remove old folder and its obsolete contents

UbitUmarov [2024-04-20 17:48:02]
remove old folder and its obsolete contents
Filename
old/libsl1550-patches/README.txt
old/libsl1550-patches/Update_packets_.cs-set-tickcount-public.patch
old/libsl1550-patches/Update_packets_.cs-to-latest-and-add-DataBlockEstended.patch
old/libsl1550-patches/change-asset-type-Primitive-enum-to-Object.patch
old/libsl1550-patches/change-asset-type-Primitive-enum-to-Object.patch.README
old/libsl1550-patches/disable-_Packet_.cs-generation-to-work-around-mapgenerator-bug.patch
old/libsl1550-patches/disable-_Packet_.cs-generation-to-work-around-mapgenerator-bug.txt
old/libsl1550-patches/mjm_quaternion_getbytes_patch.diff
old/libsl1550/LICENSE.txt
old/libsl1550/README.txt
old/libsl1550/SLImageUpload/Properties/AssemblyInfo.cs
old/libsl1550/SLImageUpload/Properties/Resources.Designer.cs
old/libsl1550/SLImageUpload/Properties/Resources.resx
old/libsl1550/SLImageUpload/Properties/Settings.Designer.cs
old/libsl1550/SLImageUpload/Properties/Settings.settings
old/libsl1550/SLImageUpload/SLImageUpload.cs
old/libsl1550/SLImageUpload/SLImageUpload.csproj
old/libsl1550/SLImageUpload/frmSLImageUpload.Designer.cs
old/libsl1550/SLImageUpload/frmSLImageUpload.cs
old/libsl1550/SLImageUpload/frmSLImageUpload.resx
old/libsl1550/SLProxy/Analyst.cs
old/libsl1550/SLProxy/ChatConsole.cs
old/libsl1550/SLProxy/ChatConsole.csproj
old/libsl1550/SLProxy/MacProxy/Launcher/Controller.h
old/libsl1550/SLProxy/MacProxy/Launcher/Controller.m
old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/InfoPlist.strings
old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/classes.nib
old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/info.nib
old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/keyedobjects.nib
old/libsl1550/SLProxy/MacProxy/Launcher/Info.plist
old/libsl1550/SLProxy/MacProxy/Launcher/Launcher.xcodeproj/project.pbxproj
old/libsl1550/SLProxy/MacProxy/Launcher/Launcher_Prefix.pch
old/libsl1550/SLProxy/MacProxy/Launcher/SLProxy.h
old/libsl1550/SLProxy/MacProxy/Launcher/SLProxy.m
old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Info.plist
old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/MacOS/Launcher
old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/PkgInfo
old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/InfoPlist.strings
old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/info.nib
old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/libsl.icns
old/libsl1550/SLProxy/MacProxy/Launcher/libsl.icns
old/libsl1550/SLProxy/MacProxy/Launcher/main.m
old/libsl1550/SLProxy/MacProxy/README.txt
old/libsl1550/SLProxy/MacProxy/build.pl
old/libsl1550/SLProxy/README.txt
old/libsl1550/SLProxy/SLProxy.build
old/libsl1550/SLProxy/SLProxy.cs
old/libsl1550/SLProxy/SLProxy.csproj
old/libsl1550/SLProxy/SLProxyLoader.cs
old/libsl1550/SLProxy/SLProxyMain.cs
old/libsl1550/SLProxy/XmlRpcCS/Logger.cs
old/libsl1550/SLProxy/XmlRpcCS/SimpleHttpRequest.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcBoxcarRequest.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcClientProxy.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcDeserializer.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcErrorCodes.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcException.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcExposedAttribute.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequest.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequestDeserializer.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequestSerializer.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponder.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponse.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponseDeserializer.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponseSerializer.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcSerializer.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcServer.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcSystemObject.cs
old/libsl1550/SLProxy/XmlRpcCS/XmlRpcXmlTokens.cs
old/libsl1550/SecondGlance/Properties/AssemblyInfo.cs
old/libsl1550/SecondGlance/Properties/Resources.Designer.cs
old/libsl1550/SecondGlance/Properties/Resources.resx
old/libsl1550/SecondGlance/Properties/Settings.Designer.cs
old/libsl1550/SecondGlance/Properties/Settings.settings
old/libsl1550/SecondGlance/SecondGlance.cs
old/libsl1550/SecondGlance/SecondGlance.csproj
old/libsl1550/SecondGlance/frmSecondGlance.Designer.cs
old/libsl1550/SecondGlance/frmSecondGlance.cs
old/libsl1550/SecondGlance/frmSecondGlance.resx
old/libsl1550/VoiceTest/VoiceTest.cs
old/libsl1550/VoiceTest/VoiceTest.csproj
old/libsl1550/bin/CookComputing.XmlRpc.CF.dll
old/libsl1550/bin/CookComputing.XmlRpcV2.dll
old/libsl1550/bin/libsecondlife.dll.config
old/libsl1550/bin/openjpeg-libsl.dll
old/libsl1550/libsecondlife.build
old/libsl1550/libsecondlife/AgentManager.cs
old/libsl1550/libsecondlife/AgentManagerCamera.cs
old/libsl1550/libsecondlife/AgentManagerMovement.cs
old/libsl1550/libsecondlife/AgentThrottle.cs
old/libsl1550/libsecondlife/Animations.cs
old/libsl1550/libsecondlife/AppearanceManager.cs
old/libsl1550/libsecondlife/AssemblyInfo.cs
old/libsl1550/libsecondlife/AssetManager.cs
old/libsl1550/libsecondlife/AssetSystem/AppearanceManager.cs
old/libsl1550/libsecondlife/AssetSystem/Asset.cs
old/libsl1550/libsecondlife/AssetSystem/AssetImage.cs
old/libsl1550/libsecondlife/AssetSystem/AssetLandmark.cs
old/libsl1550/libsecondlife/AssetSystem/AssetManager.cs
old/libsl1550/libsecondlife/AssetSystem/AssetNotecard.cs
old/libsl1550/libsecondlife/AssetSystem/AssetPacketHelpers.cs
old/libsl1550/libsecondlife/AssetSystem/AssetRequest.cs
old/libsl1550/libsecondlife/AssetSystem/AssetRequestUpload.cs
old/libsl1550/libsecondlife/AssetSystem/AssetScript.cs
old/libsl1550/libsecondlife/AssetSystem/AssetWearable.cs
old/libsl1550/libsecondlife/AssetSystem/AssetWearable_Body.cs
old/libsl1550/libsecondlife/AssetSystem/AssetWearable_Clothing.cs
old/libsl1550/libsecondlife/AssetSystem/BodyPart_Deprecated.cs
old/libsl1550/libsecondlife/AssetSystem/ImageManager.cs
old/libsl1550/libsecondlife/AssetSystem/ImagePacketHelpers.cs
old/libsl1550/libsecondlife/AssetTypes.cs
old/libsl1550/libsecondlife/Avatar.cs
old/libsl1550/libsecondlife/AvatarManager.cs
old/libsl1550/libsecondlife/BakeLayer.cs
old/libsl1550/libsecondlife/BitPack.cs
old/libsl1550/libsecondlife/BlockingQueue.cs
old/libsl1550/libsecondlife/Capabilities/CapsBase.cs
old/libsl1550/libsecondlife/Capabilities/CapsClient.cs
old/libsl1550/libsecondlife/Capabilities/CapsListener.cs
old/libsl1550/libsecondlife/Capabilities/EventQueueClient.cs
old/libsl1550/libsecondlife/Capabilities/EventQueueListener.cs
old/libsl1550/libsecondlife/Caps.cs
old/libsl1550/libsecondlife/CapsToPacket.cs
old/libsl1550/libsecondlife/CoordinateFrame.cs
old/libsl1550/libsecondlife/DirectoryManager.cs
old/libsl1550/libsecondlife/EstateTools.cs
old/libsl1550/libsecondlife/EventDictionary.cs
old/libsl1550/libsecondlife/FriendsManager.cs
old/libsl1550/libsecondlife/GridManager.cs
old/libsl1550/libsecondlife/GroupManager.cs
old/libsl1550/libsecondlife/Helpers.cs
old/libsl1550/libsecondlife/Image.cs
old/libsl1550/libsecondlife/Inventory.cs
old/libsl1550/libsecondlife/InventoryManager.cs
old/libsl1550/libsecondlife/InventoryNode.cs
old/libsl1550/libsecondlife/InventoryNodeDictionary.cs
old/libsl1550/libsecondlife/InventorySystem/DownloadRequest_Folder.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryBase.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryFolder.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryImage.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryItem.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryLandmark.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryManager.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryNotecard.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryPacketHelper.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryScript.cs
old/libsl1550/libsecondlife/InventorySystem/InventoryWearable.cs
old/libsl1550/libsecondlife/LLObject.cs
old/libsl1550/libsecondlife/LLSD/BinaryLLSD.cs
old/libsl1550/libsecondlife/LLSD/LLSD.cs
old/libsl1550/libsecondlife/LLSD/NotationLLSD.cs
old/libsl1550/libsecondlife/LLSD/XmlLLSD.cs
old/libsl1550/libsecondlife/LLSD/xml-llsd.dtd
old/libsl1550/libsecondlife/LLSD/xml-llsd.xsd
old/libsl1550/libsecondlife/Login.cs
old/libsl1550/libsecondlife/NameValue.cs
old/libsl1550/libsecondlife/NetworkManager.cs
old/libsl1550/libsecondlife/ObjectManager.cs
old/libsl1550/libsecondlife/ObjectPoolBase.cs
old/libsl1550/libsecondlife/ObjectTracker.cs
old/libsl1550/libsecondlife/OpenJPEG.cs
old/libsl1550/libsecondlife/ParcelManager.cs
old/libsl1550/libsecondlife/ParticleSystem.cs
old/libsl1550/libsecondlife/Permissions.cs
old/libsl1550/libsecondlife/Prims.cs
old/libsl1550/libsecondlife/ProtocolManager.cs
old/libsl1550/libsecondlife/ReaderWriterLock.cs
old/libsl1550/libsecondlife/Resources/avatar_lad.xml
old/libsl1550/libsecondlife/Resources/blush_alpha.tga
old/libsl1550/libsecondlife/Resources/body_skingrain.tga
old/libsl1550/libsecondlife/Resources/bodyfreckles_alpha.tga
old/libsl1550/libsecondlife/Resources/bump_face_wrinkles.tga
old/libsl1550/libsecondlife/Resources/bump_head_base.tga
old/libsl1550/libsecondlife/Resources/bump_lowerbody_base.tga
old/libsl1550/libsecondlife/Resources/bump_pants_wrinkles.tga
old/libsl1550/libsecondlife/Resources/bump_shirt_wrinkles.tga
old/libsl1550/libsecondlife/Resources/bump_upperbody_base.tga
old/libsl1550/libsecondlife/Resources/eyebrows_alpha.tga
old/libsl1550/libsecondlife/Resources/eyeliner_alpha.tga
old/libsl1550/libsecondlife/Resources/eyeshadow_inner_alpha.tga
old/libsl1550/libsecondlife/Resources/eyeshadow_outer_alpha.tga
old/libsl1550/libsecondlife/Resources/eyewhite.tga
old/libsl1550/libsecondlife/Resources/facehair_chincurtains_alpha.tga
old/libsl1550/libsecondlife/Resources/facehair_moustache_alpha.tga
old/libsl1550/libsecondlife/Resources/facehair_sideburns_alpha.tga
old/libsl1550/libsecondlife/Resources/facehair_soulpatch_alpha.tga
old/libsl1550/libsecondlife/Resources/freckles_alpha.tga
old/libsl1550/libsecondlife/Resources/glove_length_alpha.tga
old/libsl1550/libsecondlife/Resources/gloves_fingers_alpha.tga
old/libsl1550/libsecondlife/Resources/head_alpha.tga
old/libsl1550/libsecondlife/Resources/head_color.tga
old/libsl1550/libsecondlife/Resources/head_hair.tga
old/libsl1550/libsecondlife/Resources/head_highlights_alpha.tga
old/libsl1550/libsecondlife/Resources/head_shading_alpha.tga
old/libsl1550/libsecondlife/Resources/head_skingrain.tga
old/libsl1550/libsecondlife/Resources/jacket_length_lower_alpha.tga
old/libsl1550/libsecondlife/Resources/jacket_length_upper_alpha.tga
old/libsl1550/libsecondlife/Resources/jacket_open_lower_alpha.tga
old/libsl1550/libsecondlife/Resources/jacket_open_upper_alpha.tga
old/libsl1550/libsecondlife/Resources/lipgloss_alpha.tga
old/libsl1550/libsecondlife/Resources/lips_mask.tga
old/libsl1550/libsecondlife/Resources/lipstick_alpha.tga
old/libsl1550/libsecondlife/Resources/lowerbody_color.tga
old/libsl1550/libsecondlife/Resources/lowerbody_highlights_alpha.tga
old/libsl1550/libsecondlife/Resources/lowerbody_shading_alpha.tga
old/libsl1550/libsecondlife/Resources/nailpolish_alpha.tga
old/libsl1550/libsecondlife/Resources/pants_length_alpha.tga
old/libsl1550/libsecondlife/Resources/pants_waist_alpha.tga
old/libsl1550/libsecondlife/Resources/rosyface_alpha.tga
old/libsl1550/libsecondlife/Resources/rouge_alpha.tga
old/libsl1550/libsecondlife/Resources/shirt_bottom_alpha.tga
old/libsl1550/libsecondlife/Resources/shirt_collar_alpha.tga
old/libsl1550/libsecondlife/Resources/shirt_collar_back_alpha.tga
old/libsl1550/libsecondlife/Resources/shirt_sleeve_alpha.tga
old/libsl1550/libsecondlife/Resources/shoe_height_alpha.tga
old/libsl1550/libsecondlife/Resources/skirt_length_alpha.tga
old/libsl1550/libsecondlife/Resources/skirt_slit_back_alpha.tga
old/libsl1550/libsecondlife/Resources/skirt_slit_front_alpha.tga
old/libsl1550/libsecondlife/Resources/skirt_slit_left_alpha.tga
old/libsl1550/libsecondlife/Resources/skirt_slit_right_alpha.tga
old/libsl1550/libsecondlife/Resources/underpants_trial_female.tga
old/libsl1550/libsecondlife/Resources/underpants_trial_male.tga
old/libsl1550/libsecondlife/Resources/undershirt_trial_female.tga
old/libsl1550/libsecondlife/Resources/upperbody_color.tga
old/libsl1550/libsecondlife/Resources/upperbody_highlights_alpha.tga
old/libsl1550/libsecondlife/Resources/upperbody_shading_alpha.tga
old/libsl1550/libsecondlife/Resources/upperbodyfreckles_alpha.tga
old/libsl1550/libsecondlife/SafeDictionary.cs
old/libsl1550/libsecondlife/SecondLife.cs
old/libsl1550/libsecondlife/Settings.cs
old/libsl1550/libsecondlife/Simulator.cs
old/libsl1550/libsecondlife/SoundManager.cs
old/libsl1550/libsecondlife/TGALoader.cs
old/libsl1550/libsecondlife/TerrainManager.cs
old/libsl1550/libsecondlife/TextureEntry.cs
old/libsl1550/libsecondlife/ThreadUtil.cs
old/libsl1550/libsecondlife/Types.cs
old/libsl1550/libsecondlife/UDPBase.cs
old/libsl1550/libsecondlife/VisualParamGenerator/VisualParamGenerator.cs
old/libsl1550/libsecondlife/VisualParamGenerator/VisualParamGenerator.csproj
old/libsl1550/libsecondlife/VisualParamGenerator/template.cs
old/libsl1550/libsecondlife/_Packets_.cs
old/libsl1550/libsecondlife/_VisualParam_.cs
old/libsl1550/libsecondlife/examples/Baker/Baker.cs
old/libsl1550/libsecondlife/examples/Baker/Baker.csproj
old/libsl1550/libsecondlife/examples/Baker/Oven.cs
old/libsl1550/libsecondlife/examples/Baker/bin/Release/Baker.exe
old/libsl1550/libsecondlife/examples/Baker/bin/Release/Baker.pdb
old/libsl1550/libsecondlife/examples/Baker/bin/Release/CookComputing.XmlRpcV2.dll
old/libsl1550/libsecondlife/examples/Baker/bin/Release/libsecondlife.dll
old/libsl1550/libsecondlife/examples/Baker/frmBaker.Designer.cs
old/libsl1550/libsecondlife/examples/Baker/frmBaker.cs
old/libsl1550/libsecondlife/examples/Baker/frmBaker.resx
old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/BodyPartMorphGenerator.csproj
old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/Properties/AssemblyInfo.cs
old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/genbodyparams.cs
old/libsl1550/libsecondlife/examples/GUITestClient/GUITestClient.cs
old/libsl1550/libsecondlife/examples/GUITestClient/GUITestClient.csproj
old/libsl1550/libsecondlife/examples/GUITestClient/Interface.cs
old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/HeightmapInterface.cs
old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/MinimapInterface.cs
old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/TeleportInterface.cs
old/libsl1550/libsecondlife/examples/GUITestClient/Properties/AssemblyInfo.cs
old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Resources.Designer.cs
old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Resources.resx
old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Settings.Designer.cs
old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Settings.settings
old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.Designer.cs
old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.cs
old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.resx
old/libsl1550/libsecondlife/examples/GUITestClient/obj/GUITestClient.csproj.FileList.txt
old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.Properties.Resources.resources
old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.csproj.GenerateResource.Cache
old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.exe
old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.pdb
old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/TempPE/Properties.Resources.Designer.cs.dll
old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/libsecondlife.GUITestClient.frmTestClient.resources
old/libsl1550/libsecondlife/examples/Heightmap/Heightmap.cs
old/libsl1550/libsecondlife/examples/Heightmap/Heightmap.csproj
old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.Designer.cs
old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.cs
old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.resx
old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/CookComputing.XmlRpcV2.dll
old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/key2name.exe
old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.Utilities.dll
old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.Utilities.pdb
old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.dll
old/libsl1550/libsecondlife/examples/Key2Name/key2name.cs
old/libsl1550/libsecondlife/examples/Key2Name/key2name.csproj
old/libsl1550/libsecondlife/examples/TestClient/Arguments.cs
old/libsl1550/libsecondlife/examples/TestClient/ClientManager.cs
old/libsl1550/libsecondlife/examples/TestClient/Command.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/AppearanceCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/AttachmentsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/CloneCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/WearCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/CloneProfileCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/EchoMasterCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/IMCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/SayCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/ShoutCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/TtsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/WhisperCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/DetectBotCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Friends/FriendsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/GoHome.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/GotoLandmark.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Groups/GroupsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/BackupCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/BalanceCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/DeleteFolderCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/DumpOutfitCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ExportOutfitCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/GiveAllCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ImportOutfitCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/InventoryCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ObjectInventoryCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/AgentLocationsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/FindSimCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/GridLayerCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/GridMapCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/ParcelInfoCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/CrouchCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/FlyCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/FollowCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/GotoCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/JumpCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/LocationCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/MoveToCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SetHome.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SitCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SitOnCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/StandCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ChangePermsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ExportCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ExportParticlesCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/FindObjectsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/FindTextureCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ImportCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimCountCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimInfoCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimRegexCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/DilationCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/RegionInfoCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/StatsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/UptimeCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/DebugCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/HelpCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LoadCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LoginCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LogoutCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/MD5Command.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/PacketLogCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/QuitCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/SetMasterCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/SetMasterKeyCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/System/ShowEffectsCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/TouchCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/TreeCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Commands/WhoCommand.cs
old/libsl1550/libsecondlife/examples/TestClient/Parsing.cs
old/libsl1550/libsecondlife/examples/TestClient/Program.cs
old/libsl1550/libsecondlife/examples/TestClient/Properties/AssemblyInfo.cs
old/libsl1550/libsecondlife/examples/TestClient/TestClient.build
old/libsl1550/libsecondlife/examples/TestClient/TestClient.cs
old/libsl1550/libsecondlife/examples/TestClient/TestClient.csproj
old/libsl1550/libsecondlife/examples/examples.build
old/libsl1550/libsecondlife/examples/groupmanager/App.ico
old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/groupmanager.exe
old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/libsecondlife.Utilities.dll
old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/libsecondlife.Utilities.pdb
old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.Designer.cs
old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.cs
old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.resx
old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.Designer.cs
old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.cs
old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.resx
old/libsl1550/libsecondlife/examples/groupmanager/groupmanager.csproj
old/libsl1550/libsecondlife/examples/name2key/bin/Release/CookComputing.XmlRpcV2.dll
old/libsl1550/libsecondlife/examples/name2key/bin/Release/libsecondlife.dll
old/libsl1550/libsecondlife/examples/name2key/bin/Release/name2key.exe
old/libsl1550/libsecondlife/examples/name2key/name2key.cs
old/libsl1550/libsecondlife/examples/name2key/name2key.csproj
old/libsl1550/libsecondlife/examples/slaccountant/App.ico
old/libsl1550/libsecondlife/examples/slaccountant/AssemblyInfo.cs
old/libsl1550/libsecondlife/examples/slaccountant/frmSLAccountant.cs
old/libsl1550/libsecondlife/examples/slaccountant/frmSLAccountant.resx
old/libsl1550/libsecondlife/examples/slaccountant/slaccountant.csproj
old/libsl1550/libsecondlife/examples/sldump/sldump.cs
old/libsl1550/libsecondlife/examples/sldump/sldump.csproj
old/libsl1550/libsecondlife/libsecondlife.Tests/NetworkTests.cs
old/libsl1550/libsecondlife/libsecondlife.Tests/PacketTests.cs
old/libsl1550/libsecondlife/libsecondlife.Tests/PrimObjectTests.cs
old/libsl1550/libsecondlife/libsecondlife.Tests/TypeTests.cs
old/libsl1550/libsecondlife/libsecondlife.Tests/XmlLLSDTests.cs
old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.csproj
old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.mdp
old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.sln
old/libsl1550/libsecondlife/libsecondlife.Utilities/Properties/AssemblyInfo.cs
old/libsl1550/libsecondlife/libsecondlife.Utilities/RegistrationApi.cs
old/libsl1550/libsecondlife/libsecondlife.Utilities/TCPPipe.cs
old/libsl1550/libsecondlife/libsecondlife.Utilities/Utilities.cs
old/libsl1550/libsecondlife/libsecondlife.Utilities/VoiceManager.cs
old/libsl1550/libsecondlife/libsecondlife.Utilities/VoiceManagerBlocking.cs
old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/CookComputing.XmlRpcV2.dll
old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.Utilities.dll
old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.Utilities.pdb
old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.dll
old/libsl1550/libsecondlife/libsecondlife.Utilities/libsecondlife.Utilities.csproj
old/libsl1550/libsecondlife/libsecondlife.Utilities/libsecondlife.Utilities.mdp
old/libsl1550/libsecondlife/libsecondlife.build
old/libsl1550/libsecondlife/libsecondlife.csproj
old/libsl1550/libsecondlife/libsecondlife.sln
old/libsl1550/libsecondlife/libsecondlife.suo
old/libsl1550/libsecondlife/mapgenerator/Properties/AssemblyInfo.cs
old/libsl1550/libsecondlife/mapgenerator/ProtocolManager.cs
old/libsl1550/libsecondlife/mapgenerator/mapgenerator.cs
old/libsl1550/libsecondlife/mapgenerator/mapgenerator.csproj
old/libsl1550/libsecondlife/mapgenerator/mapgenerator.sln
old/libsl1550/libsecondlife/mapgenerator/template.cs
old/libsl1550/libsecondlife/mapgenerator/unusedpackets.txt
old/libsl1550/mapgen.bat
old/libsl1550/openjpeg-libsl/DllOpenJPEG.sln
old/libsl1550/openjpeg-libsl/DllOpenJPEG.vcproj
old/libsl1550/openjpeg-libsl/Makefile
old/libsl1550/openjpeg-libsl/Makefile.osx
old/libsl1550/openjpeg-libsl/OpenJPEG.rc
old/libsl1550/openjpeg-libsl/README.msvc
old/libsl1550/openjpeg-libsl/Resource.h
old/libsl1550/openjpeg-libsl/libopenjpeg/bio.c
old/libsl1550/openjpeg-libsl/libopenjpeg/bio.h
old/libsl1550/openjpeg-libsl/libopenjpeg/cio.c
old/libsl1550/openjpeg-libsl/libopenjpeg/cio.h
old/libsl1550/openjpeg-libsl/libopenjpeg/dwt.c
old/libsl1550/openjpeg-libsl/libopenjpeg/dwt.h
old/libsl1550/openjpeg-libsl/libopenjpeg/event.c
old/libsl1550/openjpeg-libsl/libopenjpeg/event.h
old/libsl1550/openjpeg-libsl/libopenjpeg/fix.h
old/libsl1550/openjpeg-libsl/libopenjpeg/image.c
old/libsl1550/openjpeg-libsl/libopenjpeg/image.h
old/libsl1550/openjpeg-libsl/libopenjpeg/int.h
old/libsl1550/openjpeg-libsl/libopenjpeg/j2k.c
old/libsl1550/openjpeg-libsl/libopenjpeg/j2k.h
old/libsl1550/openjpeg-libsl/libopenjpeg/j2k_lib.c
old/libsl1550/openjpeg-libsl/libopenjpeg/j2k_lib.h
old/libsl1550/openjpeg-libsl/libopenjpeg/jp2.c
old/libsl1550/openjpeg-libsl/libopenjpeg/jp2.h
old/libsl1550/openjpeg-libsl/libopenjpeg/jpt.c
old/libsl1550/openjpeg-libsl/libopenjpeg/jpt.h
old/libsl1550/openjpeg-libsl/libopenjpeg/mct.c
old/libsl1550/openjpeg-libsl/libopenjpeg/mct.h
old/libsl1550/openjpeg-libsl/libopenjpeg/mqc.c
old/libsl1550/openjpeg-libsl/libopenjpeg/mqc.h
old/libsl1550/openjpeg-libsl/libopenjpeg/openjpeg.c
old/libsl1550/openjpeg-libsl/libopenjpeg/openjpeg.h
old/libsl1550/openjpeg-libsl/libopenjpeg/opj_includes.h
old/libsl1550/openjpeg-libsl/libopenjpeg/pi.c
old/libsl1550/openjpeg-libsl/libopenjpeg/pi.h
old/libsl1550/openjpeg-libsl/libopenjpeg/raw.c
old/libsl1550/openjpeg-libsl/libopenjpeg/raw.h
old/libsl1550/openjpeg-libsl/libopenjpeg/t1.c
old/libsl1550/openjpeg-libsl/libopenjpeg/t1.h
old/libsl1550/openjpeg-libsl/libopenjpeg/t1_generate_luts.c
old/libsl1550/openjpeg-libsl/libopenjpeg/t1_luts.h
old/libsl1550/openjpeg-libsl/libopenjpeg/t2.c
old/libsl1550/openjpeg-libsl/libopenjpeg/t2.h
old/libsl1550/openjpeg-libsl/libopenjpeg/tcd.c
old/libsl1550/openjpeg-libsl/libopenjpeg/tcd.h
old/libsl1550/openjpeg-libsl/libopenjpeg/tgt.c
old/libsl1550/openjpeg-libsl/libopenjpeg/tgt.h
old/libsl1550/openjpeg-libsl/libsl/libsl.cpp
old/libsl1550/openjpeg-libsl/libsl/libsl.h
old/libsl1550/openjpeg-libsl/license.txt
old/nhibernate-1.2.1-patches/Makefile
old/nhibernate-1.2.1-patches/sqlite-driver-mono-1.2.x.patch
trunk/managed/MonoCecil/README.md
diff --git a/old/libsl1550-patches/README.txt b/old/libsl1550-patches/README.txt
deleted file mode 100644
index c373d0d..0000000
--- a/old/libsl1550-patches/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-README
-
-This directory contains patches that OpenSim has applied against libsl r1550.  It is probably not complete
diff --git a/old/libsl1550-patches/Update_packets_.cs-set-tickcount-public.patch b/old/libsl1550-patches/Update_packets_.cs-set-tickcount-public.patch
deleted file mode 100644
index a3c7003..0000000
--- a/old/libsl1550-patches/Update_packets_.cs-set-tickcount-public.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: libsl1550/libsecondlife/_Packets_.cs
-===================================================================
---- libsl1550/libsecondlife/_Packets_.cs	(revision 33)
-+++ libsl1550/libsecondlife/_Packets_.cs	(working copy)
-@@ -782,7 +782,7 @@
-         public abstract void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);
-         public abstract void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);
-         public int ResendCount;
--        internal int TickCount;
-+        public int TickCount;
-
-         public abstract byte[] ToBytes();
-         public static PacketType GetType(ushort id, PacketFrequency frequency)
diff --git a/old/libsl1550-patches/Update_packets_.cs-to-latest-and-add-DataBlockEstended.patch b/old/libsl1550-patches/Update_packets_.cs-to-latest-and-add-DataBlockEstended.patch
deleted file mode 100644
index aa41051..0000000
--- a/old/libsl1550-patches/Update_packets_.cs-to-latest-and-add-DataBlockEstended.patch
+++ /dev/null
@@ -1,871 +0,0 @@
-Index: libsl1550/libsecondlife/_Packets_.cs
-===================================================================
---- libsl1550/libsecondlife/_Packets_.cs	(revision 32)
-+++ libsl1550/libsecondlife/_Packets_.cs	(working copy)
-@@ -97,10 +97,11 @@
-         public uint Sequence
-         {
-             get { return (uint)((Data[1] << 24) + (Data[2] << 16) + (Data[3] << 8) + Data[4]); }
--            set {
--			Data[1] = (byte)(value >> 24); Data[2] = (byte)(value >> 16);
--			Data[3] = (byte)(value >> 8);  Data[4] = (byte)(value % 256);
--		}
-+            set
-+            {
-+			    Data[1] = (byte)(value >> 24); Data[2] = (byte)(value >> 16);
-+			    Data[3] = (byte)(value >> 8);  Data[4] = (byte)(value % 256);
-+		    }
-         }
-         /// <summary>Numeric ID number of this packet</summary>
-         public abstract ushort ID { get; set; }
-@@ -727,6 +728,7 @@
-         LandStatRequest = 65957,
-         LandStatReply = 65958,
-         Error = 65959,
-+        ObjectIncludeInSearch = 65960,
-         PacketAck = 131067,
-         OpenCircuit = 131068,
-         CloseCircuit = 131069,
-@@ -779,7 +781,8 @@
-         public abstract PacketType Type { get; }
-         public abstract void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);
-         public abstract void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);
--        public int TickCount;
-+        public int ResendCount;
-+        internal int TickCount;
-
-         public abstract byte[] ToBytes();
-         public static PacketType GetType(ushort id, PacketFrequency frequency)
-@@ -1135,6 +1138,7 @@
-                         case 421: return PacketType.LandStatRequest;
-                         case 422: return PacketType.LandStatReply;
-                         case 423: return PacketType.Error;
-+                        case 424: return PacketType.ObjectIncludeInSearch;
-                         case 65531: return PacketType.PacketAck;
-                         case 65532: return PacketType.OpenCircuit;
-                         case 65533: return PacketType.CloseCircuit;
-@@ -1585,6 +1589,7 @@
-             if(type == PacketType.LandStatRequest) return new LandStatRequestPacket();
-             if(type == PacketType.LandStatReply) return new LandStatReplyPacket();
-             if(type == PacketType.Error) return new ErrorPacket();
-+            if(type == PacketType.ObjectIncludeInSearch) return new ObjectIncludeInSearchPacket();
-             if(type == PacketType.PacketAck) return new PacketAckPacket();
-             if(type == PacketType.OpenCircuit) return new OpenCircuitPacket();
-             if(type == PacketType.CloseCircuit) return new CloseCircuitPacket();
-@@ -1960,6 +1965,7 @@
-                         case 421: return new LandStatRequestPacket(header, bytes, ref i);
-                         case 422: return new LandStatReplyPacket(header, bytes, ref i);
-                         case 423: return new ErrorPacket(header, bytes, ref i);
-+                        case 424: return new ObjectIncludeInSearchPacket(header, bytes, ref i);
-                         case 65531: return new PacketAckPacket(header, bytes, ref i);
-                         case 65532: return new OpenCircuitPacket(header, bytes, ref i);
-                         case 65533: return new CloseCircuitPacket(header, bytes, ref i);
-@@ -29150,11 +29156,57 @@
-             }
-         }
-
-+        /// <exclude/>
-+        public class NewGroupDataBlock
-+        {
-+            public bool ListInProfile;
-+
-+            public int Length
-+            {
-+                get
-+                {
-+                    return 1;
-+                }
-+            }
-+
-+            public NewGroupDataBlock() { }
-+            public NewGroupDataBlock(byte[] bytes, ref int i)
-+            {
-+                FromBytes(bytes, ref i);
-+            }
-+
-+            public void FromBytes(byte[] bytes, ref int i)
-+            {
-+                try
-+                {
-+                    ListInProfile = (bytes[i++] != 0) ? (bool)true : (bool)false;
-+                }
-+                catch (Exception)
-+                {
-+                    throw new MalformedDataException();
-+                }
-+            }
-+
-+            public void ToBytes(byte[] bytes, ref int i)
-+            {
-+                bytes[i++] = (byte)((ListInProfile) ? 1 : 0);
-+            }
-+
-+            public override string ToString()
-+            {
-+                StringBuilder output = new StringBuilder();
-+                output.AppendLine("-- NewGroupData --");
-+                output.Append(String.Format("ListInProfile: {0}", ListInProfile));
-+                return output.ToString();
-+            }
-+        }
-+
-         private Header header;
-         public override Header Header { get { return header; } set { header = value; } }
-         public override PacketType Type { get { return PacketType.AvatarGroupsReply; } }
-         public AgentDataBlock AgentData;
-         public GroupDataBlock[] GroupData;
-+        public NewGroupDataBlock NewGroupData;
-
-         public AvatarGroupsReplyPacket()
-         {
-@@ -29163,6 +29215,7 @@
-             Header.Reliable = true;
-             AgentData = new AgentDataBlock();
-             GroupData = new GroupDataBlock[0];
-+            NewGroupData = new NewGroupDataBlock();
-         }
-
-         public AvatarGroupsReplyPacket(byte[] bytes, ref int i) : this()
-@@ -29187,6 +29240,7 @@
-             }
-             for (int j = 0; j < count; j++)
-             { GroupData[j].FromBytes(bytes, ref i); }
-+            NewGroupData.FromBytes(bytes, ref i);
-         }
-
-         public AvatarGroupsReplyPacket(Header head, byte[] bytes, ref int i): this()
-@@ -29211,12 +29265,13 @@
-             }
-             for (int j = 0; j < count; j++)
-             { GroupData[j].FromBytes(bytes, ref i); }
-+            NewGroupData.FromBytes(bytes, ref i);
-         }
-
-         public override byte[] ToBytes()
-         {
-             int length = 10;
--            length += AgentData.Length;;
-+            length += AgentData.Length;            length += NewGroupData.Length;;
-             length++;
-             for (int j = 0; j < GroupData.Length; j++) { length += GroupData[j].Length; }
-             if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-@@ -29226,6 +29281,7 @@
-             AgentData.ToBytes(bytes, ref i);
-             bytes[i++] = (byte)GroupData.Length;
-             for (int j = 0; j < GroupData.Length; j++) { GroupData[j].ToBytes(bytes, ref i); }
-+            NewGroupData.ToBytes(bytes, ref i);
-             if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-             return bytes;
-         }
-@@ -29238,6 +29294,7 @@
-             {
-                 output += GroupData[j].ToString() + Environment.NewLine;
-             }
-+                output += NewGroupData.ToString() + Environment.NewLine;
-             return output;
-         }
-
-@@ -63294,11 +63351,57 @@
-             }
-         }
-
-+        /// <exclude/>
-+        public class NewDataBlock
-+        {
-+            public bool ListInProfile;
-+
-+            public int Length
-+            {
-+                get
-+                {
-+                    return 1;
-+                }
-+            }
-+
-+            public NewDataBlock() { }
-+            public NewDataBlock(byte[] bytes, ref int i)
-+            {
-+                FromBytes(bytes, ref i);
-+            }
-+
-+            public void FromBytes(byte[] bytes, ref int i)
-+            {
-+                try
-+                {
-+                    ListInProfile = (bytes[i++] != 0) ? (bool)true : (bool)false;
-+                }
-+                catch (Exception)
-+                {
-+                    throw new MalformedDataException();
-+                }
-+            }
-+
-+            public void ToBytes(byte[] bytes, ref int i)
-+            {
-+                bytes[i++] = (byte)((ListInProfile) ? 1 : 0);
-+            }
-+
-+            public override string ToString()
-+            {
-+                StringBuilder output = new StringBuilder();
-+                output.AppendLine("-- NewData --");
-+                output.Append(String.Format("ListInProfile: {0}", ListInProfile));
-+                return output.ToString();
-+            }
-+        }
-+
-         private Header header;
-         public override Header Header { get { return header; } set { header = value; } }
-         public override PacketType Type { get { return PacketType.SetGroupAcceptNotices; } }
-         public AgentDataBlock AgentData;
-         public DataBlock Data;
-+        public NewDataBlock NewData;
-
-         public SetGroupAcceptNoticesPacket()
-         {
-@@ -63307,6 +63410,7 @@
-             Header.Reliable = true;
-             AgentData = new AgentDataBlock();
-             Data = new DataBlock();
-+            NewData = new NewDataBlock();
-         }
-
-         public SetGroupAcceptNoticesPacket(byte[] bytes, ref int i) : this()
-@@ -63325,6 +63429,7 @@
-             }
-             AgentData.FromBytes(bytes, ref i);
-             Data.FromBytes(bytes, ref i);
-+            NewData.FromBytes(bytes, ref i);
-         }
-
-         public SetGroupAcceptNoticesPacket(Header head, byte[] bytes, ref int i): this()
-@@ -63343,18 +63448,20 @@
-             }
-             AgentData.FromBytes(bytes, ref i);
-             Data.FromBytes(bytes, ref i);
-+            NewData.FromBytes(bytes, ref i);
-         }
-
-         public override byte[] ToBytes()
-         {
-             int length = 10;
--            length += AgentData.Length;            length += Data.Length;;
-+            length += AgentData.Length;            length += Data.Length;            length += NewData.Length;;
-             if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-             byte[] bytes = new byte[length];
-             int i = 0;
-             header.ToBytes(bytes, ref i);
-             AgentData.ToBytes(bytes, ref i);
-             Data.ToBytes(bytes, ref i);
-+            NewData.ToBytes(bytes, ref i);
-             if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-             return bytes;
-         }
-@@ -63364,6 +63471,7 @@
-             string output = "--- SetGroupAcceptNotices ---" + Environment.NewLine;
-                 output += AgentData.ToString() + Environment.NewLine;
-                 output += Data.ToString() + Environment.NewLine;
-+                output += NewData.ToString() + Environment.NewLine;
-             return output;
-         }
-
-@@ -71238,11 +71346,125 @@
-                 return output.ToString();
-             }
-         }
-+        /// <exclude/>
-+        public class DataBlockExtendedBlock
-+        {
-+            private byte[] _mediatype;
-+            public byte[] MediaType
-+            {
-+                get { return _mediatype; }
-+                set
-+                {
-+                    if (value == null) { _mediatype = null; return; }
-+                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-+                    else { _mediatype = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediatype, 0, value.Length); }
-+                }
-+            }
-
-+            private byte[] _mediadesc;
-+            public byte[] MediaDesc
-+            {
-+                get { return _mediadesc; }
-+                set
-+                {
-+                    if (value == null) { _mediadesc = null; return; }
-+                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-+                    else { _mediadesc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediadesc, 0, value.Length); }
-+                }
-+            }
-+
-+            public int MediaWidth;
-+            public int MediaHeight;
-+            public byte MediaLoop;
-+
-+
-+
-+            public int Length
-+            {
-+                get
-+                {
-+                    int length = 17;
-+                    if (MediaType != null) { length += 1 + MediaType.Length; }
-+                    if (MediaDesc != null) { length += 1 + MediaDesc.Length; }
-+
-+                    return length;
-+                }
-+            }
-+
-+            public DataBlockExtendedBlock() { }
-+            public DataBlockExtendedBlock(byte[] bytes, ref int i)
-+            {
-+                FromBytes(bytes, ref i);
-+            }
-+
-+            public void FromBytes(byte[] bytes, ref int i)
-+            {
-+                int length;
-+                try
-+                {
-+                    length = (ushort)bytes[i++];
-+                    _mediatype = new byte[length];
-+                    Buffer.BlockCopy(bytes, i, _mediatype, 0, length); i += length;
-+
-+                    length = (ushort)bytes[i++];
-+                    _mediadesc = new byte[length];
-+                    Buffer.BlockCopy(bytes, i, _mediadesc, 0, length); i += length;
-+
-+                    MediaWidth = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-+
-+                    MediaHeight = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-+
-+                    MediaLoop = (byte)bytes[i++];
-+               }
-+                catch (Exception)
-+                {
-+                    throw new MalformedDataException();
-+                }
-+            }
-+
-+            public void ToBytes(byte[] bytes, ref int i)
-+            {
-+                if (MediaType == null) { Console.WriteLine("Warning: MediaType is null, in " + this.GetType()); }
-+                bytes[i++] = (byte)MediaType.Length;
-+                Buffer.BlockCopy(MediaType, 0, bytes, i, MediaType.Length); i += MediaType.Length;
-+
-+                if (MediaDesc == null) { Console.WriteLine("Warning: MediaDesc is null, in " + this.GetType()); }
-+                bytes[i++] = (byte)MediaDesc.Length;
-+                Buffer.BlockCopy(MediaDesc, 0, bytes, i, MediaDesc.Length); i += MediaDesc.Length;
-+
-+                bytes[i++] = (byte)(MediaWidth % 256);
-+                bytes[i++] = (byte)((MediaWidth >> 8) % 256);
-+                bytes[i++] = (byte)((MediaWidth >> 16) % 256);
-+                bytes[i++] = (byte)((MediaWidth >> 24) % 256);
-+
-+                bytes[i++] = (byte)(MediaHeight % 256);
-+                bytes[i++] = (byte)((MediaHeight >> 8) % 256);
-+                bytes[i++] = (byte)((MediaHeight >> 16) % 256);
-+                bytes[i++] = (byte)((MediaHeight >> 24) % 256);
-+                bytes[i++] = MediaLoop;
-+            }
-+
-+            public override string ToString()
-+            {
-+                StringBuilder output = new StringBuilder();
-+                output.AppendLine("-- DataBlockExtendedBlock --");
-+                Helpers.FieldToString(output, MediaType, "MediaType");
-+                output.Append(Environment.NewLine);
-+                Helpers.FieldToString(output, MediaDesc, "MediaDesc");
-+                output.Append(Environment.NewLine);
-+                output.AppendLine(String.Format("MediaWidth: {0}", MediaWidth));
-+                output.Append(Environment.NewLine);
-+                output.AppendLine(String.Format("MediaHeight: {0}", MediaHeight));
-+                output.Append(Environment.NewLine);
-+                output.Append(String.Format("MediaLoop: {0}", MediaLoop));
-+                return output.ToString();
-+            }
-+        }
-         private Header header;
-         public override Header Header { get { return header; } set { header = value; } }
-         public override PacketType Type { get { return PacketType.ParcelMediaUpdate; } }
-         public DataBlockBlock DataBlock;
-+        public DataBlockExtendedBlock DataExtendedBlock;
-
-         public ParcelMediaUpdatePacket()
-         {
-@@ -71250,6 +71472,7 @@
-             Header.ID = 420;
-             Header.Reliable = true;
-             DataBlock = new DataBlockBlock();
-+            DataExtendedBlock = new DataBlockExtendedBlock();
-         }
-
-         public ParcelMediaUpdatePacket(byte[] bytes, ref int i) : this()
-@@ -71267,6 +71490,7 @@
-                 bytes = zeroBuffer;
-             }
-             DataBlock.FromBytes(bytes, ref i);
-+            DataExtendedBlock.FromBytes(bytes, ref i); ;
-         }
-
-         public ParcelMediaUpdatePacket(Header head, byte[] bytes, ref int i): this()
-@@ -71284,17 +71508,19 @@
-                 bytes = zeroBuffer;
-             }
-             DataBlock.FromBytes(bytes, ref i);
-+            DataExtendedBlock.FromBytes(bytes, ref i); ;
-         }
-
-         public override byte[] ToBytes()
-         {
-             int length = 10;
--            length += DataBlock.Length;;
-+            length += DataBlock.Length; length += DataExtendedBlock.Length;
-             if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-             byte[] bytes = new byte[length];
-             int i = 0;
-             header.ToBytes(bytes, ref i);
-             DataBlock.ToBytes(bytes, ref i);
-+            DataExtendedBlock.ToBytes(bytes, ref i);
-             if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-             return bytes;
-         }
-@@ -71303,6 +71529,7 @@
-         {
-             string output = "--- ParcelMediaUpdate ---" + Environment.NewLine;
-                 output += DataBlock.ToString() + Environment.NewLine;
-+                output += DataExtendedBlock.ToString() + Environment.NewLine;
-             return output;
-         }
-
-@@ -72058,6 +72285,203 @@
-     }
-
-     /// <exclude/>
-+    public class ObjectIncludeInSearchPacket : Packet
-+    {
-+        /// <exclude/>
-+        public class AgentDataBlock
-+        {
-+            public LLUUID AgentID;
-+            public LLUUID SessionID;
-+
-+            public int Length
-+            {
-+                get
-+                {
-+                    return 32;
-+                }
-+            }
-+
-+            public AgentDataBlock() { }
-+            public AgentDataBlock(byte[] bytes, ref int i)
-+            {
-+                FromBytes(bytes, ref i);
-+            }
-+
-+            public void FromBytes(byte[] bytes, ref int i)
-+            {
-+                try
-+                {
-+                    AgentID.FromBytes(bytes, i); i += 16;
-+                    SessionID.FromBytes(bytes, i); i += 16;
-+                }
-+                catch (Exception)
-+                {
-+                    throw new MalformedDataException();
-+                }
-+            }
-+
-+            public void ToBytes(byte[] bytes, ref int i)
-+            {
-+                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-+                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-+            }
-+
-+            public override string ToString()
-+            {
-+                StringBuilder output = new StringBuilder();
-+                output.AppendLine("-- AgentData --");
-+                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-+                output.Append(String.Format("SessionID: {0}", SessionID));
-+                return output.ToString();
-+            }
-+        }
-+
-+        /// <exclude/>
-+        public class ObjectDataBlock
-+        {
-+            public uint ObjectLocalID;
-+            public bool IncludeInSearch;
-+
-+            public int Length
-+            {
-+                get
-+                {
-+                    return 5;
-+                }
-+            }
-+
-+            public ObjectDataBlock() { }
-+            public ObjectDataBlock(byte[] bytes, ref int i)
-+            {
-+                FromBytes(bytes, ref i);
-+            }
-+
-+            public void FromBytes(byte[] bytes, ref int i)
-+            {
-+                try
-+                {
-+                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-+                    IncludeInSearch = (bytes[i++] != 0) ? (bool)true : (bool)false;
-+                }
-+                catch (Exception)
-+                {
-+                    throw new MalformedDataException();
-+                }
-+            }
-+
-+            public void ToBytes(byte[] bytes, ref int i)
-+            {
-+                bytes[i++] = (byte)(ObjectLocalID % 256);
-+                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-+                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-+                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-+                bytes[i++] = (byte)((IncludeInSearch) ? 1 : 0);
-+            }
-+
-+            public override string ToString()
-+            {
-+                StringBuilder output = new StringBuilder();
-+                output.AppendLine("-- ObjectData --");
-+                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-+                output.Append(String.Format("IncludeInSearch: {0}", IncludeInSearch));
-+                return output.ToString();
-+            }
-+        }
-+
-+        private Header header;
-+        public override Header Header { get { return header; } set { header = value; } }
-+        public override PacketType Type { get { return PacketType.ObjectIncludeInSearch; } }
-+        public AgentDataBlock AgentData;
-+        public ObjectDataBlock[] ObjectData;
-+
-+        public ObjectIncludeInSearchPacket()
-+        {
-+            Header = new LowHeader();
-+            Header.ID = 424;
-+            Header.Reliable = true;
-+            AgentData = new AgentDataBlock();
-+            ObjectData = new ObjectDataBlock[0];
-+        }
-+
-+        public ObjectIncludeInSearchPacket(byte[] bytes, ref int i) : this()
-+        {
-+            int packetEnd = bytes.Length - 1;
-+            FromBytes(bytes, ref i, ref packetEnd, null);
-+        }
-+
-+        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-+        {
-+            header.FromBytes(bytes, ref i, ref packetEnd);
-+            if (header.Zerocoded && zeroBuffer != null)
-+            {
-+                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-+                bytes = zeroBuffer;
-+            }
-+            AgentData.FromBytes(bytes, ref i);
-+            int count = (int)bytes[i++];
-+            if(ObjectData.Length < count) {
-+                ObjectData = new ObjectDataBlock[count];
-+                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-+            }
-+            for (int j = 0; j < count; j++)
-+            { ObjectData[j].FromBytes(bytes, ref i); }
-+        }
-+
-+        public ObjectIncludeInSearchPacket(Header head, byte[] bytes, ref int i): this()
-+        {
-+            int packetEnd = bytes.Length - 1;
-+            FromBytes(head, bytes, ref i, ref packetEnd, null);
-+        }
-+
-+        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-+        {
-+            Header = head;
-+            if (head.Zerocoded && zeroBuffer != null)
-+            {
-+                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-+                bytes = zeroBuffer;
-+            }
-+            AgentData.FromBytes(bytes, ref i);
-+            int count = (int)bytes[i++];
-+            if(ObjectData.Length < count) {
-+                ObjectData = new ObjectDataBlock[count];
-+                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-+            }
-+            for (int j = 0; j < count; j++)
-+            { ObjectData[j].FromBytes(bytes, ref i); }
-+        }
-+
-+        public override byte[] ToBytes()
-+        {
-+            int length = 10;
-+            length += AgentData.Length;;
-+            length++;
-+            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-+            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-+            byte[] bytes = new byte[length];
-+            int i = 0;
-+            header.ToBytes(bytes, ref i);
-+            AgentData.ToBytes(bytes, ref i);
-+            bytes[i++] = (byte)ObjectData.Length;
-+            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-+            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-+            return bytes;
-+        }
-+
-+        public override string ToString()
-+        {
-+            string output = "--- ObjectIncludeInSearch ---" + Environment.NewLine;
-+                output += AgentData.ToString() + Environment.NewLine;
-+            for (int j = 0; j < ObjectData.Length; j++)
-+            {
-+                output += ObjectData[j].ToString() + Environment.NewLine;
-+            }
-+            return output;
-+        }
-+
-+    }
-+
-+    /// <exclude/>
-     public class PacketAckPacket : Packet
-     {
-         /// <exclude/>
-@@ -73580,11 +74004,57 @@
-             }
-         }
-
-+        /// <exclude/>
-+        public class AgentDataBlock
-+        {
-+            public LLUUID AgentID;
-+
-+            public int Length
-+            {
-+                get
-+                {
-+                    return 16;
-+                }
-+            }
-+
-+            public AgentDataBlock() { }
-+            public AgentDataBlock(byte[] bytes, ref int i)
-+            {
-+                FromBytes(bytes, ref i);
-+            }
-+
-+            public void FromBytes(byte[] bytes, ref int i)
-+            {
-+                try
-+                {
-+                    AgentID.FromBytes(bytes, i); i += 16;
-+                }
-+                catch (Exception)
-+                {
-+                    throw new MalformedDataException();
-+                }
-+            }
-+
-+            public void ToBytes(byte[] bytes, ref int i)
-+            {
-+                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-+            }
-+
-+            public override string ToString()
-+            {
-+                StringBuilder output = new StringBuilder();
-+                output.AppendLine("-- AgentData --");
-+                output.Append(String.Format("AgentID: {0}", AgentID));
-+                return output.ToString();
-+            }
-+        }
-+
-         private Header header;
-         public override Header Header { get { return header; } set { header = value; } }
-         public override PacketType Type { get { return PacketType.CoarseLocationUpdate; } }
-         public LocationBlock[] Location;
-         public IndexBlock Index;
-+        public AgentDataBlock[] AgentData;
-
-         public CoarseLocationUpdatePacket()
-         {
-@@ -73593,6 +74063,7 @@
-             Header.Reliable = true;
-             Location = new LocationBlock[0];
-             Index = new IndexBlock();
-+            AgentData = new AgentDataBlock[0];
-         }
-
-         public CoarseLocationUpdatePacket(byte[] bytes, ref int i) : this()
-@@ -73617,6 +74088,13 @@
-             for (int j = 0; j < count; j++)
-             { Location[j].FromBytes(bytes, ref i); }
-             Index.FromBytes(bytes, ref i);
-+            count = (int)bytes[i++];
-+            if(AgentData.Length < count) {
-+                AgentData = new AgentDataBlock[count];
-+                for(int j = 0; j < count; j++) AgentData[j] = new AgentDataBlock();
-+            }
-+            for (int j = 0; j < count; j++)
-+            { AgentData[j].FromBytes(bytes, ref i); }
-         }
-
-         public CoarseLocationUpdatePacket(Header head, byte[] bytes, ref int i): this()
-@@ -73641,6 +74119,13 @@
-             for (int j = 0; j < count; j++)
-             { Location[j].FromBytes(bytes, ref i); }
-             Index.FromBytes(bytes, ref i);
-+            count = (int)bytes[i++];
-+            if(AgentData.Length < count) {
-+                AgentData = new AgentDataBlock[count];
-+                for(int j = 0; j < count; j++) AgentData[j] = new AgentDataBlock();
-+            }
-+            for (int j = 0; j < count; j++)
-+            { AgentData[j].FromBytes(bytes, ref i); }
-         }
-
-         public override byte[] ToBytes()
-@@ -73649,6 +74134,8 @@
-             length += Index.Length;;
-             length++;
-             for (int j = 0; j < Location.Length; j++) { length += Location[j].Length; }
-+            length++;
-+            for (int j = 0; j < AgentData.Length; j++) { length += AgentData[j].Length; }
-             if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-             byte[] bytes = new byte[length];
-             int i = 0;
-@@ -73656,6 +74143,8 @@
-             bytes[i++] = (byte)Location.Length;
-             for (int j = 0; j < Location.Length; j++) { Location[j].ToBytes(bytes, ref i); }
-             Index.ToBytes(bytes, ref i);
-+            bytes[i++] = (byte)AgentData.Length;
-+            for (int j = 0; j < AgentData.Length; j++) { AgentData[j].ToBytes(bytes, ref i); }
-             if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-             return bytes;
-         }
-@@ -73668,6 +74157,10 @@
-                 output += Location[j].ToString() + Environment.NewLine;
-             }
-                 output += Index.ToString() + Environment.NewLine;
-+            for (int j = 0; j < AgentData.Length; j++)
-+            {
-+                output += AgentData[j].ToString() + Environment.NewLine;
-+            }
-             return output;
-         }
-
-@@ -80183,10 +80676,56 @@
-             }
-         }
-
-+        /// <exclude/>
-+        public class AgeVerificationBlockBlock
-+        {
-+            public bool RegionDenyAgeUnverified;
-+
-+            public int Length
-+            {
-+                get
-+                {
-+                    return 1;
-+                }
-+            }
-+
-+            public AgeVerificationBlockBlock() { }
-+            public AgeVerificationBlockBlock(byte[] bytes, ref int i)
-+            {
-+                FromBytes(bytes, ref i);
-+            }
-+
-+            public void FromBytes(byte[] bytes, ref int i)
-+            {
-+                try
-+                {
-+                    RegionDenyAgeUnverified = (bytes[i++] != 0) ? (bool)true : (bool)false;
-+                }
-+                catch (Exception)
-+                {
-+                    throw new MalformedDataException();
-+                }
-+            }
-+
-+            public void ToBytes(byte[] bytes, ref int i)
-+            {
-+                bytes[i++] = (byte)((RegionDenyAgeUnverified) ? 1 : 0);
-+            }
-+
-+            public override string ToString()
-+            {
-+                StringBuilder output = new StringBuilder();
-+                output.AppendLine("-- AgeVerificationBlock --");
-+                output.Append(String.Format("RegionDenyAgeUnverified: {0}", RegionDenyAgeUnverified));
-+                return output.ToString();
-+            }
-+        }
-+
-         private Header header;
-         public override Header Header { get { return header; } set { header = value; } }
-         public override PacketType Type { get { return PacketType.ParcelProperties; } }
-         public ParcelDataBlock ParcelData;
-+        public AgeVerificationBlockBlock AgeVerificationBlock;
-
-         public ParcelPropertiesPacket()
-         {
-@@ -80194,6 +80733,7 @@
-             Header.ID = 23;
-             Header.Reliable = true;
-             ParcelData = new ParcelDataBlock();
-+            AgeVerificationBlock = new AgeVerificationBlockBlock();
-         }
-
-         public ParcelPropertiesPacket(byte[] bytes, ref int i) : this()
-@@ -80211,6 +80751,7 @@
-                 bytes = zeroBuffer;
-             }
-             ParcelData.FromBytes(bytes, ref i);
-+            AgeVerificationBlock.FromBytes(bytes, ref i);
-         }
-
-         public ParcelPropertiesPacket(Header head, byte[] bytes, ref int i): this()
-@@ -80228,17 +80769,19 @@
-                 bytes = zeroBuffer;
-             }
-             ParcelData.FromBytes(bytes, ref i);
-+            AgeVerificationBlock.FromBytes(bytes, ref i);
-         }
-
-         public override byte[] ToBytes()
-         {
-             int length = 7;
--            length += ParcelData.Length;;
-+            length += ParcelData.Length;            length += AgeVerificationBlock.Length;;
-             if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-             byte[] bytes = new byte[length];
-             int i = 0;
-             header.ToBytes(bytes, ref i);
-             ParcelData.ToBytes(bytes, ref i);
-+            AgeVerificationBlock.ToBytes(bytes, ref i);
-             if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-             return bytes;
-         }
-@@ -80247,6 +80790,7 @@
-         {
-             string output = "--- ParcelProperties ---" + Environment.NewLine;
-                 output += ParcelData.ToString() + Environment.NewLine;
-+                output += AgeVerificationBlock.ToString() + Environment.NewLine;
-             return output;
-         }
-
diff --git a/old/libsl1550-patches/change-asset-type-Primitive-enum-to-Object.patch b/old/libsl1550-patches/change-asset-type-Primitive-enum-to-Object.patch
deleted file mode 100644
index f6ec13f..0000000
--- a/old/libsl1550-patches/change-asset-type-Primitive-enum-to-Object.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -r 6057b1cda03d libsecondlife/AssetManager.cs
---- a/libsecondlife/AssetManager.cs	Wed Mar 12 22:33:53 2008 +0000
-+++ b/libsecondlife/AssetManager.cs	Mon Apr 07 16:25:09 2008 +0200
-@@ -31,7 +31,7 @@
-         Clothing = 5,
-         /// <summary>Primitive that can contain textures, sounds,
-         /// scripts and more</summary>
--        Primitive = 6,
-+        Object = 6,
-         /// <summary>Notecard asset</summary>
-         Notecard = 7,
-         /// <summary>Holds a collection of inventory items</summary>
-@@ -668,7 +668,7 @@
-                 case AssetType.Texture:
-                     asset = new AssetTexture();
-                     break;
--                case AssetType.Primitive:
-+                case AssetType.Object:
-                     asset = new AssetPrim();
-                     break;
-                 case AssetType.Clothing:
-diff -r 6057b1cda03d libsecondlife/AssetTypes.cs
---- a/libsecondlife/AssetTypes.cs	Wed Mar 12 22:33:53 2008 +0000
-+++ b/libsecondlife/AssetTypes.cs	Mon Apr 07 16:25:09 2008 +0200
-@@ -167,7 +167,7 @@
-
-     public class AssetPrim : Asset
-     {
--        public override AssetType AssetType { get { return AssetType.Primitive; } }
-+        public override AssetType AssetType { get { return AssetType.Object; } }
-
-         public AssetPrim() { }
-
diff --git a/old/libsl1550-patches/change-asset-type-Primitive-enum-to-Object.patch.README b/old/libsl1550-patches/change-asset-type-Primitive-enum-to-Object.patch.README
deleted file mode 100644
index 9fffb8e..0000000
--- a/old/libsl1550-patches/change-asset-type-Primitive-enum-to-Object.patch.README
+++ /dev/null
@@ -1,3 +0,0 @@
-README
-
-This patch was included in libecondlife in revision r1714
diff --git a/old/libsl1550-patches/disable-_Packet_.cs-generation-to-work-around-mapgenerator-bug.patch b/old/libsl1550-patches/disable-_Packet_.cs-generation-to-work-around-mapgenerator-bug.patch
deleted file mode 100644
index 1b1d004..0000000
--- a/old/libsl1550-patches/disable-_Packet_.cs-generation-to-work-around-mapgenerator-bug.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: libsecondlife/libsecondlife.build
-===================================================================
---- libsecondlife/libsecondlife.build	(revision 31)
-+++ libsecondlife/libsecondlife.build	(working copy)
-@@ -67,7 +67,7 @@
- 		</exec>
- 	</target>
-
--	<target name="build" depends="init map" description="compiles the source code">
-+	<target name="build" depends="init" description="compiles the source code">
- 	    <if test="${property::exists('CCNetLabel')}">
- 			<!-- Produce AssemblyInfo.cs for libsecondlife.dll -->
- 			<asminfo output="AssemblyInfo.cs" language="CSharp">
diff --git a/old/libsl1550-patches/disable-_Packet_.cs-generation-to-work-around-mapgenerator-bug.txt b/old/libsl1550-patches/disable-_Packet_.cs-generation-to-work-around-mapgenerator-bug.txt
deleted file mode 100644
index 723f78a..0000000
--- a/old/libsl1550-patches/disable-_Packet_.cs-generation-to-work-around-mapgenerator-bug.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-In Dr Schofld's own words
-
-this patch fixes the build problem in opensim-libs/libsl1550 with nant/mcs barfing about the missing message_template.msg --- the real bug is in the mapgenerator. however, since we don't need to regenerate the _Packet_.cs with the current grid, we can just disable the dependency on "map" in libsl1550/libsecondlife/libsecondlife.build --- which is what this patch does.
-
-In my (justincc's words).
-
-This doesn't compile under 1.2.4 because WebClient doesn't contain GetWebRequest() to override.  However, it does compile under Windows (when mono-2.0 is changed to net-2.0) - it may well compile under versions of mono later than 1.2.4
diff --git a/old/libsl1550-patches/mjm_quaternion_getbytes_patch.diff b/old/libsl1550-patches/mjm_quaternion_getbytes_patch.diff
deleted file mode 100644
index ca81c43..0000000
--- a/old/libsl1550-patches/mjm_quaternion_getbytes_patch.diff
+++ /dev/null
@@ -1,36 +0,0 @@
-Index: libsl1550/libsecondlife/Types.cs
-===================================================================
---- libsl1550/libsecondlife/Types.cs	(revision 42)
-+++ libsl1550/libsecondlife/Types.cs	(working copy)
-@@ -1780,10 +1780,20 @@
-             {
-                 norm = 1 / norm;
-
--                Buffer.BlockCopy(BitConverter.GetBytes(norm * X), 0, bytes, 0, 4);
--                Buffer.BlockCopy(BitConverter.GetBytes(norm * Y), 0, bytes, 4, 4);
--                Buffer.BlockCopy(BitConverter.GetBytes(norm * Z), 0, bytes, 8, 4);
-+                float x, y, z;
-+                if (W >= 0)
-+                {
-+                    x = X; y = Y; z = Z;
-+                }
-+                else
-+                {
-+                    x = -X; y = -Y; z = -Z;
-+                }
-
-+                Buffer.BlockCopy(BitConverter.GetBytes(norm * x), 0, bytes, 0, 4);
-+                Buffer.BlockCopy(BitConverter.GetBytes(norm * y), 0, bytes, 4, 4);
-+                Buffer.BlockCopy(BitConverter.GetBytes(norm * z), 0, bytes, 8, 4);
-+
-                 if (!BitConverter.IsLittleEndian)
-                 {
-                     Array.Reverse(bytes, 0, 4);
-@@ -1799,6 +1809,7 @@
-             return bytes;
-         }
-
-+
-         public LLSD ToLLSD()
-         {
-             LLSDArray array = new LLSDArray();
\ No newline at end of file
diff --git a/old/libsl1550/LICENSE.txt b/old/libsl1550/LICENSE.txt
deleted file mode 100644
index 022673a..0000000
--- a/old/libsl1550/LICENSE.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright (c) 2006, Second Life Reverse Engineering Team
-All rights reserved.
-
-- Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are met:
-
-- Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer.
-- Neither the name of the Second Life Reverse Engineering Team nor the names
-  of its contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/old/libsl1550/README.txt b/old/libsl1550/README.txt
deleted file mode 100644
index 6050119..0000000
--- a/old/libsl1550/README.txt
+++ /dev/null
@@ -1,110 +0,0 @@
-
-libsecondlife
--------------
-
-We're still working on getting some documentation prepared for our first
-"official" release, so bear with us for now. If you need any help we
-have a couple of resources, the primary one being the #libsl IRC channel
-on EFNet. There are also the web forums at
-http://www.libsecondlife.org/forums/ and the libsecondlife-dev mailing
-list at http://opensecondlife.org/cgi-bin/mailman/listinfo/libsl-dev and
-lastly you can use the e-mail contact@libsecondlife.org for any general
-inquiries (although we prefer developer-related questions to go to IRC,
-forums, or the mailing list). You can find us in-world at
-http://tinyurl.com/y472fj.
-
-To checkout a copy of libsecondlife trunk see
-http://www.libsecondlife.org/wiki/SVN for details
-
-
-Windows
-------------------------------------------------------------------
-------------------------------------------------------------------
-
-
-Microsoft Visual Studio
------------------------
-
-Visual Studio 2005 project files are included to ease compiling on Windows
-platforms.  Some of the projects use a custom targets file that allows you
-to compile against .NET 1.0/1.1, mono, or the Compact Framework.  You will
-need to authorize this custom file when you first open the solution file.
-
-
-Software Needed (all Freeware)
-------------------------------
-
-Basic Stuff (Windows):
-   MS .NET Framework (1.1 and/or 2.0 depending on what you're working on;
-      preferably both).  Get directly from Windows Update.
-   Visual C# Express - http://msdn.microsoft.com/vstudio/express/visualcsharp/
-   nAnt (0.85) - http://nant.sourceforge.net/
-   nUnit Framework (2.2.8 or greater) - http://www.nunit.org/
-
-
-If you are using Visual Studio or Visual C# Express you can simply open
-the libsecondlife.sln solution file and begin compiling. It will complain
-about a missing dependency if you didn't install the nUnit framework, you
-can either install it now or remove libsecondlife.Tests from the solution
-file.
-
-
-NAnt under Windows
------------------------------------------------------------------
-
-1) Get .Net Frameworks (1.1 and 2.0) plus any patches installed via
-Windows Update.  Multiple reboots may be needed.
-
-2) Install Visual C# Express (defaults are fine)
-
-3) Install nUnit Framework (defaults are fine)
-
-4) Unpack the 0.85 binary of nAnt in a directory you can be happy with
-   (I chose C:\bin\nant-0.85\bin).  Add this to your XP PATH variable:
-
-   * Start->My Computer->[Right Click]->Properties (new window)
-   * Advanced Tab -> Environment Variables (new window)
-   * System Variables is bottom subwindow, click on 'path' and then the
-     'Edit' button below that. (new window)
-   * Add ';C:\bin\nant-0.85\bin' or whereever it is to the line and click
-     OK.
-   * Click OK twice more to close out system config windows.
-
-5) In a Command Prompt (yea you heard that right) cd to where you checked
-out the trunk (You're looking for the dir that has libsecondlife.build and
-Ovastus.CSharp.targets).  I'm going to call this %TRUNK% from here on.
-
-   * Run 'nant' and sit back.  'cd bin' and enjoy!
-
-6) [Optional]  Not all apps and examples will be in nant due to various
-compatibility and stability issues.  If you're still interested:
-
-  * Under %TRUNK%\libsecondlife-cs, open the libsecondlife.sln file and
-    Build the Solution (you're likely going to get warnings and such here).
-  * This may overwrite some of the files you created in step 5; If they
-    don't work re-run nant.
-
-
-Linux
------------------------------------------------------------------
------------------------------------------------------------------
-
-
-Software Needed
----------------
-
-mono 1.2.5 - http://www.mono-project.com/
-nAnt (0.85) - http://nant.sourceforge.net/
-nUnit Framework (2.2.8 or greater) - http://www.nunit.org/
-
-
-Compiling
----------
-
-Simply go to the directory where you extracted libsecondlife, where the
-libsecondlife.build file is located and type "nant". To build a zip file
-package use "nant package", and to generate documentation use "nant doc".
-
-
-Happy fiddling,
---libsecondlife Team
diff --git a/old/libsl1550/SLImageUpload/Properties/AssemblyInfo.cs b/old/libsl1550/SLImageUpload/Properties/AssemblyInfo.cs
deleted file mode 100644
index 182d2ca..0000000
--- a/old/libsl1550/SLImageUpload/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SLImageUpload")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Metaverse Industries LLC")]
-[assembly: AssemblyProduct("SLImageUpload")]
-[assembly: AssemblyCopyright("Copyright © Metaverse Industries LLC 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("d8a0ec17-daf9-4a17-b72f-d32ed7f6962a")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/old/libsl1550/SLImageUpload/Properties/Resources.Designer.cs b/old/libsl1550/SLImageUpload/Properties/Resources.Designer.cs
deleted file mode 100644
index 9a580a1..0000000
--- a/old/libsl1550/SLImageUpload/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace SLImageUpload.Properties
-{
-
-
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
-        private static global::System.Resources.ResourceManager resourceMan;
-
-        private static global::System.Globalization.CultureInfo resourceCulture;
-
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
-        }
-
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SLImageUpload.Properties.Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
-                return resourceCulture;
-            }
-            set
-            {
-                resourceCulture = value;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/SLImageUpload/Properties/Resources.resx b/old/libsl1550/SLImageUpload/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/old/libsl1550/SLImageUpload/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/SLImageUpload/Properties/Settings.Designer.cs b/old/libsl1550/SLImageUpload/Properties/Settings.Designer.cs
deleted file mode 100644
index 3c5c10a..0000000
--- a/old/libsl1550/SLImageUpload/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace SLImageUpload.Properties
-{
-
-
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
-        public static Settings Default
-        {
-            get
-            {
-                return defaultInstance;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/SLImageUpload/Properties/Settings.settings b/old/libsl1550/SLImageUpload/Properties/Settings.settings
deleted file mode 100644
index 3964565..0000000
--- a/old/libsl1550/SLImageUpload/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>
diff --git a/old/libsl1550/SLImageUpload/SLImageUpload.cs b/old/libsl1550/SLImageUpload/SLImageUpload.cs
deleted file mode 100644
index 87e643d..0000000
--- a/old/libsl1550/SLImageUpload/SLImageUpload.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace SLImageUpload
-{
-    static class SLImageUpload
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new frmSLImageUpload());
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/SLImageUpload/SLImageUpload.csproj b/old/libsl1550/SLImageUpload/SLImageUpload.csproj
deleted file mode 100644
index b216ea2..0000000
--- a/old/libsl1550/SLImageUpload/SLImageUpload.csproj
+++ /dev/null
@@ -1,84 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{F3BDC0BC-74EB-451E-8FFE-AA162474F2F2}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>SLImageUpload</RootNamespace>
-    <AssemblyName>SLImageUpload</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Deployment" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="frmSLImageUpload.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="frmSLImageUpload.Designer.cs">
-      <DependentUpon>frmSLImageUpload.cs</DependentUpon>
-    </Compile>
-    <Compile Include="SLImageUpload.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="frmSLImageUpload.resx">
-      <SubType>Designer</SubType>
-      <DependentUpon>frmSLImageUpload.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Resources.resx</DependentUpon>
-    </Compile>
-    <None Include="Properties\Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
-    <Compile Include="Properties\Settings.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Settings.settings</DependentUpon>
-      <DesignTimeSharedInput>True</DesignTimeSharedInput>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\libsecondlife\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/SLImageUpload/frmSLImageUpload.Designer.cs b/old/libsl1550/SLImageUpload/frmSLImageUpload.Designer.cs
deleted file mode 100644
index 2773d56..0000000
--- a/old/libsl1550/SLImageUpload/frmSLImageUpload.Designer.cs
+++ /dev/null
@@ -1,279 +0,0 @@
-namespace SLImageUpload
-{
-    partial class frmSLImageUpload
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.grpLogin = new System.Windows.Forms.GroupBox();
-            this.cmdConnect = new System.Windows.Forms.Button();
-            this.label3 = new System.Windows.Forms.Label();
-            this.txtPassword = new System.Windows.Forms.TextBox();
-            this.label2 = new System.Windows.Forms.Label();
-            this.txtLastName = new System.Windows.Forms.TextBox();
-            this.label1 = new System.Windows.Forms.Label();
-            this.txtFirstName = new System.Windows.Forms.TextBox();
-            this.grpUpload = new System.Windows.Forms.GroupBox();
-            this.txtAssetID = new System.Windows.Forms.TextBox();
-            this.label4 = new System.Windows.Forms.Label();
-            this.lblSize = new System.Windows.Forms.Label();
-            this.prgUpload = new System.Windows.Forms.ProgressBar();
-            this.picPreview = new System.Windows.Forms.PictureBox();
-            this.cmdLoad = new System.Windows.Forms.Button();
-            this.txtSendtoName = new System.Windows.Forms.TextBox();
-            this.label6 = new System.Windows.Forms.Label();
-            this.chkLossless = new System.Windows.Forms.CheckBox();
-            this.cmdUpload = new System.Windows.Forms.Button();
-            this.grpLogin.SuspendLayout();
-            this.grpUpload.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.picPreview)).BeginInit();
-            this.SuspendLayout();
-            //
-            // grpLogin
-            //
-            this.grpLogin.Controls.Add(this.cmdConnect);
-            this.grpLogin.Controls.Add(this.label3);
-            this.grpLogin.Controls.Add(this.txtPassword);
-            this.grpLogin.Controls.Add(this.label2);
-            this.grpLogin.Controls.Add(this.txtLastName);
-            this.grpLogin.Controls.Add(this.label1);
-            this.grpLogin.Controls.Add(this.txtFirstName);
-            this.grpLogin.Location = new System.Drawing.Point(11, 260);
-            this.grpLogin.Name = "grpLogin";
-            this.grpLogin.Size = new System.Drawing.Size(379, 101);
-            this.grpLogin.TabIndex = 67;
-            this.grpLogin.TabStop = false;
-            //
-            // cmdConnect
-            //
-            this.cmdConnect.Location = new System.Drawing.Point(251, 62);
-            this.cmdConnect.Name = "cmdConnect";
-            this.cmdConnect.Size = new System.Drawing.Size(120, 24);
-            this.cmdConnect.TabIndex = 3;
-            this.cmdConnect.Text = "Connect";
-            this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
-            //
-            // label3
-            //
-            this.label3.Location = new System.Drawing.Point(251, 20);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(120, 16);
-            this.label3.TabIndex = 72;
-            this.label3.Text = "Password";
-            //
-            // txtPassword
-            //
-            this.txtPassword.Location = new System.Drawing.Point(251, 36);
-            this.txtPassword.Name = "txtPassword";
-            this.txtPassword.PasswordChar = '*';
-            this.txtPassword.Size = new System.Drawing.Size(120, 20);
-            this.txtPassword.TabIndex = 2;
-            //
-            // label2
-            //
-            this.label2.Location = new System.Drawing.Point(132, 20);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(120, 16);
-            this.label2.TabIndex = 70;
-            this.label2.Text = "Last Name";
-            //
-            // txtLastName
-            //
-            this.txtLastName.Location = new System.Drawing.Point(132, 36);
-            this.txtLastName.Name = "txtLastName";
-            this.txtLastName.Size = new System.Drawing.Size(112, 20);
-            this.txtLastName.TabIndex = 1;
-            //
-            // label1
-            //
-            this.label1.Location = new System.Drawing.Point(6, 20);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(120, 16);
-            this.label1.TabIndex = 68;
-            this.label1.Text = "First Name";
-            //
-            // txtFirstName
-            //
-            this.txtFirstName.Location = new System.Drawing.Point(6, 36);
-            this.txtFirstName.Name = "txtFirstName";
-            this.txtFirstName.Size = new System.Drawing.Size(120, 20);
-            this.txtFirstName.TabIndex = 0;
-            //
-            // grpUpload
-            //
-            this.grpUpload.Controls.Add(this.txtAssetID);
-            this.grpUpload.Controls.Add(this.label4);
-            this.grpUpload.Controls.Add(this.lblSize);
-            this.grpUpload.Controls.Add(this.prgUpload);
-            this.grpUpload.Controls.Add(this.picPreview);
-            this.grpUpload.Controls.Add(this.cmdLoad);
-            this.grpUpload.Controls.Add(this.txtSendtoName);
-            this.grpUpload.Controls.Add(this.label6);
-            this.grpUpload.Controls.Add(this.chkLossless);
-            this.grpUpload.Controls.Add(this.cmdUpload);
-            this.grpUpload.Location = new System.Drawing.Point(12, 12);
-            this.grpUpload.Name = "grpUpload";
-            this.grpUpload.Size = new System.Drawing.Size(379, 242);
-            this.grpUpload.TabIndex = 68;
-            this.grpUpload.TabStop = false;
-            //
-            // txtAssetID
-            //
-            this.txtAssetID.Location = new System.Drawing.Point(90, 204);
-            this.txtAssetID.Name = "txtAssetID";
-            this.txtAssetID.ReadOnly = true;
-            this.txtAssetID.Size = new System.Drawing.Size(280, 20);
-            this.txtAssetID.TabIndex = 8;
-            this.txtAssetID.TabStop = false;
-            //
-            // label4
-            //
-            this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(6, 207);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(66, 13);
-            this.label4.TabIndex = 79;
-            this.label4.Text = "Asset UUID:";
-            //
-            // lblSize
-            //
-            this.lblSize.AutoSize = true;
-            this.lblSize.Location = new System.Drawing.Point(79, 96);
-            this.lblSize.Name = "lblSize";
-            this.lblSize.Size = new System.Drawing.Size(0, 13);
-            this.lblSize.TabIndex = 77;
-            //
-            // prgUpload
-            //
-            this.prgUpload.Location = new System.Drawing.Point(9, 175);
-            this.prgUpload.Name = "prgUpload";
-            this.prgUpload.Size = new System.Drawing.Size(362, 23);
-            this.prgUpload.TabIndex = 76;
-            //
-            // picPreview
-            //
-            this.picPreview.Location = new System.Drawing.Point(9, 96);
-            this.picPreview.Name = "picPreview";
-            this.picPreview.Size = new System.Drawing.Size(64, 64);
-            this.picPreview.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
-            this.picPreview.TabIndex = 75;
-            this.picPreview.TabStop = false;
-            //
-            // cmdLoad
-            //
-            this.cmdLoad.Location = new System.Drawing.Point(160, 136);
-            this.cmdLoad.Name = "cmdLoad";
-            this.cmdLoad.Size = new System.Drawing.Size(102, 24);
-            this.cmdLoad.TabIndex = 6;
-            this.cmdLoad.Text = "Load Texture";
-            this.cmdLoad.UseVisualStyleBackColor = true;
-            this.cmdLoad.Click += new System.EventHandler(this.cmdLoad_Click);
-            //
-            // txtSendtoName
-            //
-            this.txtSendtoName.Location = new System.Drawing.Point(131, 64);
-            this.txtSendtoName.Name = "txtSendtoName";
-            this.txtSendtoName.Size = new System.Drawing.Size(239, 20);
-            this.txtSendtoName.TabIndex = 5;
-            //
-            // label6
-            //
-            this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(6, 67);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(112, 13);
-            this.label6.TabIndex = 71;
-            this.label6.Text = "Send Copy To Avatar:";
-            //
-            // chkLossless
-            //
-            this.chkLossless.Location = new System.Drawing.Point(9, 19);
-            this.chkLossless.Name = "chkLossless";
-            this.chkLossless.Size = new System.Drawing.Size(362, 37);
-            this.chkLossless.TabIndex = 4;
-            this.chkLossless.Text = "Single Layer Lossless (only useful for pixel perfect reproductions of small image" +
-                "s, such as sculpt maps)";
-            this.chkLossless.UseVisualStyleBackColor = true;
-            this.chkLossless.CheckedChanged += new System.EventHandler(this.chkLossless_CheckedChanged);
-            //
-            // cmdUpload
-            //
-            this.cmdUpload.Enabled = false;
-            this.cmdUpload.Location = new System.Drawing.Point(268, 136);
-            this.cmdUpload.Name = "cmdUpload";
-            this.cmdUpload.Size = new System.Drawing.Size(103, 24);
-            this.cmdUpload.TabIndex = 7;
-            this.cmdUpload.Text = "Upload Texture";
-            this.cmdUpload.UseVisualStyleBackColor = true;
-            this.cmdUpload.Click += new System.EventHandler(this.cmdUpload_Click);
-            //
-            // frmSLImageUpload
-            //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(402, 373);
-            this.Controls.Add(this.grpUpload);
-            this.Controls.Add(this.grpLogin);
-            this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(410, 400);
-            this.MinimumSize = new System.Drawing.Size(410, 400);
-            this.Name = "frmSLImageUpload";
-            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
-            this.Text = "SL Image Upload";
-            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmSLImageUpload_FormClosed);
-            this.grpLogin.ResumeLayout(false);
-            this.grpLogin.PerformLayout();
-            this.grpUpload.ResumeLayout(false);
-            this.grpUpload.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.picPreview)).EndInit();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.GroupBox grpLogin;
-        private System.Windows.Forms.Button cmdConnect;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.TextBox txtPassword;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.TextBox txtLastName;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.TextBox txtFirstName;
-        private System.Windows.Forms.GroupBox grpUpload;
-        private System.Windows.Forms.Button cmdUpload;
-        private System.Windows.Forms.CheckBox chkLossless;
-        private System.Windows.Forms.TextBox txtSendtoName;
-        private System.Windows.Forms.Label label6;
-        private System.Windows.Forms.PictureBox picPreview;
-        private System.Windows.Forms.Button cmdLoad;
-        private System.Windows.Forms.ProgressBar prgUpload;
-        private System.Windows.Forms.Label lblSize;
-        private System.Windows.Forms.TextBox txtAssetID;
-        private System.Windows.Forms.Label label4;
-    }
-}
-
diff --git a/old/libsl1550/SLImageUpload/frmSLImageUpload.cs b/old/libsl1550/SLImageUpload/frmSLImageUpload.cs
deleted file mode 100644
index 2f67a31..0000000
--- a/old/libsl1550/SLImageUpload/frmSLImageUpload.cs
+++ /dev/null
@@ -1,352 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using System.Threading;
-using libsecondlife;
-
-namespace SLImageUpload
-{
-    public partial class frmSLImageUpload : Form
-    {
-        private SecondLife Client;
-        private byte[] UploadData = null;
-        private int Transferred = 0;
-        private string FileName = String.Empty;
-        private LLUUID SendToID;
-        private LLUUID AssetID;
-
-        public frmSLImageUpload()
-        {
-            InitializeComponent();
-
-            Client = new SecondLife();
-            Client.Network.OnEventQueueRunning += new NetworkManager.EventQueueRunningCallback(Network_OnEventQueueRunning);
-            Client.Assets.OnUploadProgress += new AssetManager.UploadProgressCallback(Assets_OnUploadProgress);
-
-            // Turn almost everything off since we are only interested in uploading textures
-            Client.Settings.ALWAYS_DECODE_OBJECTS = false;
-            Client.Settings.ALWAYS_REQUEST_OBJECTS = false;
-            Client.Settings.CONTINUOUS_AGENT_UPDATES = false;
-            Client.Settings.OBJECT_TRACKING = false;
-            Client.Settings.SEND_AGENT_UPDATES = true;
-            Client.Settings.STORE_LAND_PATCHES = false;
-            Client.Settings.MULTIPLE_SIMS = false;
-            Client.Self.Movement.Camera.Far = 32.0f;
-            Client.Throttle.Cloud = 0.0f;
-            Client.Throttle.Land = 0.0f;
-            Client.Throttle.Wind = 0.0f;
-        }
-
-        private void EnableUpload()
-        {
-            if (UploadData != null)
-            {
-                if (this.InvokeRequired)
-                    BeginInvoke(new MethodInvoker(EnableUpload));
-                else
-                    cmdUpload.Enabled = true;
-            }
-        }
-
-        private void DisableUpload()
-        {
-            if (this.InvokeRequired)
-                BeginInvoke(new MethodInvoker(DisableUpload));
-            else
-                cmdUpload.Enabled = false;
-        }
-
-        private void UpdateAssetID()
-        {
-            if (this.InvokeRequired)
-                BeginInvoke(new MethodInvoker(UpdateAssetID));
-            else
-                txtAssetID.Text = AssetID.ToString();
-        }
-
-        private void LoadImage()
-        {
-            string lowfilename = FileName.ToLower();
-            Bitmap bitmap = null;
-
-            try
-            {
-                if (lowfilename.EndsWith(".jp2") || lowfilename.EndsWith(".j2c"))
-                {
-                    // Upload JPEG2000 images untouched
-                    UploadData = System.IO.File.ReadAllBytes(FileName);
-                    bitmap = (Bitmap)OpenJPEGNet.OpenJPEG.DecodeToImage(UploadData);
-
-                    Client.Log("Loaded raw JPEG2000 data " + FileName, Helpers.LogLevel.Info);
-                }
-                else
-                {
-                    if (lowfilename.EndsWith(".tga"))
-                        bitmap = OpenJPEGNet.LoadTGAClass.LoadTGA(FileName);
-                    else
-                        bitmap = (Bitmap)System.Drawing.Image.FromFile(FileName);
-
-                    Client.Log("Loaded image " + FileName, Helpers.LogLevel.Info);
-
-                    int oldwidth = bitmap.Width;
-                    int oldheight = bitmap.Height;
-
-                    if (!IsPowerOfTwo((uint)oldwidth) || !IsPowerOfTwo((uint)oldheight))
-                    {
-                        Client.Log("Image has irregular dimensions " + oldwidth + "x" + oldheight + ", resizing to 256x256",
-                            Helpers.LogLevel.Info);
-
-                        Bitmap resized = new Bitmap(256, 256, bitmap.PixelFormat);
-                        Graphics graphics = Graphics.FromImage(resized);
-
-                        graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
-                        graphics.InterpolationMode =
-                           System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
-                        graphics.DrawImage(bitmap, 0, 0, 256, 256);
-
-                        bitmap.Dispose();
-                        bitmap = resized;
-
-                        oldwidth = 256;
-                        oldheight = 256;
-                    }
-
-                    // Handle resizing to prevent excessively large images
-                    if (oldwidth > 1024 || oldheight > 1024)
-                    {
-                        int newwidth = (oldwidth > 1024) ? 1024 : oldwidth;
-                        int newheight = (oldheight > 1024) ? 1024 : oldheight;
-
-                        Client.Log("Image has oversized dimensions " + oldwidth + "x" + oldheight + ", resizing to " +
-                            newwidth + "x" + newheight, Helpers.LogLevel.Info);
-
-                        Bitmap resized = new Bitmap(newwidth, newheight, bitmap.PixelFormat);
-                        Graphics graphics = Graphics.FromImage(resized);
-
-                        graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
-                        graphics.InterpolationMode =
-                           System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
-                        graphics.DrawImage(bitmap, 0, 0, newwidth, newheight);
-
-                        bitmap.Dispose();
-                        bitmap = resized;
-                    }
-
-                    Client.Log("Encoding image...", Helpers.LogLevel.Info);
-
-                    UploadData = OpenJPEGNet.OpenJPEG.EncodeFromImage(bitmap, chkLossless.Checked);
-
-                    Client.Log("Finished encoding", Helpers.LogLevel.Info);
-                }
-            }
-            catch (Exception ex)
-            {
-                UploadData = null;
-                cmdUpload.Enabled = false;
-                MessageBox.Show(ex.ToString(), "SL Image Upload", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                return;
-            }
-
-            picPreview.Image = bitmap;
-            lblSize.Text = Math.Round((double)UploadData.Length / 1024.0d, 2) + "KB";
-            prgUpload.Maximum = UploadData.Length;
-            if (Client.Network.Connected) cmdUpload.Enabled = true;
-        }
-
-        private void cmdConnect_Click(object sender, EventArgs e)
-        {
-            if (cmdConnect.Text == "Connect")
-            {
-                cmdConnect.Text = "Disconnect";
-                txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;
-
-                if (!Client.Network.Login(txtFirstName.Text, txtLastName.Text, txtPassword.Text, "SL Image Upload",
-                    "jhurliman@metaverseindustries.com"))
-                {
-                    MessageBox.Show(this, String.Format("Error logging in ({0}): {1}", Client.Network.LoginErrorKey,
-                        Client.Network.LoginMessage));
-                    cmdConnect.Text = "Connect";
-                    txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
-                    DisableUpload();
-                }
-            }
-            else
-            {
-                Client.Network.Logout();
-                cmdConnect.Text = "Connect";
-                txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
-                DisableUpload();
-
-                // HACK: Create a new SecondLife object until it can clean up properly after itself
-                Client = new SecondLife();
-            }
-        }
-
-        private void cmdLoad_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog dialog = new OpenFileDialog();
-            dialog.Filter =
-                "Image Files (*.jp2,*.j2c,*.jpg,*.jpeg,*.gif,*.png,*.bmp,*.tga,*.tif,*.tiff,*.ico,*.wmf,*.emf)|" +
-                "*.jp2;*.j2c;*.jpg;*.jpeg;*.gif;*.png;*.bmp;*.tga;*.tif;*.tiff;*.ico;*.wmf;*.emf;";
-
-            if (dialog.ShowDialog() == DialogResult.OK)
-            {
-                FileName = dialog.FileName;
-                LoadImage();
-            }
-        }
-
-        private void cmdUpload_Click(object sender, EventArgs e)
-        {
-            SendToID = LLUUID.Zero;
-            string sendTo = txtSendtoName.Text.Trim();
-
-            if (sendTo.Length > 0)
-            {
-                AutoResetEvent lookupEvent = new AutoResetEvent(false);
-                LLUUID thisQueryID = LLUUID.Random();
-                bool lookupSuccess = false;
-
-                DirectoryManager.DirPeopleReplyCallback callback =
-                    delegate(LLUUID queryID, List<DirectoryManager.AgentSearchData> matchedPeople)
-                    {
-                        if (queryID == thisQueryID)
-                        {
-                            if (matchedPeople.Count > 0)
-                            {
-                                SendToID = matchedPeople[0].AgentID;
-                                lookupSuccess = true;
-                            }
-
-                            lookupEvent.Set();
-                        }
-                    };
-
-                Client.Directory.OnDirPeopleReply += callback;
-                Client.Directory.StartPeopleSearch(DirectoryManager.DirFindFlags.People, sendTo, 0, thisQueryID);
-
-                bool eventSuccess = lookupEvent.WaitOne(10 * 1000, false);
-                Client.Directory.OnDirPeopleReply -= callback;
-
-                if (eventSuccess && lookupSuccess)
-                {
-                    Client.Log("Will send uploaded image to avatar " + SendToID.ToString(), Helpers.LogLevel.Info);
-                }
-                else
-                {
-                    MessageBox.Show("Could not find avatar \"" + sendTo + "\", upload cancelled");
-                    return;
-                }
-            }
-
-            if (UploadData != null)
-            {
-                prgUpload.Value = 0;
-                cmdLoad.Enabled = false;
-                cmdUpload.Enabled = false;
-                grpLogin.Enabled = false;
-
-                string name = System.IO.Path.GetFileNameWithoutExtension(FileName);
-
-                Client.Inventory.RequestCreateItemFromAsset(UploadData, name, "Uploaded with SL Image Upload", AssetType.Texture,
-                    InventoryType.Texture, Client.Inventory.FindFolderForType(AssetType.Texture),
-                    delegate(bool success, string status, LLUUID itemID, LLUUID assetID)
-                    {
-                        if (this.InvokeRequired)
-                            BeginInvoke(new MethodInvoker(EnableControls));
-                        else
-                            EnableControls();
-
-                        if (success)
-                        {
-                            AssetID = assetID;
-                            UpdateAssetID();
-
-                            // Fix the permissions on the new upload since they are fscked by default
-                            InventoryItem item = Client.Inventory.FetchItem(itemID, Client.Self.AgentID, 1000 * 15);
-
-                            if (item != null)
-                            {
-                                item.Permissions.EveryoneMask = PermissionMask.All;
-                                item.Permissions.NextOwnerMask = PermissionMask.All;
-                                Client.Inventory.RequestUpdateItem(item);
-
-                                Client.Log("Created inventory item " + itemID.ToString(), Helpers.LogLevel.Info);
-                                MessageBox.Show("Created inventory item " + itemID.ToString());
-
-                                // FIXME: We should be watching the callback for RequestUpdateItem instead of a dumb sleep
-                                System.Threading.Thread.Sleep(2000);
-
-                                if (SendToID != LLUUID.Zero)
-                                {
-                                    Client.Log("Sending item to " + SendToID.ToString(), Helpers.LogLevel.Info);
-                                    Client.Inventory.GiveItem(itemID, name, AssetType.Texture, SendToID, true);
-                                    MessageBox.Show("Sent item to " + SendToID.ToString());
-                                }
-                            }
-                            else
-                            {
-                                Client.DebugLog("Created inventory item " + itemID.ToString() + " but failed to fetch it," +
-                                    " cannot update permissions or send to another avatar");
-                                MessageBox.Show("Created inventory item " + itemID.ToString() + " but failed to fetch it," +
-                                    " cannot update permissions or send to another avatar");
-                            }
-                        }
-                        else
-                        {
-                            MessageBox.Show("Asset upload failed: " + status);
-                        }
-                    }
-                );
-            }
-        }
-
-        private void Assets_OnUploadProgress(AssetUpload upload)
-        {
-            Transferred = upload.Transferred;
-
-            if (this.InvokeRequired)
-                BeginInvoke(new MethodInvoker(SetProgress));
-            else
-                SetProgress();
-        }
-
-        private void SetProgress()
-        {
-            prgUpload.Value = Transferred;
-        }
-
-        private void Network_OnEventQueueRunning(Simulator simulator)
-        {
-            Client.DebugLog("Event queue is running for " + simulator.ToString() + ", enabling uploads");
-            EnableUpload();
-        }
-
-        private void EnableControls()
-        {
-            cmdLoad.Enabled = true;
-            cmdUpload.Enabled = true;
-            grpLogin.Enabled = true;
-        }
-
-        private void frmSLImageUpload_FormClosed(object sender, FormClosedEventArgs e)
-        {
-            if (Client.Network.Connected)
-                Client.Network.Logout();
-        }
-
-        private void chkLossless_CheckedChanged(object sender, EventArgs e)
-        {
-            LoadImage();
-        }
-
-        private bool IsPowerOfTwo(uint n)
-        {
-            return (n & (n - 1)) == 0 && n != 0;
-        }
-    }
-}
diff --git a/old/libsl1550/SLImageUpload/frmSLImageUpload.resx b/old/libsl1550/SLImageUpload/frmSLImageUpload.resx
deleted file mode 100644
index 19dc0dd..0000000
--- a/old/libsl1550/SLImageUpload/frmSLImageUpload.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/Analyst.cs b/old/libsl1550/SLProxy/Analyst.cs
deleted file mode 100644
index 2c2800c..0000000
--- a/old/libsl1550/SLProxy/Analyst.cs
+++ /dev/null
@@ -1,747 +0,0 @@
-/*
- * Analyst.cs: proxy that makes packet inspection and modifcation interactive
- *   See the README for usage instructions.
- *
- * Copyright (c) 2006 Austin Jennings
- * Modified by "qode" and "mcortez" on December 21st, 2006 to work with the new
- * pregen
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using SLProxy;
-using libsecondlife;
-using Nwc.XmlRpc;
-using libsecondlife.Packets;
-using System.Reflection;
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.IO;
-using System.Net;
-using System.Text.RegularExpressions;
-
-public class Analyst : ProxyPlugin
-{
-    private ProxyFrame frame;
-    private Proxy proxy;
-    private Hashtable loggedPackets = new Hashtable();
-    private string logGrep = null;
-    private Hashtable modifiedPackets = new Hashtable();
-    private Assembly libslAssembly;
-
-    public Analyst(ProxyFrame frame)
-    {
-        this.frame = frame;
-        this.proxy = frame.proxy;
-    }
-
-    public override void Init()
-    {
-        libslAssembly = Assembly.Load("libsecondlife");
-        if (libslAssembly == null) throw new Exception("Assembly load exception");
-
-        // build the table of /command delegates
-        InitializeCommandDelegates();
-
-        //  handle command line arguments
-        foreach (string arg in frame.Args)
-            if (arg == "--log-all")
-                LogAll();
-
-        Console.WriteLine("Analyst loaded");
-    }
-
-    // InitializeCommandDelegates: configure Analyst's commands
-    private void InitializeCommandDelegates()
-    {
-        frame.AddCommand("/log", new ProxyFrame.CommandDelegate(CmdLog));
-        frame.AddCommand("/-log", new ProxyFrame.CommandDelegate(CmdNoLog));
-        frame.AddCommand("/grep", new ProxyFrame.CommandDelegate(CmdGrep));
-        frame.AddCommand("/set", new ProxyFrame.CommandDelegate(CmdSet));
-        frame.AddCommand("/-set", new ProxyFrame.CommandDelegate(CmdNoSet));
-        frame.AddCommand("/inject", new ProxyFrame.CommandDelegate(CmdInject));
-        frame.AddCommand("/in", new ProxyFrame.CommandDelegate(CmdInject));
-    }
-
-    private static PacketType packetTypeFromName(string name)
-    {
-        Type packetTypeType = typeof(PacketType);
-        System.Reflection.FieldInfo f = packetTypeType.GetField(name);
-        if (f == null) throw new ArgumentException("Bad packet type");
-        return (PacketType)Enum.ToObject(packetTypeType, (int)f.GetValue(packetTypeType));
-    }
-
-    // CmdLog: handle a /log command
-    private void CmdLog(string[] words)
-    {
-        if (words.Length != 2)
-            SayToUser("Usage: /log <packet name>");
-        else if (words[1] == "*")
-        {
-            LogAll();
-            SayToUser("logging all packets");
-        }
-        else
-        {
-            PacketType pType;
-            try
-            {
-                pType = packetTypeFromName(words[1]);
-            }
-            catch (ArgumentException)
-            {
-                SayToUser("Bad packet name: " + words[1]);
-                return;
-            }
-            loggedPackets[pType] = null;
-            proxy.AddDelegate(pType, Direction.Incoming, new PacketDelegate(LogPacketIn));
-            proxy.AddDelegate(pType, Direction.Outgoing, new PacketDelegate(LogPacketOut));
-            SayToUser("logging " + words[1]);
-        }
-    }
-
-    // CmdNoLog: handle a /-log command
-    private void CmdNoLog(string[] words)
-    {
-        if (words.Length != 2)
-            SayToUser("Usage: /-log <packet name>");
-        else if (words[1] == "*")
-        {
-            NoLogAll();
-            SayToUser("stopped logging all packets");
-        }
-        else
-        {
-            PacketType pType = packetTypeFromName(words[1]);
-            loggedPackets.Remove(pType);
-
-            proxy.RemoveDelegate(pType, Direction.Incoming, new PacketDelegate(LogPacketIn));
-            proxy.RemoveDelegate(pType, Direction.Outgoing, new PacketDelegate(LogPacketOut));
-            SayToUser("stopped logging " + words[1]);
-        }
-    }
-
-    	// CmdGrep: handle a /grep command
-        private void CmdGrep(string[] words) {
-            if (words.Length == 1) {
-                logGrep = null;
-                SayToUser("stopped filtering logs");
-            } else {
-                string[] regexArray = new string[words.Length - 1];
-                Array.Copy(words, 1, regexArray, 0, words.Length - 1);
-                logGrep = String.Join(" ", regexArray);
-                SayToUser("filtering log with " + logGrep);
-            }
-	}
-
-    // CmdSet: handle a /set command
-    private void CmdSet(string[] words)
-    {
-        if (words.Length < 5)
-            SayToUser("Usage: /set <packet name> <block> <field> <value>");
-        else
-        {
-            PacketType pType;
-            try
-            {
-                pType = packetTypeFromName(words[1]);
-            }
-            catch (ArgumentException)
-            {
-                SayToUser("Bad packet name: " + words[1]);
-                return;
-            }
-
-            string[] valueArray = new string[words.Length - 4];
-            Array.Copy(words, 4, valueArray, 0, words.Length - 4);
-            string valueString = String.Join(" ", valueArray);
-            object value;
-            try
-            {
-                value = MagicCast(words[1], words[2], words[3], valueString);
-            }
-            catch (Exception e)
-            {
-                SayToUser(e.Message);
-                return;
-            }
-
-            Hashtable fields;
-            if (modifiedPackets.Contains(pType))
-                fields = (Hashtable)modifiedPackets[pType];
-            else
-                fields = new Hashtable();
-
-            fields[new BlockField(words[2], words[3])] = value;
-            modifiedPackets[pType] = fields;
-
-            proxy.AddDelegate(pType, Direction.Incoming, new PacketDelegate(ModifyIn));
-            proxy.AddDelegate(pType, Direction.Outgoing, new PacketDelegate(ModifyOut));
-
-            SayToUser("setting " + words[1] + "." + words[2] + "." + words[3] + " = " + valueString);
-        }
-    }
-
-    // CmdNoSet: handle a /-set command
-    private void CmdNoSet(string[] words)
-    {
-        if (words.Length == 2 && words[1] == "*")
-        {
-            foreach (PacketType pType in modifiedPackets.Keys)
-            {
-                proxy.RemoveDelegate(pType, Direction.Incoming, new PacketDelegate(ModifyIn));
-                proxy.RemoveDelegate(pType, Direction.Outgoing, new PacketDelegate(ModifyOut));
-            }
-            modifiedPackets = new Hashtable();
-
-            SayToUser("stopped setting all fields");
-        }
-        else if (words.Length == 4)
-        {
-            PacketType pType;
-            try
-            {
-                pType = packetTypeFromName(words[1]);
-            }
-            catch (ArgumentException)
-            {
-                SayToUser("Bad packet name: " + words[1]);
-                return;
-            }
-
-
-            if (modifiedPackets.Contains(pType))
-            {
-                Hashtable fields = (Hashtable)modifiedPackets[pType];
-                fields.Remove(new BlockField(words[2], words[3]));
-
-                if (fields.Count == 0)
-                {
-                    modifiedPackets.Remove(pType);
-
-                    proxy.RemoveDelegate(pType, Direction.Incoming, new PacketDelegate(ModifyIn));
-                    proxy.RemoveDelegate(pType, Direction.Outgoing, new PacketDelegate(ModifyOut));
-                }
-            }
-
-            SayToUser("stopped setting " + words[1] + "." + words[2] + "." + words[3]);
-        }
-        else
-            SayToUser("Usage: /-set <packet name> <block> <field>");
-    }
-
-
-    // CmdInject: handle an /inject command
-    private void CmdInject(string[] words)
-    {
-        if (words.Length < 2)
-            SayToUser("Usage: /inject <packet file> [value]");
-        else
-        {
-            string[] valueArray = new string[words.Length - 2];
-            Array.Copy(words, 2, valueArray, 0, words.Length - 2);
-            string value = String.Join(" ", valueArray);
-
-            FileStream fs = null;
-            StreamReader sr = null;
-            Direction direction = Direction.Incoming;
-            string name = null;
-            string block = null;
-            object blockObj = null;
-            Type packetClass = null;
-            Packet packet = null;
-
-            try
-            {
-                fs = File.OpenRead(words[1] + ".packet");
-                sr = new StreamReader(fs);
-
-                string line;
-                while ((line = sr.ReadLine()) != null)
-                {
-                    Match match;
-
-                    if (name == null)
-                    {
-                        match = (new Regex(@"^\s*(in|out)\s+(\w+)\s*$")).Match(line);
-                        if (!match.Success)
-                        {
-                            SayToUser("expecting direction and packet name, got: " + line);
-                            return;
-                        }
-
-                        string lineDir = match.Groups[1].Captures[0].ToString();
-                        string lineName = match.Groups[2].Captures[0].ToString();
-
-                        if (lineDir == "in")
-                            direction = Direction.Incoming;
-                        else if (lineDir == "out")
-                            direction = Direction.Outgoing;
-                        else
-                        {
-                            SayToUser("expecting 'in' or 'out', got: " + line);
-                            return;
-                        }
-
-                        name = lineName;
-                        packetClass = libslAssembly.GetType("libsecondlife.Packets." + name + "Packet");
-                        if (packetClass == null) throw new Exception("Couldn't get class " + name + "Packet");
-                        ConstructorInfo ctr = packetClass.GetConstructor(new Type[] { });
-                        if (ctr == null) throw new Exception("Couldn't get suitable constructor for " + name + "Packet");
-                        packet = (Packet)ctr.Invoke(new object[] { });
-                        //Console.WriteLine("Created new " + name + "Packet");
-                    }
-                    else
-                    {
-                        match = (new Regex(@"^\s*\[(\w+)\]\s*$")).Match(line);
-                        if (match.Success)
-                        {
-                            block = match.Groups[1].Captures[0].ToString();
-                            FieldInfo blockField = packetClass.GetField(block);
-                            if (blockField == null) throw new Exception("Couldn't get " + name + "Packet." + block);
-                            Type blockClass = blockField.FieldType;
-                            if (blockClass.IsArray)
-                            {
-                                blockClass = blockClass.GetElementType();
-                                ConstructorInfo ctr = blockClass.GetConstructor(new Type[] { });
-                                if (ctr == null) throw new Exception("Couldn't get suitable constructor for " + blockClass.Name);
-                                blockObj = ctr.Invoke(new object[] { });
-                                object[] arr = (object[])blockField.GetValue(packet);
-                                object[] narr = (object[])Array.CreateInstance(blockClass, arr.Length + 1);
-                                Array.Copy(arr, narr, arr.Length);
-                                narr[arr.Length] = blockObj;
-                                blockField.SetValue(packet, narr);
-                                //Console.WriteLine("Added block "+block);
-                            }
-                            else
-                            {
-                                blockObj = blockField.GetValue(packet);
-                            }
-                            if (blockObj == null) throw new Exception("Got " + name + "Packet." + block + " == null");
-                            //Console.WriteLine("Got block " + name + "Packet." + block);
-
-                            continue;
-                        }
-
-                        if (block == null)
-                        {
-                            SayToUser("expecting block name, got: " + line);
-                            return;
-                        }
-
-                        match = (new Regex(@"^\s*(\w+)\s*=\s*(.*)$")).Match(line);
-                        if (match.Success)
-                        {
-                            string lineField = match.Groups[1].Captures[0].ToString();
-                            string lineValue = match.Groups[2].Captures[0].ToString();
-                            object fval;
-
-                            //FIXME: use of MagicCast inefficient
-                            if (lineValue == "$Value")
-                                fval = MagicCast(name, block, lineField, value);
-                            else if (lineValue == "$UUID")
-                                fval = LLUUID.Random();
-                            else if (lineValue == "$AgentID")
-                                fval = frame.AgentID;
-                            else if (lineValue == "$SessionID")
-                                fval = frame.SessionID;
-                            else
-                                fval = MagicCast(name, block, lineField, lineValue);
-
-                            MagicSetField(blockObj, lineField, fval);
-                            continue;
-                        }
-
-                        SayToUser("expecting block name or field, got: " + line);
-                        return;
-                    }
-                }
-
-                if (name == null)
-                {
-                    SayToUser("expecting direction and packet name, got EOF");
-                    return;
-                }
-
-                packet.Header.Flags |= Helpers.MSG_RELIABLE;
-                //if (protocolManager.Command(name).Encoded)
-                //	packet.Header.Flags |= Helpers.MSG_ZEROCODED;
-                proxy.InjectPacket(packet, direction);
-
-                SayToUser("injected " + words[1]);
-            }
-            catch (Exception e)
-            {
-                SayToUser("failed to inject " + words[1] + ": " + e.Message);
-                Console.WriteLine("failed to inject " + words[1] + ": " + e.Message + "\n" + e.StackTrace);
-            }
-            finally
-            {
-                if (fs != null)
-                    fs.Close();
-                if (sr != null)
-                    sr.Close();
-            }
-        }
-    }
-
-    // SayToUser: send a message to the user as in-world chat
-    private void SayToUser(string message)
-    {
-        ChatFromSimulatorPacket packet = new ChatFromSimulatorPacket();
-        packet.ChatData.FromName = Helpers.StringToField("Analyst");
-        packet.ChatData.SourceID = LLUUID.Random();
-        packet.ChatData.OwnerID = frame.AgentID;
-        packet.ChatData.SourceType = (byte)2;
-        packet.ChatData.ChatType = (byte)1;
-        packet.ChatData.Audible = (byte)1;
-        packet.ChatData.Position = new LLVector3(0, 0, 0);
-        packet.ChatData.Message = Helpers.StringToField(message);
-        proxy.InjectPacket(packet, Direction.Incoming);
-    }
-
-    // BlockField: product type for a block name and field name
-    private struct BlockField
-    {
-        public string block;
-        public string field;
-
-
-        public BlockField(string block, string field)
-        {
-            this.block = block;
-            this.field = field;
-        }
-    }
-
-    private static void MagicSetField(object obj, string field, object val)
-    {
-        Type cls = obj.GetType();
-
-        FieldInfo fieldInf = cls.GetField(field);
-        if (fieldInf == null)
-        {
-            PropertyInfo prop = cls.GetProperty(field);
-            if (prop == null) throw new Exception("Couldn't find field " + cls.Name + "." + field);
-            prop.SetValue(obj, val, null);
-            //throw new Exception("FIXME: can't set properties");
-        }
-        else
-        {
-            fieldInf.SetValue(obj, val);
-        }
-    }
-
-    // MagicCast: given a packet/block/field name and a string, convert the string to a value of the appropriate type
-    private object MagicCast(string name, string block, string field, string value)
-    {
-        Type packetClass = libslAssembly.GetType("libsecondlife.Packets." + name + "Packet");
-        if (packetClass == null) throw new Exception("Couldn't get class " + name + "Packet");
-
-        FieldInfo blockField = packetClass.GetField(block);
-        if (blockField == null) throw new Exception("Couldn't get " + name + "Packet." + block);
-        Type blockClass = blockField.FieldType;
-        if (blockClass.IsArray) blockClass = blockClass.GetElementType();
-        // Console.WriteLine("DEBUG: " + blockClass.Name);
-
-        FieldInfo fieldField = blockClass.GetField(field); PropertyInfo fieldProp = null;
-        Type fieldClass = null;
-        if (fieldField == null)
-        {
-            fieldProp = blockClass.GetProperty(field);
-            if (fieldProp == null) throw new Exception("Couldn't get " + name + "Packet." + block + "." + field);
-            fieldClass = fieldProp.PropertyType;
-        }
-        else
-        {
-            fieldClass = fieldField.FieldType;
-        }
-
-        try
-        {
-            if (fieldClass == typeof(byte))
-            {
-                return Convert.ToByte(value);
-            }
-            else if (fieldClass == typeof(ushort))
-            {
-                return Convert.ToUInt16(value);
-            }
-            else if (fieldClass == typeof(uint))
-            {
-                return Convert.ToUInt32(value);
-            }
-            else if (fieldClass == typeof(ulong))
-            {
-                return Convert.ToUInt64(value);
-            }
-            else if (fieldClass == typeof(sbyte))
-            {
-                return Convert.ToSByte(value);
-            }
-            else if (fieldClass == typeof(short))
-            {
-                return Convert.ToInt16(value);
-            }
-            else if (fieldClass == typeof(int))
-            {
-                return Convert.ToInt32(value);
-            }
-            else if (fieldClass == typeof(long))
-            {
-                return Convert.ToInt64(value);
-            }
-            else if (fieldClass == typeof(float))
-            {
-                return Convert.ToSingle(value);
-            }
-            else if (fieldClass == typeof(double))
-            {
-                return Convert.ToDouble(value);
-            }
-            else if (fieldClass == typeof(LLUUID))
-            {
-                return new LLUUID(value);
-            }
-            else if (fieldClass == typeof(bool))
-            {
-                if (value.ToLower() == "true")
-                    return true;
-                else if (value.ToLower() == "false")
-                    return false;
-                else
-                    throw new Exception();
-            }
-            else if (fieldClass == typeof(byte[]))
-            {
-                return Helpers.StringToField(value);
-            }
-            else if (fieldClass == typeof(LLVector3))
-            {
-                Match vector3Match = (new Regex(@"<\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*>")).Match(value);
-                if (!vector3Match.Success)
-                    throw new Exception();
-                return new LLVector3
-                    (Convert.ToSingle(vector3Match.Groups[1].Captures[0].ToString())
-                    , Convert.ToSingle(vector3Match.Groups[2].Captures[0].ToString())
-                    , Convert.ToSingle(vector3Match.Groups[3].Captures[0].ToString())
-                    );
-            }
-            else if (fieldClass == typeof(LLVector3d))
-            {
-                Match vector3dMatch = (new Regex(@"<\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*>")).Match(value);
-                if (!vector3dMatch.Success)
-                    throw new Exception();
-                return new LLVector3d
-                    (Convert.ToDouble(vector3dMatch.Groups[1].Captures[0].ToString())
-                    , Convert.ToDouble(vector3dMatch.Groups[2].Captures[0].ToString())
-                    , Convert.ToDouble(vector3dMatch.Groups[3].Captures[0].ToString())
-                    );
-            }
-            else if (fieldClass == typeof(LLVector4))
-            {
-                Match vector4Match = (new Regex(@"<\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*>")).Match(value);
-                if (!vector4Match.Success)
-                    throw new Exception();
-                float vector4X = Convert.ToSingle(vector4Match.Groups[1].Captures[0].ToString());
-                float vector4Y = Convert.ToSingle(vector4Match.Groups[2].Captures[0].ToString());
-                float vector4Z = Convert.ToSingle(vector4Match.Groups[3].Captures[0].ToString());
-                float vector4S = Convert.ToSingle(vector4Match.Groups[4].Captures[0].ToString());
-                byte[] vector4Bytes = new byte[16];
-                Array.Copy(BitConverter.GetBytes(vector4X), 0, vector4Bytes, 0, 4);
-                Array.Copy(BitConverter.GetBytes(vector4Y), 0, vector4Bytes, 4, 4);
-                Array.Copy(BitConverter.GetBytes(vector4Z), 0, vector4Bytes, 8, 4);
-                Array.Copy(BitConverter.GetBytes(vector4S), 0, vector4Bytes, 12, 4);
-                return new LLVector4(vector4Bytes, 0);
-            }
-            else if (fieldClass == typeof(LLQuaternion))
-            {
-                Match quaternionMatch = (new Regex(@"<\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*>")).Match(value);
-                if (!quaternionMatch.Success)
-                    throw new Exception();
-                return new LLQuaternion
-                    (Convert.ToSingle(quaternionMatch.Groups[1].Captures[0].ToString())
-                    , Convert.ToSingle(quaternionMatch.Groups[2].Captures[0].ToString())
-                    , Convert.ToSingle(quaternionMatch.Groups[3].Captures[0].ToString())
-                    );
-            }
-            else
-            {
-                throw new Exception("unsupported field type " + fieldClass);
-            }
-        }
-        catch
-        {
-            throw new Exception("unable to interpret " + value + " as " + fieldClass);
-        }
-    }
-
-    // ModifyIn: modify an incoming packet
-    private Packet ModifyIn(Packet packet, IPEndPoint endPoint)
-    {
-        return Modify(packet, endPoint, Direction.Incoming);
-    }
-
-    // ModifyOut: modify an outgoing packet
-    private Packet ModifyOut(Packet packet, IPEndPoint endPoint)
-    {
-        return Modify(packet, endPoint, Direction.Outgoing);
-    }
-
-    // Modify: modify a packet
-    private Packet Modify(Packet packet, IPEndPoint endPoint, Direction direction)
-    {
-        if (modifiedPackets.Contains(packet.Type))
-        {
-            try
-            {
-                Hashtable changes = (Hashtable)modifiedPackets[packet.Type];
-                Type packetClass = packet.GetType();
-
-                foreach (BlockField bf in changes.Keys)
-                {
-                    //FIXME: support variable blocks
-
-                    FieldInfo blockField = packetClass.GetField(bf.block);
-                    //Type blockClass = blockField.FieldType;
-                    object blockObject = blockField.GetValue(packet);
-                    MagicSetField(blockObject, bf.field, changes[blockField]);
-                }
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("failed to modify " + packet.Type + ": " + e.Message);
-                Console.WriteLine(e.StackTrace);
-            }
-        }
-
-        return packet;
-    }
-
-    // LogPacketIn: log an incoming packet
-    private Packet LogPacketIn(Packet packet, IPEndPoint endPoint)
-    {
-        LogPacket(packet, endPoint, Direction.Incoming);
-        return packet;
-    }
-
-    // LogPacketOut: log an outgoing packet
-    private Packet LogPacketOut(Packet packet, IPEndPoint endPoint)
-    {
-        LogPacket(packet, endPoint, Direction.Outgoing);
-        return packet;
-    }
-
-    // LogAll: register logging delegates for all packets
-    private void LogAll()
-    {
-        Type packetTypeType = typeof(PacketType);
-        System.Reflection.MemberInfo[] packetTypes = packetTypeType.GetMembers();
-
-        for (int i = 0; i < packetTypes.Length; i++)
-        {
-            if (packetTypes[i].MemberType == System.Reflection.MemberTypes.Field && packetTypes[i].DeclaringType == packetTypeType)
-            {
-                string name = packetTypes[i].Name;
-                PacketType pType;
-
-                try
-                {
-                    pType = packetTypeFromName(name);
-                }
-                catch (Exception)
-                {
-                    continue;
-                }
-
-                loggedPackets[pType] = null;
-
-                proxy.AddDelegate(pType, Direction.Incoming, new PacketDelegate(LogPacketIn));
-                proxy.AddDelegate(pType, Direction.Outgoing, new PacketDelegate(LogPacketOut));
-            }
-        }
-    }
-
-    // NoLogAll: unregister logging delegates for all packets
-    private void NoLogAll()
-    {
-        Type packetTypeType = typeof(PacketType);
-        System.Reflection.MemberInfo[] packetTypes = packetTypeType.GetMembers();
-
-        for (int i = 0; i < packetTypes.Length; i++)
-        {
-            if (packetTypes[i].MemberType == System.Reflection.MemberTypes.Field && packetTypes[i].DeclaringType == packetTypeType)
-            {
-                string name = packetTypes[i].Name;
-                PacketType pType;
-
-                try
-                {
-                    pType = packetTypeFromName(name);
-                }
-                catch (Exception)
-                {
-                    continue;
-                }
-
-                loggedPackets.Remove(pType);
-
-                proxy.RemoveDelegate(pType, Direction.Incoming, new PacketDelegate(LogPacketIn));
-                proxy.RemoveDelegate(pType, Direction.Outgoing, new PacketDelegate(LogPacketOut));
-            }
-        }
-    }
-
-    // LogPacket: dump a packet to the console
-    private void LogPacket(Packet packet, IPEndPoint endPoint, Direction direction)
-    {
-        if (logGrep == null || (logGrep != null && Regex.IsMatch(packet.ToString(), logGrep)))
-        {
-            Console.WriteLine("{0} {1,21} {2,5} {3}{4}{5}"
-                     , direction == Direction.Incoming ? "<--" : "-->"
-                     , endPoint
-                     , packet.Header.Sequence
-                     , InterpretOptions(packet.Header.Flags)
-                     , Environment.NewLine
-                     , packet
-                     );
-        }
-    }
-
-    // InterpretOptions: produce a string representing a packet's header options
-    private static string InterpretOptions(byte options)
-    {
-        return "["
-             + ((options & Helpers.MSG_APPENDED_ACKS) != 0 ? "Ack" : "   ")
-             + " "
-             + ((options & Helpers.MSG_RESENT) != 0 ? "Res" : "   ")
-             + " "
-             + ((options & Helpers.MSG_RELIABLE) != 0 ? "Rel" : "   ")
-             + " "
-             + ((options & Helpers.MSG_ZEROCODED) != 0 ? "Zer" : "   ")
-             + "]"
-             ;
-    }
-}
diff --git a/old/libsl1550/SLProxy/ChatConsole.cs b/old/libsl1550/SLProxy/ChatConsole.cs
deleted file mode 100644
index b2b9b1d..0000000
--- a/old/libsl1550/SLProxy/ChatConsole.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * ChatConsole.cs: sample SLProxy appliation that writes chat to the console.
- *   Typing on the console will send chat to Second Life.
- *
- * Copyright (c) 2006 Austin Jennings
- * Modified by Andrew Ortman ("qode") on Decemeber 21, 2006 to work with the new pregen proxy.
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using SLProxy;
-using libsecondlife;
-using libsecondlife.Packets;
-using Nwc.XmlRpc;
-
-using System;
-using System.Collections;
-using System.Net;
-using System.Threading;
-
-public class ChatConsole {
-	private static Proxy proxy;
-	private static LLUUID agentID;
-	private static LLUUID sessionID;
-
-	public static void Main(string[] args) {
-		// configure the proxy
-		ProxyConfig proxyConfig = new ProxyConfig("ChatConsole V2", "Austin Jennings / Andrew Ortman", args);
-		proxy = new Proxy(proxyConfig);
-
-		// set a delegate for when the client logs in
-		proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(Login));
-
-		// add a delegate for incoming chat
-		proxy.AddDelegate(PacketType.ChatFromSimulator, Direction.Incoming, new PacketDelegate(ChatFromSimulator));
-
-		// start the proxy
-		proxy.Start();
-	}
-
-	private static void Login(XmlRpcResponse response) {
-		Hashtable values = (Hashtable)response.Value;
-		if (values.Contains("agent_id") && values.Contains("session_id")) {
-			// remember our agentID and sessionID
-			agentID = new LLUUID((string)values["agent_id"]);
-			sessionID = new LLUUID((string)values["session_id"]);
-
-			// start a new thread that reads lines from the console
-			(new Thread(new ThreadStart(ReadFromConsole))).Start();
-		}
-	}
-
-	private static void ReadFromConsole() {
-		// send text from the console in an infinite loop
-		for (;;) {
-			// read a line from the console
-			string message = Console.ReadLine();
-
-			// construct a ChatFromViewer packet
-            ChatFromViewerPacket chat = new ChatFromViewerPacket();
-            chat.ChatData.Channel = 0;
-            chat.ChatData.Message = Helpers.StringToField(message);
-            chat.ChatData.Type = (byte)1;
-
-            chat.AgentData.AgentID = agentID;
-            chat.AgentData.SessionID = sessionID;
-			// inject the packet
-			proxy.InjectPacket((Packet)chat, Direction.Outgoing);
-		}
-	}
-
-	private static Packet ChatFromSimulator(Packet packet, IPEndPoint sim) {
-		// deconstruct the packet
-        ChatFromSimulatorPacket chat = (ChatFromSimulatorPacket)packet;
-        string message = Helpers.FieldToUTF8String(chat.ChatData.Message);
-        string name = Helpers.FieldToUTF8String(chat.ChatData.FromName);
-        byte audible = chat.ChatData.Audible;
-        byte type = chat.ChatData.ChatType;
-
-		// if this was a normal, audible message, write it to the console
-		if (audible != 0 && (type == 0 || type == 1 || type == 2))
-			Console.WriteLine(name + ": " + message);
-
-		// return the packet unmodified
-		return packet;
-	}
-}
diff --git a/old/libsl1550/SLProxy/ChatConsole.csproj b/old/libsl1550/SLProxy/ChatConsole.csproj
deleted file mode 100644
index 685c301..0000000
--- a/old/libsl1550/SLProxy/ChatConsole.csproj
+++ /dev/null
@@ -1,108 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{D8ECCBE1-AC71-4054-AAA6-2D50E5629504}</ProjectGuid>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>
-    </ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>ChatConsole</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>ChatConsole</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>
-    </StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>full</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>..\..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>none</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.Data">
-      <Name>System.Data</Name>
-    </Reference>
-    <Reference Include="System.Xml">
-      <Name>System.XML</Name>
-    </Reference>
-    <ProjectReference Include="..\libsecondlife\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-    <ProjectReference Include="SLProxy.csproj">
-      <Name>SLProxy</Name>
-      <Project>{E4115DC9-FC88-47D6-B3B6-2400AD19B80D}</Project>
-      <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="ChatConsole.cs">
-      <SubType>Code</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>
-    </PostBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/Controller.h b/old/libsl1550/SLProxy/MacProxy/Launcher/Controller.h
deleted file mode 100644
index 2e931d5..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/Controller.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Controller */
-
-#import <Cocoa/Cocoa.h>
-
-#import "SLProxy.h"
-
-NSTask *killtask;
-
-@interface Controller : NSObject
-{
-}
-
-+ (void)terminateOnFailure:(NSTask *)task;
-+ (void)failBecause:(NSString *)reason;
-
-@end
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/Controller.m b/old/libsl1550/SLProxy/MacProxy/Launcher/Controller.m
deleted file mode 100644
index fff271b..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/Controller.m
+++ /dev/null
@@ -1,52 +0,0 @@
-#import "Controller.h"
-
-@implementation Controller
-
-+ (void)terminateOnFailure:(NSTask *)task {
-	killtask = task;
-}
-
-+ (void)failBecause:(NSString *)reason {
-	NSRunCriticalAlertPanel(@"Failed to start Second Life.", reason, @"Quit", nil, nil);
-	[NSApp terminate:nil];
-}
-
-- (void)runSecondLifeWithLoginURL:(NSURL *)URL {
-	/* Locate the user's installed copy of Second Life. */
-	CFURLRef SLAppURL;
-	if (LSFindApplicationForInfo(kLSUnknownCreator, NULL, (CFStringRef)@"Second Life.app", NULL, &SLAppURL)) {
-		[Controller failBecause:@"Second Life does not appear to be installed on your system."];
-	}
-
-	/* Launch Second Life and wait until it terminates. */
-	NSTask *task = [[NSTask alloc] init];
-	[task setLaunchPath:[[(NSURL *)SLAppURL path] stringByAppendingString:@"/Contents/MacOS/Second Life"]];
-	[task setArguments:[NSArray arrayWithObjects:@"-loginuri", [URL absoluteString], nil]];
-	[task launch];
-	[task waitUntilExit];
-	[task release];
-}
-
-- (id)init {
-	[super init];
-	killtask = nil;
-	return self;
-}
-
-- (void)awakeFromNib {
-	[NSApp setDelegate:self];
-}
-
-- (void)applicationDidFinishLaunching:(NSNotification *)notification {
-	/* Start the proxy, run Second Life, stop the proxy, and terminate. */
-	SLProxy *proxy = [[SLProxy alloc] init];
-	[self runSecondLifeWithLoginURL:[proxy loginURL]];
-	[proxy release];
-	[NSApp terminate:self];
-}
-
-- (void)applicationWillTerminate:(NSNotification *)notification {
-	[killtask terminate];
-}
-
-@end
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/InfoPlist.strings b/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/InfoPlist.strings
deleted file mode 100644
index 997688e..0000000
Binary files a/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/InfoPlist.strings and /dev/null differ
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/classes.nib b/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index aa4358a..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    IBClasses = (
-        {CLASS = Controller; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
-        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
-        {CLASS = SLProxy; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
-    );
-    IBVersion = 1;
-}
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/info.nib b/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/info.nib
deleted file mode 100644
index e113278..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/info.nib
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IBDocumentLocation</key>
-	<string>110 86 356 240 0 0 1440 878 </string>
-	<key>IBEditorPositions</key>
-	<dict>
-		<key>29</key>
-		<string>109 299 338 44 0 0 1440 878 </string>
-	</dict>
-	<key>IBFramework Version</key>
-	<string>446.1</string>
-	<key>IBSystem Version</key>
-	<string>8P2137</string>
-</dict>
-</plist>
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/keyedobjects.nib b/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/keyedobjects.nib
deleted file mode 100644
index 430b4de..0000000
Binary files a/old/libsl1550/SLProxy/MacProxy/Launcher/English.lproj/MainMenu.nib/keyedobjects.nib and /dev/null differ
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/Info.plist b/old/libsl1550/SLProxy/MacProxy/Launcher/Info.plist
deleted file mode 100644
index 2f34181..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/Info.plist
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
-	<key>CFBundleExecutable</key>
-	<string>Launcher</string>
-	<key>CFBundleIconFile</key>
-	<string>libsl.icns</string>
-	<key>CFBundleIdentifier</key>
-	<string>org.libsecondlife.macproxy.##ID##</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>##NAME##</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>1.0</string>
-	<key>LSUIElement</key>
-	<true/>
-	<key>MonoArguments</key>
-	<array>
-		<string>##EXE##</string>
-		<string>--proxy-verbose</string>
-		<string>--proxy-login-port=0</string>
-	</array>
-	<key>NSMainNibFile</key>
-	<string>MainMenu</string>
-	<key>NSPrincipalClass</key>
-	<string>NSApplication</string>
-</dict>
-</plist>
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/Launcher.xcodeproj/project.pbxproj b/old/libsl1550/SLProxy/MacProxy/Launcher/Launcher.xcodeproj/project.pbxproj
deleted file mode 100644
index 861fb7f..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/Launcher.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,297 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 42;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
-		8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
-		8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
-		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
-		D92540DD0BB9F4B400637A9C /* libsl.icns in Resources */ = {isa = PBXBuildFile; fileRef = D92540DC0BB9F4B400637A9C /* libsl.icns */; };
-		D925501C0BB9FC1B00637A9C /* Assemblies in Resources */ = {isa = PBXBuildFile; fileRef = D925501A0BB9FC1B00637A9C /* Assemblies */; };
-		D971F9C70BBA096500103A6D /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = D971F9C60BBA096500103A6D /* Controller.m */; };
-		D971FB330BBA213000103A6D /* SLProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = D971FB320BBA213000103A6D /* SLProxy.m */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
-		089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
-		1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
-		13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
-		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
-		29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
-		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
-		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
-		32CA4F630368D1EE00C91783 /* Launcher_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Launcher_Prefix.pch; sourceTree = "<group>"; };
-		8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
-		8D1107320486CEB800E47090 /* Launcher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Launcher.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		D92540DC0BB9F4B400637A9C /* libsl.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = libsl.icns; sourceTree = "<group>"; };
-		D925501A0BB9FC1B00637A9C /* Assemblies */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Assemblies; sourceTree = "<group>"; };
-		D971F9C50BBA096500103A6D /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = "<group>"; };
-		D971F9C60BBA096500103A6D /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = "<group>"; };
-		D971FB310BBA213000103A6D /* SLProxy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SLProxy.h; sourceTree = "<group>"; };
-		D971FB320BBA213000103A6D /* SLProxy.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SLProxy.m; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		8D11072E0486CEB800E47090 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		080E96DDFE201D6D7F000001 /* Classes */ = {
-			isa = PBXGroup;
-			children = (
-				D971F9C50BBA096500103A6D /* Controller.h */,
-				D971F9C60BBA096500103A6D /* Controller.m */,
-				D971FB310BBA213000103A6D /* SLProxy.h */,
-				D971FB320BBA213000103A6D /* SLProxy.m */,
-			);
-			name = Classes;
-			sourceTree = "<group>";
-		};
-		1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
-			);
-			name = "Linked Frameworks";
-			sourceTree = "<group>";
-		};
-		1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				29B97324FDCFA39411CA2CEA /* AppKit.framework */,
-				13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
-				29B97325FDCFA39411CA2CEA /* Foundation.framework */,
-			);
-			name = "Other Frameworks";
-			sourceTree = "<group>";
-		};
-		19C28FACFE9D520D11CA2CBB /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				8D1107320486CEB800E47090 /* Launcher.app */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		29B97314FDCFA39411CA2CEA /* Launcher */ = {
-			isa = PBXGroup;
-			children = (
-				080E96DDFE201D6D7F000001 /* Classes */,
-				29B97315FDCFA39411CA2CEA /* Other Sources */,
-				29B97317FDCFA39411CA2CEA /* Resources */,
-				29B97323FDCFA39411CA2CEA /* Frameworks */,
-				19C28FACFE9D520D11CA2CBB /* Products */,
-			);
-			name = Launcher;
-			sourceTree = "<group>";
-		};
-		29B97315FDCFA39411CA2CEA /* Other Sources */ = {
-			isa = PBXGroup;
-			children = (
-				32CA4F630368D1EE00C91783 /* Launcher_Prefix.pch */,
-				29B97316FDCFA39411CA2CEA /* main.m */,
-			);
-			name = "Other Sources";
-			sourceTree = "<group>";
-		};
-		29B97317FDCFA39411CA2CEA /* Resources */ = {
-			isa = PBXGroup;
-			children = (
-				8D1107310486CEB800E47090 /* Info.plist */,
-				089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
-				29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
-				D92540DC0BB9F4B400637A9C /* libsl.icns */,
-				D925501A0BB9FC1B00637A9C /* Assemblies */,
-			);
-			name = Resources;
-			sourceTree = "<group>";
-		};
-		29B97323FDCFA39411CA2CEA /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
-				1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		8D1107260486CEB800E47090 /* Launcher */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Launcher" */;
-			buildPhases = (
-				8D1107290486CEB800E47090 /* Resources */,
-				8D11072C0486CEB800E47090 /* Sources */,
-				8D11072E0486CEB800E47090 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = Launcher;
-			productInstallPath = "$(HOME)/Applications";
-			productName = Launcher;
-			productReference = 8D1107320486CEB800E47090 /* Launcher.app */;
-			productType = "com.apple.product-type.application";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		29B97313FDCFA39411CA2CEA /* Project object */ = {
-			isa = PBXProject;
-			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Launcher" */;
-			hasScannedForEncodings = 1;
-			mainGroup = 29B97314FDCFA39411CA2CEA /* Launcher */;
-			projectDirPath = "";
-			targets = (
-				8D1107260486CEB800E47090 /* Launcher */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-		8D1107290486CEB800E47090 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
-				8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
-				D92540DD0BB9F4B400637A9C /* libsl.icns in Resources */,
-				D925501C0BB9FC1B00637A9C /* Assemblies in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		8D11072C0486CEB800E47090 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				8D11072D0486CEB800E47090 /* main.m in Sources */,
-				D971F9C70BBA096500103A6D /* Controller.m in Sources */,
-				D971FB330BBA213000103A6D /* SLProxy.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
-		089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
-			isa = PBXVariantGroup;
-			children = (
-				089C165DFE840E0CC02AAC07 /* English */,
-			);
-			name = InfoPlist.strings;
-			sourceTree = "<group>";
-		};
-		29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
-			isa = PBXVariantGroup;
-			children = (
-				29B97319FDCFA39411CA2CEA /* English */,
-			);
-			name = MainMenu.nib;
-			sourceTree = "<group>";
-		};
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
-		C01FCF4B08A954540054247B /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
-				);
-				FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
-				GCC_MODEL_TUNING = G5;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				INFOPLIST_FILE = Info.plist;
-				INSTALL_PATH = "$(HOME)/Applications";
-				PRODUCT_NAME = Launcher;
-				WRAPPER_EXTENSION = app;
-				ZERO_LINK = YES;
-			};
-			name = Debug;
-		};
-		C01FCF4C08A954540054247B /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = ppc;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
-				);
-				FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
-				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-				GCC_MODEL_TUNING = G5;
-				INFOPLIST_FILE = Info.plist;
-				INSTALL_PATH = "$(HOME)/Applications";
-				PRODUCT_NAME = Launcher;
-				WRAPPER_EXTENSION = app;
-			};
-			name = Release;
-		};
-		C01FCF4F08A954540054247B /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				PREBINDING = NO;
-				SDKROOT = /Developer/SDKs/MacOSX10.3.9.sdk;
-			};
-			name = Debug;
-		};
-		C01FCF5008A954540054247B /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = ppc;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				PREBINDING = NO;
-				SDKROOT = /Developer/SDKs/MacOSX10.3.9.sdk;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Launcher" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				C01FCF4B08A954540054247B /* Debug */,
-				C01FCF4C08A954540054247B /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Launcher" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				C01FCF4F08A954540054247B /* Debug */,
-				C01FCF5008A954540054247B /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/Launcher_Prefix.pch b/old/libsl1550/SLProxy/MacProxy/Launcher/Launcher_Prefix.pch
deleted file mode 100644
index 7504e2d..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/Launcher_Prefix.pch
+++ /dev/null
@@ -1,7 +0,0 @@
-//
-// Prefix header for all source files of the 'Launcher' target in the 'Launcher' project
-//
-
-#ifdef __OBJC__
-    #import <Cocoa/Cocoa.h>
-#endif
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/SLProxy.h b/old/libsl1550/SLProxy/MacProxy/Launcher/SLProxy.h
deleted file mode 100644
index 7865a37..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/SLProxy.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* SLProxy */
-
-#import <Cocoa/Cocoa.h>
-
-#import "Controller.h"
-
-@interface SLProxy : NSObject
-{
-	NSTask *task;
-	NSURL *loginURL;
-}
-
-- (SLProxy *)init;
-- (void)dealloc;
-- (NSURL *)loginURL;
-
-@end
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/SLProxy.m b/old/libsl1550/SLProxy/MacProxy/Launcher/SLProxy.m
deleted file mode 100644
index 14d5afd..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/SLProxy.m
+++ /dev/null
@@ -1,60 +0,0 @@
-#import "SLProxy.h"
-
-#include <unistd.h>
-
-@implementation SLProxy
-
-- (SLProxy *)init {
-	[super init];
-
-	NSPipe *pipe = [NSPipe pipe];
-
-	/* Launch the proxy. */
-	task = [[NSTask alloc] init];
-	[task setLaunchPath:@"/Library/Frameworks/Mono.framework/Commands/mono"];
-	[task setCurrentDirectoryPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Assemblies"]];
-	[task setArguments:[[[NSBundle mainBundle] infoDictionary] valueForKey:@"MonoArguments"]];
-	[task setStandardOutput:[pipe fileHandleForWriting]];
-	NS_DURING
-		[task launch];
-	NS_HANDLER
-		[Controller failBecause:@"Mono does not appear to be installed on your system."];
-	NS_ENDHANDLER
-	[Controller terminateOnFailure:task];
-
-	/* Read the proxy's output to determine the login URL to give SL. */
-	int reader = [[pipe fileHandleForReading] fileDescriptor];
-	char c;
-	NSString *line = [NSString string];
-	for (;;) {
-		if (read(reader, &c, 1) != 1) {
-			[Controller failBecause:@"Unable to synchronize with proxy."];
-		} else if (c == '\n') {
-			break;
-		} else {
-			line = [line stringByAppendingFormat:@"%c", c];
-		}
-	}
-	[[pipe fileHandleForReading] closeFile]; // mono's ok with this; keep it from blocking on WriteLine
-	int port;
-	if (sscanf([line UTF8String], "proxy ready at http://127.0.0.1:%d/", &port) != 1) {
-		[Controller failBecause:@"Unable to synchronize with proxy."];
-	}
-	loginURL = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"http://127.0.0.1:%d/", port]];
-
-	return self;
-}
-
-- (void)dealloc {
-	/* Stop the proxy and clean up. */
-	[task terminate];
-	[task release];
-	[loginURL release];
-	[super dealloc];
-}
-
-- (NSURL *)loginURL {
-	return loginURL;
-}
-
-@end
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Info.plist b/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Info.plist
deleted file mode 100644
index 2f34181..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Info.plist
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
-	<key>CFBundleExecutable</key>
-	<string>Launcher</string>
-	<key>CFBundleIconFile</key>
-	<string>libsl.icns</string>
-	<key>CFBundleIdentifier</key>
-	<string>org.libsecondlife.macproxy.##ID##</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>##NAME##</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>1.0</string>
-	<key>LSUIElement</key>
-	<true/>
-	<key>MonoArguments</key>
-	<array>
-		<string>##EXE##</string>
-		<string>--proxy-verbose</string>
-		<string>--proxy-login-port=0</string>
-	</array>
-	<key>NSMainNibFile</key>
-	<string>MainMenu</string>
-	<key>NSPrincipalClass</key>
-	<string>NSApplication</string>
-</dict>
-</plist>
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/MacOS/Launcher b/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/MacOS/Launcher
deleted file mode 100644
index 1614cc4..0000000
Binary files a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/MacOS/Launcher and /dev/null differ
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/PkgInfo b/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/PkgInfo
deleted file mode 100644
index bd04210..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/PkgInfo
+++ /dev/null
@@ -1 +0,0 @@
-APPL????
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/InfoPlist.strings b/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/InfoPlist.strings
deleted file mode 100644
index 997688e..0000000
Binary files a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/InfoPlist.strings and /dev/null differ
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/classes.nib b/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index aa4358a..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    IBClasses = (
-        {CLASS = Controller; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
-        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
-        {CLASS = SLProxy; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
-    );
-    IBVersion = 1;
-}
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/info.nib b/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/info.nib
deleted file mode 100644
index e113278..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/info.nib
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IBDocumentLocation</key>
-	<string>110 86 356 240 0 0 1440 878 </string>
-	<key>IBEditorPositions</key>
-	<dict>
-		<key>29</key>
-		<string>109 299 338 44 0 0 1440 878 </string>
-	</dict>
-	<key>IBFramework Version</key>
-	<string>446.1</string>
-	<key>IBSystem Version</key>
-	<string>8P2137</string>
-</dict>
-</plist>
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
deleted file mode 100644
index 430b4de..0000000
Binary files a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and /dev/null differ
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/libsl.icns b/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/libsl.icns
deleted file mode 100644
index c35d47c..0000000
Binary files a/old/libsl1550/SLProxy/MacProxy/Launcher/build/Release/Launcher.app/Contents/Resources/libsl.icns and /dev/null differ
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/libsl.icns b/old/libsl1550/SLProxy/MacProxy/Launcher/libsl.icns
deleted file mode 100644
index c35d47c..0000000
Binary files a/old/libsl1550/SLProxy/MacProxy/Launcher/libsl.icns and /dev/null differ
diff --git a/old/libsl1550/SLProxy/MacProxy/Launcher/main.m b/old/libsl1550/SLProxy/MacProxy/Launcher/main.m
deleted file mode 100644
index 6d6f483..0000000
--- a/old/libsl1550/SLProxy/MacProxy/Launcher/main.m
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-//  main.m
-//  Launcher
-//
-//  Created by Austin Jennings on 07/03/27.
-//  Copyright __MyCompanyName__ 2007. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
-int main(int argc, char *argv[])
-{
-    return NSApplicationMain(argc,  (const char **) argv);
-}
diff --git a/old/libsl1550/SLProxy/MacProxy/README.txt b/old/libsl1550/SLProxy/MacProxy/README.txt
deleted file mode 100644
index 02848ea..0000000
--- a/old/libsl1550/SLProxy/MacProxy/README.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-MacProxy is a tool that packages an SLProxy application as a
-standalone Mac OS X application.  When double-clicked, the application
-will start the proxy in the background and open Second Life,
-configured to connect through the proxy.  The proxy runs entirely in
-the background, so its output will not be visible to the user.  You do
-not need to have a Mac to run MacProxy; any typical Unix-like
-environment with Perl installed should suffice.
-
-To use MacProxy, navigate to the MacProxy directory and type
-
-	./build.pl "Application Name" path/to/executable.exe \
-	path/to/libraries.dll ...
-
-For example, to create a standalone ChatConsole for the Mac:
-
-	./build.pl "Chat Console" ../../bin/ChatConsole.exe \
-	../../bin/SLProxy.dll ../../bin/libsecondlife.dll
-
-(Of course, this is entirely pointless, since ChatConsole provides no
-functionality unless run from a terminal.)
-
-CAVEATS
-
-The generated application will not work unless the user has the Mono
-framework installed.  This should be distributed separately, since
-it's huge.  The installer is available from
-http://www.mono-project.com/Downloads.
-
-MacProxy assumes that your proxy application accepts the standard
-suite of --proxy arguments via the command line (see SLProxy's
-documentation) and that it doesn't output anything of its own to
-stdout before the proxy is active.
diff --git a/old/libsl1550/SLProxy/MacProxy/build.pl b/old/libsl1550/SLProxy/MacProxy/build.pl
deleted file mode 100644
index ac666fe..0000000
--- a/old/libsl1550/SLProxy/MacProxy/build.pl
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/perl -w
-
-die "Usage: $0 \"Application Name\" path/to/executable.exe path/to/libraries.dll ...\n" unless @ARGV >= 2;
-
-die "Please run MacProxy from within its own directory.\n" unless -d 'Launcher';
-
-my ($appname, $exe, @libs) = @ARGV;
-
-print "Creating application bundle...\n";
-
-die "An application with that name already exists; aborting.\n" if -e "$appname.app";
-system('cp', '-r', 'Launcher/build/Release/Launcher.app', "$appname.app")
-and die "Failed; aborting.\n";
-
-print "Embedding assemblies...\n";
-
-system('cp', $exe, @libs, "$appname.app/Contents/Resources/Assemblies/")
-and die "Failed; aborting.\n";
-
-print "Writing metadata...\n";
-
-open(my $ii, '<', 'Launcher/Info.plist')
-or die "Failed to open Launcher/Info.plist; aborting.\n";
-open(my $io, '>', "$appname.app/Contents/Info.plist")
-or die "Failed to open $appname.app/Contents/Info.plist; aborting.\n";
-
-my $id = $appname;
-$id =~ s/[^a-z]//gi;
-$id = 'x' unless length $id;
-$exe =~ s!.*/!!;
-while (<$ii>) {
-	s/##NAME##/$appname/;
-	s/##ID##/$id/;
-	s/##EXE##/$exe/;
-	print $io $_;
-}
-
-close $ii;
-close $io;
-
-print "Packaging bundle...\n";
-
-system('tar', 'cjf', "$appname.tar.bz2", "$appname.app")
-and die "Failed to create archive; aborting.\n";
-system('rm', '-rf', "$appname.app")
-and die "Failed to remove application bundle; aborting.\n";
-
-system('ls', '-l', "$appname.tar.bz2")
-and print "Done.\n";
diff --git a/old/libsl1550/SLProxy/README.txt b/old/libsl1550/SLProxy/README.txt
deleted file mode 100644
index 993be3e..0000000
--- a/old/libsl1550/SLProxy/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-All information about SLProxy can be found on the libsecondlife wiki at http://www.libsecondlife.org/wiki/SLProxy
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/SLProxy.build b/old/libsl1550/SLProxy/SLProxy.build
deleted file mode 100644
index 01eed6d..0000000
--- a/old/libsl1550/SLProxy/SLProxy.build
+++ /dev/null
@@ -1,153 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="libsecondlife" default="build">
-
-  <!-- global framework settings -->
-  <property name="target.framework" value="${framework::get-target-framework()}" />
-  <property name="assembly.dir" value="${framework::get-assembly-directory(target.framework)}" />
-
-  <!-- global project settings -->
-  <xmlpeek
-    file="../libsecondlife.build"
-    xpath="/project/property[@name = 'project.version']/@value"
-    property="project.version" />
-  <property name="build.number"
-     value="${math::abs(math::floor(timespan::get-total-days(datetime::now()
-     - datetime::parse('01/01/2002'))))}" />
-  <property name="assembly" value="SLProxy"/>
-  <property name="bin_dir"  value="../bin" />
-
-  <!-- default configuration -->
-  <property name="project.config" value="debug" /> <!-- debug|release -->
-
-  <!-- named configurations -->
-  <target name="init" description="Initializes build properties">
-    <call target="${project.config}" />
-  </target>
-
-  <target name="debug" description="configures a debug build">
-    <property name="build.debug" value="true" />
-    <property name="package.name"
-	value="${project::get-name()}-${project.version}-${project.config}" />
-    <property name="assembly.configuration"
-      value="${framework::get-target-framework()}.${platform::get-name()} [${project.config}]" />
-  </target>
-
-  <target name="release" description="configures a release build">
-    <property name="project.config" value="release" />
-    <property name="build.debug" value="false" />
-    <property name="package.name"
-      value="${project::get-name()}-${project.version}" />
-    <property name="assembly.configuration"
-      value="${framework::get-target-framework()}.${platform::get-name()}" />
-  </target>
-
-  <!-- build tasks -->
-  <!-- target name="build" depends="build-analyst build-chatconsole build-main"
-     description="build analyst and chatconsole"
-       FIXME: Analyst's build is broken and Analyst and SLProxyLoader have
-              circular dependencies.  Skipping Analyst for now.  -axial -->
-  <target name="build" depends="build-analyst build-slproxy build-chatconsole build-main"
-     description="build SLProxy and chatconsole">
-  </target>
-
-  <target name="build-slproxy" depends="init"
-    description="Builds the binaries for the current configuration">
-    <echo message="Build Directory is ${bin_dir}/" />
-    <mkdir dir="${bin_dir}" failonerror="false" />
-    <csc
-      target="library"
-      debug="${build.debug}"
-      output="${bin_dir}/SLProxy.dll">
-      <sources failonempty="true">
-        <include name="SLProxy.cs" />
-        <include name="XmlRpcCS/*.cs" />
-        <include name="SLProxyLoader.cs" />
-        <!-- <include name="legacy/*.cs" /> -->
-      </sources>
-      <references basedir="${bin_dir}/">
-        <include name="libsecondlife.dll"/>
-      </references>
-    </csc>
-  </target>
-
-  <target name="build-analyst" depends="init build-slproxy"
-    description="Builds the binaries for the current configuration">
-    <echo message="Build Directory is ${bin_dir}/" />
-    <mkdir dir="${bin_dir}" failonerror="false" />
-    <csc
-      target="library"
-      debug="${build.debug}"
-      output="${bin_dir}/Analyst.dll">
-      <sources failonempty="true">
-        <include name="Analyst.cs" />
-        <!-- <include name="legacy/*.cs" /> -->
-      </sources>
-      <references basedir="${bin_dir}/">
-        <include name="libsecondlife.dll"/>
-        <include name="SLProxy.dll"/>
-      </references>
-    </csc>
-  </target>
-
-  <!-- Note - please, please, PLEASE, refrain from calling the executable
-       SLProxy.exe, as the name conflict with SLProxy.dll confuses Mono -->
-  <target name="build-main"
-    depends="init build-slproxy"
-    description="build SLProxy main">
-    <echo message="Build Directory is ${bin_dir}/" />
-    <mkdir dir="${bin_dir}" failonerror="false" />
-    <csc
-      target="exe"
-      debug="${build.debug}"
-      output="${bin_dir}/SLProxyMain.exe">
-      <sources failonempty="true">
-        <include name="SLProxyMain.cs" />
-      </sources>
-      <references basedir="${bin_dir}/">
-        <include name="libsecondlife.dll"/>
-        <include name="SLProxy.dll"/>
-        <include name="Analyst.dll"/>
-      </references>
-    </csc>
-  </target>
-
-  <target name="build-chatconsole"
-    depends="init build-slproxy"
-    description="build SLProxy ChatConsole">
-    <echo message="Build Directory is ${bin_dir}/" />
-    <mkdir dir="${bin_dir}" failonerror="false" />
-    <csc
-      target="exe"
-      debug="${build.debug}"
-      output="${bin_dir}/ChatConsole.exe">
-      <sources failonempty="true">
-        <include name="ChatConsole.cs" />
-      </sources>
-      <references basedir="${bin_dir}/">
-        <include name="libsecondlife.dll"/>
-        <include name="SLProxy.dll"/>
-      </references>
-    </csc>
-  </target>
-
-  <target name="clean" depends="init"
-    description="Deletes the current configuration">
-    <delete failonerror="false">
-      <fileset basedir="${bin_dir}/">
-        <include name="SLProxy.dll" />
-        <include name="SLProxy.dll.mdb" />
-        <include name="ChatConsole.exe" />
-        <include name="ChatConsole.exe.mdb" />
-        <include name="Analyst.exe" />
-        <include name="Analyst.exe.mdb" />
-      </fileset>
-    </delete>
-  </target>
-
-  <target
-    name="*"
-    description="Handles unknown targets">
-    <echo message="skipping unknown target" />
-  </target>
-</project>
diff --git a/old/libsl1550/SLProxy/SLProxy.cs b/old/libsl1550/SLProxy/SLProxy.cs
deleted file mode 100644
index f9b291d..0000000
--- a/old/libsl1550/SLProxy/SLProxy.cs
+++ /dev/null
@@ -1,2013 +0,0 @@
-/*
- * SLProxy.cs: implementation of Second Life proxy library
- *
- * Copyright (c) 2006 Austin Jennings
- * Pregen modifications made by Andrew Ortman on Dec 10, 2006 -> Dec 20, 2006
- *
- *
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-// #define DEBUG_SEQUENCE
-// #define DEBUG_CAPS
-// #define DEBUG_THREADS
-
-using Nwc.XmlRpc;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Net.Sockets;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Xml;
-using libsecondlife;
-using libsecondlife.StructuredData;
-using libsecondlife.Packets;
-
-// SLProxy: proxy library for Second Life
-namespace SLProxy
-{
-    // ProxyConfig: configuration for proxy objects
-    public class ProxyConfig
-    {
-        // userAgent: name of the proxy application
-        public string userAgent;
-        // author: email address of the proxy application's author
-        public string author;
-        // loginPort: port that the login proxy will listen on
-        public ushort loginPort = 8080;
-        // clientFacingAddress: address from which to communicate with the client
-        public IPAddress clientFacingAddress = IPAddress.Loopback;
-        // remoteFacingAddress: address from which to communicate with the server
-        public IPAddress remoteFacingAddress = IPAddress.Any;
-        // remoteLoginUri: URI for Second Life's login server
-        public Uri remoteLoginUri = new Uri("https://login.agni.lindenlab.com/cgi-bin/login.cgi");
-        // verbose: whether or not to print informative messages
-        public bool verbose = true;
-
-        // ProxyConfig: construct a default proxy configuration with the specified userAgent, author, and protocol
-        public ProxyConfig(string userAgent, string author)
-        {
-            this.userAgent = userAgent;
-            this.author = author;
-        }
-
-        // ProxyConfig: construct a default proxy configuration, parsing command line arguments (try --proxy-help)
-        public ProxyConfig(string userAgent, string author, string[] args)
-            : this(userAgent, author)
-        {
-            Dictionary<string, ArgumentParser> argumentParsers = new Dictionary<string, ArgumentParser>();
-            argumentParsers["proxy-help"] = new ArgumentParser(ParseHelp);
-            argumentParsers["proxy-login-port"] = new ArgumentParser(ParseLoginPort);
-            argumentParsers["proxy-client-facing-address"] = new ArgumentParser(ParseClientFacingAddress);
-            argumentParsers["proxy-remote-facing-address"] = new ArgumentParser(ParseRemoteFacingAddress);
-            argumentParsers["proxy-remote-login-uri"] = new ArgumentParser(ParseRemoteLoginUri);
-            argumentParsers["proxy-verbose"] = new ArgumentParser(ParseVerbose);
-            argumentParsers["proxy-quiet"] = new ArgumentParser(ParseQuiet);
-
-            foreach (string arg in args)
-                foreach (string argument in argumentParsers.Keys)
-                {
-                    Match match = (new Regex("^--" + argument + "(?:=(.*))?$")).Match(arg);
-                    if (match.Success)
-                    {
-                        string value;
-                        if (match.Groups[1].Captures.Count == 1)
-                            value = match.Groups[1].Captures[0].ToString();
-                        else
-                            value = null;
-                        try
-                        {
-                            ((ArgumentParser)argumentParsers[argument])(value);
-                        }
-                        catch
-                        {
-                            Console.WriteLine("invalid value for --" + argument);
-                            ParseHelp(null);
-                        }
-                    }
-                }
-        }
-
-        private delegate void ArgumentParser(string value);
-
-        private void ParseHelp(string value)
-        {
-            Console.WriteLine("Proxy command-line arguments:");
-            Console.WriteLine("  --proxy-help                        display this help");
-            Console.WriteLine("  --proxy-login-port=<port>           listen for logins on <port>");
-            Console.WriteLine("  --proxy-client-facing-address=<IP>  communicate with client via <IP>");
-            Console.WriteLine("  --proxy-remote-facing-address=<IP>  communicate with server via <IP>");
-            Console.WriteLine("  --proxy-remote-login-uri=<URI>      use SL login server at <URI>");
-            Console.WriteLine("  --proxy-verbose                     display proxy notifications");
-            Console.WriteLine("  --proxy-quiet                       suppress proxy notifications");
-
-            Environment.Exit(1);
-        }
-
-        private void ParseLoginPort(string value)
-        {
-            loginPort = Convert.ToUInt16(value);
-        }
-
-        private void ParseClientFacingAddress(string value)
-        {
-            clientFacingAddress = IPAddress.Parse(value);
-        }
-
-        private void ParseRemoteFacingAddress(string value)
-        {
-            remoteFacingAddress = IPAddress.Parse(value);
-        }
-
-        private void ParseRemoteLoginUri(string value)
-        {
-            remoteLoginUri = new Uri(value);
-        }
-
-        private void ParseVerbose(string value)
-        {
-            if (value != null)
-                throw new Exception();
-
-            verbose = true;
-        }
-
-        private void ParseQuiet(string value)
-        {
-            if (value != null)
-                throw new Exception();
-
-            verbose = false;
-        }
-    }
-
-    // Proxy: Second Life proxy server
-    // A Proxy instance is only prepared to deal with one client at a time.
-    public class Proxy
-    {
-        private ProxyConfig proxyConfig;
-        private string loginURI;
-
-        /*
-         * Proxy Management
-         */
-
-        // Proxy: construct a proxy server with the given configuration
-        public Proxy(ProxyConfig proxyConfig)
-        {
-            this.proxyConfig = proxyConfig;
-
-            InitializeLoginProxy();
-            InitializeSimProxy();
-            InitializeCaps();
-        }
-
-        object keepAliveLock = new Object();
-
-        // Start: begin accepting clients
-        public void Start()
-        {
-            lock (this)
-            {
-                System.Threading.Monitor.Enter(keepAliveLock);
-                (new Thread(new ThreadStart(KeepAlive))).Start();
-
-                RunSimProxy();
-                Thread runLoginProxy = new Thread(new ThreadStart(RunLoginProxy));
-                runLoginProxy.IsBackground = true;
-                runLoginProxy.Start();
-
-                IPEndPoint endPoint = (IPEndPoint)loginServer.LocalEndPoint;
-                IPAddress displayAddress;
-                if (endPoint.Address == IPAddress.Any)
-                    displayAddress = IPAddress.Loopback;
-                else
-                    displayAddress = endPoint.Address;
-                loginURI = "http://" + displayAddress + ":" + endPoint.Port + "/";
-
-                Log("proxy ready at " + loginURI, false);
-            }
-        }
-
-        // Stop: allow foreground threads to die
-        public void Stop()
-        {
-            lock (this)
-            {
-                System.Threading.Monitor.Exit(keepAliveLock);
-            }
-        }
-
-        // KeepAlive: blocks until the proxy is free to shut down
-        public void KeepAlive()
-        {
-#if DEBUG_THREADS
-		Console.WriteLine(">T> KeepAlive");
-#endif
-            lock (keepAliveLock) { };
-#if DEBUG_THREADS
-		Console.WriteLine("<T< KeepAlive");
-#endif
-
-        }
-
-        // SetLoginRequestDelegate: specify a callback loginRequestDelegate that will be called when the client requests login
-        public void SetLoginRequestDelegate(XmlRpcRequestDelegate loginRequestDelegate)
-        {
-            lock (this)
-            {
-                this.loginRequestDelegate = loginRequestDelegate;
-            }
-        }
-
-        // SetLoginResponseDelegate: specify a callback loginResponseDelegate that will be called when the server responds to login
-        public void SetLoginResponseDelegate(XmlRpcResponseDelegate loginResponseDelegate)
-        {
-            lock (this)
-            {
-                this.loginResponseDelegate = loginResponseDelegate;
-            }
-        }
-
-        // AddDelegate: add callback packetDelegate for packets of type packetName going direction
-        public void AddDelegate(PacketType packetType, Direction direction, PacketDelegate packetDelegate)
-        {
-            lock (this)
-            {
-                Dictionary<PacketType, List<PacketDelegate>> delegates = (direction == Direction.Incoming ? incomingDelegates : outgoingDelegates);
-                if (!delegates.ContainsKey(packetType))
-                {
-                    delegates[packetType] = new List<PacketDelegate>();
-                }
-                List<PacketDelegate> delegateArray = delegates[packetType];
-                if (!delegateArray.Contains(packetDelegate))
-                {
-                    delegateArray.Add(packetDelegate);
-                }
-            }
-        }
-
-        // RemoveDelegate: remove callback for packets of type packetName going direction
-        public void RemoveDelegate(PacketType packetType, Direction direction, PacketDelegate packetDelegate)
-        {
-            lock (this)
-            {
-                Dictionary<PacketType, List<PacketDelegate>> delegates = (direction == Direction.Incoming ? incomingDelegates : outgoingDelegates);
-                if (!delegates.ContainsKey(packetType))
-                {
-                    return;
-                }
-                List<PacketDelegate> delegateArray = delegates[packetType];
-                if (delegateArray.Contains(packetDelegate))
-                {
-                    delegateArray.Remove(packetDelegate);
-                }
-            }
-        }
-
-        private Packet callDelegates(Dictionary<PacketType, List<PacketDelegate>> delegates, Packet packet, IPEndPoint remoteEndPoint)
-        {
-            PacketType origType = packet.Type;
-            foreach (PacketDelegate del in delegates[origType])
-            {
-                packet = del(packet, remoteEndPoint);
-
-                // FIXME: how should we handle the packet type changing?
-                if (packet == null || packet.Type != origType) break;
-            }
-            return packet;
-        }
-
-        // InjectPacket: send packet to the client or server when direction is Incoming or Outgoing, respectively
-        public void InjectPacket(Packet packet, Direction direction)
-        {
-            lock (this)
-            {
-                if (activeCircuit == null)
-                {
-                    // no active circuit; queue the packet for injection once we have one
-                    List<Packet> queue = direction == Direction.Incoming ? queuedIncomingInjections : queuedOutgoingInjections;
-                    queue.Add(packet);
-                }
-                else
-                    // tell the active sim proxy to inject the packet
-                    ((SimProxy)simProxies[activeCircuit]).Inject(packet, direction);
-            }
-        }
-
-        // Log: write message to the console if in verbose mode
-        private void Log(object message, bool important)
-        {
-            if (proxyConfig.verbose || important)
-                Console.WriteLine(message);
-        }
-
-        /*
-         * Login Proxy
-         */
-
-        private Socket loginServer;
-        private int capsReqCount = 0;
-
-        // InitializeLoginProxy: initialize the login proxy
-        private void InitializeLoginProxy()
-        {
-            loginServer = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-            loginServer.Bind(new IPEndPoint(proxyConfig.clientFacingAddress, proxyConfig.loginPort));
-            loginServer.Listen(1);
-        }
-
-        // RunLoginProxy: process login requests from clients
-        private void RunLoginProxy()
-        {
-#if DEBUG_THREADS
-		Console.WriteLine(">T> RunLoginProxy");
-#endif
-            try
-            {
-                for (; ; )
-                {
-                    Socket client = loginServer.Accept();
-                    IPEndPoint clientEndPoint = (IPEndPoint)client.RemoteEndPoint;
-
-                    try
-                    {
-                        Thread connThread = new Thread((ThreadStart)delegate
-                        {
-#if DEBUG_THREADS
-					Console.WriteLine(">T> ProxyHTTP");
-#endif
-                            ProxyHTTP(client);
-#if DEBUG_THREADS
-					Console.WriteLine("<T< ProxyHTTP");
-				} catch (Exception e) {
-					Console.WriteLine("ProxyHTTP: {0}", e.Message);
-				}
-#endif
-                        });
-                        connThread.IsBackground = true;
-                        connThread.Start();
-                    }
-                    catch (Exception e)
-                    {
-                        Log("login failed: " + e.Message, false);
-                    }
-
-
-                    // send any packets queued for injection
-                    if (activeCircuit != null) lock (this)
-                        {
-                            SimProxy activeProxy = (SimProxy)simProxies[activeCircuit];
-                            foreach (Packet packet in queuedOutgoingInjections)
-                                activeProxy.Inject(packet, Direction.Outgoing);
-                            queuedOutgoingInjections = new List<Packet>();
-                        }
-                }
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine(e.Message);
-                Console.WriteLine(e.StackTrace);
-            }
-#if DEBUG_THREADS
-		Console.WriteLine("<T< RunLoginProxy");
-#endif
-        }
-
-        private class HandyNetReader
-        {
-            private NetworkStream netStream;
-            private const int BUF_SIZE = 8192;
-            private byte[] buf = new byte[BUF_SIZE];
-            private int bufFill = 0;
-
-            public HandyNetReader(NetworkStream s)
-            {
-                netStream = s;
-            }
-
-            public byte[] ReadLine()
-            {
-                int i = -1;
-                while (true)
-                {
-                    i = Array.IndexOf(buf, (byte)'\n', 0, bufFill);
-                    if (i >= 0) break;
-                    if (bufFill >= BUF_SIZE) return null;
-                    if (!ReadMore()) return null;
-                }
-                byte[] ret = new byte[i];
-                Array.Copy(buf, ret, i);
-                Array.Copy(buf, i + 1, buf, 0, bufFill - (i + 1));
-                bufFill -= i + 1;
-                return ret;
-            }
-
-            private bool ReadMore()
-            {
-                int n = netStream.Read(buf, bufFill, BUF_SIZE - bufFill);
-                bufFill += n;
-                return n > 0;
-            }
-
-            public int Read(byte[] rbuf, int start, int len)
-            {
-                int read = 0;
-                while (len > bufFill)
-                {
-                    Array.Copy(buf, 0, rbuf, start, bufFill);
-                    start += bufFill; len -= bufFill;
-                    read += bufFill; bufFill = 0;
-                    if (!ReadMore()) break;
-                }
-                Array.Copy(buf, 0, rbuf, start, len);
-                Array.Copy(buf, len, buf, 0, bufFill - len);
-                bufFill -= len; read += len;
-                return read;
-            }
-        }
-
-        // ProxyHTTP: proxy a HTTP request
-        private void ProxyHTTP(Socket client)
-        {
-            NetworkStream netStream = new NetworkStream(client);
-            HandyNetReader reader = new HandyNetReader(netStream);
-
-            string line = null;
-            int reqNo;
-            int contentLength = 0;
-            Match match;
-            string uri;
-            string meth;
-            Dictionary<string, string> headers = new Dictionary<string, string>();
-
-            lock (this)
-            {
-                capsReqCount++; reqNo = capsReqCount;
-            }
-
-            byte[] byteLine = reader.ReadLine();
-            if (byteLine != null) line = Encoding.UTF8.GetString(byteLine).Replace("\r", "");
-
-            if (line == null)
-                throw new Exception("EOF in client HTTP header");
-
-            match = new Regex(@"^(\S+)\s+(\S+)\s+(HTTP/\d\.\d)$").Match(line);
-
-            if (!match.Success)
-            {
-                Console.WriteLine("[" + reqNo + "] Bad request!");
-                byte[] wr = Encoding.ASCII.GetBytes("HTTP/1.0 400 Bad Request\r\nContent-Length: 0\r\n\r\n");
-                netStream.Write(wr, 0, wr.Length);
-                netStream.Close(); client.Close();
-                return;
-            }
-
-
-            meth = match.Groups[1].Captures[0].ToString();
-            uri = match.Groups[2].Captures[0].ToString();
-#if DEBUG_CAPS
-            Console.WriteLine("[" + reqNo + "] " + meth + ": " + uri); // FIXME - for debugging only
-#endif
-
-            // read HTTP header
-            do
-            {
-                // read one line of the header
-                line = Encoding.UTF8.GetString(reader.ReadLine()).Replace("\r", "");
-
-                // check for premature EOF
-                if (line == null)
-                    throw new Exception("EOF in client HTTP header");
-
-                if (line == "") break;
-
-                match = new Regex(@"^([^:]+):\s*(.*)$").Match(line);
-
-                if (!match.Success)
-                {
-                    Console.WriteLine("[" + reqNo + "] Bad header: '" + line + "'");
-                    byte[] wr = Encoding.ASCII.GetBytes("HTTP/1.0 400 Bad Request\r\nContent-Length: 0\r\n\r\n");
-                    netStream.Write(wr, 0, wr.Length);
-                    netStream.Close(); client.Close();
-                    return;
-                }
-
-                string key = match.Groups[1].Captures[0].ToString();
-                string val = match.Groups[2].Captures[0].ToString();
-                headers[key.ToLower()] = val;
-            } while (line != "");
-
-            if (headers.ContainsKey("content-length"))
-            {
-                contentLength = Convert.ToInt32(headers["content-length"]);
-            }
-
-            // read the HTTP body into a buffer
-            byte[] content = new byte[contentLength];
-            reader.Read(content, 0, contentLength);
-
-#if DEBUG_CAPS
-            if (contentLength < 8192) Console.WriteLine("[" + reqNo + "] request length = " + contentLength + ":\n" + Helpers.FieldToUTF8String(content) + "\n-------------");
-#endif
-
-            if (uri == "/")
-            {
-                ProxyLogin(netStream, content);
-            }
-            else if (new Regex(@"^/https?://.*$").Match(uri).Success)
-            {
-                ProxyCaps(netStream, meth, uri.Substring(1), headers, content, reqNo);
-            }
-            else
-            {
-                Console.WriteLine("404 not found: " + uri);
-                byte[] wr = Encoding.ASCII.GetBytes("HTTP/1.0 404 Not Found\r\nContent-Length: 0\r\n\r\n");
-                netStream.Write(wr, 0, wr.Length);
-                netStream.Close(); client.Close();
-                return;
-            }
-
-            netStream.Close();
-            client.Close();
-
-        }
-
-        private Dictionary<string, CapInfo> KnownCaps;
-        private Dictionary<string, bool> SubHack = new Dictionary<string, bool>();
-
-
-        private void ProxyCaps(NetworkStream netStream, string meth, string uri, Dictionary<string, string> headers, byte[] content, int reqNo)
-        {
-            Match match = new Regex(@"^(https?)://([^:/]+)(:\d+)?(/.*)$").Match(uri);
-            if (!match.Success)
-            {
-                Console.WriteLine("[" + reqNo + "] Malformed proxy URI: " + uri);
-                byte[] wr = Encoding.ASCII.GetBytes("HTTP/1.0 404 Not Found\r\nContent-Length: 0\r\n\r\n");
-                netStream.Write(wr, 0, wr.Length);
-                return;
-            }
-
-            //DEBUG: Console.WriteLine("[" + reqNo + "] : " + meth);
-            CapInfo cap = null;
-            lock (this)
-            {
-                if (KnownCaps.ContainsKey(uri))
-                {
-                    cap = KnownCaps[uri];
-                }
-            }
-
-            CapsRequest capReq = null; bool shortCircuit = false; bool requestFailed = false;
-            if (cap != null)
-            {
-                capReq = new CapsRequest(cap);
-
-                if (cap.ReqFmt == CapsDataFormat.LLSD)
-                {
-                    capReq.Request = LLSDParser.DeserializeXml(content);
-                }
-                else
-                {
-                    capReq.Request = content;
-                }
-
-                foreach (CapsDelegate d in cap.GetDelegates())
-                {
-                    if (d(capReq, CapsStage.Request)) { shortCircuit = true; break; }
-                }
-
-                if (cap.ReqFmt == CapsDataFormat.LLSD)
-                {
-                    content = LLSDParser.SerializeXmlBytes((LLSD)capReq.Request);
-                }
-                else
-                {
-                    content = (byte[])capReq.Request;
-                }
-            }
-
-            byte[] respBuf = null;
-            string consoleMsg = String.Empty;
-
-            if (shortCircuit)
-            {
-                byte[] wr = Encoding.UTF8.GetBytes("HTTP/1.0 200 OK\r\n");
-                netStream.Write(wr, 0, wr.Length);
-            }
-            else
-            {
-                HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(uri);
-                req.KeepAlive = false;
-                foreach (string header in headers.Keys)
-                {
-                    if (header == "accept" || header == "connection" ||
-                       header == "content-length" || header == "date" || header == "expect" ||
-                       header == "host" || header == "if-modified-since" || header == "referer" ||
-                       header == "transfer-encoding" || header == "user-agent" ||
-                       header == "proxy-connection")
-                    {
-                        // can't touch these!
-                    }
-                    else if (header == "content-type")
-                    {
-                        req.ContentType = headers["content-type"];
-                    }
-                    else
-                    {
-                        req.Headers[header] = headers[header];
-                    }
-                }
-
-                req.Method = meth;
-                req.ContentLength = content.Length;
-
-                HttpWebResponse resp;
-                try
-                {
-                    Stream reqStream = req.GetRequestStream();
-                    reqStream.Write(content, 0, content.Length);
-                    reqStream.Close();
-                    resp = (HttpWebResponse)req.GetResponse();
-                }
-                catch (WebException e)
-                {
-                    if (e.Status == WebExceptionStatus.Timeout || e.Status == WebExceptionStatus.SendFailure)
-                    {
-                        Console.WriteLine("Request timeout");
-                        byte[] wr = Encoding.ASCII.GetBytes("HTTP/1.0 504 Proxy Request Timeout\r\nContent-Length: 0\r\n\r\n");
-                        netStream.Write(wr, 0, wr.Length);
-                        return;
-                    }
-                    else if (e.Status == WebExceptionStatus.ProtocolError && e.Response != null)
-                    {
-                        resp = (HttpWebResponse)e.Response; requestFailed = true;
-                    }
-                    else
-                    {
-                        Console.WriteLine("Request error: " + e.ToString());
-                        byte[] wr = Encoding.ASCII.GetBytes("HTTP/1.0 502 Gateway Error\r\nContent-Length: 0\r\n\r\n"); // FIXME
-                        netStream.Write(wr, 0, wr.Length);
-                        return;
-                    }
-                }
-
-                try
-                {
-                    Stream respStream = resp.GetResponseStream();
-                    int read;
-                    int length = 0;
-                    respBuf = new byte[256];
-
-                    do
-                    {
-                        read = respStream.Read(respBuf, length, 256);
-                        if (read > 0)
-                        {
-                            length += read;
-                            Array.Resize(ref respBuf, length + 256);
-                        }
-                    } while (read > 0);
-
-                    Array.Resize(ref respBuf, length);
-
-                    if (capReq != null && !requestFailed)
-                    {
-                        if (cap.RespFmt == CapsDataFormat.LLSD)
-                        {
-                            capReq.Response = LLSDParser.DeserializeXml(respBuf);
-                        }
-                        else
-                        {
-                            capReq.Response = respBuf;
-                        }
-
-                    }
-
-                    consoleMsg += "[" + reqNo + "] Response from " + uri + "\nStatus: " + (int)resp.StatusCode + " " + resp.StatusDescription + "\n";
-
-                    {
-                        byte[] wr = Encoding.UTF8.GetBytes("HTTP/1.0 " + (int)resp.StatusCode + " " + resp.StatusDescription + "\r\n");
-                        netStream.Write(wr, 0, wr.Length);
-                    }
-
-                    for (int i = 0; i < resp.Headers.Count; i++)
-                    {
-                        string key = resp.Headers.Keys[i];
-                        string val = resp.Headers[i];
-                        string lkey = key.ToLower();
-                        if (lkey != "content-length" && lkey != "transfer-encoding" && lkey != "connection")
-                        {
-                            consoleMsg += key + ": " + val + "\n";
-                            byte[] wr = Encoding.UTF8.GetBytes(key + ": " + val + "\r\n");
-                            netStream.Write(wr, 0, wr.Length);
-                        }
-                    }
-                }
-                catch (Exception)
-                {
-                    // TODO: Should we handle this somehow?
-                }
-            }
-
-            if (cap != null && !requestFailed)
-            {
-                foreach (CapsDelegate d in cap.GetDelegates())
-                {
-                    try
-                    {
-                        if (d(capReq, CapsStage.Response)) { break; }
-                    }
-                    catch (Exception e)
-                    {
-                        Console.WriteLine(e.ToString()); break;
-                    }
-                }
-
-                if (cap.RespFmt == CapsDataFormat.LLSD)
-                {
-                    respBuf = LLSDParser.SerializeXmlBytes((LLSD)capReq.Response);
-                }
-                else
-                {
-                    respBuf = (byte[])capReq.Response;
-                }
-            }
-
-
-            consoleMsg += "\n" + Encoding.UTF8.GetString(respBuf) + "\n--------";
-#if DEBUG_CAPS
-            Console.WriteLine(consoleMsg);
-#endif
-
-            /* try {
-                if(resp.StatusCode == HttpStatusCode.OK) respBuf = CapsFixup(uri,respBuf);
-            } catch(Exception e) {
-                Console.WriteLine("["+reqNo+"] Couldn't fixup response: "+e.ToString());
-            } */
-
-#if DEBUG_CAPS
-            Console.WriteLine("[" + reqNo + "] Fixed-up response:\n" + Encoding.UTF8.GetString(respBuf) + "\n--------");
-#endif
-
-            try
-            {
-                byte[] wr2 = Encoding.UTF8.GetBytes("Content-Length: " + respBuf.Length + "\r\n\r\n");
-                netStream.Write(wr2, 0, wr2.Length);
-
-                netStream.Write(respBuf, 0, respBuf.Length);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine(e.ToString());
-            }
-
-            return;
-        }
-
-        private bool FixupSeedCapsResponse(CapsRequest capReq, CapsStage stage)
-        {
-            if (stage != CapsStage.Response) return false;
-
-            Dictionary<string, object> m = (Dictionary<string, object>)capReq.Response;
-            Dictionary<string, object> nm = new Dictionary<string, object>();
-            foreach (string key in m.Keys)
-            {
-                string val = (string)m[key];
-                if (!String.IsNullOrEmpty(val))
-                {
-                    if (!KnownCaps.ContainsKey(val))
-                    {
-                        CapInfo newCap = new CapInfo(val, capReq.Info.Sim, key);
-                        newCap.AddDelegate(new CapsDelegate(KnownCapDelegate));
-                        lock (this) { KnownCaps[val] = newCap; }
-                    }
-                    nm[key] = loginURI + val;
-                }
-                else
-                {
-                    nm[key] = val;
-                }
-            }
-            capReq.Response = nm;
-            return false;
-        }
-
-        private Dictionary<string, List<CapsDelegate>> KnownCapsDelegates = new Dictionary<string, List<CapsDelegate>>();
-
-
-        private void InitializeCaps()
-        {
-
-            AddCapsDelegate("EventQueueGet", new CapsDelegate(FixupEventQueueGet));
-        }
-
-        public void AddCapsDelegate(string CapName, CapsDelegate capsDelegate)
-        {
-            lock (this)
-            {
-
-                if (!KnownCapsDelegates.ContainsKey(CapName))
-                {
-                    KnownCapsDelegates[CapName] = new List<CapsDelegate>();
-                }
-                List<CapsDelegate> delegateArray = KnownCapsDelegates[CapName];
-                if (!delegateArray.Contains(capsDelegate))
-                {
-                    delegateArray.Add(capsDelegate);
-                }
-            }
-        }
-
-        public void RemoveCapRequestDelegate(string CapName, CapsDelegate capsDelegate)
-        {
-            lock (this)
-            {
-
-                if (!KnownCapsDelegates.ContainsKey(CapName))
-                {
-                    return;
-                }
-                List<CapsDelegate> delegateArray = KnownCapsDelegates[CapName];
-                if (delegateArray.Contains(capsDelegate))
-                {
-                    delegateArray.Remove(capsDelegate);
-                }
-            }
-        }
-
-        private bool KnownCapDelegate(CapsRequest capReq, CapsStage stage)
-        {
-            lock (this)
-            {
-                if (!KnownCapsDelegates.ContainsKey(capReq.Info.CapType))
-                    return false;
-
-                List<CapsDelegate> delegates = KnownCapsDelegates[capReq.Info.CapType];
-
-                foreach (CapsDelegate d in delegates)
-                {
-                    if (d(capReq, stage)) { return true; }
-                }
-            }
-
-            return false;
-        }
-
-        private bool FixupEventQueueGet(CapsRequest capReq, CapsStage stage)
-        {
-            if (stage != CapsStage.Response) return false;
-
-            foreach (Dictionary<string, object> evt in (List<object>)((Dictionary<string, object>)capReq.Response)["events"])
-            {
-                string message = (string)evt["message"];
-                Dictionary<string, object> body = (Dictionary<string, object>)evt["body"];
-                if (message == "TeleportFinish" || message == "CrossedRegion")
-                {
-                    Dictionary<string, object> info = null;
-                    if (message == "TeleportFinish")
-                        info = (Dictionary<string, object>)(((List<object>)body["Info"])[0]);
-                    else
-                        info = (Dictionary<string, object>)(((List<object>)body["RegionData"])[0]);
-                    byte[] bytes = (byte[])info["SimIP"];
-                    uint simIP = Helpers.BytesToUIntBig((byte[])info["SimIP"]);
-                    ushort simPort = (ushort)(int)info["SimPort"];
-                    string capsURL = (string)info["SeedCapability"];
-                    GenericCheck(ref simIP, ref simPort, ref capsURL, capReq.Info.Sim == activeCircuit);
-                    info["SeedCapability"] = capsURL;
-                    bytes[0] = (byte)(simIP % 256);
-                    bytes[1] = (byte)((simIP >> 8) % 256);
-                    bytes[2] = (byte)((simIP >> 16) % 256);
-                    bytes[3] = (byte)((simIP >> 24) % 256);
-                    info["SimIP"] = bytes;
-                    info["SimPort"] = (int)simPort;
-                }
-                else if (message == "EstablishAgentCommunication")
-                {
-                    string ipAndPort = (string)body["sim-ip-and-port"];
-                    string[] pieces = ipAndPort.Split(':');
-                    byte[] bytes = IPAddress.Parse(pieces[0]).GetAddressBytes();
-                    uint simIP = (uint)(bytes[0] + (bytes[1] << 8) + (bytes[2] << 16) + (bytes[3] << 24));
-                    ushort simPort = (ushort)Convert.ToInt32(pieces[1]);
-
-                    string capsURL = (string)body["seed-capability"];
-                    Console.WriteLine("DEBUG: Got EstablishAgentCommunication for " + ipAndPort + " with seed cap " + capsURL);
-                    GenericCheck(ref simIP, ref simPort, ref capsURL, false);
-                    body["seed-capability"] = capsURL;
-                    body["sim-ip-and-port"] = new IPAddress((uint)simIP).ToString() + ":" + simPort;
-                    Console.WriteLine("DEBUG: Modified EstablishAgentCommunication to " + (string)body["sim-ip-and-port"] + " with seed cap " + capsURL);
-                }
-            }
-
-            return false;
-        }
-
-        private void ProxyLogin(NetworkStream netStream, byte[] content)
-        {
-            lock (this)
-            {
-                // convert the body into an XML-RPC request
-                XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(Encoding.UTF8.GetString(content));
-
-                // call the loginRequestDelegate
-                if (loginRequestDelegate != null)
-                    try
-                    {
-                        loginRequestDelegate(request);
-                    }
-                    catch (Exception e)
-                    {
-                        Log("exception in login request deligate: " + e.Message, true);
-                        Log(e.StackTrace, true);
-                    }
-
-                // add our userAgent and author to the request
-                System.Collections.Hashtable requestParams = new System.Collections.Hashtable();
-                if (proxyConfig.userAgent != null)
-                    requestParams["user-agent"] = proxyConfig.userAgent;
-                if (proxyConfig.author != null)
-                    requestParams["author"] = proxyConfig.author;
-                request.Params.Add(requestParams);
-
-                XmlRpcResponse response;
-                try
-                {
-                    // forward the XML-RPC request to the server
-                    response = (XmlRpcResponse)request.Send(proxyConfig.remoteLoginUri.ToString(),
-                        60000); //added 60 second timeout -- Andrew
-                }
-                catch (Exception e)
-                {
-                    Console.WriteLine(e.Message);
-                    return;
-                }
-
-                System.Collections.Hashtable responseData = (System.Collections.Hashtable)response.Value;
-
-                // proxy any simulator address given in the XML-RPC response
-                if (responseData.Contains("sim_ip") && responseData.Contains("sim_port"))
-                {
-                    IPEndPoint realSim = new IPEndPoint(IPAddress.Parse((string)responseData["sim_ip"]), Convert.ToUInt16(responseData["sim_port"]));
-                    IPEndPoint fakeSim = ProxySim(realSim);
-                    responseData["sim_ip"] = fakeSim.Address.ToString();
-                    responseData["sim_port"] = fakeSim.Port;
-                    activeCircuit = realSim;
-                }
-
-                // start a new proxy session
-                Reset();
-
-                if (responseData.Contains("seed_capability"))
-                {
-                    CapInfo info = new CapInfo((string)responseData["seed_capability"], activeCircuit, "SeedCapability");
-                    info.AddDelegate(new CapsDelegate(FixupSeedCapsResponse));
-
-                    KnownCaps[(string)responseData["seed_capability"]] = info;
-                    responseData["seed_capability"] = loginURI + responseData["seed_capability"];
-                }
-
-                // call the loginResponseDelegate
-                if (loginResponseDelegate != null)
-                {
-                    try
-                    {
-                        loginResponseDelegate(response);
-                    }
-                    catch (Exception e)
-                    {
-                        Log("exception in login response delegate: " + e.Message, true);
-                        Log(e.StackTrace, true);
-                    }
-                }
-
-                // forward the XML-RPC response to the client
-                StreamWriter writer = new StreamWriter(netStream);
-                writer.Write("HTTP/1.0 200 OK\r\n");
-                writer.Write("Content-type: text/xml\r\n");
-                writer.Write("\r\n");
-
-                XmlTextWriter responseWriter = new XmlTextWriter(writer);
-                XmlRpcResponseSerializer.Singleton.Serialize(responseWriter, response);
-                responseWriter.Close(); writer.Close();
-            }
-        }
-
-        /*
-         * Sim Proxy
-         */
-
-        private Socket simFacingSocket;
-        private IPEndPoint activeCircuit = null;
-        private Dictionary<IPEndPoint, IPEndPoint> proxyEndPoints = new Dictionary<IPEndPoint, IPEndPoint>();
-        private Dictionary<IPEndPoint, SimProxy> simProxies = new Dictionary<IPEndPoint, SimProxy>();
-        private Dictionary<EndPoint, SimProxy> proxyHandlers = new Dictionary<EndPoint, SimProxy>();
-        private XmlRpcRequestDelegate loginRequestDelegate = null;
-        private XmlRpcResponseDelegate loginResponseDelegate = null;
-        private Dictionary<PacketType, List<PacketDelegate>> incomingDelegates = new Dictionary<PacketType, List<PacketDelegate>>();
-        private Dictionary<PacketType, List<PacketDelegate>> outgoingDelegates = new Dictionary<PacketType, List<PacketDelegate>>();
-        private List<Packet> queuedIncomingInjections = new List<Packet>();
-        private List<Packet> queuedOutgoingInjections = new List<Packet>();
-
-        // InitializeSimProxy: initialize the sim proxy
-        private void InitializeSimProxy()
-        {
-            InitializeAddressCheckers();
-
-            simFacingSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-            simFacingSocket.Bind(new IPEndPoint(proxyConfig.remoteFacingAddress, 0));
-            Reset();
-        }
-
-        // Reset: start a new session
-        private void Reset()
-        {
-            foreach (SimProxy simProxy in simProxies.Values)
-                simProxy.Reset();
-            KnownCaps = new Dictionary<string, CapInfo>();
-        }
-
-        private byte[] receiveBuffer = new byte[8192];
-        private byte[] zeroBuffer = new byte[8192];
-        private EndPoint remoteEndPoint = (EndPoint)new IPEndPoint(IPAddress.Any, 0);
-
-        // RunSimProxy: start listening for packets from remote sims
-        private void RunSimProxy()
-        {
-#if DEBUG_THREADS
-		Console.WriteLine(">R> RunSimProxy");
-#endif
-            simFacingSocket.BeginReceiveFrom(receiveBuffer, 0, receiveBuffer.Length, SocketFlags.None, ref remoteEndPoint, new AsyncCallback(ReceiveFromSim), null);
-        }
-
-        // ReceiveFromSim: packet received from a remote sim
-        private void ReceiveFromSim(IAsyncResult ar)
-        {
-            lock (this) try
-                {
-                    // pause listening and fetch the packet
-                    bool needsZero = false;
-                    bool needsCopy = true;
-                    int length;
-                    length = simFacingSocket.EndReceiveFrom(ar, ref remoteEndPoint);
-
-                    if (proxyHandlers.ContainsKey(remoteEndPoint))
-                    {
-                        // find the proxy responsible for forwarding this packet
-                        SimProxy simProxy = (SimProxy)proxyHandlers[remoteEndPoint];
-
-                        // interpret the packet according to the SL protocol
-                        Packet packet;
-                        int end = length - 1;
-
-                        packet = Packet.BuildPacket(receiveBuffer, ref end, zeroBuffer);
-#if DEBUG_SEQUENCE
-				Console.WriteLine("<- " + packet.Type + " #" + packet.Header.Sequence);
-#endif
-
-                        // check for ACKs we're waiting for
-                        packet = simProxy.CheckAcks(packet, Direction.Incoming, ref length, ref needsCopy);
-
-                        // modify sequence numbers to account for injections
-                        uint oldSequence = packet.Header.Sequence;
-                        packet = simProxy.ModifySequence(packet, Direction.Incoming, ref length, ref needsCopy);
-
-                        // keep track of sequence numbers
-                        if (packet.Header.Sequence > simProxy.incomingSequence)
-                            simProxy.incomingSequence = packet.Header.Sequence;
-
-                        // check the packet for addresses that need proxying
-                        if (incomingCheckers.ContainsKey(packet.Type))
-                        {
-                            /* if (needsZero) {
-                                length = Helpers.ZeroDecode(packet.Header.Data, length, zeroBuffer);
-                                packet.Header.Data = zeroBuffer;
-                                needsZero = false;
-                            } */
-
-                            Packet newPacket = ((AddressChecker)incomingCheckers[packet.Type])(packet);
-                            SwapPacket(packet, newPacket);
-                            packet = newPacket;
-                            needsCopy = false;
-                        }
-
-                        // pass the packet to any callback delegates
-                        if (incomingDelegates.ContainsKey(packet.Type))
-                        {
-                            /* if (needsZero) {
-                                length = Helpers.ZeroDecode(packet.Header.Data, length, zeroBuffer);
-                                packet.Header.Data = zeroBuffer;
-                                needsCopy = true;
-                            } */
-
-                            if (needsCopy)
-                            {
-                                byte[] newData = new byte[packet.Header.Data.Length];
-                                Array.Copy(packet.Header.Data, 0, newData, 0, packet.Header.Data.Length);
-                                packet.Header.Data = newData; // FIXME
-                            }
-
-                            try
-                            {
-                                Packet newPacket = callDelegates(incomingDelegates, packet, (IPEndPoint)remoteEndPoint);
-                                if (newPacket == null)
-                                {
-                                    if ((packet.Header.Flags & Helpers.MSG_RELIABLE) != 0)
-                                        simProxy.Inject(SpoofAck(oldSequence), Direction.Outgoing);
-
-                                    if ((packet.Header.Flags & Helpers.MSG_APPENDED_ACKS) != 0)
-                                        packet = SeparateAck(packet);
-                                    else
-                                        packet = null;
-                                }
-                                else
-                                {
-                                    bool oldReliable = (packet.Header.Flags & Helpers.MSG_RELIABLE) != 0;
-                                    bool newReliable = (newPacket.Header.Flags & Helpers.MSG_RELIABLE) != 0;
-                                    if (oldReliable && !newReliable)
-                                        simProxy.Inject(SpoofAck(oldSequence), Direction.Outgoing);
-                                    else if (!oldReliable && newReliable)
-                                        simProxy.WaitForAck(packet, Direction.Incoming);
-
-                                    SwapPacket(packet, newPacket);
-                                    packet = newPacket;
-                                }
-                            }
-                            catch (Exception e)
-                            {
-                                Log("exception in incoming delegate: " + e.Message, true);
-                                Log(e.StackTrace, true);
-                            }
-
-                            if (packet != null)
-                                simProxy.SendPacket(packet, false);
-                        }
-                        else
-                            simProxy.SendPacket(packet, needsZero);
-                    }
-                    else
-                        // ignore packets from unknown peers
-                        Log("dropping packet from " + remoteEndPoint, false);
-                }
-                catch (Exception e)
-                {
-                    Console.WriteLine(e.Message);
-                    Console.WriteLine(e.StackTrace);
-                }
-                finally
-                {
-                    // resume listening
-                    simFacingSocket.BeginReceiveFrom(receiveBuffer, 0, receiveBuffer.Length, SocketFlags.None, ref remoteEndPoint, new AsyncCallback(ReceiveFromSim), null);
-                }
-        }
-
-        // SendPacket: send a packet to a sim from our fake client endpoint
-        public void SendPacket(Packet packet, IPEndPoint endPoint, bool skipZero)
-        {
-            byte[] buffer = packet.ToBytes();
-            if (skipZero || (packet.Header.Data[0] & Helpers.MSG_ZEROCODED) == 0)
-                simFacingSocket.SendTo(buffer, buffer.Length, SocketFlags.None, endPoint);
-            else
-            {
-                int zeroLength = Helpers.ZeroEncode(buffer, buffer.Length, zeroBuffer);
-                simFacingSocket.SendTo(zeroBuffer, zeroLength, SocketFlags.None, endPoint);
-            }
-
-        }
-
-        // SpoofAck: create an ACK for the given packet
-        public Packet SpoofAck(uint sequence)
-        {
-            PacketAckPacket spoof = new PacketAckPacket();
-            spoof.Packets = new PacketAckPacket.PacketsBlock[1];
-            spoof.Packets[0] = new PacketAckPacket.PacketsBlock();
-            spoof.Packets[0].ID = sequence;
-            return (Packet)spoof;
-            //Legacy:
-            ////Hashtable blocks = new Hashtable();
-            ////Hashtable fields = new Hashtable();
-            ////fields["ID"] = (uint)sequence;
-            ////blocks[fields] = "Packets";
-            ////return .BuildPacket("PacketAck", proxyConfig.protocol, blocks, Helpers.MSG_ZEROCODED);
-        }
-
-        // SeparateAck: create a standalone PacketAck for packet's appended ACKs
-        public Packet SeparateAck(Packet packet)
-        {
-            PacketAckPacket seperate = new PacketAckPacket();
-            seperate.Packets = new PacketAckPacket.PacketsBlock[packet.Header.AckList.Length];
-
-            for (int i = 0; i < packet.Header.AckList.Length; ++i)
-            {
-                seperate.Packets[i].ID = packet.Header.AckList[i];
-            }
-
-            Packet ack = seperate;
-            ack.Header.Sequence = packet.Header.Sequence;
-            return ack;
-        }
-
-        // SwapPacket: copy the sequence number and appended ACKs from one packet to another
-        public static void SwapPacket(Packet oldPacket, Packet newPacket)
-        {
-            newPacket.Header.Sequence = oldPacket.Header.Sequence;
-
-            int oldAcks = (oldPacket.Header.Data[0] & Helpers.MSG_APPENDED_ACKS) == 0 ? 0 : oldPacket.Header.AckList.Length;
-            int newAcks = (newPacket.Header.Data[0] & Helpers.MSG_APPENDED_ACKS) == 0 ? 0 : newPacket.Header.AckList.Length;
-
-            if (oldAcks != 0 || newAcks != 0)
-            {
-
-                uint[] newAckList = new uint[oldAcks];
-                Array.Copy(oldPacket.Header.AckList, 0, newAckList, 0, oldAcks);
-
-                newPacket.Header.AckList = newAckList;
-                newPacket.Header.AppendedAcks = oldPacket.Header.AppendedAcks;
-
-            }
-        }
-
-        // ProxySim: return the proxy for the specified sim, creating it if it doesn't exist
-        private IPEndPoint ProxySim(IPEndPoint simEndPoint)
-        {
-            if (proxyEndPoints.ContainsKey(simEndPoint))
-                // return the existing proxy
-                return (IPEndPoint)proxyEndPoints[simEndPoint];
-            else
-            {
-                // return a new proxy
-                SimProxy simProxy = new SimProxy(proxyConfig, simEndPoint, this);
-                IPEndPoint fakeSim = simProxy.LocalEndPoint();
-                Log("creating proxy for " + simEndPoint + " at " + fakeSim, false);
-                simProxy.Run();
-                proxyEndPoints.Add(simEndPoint, fakeSim);
-                simProxies.Add(simEndPoint, simProxy);
-                return fakeSim;
-            }
-        }
-
-        // AddHandler: remember which sim proxy corresponds to a given sim
-        private void AddHandler(EndPoint endPoint, SimProxy proxy)
-        {
-            proxyHandlers.Add(endPoint, proxy);
-        }
-
-        // SimProxy: proxy for a single simulator
-        private class SimProxy
-        {
-            private ProxyConfig proxyConfig;
-            private IPEndPoint remoteEndPoint;
-            private Proxy proxy;
-            private Socket socket;
-            public uint incomingSequence;
-            public uint outgoingSequence;
-            private List<uint> incomingInjections;
-            private List<uint> outgoingInjections;
-            private uint incomingOffset = 0;
-            private uint outgoingOffset = 0;
-            private Dictionary<uint, Packet> incomingAcks;
-            private Dictionary<uint, Packet> outgoingAcks;
-            private List<uint> incomingSeenAcks;
-            private List<uint> outgoingSeenAcks;
-
-            // SimProxy: construct a proxy for a single simulator
-            public SimProxy(ProxyConfig proxyConfig, IPEndPoint simEndPoint, Proxy proxy)
-            {
-                this.proxyConfig = proxyConfig;
-                remoteEndPoint = new IPEndPoint(simEndPoint.Address, simEndPoint.Port);
-                this.proxy = proxy;
-                socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-                socket.Bind(new IPEndPoint(proxyConfig.clientFacingAddress, 0));
-                proxy.AddHandler(remoteEndPoint, this);
-                Reset();
-            }
-
-            // Reset: start a new session
-            public void Reset()
-            {
-                incomingSequence = 0;
-                outgoingSequence = 0;
-                incomingInjections = new List<uint>();
-                outgoingInjections = new List<uint>();
-                incomingAcks = new Dictionary<uint, Packet>();
-                outgoingAcks = new Dictionary<uint, Packet>();
-                incomingSeenAcks = new List<uint>();
-                outgoingSeenAcks = new List<uint>();
-            }
-
-            // BackgroundTasks: resend unacknowledged packets and keep data structures clean
-            private void BackgroundTasks()
-            {
-#if DEBUG_THREADS
-		    Console.WriteLine(">T> BackgroundTasks-{0}", LocalEndPoint().Port);
-#endif
-                try
-                {
-                    int tick = 1;
-                    int incomingInjectionsPoint = 0;
-                    int outgoingInjectionsPoint = 0;
-                    int incomingSeenAcksPoint = 0;
-                    int outgoingSeenAcksPoint = 0;
-
-                    for (; ; Thread.Sleep(1000)) lock (proxy)
-                        {
-                            if ((tick = (tick + 1) % 60) == 0)
-                            {
-                                for (int i = 0; i < incomingInjectionsPoint; ++i)
-                                {
-                                    incomingInjections.RemoveAt(0);
-                                    ++incomingOffset;
-#if DEBUG_SEQUENCE
-							Console.WriteLine("incomingOffset = " + incomingOffset);
-#endif
-                                }
-                                incomingInjectionsPoint = incomingInjections.Count;
-
-                                for (int i = 0; i < outgoingInjectionsPoint; ++i)
-                                {
-                                    outgoingInjections.RemoveAt(0);
-                                    ++outgoingOffset;
-#if DEBUG_SEQUENCE
-							Console.WriteLine("outgoingOffset = " + outgoingOffset);
-#endif
-                                }
-                                outgoingInjectionsPoint = outgoingInjections.Count;
-
-                                for (int i = 0; i < incomingSeenAcksPoint; ++i)
-                                {
-#if DEBUG_SEQUENCE
-							Console.WriteLine("incomingAcks.Remove(" + incomingSeenAcks[0] + ")");
-#endif
-                                    incomingAcks.Remove(incomingSeenAcks[0]);
-                                    incomingSeenAcks.RemoveAt(0);
-                                }
-                                incomingSeenAcksPoint = incomingSeenAcks.Count;
-
-                                for (int i = 0; i < outgoingSeenAcksPoint; ++i)
-                                {
-#if DEBUG_SEQUENCE
-							Console.WriteLine("outgoingAcks.Remove(" + outgoingSeenAcks[0] + ")");
-#endif
-                                    outgoingAcks.Remove(outgoingSeenAcks[0]);
-                                    outgoingSeenAcks.RemoveAt(0);
-                                }
-                                outgoingSeenAcksPoint = outgoingSeenAcks.Count;
-                            }
-
-                            foreach (uint id in incomingAcks.Keys)
-                                if (!incomingSeenAcks.Contains(id))
-                                {
-                                    Packet packet = (Packet)incomingAcks[id];
-                                    packet.Header.Data[0] |= Helpers.MSG_RESENT;
-#if DEBUG_SEQUENCE
-							Console.WriteLine("RESEND <- " + packet.Type + " #" + packet.Header.Sequence);
-#endif
-                                    SendPacket(packet, false);
-                                }
-
-                            foreach (uint id in outgoingAcks.Keys)
-                                if (!outgoingSeenAcks.Contains(id))
-                                {
-                                    Packet packet = (Packet)outgoingAcks[id];
-                                    packet.Header.Data[0] |= Helpers.MSG_RESENT;
-#if DEBUG_SEQUENCE
-							Console.WriteLine("RESEND -> " + packet.Type + " #" + packet.Header.Sequence);
-#endif
-                                    proxy.SendPacket(packet, remoteEndPoint, false);
-                                }
-                        }
-                }
-                catch (Exception e)
-                {
-                    Console.WriteLine(e.Message);
-                    Console.WriteLine(e.StackTrace);
-                }
-#if DEBUG_THREADS
-		Console.WriteLine("<T< BackgroundTasks");
-#endif
-            }
-
-            // LocalEndPoint: return the endpoint that the client should communicate with
-            public IPEndPoint LocalEndPoint()
-            {
-                return (IPEndPoint)socket.LocalEndPoint;
-            }
-
-            private byte[] receiveBuffer = new byte[8192];
-            private byte[] zeroBuffer = new byte[8192];
-            private EndPoint clientEndPoint = new IPEndPoint(IPAddress.Any, 0);
-            bool firstReceive = true;
-
-            // Run: forward packets from the client to the sim
-            public void Run()
-            {
-                Thread backgroundTasks = new Thread(new ThreadStart(BackgroundTasks));
-                backgroundTasks.IsBackground = true;
-                backgroundTasks.Start();
-#if DEBUG_THREADS
-		Console.WriteLine(">R> Run-{0}", LocalEndPoint().Port);
-#endif
-                socket.BeginReceiveFrom(receiveBuffer, 0, receiveBuffer.Length, SocketFlags.None, ref clientEndPoint, new AsyncCallback(ReceiveFromClient), null);
-            }
-
-            // ReceiveFromClient: packet received from the client
-            private void ReceiveFromClient(IAsyncResult ar)
-            {
-                lock (proxy)
-                {
-                    try
-                    {
-                        // pause listening and fetch the packet
-                        bool needsZero = false;
-                        bool needsCopy = true;
-                        int length;
-                        length = socket.EndReceiveFrom(ar, ref clientEndPoint);
-
-                        // interpret the packet according to the SL protocol
-                        int end = length - 1;
-                        Packet packet = libsecondlife.Packets.Packet.BuildPacket(receiveBuffer, ref end, zeroBuffer);
-
-#if DEBUG_SEQUENCE
-				Console.WriteLine("-> " + packet.Type + " #" + packet.Header.Sequence);
-#endif
-
-                        // check for ACKs we're waiting for
-                        packet = CheckAcks(packet, Direction.Outgoing, ref length, ref needsCopy);
-
-                        // modify sequence numbers to account for injections
-                        uint oldSequence = packet.Header.Sequence;
-                        packet = ModifySequence(packet, Direction.Outgoing, ref length, ref needsCopy);
-
-                        // keep track of sequence numbers
-                        if (packet.Header.Sequence > outgoingSequence)
-                            outgoingSequence = packet.Header.Sequence;
-
-                        // check the packet for addresses that need proxying
-                        if (proxy.outgoingCheckers.ContainsKey(packet.Type))
-                        {
-                            /* if (packet.Header.Zerocoded) {
-                                length = Helpers.ZeroDecode(packet.Header.Data, length, zeroBuffer);
-                                packet.Header.Data = zeroBuffer;
-                                needsZero = false;
-                            } */
-
-                            Packet newPacket = ((AddressChecker)proxy.outgoingCheckers[packet.Type])(packet);
-                            SwapPacket(packet, newPacket);
-                            packet = newPacket;
-                            length = packet.Header.Data.Length;
-                            needsCopy = false;
-                        }
-
-                        // pass the packet to any callback delegates
-                        if (proxy.outgoingDelegates.ContainsKey(packet.Type))
-                        {
-                            /* if (packet.Header.Zerocoded) {
-                                length = Helpers.ZeroDecode(packet.Header.Data, length, zeroBuffer);
-                                packet.Header.Data = zeroBuffer;
-                                needsCopy = true;
-                            } */
-
-                            if (needsCopy)
-                            {
-                                byte[] newData = new byte[packet.Header.Data.Length];
-                                Array.Copy(packet.Header.Data, 0, newData, 0, packet.Header.Data.Length);
-                                packet.Header.Data = newData; // FIXME!!!
-                            }
-
-                            try
-                            {
-                                Packet newPacket = proxy.callDelegates(proxy.outgoingDelegates, packet, remoteEndPoint);
-                                if (newPacket == null)
-                                {
-                                    if ((packet.Header.Flags & Helpers.MSG_RELIABLE) != 0)
-                                        Inject(proxy.SpoofAck(oldSequence), Direction.Incoming);
-
-                                    if ((packet.Header.Flags & Helpers.MSG_APPENDED_ACKS) != 0)
-                                        packet = proxy.SeparateAck(packet);
-                                    else
-                                        packet = null;
-                                }
-                                else
-                                {
-                                    bool oldReliable = (packet.Header.Flags & Helpers.MSG_RELIABLE) != 0;
-                                    bool newReliable = (newPacket.Header.Flags & Helpers.MSG_RELIABLE) != 0;
-                                    if (oldReliable && !newReliable)
-                                        Inject(proxy.SpoofAck(oldSequence), Direction.Incoming);
-                                    else if (!oldReliable && newReliable)
-                                        WaitForAck(packet, Direction.Outgoing);
-
-                                    SwapPacket(packet, newPacket);
-                                    packet = newPacket;
-                                }
-                            }
-                            catch (Exception e)
-                            {
-                                proxy.Log("exception in outgoing delegate: " + e.Message, true);
-                                proxy.Log(e.StackTrace, true);
-                            }
-
-                            if (packet != null)
-                                proxy.SendPacket(packet, remoteEndPoint, false);
-                        }
-                        else
-                            proxy.SendPacket(packet, remoteEndPoint, needsZero);
-
-                        // send any packets queued for injection
-                        if (firstReceive)
-                        {
-                            firstReceive = false;
-                            foreach (Packet queuedPacket in proxy.queuedIncomingInjections)
-                                Inject(queuedPacket, Direction.Incoming);
-                            proxy.queuedIncomingInjections = new List<Packet>();
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        Console.WriteLine(e.Message);
-                        Console.WriteLine(e.StackTrace);
-                    }
-                    finally
-                    {
-                        // resume listening
-                        socket.BeginReceiveFrom(receiveBuffer, 0, receiveBuffer.Length, SocketFlags.None, ref clientEndPoint, new AsyncCallback(ReceiveFromClient), null);
-                    }
-                }
-            }
-
-            // SendPacket: send a packet from the sim to the client via our fake sim endpoint
-            public void SendPacket(Packet packet, bool skipZero)
-            {
-                byte[] buffer = packet.ToBytes();
-                if (skipZero || (packet.Header.Data[0] & Helpers.MSG_ZEROCODED) == 0)
-                    socket.SendTo(buffer, buffer.Length, SocketFlags.None, clientEndPoint);
-                else
-                {
-                    int zeroLength = Helpers.ZeroEncode(buffer, buffer.Length, zeroBuffer);
-                    socket.SendTo(zeroBuffer, zeroLength, SocketFlags.None, clientEndPoint);
-                }
-            }
-
-            // Inject: inject a packet
-            public void Inject(Packet packet, Direction direction)
-            {
-                if (direction == Direction.Incoming)
-                {
-                    if (firstReceive)
-                    {
-                        proxy.queuedIncomingInjections.Add(packet);
-                        return;
-                    }
-
-                    incomingInjections.Add(++incomingSequence);
-                    packet.Header.Sequence = incomingSequence;
-                }
-                else
-                {
-                    outgoingInjections.Add(++outgoingSequence);
-                    packet.Header.Sequence = outgoingSequence;
-                }
-
-#if DEBUG_SEQUENCE
-				Console.WriteLine("INJECT " + (direction == Direction.Incoming ? "<-" : "->") + " " + packet.Type + " #" + packet.Header.Sequence);
-
-#endif
-                if ((packet.Header.Data[0] & Helpers.MSG_RELIABLE) != 0)
-                    WaitForAck(packet, direction);
-
-                if (direction == Direction.Incoming)
-                {
-                    byte[] buffer = packet.ToBytes();
-                    if ((packet.Header.Data[0] & Helpers.MSG_ZEROCODED) == 0)
-                        socket.SendTo(buffer, buffer.Length, SocketFlags.None, clientEndPoint);
-                    else
-                    {
-                        int zeroLength = Helpers.ZeroEncode(buffer, buffer.Length, zeroBuffer);
-                        socket.SendTo(zeroBuffer, zeroLength, SocketFlags.None, clientEndPoint);
-                    }
-                }
-                else
-                    proxy.SendPacket(packet, remoteEndPoint, false);
-            }
-
-            // WaitForAck: take care of resending a packet until it's ACKed
-            public void WaitForAck(Packet packet, Direction direction)
-            {
-                Dictionary<uint, Packet> table = direction == Direction.Incoming ? incomingAcks : outgoingAcks;
-                table.Add(packet.Header.Sequence, packet);
-            }
-
-            // CheckAcks: check for and remove ACKs of packets we've injected
-            public Packet CheckAcks(Packet packet, Direction direction, ref int length, ref bool needsCopy)
-            {
-                Dictionary<uint, Packet> acks = direction == Direction.Incoming ? outgoingAcks : incomingAcks;
-                List<uint> seenAcks = direction == Direction.Incoming ? outgoingSeenAcks : incomingSeenAcks;
-
-                if (acks.Count == 0)
-                    return packet;
-
-                // check for embedded ACKs
-                if (packet.Type == PacketType.PacketAck)
-                {
-                    bool changed = false;
-                    List<PacketAckPacket.PacketsBlock> newPacketBlocks = new List<PacketAckPacket.PacketsBlock>();
-                    foreach (PacketAckPacket.PacketsBlock pb in ((PacketAckPacket)packet).Packets)
-                    {
-                        uint id = pb.ID;
-#if DEBUG_SEQUENCE
-						string hrup = "Check !" + id;
-#endif
-                        if (acks.ContainsKey(id))
-                        {
-#if DEBUG_SEQUENCE
-							hrup += " get's";
-#endif
-                            seenAcks.Add(id);
-                            changed = true;
-                        }
-                        else
-                            newPacketBlocks.Add(pb);
-#if DEBUG_SEQUENCE
-						Console.WriteLine(hrup);
-#endif
-                    }
-                    if (changed)
-                    {
-                        PacketAckPacket newPacket = new PacketAckPacket();
-                        newPacket.Packets = new PacketAckPacket.PacketsBlock[newPacketBlocks.Count];
-
-                        int a = 0;
-                        foreach (PacketAckPacket.PacketsBlock pb in newPacketBlocks)
-                        {
-                            newPacket.Packets[a++] = pb;
-                        }
-
-                        SwapPacket(packet, (Packet)newPacket);
-                        packet = newPacket;
-                        length = packet.Header.Data.Length;
-                        needsCopy = false;
-                    }
-                }
-
-                // check for appended ACKs
-                if ((packet.Header.Data[0] & Helpers.MSG_APPENDED_ACKS) != 0)
-                {
-                    int ackCount = packet.Header.AckList.Length;
-                    for (int i = 0; i < ackCount; )
-                    {
-                        uint ackID = packet.Header.AckList[i]; // FIXME FIXME FIXME
-#if DEBUG_SEQUENCE
-						string hrup = "Check @" + ackID;
-#endif
-                        if (acks.ContainsKey(ackID))
-                        {
-#if DEBUG_SEQUENCE
-							hrup += " get's";
-#endif
-                            uint[] newAcks = new uint[ackCount - 1];
-                            Array.Copy(packet.Header.AckList, 0, newAcks, 0, i);
-                            Array.Copy(packet.Header.AckList, i + 1, newAcks, i, ackCount - i - 1);
-                            packet.Header.AckList = newAcks;
-                            --ackCount;
-                            seenAcks.Add(ackID);
-                            needsCopy = false;
-                        }
-                        else
-                            ++i;
-#if DEBUG_SEQUENCE
-						Console.WriteLine(hrup);
-#endif
-                    }
-                    if (ackCount == 0)
-                    {
-                        packet.Header.Flags ^= Helpers.MSG_APPENDED_ACKS;
-                        packet.Header.AckList = new uint[0];
-                    }
-                }
-
-                return packet;
-            }
-
-            // ModifySequence: modify a packet's sequence number and ACK IDs to account for injections
-            public Packet ModifySequence(Packet packet, Direction direction, ref int length, ref bool needsCopy)
-            {
-                List<uint> ourInjections = direction == Direction.Outgoing ? outgoingInjections : incomingInjections;
-                List<uint> theirInjections = direction == Direction.Incoming ? outgoingInjections : incomingInjections;
-                uint ourOffset = direction == Direction.Outgoing ? outgoingOffset : incomingOffset;
-                uint theirOffset = direction == Direction.Incoming ? outgoingOffset : incomingOffset;
-
-                uint newSequence = (uint)(packet.Header.Sequence + ourOffset);
-                foreach (uint injection in ourInjections)
-                    if (newSequence >= injection)
-                        ++newSequence;
-#if DEBUG_SEQUENCE
-				Console.WriteLine("Mod #" + packet.Header.Sequence + " = " + newSequence);
-#endif
-                packet.Header.Sequence = newSequence;
-
-                if ((packet.Header.Flags & Helpers.MSG_APPENDED_ACKS) != 0)
-                {
-                    int ackCount = packet.Header.AckList.Length;
-                    for (int i = 0; i < ackCount; ++i)
-                    {
-                        int offset = length - (ackCount - i) * 4 - 1;
-                        uint ackID = packet.Header.AckList[i] - theirOffset;
-#if DEBUG_SEQUENCE
-						uint hrup = packet.Header.AckList[i];
-#endif
-                        for (int j = theirInjections.Count - 1; j >= 0; --j)
-                            if (ackID >= (uint)theirInjections[j])
-                                --ackID;
-#if DEBUG_SEQUENCE
-						Console.WriteLine("Mod @" + hrup + " = " + ackID);
-#endif
-                        packet.Header.AckList[i] = ackID;
-                    }
-                }
-
-                if (packet.Type == PacketType.PacketAck)
-                {
-                    PacketAckPacket pap = (PacketAckPacket)packet;
-                    foreach (PacketAckPacket.PacketsBlock pb in pap.Packets)
-                    {
-                        uint ackID = (uint)pb.ID - theirOffset;
-#if DEBUG_SEQUENCE
-						uint hrup = (uint)pb.ID;
-#endif
-                        for (int i = theirInjections.Count - 1; i >= 0; --i)
-                            if (ackID >= (uint)theirInjections[i])
-                                --ackID;
-#if DEBUG_SEQUENCE
-						Console.WriteLine("Mod !" + hrup + " = " + ackID);
-#endif
-                        pb.ID = ackID;
-
-                    }
-                    //SwapPacket(packet, (Packet)pap);
-                    // packet = (Packet)pap;
-                    length = packet.Header.Data.Length;
-                    needsCopy = false;
-                }
-
-                return packet;
-            }
-        }
-
-        // Checkers swap proxy addresses in for real addresses.  A few constraints:
-        //   - Checkers must not alter the incoming packet.
-        //   - Checkers must return a freshly built packet, even if nothing's changed.
-        //   - The incoming packet's buffer may be longer than the length of the data it contains.
-        //   - The incoming packet's buffer must not be used after the checker returns.
-        // This is all because checkers may be operating on data that's still in a scratch buffer.
-        delegate Packet AddressChecker(Packet packet);
-
-        Dictionary<PacketType, AddressChecker> incomingCheckers = new Dictionary<PacketType, AddressChecker>();
-        Dictionary<PacketType, AddressChecker> outgoingCheckers = new Dictionary<PacketType, AddressChecker>();
-
-        // InitializeAddressCheckers: initialize delegates that check packets for addresses that need proxying
-        private void InitializeAddressCheckers()
-        {
-            // TODO: what do we do with mysteries and empty IPs?
-            AddMystery(PacketType.OpenCircuit);
-            //AddMystery(PacketType.AgentPresenceResponse);
-
-            incomingCheckers.Add(PacketType.TeleportFinish, new AddressChecker(CheckTeleportFinish));
-            incomingCheckers.Add(PacketType.CrossedRegion, new AddressChecker(CheckCrossedRegion));
-            incomingCheckers.Add(PacketType.EnableSimulator, new AddressChecker(CheckEnableSimulator));
-            //incomingCheckers.Add("UserLoginLocationReply", new AddressChecker(CheckUserLoginLocationReply));
-        }
-
-        // AddMystery: add a checker delegate that logs packets we're watching for development purposes
-        private void AddMystery(PacketType type)
-        {
-            incomingCheckers.Add(type, new AddressChecker(LogIncomingMysteryPacket));
-            outgoingCheckers.Add(type, new AddressChecker(LogOutgoingMysteryPacket));
-        }
-
-        // GenericCheck: replace the sim address in a packet with our proxy address
-        private void GenericCheck(ref uint simIP, ref ushort simPort, ref string simCaps, bool active)
-        {
-            IPAddress sim_ip = new IPAddress((long)simIP);
-
-            IPEndPoint realSim = new IPEndPoint(sim_ip, Convert.ToInt32(simPort));
-            IPEndPoint fakeSim = ProxySim(realSim);
-
-            simPort = (ushort)fakeSim.Port;
-            int i = 0;
-            byte[] bytes = fakeSim.Address.GetAddressBytes();
-            simIP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-            if (simCaps != null && simCaps.Length > 0)
-            {
-                CapInfo info = new CapInfo(simCaps, realSim, "SeedCapability");
-                info.AddDelegate(new CapsDelegate(FixupSeedCapsResponse));
-                lock (this)
-                {
-                    KnownCaps[simCaps] = info;
-                }
-                simCaps = loginURI + simCaps;
-            }
-
-            if (active)
-                activeCircuit = realSim;
-        }
-
-        // CheckTeleportFinish: check TeleportFinish packets
-        private Packet CheckTeleportFinish(Packet packet)
-        {
-            TeleportFinishPacket tfp = (TeleportFinishPacket)packet;
-            string simCaps = Encoding.UTF8.GetString(tfp.Info.SeedCapability).Replace("\0", "");
-            GenericCheck(ref tfp.Info.SimIP, ref tfp.Info.SimPort, ref simCaps, true);
-            tfp.Info.SeedCapability = Helpers.StringToField(simCaps);
-            return (Packet)tfp;
-        }
-
-        // CheckEnableSimulator: check EnableSimulator packets
-        private Packet CheckEnableSimulator(Packet packet)
-        {
-            EnableSimulatorPacket esp = (EnableSimulatorPacket)packet;
-            string simCaps = null;
-            GenericCheck(ref esp.SimulatorInfo.IP, ref esp.SimulatorInfo.Port, ref simCaps, false);
-            return (Packet)esp;
-        }
-
-        // CheckCrossedRegion: check CrossedRegion packets
-        private Packet CheckCrossedRegion(Packet packet)
-        {
-            CrossedRegionPacket crp = (CrossedRegionPacket)packet;
-            string simCaps = Encoding.UTF8.GetString(crp.RegionData.SeedCapability).Replace("\0", "");
-            GenericCheck(ref crp.RegionData.SimIP, ref crp.RegionData.SimPort, ref simCaps, true);
-            crp.RegionData.SeedCapability = Helpers.StringToField(simCaps);
-            return (Packet)crp;
-        }
-
-        // LogPacket: log a packet dump
-        private Packet LogPacket(Packet packet, string type)
-        {
-            Log(type + " packet:", true);
-            Log(packet, true);
-            return packet;
-        }
-
-        // LogIncomingMysteryPacket: log an incoming packet we're watching for development purposes
-        private Packet LogIncomingMysteryPacket(Packet packet)
-        {
-            return LogPacket(packet, "incoming mystery");
-        }
-
-        // LogOutgoingMysteryPacket: log an outgoing packet we're watching for development purposes
-        private Packet LogOutgoingMysteryPacket(Packet packet)
-        {
-            return LogPacket (packet , "outgoing mystery");
-        }
-    }
-
-
-    // Describes the data format of a capability
-    public enum CapsDataFormat
-    {
-        Binary = 0,
-        LLSD = 1
-    }
-
-    // Describes a caps URI
-    public class CapInfo
-    {
-        private string uri;
-        private IPEndPoint sim;
-        private string type;
-        private CapsDataFormat reqFmt;
-        private CapsDataFormat respFmt;
-
-        private List<CapsDelegate> Delegates = new List<CapsDelegate>();
-
-
-        public CapInfo(string URI, IPEndPoint Sim, string CapType)
-            :
-            this(URI, Sim, CapType, CapsDataFormat.LLSD, CapsDataFormat.LLSD) { }
-        public CapInfo(string URI, IPEndPoint Sim, string CapType, CapsDataFormat ReqFmt, CapsDataFormat RespFmt)
-        {
-            uri = URI; sim = Sim; type = CapType; reqFmt = ReqFmt; respFmt = RespFmt;
-        }
-        public string URI
-        {
-            get { return uri; }
-        }
-        public string CapType
-        {
-            get { return type; } /* EventQueueGet, etc */
-        }
-        public IPEndPoint Sim
-        {
-            get { return sim; }
-        }
-        public CapsDataFormat ReqFmt
-        {
-            get { return reqFmt; } /* expected request format */
-        }
-        public CapsDataFormat RespFmt
-        {
-            get { return respFmt; } /* expected response format */
-        }
-
-        public void AddDelegate(CapsDelegate deleg)
-        {
-            lock (this)
-            {
-                if (!Delegates.Contains(deleg))
-                {
-                    Delegates.Add(deleg);
-                }
-            }
-        }
-        public void RemoveDelegate(CapsDelegate deleg)
-        {
-            lock (this)
-            {
-                if (Delegates.Contains(deleg))
-                {
-                    Delegates.Remove(deleg);
-                }
-            }
-        }
-
-        // inefficient, but avoids potential deadlocks.
-        public List<CapsDelegate> GetDelegates()
-        {
-            lock (this)
-            {
-                return new List<CapsDelegate>(Delegates);
-            }
-        }
-    }
-
-    // Information associated with a caps request/response
-    public class CapsRequest
-    {
-        public CapsRequest(CapInfo info)
-        {
-            Info = info;
-        }
-
-        public readonly CapInfo Info;
-
-        // The request
-        public object Request = null;
-
-        // The corresponding response
-        public object Response = null;
-    }
-
-    // XmlRpcRequestDelegate: specifies a delegate to be called for XML-RPC requests
-    public delegate void XmlRpcRequestDelegate(XmlRpcRequest request);
-
-    // XmlRpcResponseDelegate: specifies a delegate to be called for XML-RPC responses
-    public delegate void XmlRpcResponseDelegate(XmlRpcResponse response);
-
-    // PacketDelegate: specifies a delegate to be called when a packet passes through the proxy
-    public delegate Packet PacketDelegate(Packet packet, IPEndPoint endPoint);
-
-    // Delegate for a caps request. Generally called twice - first with stage = CapsStage.Request
-    // before the request is sent, then with stage = CapsStage.Response when the response is
-    // received. Returning true causes all the subsequent delegates in that stage to be skipped,
-    // and in the case of CapsStage.Request also prevents the request being forwarded. In this
-    // case, you should set req.Response to the response you want to return.
-    // Can modify req.Request and req.Response, with the expected effects.
-    public delegate bool CapsDelegate(CapsRequest req, CapsStage stage);
-
-    // Direction: specifies whether a packet is going to the client (Incoming) or to a sim (Outgoing)
-    public enum Direction
-    {
-        Incoming,
-        Outgoing
-    }
-    public enum CapsStage
-    {
-        Request,
-        Response
-    }
-}
-
-
diff --git a/old/libsl1550/SLProxy/SLProxy.csproj b/old/libsl1550/SLProxy/SLProxy.csproj
deleted file mode 100644
index 95bea17..0000000
--- a/old/libsl1550/SLProxy/SLProxy.csproj
+++ /dev/null
@@ -1,127 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{E4115DC9-FC88-47D6-B3B6-2400AD19B80D}</ProjectGuid>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>
-    </ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>SLProxy</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>SLProxy</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>ProxyMain</StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>full</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-    <UseVSHostingProcess>false</UseVSHostingProcess>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>none</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.Data">
-      <Name>System.Data</Name>
-    </Reference>
-    <Reference Include="System.Xml">
-      <Name>System.XML</Name>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Analyst.cs" />
-    <Compile Include="SLProxy.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="SLProxyLoader.cs" />
-    <Compile Include="SLProxyMain.cs" />
-    <Compile Include="XmlRpcCS\Logger.cs" />
-    <Compile Include="XmlRpcCS\SimpleHttpRequest.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcBoxcarRequest.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcClientProxy.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcDeserializer.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcErrorCodes.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcException.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcExposedAttribute.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcRequest.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcRequestDeserializer.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcRequestSerializer.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcResponder.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcResponse.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcResponseDeserializer.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcResponseSerializer.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcSerializer.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcServer.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcSystemObject.cs" />
-    <Compile Include="XmlRpcCS\XmlRpcXmlTokens.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\libsecondlife\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>
-    </PostBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/SLProxyLoader.cs b/old/libsl1550/SLProxy/SLProxyLoader.cs
deleted file mode 100644
index d842ba8..0000000
--- a/old/libsl1550/SLProxy/SLProxyLoader.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-using SLProxy;
-using libsecondlife;
-using Nwc.XmlRpc;
-using libsecondlife.Packets;
-using System.Reflection;
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Net;
-using System.Text.RegularExpressions;
-
-
-namespace SLProxy
-{
-    public class ProxyFrame
-    {
-        public Proxy proxy;
-        private Dictionary<string, CommandDelegate> commandDelegates = new Dictionary<string, CommandDelegate>();
-        private LLUUID agentID;
-        private LLUUID sessionID;
-        private bool logLogin = false;
-        private string[] args;
-
-        public delegate void CommandDelegate(string[] words);
-
-        public string[] Args
-        {
-            get { return args; }
-        }
-
-        public LLUUID AgentID
-        {
-            get { return agentID; }
-        }
-
-        public LLUUID SessionID
-        {
-            get { return sessionID; }
-        }
-
-        public void AddCommand(string cmd, CommandDelegate deleg)
-        {
-            commandDelegates[cmd] = deleg;
-        }
-
-        public ProxyFrame(string[] args)
-        {
-            //bool externalPlugin = false;
-            this.args = args;
-
-            ProxyConfig proxyConfig = new ProxyConfig("SLProxy", "Austin Jennings / Andrew Ortman", args);
-            proxy = new Proxy(proxyConfig);
-
-            // add delegates for login
-            proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest));
-            proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse));
-
-            // add a delegate for outgoing chat
-            proxy.AddDelegate(PacketType.ChatFromViewer, Direction.Outgoing, new PacketDelegate(ChatFromViewerOut));
-
-            //  handle command line arguments
-            foreach (string arg in args)
-                if (arg == "--log-login")
-                    logLogin = true;
-                else if (arg.Substring(0, 2) == "--")
-                {
-                    int ipos = arg.IndexOf("=");
-                    if (ipos != -1)
-                    {
-                        string sw = arg.Substring(0, ipos);
-                        string val = arg.Substring(ipos + 1);
-                        Console.WriteLine("arg '" + sw + "' val '" + val + "'");
-                        if (sw == "--load")
-                        {
-                            //externalPlugin = true;
-                            LoadPlugin(val);
-                        }
-                    }
-                }
-
-            commandDelegates["/load"] = new CommandDelegate(CmdLoad);
-       }
-
-        private void CmdLoad(string[] words)
-        {
-            if (words.Length != 2)
-                SayToUser("Usage: /load <plugin name>");
-            else
-            {
-                try
-                {
-                    LoadPlugin(words[1]);
-                }
-                catch (Exception e)
-                {
-                    Console.WriteLine(e.ToString());
-                }
-            }
-        }
-
-        public void LoadPlugin(string name)
-        {
-
-            Assembly assembly = Assembly.LoadFile(Path.GetFullPath(name));
-            foreach (Type t in assembly.GetTypes())
-            {
-                try
-                {
-                    if (t.IsSubclassOf(typeof(ProxyPlugin)))
-                    {
-                        ConstructorInfo info = t.GetConstructor(new Type[] { typeof(ProxyFrame) });
-                        ProxyPlugin plugin = (ProxyPlugin)info.Invoke(new object[] { this });
-                        plugin.Init();
-                    }
-                }
-                catch (Exception e)
-                {
-                    Console.WriteLine(e.ToString());
-                }
-            }
-
-        }
-
-        // LoginRequest: dump a login request to the console
-        private void LoginRequest(XmlRpcRequest request)
-        {
-            if (logLogin)
-            {
-                Console.WriteLine("==> Login Request");
-                Console.WriteLine(request);
-            }
-        }
-
-        // Loginresponse: dump a login response to the console
-        private void LoginResponse(XmlRpcResponse response)
-        {
-            System.Collections.Hashtable values = (System.Collections.Hashtable)response.Value;
-            if (values.Contains("agent_id"))
-                agentID = new LLUUID((string)values["agent_id"]);
-            if (values.Contains("session_id"))
-                sessionID = new LLUUID((string)values["session_id"]);
-
-            if (logLogin)
-            {
-                Console.WriteLine("<== Login Response");
-                Console.WriteLine(response);
-            }
-        }
-
-        // ChatFromViewerOut: outgoing ChatFromViewer delegate; check for Analyst commands
-        private Packet ChatFromViewerOut(Packet packet, IPEndPoint sim)
-        {
-            // deconstruct the packet
-            ChatFromViewerPacket cpacket = (ChatFromViewerPacket)packet;
-            string message = System.Text.Encoding.UTF8.GetString(cpacket.ChatData.Message).Replace("\0", "");
-
-            if (message.Length > 1 && message[0] == '/')
-            {
-                string[] words = message.Split(' ');
-                if (commandDelegates.ContainsKey(words[0]))
-                {
-                    // this is an Analyst command; act on it and drop the chat packet
-                    ((CommandDelegate)commandDelegates[words[0]])(words);
-                    return null;
-                }
-            }
-
-            return packet;
-        }
-
-        // SayToUser: send a message to the user as in-world chat
-        public void SayToUser(string message)
-        {
-            ChatFromSimulatorPacket packet = new ChatFromSimulatorPacket();
-            packet.ChatData.FromName = Helpers.StringToField("SLProxy");
-            packet.ChatData.SourceID = LLUUID.Random();
-            packet.ChatData.OwnerID = agentID;
-            packet.ChatData.SourceType = (byte)2;
-            packet.ChatData.ChatType = (byte)1;
-            packet.ChatData.Audible = (byte)1;
-            packet.ChatData.Position = new LLVector3(0, 0, 0);
-            packet.ChatData.Message = Helpers.StringToField(message);
-            proxy.InjectPacket(packet, Direction.Incoming);
-        }
-
-    }
-
-
-    public abstract class ProxyPlugin : MarshalByRefObject
-    {
-        // public abstract ProxyPlugin(ProxyFrame main);
-        public abstract void Init();
-    }
-
-}
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/SLProxyMain.cs b/old/libsl1550/SLProxy/SLProxyMain.cs
deleted file mode 100644
index 86c8978..0000000
--- a/old/libsl1550/SLProxy/SLProxyMain.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Reflection;
-using SLProxy;
-
-class ProxyMain
-{
-    public static void Main(string[] args)
-    {
-        ProxyFrame p = new ProxyFrame(args);
-	ProxyPlugin analyst = new Analyst(p);
-        analyst.Init();
-	p.proxy.Start();
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/Logger.cs b/old/libsl1550/SLProxy/XmlRpcCS/Logger.cs
deleted file mode 100644
index ad3e527..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/Logger.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-
-    /// <summary>Define levels of logging.</summary><remarks> This duplicates
-    /// similar enumerations in System.Diagnostics.EventLogEntryType. The
-    /// duplication was merited because .NET Compact Framework lacked the EventLogEntryType enum.</remarks>
-    public enum LogLevel
-    {
-        /// <summary>Information level, log entry for informational reasons only.</summary>
-        Information,
-        /// <summary>Warning level, indicates a possible problem.</summary>
-        Warning,
-        /// <summary>Error level, implies a significant problem.</summary>
-        Error
-    }
-
-    ///<summary>
-    ///Logging singleton with swappable output delegate.
-    ///</summary>
-    ///<remarks>
-    ///This singleton provides a centralized log. The actual WriteEntry calls are passed
-    ///off to a delegate however. Having a delegate do the actual logginh allows you to
-    ///implement different logging mechanism and have them take effect throughout the system.
-    ///</remarks>
-    public class Logger
-    {
-        ///<summary>Delegate definition for logging.</summary>
-        ///<param name="message">The message <c>String</c> to log.</param>
-        ///<param name="level">The <c>LogLevel</c> of your message.</param>
-        public delegate void LoggerDelegate(String message, LogLevel level);
-        ///<summary>The LoggerDelegate that will recieve WriteEntry requests.</summary>
-        static public LoggerDelegate Delegate = null;
-
-        ///<summary>
-        ///Method logging events are sent to.
-        ///</summary>
-        ///<param name="message">The message <c>String</c> to log.</param>
-        ///<param name="level">The <c>LogLevel</c> of your message.</param>
-        static public void WriteEntry(String message, LogLevel level)
-        {
-            if (Delegate != null)
-                Delegate(message, level);
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/SimpleHttpRequest.cs b/old/libsl1550/SLProxy/XmlRpcCS/SimpleHttpRequest.cs
deleted file mode 100644
index 2e292b6..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/SimpleHttpRequest.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.IO;
-    using System.Net.Sockets;
-    using System.Collections;
-
-    ///<summary>Very basic HTTP request handler.</summary>
-    ///<remarks>This class is designed to accept a TcpClient and treat it as an HTTP request.
-    /// It will do some basic header parsing and manage the input and output streams associated
-    /// with the request.</remarks>
-    public class SimpleHttpRequest
-    {
-        private String _httpMethod = null;
-        private String _protocol;
-        private String _filePathFile = null;
-        private String _filePathDir = null;
-        private String __filePath;
-        private TcpClient _client;
-        private StreamReader _input;
-        private StreamWriter _output;
-        private Hashtable _headers;
-
-        /// <summary>A constructor which accepts the TcpClient.</summary>
-        /// <remarks>It creates the associated input and output streams, determines the request type,
-        /// and parses the remaining HTTP header.</remarks>
-        /// <param name="client">The <c>TcpClient</c> associated with the HTTP connection.</param>
-        public SimpleHttpRequest(TcpClient client)
-        {
-            _client = client;
-            _output = new StreamWriter(client.GetStream());
-            _input = new StreamReader(client.GetStream());
-            GetRequestMethod();
-            GetRequestHeaders();
-        }
-
-        /// <summary>The output <c>StreamWriter</c> associated with the request.</summary>
-        public StreamWriter Output
-        {
-            get { return _output; }
-        }
-
-        /// <summary>The input <c>StreamReader</c> associated with the request.</summary>
-        public StreamReader Input
-        {
-            get { return _input; }
-        }
-
-        /// <summary>The <c>TcpClient</c> with the request.</summary>
-        public TcpClient Client
-        {
-            get { return _client; }
-        }
-
-        private String _filePath
-        {
-            get { return __filePath; }
-            set
-            {
-                __filePath = value;
-                _filePathDir = null;
-                _filePathFile = null;
-            }
-        }
-
-        /// <summary>The type of HTTP request (i.e. PUT, GET, etc.).</summary>
-        public String HttpMethod
-        {
-            get { return _httpMethod; }
-        }
-
-        /// <summary>The level of the HTTP protocol.</summary>
-        public String Protocol
-        {
-            get { return _protocol; }
-        }
-
-        /// <summary>The "path" which is part of any HTTP request.</summary>
-        public String FilePath
-        {
-            get { return _filePath; }
-        }
-
-        /// <summary>The file portion of the "path" which is part of any HTTP request.</summary>
-        public String FilePathFile
-        {
-            get
-            {
-                if (_filePathFile != null)
-                    return _filePathFile;
-
-                int i = FilePath.LastIndexOf("/");
-
-                if (i == -1)
-                    return "";
-
-                i++;
-                _filePathFile = FilePath.Substring(i, FilePath.Length - i);
-                return _filePathFile;
-            }
-        }
-
-        /// <summary>The directory portion of the "path" which is part of any HTTP request.</summary>
-        public String FilePathDir
-        {
-            get
-            {
-                if (_filePathDir != null)
-                    return _filePathDir;
-
-                int i = FilePath.LastIndexOf("/");
-
-                if (i == -1)
-                    return "";
-
-                i++;
-                _filePathDir = FilePath.Substring(0, i);
-                return _filePathDir;
-            }
-        }
-
-        private void GetRequestMethod()
-        {
-            string req = _input.ReadLine();
-            if (req == null)
-                throw new ApplicationException("Void request.");
-
-            if (0 == String.Compare("GET ", req.Substring(0, 4), true))
-                _httpMethod = "GET";
-            else if (0 == String.Compare("POST ", req.Substring(0, 5), true))
-                _httpMethod = "POST";
-            else
-                throw new InvalidOperationException("Unrecognized method in query: " + req);
-
-            req = req.TrimEnd();
-            int idx = req.IndexOf(' ') + 1;
-            if (idx >= req.Length)
-                throw new ApplicationException("What do you want?");
-
-            string page_protocol = req.Substring(idx);
-            int idx2 = page_protocol.IndexOf(' ');
-            if (idx2 == -1)
-                idx2 = page_protocol.Length;
-
-            _filePath = page_protocol.Substring(0, idx2).Trim();
-            _protocol = page_protocol.Substring(idx2).Trim();
-        }
-
-        private void GetRequestHeaders()
-        {
-            String line;
-            int idx;
-
-            _headers = new Hashtable();
-
-            while ((line = _input.ReadLine()) != "")
-            {
-                if (line == null)
-                {
-                    break;
-                }
-
-                idx = line.IndexOf(':');
-                if (idx == -1 || idx == line.Length - 1)
-                {
-                    Logger.WriteEntry("Malformed header line: " + line, LogLevel.Information);
-                    continue;
-                }
-
-                String key = line.Substring(0, idx);
-                String value = line.Substring(idx + 1);
-
-                try
-                {
-                    _headers.Add(key, value);
-                }
-                catch (Exception)
-                {
-                    Logger.WriteEntry("Duplicate header key in line: " + line, LogLevel.Information);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Format the object contents into a useful string representation.
-        /// </summary>
-        ///<returns><c>String</c> representation of the <c>SimpleHttpRequest</c> as the <i>HttpMethod FilePath Protocol</i>.</returns>
-        override public String ToString()
-        {
-            return HttpMethod + " " + FilePath + " " + Protocol;
-        }
-
-        /// <summary>
-        /// Close the <c>SimpleHttpRequest</c>. This flushes and closes all associated io streams.
-        /// </summary>
-        public void Close()
-        {
-            _output.Flush();
-            _output.Close();
-            _input.Close();
-            _client.Close();
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcBoxcarRequest.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcBoxcarRequest.cs
deleted file mode 100644
index 740d19d..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcBoxcarRequest.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace Nwc.XmlRpc
-{
-  using System;
-  using System.Collections;
-  using System.IO;
-  using System.Xml;
-  using System.Net;
-  using System.Text;
-  using System.Reflection;
-
-  /// <summary>Class that collects individual <c>XmlRpcRequest</c> objects and submits them as a <i>boxcarred</i> request.</summary>
-  /// <remarks>A boxcared request is when a number of request are collected before being sent via XML-RPC, and then are sent via
-  /// a single HTTP connection. This results in a speed up from reduced connection time.  The results are then retuned collectively
-  /// as well.
-  ///</remarks>
-  /// <seealso cref="XmlRpcRequest"/>
-  public class XmlRpcBoxcarRequest : XmlRpcRequest
-  {
-    /// <summary>ArrayList to collect the requests to boxcar.</summary>
-    public IList Requests = new ArrayList();
-
-    /// <summary>Basic constructor.</summary>
-    public XmlRpcBoxcarRequest()
-      {
-      }
-
-    /// <summary>Returns the <c>String</c> "system.multiCall" which is the server method that handles boxcars.</summary>
-    public override String MethodName
-      {
-	get { return  "system.multiCall";  }
-      }
-
-    /// <summary>The <c>ArrayList</c> of boxcarred <paramref>Requests</paramref> as properly formed parameters.</summary>
-    public override IList Params
-      {
-	get {
-	  _params.Clear();
-	  ArrayList reqArray = new ArrayList();
-	  foreach (XmlRpcRequest request in Requests)
-	    {
-	      Hashtable requestEntry = new Hashtable();
-	      requestEntry.Add(XmlRpcXmlTokens.METHOD_NAME, request.MethodName);
-	      requestEntry.Add(XmlRpcXmlTokens.PARAMS, request.Params);
-	      reqArray.Add(requestEntry);
-	    }
-	  _params.Add(reqArray);
-	  return _params;
-	}
-      }
-  }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcClientProxy.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcClientProxy.cs
deleted file mode 100644
index e00d8c0..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcClientProxy.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-namespace Nwc.XmlRpc
-{
-  using System;
-  using System.Runtime.Remoting.Proxies;
-  using System.Runtime.Remoting.Messaging;
-
-  /// <summary>This class provides support for creating local proxies of XML-RPC remote objects</summary>
-  /// <remarks>
-  /// To create a local proxy you need to create a local C# interface and then, via <i>createProxy</i>
-  /// associate that interface with a remote object at a given URL.
-  /// </remarks>
-public class XmlRpcClientProxy : RealProxy
-{
-  private String _remoteObjectName;
-  private String _url;
-  private XmlRpcRequest _client = new XmlRpcRequest();
-
-  /// <summary>Factory method to create proxies.</summary>
-  /// <remarks>
-  /// To create a local proxy you need to create a local C# interface with methods that mirror those of the server object.
-  /// Next, pass that interface into <c>createProxy</c> along with the object name and URL of the remote object and
-  /// cast the resulting object to the specifice interface.
-  /// </remarks>
-  /// <param name="remoteObjectName"><c>String</c> The name of the remote object.</param>
-  /// <param name="url"><c>String</c> The URL of the remote object.</param>
-  /// <param name="anInterface"><c>Type</c> The typeof() of a C# interface.</param>
-  /// <returns><c>Object</c> A proxy for your specified interface. Cast to appropriate type.</returns>
-  public static Object createProxy(String remoteObjectName, String url, Type anInterface)
-    {
-      return new XmlRpcClientProxy(remoteObjectName, url, anInterface).GetTransparentProxy();
-    }
-
-  private XmlRpcClientProxy(String remoteObjectName, String url, Type t) : base(t)
-    {
-      _remoteObjectName = remoteObjectName;
-      _url = url;
-    }
-
-  /// <summary>The local method dispatcher - do not invoke.</summary>
-  override public IMessage Invoke(IMessage msg)
-    {
-      IMethodCallMessage methodMessage = (IMethodCallMessage)msg;
-
-      _client.MethodName = _remoteObjectName + "." + methodMessage.MethodName;
-      _client.Params.Clear();
-      foreach (Object o in methodMessage.Args)
-	_client.Params.Add(o);
-
-      try
-	{
-	  Object ret = _client.Invoke(_url);
-	  return new ReturnMessage(ret,null,0,
-				   methodMessage.LogicalCallContext, methodMessage);
-	}
-      catch (Exception e)
-	{
-	  return new ReturnMessage(e, methodMessage);
-	}
-    }
-}
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcDeserializer.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcDeserializer.cs
deleted file mode 100644
index a17fdcb..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcDeserializer.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.IO;
-    using System.Xml;
-    using System.Globalization;
-
-    /// <summary>Parser context, we maintain contexts in a stack to avoiding recursion. </summary>
-    struct Context
-    {
-        public String Name;
-        public Object Container;
-    }
-
-    /// <summary>Basic XML-RPC data deserializer.</summary>
-    /// <remarks>Uses <c>XmlTextReader</c> to parse the XML data. This level of the class
-    /// only handles the tokens common to both Requests and Responses. This class is not useful in and of itself
-    /// but is designed to be subclassed.</remarks>
-    public class XmlRpcDeserializer : XmlRpcXmlTokens
-    {
-        private static DateTimeFormatInfo _dateFormat = new DateTimeFormatInfo();
-
-        private Object _container;
-        private Stack _containerStack;
-
-        /// <summary>Protected reference to last text.</summary>
-        protected String _text;
-        /// <summary>Protected reference to last deserialized value.</summary>
-        protected Object _value;
-        /// <summary>Protected reference to last name field.</summary>
-        protected String _name;
-
-
-        /// <summary>Basic constructor.</summary>
-        public XmlRpcDeserializer()
-        {
-            Reset();
-            _dateFormat.FullDateTimePattern = ISO_DATETIME;
-        }
-
-        /// <summary>Static method that parses XML data into a response using the Singleton.</summary>
-        /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
-        /// <returns><c>Object</c> object resulting from the deserialization.</returns>
-        virtual public Object Deserialize(TextReader xmlData)
-        {
-            return null;
-        }
-
-        /// <summary>Protected method to parse a node in an XML-RPC XML stream.</summary>
-        /// <remarks>Method deals with elements common to all XML-RPC data, subclasses of
-        /// this object deal with request/response spefic elements.</remarks>
-        /// <param name="reader"><c>XmlTextReader</c> of the in progress parsing data stream.</param>
-        protected void DeserializeNode(XmlTextReader reader)
-        {
-            switch (reader.NodeType)
-            {
-                case XmlNodeType.Element:
-                    if (Logger.Delegate != null)
-                        Logger.WriteEntry("START " + reader.Name, LogLevel.Information);
-                    switch (reader.Name)
-                    {
-                        case VALUE:
-                            _value = null;
-                            _text = null;
-                            break;
-                        case STRUCT:
-                            PushContext();
-                            _container = new Hashtable();
-                            break;
-                        case ARRAY:
-                            PushContext();
-                            _container = new ArrayList();
-                            break;
-                    }
-                    break;
-                case XmlNodeType.EndElement:
-                    if (Logger.Delegate != null)
-                        Logger.WriteEntry("END " + reader.Name, LogLevel.Information);
-                    switch (reader.Name)
-                    {
-                        case BASE64:
-                            _value = Convert.FromBase64String(_text);
-                            break;
-                        case BOOLEAN:
-                            int val = Int16.Parse(_text);
-                            if (val == 0)
-                                _value = false;
-                            else if (val == 1)
-                                _value = true;
-                            break;
-                        case STRING:
-                            _value = _text;
-                            break;
-                        case DOUBLE:
-                            _value = Double.Parse(_text);
-                            break;
-                        case INT:
-                        case ALT_INT:
-                            _value = Int32.Parse(_text);
-                            break;
-                        case DATETIME:
-#if __MONO__
-		    _value = DateParse(_text);
-#else
-                            _value = DateTime.ParseExact(_text, "F", _dateFormat);
-#endif
-                            break;
-                        case NAME:
-                            _name = _text;
-                            break;
-                        case VALUE:
-                            if (_value == null)
-                                _value = _text; // some kits don't use <string> tag, they just do <value>
-
-                            if ((_container != null) && (_container is IList)) // in an array?  If so add value to it.
-                                ((IList)_container).Add(_value);
-                            break;
-                        case MEMBER:
-                            if ((_container != null) && (_container is IDictionary)) // in an struct?  If so add value to it.
-                                ((IDictionary)_container).Add(_name, _value);
-                            break;
-                        case ARRAY:
-                        case STRUCT:
-                            _value = _container;
-                            PopContext();
-                            break;
-                    }
-                    break;
-                case XmlNodeType.Text:
-                    if (Logger.Delegate != null)
-                        Logger.WriteEntry("Text " + reader.Value, LogLevel.Information);
-                    _text = reader.Value;
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        /// <summary>Static method that parses XML in a <c>String</c> into a
-        /// request using the Singleton.</summary>
-        /// <param name="xmlData"><c>String</c> containing an XML-RPC request.</param>
-        /// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
-        public Object Deserialize(String xmlData)
-        {
-            StringReader sr = new StringReader(xmlData);
-            return Deserialize(sr);
-        }
-
-        /// <summary>Pop a Context of the stack, an Array or Struct has closed.</summary>
-        private void PopContext()
-        {
-            Context c = (Context)_containerStack.Pop();
-            _container = c.Container;
-            _name = c.Name;
-        }
-
-        /// <summary>Push a Context on the stack, an Array or Struct has opened.</summary>
-        private void PushContext()
-        {
-            Context context;
-
-            context.Container = _container;
-            context.Name = _name;
-
-            _containerStack.Push(context);
-        }
-
-        /// <summary>Reset the internal state of the deserializer.</summary>
-        protected void Reset()
-        {
-            _text = null;
-            _value = null;
-            _name = null;
-            _container = null;
-            _containerStack = new Stack();
-        }
-
-#if __MONO__
-    private DateTime DateParse(String str)
-      {
-	int year = Int32.Parse(str.Substring(0,4));
-	int month = Int32.Parse(str.Substring(4,2));
-	int day = Int32.Parse(str.Substring(6,2));
-	int hour = Int32.Parse(str.Substring(9,2));
-	int min = Int32.Parse(str.Substring(12,2));
-	int sec = Int32.Parse(str.Substring(15,2));
-	return new DateTime(year,month,day,hour,min,sec);
-      }
-#endif
-
-    }
-}
-
-
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcErrorCodes.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcErrorCodes.cs
deleted file mode 100644
index 1b1beec..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcErrorCodes.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-
-    /// <summary>Standard XML-RPC error codes.</summary>
-    public class XmlRpcErrorCodes
-    {
-        /// <summary></summary>
-        public const int PARSE_ERROR_MALFORMED = -32700;
-        /// <summary></summary>
-        public const String PARSE_ERROR_MALFORMED_MSG = "Parse Error, not well formed";
-
-        /// <summary></summary>
-        public const int PARSE_ERROR_ENCODING = -32701;
-        /// <summary></summary>
-        public const String PARSE_ERROR_ENCODING_MSG = "Parse Error, unsupported encoding";
-
-        //
-        // -32702 ---> parse error. invalid character for encoding
-        // -32600 ---> server error. invalid xml-rpc. not conforming to spec.
-        //
-
-        /// <summary></summary>
-        public const int SERVER_ERROR_METHOD = -32601;
-        /// <summary></summary>
-        public const String SERVER_ERROR_METHOD_MSG = "Server Error, requested method not found";
-
-        /// <summary></summary>
-        public const int SERVER_ERROR_PARAMS = -32602;
-        /// <summary></summary>
-        public const String SERVER_ERROR_PARAMS_MSG = "Server Error, invalid method parameters";
-
-        //
-        // -32603 ---> server error. internal xml-rpc error
-        //
-
-        /// <summary></summary>
-        public const int APPLICATION_ERROR = -32500;
-        /// <summary></summary>
-        public const String APPLICATION_ERROR_MSG = "Application Error";
-
-        //
-        // -32400 ---> system error
-        //
-
-        /// <summary></summary>
-        public const int TRANSPORT_ERROR = -32300;
-        /// <summary></summary>
-        public const String TRANSPORT_ERROR_MSG = "Transport Layer Error";
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcException.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcException.cs
deleted file mode 100644
index 3d4f467..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-
-    /// <summary>An XML-RPC Exception.</summary>
-    /// <remarks>Maps a C# exception to an XML-RPC fault. Normal exceptions
-    /// include a message so this adds the code needed by XML-RPC.</remarks>
-    public class XmlRpcException : Exception
-    {
-        private int _code;
-
-        /// <summary>Instantiate an <c>XmlRpcException</c> with a code and message.</summary>
-        /// <param name="code"><c>Int</c> faultCode associated with this exception.</param>
-        /// <param name="message"><c>String</c> faultMessage associated with this exception.</param>
-        public XmlRpcException(int code, String message)
-            : base(message)
-        {
-            _code = code;
-        }
-
-        /// <summary>The value of the faults message, i.e. the faultString.</summary>
-        public String FaultString
-        {
-            get { return Message; }
-        }
-
-        /// <summary>The value of the faults code, i.e. the faultCode.</summary>
-        public int FaultCode
-        {
-            get { return _code; }
-        }
-
-        /// <summary>Format the message to include the code.</summary>
-        override public String ToString()
-        {
-            return "Code: " + FaultCode + " Message: " + base.ToString();
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcExposedAttribute.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcExposedAttribute.cs
deleted file mode 100644
index 5c735d5..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcExposedAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Reflection;
-
-    /// <summary>
-    /// Simple tagging attribute to indicate participation is XML-RPC exposure.
-    /// </summary>
-    /// <remarks>
-    /// If present at the class level it indicates that this class does explicitly
-    /// expose methods. If present at the method level it denotes that the method
-    /// is exposed.
-    /// </remarks>
-    [AttributeUsage(
-          AttributeTargets.Class | AttributeTargets.Method,
-          AllowMultiple = false,
-          Inherited = true
-      )]
-    public class XmlRpcExposedAttribute : Attribute
-    {
-        /// <summary>Check if <paramref>obj</paramref> is an object utilizing the XML-RPC exposed Attribute.</summary>
-        /// <param name="obj"><c>Object</c> of a class or method to check for attribute.</param>
-        /// <returns><c>Boolean</c> true if attribute present.</returns>
-        public static Boolean ExposedObject(Object obj)
-        {
-            return IsExposed(obj.GetType());
-        }
-
-        /// <summary>Check if <paramref>obj</paramref>.<paramref>methodName</paramref> is an XML-RPC exposed method.</summary>
-        /// <remarks>A method is considered to be exposed if it exists and, either, the object does not use the XmlRpcExposed attribute,
-        /// or the object does use the XmlRpcExposed attribute and the method has the XmlRpcExposed attribute as well.</remarks>
-        /// <returns><c>Boolean</c> true if the  method is exposed.</returns>
-        public static Boolean ExposedMethod(Object obj, String methodName)
-        {
-            Type type = obj.GetType();
-            MethodInfo method = type.GetMethod(methodName);
-
-            if (method == null)
-                throw new MissingMethodException("Method " + methodName + " not found.");
-
-            if (!IsExposed(type))
-                return true;
-
-            return IsExposed(method);
-        }
-
-        /// <summary>Check if <paramref>mi</paramref> is XML-RPC exposed.</summary>
-        /// <param name="mi"><c>MemberInfo</c> of a class or method to check for attribute.</param>
-        /// <returns><c>Boolean</c> true if attribute present.</returns>
-        public static Boolean IsExposed(MemberInfo mi)
-        {
-            foreach (Attribute attr in mi.GetCustomAttributes(true))
-            {
-                if (attr is XmlRpcExposedAttribute)
-                    return true;
-            }
-            return false;
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequest.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequest.cs
deleted file mode 100644
index 88267a9..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequest.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.IO;
-    using System.Xml;
-    using System.Net;
-    using System.Text;
-    using System.Reflection;
-    using System.Net.Security;
-    using System.Security.Cryptography.X509Certificates;
-
-    internal class AcceptAllCertificatePolicy : ICertificatePolicy
-    {
-        public AcceptAllCertificatePolicy()
-        {
-        }
-
-        public bool CheckValidationResult(ServicePoint sPoint,
-            System.Security.Cryptography.X509Certificates.X509Certificate cert,
-            WebRequest wRequest, int certProb)
-        {
-            // Always accept
-            return true;
-        }
-    }
-
-    /// <summary>Class supporting the request side of an XML-RPC transaction.</summary>
-    public class XmlRpcRequest
-    {
-        private String _methodName = null;
-        private Encoding _encoding = new ASCIIEncoding();
-        private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer();
-        private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer();
-
-        /// <summary><c>ArrayList</c> containing the parameters.</summary>
-        protected IList _params = null;
-
-        /// <summary>Instantiate an <c>XmlRpcRequest</c></summary>
-        public XmlRpcRequest()
-        {
-            _params = new ArrayList();
-        }
-
-        /// <summary>Instantiate an <c>XmlRpcRequest</c> for a specified method and parameters.</summary>
-        /// <param name="methodName"><c>String</c> designating the <i>object.method</i> on the server the request
-        /// should be directed to.</param>
-        /// <param name="parameters"><c>ArrayList</c> of XML-RPC type parameters to invoke the request with.</param>
-        public XmlRpcRequest(String methodName, IList parameters)
-        {
-            MethodName = methodName;
-            _params = parameters;
-        }
-
-        /// <summary><c>ArrayList</c> conntaining the parameters for the request.</summary>
-        public virtual IList Params
-        {
-            get { return _params; }
-        }
-
-        /// <summary><c>String</c> conntaining the method name, both object and method, that the request will be sent to.</summary>
-        public virtual String MethodName
-        {
-            get { return _methodName; }
-            set { _methodName = value; }
-        }
-
-        /// <summary><c>String</c> object name portion of the method name.</summary>
-        public String MethodNameObject
-        {
-            get
-            {
-                int index = MethodName.IndexOf(".");
-
-                if (index == -1)
-                    return MethodName;
-
-                return MethodName.Substring(0, index);
-            }
-        }
-
-        /// <summary><c>String</c> method name portion of the object.method name.</summary>
-        public String MethodNameMethod
-        {
-            get
-            {
-                int index = MethodName.IndexOf(".");
-
-                if (index == -1)
-                    return MethodName;
-
-                return MethodName.Substring(index + 1, MethodName.Length - index - 1);
-            }
-        }
-
-        /// <summary>Invoke this request on the server.</summary>
-        /// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
-        /// <returns><c>Object</c> The value returned from the method invocation on the server.</returns>
-        /// <exception cref="XmlRpcException">If an exception generated on the server side.</exception>
-        public Object Invoke(String url)
-        {
-            XmlRpcResponse res = Send(url, 10000);
-
-            if (res.IsFault)
-                throw new XmlRpcException(res.FaultCode, res.FaultString);
-
-            return res.Value;
-        }
-
-        /// <summary>Send the request to the server.</summary>
-        /// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
-        /// <param name="timeout">Milliseconds before the connection times out.</param>
-        /// <returns><c>XmlRpcResponse</c> The response generated.</returns>
-        public XmlRpcResponse Send(String url, int timeout)
-        {
-            // Override SSL authentication mechanisms
-            ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
-
-            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
-            if (request == null)
-                throw new XmlRpcException(XmlRpcErrorCodes.TRANSPORT_ERROR,
-                              XmlRpcErrorCodes.TRANSPORT_ERROR_MSG + ": Could not create request with " + url);
-            request.Method = "POST";
-            request.ContentType = "text/xml";
-            request.AllowWriteStreamBuffering = true;
-            request.Timeout = timeout;
-
-            Stream stream = request.GetRequestStream();
-            XmlTextWriter xml = new XmlTextWriter(stream, _encoding);
-            _serializer.Serialize(xml, this);
-            xml.Flush();
-            xml.Close();
-
-            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
-            StreamReader input = new StreamReader(response.GetResponseStream());
-
-            XmlRpcResponse resp = (XmlRpcResponse)_deserializer.Deserialize(input);
-            input.Close();
-            response.Close();
-            return resp;
-        }
-
-        /// <summary>Produce <c>String</c> representation of the object.</summary>
-        /// <returns><c>String</c> representation of the object.</returns>
-        override public String ToString()
-        {
-            return _serializer.Serialize(this);
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequestDeserializer.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequestDeserializer.cs
deleted file mode 100644
index 253f891..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequestDeserializer.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.Diagnostics;
-    using System.IO;
-    using System.Xml;
-
-    /// <summary>Class to deserialize XML data representing a request.</summary>
-    public class XmlRpcRequestDeserializer : XmlRpcDeserializer
-    {
-        static private XmlRpcRequestDeserializer _singleton;
-        /// <summary>A static singleton instance of this deserializer.</summary>
-        [Obsolete("This object is now thread safe, just use an instance.", false)]
-        static public XmlRpcRequestDeserializer Singleton
-        {
-            get
-            {
-                if (_singleton == null)
-                    _singleton = new XmlRpcRequestDeserializer();
-
-                return _singleton;
-            }
-        }
-
-        /// <summary>Static method that parses XML data into a request using the Singleton.</summary>
-        /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC request.</param>
-        /// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
-        override public Object Deserialize(TextReader xmlData)
-        {
-            XmlTextReader reader = new XmlTextReader(xmlData);
-            XmlRpcRequest request = new XmlRpcRequest();
-            bool done = false;
-
-            lock (this)
-            {
-                Reset();
-                while (!done && reader.Read())
-                {
-                    DeserializeNode(reader); // Parent parse...
-                    switch (reader.NodeType)
-                    {
-                        case XmlNodeType.EndElement:
-                            switch (reader.Name)
-                            {
-                                case METHOD_NAME:
-                                    request.MethodName = _text;
-                                    break;
-                                case METHOD_CALL:
-                                    done = true;
-                                    break;
-                                case PARAM:
-                                    request.Params.Add(_value);
-                                    _text = null;
-                                    break;
-                            }
-                            break;
-                    }
-                }
-            }
-            return request;
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequestSerializer.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequestSerializer.cs
deleted file mode 100644
index 1451d69..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcRequestSerializer.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.Xml;
-    using System.IO;
-
-    /// <summary>Class responsible for serializing an XML-RPC request.</summary>
-    /// <remarks>This class handles the request envelope, depending on <c>XmlRpcSerializer</c>
-    /// to serialize the payload.</remarks>
-    /// <seealso cref="XmlRpcSerializer"/>
-    public class XmlRpcRequestSerializer : XmlRpcSerializer
-    {
-        static private XmlRpcRequestSerializer _singleton;
-        /// <summary>A static singleton instance of this deserializer.</summary>
-        static public XmlRpcRequestSerializer Singleton
-        {
-            get
-            {
-                if (_singleton == null)
-                    _singleton = new XmlRpcRequestSerializer();
-
-                return _singleton;
-            }
-        }
-
-        /// <summary>Serialize the <c>XmlRpcRequest</c> to the output stream.</summary>
-        /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
-        /// <param name="obj">An <c>XmlRpcRequest</c> to serialize.</param>
-        /// <seealso cref="XmlRpcRequest"/>
-        override public void Serialize(XmlTextWriter output, Object obj)
-        {
-            XmlRpcRequest request = (XmlRpcRequest)obj;
-            output.WriteStartDocument();
-            output.WriteStartElement(METHOD_CALL);
-            output.WriteElementString(METHOD_NAME, request.MethodName);
-            output.WriteStartElement(PARAMS);
-            foreach (Object param in request.Params)
-            {
-                output.WriteStartElement(PARAM);
-                output.WriteStartElement(VALUE);
-                SerializeObject(output, param);
-                output.WriteEndElement();
-                output.WriteEndElement();
-            }
-
-            output.WriteEndElement();
-            output.WriteEndElement();
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponder.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponder.cs
deleted file mode 100644
index c3e814a..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponder.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Xml;
-    using System.Net.Sockets;
-
-    /// <summary>The class is a container of the context of an XML-RPC dialog on the server side.</summary>
-    /// <remarks>Instances of this class maintain the context for an individual XML-RPC server
-    /// side dialog. Namely they manage an inbound deserializer and an outbound serializer. </remarks>
-    public class XmlRpcResponder
-    {
-        private XmlRpcRequestDeserializer _deserializer = new XmlRpcRequestDeserializer();
-        private XmlRpcResponseSerializer _serializer = new XmlRpcResponseSerializer();
-        private XmlRpcServer _server;
-        private TcpClient _client;
-        private SimpleHttpRequest _httpReq;
-
-        /// <summary>The SimpleHttpRequest based on the TcpClient.</summary>
-        public SimpleHttpRequest HttpReq
-        {
-            get { return _httpReq; }
-        }
-
-        /// <summary>Basic constructor.</summary>
-        /// <param name="server">XmlRpcServer that this XmlRpcResponder services.</param>
-        /// <param name="client">TcpClient with the connection.</param>
-        public XmlRpcResponder(XmlRpcServer server, TcpClient client)
-        {
-            _server = server;
-            _client = client;
-            _httpReq = new SimpleHttpRequest(_client);
-        }
-
-        /// <summary>Call close to insure proper shutdown.</summary>
-        ~XmlRpcResponder()
-        {
-            Close();
-        }
-
-        ///<summary>Respond using this responders HttpReq.</summary>
-        public void Respond()
-        {
-            Respond(HttpReq);
-        }
-
-        /// <summary>Handle an HTTP request containing an XML-RPC request.</summary>
-        /// <remarks>This method deserializes the XML-RPC request, invokes the
-        /// described method, serializes the response (or fault) and sends the XML-RPC response
-        /// back as a valid HTTP page.
-        /// </remarks>
-        /// <param name="httpReq"><c>SimpleHttpRequest</c> containing the request.</param>
-        public void Respond(SimpleHttpRequest httpReq)
-        {
-            XmlRpcRequest xmlRpcReq = (XmlRpcRequest)_deserializer.Deserialize(httpReq.Input);
-            XmlRpcResponse xmlRpcResp = new XmlRpcResponse();
-
-            try
-            {
-                xmlRpcResp.Value = _server.Invoke(xmlRpcReq);
-            }
-            catch (XmlRpcException e)
-            {
-                xmlRpcResp.SetFault(e.FaultCode, e.FaultString);
-            }
-            catch (Exception e2)
-            {
-                xmlRpcResp.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR,
-                      XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message);
-            }
-
-            if (Logger.Delegate != null)
-                Logger.WriteEntry(xmlRpcResp.ToString(), LogLevel.Information);
-
-            XmlRpcServer.HttpHeader(httpReq.Protocol, "text/xml", 0, " 200 OK", httpReq.Output);
-            httpReq.Output.Flush();
-            XmlTextWriter xml = new XmlTextWriter(httpReq.Output);
-            _serializer.Serialize(xml, xmlRpcResp);
-            xml.Flush();
-            httpReq.Output.Flush();
-        }
-
-        ///<summary>Close all contained resources, both the HttpReq and client.</summary>
-        public void Close()
-        {
-            if (_httpReq != null)
-            {
-                _httpReq.Close();
-                _httpReq = null;
-            }
-
-            if (_client != null)
-            {
-                _client.Close();
-                _client = null;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponse.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponse.cs
deleted file mode 100644
index 0d7d985..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponse.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.IO;
-    using System.Xml;
-
-    /// <summary>Class designed to represent an XML-RPC response.</summary>
-    public class XmlRpcResponse
-    {
-        private Object _value;
-        /// <summary><c>bool</c> indicating if this response represents a fault.</summary>
-        public bool IsFault;
-
-        /// <summary>Basic constructor</summary>
-        public XmlRpcResponse()
-        {
-            Value = null;
-            IsFault = false;
-        }
-
-        /// <summary>Constructor for a fault.</summary>
-        /// <param name="code"><c>int</c> the numeric faultCode value.</param>
-        /// <param name="message"><c>String</c> the faultString value.</param>
-        public XmlRpcResponse(int code, String message)
-            : this()
-        {
-            SetFault(code, message);
-        }
-
-        /// <summary>The data value of the response, may be fault data.</summary>
-        public Object Value
-        {
-            get { return _value; }
-            set
-            {
-                IsFault = false;
-                _value = value;
-            }
-        }
-
-        /// <summary>The faultCode if this is a fault.</summary>
-        public int FaultCode
-        {
-            get
-            {
-                if (!IsFault)
-                    return 0;
-                else
-                    return (int)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_CODE];
-            }
-        }
-
-        /// <summary>The faultString if this is a fault.</summary>
-        public String FaultString
-        {
-            get
-            {
-                if (!IsFault)
-                    return "";
-                else
-                    return (String)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_STRING];
-            }
-        }
-
-        /// <summary>Set this response to be a fault.</summary>
-        /// <param name="code"><c>int</c> the numeric faultCode value.</param>
-        /// <param name="message"><c>String</c> the faultString value.</param>
-        public void SetFault(int code, String message)
-        {
-            Hashtable fault = new Hashtable();
-            fault.Add("faultCode", code);
-            fault.Add("faultString", message);
-            Value = fault;
-            IsFault = true;
-        }
-
-        /// <summary>Form a useful string representation of the object, in this case the XML response.</summary>
-        /// <returns><c>String</c> The XML serialized XML-RPC response.</returns>
-        override public String ToString()
-        {
-            return XmlRpcResponseSerializer.Singleton.Serialize(this);
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponseDeserializer.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponseDeserializer.cs
deleted file mode 100644
index bfaf968..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponseDeserializer.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.IO;
-    using System.Xml;
-
-    /// <summary>Class to deserialize XML data representing a response.</summary>
-    public class XmlRpcResponseDeserializer : XmlRpcDeserializer
-    {
-        static private XmlRpcResponseDeserializer _singleton;
-        /// <summary>A static singleton instance of this deserializer.</summary>
-        [Obsolete("This object is now thread safe, just use an instance.", false)]
-        static public XmlRpcResponseDeserializer Singleton
-        {
-            get
-            {
-                if (_singleton == null)
-                    _singleton = new XmlRpcResponseDeserializer();
-
-                return _singleton;
-            }
-        }
-
-        /// <summary>Static method that parses XML data into a response using the Singleton.</summary>
-        /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
-        /// <returns><c>XmlRpcResponse</c> object resulting from the parse.</returns>
-        override public Object Deserialize(TextReader xmlData)
-        {
-            XmlTextReader reader = new XmlTextReader(xmlData);
-            XmlRpcResponse response = new XmlRpcResponse();
-            bool done = false;
-
-            lock (this)
-            {
-                Reset();
-
-                while (!done && reader.Read())
-                {
-                    DeserializeNode(reader); // Parent parse...
-                    switch (reader.NodeType)
-                    {
-                        case XmlNodeType.EndElement:
-                            switch (reader.Name)
-                            {
-                                case FAULT:
-                                    response.Value = _value;
-                                    response.IsFault = true;
-                                    break;
-                                case PARAM:
-                                    response.Value = _value;
-                                    _value = null;
-                                    _text = null;
-                                    break;
-                            }
-                            break;
-                        default:
-                            break;
-                    }
-                }
-            }
-            return response;
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponseSerializer.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponseSerializer.cs
deleted file mode 100644
index 67b3b09..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcResponseSerializer.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.Xml;
-
-    /// <summary>Class responsible for serializing an XML-RPC response.</summary>
-    /// <remarks>This class handles the response envelope, depending on XmlRpcSerializer
-    /// to serialize the payload.</remarks>
-    /// <seealso cref="XmlRpcSerializer"/>
-    public class XmlRpcResponseSerializer : XmlRpcSerializer
-    {
-        static private XmlRpcResponseSerializer _singleton;
-        /// <summary>A static singleton instance of this deserializer.</summary>
-        static public XmlRpcResponseSerializer Singleton
-        {
-            get
-            {
-                if (_singleton == null)
-                    _singleton = new XmlRpcResponseSerializer();
-
-                return _singleton;
-            }
-        }
-
-        /// <summary>Serialize the <c>XmlRpcResponse</c> to the output stream.</summary>
-        /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
-        /// <param name="obj">An <c>Object</c> to serialize.</param>
-        /// <seealso cref="XmlRpcResponse"/>
-        override public void Serialize(XmlTextWriter output, Object obj)
-        {
-            XmlRpcResponse response = (XmlRpcResponse)obj;
-
-            output.WriteStartDocument();
-            output.WriteStartElement(METHOD_RESPONSE);
-
-            if (response.IsFault)
-                output.WriteStartElement(FAULT);
-            else
-            {
-                output.WriteStartElement(PARAMS);
-                output.WriteStartElement(PARAM);
-            }
-
-            output.WriteStartElement(VALUE);
-
-            SerializeObject(output, response.Value);
-
-            output.WriteEndElement();
-
-            output.WriteEndElement();
-            if (!response.IsFault)
-                output.WriteEndElement();
-            output.WriteEndElement();
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcSerializer.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcSerializer.cs
deleted file mode 100644
index 8989a5b..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcSerializer.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.IO;
-    using System.Xml;
-
-    /// <summary>Base class of classes serializing data to XML-RPC's XML format.</summary>
-    /// <remarks>This class handles the basic type conversions like Integer to &lt;i4&gt;. </remarks>
-    /// <seealso cref="XmlRpcXmlTokens"/>
-    public class XmlRpcSerializer : XmlRpcXmlTokens
-    {
-
-        /// <summary>Serialize the <c>XmlRpcRequest</c> to the output stream.</summary>
-        /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
-        /// <param name="obj">An <c>Object</c> to serialize.</param>
-        /// <seealso cref="XmlRpcRequest"/>
-        virtual public void Serialize(XmlTextWriter output, Object obj)
-        {
-        }
-
-        /// <summary>Serialize the <c>XmlRpcRequest</c> to a String.</summary>
-        /// <remarks>Note this may represent a real memory hog for a large request.</remarks>
-        /// <param name="obj">An <c>Object</c> to serialize.</param>
-        /// <returns><c>String</c> containing XML-RPC representation of the request.</returns>
-        /// <seealso cref="XmlRpcRequest"/>
-        public String Serialize(Object obj)
-        {
-            StringWriter strBuf = new StringWriter();
-            XmlTextWriter xml = new XmlTextWriter(strBuf);
-            xml.Formatting = Formatting.Indented;
-            xml.Indentation = 4;
-            Serialize(xml, obj);
-            xml.Flush();
-            String returns = strBuf.ToString();
-            xml.Close();
-            return returns;
-        }
-
-        /// <remarks>Serialize the object to the output stream.</remarks>
-        /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
-        /// <param name="obj">An <c>Object</c> to serialize.</param>
-        public void SerializeObject(XmlTextWriter output, Object obj)
-        {
-            if (obj == null)
-                return;
-
-            if (obj is byte[])
-            {
-                byte[] ba = (byte[])obj;
-                output.WriteStartElement(BASE64);
-                output.WriteBase64(ba, 0, ba.Length);
-                output.WriteEndElement();
-            }
-            else if (obj is String)
-            {
-                output.WriteElementString(STRING, obj.ToString());
-            }
-            else if (obj is Int32)
-            {
-                output.WriteElementString(INT, obj.ToString());
-            }
-            else if (obj is DateTime)
-            {
-                output.WriteElementString(DATETIME, ((DateTime)obj).ToString(ISO_DATETIME));
-            }
-            else if (obj is Double)
-            {
-                output.WriteElementString(DOUBLE, obj.ToString());
-            }
-            else if (obj is Boolean)
-            {
-                output.WriteElementString(BOOLEAN, ((((Boolean)obj) == true) ? "1" : "0"));
-            }
-            else if (obj is IList)
-            {
-                output.WriteStartElement(ARRAY);
-                output.WriteStartElement(DATA);
-                if (((ArrayList)obj).Count > 0)
-                {
-                    foreach (Object member in ((IList)obj))
-                    {
-                        output.WriteStartElement(VALUE);
-                        SerializeObject(output, member);
-                        output.WriteEndElement();
-                    }
-                }
-                output.WriteEndElement();
-                output.WriteEndElement();
-            }
-            else if (obj is IDictionary)
-            {
-                IDictionary h = (IDictionary)obj;
-                output.WriteStartElement(STRUCT);
-                foreach (String key in h.Keys)
-                {
-                    output.WriteStartElement(MEMBER);
-                    output.WriteElementString(NAME, key);
-                    output.WriteStartElement(VALUE);
-                    SerializeObject(output, h[key]);
-                    output.WriteEndElement();
-                    output.WriteEndElement();
-                }
-                output.WriteEndElement();
-            }
-
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcServer.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcServer.cs
deleted file mode 100644
index 035e28f..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcServer.cs
+++ /dev/null
@@ -1,239 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.IO;
-    using System.Net;
-    using System.Net.Sockets;
-    using System.Text;
-    using System.Threading;
-    using System.Xml;
-
-    /// <summary>A restricted HTTP server for use with XML-RPC.</summary>
-    /// <remarks>It only handles POST requests, and only POSTs representing XML-RPC calls.
-    /// In addition to dispatching requests it also provides a registry for request handlers.
-    /// </remarks>
-    public class XmlRpcServer : IEnumerable
-    {
-#pragma warning disable 0414 // disable "private field assigned but not used"
-        const int RESPONDER_COUNT = 10;
-        private TcpListener _myListener;
-        private int _port;
-        private IPAddress _address;
-        private IDictionary _handlers;
-        private XmlRpcSystemObject _system;
-        private WaitCallback _wc;
-#pragma warning restore 0414
-
-        ///<summary>Constructor with port and address.</summary>
-        ///<remarks>This constructor sets up a TcpListener listening on the
-        ///given port and address. It also calls a Thread on the method StartListen().</remarks>
-        ///<param name="address"><c>IPAddress</c> value of the address to listen on.</param>
-        ///<param name="port"><c>Int</c> value of the port to listen on.</param>
-        public XmlRpcServer(IPAddress address, int port)
-        {
-            _port = port;
-            _address = address;
-            _handlers = new Hashtable();
-            _system = new XmlRpcSystemObject(this);
-            _wc = new WaitCallback(WaitCallback);
-        }
-
-        ///<summary>Basic constructor.</summary>
-        ///<remarks>This constructor sets up a TcpListener listening on the
-        ///given port. It also calls a Thread on the method StartListen(). IPAddress.Any
-        ///is assumed as the address here.</remarks>
-        ///<param name="port"><c>Int</c> value of the port to listen on.</param>
-        public XmlRpcServer(int port) : this(IPAddress.Any, port) { }
-
-        /// <summary>Start the server.</summary>
-        public void Start()
-        {
-            try
-            {
-                Stop();
-                //start listing on the given port
-                //	    IPAddress addr = IPAddress.Parse("127.0.0.1");
-                lock (this)
-                {
-                    _myListener = new TcpListener(IPAddress.Any, _port);
-                    _myListener.Start();
-                    //start the thread which calls the method 'StartListen'
-                    Thread th = new Thread(new ThreadStart(StartListen));
-                    th.Start();
-                }
-            }
-            catch (Exception e)
-            {
-                Logger.WriteEntry("An Exception Occurred while Listening :" + e.ToString(), LogLevel.Error);
-            }
-        }
-
-        /// <summary>Stop the server.</summary>
-        public void Stop()
-        {
-            try
-            {
-                if (_myListener != null)
-                {
-                    lock (this)
-                    {
-                        _myListener.Stop();
-                        _myListener = null;
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                Logger.WriteEntry("An Exception Occurred while stopping :" +
-                      e.ToString(), LogLevel.Error);
-            }
-        }
-
-        /// <summary>Get an enumeration of my XML-RPC handlers.</summary>
-        /// <returns><c>IEnumerable</c> the handler enumeration.</returns>
-        public IEnumerator GetEnumerator()
-        {
-            return _handlers.GetEnumerator();
-        }
-
-        /// <summary>Retrieve a handler by name.</summary>
-        /// <param name="name"><c>String</c> naming a handler</param>
-        /// <returns><c>Object</c> that is the handler.</returns>
-        public Object this[String name]
-        {
-            get { return _handlers[name]; }
-        }
-
-        ///<summary>
-        ///This method Accepts new connections and dispatches them when appropriate.
-        ///</summary>
-        public void StartListen()
-        {
-            while (true && _myListener != null)
-            {
-                //Accept a new connection
-                XmlRpcResponder responder = new XmlRpcResponder(this, _myListener.AcceptTcpClient());
-                ThreadPool.QueueUserWorkItem(_wc, responder);
-            }
-        }
-
-
-        ///<summary>
-        ///Add an XML-RPC handler object by name.
-        ///</summary>
-        ///<param name="name"><c>String</c> XML-RPC dispatch name of this object.</param>
-        ///<param name="obj"><c>Object</c> The object that is the XML-RPC handler.</param>
-        public void Add(String name, Object obj)
-        {
-            _handlers.Add(name, obj);
-        }
-
-        ///<summary>Return a C# object.method name for and XML-RPC object.method name pair.</summary>
-        ///<param name="methodName">The XML-RPC object.method.</param>
-        ///<returns><c>String</c> of form object.method for the underlying C# method.</returns>
-        public String MethodName(String methodName)
-        {
-            int dotAt = methodName.LastIndexOf('.');
-
-            if (dotAt == -1)
-            {
-                throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
-                              XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Bad method name " + methodName);
-            }
-
-            String objectName = methodName.Substring(0, dotAt);
-            Object target = _handlers[objectName];
-
-            if (target == null)
-            {
-                throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
-                              XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found");
-            }
-
-            return target.GetType().FullName + "." + methodName.Substring(dotAt + 1);
-        }
-
-        ///<summary>Invoke a method described in a request.</summary>
-        ///<param name="req"><c>XmlRpcRequest</c> containing a method descriptions.</param>
-        /// <seealso cref="XmlRpcSystemObject.Invoke"/>
-        /// <seealso cref="XmlRpcServer.Invoke(String,String,IList)"/>
-        public Object Invoke(XmlRpcRequest req)
-        {
-            return Invoke(req.MethodNameObject, req.MethodNameMethod, req.Params);
-        }
-
-        ///<summary>Invoke a method on a named handler.</summary>
-        ///<param name="objectName"><c>String</c> The name of the handler.</param>
-        ///<param name="methodName"><c>String</c> The name of the method to invoke on the handler.</param>
-        ///<param name="parameters"><c>IList</c> The parameters to invoke the method with.</param>
-        /// <seealso cref="XmlRpcSystemObject.Invoke"/>
-        public Object Invoke(String objectName, String methodName, IList parameters)
-        {
-            Object target = _handlers[objectName];
-
-            if (target == null)
-            {
-                throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
-                              XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found");
-            }
-
-            return XmlRpcSystemObject.Invoke(target, methodName, parameters);
-        }
-
-        /// <summary>The method the thread pool invokes when a thread is available to handle an HTTP request.</summary>
-        /// <param name="responder">TcpClient from the socket accept.</param>
-        public void WaitCallback(object responder)
-        {
-            XmlRpcResponder resp = (XmlRpcResponder)responder;
-
-            if (resp.HttpReq.HttpMethod == "POST")
-            {
-                try
-                {
-                    resp.Respond();
-                }
-                catch (Exception e)
-                {
-                    Logger.WriteEntry("Failed on post: " + e, LogLevel.Error);
-                }
-            }
-            else
-            {
-                Logger.WriteEntry("Only POST methods are supported: " + resp.HttpReq.HttpMethod +
-                          " ignored", LogLevel.Error);
-            }
-
-            resp.Close();
-        }
-
-        /// <summary>
-        /// This function send the Header Information to the client (Browser)
-        /// </summary>
-        /// <param name="sHttpVersion">HTTP Version</param>
-        /// <param name="sMIMEHeader">Mime Type</param>
-        /// <param name="iTotBytes">Total Bytes to be sent in the body</param>
-        /// <param name="sStatusCode"></param>
-        /// <param name="output">Socket reference</param>
-        static public void HttpHeader(string sHttpVersion, string sMIMEHeader, long iTotBytes, string sStatusCode, TextWriter output)
-        {
-            String sBuffer = "";
-
-            // if Mime type is not provided set default to text/html
-            if (sMIMEHeader.Length == 0)
-            {
-                sMIMEHeader = "text/html";  // Default Mime Type is text/html
-            }
-
-            sBuffer += sHttpVersion + sStatusCode + "\r\n";
-            sBuffer += "Connection: close\r\n";
-            if (iTotBytes > 0)
-                sBuffer += "Content-Length: " + iTotBytes + "\r\n";
-            sBuffer += "Server: XmlRpcServer \r\n";
-            sBuffer += "Content-Type: " + sMIMEHeader + "\r\n";
-            sBuffer += "\r\n";
-
-            output.Write(sBuffer);
-        }
-    }
-}
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcSystemObject.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcSystemObject.cs
deleted file mode 100644
index c88e654..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcSystemObject.cs
+++ /dev/null
@@ -1,252 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-    using System.Collections;
-    using System.Reflection;
-
-    /// <summary> XML-RPC System object implementation of extended specifications.</summary>
-    [XmlRpcExposed]
-    public class XmlRpcSystemObject
-    {
-        private XmlRpcServer _server;
-        static private IDictionary _methodHelp = new Hashtable();
-
-        /// <summary>Static <c>IDictionary</c> to hold mappings of method name to associated documentation String</summary>
-        static public IDictionary MethodHelp
-        {
-            get { return _methodHelp; }
-        }
-
-        /// <summary>Constructor.</summary>
-        /// <param name="server"><c>XmlRpcServer</c> server to be the system object for.</param>
-        public XmlRpcSystemObject(XmlRpcServer server)
-        {
-            _server = server;
-            server.Add("system", this);
-            _methodHelp.Add(this.GetType().FullName + ".methodHelp", "Return a string description.");
-        }
-
-        /// <summary>Invoke a method on a given object.</summary>
-        /// <remarks>Using reflection, and respecting the <c>XmlRpcExposed</c> attribute,
-        /// invoke the <paramref>methodName</paramref> method on the <paramref>target</paramref>
-        /// instance with the <paramref>parameters</paramref> provided. All this packages other <c>Invoke</c> methods
-        /// end up calling this.</remarks>
-        /// <returns><c>Object</c> the value the invoked method returns.</returns>
-        /// <exception cref="XmlRpcException">If method does not exist, is not exposed, parameters invalid, or invocation
-        /// results in an exception. Note, the <c>XmlRpcException.Code</c> will indicate cause.</exception>
-        static public Object Invoke(Object target, String methodName, IList parameters)
-        {
-            if (target == null)
-                throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
-                              XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Invalid target object.");
-
-            Type type = target.GetType();
-            MethodInfo method = type.GetMethod(methodName);
-
-            try
-            {
-                if (!XmlRpcExposedAttribute.ExposedMethod(target, methodName))
-                    throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
-                              XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Method " + methodName + " is not exposed.");
-            }
-            catch (MissingMethodException me)
-            {
-                throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
-                              XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": " + me.Message);
-            }
-
-            Object[] args = new Object[parameters.Count];
-
-            int index = 0;
-            foreach (Object arg in parameters)
-            {
-                args[index] = arg;
-                index++;
-            }
-
-            try
-            {
-                Object retValue = method.Invoke(target, args);
-                if (retValue == null)
-                    throw new XmlRpcException(XmlRpcErrorCodes.APPLICATION_ERROR,
-                              XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": Method returned NULL.");
-                return retValue;
-            }
-            catch (XmlRpcException e)
-            {
-                throw e;
-            }
-            catch (ArgumentException ae)
-            {
-                Logger.WriteEntry(XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": " + ae.Message,
-                          LogLevel.Information);
-                String call = methodName + "( ";
-                foreach (Object o in args)
-                {
-                    call += o.GetType().Name;
-                    call += " ";
-                }
-                call += ")";
-                throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_PARAMS,
-                              XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": Arguement type mismatch invoking " + call);
-            }
-            catch (TargetParameterCountException tpce)
-            {
-                Logger.WriteEntry(XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": " + tpce.Message,
-                          LogLevel.Information);
-                throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_PARAMS,
-                              XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": Arguement count mismatch invoking " + methodName);
-            }
-            catch (TargetInvocationException tie)
-            {
-                throw new XmlRpcException(XmlRpcErrorCodes.APPLICATION_ERROR,
-                              XmlRpcErrorCodes.APPLICATION_ERROR_MSG + " Invoked method " + methodName + ": " + tie.Message);
-            }
-        }
-
-        /// <summary>List methods available on all handlers of this server.</summary>
-        /// <returns><c>IList</c> An array of <c>Strings</c>, each <c>String</c> will have form "object.method".</returns>
-        [XmlRpcExposed]
-        public IList listMethods()
-        {
-            IList methods = new ArrayList();
-            Boolean considerExposure;
-
-            foreach (DictionaryEntry handlerEntry in _server)
-            {
-                considerExposure = XmlRpcExposedAttribute.IsExposed(handlerEntry.Value.GetType());
-
-                foreach (MemberInfo mi in handlerEntry.Value.GetType().GetMembers())
-                {
-                    if (mi.MemberType != MemberTypes.Method)
-                        continue;
-
-                    if (!((MethodInfo)mi).IsPublic)
-                        continue;
-
-                    if (considerExposure && !XmlRpcExposedAttribute.IsExposed(mi))
-                        continue;
-
-                    methods.Add(handlerEntry.Key + "." + mi.Name);
-                }
-            }
-
-            return methods;
-        }
-
-        /// <summary>Given a method name return the possible signatures for it.</summary>
-        /// <param name="name"><c>String</c> The object.method name to look up.</param>
-        /// <returns><c>IList</c> Of arrays of signatures.</returns>
-        [XmlRpcExposed]
-        public IList methodSignature(String name)
-        {
-            IList signatures = new ArrayList();
-            int index = name.IndexOf('.');
-
-            if (index < 0)
-                return signatures;
-
-            String oName = name.Substring(0, index);
-            Object obj = _server[oName];
-
-            if (obj == null)
-                return signatures;
-
-            MemberInfo[] mi = obj.GetType().GetMember(name.Substring(index + 1));
-
-            if (mi == null || mi.Length != 1) // for now we want a single signature
-                return signatures;
-
-            MethodInfo method;
-
-            try
-            {
-                method = (MethodInfo)mi[0];
-            }
-            catch (Exception e)
-            {
-                Logger.WriteEntry("Attempted methodSignature call on " + mi[0] + " caused: " + e,
-                          LogLevel.Information);
-                return signatures;
-            }
-
-            if (!method.IsPublic)
-                return signatures;
-
-            IList signature = new ArrayList();
-            signature.Add(method.ReturnType.Name);
-
-            foreach (ParameterInfo param in method.GetParameters())
-            {
-                signature.Add(param.ParameterType.Name);
-            }
-
-
-            signatures.Add(signature);
-
-            return signatures;
-        }
-
-        /// <summary>Help for given method signature. Not implemented yet.</summary>
-        /// <param name="name"><c>String</c> The object.method name to look up.</param>
-        /// <returns><c>String</c> help text. Rich HTML text.</returns>
-        [XmlRpcExposed]
-        public String methodHelp(String name)
-        {
-            String help = null;
-
-            try
-            {
-                help = (String)_methodHelp[_server.MethodName(name)];
-            }
-            catch (XmlRpcException e)
-            {
-                throw e;
-            }
-            catch (Exception) { /* ignored */ };
-
-            if (help == null)
-                help = "No help available for: " + name;
-
-            return help;
-        }
-
-        /// <summary>Boxcarring support method.</summary>
-        /// <param name="calls"><c>IList</c> of calls</param>
-        /// <returns><c>ArrayList</c> of results/faults.</returns>
-        [XmlRpcExposed]
-        public IList multiCall(IList calls)
-        {
-            IList responses = new ArrayList();
-            XmlRpcResponse fault = new XmlRpcResponse();
-
-            foreach (IDictionary call in calls)
-            {
-                try
-                {
-                    XmlRpcRequest req = new XmlRpcRequest((String)call[XmlRpcXmlTokens.METHOD_NAME],
-                                          (ArrayList)call[XmlRpcXmlTokens.PARAMS]);
-                    Object results = _server.Invoke(req);
-                    IList response = new ArrayList();
-                    response.Add(results);
-                    responses.Add(response);
-                }
-                catch (XmlRpcException e)
-                {
-                    fault.SetFault(e.FaultCode, e.FaultString);
-                    responses.Add(fault.Value);
-                }
-                catch (Exception e2)
-                {
-                    fault.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR,
-                               XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message);
-                    responses.Add(fault.Value);
-                }
-            }
-
-            return responses;
-        }
-
-    }
-}
-
diff --git a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcXmlTokens.cs b/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcXmlTokens.cs
deleted file mode 100644
index 6fc60af..0000000
--- a/old/libsl1550/SLProxy/XmlRpcCS/XmlRpcXmlTokens.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-namespace Nwc.XmlRpc
-{
-    using System;
-
-    /// <summary>Class collecting <c>String</c> tokens that are part of XML-RPC files.</summary>
-    public class XmlRpcXmlTokens
-    {
-        /// <summary>C# formatting string to describe an ISO 8601 date.</summary>
-        public const String ISO_DATETIME = "yyyyMMdd\\THH\\:mm\\:ss";
-        /// <summary>Base64 field indicator.</summary>
-        /// <remarks>Corresponds to the &lt;base64&gt; tag.</remarks>
-        public const String BASE64 = "base64";
-        /// <summary>String field indicator.</summary>
-        /// <remarks>Corresponds to the &lt;string&gt; tag.</remarks>
-        public const String STRING = "string";
-        /// <summary>Integer field integer.</summary>
-        /// <remarks>Corresponds to the &lt;i4&gt; tag.</remarks>
-        public const String INT = "i4";
-        /// <summary>Alternate integer field indicator.</summary>
-        /// <remarks>Corresponds to the &lt;int&gt; tag.</remarks>
-        public const String ALT_INT = "int";
-        /// <summary>Date field indicator.</summary>
-        /// <remarks>Corresponds to the &lt;dateTime.iso8601&gt; tag.</remarks>
-        public const String DATETIME = "dateTime.iso8601";
-        /// <summary>Boolean field indicator.</summary>
-        /// <remarks>Corresponds to the &lt;boolean&gt; tag.</remarks>
-        public const String BOOLEAN = "boolean";
-        /// <summary>Value token.</summary>
-        /// <remarks>Corresponds to the &lt;value&gt; tag.</remarks>
-        public const String VALUE = "value";
-        /// <summary>Name token.</summary>
-        /// <remarks>Corresponds to the &lt;name&gt; tag.</remarks>
-        public const String NAME = "name";
-        /// <summary>Array field indicator..</summary>
-        /// <remarks>Corresponds to the &lt;array&gt; tag.</remarks>
-        public const String ARRAY = "array";
-        /// <summary>Data token.</summary>
-        /// <remarks>Corresponds to the &lt;data&gt; tag.</remarks>
-        public const String DATA = "data";
-        /// <summary>Member token.</summary>
-        /// <remarks>Corresponds to the &lt;member&gt; tag.</remarks>
-        public const String MEMBER = "member";
-        /// <summary>Stuct field indicator.</summary>
-        /// <remarks>Corresponds to the &lt;struct&gt; tag.</remarks>
-        public const String STRUCT = "struct";
-        /// <summary>Double field indicator.</summary>
-        /// <remarks>Corresponds to the &lt;double&gt; tag.</remarks>
-        public const String DOUBLE = "double";
-        /// <summary>Param token.</summary>
-        /// <remarks>Corresponds to the &lt;param&gt; tag.</remarks>
-        public const String PARAM = "param";
-        /// <summary>Params token.</summary>
-        /// <remarks>Corresponds to the &lt;params&gt; tag.</remarks>
-        public const String PARAMS = "params";
-        /// <summary>MethodCall token.</summary>
-        /// <remarks>Corresponds to the &lt;methodCall&gt; tag.</remarks>
-        public const String METHOD_CALL = "methodCall";
-        /// <summary>MethodName token.</summary>
-        /// <remarks>Corresponds to the &lt;methodName&gt; tag.</remarks>
-        public const String METHOD_NAME = "methodName";
-        /// <summary>MethodResponse token</summary>
-        /// <remarks>Corresponds to the &lt;methodResponse&gt; tag.</remarks>
-        public const String METHOD_RESPONSE = "methodResponse";
-        /// <summary>Fault response token.</summary>
-        /// <remarks>Corresponds to the &lt;fault&gt; tag.</remarks>
-        public const String FAULT = "fault";
-        /// <summary>FaultCode token.</summary>
-        /// <remarks>Corresponds to the &lt;faultCode&gt; tag.</remarks>
-        public const String FAULT_CODE = "faultCode";
-        /// <summary>FaultString token.</summary>
-        /// <remarks>Corresponds to the &lt;faultString&gt; tag.</remarks>
-        public const String FAULT_STRING = "faultString";
-    }
-}
-
-
diff --git a/old/libsl1550/SecondGlance/Properties/AssemblyInfo.cs b/old/libsl1550/SecondGlance/Properties/AssemblyInfo.cs
deleted file mode 100644
index e21fc67..0000000
--- a/old/libsl1550/SecondGlance/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SecondGlance")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SecondGlance")]
-[assembly: AssemblyCopyright("Copyright ©  2006")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("02456c47-f074-4302-a3a3-01a719de9d20")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/old/libsl1550/SecondGlance/Properties/Resources.Designer.cs b/old/libsl1550/SecondGlance/Properties/Resources.Designer.cs
deleted file mode 100644
index 65ad993..0000000
--- a/old/libsl1550/SecondGlance/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.308
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace SecondGlance.Properties
-{
-
-
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
-        private static global::System.Resources.ResourceManager resourceMan;
-
-        private static global::System.Globalization.CultureInfo resourceCulture;
-
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
-        }
-
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SecondGlance.Properties.Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
-                return resourceCulture;
-            }
-            set
-            {
-                resourceCulture = value;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/SecondGlance/Properties/Resources.resx b/old/libsl1550/SecondGlance/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/old/libsl1550/SecondGlance/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/SecondGlance/Properties/Settings.Designer.cs b/old/libsl1550/SecondGlance/Properties/Settings.Designer.cs
deleted file mode 100644
index f7808fd..0000000
--- a/old/libsl1550/SecondGlance/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.308
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace SecondGlance.Properties
-{
-
-
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
-        public static Settings Default
-        {
-            get
-            {
-                return defaultInstance;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/SecondGlance/Properties/Settings.settings b/old/libsl1550/SecondGlance/Properties/Settings.settings
deleted file mode 100644
index 3964565..0000000
--- a/old/libsl1550/SecondGlance/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>
diff --git a/old/libsl1550/SecondGlance/SecondGlance.cs b/old/libsl1550/SecondGlance/SecondGlance.cs
deleted file mode 100644
index 1a8aefe..0000000
--- a/old/libsl1550/SecondGlance/SecondGlance.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace SecondGlance
-{
-    static class SecondGlance
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new frmSecondGlance());
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/SecondGlance/SecondGlance.csproj b/old/libsl1550/SecondGlance/SecondGlance.csproj
deleted file mode 100644
index 1222f55..0000000
--- a/old/libsl1550/SecondGlance/SecondGlance.csproj
+++ /dev/null
@@ -1,87 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{D72C92D1-559A-48A7-93F5-99F4E99F3F98}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>SecondGlance</RootNamespace>
-    <AssemblyName>SecondGlance</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="frmSecondGlance.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="frmSecondGlance.Designer.cs">
-      <DependentUpon>frmSecondGlance.cs</DependentUpon>
-    </Compile>
-    <Compile Include="SecondGlance.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="frmSecondGlance.resx">
-      <SubType>Designer</SubType>
-      <DependentUpon>frmSecondGlance.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Resources.resx</DependentUpon>
-    </Compile>
-    <None Include="Properties\Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
-    <Compile Include="Properties\Settings.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Settings.settings</DependentUpon>
-      <DesignTimeSharedInput>True</DesignTimeSharedInput>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\libsecondlife\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\SLProxy\SLProxy.csproj">
-      <Project>{E4115DC9-FC88-47D6-B3B6-2400AD19B80D}</Project>
-      <Name>SLProxy</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/SecondGlance/frmSecondGlance.Designer.cs b/old/libsl1550/SecondGlance/frmSecondGlance.Designer.cs
deleted file mode 100644
index 992ef1c..0000000
--- a/old/libsl1550/SecondGlance/frmSecondGlance.Designer.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-namespace SecondGlance
-{
-    partial class frmSecondGlance
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
-            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
-            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
-            this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
-            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.cboToLog = new System.Windows.Forms.ComboBox();
-            this.cmdAddLogger = new System.Windows.Forms.Button();
-            this.cmdDontLog = new System.Windows.Forms.Button();
-            this.cboLogged = new System.Windows.Forms.ComboBox();
-            this.lstPackets = new System.Windows.Forms.ListBox();
-            this.panel1.SuspendLayout();
-            this.splitContainer1.Panel1.SuspendLayout();
-            this.splitContainer1.SuspendLayout();
-            this.menuStrip1.SuspendLayout();
-            this.SuspendLayout();
-            //
-            // panel1
-            //
-            this.panel1.Controls.Add(this.splitContainer1);
-            this.panel1.Location = new System.Drawing.Point(29, 100);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(664, 333);
-            this.panel1.TabIndex = 0;
-            //
-            // splitContainer1
-            //
-            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
-            this.splitContainer1.Name = "splitContainer1";
-            //
-            // splitContainer1.Panel1
-            //
-            this.splitContainer1.Panel1.Controls.Add(this.lstPackets);
-            this.splitContainer1.Size = new System.Drawing.Size(664, 333);
-            this.splitContainer1.SplitterDistance = 294;
-            this.splitContainer1.TabIndex = 0;
-            //
-            // menuStrip1
-            //
-            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.fileToolStripMenuItem,
-            this.aboutToolStripMenuItem});
-            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
-            this.menuStrip1.Name = "menuStrip1";
-            this.menuStrip1.Size = new System.Drawing.Size(705, 24);
-            this.menuStrip1.TabIndex = 1;
-            this.menuStrip1.Text = "menuStrip1";
-            //
-            // fileToolStripMenuItem
-            //
-            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.newToolStripMenuItem,
-            this.openToolStripMenuItem,
-            this.toolStripMenuItem1,
-            this.saveToolStripMenuItem,
-            this.toolStripMenuItem2,
-            this.exitToolStripMenuItem});
-            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
-            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
-            this.fileToolStripMenuItem.Text = "File";
-            //
-            // newToolStripMenuItem
-            //
-            this.newToolStripMenuItem.Name = "newToolStripMenuItem";
-            this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
-            this.newToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
-            this.newToolStripMenuItem.Text = "New Session";
-            //
-            // openToolStripMenuItem
-            //
-            this.openToolStripMenuItem.Name = "openToolStripMenuItem";
-            this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
-            this.openToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
-            this.openToolStripMenuItem.Text = "Open Session";
-            //
-            // toolStripMenuItem1
-            //
-            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
-            this.toolStripMenuItem1.Size = new System.Drawing.Size(185, 6);
-            //
-            // saveToolStripMenuItem
-            //
-            this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
-            this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
-            this.saveToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
-            this.saveToolStripMenuItem.Text = "Save Session";
-            //
-            // toolStripMenuItem2
-            //
-            this.toolStripMenuItem2.Name = "toolStripMenuItem2";
-            this.toolStripMenuItem2.Size = new System.Drawing.Size(185, 6);
-            //
-            // exitToolStripMenuItem
-            //
-            this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
-            this.exitToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
-            this.exitToolStripMenuItem.Text = "Exit";
-            //
-            // aboutToolStripMenuItem
-            //
-            this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
-            this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
-            this.aboutToolStripMenuItem.Text = "About";
-            //
-            // cboToLog
-            //
-            this.cboToLog.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cboToLog.FormattingEnabled = true;
-            this.cboToLog.Location = new System.Drawing.Point(12, 27);
-            this.cboToLog.Name = "cboToLog";
-            this.cboToLog.Size = new System.Drawing.Size(150, 21);
-            this.cboToLog.TabIndex = 4;
-            //
-            // cmdAddLogger
-            //
-            this.cmdAddLogger.Location = new System.Drawing.Point(168, 25);
-            this.cmdAddLogger.Name = "cmdAddLogger";
-            this.cmdAddLogger.Size = new System.Drawing.Size(75, 23);
-            this.cmdAddLogger.TabIndex = 5;
-            this.cmdAddLogger.Text = "Log";
-            this.cmdAddLogger.UseVisualStyleBackColor = true;
-            this.cmdAddLogger.Click += new System.EventHandler(this.cmdAddLogger_Click);
-            //
-            // cmdDontLog
-            //
-            this.cmdDontLog.Location = new System.Drawing.Point(430, 25);
-            this.cmdDontLog.Name = "cmdDontLog";
-            this.cmdDontLog.Size = new System.Drawing.Size(75, 23);
-            this.cmdDontLog.TabIndex = 7;
-            this.cmdDontLog.Text = "Don\'t Log";
-            this.cmdDontLog.UseVisualStyleBackColor = true;
-            this.cmdDontLog.Click += new System.EventHandler(this.cmdDontLog_Click);
-            //
-            // cboLogged
-            //
-            this.cboLogged.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cboLogged.FormattingEnabled = true;
-            this.cboLogged.Location = new System.Drawing.Point(274, 27);
-            this.cboLogged.Name = "cboLogged";
-            this.cboLogged.Size = new System.Drawing.Size(150, 21);
-            this.cboLogged.TabIndex = 6;
-            //
-            // lstPackets
-            //
-            this.lstPackets.FormattingEnabled = true;
-            this.lstPackets.Location = new System.Drawing.Point(26, 40);
-            this.lstPackets.Name = "lstPackets";
-            this.lstPackets.Size = new System.Drawing.Size(243, 277);
-            this.lstPackets.TabIndex = 1;
-            //
-            // frmSecondGlance
-            //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(705, 498);
-            this.Controls.Add(this.cmdDontLog);
-            this.Controls.Add(this.cboLogged);
-            this.Controls.Add(this.cmdAddLogger);
-            this.Controls.Add(this.cboToLog);
-            this.Controls.Add(this.panel1);
-            this.Controls.Add(this.menuStrip1);
-            this.MainMenuStrip = this.menuStrip1;
-            this.Name = "frmSecondGlance";
-            this.Text = "Second Glance";
-            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmSecondGlance_FormClosing);
-            this.panel1.ResumeLayout(false);
-            this.splitContainer1.Panel1.ResumeLayout(false);
-            this.splitContainer1.ResumeLayout(false);
-            this.menuStrip1.ResumeLayout(false);
-            this.menuStrip1.PerformLayout();
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.SplitContainer splitContainer1;
-        private System.Windows.Forms.MenuStrip menuStrip1;
-        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
-        private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
-        private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
-        private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
-        private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
-        private System.Windows.Forms.ComboBox cboToLog;
-        private System.Windows.Forms.Button cmdAddLogger;
-        private System.Windows.Forms.Button cmdDontLog;
-        private System.Windows.Forms.ComboBox cboLogged;
-        private System.Windows.Forms.ListBox lstPackets;
-    }
-}
-
diff --git a/old/libsl1550/SecondGlance/frmSecondGlance.cs b/old/libsl1550/SecondGlance/frmSecondGlance.cs
deleted file mode 100644
index cad80e2..0000000
--- a/old/libsl1550/SecondGlance/frmSecondGlance.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- *
- * Copyright (c) 2007 John Hurliman
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Net;
-using System.Windows.Forms;
-using libsecondlife;
-using libsecondlife.Packets;
-using SLProxy;
-
-namespace SecondGlance
-{
-    public partial class frmSecondGlance : Form
-    {
-        private Proxy Proxy;
-        private Queue<LoggedPacket> Inbox = new Queue<LoggedPacket>();
-        private System.Timers.Timer DisplayTimer = new System.Timers.Timer(200);
-
-        public frmSecondGlance()
-        {
-            InitializeComponent();
-
-            PacketType[] types = (PacketType[])Enum.GetValues(typeof(PacketType));
-
-            // Fill up the "To Log" combo box with options
-            foreach (PacketType type in types)
-            {
-                if (type != PacketType.Default) cboToLog.Items.Add(type);
-            }
-
-            // Set the default selection to the first entry
-            cboToLog.SelectedIndex = 0;
-
-            // Setup the proxy
-            ProxyConfig proxyConfig = new ProxyConfig("Second Glance", "John Hurliman <jhurliman@wsu.edu>",
-                new string[0]);
-            Proxy = new Proxy(proxyConfig);
-
-            Proxy.Start();
-
-            // Start the timer that moves packets from the queue and displays them
-            DisplayTimer.Elapsed += new System.Timers.ElapsedEventHandler(DisplayTimer_Elapsed);
-            DisplayTimer.Start();
-        }
-
-        void DisplayTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
-        {
-            this.BeginInvoke(new MethodInvoker(UpdateDisplay));
-        }
-
-        void UpdateDisplay()
-        {
-            lock (Inbox)
-            {
-                while (Inbox.Count > 0)
-                {
-                    lstPackets.Items.Add(Inbox.Dequeue());
-                }
-            }
-        }
-
-        private void frmSecondGlance_FormClosing(object sender, FormClosingEventArgs e)
-        {
-            DisplayTimer.Stop();
-            Proxy.Stop();
-        }
-
-        private void cmdAddLogger_Click(object sender, EventArgs e)
-        {
-            if (!cboLogged.Items.Contains(cboToLog.SelectedItem))
-            {
-                PacketType type = (PacketType)cboToLog.SelectedItem;
-
-                cboLogged.Items.Add(type);
-
-                Proxy.AddDelegate(type, Direction.Incoming, new PacketDelegate(IncomingPacketHandler));
-                Proxy.AddDelegate(type, Direction.Outgoing, new PacketDelegate(OutgoingPacketHandler));
-            }
-        }
-
-        private void cmdDontLog_Click(object sender, EventArgs e)
-        {
-            ;
-        }
-
-        private Packet IncomingPacketHandler(Packet packet, IPEndPoint sim)
-        {
-            return PacketHandler(packet, sim, Direction.Incoming);
-        }
-
-        private Packet OutgoingPacketHandler(Packet packet, IPEndPoint sim)
-        {
-            return PacketHandler(packet, sim, Direction.Outgoing);
-        }
-
-        private Packet PacketHandler(Packet packet, IPEndPoint sim, Direction direction)
-        {
-            LoggedPacket logged = new LoggedPacket();
-            logged.Packet = packet;
-            logged.Sim = sim;
-            logged.Direction = direction;
-
-            lock (Inbox)
-                Inbox.Enqueue(logged);
-
-            // TODO: Packet modifications
-
-            return packet;
-        }
-    }
-
-    public class LoggedPacket
-    {
-        public Packet Packet;
-        public IPEndPoint Sim;
-        public Direction Direction;
-
-        public override string ToString()
-        {
-            string text = (Direction == Direction.Incoming) ? "<-- " : "--> ";
-            text += Sim.ToString() + " " + Packet.Type.ToString();
-
-            return text;
-        }
-    }
-}
diff --git a/old/libsl1550/SecondGlance/frmSecondGlance.resx b/old/libsl1550/SecondGlance/frmSecondGlance.resx
deleted file mode 100644
index 541af56..0000000
--- a/old/libsl1550/SecondGlance/frmSecondGlance.resx
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/VoiceTest/VoiceTest.cs b/old/libsl1550/VoiceTest/VoiceTest.cs
deleted file mode 100644
index 8534281..0000000
--- a/old/libsl1550/VoiceTest/VoiceTest.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Utilities;
-
-namespace VoiceTest
-{
-    class VoiceTest
-    {
-        static AutoResetEvent ProvisionEvent = new AutoResetEvent(false);
-        static string VoiceAccount = String.Empty;
-        static string VoicePassword = String.Empty;
-
-        static void Main(string[] args)
-        {
-            if (args.Length != 3)
-            {
-                Console.WriteLine("Usage: VoiceTest.exe [firstname] [lastname] [password]");
-                return;
-            }
-
-            string firstName = args[0];
-            string lastName = args[1];
-            string password = args[2];
-
-            SecondLife client = new SecondLife();
-            client.Settings.MULTIPLE_SIMS = false;
-            //client.OnLogMessage += new SecondLife.LogCallback(client_OnLogMessage);
-
-            VoiceManager voice = new VoiceManager(client);
-            voice.OnProvisionAccount += new VoiceManager.ProvisionAccountCallback(voice_OnProvisionAccount);
-
-            if (voice.ConnectToDaemon())
-            {
-                List<string> captureDevices = voice.CaptureDevices();
-
-                Console.WriteLine("Capture Devices:");
-                for (int i = 0; i < captureDevices.Count; i++)
-                    Console.WriteLine(String.Format("{0}. \"{1}\"", i, captureDevices[i]));
-                Console.WriteLine();
-
-                List<string> renderDevices = voice.RenderDevices();
-
-                Console.WriteLine("Render Devices:");
-                for (int i = 0; i < renderDevices.Count; i++)
-                    Console.WriteLine(String.Format("{0}. \"{1}\"", i, renderDevices[i]));
-                Console.WriteLine();
-
-                Console.WriteLine("Logging in to Second Life as " + firstName + " " + lastName + "...");
-
-                // Login to SL
-                if (client.Network.Login(firstName, lastName, password, "Voice Test", "Metaverse Industries LLC <jhurliman@metaverseindustries.com>"))
-                {
-                    Console.WriteLine("Creating voice connector...");
-
-                    int status;
-                    string connectorHandle = voice.CreateConnector(out status);
-
-                    if (connectorHandle != String.Empty)
-                    {
-                        Console.WriteLine("Voice connector handle: " + connectorHandle);
-
-                        // Wait for the simulator capabilities to show up
-                        // FIXME: Use client.Network.OnEventQueueRunning to continue here
-
-                        Console.WriteLine("Asking the current simulator to create a provisional account...");
-
-                        if (voice.RequestProvisionAccount())
-                        {
-                            if (ProvisionEvent.WaitOne(45 * 1000, false))
-                            {
-                                Console.WriteLine("Provisional account created. Username: " + VoiceAccount + ", Password: " + VoicePassword);
-                                Console.WriteLine("Logging in to voice server " + voice.VoiceServer);
-
-                                string accountHandle = voice.Login(VoiceAccount, VoicePassword, connectorHandle, out status);
-
-                                if (accountHandle != String.Empty)
-                                {
-                                    Console.WriteLine("Login succeeded, account handle: " + accountHandle);
-                                }
-                                else
-                                {
-                                    Console.WriteLine("Login failed, error code: " + status);
-                                    client.Network.Logout();
-                                }
-                            }
-                            else
-                            {
-                                Console.WriteLine("Failed to create a provisional account");
-                                client.Network.Logout();
-                            }
-                        }
-                        else
-                        {
-                            Console.WriteLine("Failed to request a provisional account");
-                        }
-                    }
-                    else
-                    {
-                        Console.WriteLine("Failed to create a voice connector, error code: " + status);
-                        client.Network.Logout();
-                    }
-                }
-                else
-                {
-                    Console.WriteLine("Login to SL failed: " + client.Network.LoginMessage);
-                }
-            }
-            else
-            {
-                Console.WriteLine("Failed to connect to the voice daemon");
-            }
-
-            Console.WriteLine("Press any key to continue...");
-            Console.ReadKey();
-        }
-
-        static void client_OnLogMessage(string message, Helpers.LogLevel level)
-        {
-            if (level == Helpers.LogLevel.Warning || level == Helpers.LogLevel.Error)
-                Console.WriteLine(level.ToString() + ": " + message);
-        }
-
-        static void voice_OnProvisionAccount(string username, string password)
-        {
-            VoiceAccount = username;
-            VoicePassword = password;
-
-            ProvisionEvent.Set();
-        }
-    }
-}
diff --git a/old/libsl1550/VoiceTest/VoiceTest.csproj b/old/libsl1550/VoiceTest/VoiceTest.csproj
deleted file mode 100644
index 2c6a8b6..0000000
--- a/old/libsl1550/VoiceTest/VoiceTest.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{B69597A7-5DC5-4564-9089-727D0348EB4E}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>VoiceTest</RootNamespace>
-    <AssemblyName>VoiceTest</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="VoiceTest.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\libsecondlife\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\libsecondlife\libsecondlife.Utilities\libsecondlife.Utilities.csproj">
-      <Project>{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}</Project>
-      <Name>libsecondlife.Utilities</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Properties\" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/bin/CookComputing.XmlRpc.CF.dll b/old/libsl1550/bin/CookComputing.XmlRpc.CF.dll
deleted file mode 100644
index 52f6c6d..0000000
Binary files a/old/libsl1550/bin/CookComputing.XmlRpc.CF.dll and /dev/null differ
diff --git a/old/libsl1550/bin/CookComputing.XmlRpcV2.dll b/old/libsl1550/bin/CookComputing.XmlRpcV2.dll
deleted file mode 100644
index 4dd869c..0000000
Binary files a/old/libsl1550/bin/CookComputing.XmlRpcV2.dll and /dev/null differ
diff --git a/old/libsl1550/bin/libsecondlife.dll.config b/old/libsl1550/bin/libsecondlife.dll.config
deleted file mode 100644
index f2f1db8..0000000
--- a/old/libsl1550/bin/libsecondlife.dll.config
+++ /dev/null
@@ -1,5 +0,0 @@
-<configuration>
-    <dllmap os="osx" dll="openjpeg-libsl.dll" target="libopenjpeg-libsl-2.1.2.0.dylib" />
-    <dllmap os="!windows,osx" cpu="x86-64,ia64" dll="openjpeg-libsl.dll" target="libopenjpeg-libsl-2.1.2.0-x86_64" />
-    <dllmap os="!windows,osx" cpu="x86" dll="openjpeg-libsl.dll" target="libopenjpeg-libsl-2.1.2.0" />
-</configuration>
diff --git a/old/libsl1550/bin/openjpeg-libsl.dll b/old/libsl1550/bin/openjpeg-libsl.dll
deleted file mode 100644
index 5f74acb..0000000
Binary files a/old/libsl1550/bin/openjpeg-libsl.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife.build b/old/libsl1550/libsecondlife.build
deleted file mode 100644
index 92c8d54..0000000
--- a/old/libsl1550/libsecondlife.build
+++ /dev/null
@@ -1,194 +0,0 @@
-<?xml version="1.0"?>
-<!-- this is a nAnt build file;  use http://nant.sourceforge.net to build me -->
-
-<project name="libsecondlife" default="build">
-  <sysinfo />
-
-  <!-- global framework settings -->
-  <property name="nant.settings.currentframework" value="mono-2.0" />
-  <property name="target.framework" value="${framework::get-target-framework()}" />
-  <property name="assembly.dir" value="${framework::get-assembly-directory(target.framework)}" />
-
-  <!-- default configuration -->
-  <property name="build.number"
-     value="${string::replace(string::replace(string::substring(datetime::to-string(datetime::now()),0,10),'/200','0'),'/','')}" />
-  <!-- <property name="project.version" value="0.0.5" /> -->
-  <property name="project.version" value="${build.number}" />
-  <property name="project.config"  value="debug" /> <!-- debug|release -->
-  <property name="package.config"  value="dist" /> <!-- dist|src -->
-  <property name="bin_dir"  value="bin" />
-
-  <property name="temp.dir" value="/tmp" if="${platform::is-unix()}" />
-  <property name="temp.dir" value="${sys.env.TEMP}" if="${platform::is-win32()}" />
-
-
-  <!-- build sets -->
-  <fileset id="apps">
-    <include name="applications/Decoder/*.build" />
-    <include name="applications/SLIRC/*.build" />
-    <include name="applications/SLProxy/*.build" />
-  </fileset>
-  <fileset id="lib">
-    <include name="openjpegnet/*.build" />
-    <include name="libsecondlife/*.build" />
-  </fileset>
-  <fileset id="examples">
-    <include name="libsecondlife/examples/examples.build" />
-  </fileset>
-
-  <!-- named configurations -->
-  <target name="init" description="Initializes building properties">
-    <echo message="assembly.dir=${assembly.dir}" />
-    <call target="${project.config}" />
-  </target>
-
-  <target name="init-package" description="Initializes packaging properties">
-    <call target="${package.config}" />
-  </target>
-
-  <target name="debug" description="Configures a debug build">
-    <property name="build.debug" value="true" />
-    <property name="package.name" value="${project::get-name()}-${project.version}-${project.config}" />
-    <if test="${property::exists('CCNetLabel')}">
-      <property name="package.name" value="${project::get-name()}-${CCNetLabel}-${project.config}" />
-    </if>
-  </target>
-
-  <target name="release" description="Configures a release build">
-    <property name="project.config" value="release" />
-    <property name="build.debug"    value="false"/>
-    <property name="package.name" value="${project::get-name()}-${project.version}" />
-    <if test="${property::exists('CCNetLabel')}">
-      <property name="package.name" value="${project::get-name()}-${CCNetLabel}-${project.config}" />
-    </if>
-  </target>
-
-  <target name="dist" description="Configures a distribution package">
-    <property name="dist" value="true" />
-    <property name="src"  value="false" />
-    <property name="archive.name" value="${package.name}.zip" />
-    <property name="archive.dir" value="${temp.dir}/${project::get-name()}-${project.version}" />
-    <property name="srcarchive.name" value="${project::get-name()}-${project.version}-src.zip" />
-    <property name="srcarchive.dir" value="${temp.dir}/${project::get-name()}-${project.version}-src" />
-
-    <if test="${property::exists('CCNetLabel')}">
-      <property name="srcarchive.name" value="${project::get-name()}-${CCNetLabel}-src.zip" />
-    </if>
-  </target>
-
-  <!-- <target name="src" description="Configures a source package">
-    <property name="package.config" value="src" />
-    <property name="dist"           value="false" />
-    <property name="src"            value="true" />
-    <property name="archive.dir"
-      value="${temp.dir}/${project::get-name()}-${project.version}" />
-    <property name="archive.name"
-      value="${project::get-name()}-${project.version}-src.zip" />
-  </target> -->
-
-  <zipfileset id="archive.set" basedir="${temp.dir}">
-      <include name="${project::get-name()}-${project.version}/**" />
-  </zipfileset>
-
-  <zipfileset id="srcarchive.set" basedir="${temp.dir}">
-      <include name="${project::get-name()}-${project.version}-src/**" />
-  </zipfileset>
-
-  <!-- build tasks -->
-  <target name="build"
-    depends="build-lib build-examples build-apps"
-    description="Builds the current configuration">
-  </target>
-
-  <target name="build-lib" depends="init"
-    description="Builds the libsecondlife dll for the current configuration">
-    <nant target="${project.config} build">
-      <buildfiles refid="lib" />
-    </nant>
-    <copy todir="bin" overwrite="true">
-	  <fileset basedir="data">
-        <include name="*.txt" />
-        <include name="*.msg" />
-      </fileset>
-    </copy>
-  </target>
-
-  <target name="build-apps" depends="init"
-    description="Builds the application suite for the current configuration">
-    <nant target="${project.config} build">
-      <buildfiles refid="apps" />
-    </nant>
-  </target>
-
-  <target name="build-examples" depends="init"
-    description="Builds the libsecondlife examples for the current configuration">
-    <nant target="${project.config} build">
-      <buildfiles refid="examples" />
-    </nant>
-  </target>
-
-  <target name="clean" depends="init"
-    description="Deletes the built products">
-    <delete dir="${bin_dir}" failonerror="false" />
-  </target>
-
-  <target name="clean-all"
-    description="Deletes all built products and packagess">
-    <delete dir="${bin_dir}" failonerror="false" />
-    <delete failonerror="false">
-      <fileset basedir=".">
-        <include name="*.zip" />
-      </fileset>
-    </delete>
-  </target>
-
-  <target name="package" depends="init init-package"
-    description="Creates a zip archive for the current configuration">
-
-    <delete file="${archive.name}" failonerror="true" />
-    <delete file="${srcarchive.name}" failonerror="true" />
-
-    <!-- <if test="${src}"> -->
-      <mkdir dir="${srcarchive.dir}" failonerror="false" />
-      <copy todir="${srcarchive.dir}" overwrite="true">
-        <fileset basedir=".">
-          <include name="**" />
-          <exclude name="*.zip" />
-        </fileset>
-      </copy>
-    <!-- </if> -->
-
-    <if test="${dist}">
-      <call target="build" />
-      <mkdir dir="${archive.dir}" failonerror="false" />
-      <copy todir="${archive.dir}" overwrite="true">
-				<fileset basedir=".">
-				  <include name="LICENSE" />
-				  <include name="README" />
-				</fileset>
-      </copy>
-      <copy todir="${archive.dir}" overwrite="true">
-        <fileset basedir="bin">
-          <include name="*.exe" />
-          <include name="*.dll" />
-		    </fileset>
-      </copy>
-    </if>
-
-    <zip zipfile="${archive.name}">
-      <fileset refid="archive.set" />
-    </zip>
-
-    <zip zipfile="${srcarchive.name}">
-      <fileset refid="srcarchive.set" />
-    </zip>
-
-    <delete dir="${archive.dir}" failonerror="false" />
-    <echo message="Created archive at file://${project::get-base-directory()}/${archive.name}" />
-    <echo message="Created archive at file://${project::get-base-directory()}/${srcarchive.name}" />
-  </target>
-
-  <!--<target name="doc" depends="build"
-    description="Compiles html documentation for libsecondlife">
-  </target>-->
-</project>
diff --git a/old/libsl1550/libsecondlife/AgentManager.cs b/old/libsl1550/libsecondlife/AgentManager.cs
deleted file mode 100644
index d85421f..0000000
--- a/old/libsl1550/libsecondlife/AgentManager.cs
+++ /dev/null
@@ -1,2422 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Net;
-using System.Collections.Generic;
-using System.Threading;
-using System.Text;
-using System.Reflection;
-using libsecondlife.StructuredData;
-using libsecondlife.Capabilities;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-	#region Enums
-
-	/// <summary>
-    ///
-    /// </summary>
-    [Flags]
-    public enum ScriptPermission : int
-    {
-		/// <summary>Placeholder for empty values, shouldn't ever see this</summary>
-		None = 0,
-		/// <summary>Script wants to take money from you</summary>
-		Debit = 1 << 1,
-		/// <summary></summary>
-		TakeControls = 1 << 2,
-		/// <summary></summary>
-		RemapControls = 1 << 3,
-		/// <summary>Script wants to trigger avatar animations</summary>
-		TriggerAnimation = 1 << 4,
-		/// <summary></summary>
-		Attach = 1 << 5,
-		/// <summary></summary>
-		ReleaseOwnership = 1 << 6,
-		/// <summary></summary>
-		ChangeLinks = 1 << 7,
-		/// <summary></summary>
-		ChangeJoints = 1 << 8,
-		/// <summary></summary>
-		ChangePermissions = 1 << 9,
-		/// <summary></summary>
-		TrackCamera = 1 << 10,
-		/// <summary>Script wants to control your camera</summary>
-		ControlCamera = 1 << 11
-    }
-
-    /// <summary>
-	/// Special commands used in Instant Messages
-	/// </summary>
-	public enum InstantMessageDialog : byte
-	{
-		/// <summary>Indicates a regular IM from another agent</summary>
-		MessageFromAgent = 0,
-		/// <summary>Simple notification box with an OK button</summary>
-		MessageBox = 1,
-		/// <summary>Used to show a countdown notification with an OK
-		/// button, deprecated now</summary>
-		[Obsolete]
-		MessageBoxCountdown = 2,
-		/// <summary>You've been invited to join a group.</summary>
-		GroupInvitation = 3,
-		/// <summary>Inventory offer</summary>
-		InventoryOffered = 4,
-		/// <summary>Accepted inventory offer</summary>
-		InventoryAccepted = 5,
-		/// <summary>Declined inventory offer</summary>
-		InventoryDeclined = 6,
-		/// <summary>Group vote</summary>
-		GroupVote = 7,
-		/// <summary>A message to everyone in the agent's group, no longer
-		/// used</summary>
-		[Obsolete]
-		DeprecatedGroupMessage = 8,
-		/// <summary>An object is offering its inventory</summary>
-		TaskInventoryOffered = 9,
-		/// <summary>Accept an inventory offer from an object</summary>
-		TaskInventoryAccepted = 10,
-		/// <summary>Decline an inventory offer from an object</summary>
-		TaskInventoryDeclined = 11,
-		/// <summary>Unknown</summary>
-		NewUserDefault = 12,
-		/// <summary>Start a session, or add users to a session</summary>
-		SessionAdd = 13,
-		/// <summary>Start a session, but don't prune offline users</summary>
-		SessionOfflineAdd = 14,
-		/// <summary>Start a session with your group</summary>
-		SessionGroupStart = 15,
-		/// <summary>Start a session without a calling card (finder or objects)</summary>
-		SessionCardlessStart = 16,
-		/// <summary>Send a message to a session</summary>
-		SessionSend = 17,
-		/// <summary>Leave a session</summary>
-		SessionDrop = 18,
-		/// <summary>Indicates that the IM is from an object</summary>
-		MessageFromObject = 19,
-		/// <summary>sent an IM to a busy user, this is the auto response</summary>
-		BusyAutoResponse = 20,
-		/// <summary>Shows the message in the console and chat history</summary>
-		ConsoleAndChatHistory = 21,
-		/// <summary>IM Types used for luring your friends</summary>
-		RequestTeleport = 22,
-		/// <summary>Response sent to the agent which inititiated a teleport invitation</summary>
-		AcceptTeleport = 23,
-		/// <summary>Response sent to the agent which inititiated a teleport invitation</summary>
-		DenyTeleport = 24,
-		/// <summary>Only useful if you have Linden permissions</summary>
-		GodLikeRequestTeleport = 25,
-		/// <summary>A placeholder type for future expansion, currently not
-		/// used</summary>
-		CurrentlyUnused = 26,
-		/// <summary>Notification of a new group election, this is
-		/// deprecated</summary>
-		[Obsolete]
-		DeprecatedGroupElection = 27,
-		/// <summary>IM to tell the user to go to an URL</summary>
-		GotoUrl = 28,
-		/// <summary>IM for help</summary>
-		Session911Start = 29,
-		/// <summary>IM sent automatically on call for help, sends a lure
-		/// to each Helper reached</summary>
-		Lure911 = 30,
-		/// <summary>Like an IM but won't go to email</summary>
-		FromTaskAsAlert = 31,
-		/// <summary>IM from a group officer to all group members</summary>
-		GroupNotice = 32,
-		/// <summary>Unknown</summary>
-		GroupNoticeInventoryAccepted = 33,
-		/// <summary>Unknown</summary>
-		GroupNoticeInventoryDeclined = 34,
-		/// <summary>Accept a group invitation</summary>
-		GroupInvitationAccept = 35,
-		/// <summary>Decline a group invitation</summary>
-		GroupInvitationDecline = 36,
-		/// <summary>Unknown</summary>
-		GroupNoticeRequested = 37,
-		/// <summary>An avatar is offering you friendship</summary>
-		FriendshipOffered = 38,
-		/// <summary>An avatar has accepted your friendship offer</summary>
-		FriendshipAccepted = 39,
-		/// <summary>An avatar has declined your friendship offer</summary>
-		FriendshipDeclined = 40,
-		/// <summary>Indicates that a user has started typing</summary>
-		StartTyping = 41,
-		/// <summary>Indicates that a user has stopped typing</summary>
-		StopTyping = 42
-    }
-
-	/// <summary>
-	/// Flag in Instant Messages, whether the IM should be delivered to
-	/// offline avatars as well
-	/// </summary>
-	public enum InstantMessageOnline
-	{
-		/// <summary>Only deliver to online avatars</summary>
-		Online = 0,
-		/// <summary>If the avatar is offline the message will be held until
-		/// they login next, and possibly forwarded to their e-mail account</summary>
-		Offline = 1
-	}
-
-	/// <summary>
-	/// Conversion type to denote Chat Packet types in an easier-to-understand format
-	/// </summary>
-	public enum ChatType : byte
-	{
-		/// <summary>Whisper (5m radius)</summary>
-		Whisper = 0,
-		/// <summary>Normal chat (10/20m radius), what the official viewer typically sends</summary>
-		Normal = 1,
-		/// <summary>Shouting! (100m radius)</summary>
-		Shout = 2,
-		/// <summary>Say chat (10/20m radius) - The official viewer will
-		/// print "[4:15] You say, hey" instead of "[4:15] You: hey"</summary>
-		[Obsolete]
-		Say = 3,
-		/// <summary>Event message when an Avatar has begun to type</summary>
-		StartTyping = 4,
-		/// <summary>Event message when an Avatar has stopped typing</summary>
-		StopTyping = 5,
-		/// <summary>Unknown</summary>
-		Debug = 6
-	}
-
-	/// <summary>
-	/// Identifies the source of a chat message
-	/// </summary>
-	public enum ChatSourceType : byte
-	{
-		/// <summary>Chat from the grid or simulator</summary>
-		System = 0,
-		/// <summary>Chat from another avatar</summary>
-		Agent = 1,
-		/// <summary>Chat from an object</summary>
-		Object = 2
-	}
-
-	/// <summary>
-	///
-	/// </summary>
-	public enum ChatAudibleLevel : sbyte
-	{
-		/// <summary></summary>
-		Not = -1,
-		/// <summary></summary>
-		Barely = 0,
-		/// <summary></summary>
-		Fully = 1
-	}
-
-	/// <summary>
-	/// Effect type used in ViewerEffect packets
-	/// </summary>
-	public enum EffectType : byte
-	{
-		/// <summary></summary>
-		Text = 0,
-		/// <summary></summary>
-		Icon,
-		/// <summary></summary>
-		Connector,
-		/// <summary></summary>
-		FlexibleObject,
-		/// <summary></summary>
-		AnimalControls,
-		/// <summary></summary>
-		AnimationObject,
-		/// <summary></summary>
-		Cloth,
-		/// <summary>Project a beam from a source to a destination, such as
-		/// the one used when editing an object</summary>
-		Beam,
-		/// <summary></summary>
-		Glow,
-		/// <summary></summary>
-		Point,
-		/// <summary></summary>
-		Trail,
-		/// <summary>Create a swirl of particles around an object</summary>
-		Sphere,
-		/// <summary></summary>
-		Spiral,
-		/// <summary></summary>
-		Edit,
-		/// <summary>Cause an avatar to look at an object</summary>
-		LookAt,
-		/// <summary>Cause an avatar to point at an object</summary>
-		PointAt
-	}
-
-	/// <summary>
-	/// The action an avatar is doing when looking at something, used in
-	/// ViewerEffect packets for the LookAt effect
-	/// </summary>
-	public enum LookAtType : byte
-	{
-		/// <summary></summary>
-		None,
-		/// <summary></summary>
-		Idle,
-		/// <summary></summary>
-		AutoListen,
-		/// <summary></summary>
-		FreeLook,
-		/// <summary></summary>
-		Respond,
-		/// <summary></summary>
-		Hover,
-		/// <summary>Deprecated</summary>
-        [Obsolete]
-		Conversation,
-		/// <summary></summary>
-		Select,
-		/// <summary></summary>
-		Focus,
-		/// <summary></summary>
-		Mouselook,
-		/// <summary></summary>
-		Clear
-	}
-
-	/// <summary>
-	/// The action an avatar is doing when pointing at something, used in
-	/// ViewerEffect packets for the PointAt effect
-	/// </summary>
-	public enum PointAtType : byte
-	{
-		/// <summary></summary>
-		None,
-		/// <summary></summary>
-		Select,
-		/// <summary></summary>
-		Grab,
-		/// <summary></summary>
-		Clear
-    }
-
-    public enum MoneyTransactionType : int
-    {
-        None = 0,
-        FailSimulatorTimeout = 1,
-        FailDataserverTimeout = 2,
-        ObjectClaim = 1000,
-        LandClaim = 1001,
-        GroupCreate = 1002,
-        ObjectPublicClaim = 1003,
-        GroupJoin = 1004,
-        TeleportCharge = 1100,
-        UploadCharge = 1101,
-        LandAuction = 1102,
-        ClassifiedCharge = 1103,
-        ObjectTax = 2000,
-        LandTax = 2001,
-        LightTax = 2002,
-        ParcelDirFee = 2003,
-        GroupTax = 2004,
-        ClassifiedRenew = 2005,
-        GiveInventory = 3000,
-        ObjectSale = 5000,
-        Gift = 5001,
-        LandSale = 5002,
-        ReferBonus = 5003,
-        InventorySale = 5004,
-        RefundPurchase = 5005,
-        LandPassSale = 5006,
-        DwellBonus = 5007,
-        PayObject = 5008,
-        ObjectPays = 5009,
-        GroupLandDeed = 6001,
-        GroupObjectDeed = 6002,
-        GroupLiability = 6003,
-        GroupDividend = 6004,
-        GroupMembershipDues = 6005,
-        ObjectRelease = 8000,
-        LandRelease = 8001,
-        ObjectDelete = 8002,
-        ObjectPublicDecay = 8003,
-        ObjectPublicDelete = 8004,
-        LindenAdjustment = 9000,
-        LindenGrant = 9001,
-        LindenPenalty = 9002,
-        EventFee = 9003,
-        EventPrize = 9004,
-        StipendBasic = 10000,
-        StipendDeveloper = 10001,
-        StipendAlways = 10002,
-        StipendDaily = 10003,
-        StipendRating = 10004,
-        StipendDelta = 10005
-    }
-
-    [Flags]
-    public enum TransactionFlags : byte
-    {
-        None = 0,
-        SourceGroup = 1,
-        DestGroup = 2,
-        OwnerGroup = 4,
-        SimultaneousContribution = 8,
-        ContributionRemoval = 16
-    }
-
-    public enum MeanCollisionType : byte
-    {
-        None,
-        Bump,
-        LLPushObject,
-        SelectedObjectCollide,
-        ScriptedObjectCollide,
-        PhysicalObjectCollide
-    }
-
-    #endregion Enums
-
-    #region Structs
-
-	/// <summary>
-	/// Instant Message
-	/// </summary>
-	public struct InstantMessage
-	{
-		/// <summary>Key of sender</summary>
-		public LLUUID FromAgentID;
-		/// <summary>Name of sender</summary>
-        public string FromAgentName;
-        /// <summary>Key of destination avatar</summary>
-        public LLUUID ToAgentID;
-        /// <summary>ID of originating estate</summary>
-        public uint ParentEstateID;
-        /// <summary>Key of originating region</summary>
-        public LLUUID RegionID;
-        /// <summary>Coordinates in originating region</summary>
-        public LLVector3 Position;
-        /// <summary>Instant message type</summary>
-        public InstantMessageDialog Dialog;
-        /// <summary>Group IM session toggle</summary>
-        public bool GroupIM;
-        /// <summary>Key of IM session</summary>
-        public LLUUID IMSessionID;
-        /// <summary>Timestamp of the instant message</summary>
-        public DateTime Timestamp;
-        /// <summary>Instant message text</summary>
-        public string Message;
-        /// <summary>Whether this message is held for offline avatars</summary>
-        public InstantMessageOnline Offline;
-        /// <summary>Context specific packed data</summary>
-        public byte[] BinaryBucket;
-		//Print the contents of a message
-		public override string ToString(){
-			string result="";
-			Type imType = this.GetType();
-			FieldInfo[] fields = imType.GetFields();
-			foreach (FieldInfo field in fields){
-				result += (field.Name + " = " + field.GetValue(this) );
-			}
-			return result;
-
-		}
-	}
-
-	#endregion Structs
-
-    /// <summary>
-    /// Manager class for our own avatar
-    /// </summary>
-    public partial class AgentManager
-    {
-        #region Enums
-
-        /// <summary>
-        /// Currently only used to hide your group title
-        /// </summary>
-        [Flags]
-        public enum AgentFlags : byte
-        {
-            /// <summary>No flags set</summary>
-            None = 0,
-            /// <summary>Hide your group title</summary>
-            HideTitle = 0x01,
-        }
-
-        /// <summary>
-        /// Action state of the avatar, which can currently be typing and
-        /// editing
-        /// </summary>
-        [Flags]
-        public enum AgentState : byte
-        {
-            /// <summary></summary>
-            None = 0x00,
-            /// <summary></summary>
-            Typing = 0x04,
-            /// <summary></summary>
-            Editing = 0x10
-        }
-
-        /// <summary>
-        /// Current teleport status
-        /// </summary>
-        public enum TeleportStatus
-        {
-            /// <summary>Unknown status</summary>
-            None,
-            /// <summary>Teleport initialized</summary>
-            Start,
-            /// <summary>Teleport in progress</summary>
-            Progress,
-            /// <summary>Teleport failed</summary>
-            Failed,
-            /// <summary>Teleport completed</summary>
-            Finished,
-            /// <summary>Teleport cancelled</summary>
-            Cancelled
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        [Flags]
-        public enum TeleportFlags : uint
-        {
-            /// <summary></summary>
-            Default         =      0,
-            /// <summary></summary>
-            SetHomeToTarget = 1 << 0,
-            /// <summary></summary>
-            SetLastToTarget = 1 << 1,
-            /// <summary></summary>
-            ViaLure         = 1 << 2,
-            /// <summary></summary>
-            ViaLandmark     = 1 << 3,
-            /// <summary></summary>
-            ViaLocation     = 1 << 4,
-            /// <summary></summary>
-            ViaHome         = 1 << 5,
-            /// <summary></summary>
-            ViaTelehub      = 1 << 6,
-            /// <summary></summary>
-            ViaLogin        = 1 << 7,
-            /// <summary></summary>
-            ViaGodlikeLure  = 1 << 8,
-            /// <summary></summary>
-            Godlike         = 1 << 9,
-            /// <summary></summary>
-            NineOneOne      = 1 << 10,
-            /// <summary></summary>
-            DisableCancel   = 1 << 11,
-            /// <summary></summary>
-            ViaRegionID     = 1 << 12,
-            /// <summary></summary>
-            IsFlying        = 1 << 13
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        [Flags]
-        public enum TeleportLureFlags
-        {
-            /// <summary></summary>
-            NormalLure = 0,
-            /// <summary></summary>
-            GodlikeLure = 1,
-            /// <summary></summary>
-            GodlikePursuit = 2
-        }
-
-        #endregion
-
-        #region Callbacks & Events
-        /// <summary>
-        /// Triggered on incoming chat messages
-        /// </summary>
-        /// <param name="message">Text of chat message</param>
-        /// <param name="audible">Audible level of this chat message</param>
-        /// <param name="type">Type of chat (whisper, shout, status, etc.)</param>
-        /// <param name="sourceType">Source of the chat message</param>
-        /// <param name="fromName">Name of the sending object</param>
-        /// <param name="id"></param>
-        /// <param name="ownerid"></param>
-        /// <param name="position"></param>
-        public delegate void ChatCallback(string message, ChatAudibleLevel audible, ChatType type,
-            ChatSourceType sourceType, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position);
-
-        /// <summary>
-        /// Triggered when a script pops up a dialog box
-        /// </summary>
-        /// <param name="message">The dialog box message</param>
-        /// <param name="objectName">Name of the object that sent the dialog</param>
-        /// <param name="imageID">Image to be displayed in the dialog</param>
-        /// <param name="objectID">ID of the object that sent the dialog</param>
-        /// <param name="firstName">First name of the object owner</param>
-        /// <param name="lastName">Last name of the object owner</param>
-        /// <param name="chatChannel">Chat channel that the object is communicating on</param>
-        /// <param name="buttons">List of button labels</param>
-        public delegate void ScriptDialogCallback(string message, string objectName, LLUUID imageID,
-            LLUUID objectID, string firstName, string lastName, int chatChannel, List<string> buttons);
-
-        /// <summary>
-        /// Triggered when a script asks for permissions
-        /// </summary>
-        /// <param name="taskID">Task ID of the script requesting permissions</param>
-        /// <param name="itemID">ID of the object containing the script</param>
-        /// <param name="objectName">Name of the object containing the script</param>
-        /// <param name="objectOwner">Name of the object's owner</param>
-        /// <param name="questions">Bitwise value representing the requested permissions</param>
-        public delegate void ScriptQuestionCallback(Simulator simulator, LLUUID taskID, LLUUID itemID, string objectName, string objectOwner, ScriptPermission questions);
-
-        /// <summary>
-        /// Triggered when the L$ account balance for this avatar changes
-        /// </summary>
-        /// <param name="balance">The new account balance</param>
-        public delegate void BalanceCallback(int balance);
-
-        /// <summary>
-        /// Triggered on Money Balance Reply
-        /// </summary>
-        /// <param name="transactionID">ID provided in Request Money Balance, or auto-generated by system events</param>
-        /// <param name="transactionSuccess">Was the transaction successful</param>
-        /// <param name="balance">Current balance</param>
-        /// <param name="metersCredit"></param>
-        /// <param name="metersCommitted"></param>
-        /// <param name="description"></param>
-        public delegate void MoneyBalanceReplyCallback(LLUUID transactionID, bool transactionSuccess, int balance, int metersCredit, int metersCommitted, string description);
-
-        /// <summary>
-        /// Triggered on incoming instant messages
-        /// </summary>
-        /// <param name="im">Instant message data structure</param>
-        /// <param name="simulator">Simulator where this IM was received from</param>
-        public delegate void InstantMessageCallback(InstantMessage im, Simulator simulator);
-
-        /// <summary>
-        /// Triggered for any status updates of a teleport (progress, failed, succeeded)
-        /// </summary>
-        /// <param name="message">A message about the current teleport status</param>
-        /// <param name="status">The current status of the teleport</param>
-        /// <param name="flags">Various flags describing the teleport</param>
-        public delegate void TeleportCallback(string message, TeleportStatus status, TeleportFlags flags);
-
-        /// <summary>
-        /// Reply to a request to join a group, informs whether it was successful or not
-        /// </summary>
-        /// <param name="groupID">The group we attempted to join</param>
-        /// <param name="success">Whether we joined the group or not</param>
-        public delegate void JoinGroupCallback(LLUUID groupID, bool success);
-
-        /// <summary>
-        /// Reply to a request to leave a group, informs whether it was successful or not
-        /// </summary>
-        /// <param name="groupID">The group we attempted to leave</param>
-        /// <param name="success">Whether we left the group or not</param>
-        public delegate void LeaveGroupCallback(LLUUID groupID, bool success);
-
-        /// <summary>
-        /// Informs the avatar that it is no longer a member of a group
-        /// </summary>
-        /// <param name="groupID">The group we are no longer a member of</param>
-        public delegate void GroupDroppedCallback(LLUUID groupID);
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="firstName"></param>
-        /// <param name="lastName"></param>
-        /// <param name="activeGroupID"></param>
-        /// <param name="groupTitle"></param>
-        /// <param name="groupPowers"></param>
-        /// <param name="groupName"></param>
-        public delegate void AgentDataCallback(string firstName, string lastName, LLUUID activeGroupID,
-            string groupTitle, GroupPowers groupPowers, string groupName);
-
-        /// <summary>
-        /// Triggered when the current agent animations change
-        /// </summary>
-        /// <param name="agentAnimations">A convenience reference to the
-        /// SignaledAnimations collection</param>
-        public delegate void AnimationsChangedCallback(SafeDictionary<LLUUID, int> agentAnimations);
-
-        /// <summary>
-        /// Triggered when an object or avatar forcefully collides with our
-        /// agent
-        /// </summary>
-        /// <param name="type">Collision type</param>
-        /// <param name="perp">Colliding object or avatar ID</param>
-        /// <param name="victim">Victim ID, should be our own AgentID</param>
-        /// <param name="magnitude">Velocity or total force of the collision</param>
-        /// <param name="time">Time the collision occurred</param>
-        public delegate void MeanCollisionCallback(MeanCollisionType type, LLUUID perp, LLUUID victim,
-            float magnitude, DateTime time);
-
-        /// <summary>Callback for incoming chat packets</summary>
-        public event ChatCallback OnChat;
-        /// <summary>Callback for pop-up dialogs from scripts</summary>
-        public event ScriptDialogCallback OnScriptDialog;
-        /// <summary>Callback for pop-up dialogs regarding permissions</summary>
-        public event ScriptQuestionCallback OnScriptQuestion;
-        /// <summary>Callback for incoming IMs</summary>
-        public event InstantMessageCallback OnInstantMessage;
-        /// <summary>Callback for Teleport request update</summary>
-        public event TeleportCallback OnTeleport;
-        /// <summary>Callback for incoming change in L$ balance</summary>
-        public event BalanceCallback OnBalanceUpdated;
-        /// <summary>Callback for incoming Money Balance Replies</summary>
-        public event MoneyBalanceReplyCallback OnMoneyBalanceReplyReceived;
-        /// <summary>Callback for agent data updates, such as the active
-        /// group changing</summary>
-        public event AgentDataCallback OnAgentDataUpdated;
-        /// <summary>Callback for the current agent animations changing</summary>
-        public event AnimationsChangedCallback OnAnimationsChanged;
-        /// <summary>Callback for an object or avatar forcefully colliding
-        /// with the agent</summary>
-        public event MeanCollisionCallback OnMeanCollision;
-
-        #endregion
-
-        /// <summary>Reference to the SecondLife client object</summary>
-        public readonly SecondLife Client;
-        /// <summary>Used for movement and camera tracking</summary>
-        public readonly AgentMovement Movement;
-        /// <summary>Currently playing animations for the agent. Can be used to
-        /// check the current movement status such as walking, hovering, aiming,
-        /// etc. by checking for system animations in the <code>Animations</code>
-        /// class</summary>
-        public SafeDictionary<LLUUID, int> SignaledAnimations = new SafeDictionary<LLUUID, int>();
-
-        #region Properties
-
-        /// <summary>Your (client) avatar UUID</summary>
-        public LLUUID AgentID { get { return id; } }
-        /// <summary>Temporary UUID assigned to this session, used for
-        /// verifying our identity in packets</summary>
-        public LLUUID SessionID { get { return sessionID; } }
-        /// <summary>Shared secret UUID that is never sent over the wire</summary>
-        public LLUUID SecureSessionID { get { return secureSessionID; } }
-        /// <summary>Your (client) avatar ID, local to the current region/sim</summary>
-        public uint LocalID { get { return localID; } }
-        /// <summary>Where the avatar started at login. Can be "last", "home"
-        /// or a login URI</summary>
-        public string StartLocation { get { return startLocation; } }
-        /// <summary>The access level of this agent, usually M or PG</summary>
-        public string AgentAccess { get { return agentAccess; } }
-        /// <summary></summary>
-        public LLVector4 CollisionPlane { get { return collisionPlane; } }
-        /// <summary></summary>
-        public LLVector3 Velocity { get { return velocity; } }
-        /// <summary></summary>
-        public LLVector3 Acceleration { get { return acceleration; } }
-        /// <summary></summary>
-        public LLVector3 AngularVelocity { get { return angularVelocity; } }
-        /// <summary>Position avatar client will goto when login to 'home' or during
-        /// teleport request to 'home' region.</summary>
-        public LLVector3 HomePosition { get { return homePosition; } }
-        /// <summary>LookAt point saved/restored with HomePosition</summary>
-        public LLVector3 HomeLookAt { get { return homeLookAt; } }
-        /// <summary>Avatar First Name (i.e. Philip)</summary>
-        public string FirstName { get { return firstName; } }
-        /// <summary>Avatar Last Name (i.e. Linden)</summary>
-        public string LastName { get { return lastName; } }
-        /// <summary>Avatar Full Name (i.e. Philip Linden)</summary>
-        public string Name
-        {
-            get
-            {
-                // This is a fairly common request, so assume the name doesn't
-                // change mid-session and cache the result
-                if (fullName == null)
-                    fullName = String.Format("{0} {1}", firstName, lastName);
-                return fullName;
-            }
-        }
-        /// <summary>Gets the health of the agent</summary>
-        public float Health { get { return health; } }
-        /// <summary>Gets the current balance of the agent</summary>
-        public int Balance { get { return balance; } }
-        /// <summary>Gets the local ID of the prim the avatar is sitting on,
-        /// zero if the avatar is not currently sitting</summary>
-        public uint SittingOn { get { return sittingOn; } }
-        /// <summary>Gets the UUID of the active group.</summary>
-        public LLUUID ActiveGroup { get { return activeGroup; } }
-        /// <summary>Current status message for teleporting</summary>
-        public string TeleportMessage { get { return teleportMessage; } }
-        /// <summary>Current position of the agent as a relative offset from
-        /// the simulator, or the parent object if we are sitting on something</summary>
-        public LLVector3 RelativePosition { get { return relativePosition; } }
-        /// <summary>Current rotation of the agent as a relative rotation from
-        /// the simulator, or the parent object if we are sitting on something</summary>
-        public LLQuaternion RelativeRotation { get { return relativeRotation; } }
-        public LLVector3 SimPosition
-        {
-            get
-            {
-                if (sittingOn != 0)
-                {
-                    Primitive parent;
-                    if (Client.Network.CurrentSim != null && Client.Network.CurrentSim.Objects.TryGetPrimitive(sittingOn, out parent))
-                    {
-                        return parent.Position + relativePosition;
-                    }
-                    else
-                    {
-                        Client.Log("Currently sitting on object " + sittingOn + " which is not tracked, SimPosition will be inaccurate",
-                            Helpers.LogLevel.Warning);
-                        return relativePosition;
-                    }
-                }
-                else
-                {
-                    return relativePosition;
-                }
-            }
-        }
-        public LLQuaternion SimRotation
-        {
-            get
-            {
-                if (sittingOn != 0)
-                {
-                    Primitive parent;
-                    if (Client.Network.CurrentSim != null && Client.Network.CurrentSim.Objects.TryGetPrimitive(sittingOn, out parent))
-                    {
-                        return relativeRotation * parent.Rotation;
-                    }
-                    else
-                    {
-                        Client.Log("Currently sitting on object " + sittingOn + " which is not tracked, SimRotation will be inaccurate",
-                            Helpers.LogLevel.Warning);
-                        return relativeRotation;
-                    }
-                }
-                else
-                {
-                    return relativeRotation;
-                }
-            }
-        }
-        /// <summary>Returns the global grid position of the avatar</summary>
-        public LLVector3d GlobalPosition
-        {
-            get
-            {
-                if (Client.Network.CurrentSim != null)
-                {
-                    uint globalX, globalY;
-                    Helpers.LongToUInts(Client.Network.CurrentSim.Handle, out globalX, out globalY);
-                    LLVector3 pos = SimPosition;
-
-                    return new LLVector3d(
-                        (double)globalX + (double)pos.X,
-                        (double)globalY + (double)pos.Y,
-                        (double)pos.Z);
-                }
-                else
-                    return LLVector3d.Zero;
-            }
-        }
-
-        [Obsolete("Position has been replaced by RelativePosition, SimPosition, and GlobalPosition")]
-        public LLVector3 Position { get { return SimPosition; } }
-        [Obsolete("Rotation has been replaced by RelativeRotation and SimRotation")]
-        public LLQuaternion Rotation { get { return SimRotation; } }
-
-        #endregion Properties
-
-        internal uint localID;
-        internal LLVector3 relativePosition;
-        internal LLQuaternion relativeRotation = LLQuaternion.Identity;
-        internal LLVector4 collisionPlane;
-        internal LLVector3 velocity;
-        internal LLVector3 acceleration;
-        internal LLVector3 angularVelocity;
-        internal uint sittingOn;
-        internal int lastInterpolation;
-
-        #region Private Members
-
-        private LLUUID id;
-        private LLUUID sessionID;
-        private LLUUID secureSessionID;
-        private string startLocation = String.Empty;
-        private string agentAccess = String.Empty;
-        private LLVector3 homePosition;
-        private LLVector3 homeLookAt;
-        private string firstName = String.Empty;
-        private string lastName = String.Empty;
-        private string fullName;
-        private string teleportMessage = String.Empty;
-        private TeleportStatus teleportStat = TeleportStatus.None;
-        private ManualResetEvent teleportEvent = new ManualResetEvent(false);
-        private uint heightWidthGenCounter;
-        private float health;
-        private int balance;
-		private LLUUID activeGroup;
-
-        #endregion Private Members
-
-        /// <summary>
-        /// Constructor, setup callbacks for packets related to our avatar
-        /// </summary>
-        /// <param name="client"></param>
-        public AgentManager(SecondLife client)
-        {
-            Client = client;
-            Movement = new AgentMovement(Client);
-            NetworkManager.PacketCallback callback;
-
-            Client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
-
-            // Teleport callbacks
-            callback = new NetworkManager.PacketCallback(TeleportHandler);
-            Client.Network.RegisterCallback(PacketType.TeleportStart, callback);
-            Client.Network.RegisterCallback(PacketType.TeleportProgress, callback);
-            Client.Network.RegisterCallback(PacketType.TeleportFailed, callback);
-            Client.Network.RegisterCallback(PacketType.TeleportFinish, callback);
-            Client.Network.RegisterCallback(PacketType.TeleportCancel, callback);
-            Client.Network.RegisterCallback(PacketType.TeleportLocal, callback);
-
-            // Instant message callback
-            Client.Network.RegisterCallback(PacketType.ImprovedInstantMessage, new NetworkManager.PacketCallback(InstantMessageHandler));
-            // Chat callback
-            Client.Network.RegisterCallback(PacketType.ChatFromSimulator, new NetworkManager.PacketCallback(ChatHandler));
-            // Script dialog callback
-            Client.Network.RegisterCallback(PacketType.ScriptDialog, new NetworkManager.PacketCallback(ScriptDialogHandler));
-            // Script question callback
-            Client.Network.RegisterCallback(PacketType.ScriptQuestion, new NetworkManager.PacketCallback(ScriptQuestionHandler));
-            // Movement complete callback
-            Client.Network.RegisterCallback(PacketType.AgentMovementComplete, new NetworkManager.PacketCallback(MovementCompleteHandler));
-            // Health callback
-            Client.Network.RegisterCallback(PacketType.HealthMessage, new NetworkManager.PacketCallback(HealthHandler));
-            // Money callback
-            Client.Network.RegisterCallback(PacketType.MoneyBalanceReply, new NetworkManager.PacketCallback(BalanceHandler));
-			//Agent update callback
-			Client.Network.RegisterCallback(PacketType.AgentDataUpdate, new NetworkManager.PacketCallback(AgentDataUpdateHandler));
-            // Animation callback
-            Client.Network.RegisterCallback(PacketType.AvatarAnimation, new NetworkManager.PacketCallback(AvatarAnimationHandler));
-            // Object colliding into our agent callback
-            Client.Network.RegisterCallback(PacketType.MeanCollisionAlert, new NetworkManager.PacketCallback(MeanCollisionAlertHandler));
-
-	        // CAPS callbacks
-            Client.Network.RegisterEventCallback("EstablishAgentCommunication", new Caps.EventQueueCallback(EstablishAgentCommunicationEventHandler));
-
-            // Login
-            Client.Network.RegisterLoginResponseCallback(new NetworkManager.LoginResponseCallback(Network_OnLoginResponse));
-        }
-
-        #region Chat and instant messages
-
-        /// <summary>
-        /// Send a chat message
-        /// </summary>
-        /// <param name="message">The Message you're sending out.</param>
-        /// <param name="channel">Channel number (0 would be default 'Say' message, other numbers
-        /// denote the equivalent of /# in normal client).</param>
-        /// <param name="type">Chat Type, see above.</param>
-        public void Chat(string message, int channel, ChatType type)
-        {
-            ChatFromViewerPacket chat = new ChatFromViewerPacket();
-            chat.AgentData.AgentID = this.id;
-            chat.AgentData.SessionID = Client.Self.SessionID;
-            chat.ChatData.Channel = channel;
-            chat.ChatData.Message = Helpers.StringToField(message);
-            chat.ChatData.Type = (byte)type;
-
-            Client.Network.SendPacket(chat);
-        }
-
-        /// <summary>Requests missed/offline messages</summary>
-        public void RetrieveInstantMessages()
-        {
-            RetrieveInstantMessagesPacket p = new RetrieveInstantMessagesPacket();
-            p.AgentData.AgentID = Client.Self.AgentID;
-            p.AgentData.SessionID = Client.Self.SessionID;
-            Client.Network.SendPacket(p);
-        }
-
-        /// <summary>
-        /// Send an Instant Message
-        /// </summary>
-        /// <param name="target">Target of the Instant Message</param>
-        /// <param name="message">Text message being sent</param>
-        public void InstantMessage(LLUUID target, string message)
-        {
-            InstantMessage(Name, target, message, target,
-                InstantMessageDialog.MessageFromAgent, InstantMessageOnline.Offline, this.SimPosition,
-                LLUUID.Zero, new byte[0]);
-        }
-
-        /// <summary>
-        /// Send an Instant Message
-        /// </summary>
-        /// <param name="target">Target of the Instant Message</param>
-        /// <param name="message">Text message being sent</param>
-        /// <param name="imSessionID">IM session ID (to differentiate between IM windows)</param>
-        public void InstantMessage(LLUUID target, string message, LLUUID imSessionID)
-        {
-            InstantMessage(Name, target, message, imSessionID,
-                InstantMessageDialog.MessageFromAgent, InstantMessageOnline.Offline, this.SimPosition,
-                LLUUID.Zero, new byte[0]);
-        }
-
-        /// <summary>
-        /// Send an Instant Message
-        /// </summary>
-        /// <param name="fromName">The name this IM will show up as being from</param>
-        /// <param name="target">Key of Avatar</param>
-        /// <param name="message">Text message being sent</param>
-        /// <param name="imSessionID">IM session ID (to differentiate between IM windows)</param>
-        /// <param name="conferenceIDs"></param>
-		public void InstantMessage(string fromName, LLUUID target, string message, LLUUID imSessionID,
-            LLUUID[] conferenceIDs)
-		{
-            byte[] binaryBucket;
-
-            if (conferenceIDs != null && conferenceIDs.Length > 0)
-            {
-                binaryBucket = new byte[16 * conferenceIDs.Length];
-                for (int i = 0; i < conferenceIDs.Length; ++i)
-                    Buffer.BlockCopy(conferenceIDs[i].Data, 0, binaryBucket, i * 16, 16);
-            }
-            else
-            {
-                binaryBucket = new byte[0];
-            }
-
-			InstantMessage(fromName, target, message, imSessionID, InstantMessageDialog.MessageFromAgent,
-                InstantMessageOnline.Offline, LLVector3.Zero, LLUUID.Zero, binaryBucket);
-		}
-
-        /// <summary>
-        /// Send an Instant Message
-        /// </summary>
-        /// <param name="fromName">The name this IM will show up as being from</param>
-        /// <param name="target">Key of Avatar</param>
-        /// <param name="message">Text message being sent</param>
-        /// <param name="imSessionID">IM session ID (to differentiate between IM windows)</param>
-        /// <param name="dialog">Type of instant message to send</param>
-        /// <param name="offline">Whether to IM offline avatars as well</param>
-        /// <param name="position"></param>
-        /// <param name="regionID"></param>
-        /// <param name="binaryBucket">Packed binary data that is specific to
-        /// the dialog type</param>
-        public void InstantMessage(string fromName, LLUUID target, string message, LLUUID imSessionID,
-            InstantMessageDialog dialog, InstantMessageOnline offline, LLVector3 position, LLUUID regionID,
-            byte[] binaryBucket)
-        {
-            if (target != LLUUID.Zero)
-            {
-                ImprovedInstantMessagePacket im = new ImprovedInstantMessagePacket();
-
-                im.AgentData.AgentID = Client.Self.AgentID;
-                im.AgentData.SessionID = Client.Self.SessionID;
-
-                im.MessageBlock.Dialog = (byte)dialog;
-                im.MessageBlock.FromAgentName = Helpers.StringToField(fromName);
-                im.MessageBlock.FromGroup = false;
-                im.MessageBlock.ID = imSessionID;
-                im.MessageBlock.Message = Helpers.StringToField(message);
-                im.MessageBlock.Offline = (byte)offline;
-                im.MessageBlock.ToAgentID = target;
-
-                if (binaryBucket != null)
-                    im.MessageBlock.BinaryBucket = binaryBucket;
-                else
-                    im.MessageBlock.BinaryBucket = new byte[0];
-
-                // These fields are mandatory, even if we don't have valid values for them
-                im.MessageBlock.Position = LLVector3.Zero;
-                //TODO: Allow region id to be correctly set by caller or fetched from Client.*
-                im.MessageBlock.RegionID = regionID;
-
-                // Send the message
-                Client.Network.SendPacket(im);
-            }
-            else
-            {
-                Client.Log(String.Format("Suppressing instant message \"{0}\" to LLUUID.Zero", message),
-                    Helpers.LogLevel.Error);
-            }
-        }
-
-        /// <summary>
-        /// Send an Instant Message to a group
-        /// </summary>
-        /// <param name="groupUUID">Key of Group</param>
-        /// <param name="message">Text Message being sent.</param>
-        public void InstantMessageGroup(LLUUID groupUUID, string message)
-        {
-            InstantMessageGroup(Name, groupUUID, message);
-        }
-
-        /// <summary>
-        /// Send an Instant Message to a group
-        /// </summary>
-        /// <param name="fromName">The name this IM will show up as being from</param>
-        /// <param name="groupUUID">Key of the group</param>
-        /// <param name="message">Text message being sent</param>
-        /// <remarks>This does not appear to function with groups the agent is not in</remarks>
-        public void InstantMessageGroup(string fromName, LLUUID groupUUID, string message)
-        {
-            ImprovedInstantMessagePacket im = new ImprovedInstantMessagePacket();
-
-            im.AgentData.AgentID = Client.Self.AgentID;
-            im.AgentData.SessionID = Client.Self.SessionID;
-            im.MessageBlock.Dialog = (byte)InstantMessageDialog.SessionSend;
-            im.MessageBlock.FromAgentName = Helpers.StringToField(fromName);
-            im.MessageBlock.FromGroup = false;
-            im.MessageBlock.Message = Helpers.StringToField(message);
-            im.MessageBlock.Offline = 0;
-            im.MessageBlock.ID = groupUUID;
-            im.MessageBlock.ToAgentID = groupUUID;
-            im.MessageBlock.BinaryBucket = new byte[0];
-            im.MessageBlock.Position = LLVector3.Zero;
-            im.MessageBlock.RegionID = LLUUID.Zero;
-
-            // Send the message
-            Client.Network.SendPacket(im);
-        }
-
-        #endregion Chat and instant messages
-
-        #region Viewer Effects
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="sourceAvatar"></param>
-        /// <param name="targetObject"></param>
-        /// <param name="globalOffset"></param>
-        /// <param name="type"></param>
-        /// <param name="effectID"></param>
-        public void PointAtEffect(LLUUID sourceAvatar, LLUUID targetObject, LLVector3d globalOffset, PointAtType type,
-            LLUUID effectID)
-        {
-            ViewerEffectPacket effect = new ViewerEffectPacket();
-
-            effect.AgentData.AgentID = Client.Self.AgentID;
-            effect.AgentData.SessionID = Client.Self.SessionID;
-
-            effect.Effect = new ViewerEffectPacket.EffectBlock[1];
-            effect.Effect[0] = new ViewerEffectPacket.EffectBlock();
-            effect.Effect[0].AgentID = Client.Self.AgentID;
-            effect.Effect[0].Color = new byte[0];
-            effect.Effect[0].Duration = (type == PointAtType.Clear) ? 0.0f : Single.MaxValue / 4.0f;
-            effect.Effect[0].ID = effectID;
-            effect.Effect[0].Type = (byte)EffectType.PointAt;
-
-            byte[] typeData = new byte[57];
-            if (sourceAvatar != null)
-                Buffer.BlockCopy(sourceAvatar.GetBytes(), 0, typeData, 0, 16);
-            if (targetObject != null)
-                Buffer.BlockCopy(targetObject.GetBytes(), 0, typeData, 16, 16);
-            Buffer.BlockCopy(globalOffset.GetBytes(), 0, typeData, 32, 24);
-            typeData[56] = (byte)type;
-
-            effect.Effect[0].TypeData = typeData;
-
-            Client.Network.SendPacket(effect);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="sourceAvatar"></param>
-        /// <param name="targetObject"></param>
-        /// <param name="globalOffset"></param>
-        /// <param name="type"></param>
-        /// <param name="effectID"></param>
-        public void LookAtEffect(LLUUID sourceAvatar, LLUUID targetObject, LLVector3d globalOffset, LookAtType type,
-            LLUUID effectID)
-        {
-            ViewerEffectPacket effect = new ViewerEffectPacket();
-
-            effect.AgentData.AgentID = Client.Self.AgentID;
-            effect.AgentData.SessionID = Client.Self.SessionID;
-
-            float duration;
-
-            switch (type)
-            {
-                case LookAtType.Clear:
-                    duration = 0.0f;
-                    break;
-                case LookAtType.Hover:
-                    duration = 1.0f;
-                    break;
-                case LookAtType.FreeLook:
-                    duration = 2.0f;
-                    break;
-                case LookAtType.Idle:
-                    duration = 3.0f;
-                    break;
-                case LookAtType.AutoListen:
-                case LookAtType.Respond:
-                    duration = 4.0f;
-                    break;
-                case LookAtType.None:
-                case LookAtType.Select:
-                case LookAtType.Focus:
-                case LookAtType.Mouselook:
-                    duration = Single.MaxValue / 2.0f;
-                    break;
-                default:
-                    duration = 0.0f;
-                    break;
-            }
-
-            effect.Effect = new ViewerEffectPacket.EffectBlock[1];
-            effect.Effect[0] = new ViewerEffectPacket.EffectBlock();
-            effect.Effect[0].AgentID = Client.Self.AgentID;
-            effect.Effect[0].Color = new byte[0];
-            effect.Effect[0].Duration = duration;
-            effect.Effect[0].ID = effectID;
-            effect.Effect[0].Type = (byte)EffectType.LookAt;
-
-            byte[] typeData = new byte[57];
-            if (sourceAvatar != null)
-                Buffer.BlockCopy(sourceAvatar.GetBytes(), 0, typeData, 0, 16);
-            if (targetObject != null)
-                Buffer.BlockCopy(targetObject.GetBytes(), 0, typeData, 16, 16);
-            typeData[56] = (byte)type;
-
-            effect.Effect[0].TypeData = typeData;
-
-            Client.Network.SendPacket(effect);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="sourceAvatar"></param>
-        /// <param name="targetObject"></param>
-        /// <param name="globalOffset"></param>
-        /// <param name="color"></param>
-        /// <param name="duration"></param>
-        /// <param name="effectID"></param>
-        public void BeamEffect(LLUUID sourceAvatar, LLUUID targetObject, LLVector3d globalOffset, LLColor color,
-            float duration, LLUUID effectID)
-        {
-            ViewerEffectPacket effect = new ViewerEffectPacket();
-
-            effect.AgentData.AgentID = Client.Self.AgentID;
-            effect.AgentData.SessionID = Client.Self.SessionID;
-
-            effect.Effect = new ViewerEffectPacket.EffectBlock[1];
-            effect.Effect[0] = new ViewerEffectPacket.EffectBlock();
-            effect.Effect[0].AgentID = Client.Self.AgentID;
-            effect.Effect[0].Color = color.GetFloatBytes();
-            effect.Effect[0].Duration = duration;
-            effect.Effect[0].ID = effectID;
-            effect.Effect[0].Type = (byte)EffectType.Beam;
-
-            byte[] typeData = new byte[56];
-            Buffer.BlockCopy(sourceAvatar.GetBytes(), 0, typeData, 0, 16);
-            Buffer.BlockCopy(targetObject.GetBytes(), 0, typeData, 16, 16);
-            Buffer.BlockCopy(globalOffset.GetBytes(), 0, typeData, 32, 24);
-
-            effect.Effect[0].TypeData = typeData;
-
-            Client.Network.SendPacket(effect);
-        }
-
-        #endregion Viewer Effects
-
-        #region Movement Actions
-
-        /// <summary>
-        /// Sends a request to sit on the specified object
-        /// </summary>
-        /// <param name="targetID">LLUUID of the object to sit on</param>
-        /// <param name="offset">Sit at offset</param>
-        public void RequestSit(LLUUID targetID, LLVector3 offset)
-        {
-            AgentRequestSitPacket requestSit = new AgentRequestSitPacket();
-            requestSit.AgentData.AgentID = Client.Self.AgentID;
-            requestSit.AgentData.SessionID = Client.Self.SessionID;
-            requestSit.TargetObject.TargetID = targetID;
-            requestSit.TargetObject.Offset = offset;
-            Client.Network.SendPacket(requestSit);
-        }
-
-        /// <summary>
-        /// Follows a call to RequestSit() to actually sit on the object
-        /// </summary>
-        public void Sit()
-        {
-            AgentSitPacket sit = new AgentSitPacket();
-            sit.AgentData.AgentID = Client.Self.AgentID;
-            sit.AgentData.SessionID = Client.Self.SessionID;
-            Client.Network.SendPacket(sit);
-        }
-
-        /// <summary>Stands up from sitting on a prim or the ground</summary>
-        public bool Stand()
-        {
-            if (Client.Settings.SEND_AGENT_UPDATES)
-            {
-                Movement.StandUp = true;
-                Movement.SendUpdate();
-                return true;
-            }
-            else
-            {
-                Client.Log("Attempted Stand but agent updates are disabled", Helpers.LogLevel.Warning);
-                return false;
-            }
-        }
-
-        /// <summary>
-        /// Does a "ground sit" at the avatar's current position
-        /// </summary>
-        public void SitOnGround()
-        {
-            Movement.SitOnGround = true;
-            Movement.SendUpdate(true);
-        }
-
-        /// <summary>
-        /// Starts or stops flying
-        /// </summary>
-        /// <param name="start">True to start flying, false to stop flying</param>
-        public void Fly(bool start)
-        {
-            if (start)
-                Movement.Fly = true;
-            else
-                Movement.Fly = false;
-
-            Movement.SendUpdate(true);
-        }
-
-        /// <summary>
-        /// Starts or stops crouching
-        /// </summary>
-        /// <param name="start">True to start crouching, false to stop crouching</param>
-        public void Crouch(bool start)
-        {
-            if (start)
-                Movement.UpNeg = true;
-            else
-                Movement.UpNeg = false;
-
-            Movement.SendUpdate(true);
-        }
-
-        /// <summary>
-        /// Starts a jump (begin holding the jump key)
-        /// </summary>
-        public void Jump()
-        {
-            Movement.UpPos = true;
-            Movement.FastUp = true;
-            Movement.SendUpdate(true);
-        }
-
-        /// <summary>
-        /// Use the autopilot sim function to move the avatar to a new
-        /// position. Uses double precision to get precise movements
-        /// </summary>
-        /// <remarks>The z value is currently not handled properly by the simulator</remarks>
-        /// <param name="globalX">Global X coordinate to move to</param>
-        /// <param name="globalY">Global Y coordinate to move to</param>
-        /// <param name="z">Z coordinate to move to</param>
-        public void AutoPilot(double globalX, double globalY, double z)
-        {
-            GenericMessagePacket autopilot = new GenericMessagePacket();
-
-            autopilot.AgentData.AgentID = Client.Self.AgentID;
-            autopilot.AgentData.SessionID = Client.Self.SessionID;
-            autopilot.AgentData.TransactionID = LLUUID.Zero;
-            autopilot.MethodData.Invoice = LLUUID.Zero;
-            autopilot.MethodData.Method = Helpers.StringToField("autopilot");
-            autopilot.ParamList = new GenericMessagePacket.ParamListBlock[3];
-            autopilot.ParamList[0] = new GenericMessagePacket.ParamListBlock();
-            autopilot.ParamList[0].Parameter = Helpers.StringToField(globalX.ToString());
-            autopilot.ParamList[1] = new GenericMessagePacket.ParamListBlock();
-            autopilot.ParamList[1].Parameter = Helpers.StringToField(globalY.ToString());
-            autopilot.ParamList[2] = new GenericMessagePacket.ParamListBlock();
-            autopilot.ParamList[2].Parameter = Helpers.StringToField(z.ToString());
-
-            Client.Network.SendPacket(autopilot);
-        }
-
-        /// <summary>
-        /// Use the autopilot sim function to move the avatar to a new position
-        /// </summary>
-        /// <remarks>The z value is currently not handled properly by the simulator</remarks>
-        /// <param name="globalX">Integer value for the global X coordinate to move to</param>
-        /// <param name="globalY">Integer value for the global Y coordinate to move to</param>
-        /// <param name="z">Floating-point value for the Z coordinate to move to</param>
-        public void AutoPilot(ulong globalX, ulong globalY, float z)
-        {
-            GenericMessagePacket autopilot = new GenericMessagePacket();
-
-            autopilot.AgentData.AgentID = Client.Self.AgentID;
-            autopilot.AgentData.SessionID = Client.Self.SessionID;
-            autopilot.AgentData.TransactionID = LLUUID.Zero;
-            autopilot.MethodData.Invoice = LLUUID.Zero;
-            autopilot.MethodData.Method = Helpers.StringToField("autopilot");
-            autopilot.ParamList = new GenericMessagePacket.ParamListBlock[3];
-            autopilot.ParamList[0] = new GenericMessagePacket.ParamListBlock();
-            autopilot.ParamList[0].Parameter = Helpers.StringToField(globalX.ToString());
-            autopilot.ParamList[1] = new GenericMessagePacket.ParamListBlock();
-            autopilot.ParamList[1].Parameter = Helpers.StringToField(globalY.ToString());
-            autopilot.ParamList[2] = new GenericMessagePacket.ParamListBlock();
-            autopilot.ParamList[2].Parameter = Helpers.StringToField(z.ToString());
-
-            Client.Network.SendPacket(autopilot);
-        }
-
-        /// <summary>
-        /// Use the autopilot sim function to move the avatar to a new position
-        /// </summary>
-        /// <remarks>The z value is currently not handled properly by the simulator</remarks>
-        /// <param name="localX">Integer value for the local X coordinate to move to</param>
-        /// <param name="localY">Integer value for the local Y coordinate to move to</param>
-        /// <param name="z">Floating-point value for the Z coordinate to move to</param>
-        public void AutoPilotLocal(int localX, int localY, float z)
-        {
-            uint x, y;
-            Helpers.LongToUInts(Client.Network.CurrentSim.Handle, out x, out y);
-            AutoPilot((ulong)(x + localX), (ulong)(y + localY), z);
-        }
-
-        /// <summary>Cancels autopilot sim function</summary>
-        /// <remarks>Not certain if this is how it is really done</remarks>
-        public bool AutoPilotCancel()
-        {
-            if (Client.Settings.SEND_AGENT_UPDATES)
-            {
-                Movement.AtPos = true;
-                Movement.SendUpdate();
-                Movement.AtPos = false;
-                Movement.SendUpdate();
-                return true;
-            }
-            else
-            {
-                Client.Log("Attempted AutoPilotCancel but agent updates are disabled", Helpers.LogLevel.Warning);
-                return false;
-            }
-        }
-
-        #endregion Movement actions
-
-        #region Touch and grab
-
-        /// <summary>
-        /// Grabs an object
-        /// </summary>
-        /// <param name="objectLocalID">Local ID of Object to grab</param>
-        public void Grab(uint objectLocalID)
-        {
-            ObjectGrabPacket grab = new ObjectGrabPacket();
-            grab.AgentData.AgentID = Client.Self.AgentID;
-            grab.AgentData.SessionID = Client.Self.SessionID;
-            grab.ObjectData.LocalID = objectLocalID;
-            grab.ObjectData.GrabOffset = new LLVector3(0, 0, 0);
-            Client.Network.SendPacket(grab);
-        }
-
-        /// <summary>
-        /// Drags on an object
-        /// </summary>
-        /// <param name="objectID">LLUUID of the object to drag</param>
-        /// <param name="grabPosition">Drag target in region coordinates</param>
-        public void GrabUpdate(LLUUID objectID, LLVector3 grabPosition)
-        {
-            ObjectGrabUpdatePacket grab = new ObjectGrabUpdatePacket();
-            grab.AgentData.AgentID = Client.Self.AgentID;
-            grab.AgentData.SessionID = Client.Self.SessionID;
-            grab.ObjectData.ObjectID = objectID;
-            grab.ObjectData.GrabOffsetInitial = new LLVector3(0, 0, 0);
-            grab.ObjectData.GrabPosition = grabPosition;
-            grab.ObjectData.TimeSinceLast = 0;
-            Client.Network.SendPacket(grab);
-        }
-
-        /// <summary>
-        /// Releases a grabbed object
-        /// </summary>
-        public void DeGrab(uint objectLocalID)
-        {
-            ObjectDeGrabPacket degrab = new ObjectDeGrabPacket();
-            degrab.AgentData.AgentID = Client.Self.AgentID;
-            degrab.AgentData.SessionID = Client.Self.SessionID;
-            degrab.ObjectData.LocalID = objectLocalID;
-            Client.Network.SendPacket(degrab);
-        }
-
-        /// <summary>
-        /// Touches an object
-        /// </summary>
-        public void Touch(uint objectLocalID)
-        {
-            Client.Self.Grab(objectLocalID);
-            Client.Self.DeGrab(objectLocalID);
-        }
-
-        #endregion Touch and grab
-
-        #region Money
-
-        /// <summary>
-        /// Request the current L$ balance
-        /// </summary>
-        public void RequestBalance()
-        {
-            MoneyBalanceRequestPacket money = new MoneyBalanceRequestPacket();
-            money.AgentData.AgentID = Client.Self.AgentID;
-            money.AgentData.SessionID = Client.Self.SessionID;
-            money.MoneyData.TransactionID = LLUUID.Zero;
-
-            Client.Network.SendPacket(money);
-        }
-
-        /// <summary>
-        /// Give Money to destination Avatar
-        /// </summary>
-        /// <param name="target">UUID of the Target Avatar</param>
-        /// <param name="amount">Amount in L$</param>
-        public void GiveAvatarMoney(LLUUID target, int amount)
-        {
-            GiveMoney(target, amount, String.Empty, MoneyTransactionType.Gift, TransactionFlags.None);
-        }
-
-        /// <summary>
-        /// Give Money to destination Avatar
-        /// </summary>
-        /// <param name="target">UUID of the Target Avatar</param>
-        /// <param name="amount">Amount in L$</param>
-        /// <param name="description">Description that will show up in the
-        /// recipients transaction history</param>
-        public void GiveAvatarMoney(LLUUID target, int amount, string description)
-        {
-            GiveMoney(target, amount, description, MoneyTransactionType.Gift, TransactionFlags.None);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="target"></param>
-        /// <param name="amount"></param>
-        /// <param name="objectName"></param>
-        public void GiveObjectMoney(LLUUID target, int amount, string objectName)
-        {
-            GiveMoney(target, amount, objectName, MoneyTransactionType.PayObject, TransactionFlags.None);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="target"></param>
-        /// <param name="amount"></param>
-        public void GiveGroupMoney(LLUUID target, int amount)
-        {
-            GiveMoney(target, amount, String.Empty, MoneyTransactionType.Gift, TransactionFlags.DestGroup);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="target"></param>
-        /// <param name="amount"></param>
-        /// <param name="description"></param>
-        public void GiveGroupMoney(LLUUID target, int amount, string description)
-        {
-            GiveMoney(target, amount, description, MoneyTransactionType.Gift, TransactionFlags.DestGroup);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void PayUploadFee()
-        {
-            GiveMoney(LLUUID.Zero, Client.Settings.UPLOAD_COST, String.Empty, MoneyTransactionType.UploadCharge,
-                TransactionFlags.None);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="description"></param>
-        public void PayUploadFee(string description)
-        {
-            GiveMoney(LLUUID.Zero, Client.Settings.UPLOAD_COST, description, MoneyTransactionType.UploadCharge,
-                TransactionFlags.None);
-        }
-
-        /// <summary>
-        /// Give Money to destionation Object or Avatar
-        /// </summary>
-        /// <param name="target">UUID of the Target Object/Avatar</param>
-        /// <param name="amount">Amount in L$</param>
-        /// <param name="description">Reason (Optional normally)</param>
-        /// <param name="type">The type of transaction</param>
-        /// <param name="flags">Transaction flags, mostly for identifying group
-        /// transactions</param>
-        public void GiveMoney(LLUUID target, int amount, string description, MoneyTransactionType type, TransactionFlags flags)
-        {
-            MoneyTransferRequestPacket money = new MoneyTransferRequestPacket();
-            money.AgentData.AgentID = this.id;
-            money.AgentData.SessionID = Client.Self.SessionID;
-            money.MoneyData.Description = Helpers.StringToField(description);
-            money.MoneyData.DestID = target;
-            money.MoneyData.SourceID = this.id;
-            money.MoneyData.TransactionType = (int)type;
-            money.MoneyData.AggregatePermInventory = 0; // This is weird, apparently always set to zero though
-            money.MoneyData.AggregatePermNextOwner = 0; // This is weird, apparently always set to zero though
-            money.MoneyData.Flags = (byte)flags;
-            money.MoneyData.Amount = amount;
-
-            Client.Network.SendPacket(money);
-        }
-
-        #endregion Money
-
-        #region Animations
-
-        /// <summary>
-        /// Send an AgentAnimation packet that toggles a single animation on
-        /// </summary>
-        /// <param name="animation">The animation to start playing</param>
-        public void AnimationStart(LLUUID animation)
-        {
-            Dictionary<LLUUID, bool> animations = new Dictionary<LLUUID, bool>();
-            animations[animation] = true;
-
-            Animate(animations);
-        }
-
-        /// <summary>
-        /// Send an AgentAnimation packet that toggles a single animation off
-        /// </summary>
-        /// <param name="animation">The animation to stop playing</param>
-        public void AnimationStop(LLUUID animation)
-        {
-            Dictionary<LLUUID, bool> animations = new Dictionary<LLUUID, bool>();
-            animations[animation] = false;
-
-            Animate(animations);
-        }
-
-        /// <summary>
-        /// Send an AgentAnimation packet that will toggle animations on or off
-        /// </summary>
-        /// <param name="animations">A list of animation UUIDs, and whether to
-        /// turn that animation on or off</param>
-        public void Animate(Dictionary<LLUUID, bool> animations)
-        {
-            AgentAnimationPacket animate = new AgentAnimationPacket();
-
-            animate.AgentData.AgentID = Client.Self.AgentID;
-            animate.AgentData.SessionID = Client.Self.SessionID;
-            animate.AnimationList = new AgentAnimationPacket.AnimationListBlock[animations.Count];
-            int i = 0;
-
-            foreach (KeyValuePair<LLUUID, bool> animation in animations)
-            {
-                animate.AnimationList[i] = new AgentAnimationPacket.AnimationListBlock();
-                animate.AnimationList[i].AnimID = animation.Key;
-                animate.AnimationList[i].StartAnim = animation.Value;
-
-                i++;
-            }
-
-            Client.Network.SendPacket(animate);
-        }
-
-        #endregion Animations
-
-        #region Teleporting
-
-        /// <summary>
-        /// Teleports the avatar home
-        /// </summary>
-        public bool GoHome()
-        {
-            return Teleport(LLUUID.Zero);
-        }
-
-		/// <summary>Attempt teleport to specified LLUUID</summary>
-		public bool Teleport(LLUUID landmark)
-		{
-			teleportStat = TeleportStatus.None;
-            teleportEvent.Reset();
-			TeleportLandmarkRequestPacket p = new TeleportLandmarkRequestPacket();
-			p.Info = new TeleportLandmarkRequestPacket.InfoBlock();
-			p.Info.AgentID = Client.Self.AgentID;
-			p.Info.SessionID = Client.Self.SessionID;
-			p.Info.LandmarkID = landmark;
-			Client.Network.SendPacket(p);
-
-            teleportEvent.WaitOne(Client.Settings.TELEPORT_TIMEOUT, false);
-
-            if (teleportStat == TeleportStatus.None ||
-                teleportStat == TeleportStatus.Start ||
-                teleportStat == TeleportStatus.Progress)
-            {
-                teleportMessage = "Teleport timed out.";
-                teleportStat = TeleportStatus.Failed;
-            }
-
-            return (teleportStat == TeleportStatus.Finished);
-		}
-
-        /// <summary>
-        /// Attempt to look up a simulator name and teleport to the discovered
-        /// destination
-        /// </summary>
-        /// <param name="simName">Region name to look up</param>
-        /// <param name="position">Position to teleport to</param>
-        /// <returns>True if the lookup and teleport were successful, otherwise
-        /// false</returns>
-        public bool Teleport(string simName, LLVector3 position)
-        {
-            return Teleport(simName, position, new LLVector3(0, 1.0f, 0));
-        }
-
-        /// <summary>
-        /// Attempt to look up a simulator name and teleport to the discovered
-        /// destination
-        /// </summary>
-        /// <param name="simName">Region name to look up</param>
-        /// <param name="position">Position to teleport to</param>
-        /// <param name="lookAt">Target to look at</param>
-        /// <returns>True if the lookup and teleport were successful, otherwise
-        /// false</returns>
-        public bool Teleport(string simName, LLVector3 position, LLVector3 lookAt)
-        {
-            teleportStat = TeleportStatus.None;
-            simName = simName.ToLower();
-
-            if (simName != Client.Network.CurrentSim.Name.ToLower())
-            {
-                // Teleporting to a foreign sim
-                GridRegion region;
-
-                if (Client.Grid.GetGridRegion(simName, GridLayerType.Objects, out region))
-                {
-                    return Teleport(region.RegionHandle, position, lookAt);
-                }
-                else
-                {
-                    teleportMessage = "Unable to resolve name: " + simName;
-                    teleportStat = TeleportStatus.Failed;
-                    return false;
-                }
-            }
-            else
-            {
-                // Teleporting to the sim we're already in
-                return Teleport(Client.Network.CurrentSim.Handle, position, lookAt);
-            }
-        }
-
-        /// <summary>
-        /// Start a teleport process
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="position">Position for Teleport</param>
-        /// <returns></returns>
-        public bool Teleport(ulong regionHandle, LLVector3 position)
-        {
-            return Teleport(regionHandle, position, new LLVector3(0.0f, 1.0f, 0.0f));
-        }
-
-        /// <summary>
-        /// Start a teleport process
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="position">Position for Teleport</param>
-        /// <param name="lookAt">Target to look at</param>
-        /// <returns></returns>
-        public bool Teleport(ulong regionHandle, LLVector3 position, LLVector3 lookAt)
-        {
-            teleportStat = TeleportStatus.None;
-            teleportEvent.Reset();
-
-            RequestTeleport(regionHandle, position, lookAt);
-
-            teleportEvent.WaitOne(Client.Settings.TELEPORT_TIMEOUT, false);
-
-            if (teleportStat == TeleportStatus.None ||
-                teleportStat == TeleportStatus.Start ||
-                teleportStat == TeleportStatus.Progress)
-            {
-                teleportMessage = "Teleport timed out.";
-                teleportStat = TeleportStatus.Failed;
-            }
-
-            return (teleportStat == TeleportStatus.Finished);
-        }
-
-        /// <summary>
-        /// Start a teleport process
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="position">Position for Teleport</param>
-        public void RequestTeleport(ulong regionHandle, LLVector3 position)
-        {
-            RequestTeleport(regionHandle, position, new LLVector3(0.0f, 1.0f, 0.0f));
-        }
-
-        /// <summary>
-        /// Start a teleport process
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="position">Position for Teleport</param>
-        /// <param name="lookAt">Target to look at</param>
-        public void RequestTeleport(ulong regionHandle, LLVector3 position, LLVector3 lookAt)
-        {
-            if (Client.Network.CurrentSim != null &&
-                Client.Network.CurrentSim.Caps != null &&
-                Client.Network.CurrentSim.Caps.IsEventQueueRunning)
-            {
-                TeleportLocationRequestPacket teleport = new TeleportLocationRequestPacket();
-                teleport.AgentData.AgentID = Client.Self.AgentID;
-                teleport.AgentData.SessionID = Client.Self.SessionID;
-                teleport.Info.LookAt = lookAt;
-                teleport.Info.Position = position;
-                teleport.Info.RegionHandle = regionHandle;
-
-                Client.Log("Requesting teleport to region handle " + regionHandle.ToString(), Helpers.LogLevel.Info);
-
-                Client.Network.SendPacket(teleport);
-            }
-            else
-            {
-                teleportMessage = "CAPS event queue is not running";
-                teleportEvent.Set();
-                teleportStat = TeleportStatus.Failed;
-            }
-        }
-
-        public void SendTeleportLure(LLUUID targetID)
-        {
-            SendTeleportLure(targetID, "Join me in " + Client.Network.CurrentSim.Name + "!");
-        }
-
-        public void SendTeleportLure(LLUUID targetID, string message)
-        {
-            StartLurePacket p = new StartLurePacket();
-            p.AgentData.AgentID = Client.Self.id;
-            p.AgentData.SessionID = Client.Self.SessionID;
-            p.Info.LureType = 0;
-            p.Info.Message = Helpers.StringToField(message);
-            p.TargetData = new StartLurePacket.TargetDataBlock[] { new StartLurePacket.TargetDataBlock() };
-            p.TargetData[0].TargetID = targetID;
-            Client.Network.SendPacket(p);
-        }
-
-        /// <summary>
-        /// Respond to a teleport lure by either accepting it and initiating
-        /// the teleport, or denying it
-        /// </summary>
-        /// <param name="requesterID">UUID of the avatar requesting the teleport</param>
-        /// <param name="accept">Accept the teleport request or deny it</param>
-        public void TeleportLureRespond(LLUUID requesterID, bool accept)
-        {
-            InstantMessage(Name, requesterID, String.Empty, LLUUID.Random(),
-                accept ? InstantMessageDialog.AcceptTeleport : InstantMessageDialog.DenyTeleport,
-                InstantMessageOnline.Offline, this.SimPosition, LLUUID.Zero, new byte[0]);
-
-            if (accept)
-            {
-                TeleportLureRequestPacket lure = new TeleportLureRequestPacket();
-
-                lure.Info.AgentID = Client.Self.AgentID;
-                lure.Info.SessionID = Client.Self.SessionID;
-                lure.Info.LureID = Client.Self.AgentID;
-                lure.Info.TeleportFlags = (uint)TeleportFlags.ViaLure;
-
-                Client.Network.SendPacket(lure);
-            }
-        }
-
-        #endregion Teleporting
-
-        #region Misc
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="profile"></param>
-        public void UpdateProfile(Avatar.AvatarProperties profile)
-        {
-            AvatarPropertiesUpdatePacket apup = new AvatarPropertiesUpdatePacket();
-            apup.AgentData.AgentID = id;
-            apup.AgentData.SessionID = sessionID;
-            apup.PropertiesData.AboutText = Helpers.StringToField(profile.AboutText);
-            apup.PropertiesData.AllowPublish = profile.AllowPublish;
-            apup.PropertiesData.FLAboutText = Helpers.StringToField(profile.FirstLifeText);
-            apup.PropertiesData.FLImageID = profile.FirstLifeImage;
-            apup.PropertiesData.ImageID = profile.ProfileImage;
-            apup.PropertiesData.MaturePublish = profile.MaturePublish;
-            apup.PropertiesData.ProfileURL = Helpers.StringToField(profile.ProfileURL);
-
-            Client.Network.SendPacket(apup);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="interests"></param>
-        public void UpdateInterests(Avatar.Interests interests)
-        {
-            AvatarInterestsUpdatePacket aiup = new AvatarInterestsUpdatePacket();
-            aiup.AgentData.AgentID = id;
-            aiup.AgentData.SessionID = sessionID;
-            aiup.PropertiesData.LanguagesText = Helpers.StringToField(interests.LanguagesText);
-            aiup.PropertiesData.SkillsMask = interests.SkillsMask;
-            aiup.PropertiesData.SkillsText = Helpers.StringToField(interests.SkillsText);
-            aiup.PropertiesData.WantToMask = interests.WantToMask;
-            aiup.PropertiesData.WantToText = Helpers.StringToField(interests.WantToText);
-
-            Client.Network.SendPacket(aiup);
-        }
-
-        /// <summary>
-        /// Set the height and the width of the client window. This is used
-        /// by the server to build a virtual camera frustum for our avatar
-        /// </summary>
-        /// <param name="height">New height of the viewer window</param>
-        /// <param name="width">New width of the viewer window</param>
-        public void SetHeightWidth(ushort height, ushort width)
-        {
-            AgentHeightWidthPacket heightwidth = new AgentHeightWidthPacket();
-            heightwidth.AgentData.AgentID = Client.Self.AgentID;
-            heightwidth.AgentData.SessionID = Client.Self.SessionID;
-            heightwidth.AgentData.CircuitCode = Client.Network.CircuitCode;
-            heightwidth.HeightWidthBlock.Height = height;
-            heightwidth.HeightWidthBlock.Width = width;
-            heightwidth.HeightWidthBlock.GenCounter = heightWidthGenCounter++;
-
-            Client.Network.SendPacket(heightwidth);
-        }
-
-        /// <summary>
-        /// Request the list of muted things for this avatar
-        /// </summary>
-        public void RequestMuteList()
-        {
-            MuteListRequestPacket mute = new MuteListRequestPacket();
-            mute.AgentData.AgentID = Client.Self.AgentID;
-            mute.AgentData.SessionID = Client.Self.SessionID;
-            mute.MuteData.MuteCRC = 0;
-
-            Client.Network.SendPacket(mute);
-        }
-
-        /// <summary>
-        /// Sets home location
-        /// </summary>
-        public void SetHome()
-        {
-            SetStartLocationRequestPacket s = new SetStartLocationRequestPacket();
-            s.AgentData = new SetStartLocationRequestPacket.AgentDataBlock();
-            s.AgentData.AgentID = Client.Self.AgentID;
-            s.AgentData.SessionID = Client.Self.SessionID;
-            s.StartLocationData = new SetStartLocationRequestPacket.StartLocationDataBlock();
-            s.StartLocationData.LocationPos = Client.Self.SimPosition;
-            s.StartLocationData.LocationID = 1;
-            s.StartLocationData.SimName = Helpers.StringToField(String.Empty);
-            s.StartLocationData.LocationLookAt = Movement.Camera.AtAxis;
-            Client.Network.SendPacket(s);
-        }
-
-        /// <summary>
-        /// Move an agent in to a simulator. This packet is the last packet
-        /// needed to complete the transition in to a new simulator
-        /// </summary>
-        /// <param name="simulator"></param>
-        public void CompleteAgentMovement(Simulator simulator)
-        {
-            CompleteAgentMovementPacket move = new CompleteAgentMovementPacket();
-
-            move.AgentData.AgentID = Client.Self.AgentID;
-            move.AgentData.SessionID = Client.Self.SessionID;
-            move.AgentData.CircuitCode = Client.Network.CircuitCode;
-
-            Client.Network.SendPacket(move, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="itemID"></param>
-        /// <param name="taskID"></param>
-        /// <param name="permissions"></param>
-        public void ScriptQuestionReply(Simulator simulator, LLUUID itemID, LLUUID taskID, ScriptPermission permissions)
-        {
-            ScriptAnswerYesPacket yes = new ScriptAnswerYesPacket();
-            yes.AgentData.AgentID = Client.Self.AgentID;
-            yes.AgentData.SessionID = Client.Self.SessionID;
-            yes.Data.ItemID = itemID;
-            yes.Data.TaskID = taskID;
-            yes.Data.Questions = (int)permissions;
-
-            Client.Network.SendPacket(yes, simulator);
-        }
-
-        #endregion Misc
-
-        #region Packet Handlers
-
-        /// <summary>
-        /// Take an incoming ImprovedInstantMessage packet, auto-parse, and if
-        /// OnInstantMessage is defined call that with the appropriate arguments
-        /// </summary>
-        /// <param name="packet">Incoming ImprovedInstantMessagePacket</param>
-        /// <param name="simulator">Unused</param>
-        private void InstantMessageHandler(Packet packet, Simulator simulator)
-        {
-            if (packet.Type == PacketType.ImprovedInstantMessage)
-            {
-                ImprovedInstantMessagePacket im = (ImprovedInstantMessagePacket)packet;
-
-                if (OnInstantMessage != null)
-                {
-                	InstantMessage message;
-                	message.FromAgentID = im.AgentData.AgentID;
-                	message.FromAgentName = Helpers.FieldToUTF8String(im.MessageBlock.FromAgentName);
-                	message.ToAgentID = im.MessageBlock.ToAgentID;
-                	message.ParentEstateID = im.MessageBlock.ParentEstateID;
-                	message.RegionID = im.MessageBlock.RegionID;
-                	message.Position = im.MessageBlock.Position;
-                	message.Dialog = (InstantMessageDialog)im.MessageBlock.Dialog;
-                	message.GroupIM = im.MessageBlock.FromGroup;
-                	message.IMSessionID = im.MessageBlock.ID;
-                	message.Timestamp = new DateTime(im.MessageBlock.Timestamp);
-                	message.Message = Helpers.FieldToUTF8String(im.MessageBlock.Message);
-                	message.Offline = (InstantMessageOnline)im.MessageBlock.Offline;
-                	message.BinaryBucket = im.MessageBlock.BinaryBucket;
-
-                	try { OnInstantMessage(message, simulator); }
-                	catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Take an incoming Chat packet, auto-parse, and if OnChat is defined call
-        ///   that with the appropriate arguments.
-        /// </summary>
-        /// <param name="packet">Incoming ChatFromSimulatorPacket</param>
-        /// <param name="simulator">Unused</param>
-        private void ChatHandler(Packet packet, Simulator simulator)
-        {
-            if (OnChat != null)
-            {
-                ChatFromSimulatorPacket chat = (ChatFromSimulatorPacket)packet;
-
-                OnChat(Helpers.FieldToUTF8String(chat.ChatData.Message)
-                    , (ChatAudibleLevel)chat.ChatData.Audible
-                    , (ChatType)chat.ChatData.ChatType
-                    , (ChatSourceType)chat.ChatData.SourceType
-                    , Helpers.FieldToUTF8String(chat.ChatData.FromName)
-                    , chat.ChatData.SourceID
-                    , chat.ChatData.OwnerID
-                    , chat.ChatData.Position
-                    );
-            }
-        }
-
-        /// <summary>
-        /// Used for parsing llDialogs
-        /// </summary>
-        /// <param name="packet">Incoming ScriptDialog packet</param>
-        /// <param name="simulator">Unused</param>
-        private void ScriptDialogHandler(Packet packet, Simulator simulator)
-        {
-            if (OnScriptDialog != null)
-            {
-                ScriptDialogPacket dialog = (ScriptDialogPacket)packet;
-                List<string> buttons = new List<string>();
-
-                foreach (ScriptDialogPacket.ButtonsBlock button in dialog.Buttons)
-                {
-                    buttons.Add(Helpers.FieldToUTF8String(button.ButtonLabel));
-                }
-
-                OnScriptDialog(Helpers.FieldToUTF8String(dialog.Data.Message),
-                    Helpers.FieldToUTF8String(dialog.Data.ObjectName),
-                    dialog.Data.ImageID,
-                    dialog.Data.ObjectID,
-                    Helpers.FieldToUTF8String(dialog.Data.FirstName),
-                    Helpers.FieldToUTF8String(dialog.Data.LastName),
-                    dialog.Data.ChatChannel,
-                    buttons);
-            }
-        }
-
-        /// <summary>
-        /// Used for parsing llRequestPermissions dialogs
-        /// </summary>
-        /// <param name="packet">Incoming ScriptDialog packet</param>
-        /// <param name="simulator">Unused</param>
-        private void ScriptQuestionHandler(Packet packet, Simulator simulator)
-        {
-            if (OnScriptQuestion != null)
-            {
-                ScriptQuestionPacket question = (ScriptQuestionPacket)packet;
-
-                try
-                {
-                    OnScriptQuestion(simulator,
-                        question.Data.TaskID,
-                        question.Data.ItemID,
-                        Helpers.FieldToUTF8String(question.Data.ObjectName),
-                        Helpers.FieldToUTF8String(question.Data.ObjectOwner),
-                        (ScriptPermission)question.Data.Questions);
-                }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        /// <summary>
-        /// Update client's Position, LookAt and region handle from incoming packet
-        /// </summary>
-        /// <param name="packet">Incoming AgentMovementCompletePacket</param>
-        /// <param name="simulator">Unused</param>
-        private void MovementCompleteHandler(Packet packet, Simulator simulator)
-        {
-            AgentMovementCompletePacket movement = (AgentMovementCompletePacket)packet;
-
-            relativePosition = movement.Data.Position;
-            Movement.Camera.LookDirection(movement.Data.LookAt);
-            simulator.Handle = movement.Data.RegionHandle;
-        }
-
-        /// <summary>
-        /// Update Client Avatar's health via incoming packet
-        /// </summary>
-        /// <param name="packet">Incoming HealthMessagePacket</param>
-        /// <param name="simulator">Unused</param>
-        private void HealthHandler(Packet packet, Simulator simulator)
-        {
-            health = ((HealthMessagePacket)packet).HealthData.Health;
-        }
-
-        private void AgentDataUpdateHandler(Packet packet, Simulator simulator)
-        {
-            AgentDataUpdatePacket p = (AgentDataUpdatePacket)packet;
-
-            if (p.AgentData.AgentID == simulator.Client.Self.AgentID)
-            {
-                firstName = Helpers.FieldToUTF8String(p.AgentData.FirstName);
-                lastName = Helpers.FieldToUTF8String(p.AgentData.LastName);
-                activeGroup = p.AgentData.ActiveGroupID;
-
-                if (OnAgentDataUpdated != null)
-                {
-                    string groupTitle = Helpers.FieldToUTF8String(p.AgentData.GroupTitle);
-                    string groupName = Helpers.FieldToUTF8String(p.AgentData.GroupName);
-
-                    try { OnAgentDataUpdated(firstName, lastName, activeGroup, groupTitle, (GroupPowers)p.AgentData.GroupPowers, groupName); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-            else
-            {
-                Client.Log("Got an AgentDataUpdate packet for avatar " + p.AgentData.AgentID.ToString() +
-                    " instead of " + Client.Self.AgentID.ToString() + ", this shouldn't happen", Helpers.LogLevel.Error);
-            }
-        }
-
-        /// <summary>
-        /// Update Client Avatar's L$ balance from incoming packet
-        /// </summary>
-        /// <param name="packet">Incoming MoneyBalanceReplyPacket</param>
-        /// <param name="simulator">Unused</param>
-        private void BalanceHandler(Packet packet, Simulator simulator)
-        {
-            if (packet.Type == PacketType.MoneyBalanceReply)
-            {
-                MoneyBalanceReplyPacket mbrp = (MoneyBalanceReplyPacket)packet;
-                balance = mbrp.MoneyData.MoneyBalance;
-
-                if (OnMoneyBalanceReplyReceived != null)
-                {
-                    try { OnMoneyBalanceReplyReceived(mbrp.MoneyData.TransactionID,
-                        mbrp.MoneyData.TransactionSuccess, mbrp.MoneyData.MoneyBalance,
-                        mbrp.MoneyData.SquareMetersCredit, mbrp.MoneyData.SquareMetersCommitted,
-                        Helpers.FieldToUTF8String(mbrp.MoneyData.Description)); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-
-            if (OnBalanceUpdated != null)
-            {
-                try { OnBalanceUpdated(balance); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void EstablishAgentCommunicationEventHandler(string message, LLSD llsd, Simulator simulator)
-        {
-            StructuredData.LLSDMap body = (StructuredData.LLSDMap)llsd;
-
-            if (Client.Settings.MULTIPLE_SIMS && body.ContainsKey("sim-ip-and-port"))
-            {
-                string ipAndPort = body["sim-ip-and-port"].AsString();
-                string[] pieces = ipAndPort.Split(':');
-                IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(pieces[0]), Convert.ToInt32(pieces[1]));
-                Simulator sim = Client.Network.FindSimulator(endPoint);
-
-                if (sim == null)
-                {
-                    Client.Log("Got EstablishAgentCommunication for unknown sim " + ipAndPort,
-                        Helpers.LogLevel.Error);
-
-                    // FIXME: Should we use this opportunity to connect to the simulator?
-                }
-                else
-                {
-                    Client.Log("Got EstablishAgentCommunication for " + sim.ToString(),
-                        Helpers.LogLevel.Info);
-
-                    sim.SetSeedCaps(body["seed-capability"].AsString());
-                }
-            }
-        }
-
-        /// <summary>
-        /// Handler for teleport Requests
-        /// </summary>
-        /// <param name="packet">Incoming TeleportHandler packet</param>
-        /// <param name="simulator">Simulator sending teleport information</param>
-        private void TeleportHandler(Packet packet, Simulator simulator)
-        {
-            bool finished = false;
-            TeleportFlags flags = TeleportFlags.Default;
-
-            if (packet.Type == PacketType.TeleportStart)
-            {
-                TeleportStartPacket start = (TeleportStartPacket)packet;
-
-                teleportMessage = "Teleport started";
-                flags = (TeleportFlags)start.Info.TeleportFlags;
-                teleportStat = TeleportStatus.Start;
-
-                Client.DebugLog("TeleportStart received, Flags: " + flags.ToString());
-            }
-            else if (packet.Type == PacketType.TeleportProgress)
-            {
-                TeleportProgressPacket progress = (TeleportProgressPacket)packet;
-
-                teleportMessage = Helpers.FieldToUTF8String(progress.Info.Message);
-                flags = (TeleportFlags)progress.Info.TeleportFlags;
-                teleportStat = TeleportStatus.Progress;
-
-                Client.DebugLog("TeleportProgress received, Message: " + teleportMessage + ", Flags: " + flags.ToString());
-            }
-            else if (packet.Type == PacketType.TeleportFailed)
-            {
-                TeleportFailedPacket failed = (TeleportFailedPacket)packet;
-
-                teleportMessage = Helpers.FieldToUTF8String(failed.Info.Reason);
-                teleportStat = TeleportStatus.Failed;
-                finished = true;
-
-                Client.DebugLog("TeleportFailed received, Reason: " + teleportMessage);
-            }
-            else if (packet.Type == PacketType.TeleportFinish)
-            {
-                TeleportFinishPacket finish = (TeleportFinishPacket)packet;
-
-                flags = (TeleportFlags)finish.Info.TeleportFlags;
-                string seedcaps = Helpers.FieldToUTF8String(finish.Info.SeedCapability);
-                finished = true;
-
-                Client.DebugLog("TeleportFinish received, Flags: " + flags.ToString());
-
-                // Connect to the new sim
-                Simulator newSimulator = Client.Network.Connect(new IPAddress(finish.Info.SimIP),
-                    finish.Info.SimPort, finish.Info.RegionHandle, true, seedcaps);
-
-                if (newSimulator != null)
-                {
-                    teleportMessage = "Teleport finished";
-                    teleportStat = TeleportStatus.Finished;
-
-                    // Disconnect from the previous sim
-                    Client.Network.DisconnectSim(simulator, true);
-
-                    Client.Log("Moved to new sim " + newSimulator.ToString(), Helpers.LogLevel.Info);
-                }
-                else
-                {
-                    teleportMessage = "Failed to connect to the new sim after a teleport";
-                    teleportStat = TeleportStatus.Failed;
-
-                    // We're going to get disconnected now
-                    Client.Log(teleportMessage, Helpers.LogLevel.Error);
-                }
-            }
-            else if (packet.Type == PacketType.TeleportCancel)
-            {
-                //TeleportCancelPacket cancel = (TeleportCancelPacket)packet;
-
-                teleportMessage = "Cancelled";
-                teleportStat = TeleportStatus.Cancelled;
-                finished = true;
-
-                Client.DebugLog("TeleportCancel received from " + simulator.ToString());
-            }
-            else if (packet.Type == PacketType.TeleportLocal)
-            {
-                TeleportLocalPacket local = (TeleportLocalPacket)packet;
-
-                teleportMessage = "Teleport finished";
-                flags = (TeleportFlags)local.Info.TeleportFlags;
-                teleportStat = TeleportStatus.Finished;
-                relativePosition = local.Info.Position;
-                Movement.Camera.LookDirection(local.Info.LookAt);
-                // This field is apparently not used for anything
-                //local.Info.LocationID;
-                finished = true;
-
-                Client.DebugLog("TeleportLocal received, Flags: " + flags.ToString());
-            }
-
-            if (OnTeleport != null)
-            {
-                try { OnTeleport(teleportMessage, teleportStat, flags); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-
-            if (finished) teleportEvent.Set();
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="sim"></param>
-        private void AvatarAnimationHandler(Packet packet, Simulator sim)
-        {
-            AvatarAnimationPacket animation = (AvatarAnimationPacket)packet;
-
-            if (animation.Sender.ID == Client.Self.AgentID)
-            {
-                lock (SignaledAnimations.Dictionary)
-                {
-                    // Reset the signaled animation list
-                    SignaledAnimations.Dictionary.Clear();
-
-                    for (int i = 0; i < animation.AnimationList.Length; i++)
-                    {
-                        LLUUID animID = animation.AnimationList[i].AnimID;
-                        int sequenceID = animation.AnimationList[i].AnimSequenceID;
-
-                        // Add this animation to the list of currently signaled animations
-                        SignaledAnimations.Dictionary[animID] = sequenceID;
-
-                        if (i < animation.AnimationSourceList.Length)
-                        {
-                            // FIXME: The server tells us which objects triggered our animations,
-                            // we should store this info
-
-                            //animation.AnimationSourceList[i].ObjectID
-                        }
-
-                        if (i < animation.PhysicalAvatarEventList.Length)
-                        {
-                            // FIXME: What is this?
-                        }
-
-                        if (Client.Settings.SEND_AGENT_UPDATES)
-                        {
-                            // We have to manually tell the server to stop playing some animations
-                            if (animID == Animations.STANDUP ||
-                                animID == Animations.PRE_JUMP ||
-                                animID == Animations.LAND ||
-                                animID == Animations.MEDIUM_LAND)
-                            {
-                                Movement.FinishAnim = true;
-                                Movement.SendUpdate(true);
-                            }
-                        }
-                    }
-                }
-
-                if (OnAnimationsChanged != null)
-                {
-                    try { OnAnimationsChanged(SignaledAnimations); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        private void MeanCollisionAlertHandler(Packet packet, Simulator sim)
-        {
-            if (OnMeanCollision != null)
-            {
-                MeanCollisionAlertPacket collision = (MeanCollisionAlertPacket)packet;
-
-                for (int i = 0; i < collision.MeanCollision.Length; i++)
-                {
-                    MeanCollisionAlertPacket.MeanCollisionBlock block = collision.MeanCollision[i];
-
-                    DateTime time = Helpers.UnixTimeToDateTime(block.Time);
-                    MeanCollisionType type = (MeanCollisionType)block.Type;
-
-                    try { OnMeanCollision(type, block.Perp, block.Victim, block.Mag, time); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        private void Network_OnLoginResponse(bool loginSuccess, bool redirect, string message, string reason,
-            LoginResponseData reply)
-        {
-            id = reply.AgentID;
-            sessionID = reply.SessionID;
-            secureSessionID = reply.SecureSessionID;
-            firstName = reply.FirstName;
-            lastName = reply.LastName;
-            startLocation = reply.StartLocation;
-            agentAccess = reply.AgentAccess;
-            Movement.Camera.LookDirection(reply.LookAt);
-            homePosition = reply.HomePosition;
-            homeLookAt = reply.HomeLookAt;
-        }
-
-        private void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message)
-        {
-            // Null out the cached fullName since it can change after logging
-            // in again (with a different account name or different login
-            // server but using the same SecondLife object
-            fullName = null;
-        }
-
-        #endregion Packet Handlers
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AgentManagerCamera.cs b/old/libsl1550/libsecondlife/AgentManagerCamera.cs
deleted file mode 100644
index f06a497..0000000
--- a/old/libsl1550/libsecondlife/AgentManagerCamera.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-namespace libsecondlife
-{
-    public partial class AgentManager
-    {
-        public partial class AgentMovement
-        {
-            /// <summary>
-            /// Camera controls for the agent, mostly a thin wrapper around
-            /// CoordinateFrame. This class is only responsible for state
-            /// tracking and math, it does not send any packets
-            /// </summary>
-            public class AgentCamera
-            {
-                /// <summary></summary>
-                public float Far;
-
-                /// <summary>The camera is a local frame of reference inside of
-                /// the larger grid space. This is where the math happens</summary>
-                private CoordinateFrame Frame;
-
-                /// <summary></summary>
-                public LLVector3 Position
-                {
-                    get { return Frame.Origin; }
-                    set { Frame.Origin = value; }
-                }
-                /// <summary></summary>
-                public LLVector3 AtAxis
-                {
-                    get { return Frame.YAxis; }
-                    set { Frame.YAxis = value; }
-                }
-                /// <summary></summary>
-                public LLVector3 LeftAxis
-                {
-                    get { return Frame.XAxis; }
-                    set { Frame.XAxis = value; }
-                }
-                /// <summary></summary>
-                public LLVector3 UpAxis
-                {
-                    get { return Frame.ZAxis; }
-                    set { Frame.ZAxis = value; }
-                }
-
-                /// <summary>
-                /// Default constructor
-                /// </summary>
-                public AgentCamera()
-                {
-                    Frame = new CoordinateFrame(new LLVector3(128f, 128f, 20f));
-                    Far = 128f;
-                }
-
-                public void Roll(float angle)
-                {
-                    Frame.Roll(angle);
-                }
-
-                public void Pitch(float angle)
-                {
-                    Frame.Pitch(angle);
-                }
-
-                public void Yaw(float angle)
-                {
-                    Frame.Yaw(angle);
-                }
-
-                public void LookDirection(LLVector3 target)
-                {
-                    Frame.LookDirection(target);
-                }
-
-                public void LookDirection(LLVector3 target, LLVector3 upDirection)
-                {
-                    Frame.LookDirection(target, upDirection);
-                }
-
-                public void LookDirection(double heading)
-                {
-                    Frame.LookDirection(heading);
-                }
-
-                public void LookAt(LLVector3 position, LLVector3 target)
-                {
-                    Frame.LookAt(position, target);
-                }
-
-                public void LookAt(LLVector3 position, LLVector3 target, LLVector3 upDirection)
-                {
-                    Frame.LookAt(position, target, upDirection);
-                }
-
-                public void SetPositionOrientation(LLVector3 position, float roll, float pitch, float yaw)
-                {
-                    Frame.Origin = position;
-
-                    Frame.ResetAxes();
-
-                    Frame.Roll(roll);
-                    Frame.Pitch(pitch);
-                    Frame.Yaw(yaw);
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AgentManagerMovement.cs b/old/libsl1550/libsecondlife/AgentManagerMovement.cs
deleted file mode 100644
index f377550..0000000
--- a/old/libsl1550/libsecondlife/AgentManagerMovement.cs
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    public partial class AgentManager
-    {
-        #region Enums
-
-        /// <summary>
-        /// Used to specify movement actions for your agent
-        /// </summary>
-        [Flags]
-        public enum ControlFlags
-        {
-            /// <summary>Empty flag</summary>
-            NONE = 0,
-            /// <summary>Move Forward (SL Keybinding: W/Up Arrow)</summary>
-            AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX,
-            /// <summary>Move Backward (SL Keybinding: S/Down Arrow)</summary>
-            AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX,
-            /// <summary>Move Left (SL Keybinding: Shift-(A/Left Arrow))</summary>
-            AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX,
-            /// <summary>Move Right (SL Keybinding: Shift-(D/Right Arrow))</summary>
-            AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX,
-            /// <summary>Not Flying: Jump/Flying: Move Up (SL Keybinding: E)</summary>
-            AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX,
-            /// <summary>Not Flying: Croutch/Flying: Move Down (SL Keybinding: C)</summary>
-            AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX,
-            /// <summary>Unused</summary>
-            AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX,
-            /// <summary>Unused</summary>
-            AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX,
-            /// <summary>Unused</summary>
-            AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX,
-            /// <summary>Unused</summary>
-            AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX,
-            /// <summary>ORed with AGENT_CONTROL_AT_* if the keyboard is being used</summary>
-            AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX,
-            /// <summary>ORed with AGENT_CONTROL_LEFT_* if the keyboard is being used</summary>
-            AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX,
-            /// <summary>ORed with AGENT_CONTROL_UP_* if the keyboard is being used</summary>
-            AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX,
-            /// <summary>Fly</summary>
-            AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX,
-            /// <summary></summary>
-            AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX,
-            /// <summary>Finish our current animation</summary>
-            AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX,
-            /// <summary>Stand up from the ground or a prim seat</summary>
-            AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX,
-            /// <summary>Sit on the ground at our current location</summary>
-            AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX,
-            /// <summary>Whether mouselook is currently enabled</summary>
-            AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX,
-            /// <summary>Legacy, used if a key was pressed for less than a certain amount of time</summary>
-            AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX,
-            /// <summary>Legacy, used if a key was pressed for less than a certain amount of time</summary>
-            AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX,
-            /// <summary>Legacy, used if a key was pressed for less than a certain amount of time</summary>
-            AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX,
-            /// <summary>Legacy, used if a key was pressed for less than a certain amount of time</summary>
-            AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX,
-            /// <summary>Legacy, used if a key was pressed for less than a certain amount of time</summary>
-            AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX,
-            /// <summary>Legacy, used if a key was pressed for less than a certain amount of time</summary>
-            AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX,
-            /// <summary></summary>
-            AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX,
-            /// <summary></summary>
-            AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX,
-            /// <summary>Set when the avatar is idled or set to away. Note that the away animation is
-            /// activated separately from setting this flag</summary>
-            AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX,
-            /// <summary></summary>
-            AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX,
-            /// <summary></summary>
-            AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX,
-            /// <summary></summary>
-            AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX,
-            /// <summary></summary>
-            AGENT_CONTROL_ML_LBUTTON_UP = 0x1 << CONTROL_ML_LBUTTON_UP_INDEX
-        }
-
-        #endregion Enums
-
-        #region AgentUpdate Constants
-
-        private const int CONTROL_AT_POS_INDEX = 0;
-        private const int CONTROL_AT_NEG_INDEX = 1;
-        private const int CONTROL_LEFT_POS_INDEX = 2;
-        private const int CONTROL_LEFT_NEG_INDEX = 3;
-        private const int CONTROL_UP_POS_INDEX = 4;
-        private const int CONTROL_UP_NEG_INDEX = 5;
-        private const int CONTROL_PITCH_POS_INDEX = 6;
-        private const int CONTROL_PITCH_NEG_INDEX = 7;
-        private const int CONTROL_YAW_POS_INDEX = 8;
-        private const int CONTROL_YAW_NEG_INDEX = 9;
-        private const int CONTROL_FAST_AT_INDEX = 10;
-        private const int CONTROL_FAST_LEFT_INDEX = 11;
-        private const int CONTROL_FAST_UP_INDEX = 12;
-        private const int CONTROL_FLY_INDEX = 13;
-        private const int CONTROL_STOP_INDEX = 14;
-        private const int CONTROL_FINISH_ANIM_INDEX = 15;
-        private const int CONTROL_STAND_UP_INDEX = 16;
-        private const int CONTROL_SIT_ON_GROUND_INDEX = 17;
-        private const int CONTROL_MOUSELOOK_INDEX = 18;
-        private const int CONTROL_NUDGE_AT_POS_INDEX = 19;
-        private const int CONTROL_NUDGE_AT_NEG_INDEX = 20;
-        private const int CONTROL_NUDGE_LEFT_POS_INDEX = 21;
-        private const int CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
-        private const int CONTROL_NUDGE_UP_POS_INDEX = 23;
-        private const int CONTROL_NUDGE_UP_NEG_INDEX = 24;
-        private const int CONTROL_TURN_LEFT_INDEX = 25;
-        private const int CONTROL_TURN_RIGHT_INDEX = 26;
-        private const int CONTROL_AWAY_INDEX = 27;
-        private const int CONTROL_LBUTTON_DOWN_INDEX = 28;
-        private const int CONTROL_LBUTTON_UP_INDEX = 29;
-        private const int CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
-        private const int CONTROL_ML_LBUTTON_UP_INDEX = 31;
-        private const int TOTAL_CONTROLS = 32;
-
-        #endregion AgentUpdate Constants
-
-        /// <summary>
-        /// Agent movement and camera control
-        /// </summary>
-        public partial class AgentMovement
-        {
-            #region Properties
-
-            /// <summary></summary>
-            public bool AtPos
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_AT_POS); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_AT_POS, value); }
-            }
-            /// <summary></summary>
-            public bool AtNeg
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG, value); }
-            }
-            /// <summary></summary>
-            public bool LeftPos
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS, value); }
-            }
-            /// <summary></summary>
-            public bool LeftNeg
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG, value); }
-            }
-            /// <summary></summary>
-            public bool UpPos
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_UP_POS); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, value); }
-            }
-            /// <summary></summary>
-            public bool UpNeg
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, value); }
-            }
-            /// <summary></summary>
-            public bool PitchPos
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_PITCH_POS); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_PITCH_POS, value); }
-            }
-            /// <summary></summary>
-            public bool PitchNeg
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_PITCH_NEG); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_PITCH_NEG, value); }
-            }
-            /// <summary></summary>
-            public bool YawPos
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS, value); }
-            }
-            /// <summary></summary>
-            public bool YawNeg
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG, value); }
-            }
-            /// <summary></summary>
-            public bool FastAt
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FAST_AT); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FAST_AT, value); }
-            }
-            /// <summary></summary>
-            public bool FastLeft
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FAST_LEFT); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FAST_LEFT, value); }
-            }
-            /// <summary></summary>
-            public bool FastUp
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FAST_UP); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FAST_UP, value); }
-            }
-            /// <summary></summary>
-            public bool Fly
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FLY); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FLY, value); }
-            }
-            /// <summary></summary>
-            public bool Stop
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_STOP); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_STOP, value); }
-            }
-            /// <summary></summary>
-            public bool FinishAnim
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FINISH_ANIM); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_FINISH_ANIM, value); }
-            }
-            /// <summary></summary>
-            public bool StandUp
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP, value); }
-            }
-            /// <summary></summary>
-            public bool SitOnGround
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND, value); }
-            }
-            /// <summary></summary>
-            public bool Mouselook
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK, value); }
-            }
-            /// <summary></summary>
-            public bool NudgeAtPos
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS, value); }
-            }
-            /// <summary></summary>
-            public bool NudgeAtNeg
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, value); }
-            }
-            /// <summary></summary>
-            public bool NudgeLeftPos
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS, value); }
-            }
-            /// <summary></summary>
-            public bool NudgeLeftNeg
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG, value); }
-            }
-            /// <summary></summary>
-            public bool NudgeUpPos
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_POS); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_POS, value); }
-            }
-            /// <summary></summary>
-            public bool NudgeUpNeg
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG, value); }
-            }
-            /// <summary></summary>
-            public bool TurnLeft
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT, value); }
-            }
-            /// <summary></summary>
-            public bool TurnRight
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT, value); }
-            }
-            /// <summary></summary>
-            public bool Away
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_AWAY); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_AWAY, value); }
-            }
-            /// <summary></summary>
-            public bool LButtonDown
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN, value); }
-            }
-            /// <summary></summary>
-            public bool LButtonUp
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_UP); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_UP, value); }
-            }
-            /// <summary></summary>
-            public bool MLButtonDown
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_DOWN); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_DOWN, value); }
-            }
-            /// <summary></summary>
-            public bool MLButtonUp
-            {
-                get { return GetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_UP); }
-                set { SetControlFlag(AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_UP, value); }
-            }
-            /// <summary>
-            /// Returns "always run" value, or changes it by sending a SetAlwaysRunPacket
-            /// </summary>
-            public bool AlwaysRun
-            {
-                get
-                {
-                    return alwaysRun;
-                }
-                set
-                {
-                    alwaysRun = value;
-                    SetAlwaysRunPacket run = new SetAlwaysRunPacket();
-                    run.AgentData.AgentID = Client.Self.AgentID;
-                    run.AgentData.SessionID = Client.Self.SessionID;
-                    run.AgentData.AlwaysRun = alwaysRun;
-                    Client.Network.SendPacket(run);
-                }
-            }
-            /// <summary>The current value of the agent control flags</summary>
-            public uint AgentControls
-            {
-                get
-                {
-                    return agentControls;
-                }
-            }
-            /// <summary>Gets or sets the interval in milliseconds at which
-            /// AgentUpdate packets are sent to the current simulator. Setting
-            /// this to a non-zero value will also enable the packet sending if
-            /// it was previously off, and setting it to zero will disable</summary>
-            public int UpdateInterval
-            {
-                get
-                {
-                    return updateInterval;
-                }
-                set
-                {
-                    if (value > 0)
-                    {
-                        updateTimer.Change(value, value);
-                        updateInterval = value;
-                    }
-                    else
-                    {
-                        updateTimer.Change(Timeout.Infinite, Timeout.Infinite);
-                        updateInterval = 0;
-                    }
-                }
-            }
-            /// <summary>Gets or sets whether AgentUpdate packets are sent to
-            /// the current simulator</summary>
-            public bool UpdateEnabled
-            {
-                get { return (updateInterval != 0); }
-            }
-
-            #endregion Properties
-
-            /// <summary>Agent camera controls</summary>
-            public AgentCamera Camera;
-            /// <summary>Currently only used for hiding your group title</summary>
-            public AgentFlags Flags = AgentFlags.None;
-            /// <summary>Action state of the avatar, which can currently be
-            /// typing and editing</summary>
-            public AgentState State = AgentState.None;
-            /// <summary></summary>
-            public LLQuaternion BodyRotation = LLQuaternion.Identity;
-            /// <summary></summary>
-            public LLQuaternion HeadRotation = LLQuaternion.Identity;
-
-            #region Change tracking
-            /// <summary></summary>
-            private LLQuaternion LastBodyRotation;
-            /// <summary></summary>
-            private LLQuaternion LastHeadRotation;
-            /// <summary></summary>
-            private LLVector3 LastCameraCenter;
-            /// <summary></summary>
-            private LLVector3 LastCameraXAxis;
-            /// <summary></summary>
-            private LLVector3 LastCameraYAxis;
-            /// <summary></summary>
-            private LLVector3 LastCameraZAxis;
-            /// <summary></summary>
-            private float LastFar;
-            #endregion Change tracking
-
-            private bool alwaysRun;
-            private SecondLife Client;
-            private uint agentControls;
-            private int duplicateCount;
-            private AgentState lastState;
-            /// <summary>Timer for sending AgentUpdate packets</summary>
-            private Timer updateTimer;
-            private int updateInterval;
-
-            /// <summary>Default constructor</summary>
-            public AgentMovement(SecondLife client)
-            {
-                Client = client;
-                Camera = new AgentCamera();
-
-                updateInterval = Settings.DEFAULT_AGENT_UPDATE_INTERVAL;
-                updateTimer = new Timer(new TimerCallback(UpdateTimer_Elapsed), null, Settings.DEFAULT_AGENT_UPDATE_INTERVAL,
-                    Settings.DEFAULT_AGENT_UPDATE_INTERVAL);
-            }
-
-            /// <summary>
-            /// Send an AgentUpdate with the camera set at the current agent
-            /// position and pointing towards the heading specified
-            /// </summary>
-            /// <param name="heading">Camera rotation in radians</param>
-            /// <param name="reliable">Whether to send the AgentUpdate reliable
-            /// or not</param>
-            public void UpdateFromHeading(double heading, bool reliable)
-            {
-                Camera.Position = Client.Self.SimPosition;
-                Camera.LookDirection(heading);
-
-                BodyRotation.Z = (float)Math.Sin(heading / 2.0d);
-                BodyRotation.W = (float)Math.Cos(heading / 2.0d);
-                HeadRotation = BodyRotation;
-
-                SendUpdate(reliable);
-            }
-
-            /// <summary>
-            /// Rotates the avatar body and camera toward a target position.
-            /// This will also anchor the camera position on the avatar
-            /// </summary>
-            /// <param name="target">Region coordinates to turn toward</param>
-            public bool TurnToward(LLVector3 target)
-            {
-                if (Client.Settings.SEND_AGENT_UPDATES)
-                {
-                    LLVector3 myPos = Client.Self.SimPosition;
-                    LLVector3 forward = new LLVector3(1, 0, 0);
-                    LLVector3 offset = LLVector3.Norm(target - myPos);
-                    LLQuaternion newRot = LLVector3.RotBetween(forward, offset);
-
-                    BodyRotation = newRot;
-                    HeadRotation = newRot;
-                    Camera.LookAt(myPos, target);
-
-                    SendUpdate();
-
-                    return true;
-                }
-                else
-                {
-                    Client.Log("Attempted TurnToward but agent updates are disabled", Helpers.LogLevel.Warning);
-                    return false;
-                }
-            }
-
-            /// <summary>
-            /// Aims at the specified position, enters mouselook, presses and
-            /// releases the left mouse button, and leaves mouselook
-            /// </summary>
-            /// <param name="target">Target to shoot at</param>
-            /// <returns></returns>
-            public bool Shoot(LLVector3 target)
-            {
-                if (TurnToward(target))
-                    return Shoot();
-                else
-                    return false;
-            }
-
-            /// <summary>
-            /// Enters mouselook, presses and releases the left mouse button, and leaves mouselook
-            /// </summary>
-            /// <returns></returns>
-            public bool Shoot()
-            {
-                if (Client.Settings.SEND_AGENT_UPDATES)
-                {
-                    Mouselook = true;
-                    MLButtonDown = true;
-                    SendUpdate();
-
-                    MLButtonUp = true;
-                    MLButtonDown = false;
-                    FinishAnim = true;
-                    SendUpdate();
-
-                    Mouselook = false;
-                    MLButtonUp = false;
-                    FinishAnim = false;
-                    SendUpdate();
-
-                    return true;
-                }
-                else
-                {
-                    Client.Log("Attempted Shoot but agent updates are disabled", Helpers.LogLevel.Warning);
-                    return false;
-                }
-            }
-
-            /// <summary>
-            /// Send new AgentUpdate packet to update our current camera
-            /// position and rotation
-            /// </summary>
-            public void SendUpdate()
-            {
-                SendUpdate(false, Client.Network.CurrentSim);
-            }
-
-            /// <summary>
-            /// Send new AgentUpdate packet to update our current camera
-            /// position and rotation
-            /// </summary>
-            /// <param name="reliable">Whether to require server acknowledgement
-            /// of this packet</param>
-            public void SendUpdate(bool reliable)
-            {
-                SendUpdate(reliable, Client.Network.CurrentSim);
-            }
-
-            /// <summary>
-            /// Send new AgentUpdate packet to update our current camera
-            /// position and rotation
-            /// </summary>
-            /// <param name="reliable">Whether to require server acknowledgement
-            /// of this packet</param>
-            /// <param name="simulator">Simulator to send the update to</param>
-            public void SendUpdate(bool reliable, Simulator simulator)
-            {
-                LLVector3 origin = Camera.Position;
-                LLVector3 xAxis = Camera.LeftAxis;
-                LLVector3 yAxis = Camera.AtAxis;
-                LLVector3 zAxis = Camera.UpAxis;
-
-                // Attempted to sort these in a rough order of how often they might change
-                if (agentControls == 0 &&
-                    yAxis == LastCameraYAxis &&
-                    origin == LastCameraCenter &&
-                    State == lastState &&
-                    HeadRotation == LastHeadRotation &&
-                    BodyRotation == LastBodyRotation &&
-                    xAxis == LastCameraXAxis &&
-                    Camera.Far == LastFar &&
-                    zAxis == LastCameraZAxis)
-                {
-                    ++duplicateCount;
-                }
-                else
-                {
-                    duplicateCount = 0;
-                }
-
-                if (Client.Settings.CONTINUOUS_AGENT_UPDATES || duplicateCount < 10)
-                {
-                    // Store the current state to do duplicate checking in the future
-                    LastHeadRotation = HeadRotation;
-                    LastBodyRotation = BodyRotation;
-                    LastCameraYAxis = yAxis;
-                    LastCameraCenter = origin;
-                    LastCameraXAxis = xAxis;
-                    LastCameraZAxis = zAxis;
-                    LastFar = Camera.Far;
-                    lastState = State;
-
-                    // Build the AgentUpdate packet and send it
-                    AgentUpdatePacket update = new AgentUpdatePacket();
-                    update.Header.Reliable = reliable;
-
-                    update.AgentData.AgentID = Client.Self.AgentID;
-                    update.AgentData.SessionID = Client.Self.SessionID;
-                    update.AgentData.HeadRotation = HeadRotation;
-                    update.AgentData.BodyRotation = BodyRotation;
-                    update.AgentData.CameraAtAxis = yAxis;
-                    update.AgentData.CameraCenter = origin;
-                    update.AgentData.CameraLeftAxis = xAxis;
-                    update.AgentData.CameraUpAxis = zAxis;
-                    update.AgentData.Far = Camera.Far;
-                    update.AgentData.State = (byte)State;
-                    update.AgentData.ControlFlags = agentControls;
-                    update.AgentData.Flags = (byte)Flags;
-
-                    Client.Network.SendPacket(update, simulator);
-
-                    ResetControlFlags();
-                }
-            }
-
-            /// <summary>
-            /// Builds an AgentUpdate packet entirely from parameters. This
-            /// will not touch the state of Self.Movement or
-            /// Self.Movement.Camera in any way
-            /// </summary>
-            /// <param name="controlFlags"></param>
-            /// <param name="position"></param>
-            /// <param name="forwardAxis"></param>
-            /// <param name="leftAxis"></param>
-            /// <param name="upAxis"></param>
-            /// <param name="bodyRotation"></param>
-            /// <param name="headRotation"></param>
-            /// <param name="farClip"></param>
-            /// <param name="reliable"></param>
-            public void SendManualUpdate(AgentManager.ControlFlags controlFlags, LLVector3 position, LLVector3 forwardAxis,
-                LLVector3 leftAxis, LLVector3 upAxis, LLQuaternion bodyRotation, LLQuaternion headRotation, float farClip,
-                AgentFlags flags, AgentState state, bool reliable)
-            {
-                AgentUpdatePacket update = new AgentUpdatePacket();
-
-                update.AgentData.AgentID = Client.Self.AgentID;
-                update.AgentData.SessionID = Client.Self.SessionID;
-                update.AgentData.BodyRotation = bodyRotation;
-                update.AgentData.HeadRotation = headRotation;
-                update.AgentData.CameraCenter = position;
-                update.AgentData.CameraAtAxis = forwardAxis;
-                update.AgentData.CameraLeftAxis = leftAxis;
-                update.AgentData.CameraUpAxis = upAxis;
-                update.AgentData.Far = farClip;
-                update.AgentData.ControlFlags = (uint)controlFlags;
-                update.AgentData.Flags = (byte)flags;
-                update.AgentData.State = (byte)state;
-
-                update.Header.Reliable = reliable;
-
-                Client.Network.SendPacket(update);
-            }
-
-            private bool GetControlFlag(ControlFlags flag)
-            {
-                return (agentControls & (uint)flag) != 0;
-            }
-
-            private void SetControlFlag(ControlFlags flag, bool value)
-            {
-                if (value) agentControls |= (uint)flag;
-                else agentControls &= ~((uint)flag);
-            }
-
-            private void ResetControlFlags()
-            {
-                // Reset all of the flags except for persistent settings like
-                // away, fly, mouselook, and crouching
-                agentControls &=
-                    (uint)(ControlFlags.AGENT_CONTROL_AWAY |
-                    ControlFlags.AGENT_CONTROL_FLY |
-                    ControlFlags.AGENT_CONTROL_MOUSELOOK |
-                    ControlFlags.AGENT_CONTROL_UP_NEG);
-            }
-
-            private void UpdateTimer_Elapsed(object obj)
-            {
-                if (Client.Network.Connected && Client.Settings.SEND_AGENT_UPDATES)
-                {
-                    //Send an AgentUpdate packet
-                    SendUpdate(false, Client.Network.CurrentSim);
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AgentThrottle.cs b/old/libsl1550/libsecondlife/AgentThrottle.cs
deleted file mode 100644
index 033fec4..0000000
--- a/old/libsl1550/libsecondlife/AgentThrottle.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Throttles the network traffic for various different traffic types.
-    /// Access this class through SecondLife.Throttle
-    /// </summary>
-    public class AgentThrottle
-    {
-        /// <summary>Maximum bytes per second for resending unacknowledged packets</summary>
-        public float Resend
-        {
-            get { return resend; }
-            set
-            {
-                if (value > 150000.0f) resend = 150000.0f;
-                else if (value < 10000.0f) resend = 10000.0f;
-                else resend = value;
-            }
-        }
-        /// <summary>Maximum bytes per second for LayerData terrain</summary>
-        public float Land
-        {
-            get { return land; }
-            set
-            {
-                if (value > 170000.0f) land = 170000.0f;
-                else if (value < 0.0f) land = 0.0f; // We don't have control of these so allow throttling to 0
-                else land = value;
-            }
-        }
-        /// <summary>Maximum bytes per second for LayerData wind data</summary>
-        public float Wind
-        {
-            get { return wind; }
-            set
-            {
-                if (value > 34000.0f) wind = 34000.0f;
-                else if (value < 0.0f) wind = 0.0f; // We don't have control of these so allow throttling to 0
-                else wind = value;
-            }
-        }
-        /// <summary>Maximum bytes per second for LayerData clouds</summary>
-        public float Cloud
-        {
-            get { return cloud; }
-            set
-            {
-                if (value > 34000.0f) cloud = 34000.0f;
-                else if (value < 0.0f) cloud = 0.0f; // We don't have control of these so allow throttling to 0
-                else cloud = value;
-            }
-        }
-        /// <summary>Unknown, includes object data</summary>
-        public float Task
-        {
-            get { return task; }
-            set
-            {
-                if (value > 446000.0f) task = 446000.0f;
-                else if (value < 4000.0f) task = 4000.0f;
-                else task = value;
-            }
-        }
-        /// <summary>Maximum bytes per second for textures</summary>
-        public float Texture
-        {
-            get { return texture; }
-            set
-            {
-                if (value > 446000.0f) texture = 446000.0f;
-                else if (value < 4000.0f) texture = 4000.0f;
-                else texture = value;
-            }
-        }
-        /// <summary>Maximum bytes per second for downloaded assets</summary>
-        public float Asset
-        {
-            get { return asset; }
-            set
-            {
-                if (value > 220000.0f) asset = 220000.0f;
-                else if (value < 10000.0f) asset = 10000.0f;
-                else asset = value;
-            }
-        }
-
-        /// <summary>Maximum bytes per second the entire connection, divided up
-        /// between invidiual streams using default multipliers</summary>
-        public float Total
-        {
-            get { return Resend + Land + Wind + Cloud + Task + Texture + Asset; }
-            set
-            {
-                // These sane initial values were pulled from the Second Life client
-                Resend = (value * 0.1f);
-                Land = (float)(value * 0.52f / 3f);
-                Wind = (float)(value * 0.05f);
-                Cloud = (float)(value * 0.05f);
-                Task = (float)(value * 0.704f / 3f);
-                Texture = (float)(value * 0.704f / 3f);
-                Asset = (float)(value * 0.484f / 3f);
-            }
-        }
-
-        private SecondLife Client;
-        private float resend;
-        private float land;
-        private float wind;
-        private float cloud;
-        private float task;
-        private float texture;
-        private float asset;
-
-        /// <summary>
-        /// Default constructor, uses a default high total of 1500 KBps (1536000)
-        /// </summary>
-        public AgentThrottle(SecondLife client)
-        {
-            Client = client;
-            Total = 1536000.0f;
-        }
-
-        /// <summary>
-        /// Constructor that decodes an existing AgentThrottle packet in to
-        /// individual values
-        /// </summary>
-        /// <param name="data">Reference to the throttle data in an AgentThrottle
-        /// packet</param>
-        /// <param name="pos">Offset position to start reading at in the
-        /// throttle data</param>
-        /// <remarks>This is generally not needed in libsecondlife clients as
-        /// the server will never send a throttle packet to the client</remarks>
-        public AgentThrottle(byte[] data, int pos)
-        {
-            int i;
-            if (!BitConverter.IsLittleEndian)
-                for (i = 0; i < 7; i++)
-                    Array.Reverse(data, pos + i * 4, 4);
-
-            Resend = BitConverter.ToSingle(data, pos); pos += 4;
-            Land = BitConverter.ToSingle(data, pos); pos += 4;
-            Wind = BitConverter.ToSingle(data, pos); pos += 4;
-            Cloud = BitConverter.ToSingle(data, pos); pos += 4;
-            Task = BitConverter.ToSingle(data, pos); pos += 4;
-            Texture = BitConverter.ToSingle(data, pos); pos += 4;
-            Asset = BitConverter.ToSingle(data, pos);
-        }
-
-        /// <summary>
-        /// Send an AgentThrottle packet to the current server using the
-        /// current values
-        /// </summary>
-        public void Set()
-        {
-            Set(Client.Network.CurrentSim);
-        }
-
-        /// <summary>
-        /// Send an AgentThrottle packet to the specified server using the
-        /// current values
-        /// </summary>
-        public void Set(Simulator simulator)
-        {
-            AgentThrottlePacket throttle = new AgentThrottlePacket();
-            throttle.AgentData.AgentID = Client.Self.AgentID;
-            throttle.AgentData.SessionID = Client.Self.SessionID;
-            throttle.AgentData.CircuitCode = Client.Network.CircuitCode;
-            throttle.Throttle.GenCounter = 0;
-            throttle.Throttle.Throttles = this.ToBytes();
-
-            Client.Network.SendPacket(throttle, simulator);
-        }
-
-        /// <summary>
-        /// Convert the current throttle values to a byte array that can be put
-        /// in an AgentThrottle packet
-        /// </summary>
-        /// <returns>Byte array containing all the throttle values</returns>
-        public byte[] ToBytes()
-        {
-            byte[] data = new byte[7 * 4];
-            int i = 0;
-
-            BitConverter.GetBytes(Resend).CopyTo(data, i); i += 4;
-            BitConverter.GetBytes(Land).CopyTo(data, i); i += 4;
-            BitConverter.GetBytes(Wind).CopyTo(data, i); i += 4;
-            BitConverter.GetBytes(Cloud).CopyTo(data, i); i += 4;
-            BitConverter.GetBytes(Task).CopyTo(data, i); i += 4;
-            BitConverter.GetBytes(Texture).CopyTo(data, i); i += 4;
-            BitConverter.GetBytes(Asset).CopyTo(data, i); i += 4;
-
-            if (!BitConverter.IsLittleEndian)
-                for (i = 0; i < 7; i++)
-                    Array.Reverse(data, i * 4, 4);
-
-            return data;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Animations.cs b/old/libsl1550/libsecondlife/Animations.cs
deleted file mode 100644
index e69764f..0000000
--- a/old/libsl1550/libsecondlife/Animations.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-using System;
-
-namespace libsecondlife
-{
-    public static class Animations
-    {
-        public readonly static LLUUID AFRAID = new LLUUID("6b61c8e8-4747-0d75-12d7-e49ff207a4ca");
-        public readonly static LLUUID AIM_BAZOOKA_R = new LLUUID("b5b4a67d-0aee-30d2-72cd-77b333e932ef");
-        public readonly static LLUUID AIM_BOW_L = new LLUUID("46bb4359-de38-4ed8-6a22-f1f52fe8f506");
-        public readonly static LLUUID AIM_HANDGUN_R = new LLUUID("3147d815-6338-b932-f011-16b56d9ac18b");
-        public readonly static LLUUID AIM_RIFLE_R = new LLUUID("ea633413-8006-180a-c3ba-96dd1d756720");
-        public readonly static LLUUID ANGRY = new LLUUID("5747a48e-073e-c331-f6f3-7c2149613d3e");
-        public readonly static LLUUID AWAY = new LLUUID("fd037134-85d4-f241-72c6-4f42164fedee");
-        public readonly static LLUUID BACKFLIP = new LLUUID("c4ca6188-9127-4f31-0158-23c4e2f93304");
-        public readonly static LLUUID BELLY_LAUGH = new LLUUID("18b3a4b5-b463-bd48-e4b6-71eaac76c515");
-        public readonly static LLUUID BLOW_KISS = new LLUUID("db84829b-462c-ee83-1e27-9bbee66bd624");
-        public readonly static LLUUID BORED = new LLUUID("b906c4ba-703b-1940-32a3-0c7f7d791510");
-        public readonly static LLUUID BOW = new LLUUID("82e99230-c906-1403-4d9c-3889dd98daba");
-        public readonly static LLUUID BRUSH = new LLUUID("349a3801-54f9-bf2c-3bd0-1ac89772af01");
-        public readonly static LLUUID BUSY = new LLUUID("efcf670c-2d18-8128-973a-034ebc806b67");
-        public readonly static LLUUID CLAP = new LLUUID("9b0c1c4e-8ac7-7969-1494-28c874c4f668");
-        public readonly static LLUUID COURTBOW = new LLUUID("9ba1c942-08be-e43a-fb29-16ad440efc50");
-        public readonly static LLUUID CROUCH = new LLUUID("201f3fdf-cb1f-dbec-201f-7333e328ae7c");
-        public readonly static LLUUID CROUCHWALK = new LLUUID("47f5f6fb-22e5-ae44-f871-73aaaf4a6022");
-        public readonly static LLUUID CRY = new LLUUID("92624d3e-1068-f1aa-a5ec-8244585193ed");
-        public readonly static LLUUID CUSTOMIZE = new LLUUID("038fcec9-5ebd-8a8e-0e2e-6e71a0a1ac53");
-        public readonly static LLUUID CUSTOMIZE_DONE = new LLUUID("6883a61a-b27b-5914-a61e-dda118a9ee2c");
-        public readonly static LLUUID DANCE1 = new LLUUID("b68a3d7c-de9e-fc87-eec8-543d787e5b0d");
-        public readonly static LLUUID DANCE2 = new LLUUID("928cae18-e31d-76fd-9cc9-2f55160ff818");
-        public readonly static LLUUID DANCE3 = new LLUUID("30047778-10ea-1af7-6881-4db7a3a5a114");
-        public readonly static LLUUID DANCE4 = new LLUUID("951469f4-c7b2-c818-9dee-ad7eea8c30b7");
-        public readonly static LLUUID DANCE5 = new LLUUID("4bd69a1d-1114-a0b4-625f-84e0a5237155");
-        public readonly static LLUUID DANCE6 = new LLUUID("cd28b69b-9c95-bb78-3f94-8d605ff1bb12");
-        public readonly static LLUUID DANCE7 = new LLUUID("a54d8ee2-28bb-80a9-7f0c-7afbbe24a5d6");
-        public readonly static LLUUID DANCE8 = new LLUUID("b0dc417c-1f11-af36-2e80-7e7489fa7cdc");
-        public readonly static LLUUID DEAD = new LLUUID("57abaae6-1d17-7b1b-5f98-6d11a6411276");
-        public readonly static LLUUID DRINK = new LLUUID("0f86e355-dd31-a61c-fdb0-3a96b9aad05f");
-        public readonly static LLUUID EMBARRASSED = new LLUUID("514af488-9051-044a-b3fc-d4dbf76377c6");
-        public readonly static LLUUID EXPRESS_AFRAID = new LLUUID("aa2df84d-cf8f-7218-527b-424a52de766e");
-        public readonly static LLUUID EXPRESS_ANGER = new LLUUID("1a03b575-9634-b62a-5767-3a679e81f4de");
-        public readonly static LLUUID EXPRESS_BORED = new LLUUID("214aa6c1-ba6a-4578-f27c-ce7688f61d0d");
-        public readonly static LLUUID EXPRESS_CRY = new LLUUID("d535471b-85bf-3b4d-a542-93bea4f59d33");
-        public readonly static LLUUID EXPRESS_DISDAIN = new LLUUID("d4416ff1-09d3-300f-4183-1b68a19b9fc1");
-        public readonly static LLUUID EXPRESS_EMBARRASSED = new LLUUID("0b8c8211-d78c-33e8-fa28-c51a9594e424");
-        public readonly static LLUUID EXPRESS_FROWN = new LLUUID("fee3df48-fa3d-1015-1e26-a205810e3001");
-        public readonly static LLUUID EXPRESS_KISS = new LLUUID("1e8d90cc-a84e-e135-884c-7c82c8b03a14");
-        public readonly static LLUUID EXPRESS_LAUGH = new LLUUID("62570842-0950-96f8-341c-809e65110823");
-        public readonly static LLUUID EXPRESS_OPEN_MOUTH = new LLUUID("d63bc1f9-fc81-9625-a0c6-007176d82eb7");
-        public readonly static LLUUID EXPRESS_REPULSED = new LLUUID("f76cda94-41d4-a229-2872-e0296e58afe1");
-        public readonly static LLUUID EXPRESS_SAD = new LLUUID("eb6ebfb2-a4b3-a19c-d388-4dd5c03823f7");
-        public readonly static LLUUID EXPRESS_SHRUG = new LLUUID("a351b1bc-cc94-aac2-7bea-a7e6ebad15ef");
-        public readonly static LLUUID EXPRESS_SMILE = new LLUUID("b7c7c833-e3d3-c4e3-9fc0-131237446312");
-        public readonly static LLUUID EXPRESS_SURPRISE = new LLUUID("728646d9-cc79-08b2-32d6-937f0a835c24");
-        public readonly static LLUUID EXPRESS_TONGUE_OUT = new LLUUID("835965c6-7f2f-bda2-5deb-2478737f91bf");
-        public readonly static LLUUID EXPRESS_TOOTHSMILE = new LLUUID("b92ec1a5-e7ce-a76b-2b05-bcdb9311417e");
-        public readonly static LLUUID EXPRESS_WINK = new LLUUID("da020525-4d94-59d6-23d7-81fdebf33148");
-        public readonly static LLUUID EXPRESS_WORRY = new LLUUID("9c05e5c7-6f07-6ca4-ed5a-b230390c3950");
-        public readonly static LLUUID FALLDOWN = new LLUUID("666307d9-a860-572d-6fd4-c3ab8865c094");
-        public readonly static LLUUID FEMALE_WALK = new LLUUID("f5fc7433-043d-e819-8298-f519a119b688");
-        public readonly static LLUUID FINGER_WAG = new LLUUID("c1bc7f36-3ba0-d844-f93c-93be945d644f");
-        public readonly static LLUUID FIST_PUMP = new LLUUID("7db00ccd-f380-f3ee-439d-61968ec69c8a");
-        public readonly static LLUUID FLY = new LLUUID("aec4610c-757f-bc4e-c092-c6e9caf18daf");
-        public readonly static LLUUID FLYSLOW = new LLUUID("2b5a38b2-5e00-3a97-a495-4c826bc443e6");
-        public readonly static LLUUID HELLO = new LLUUID("9b29cd61-c45b-5689-ded2-91756b8d76a9");
-        public readonly static LLUUID HOLD_BAZOOKA_R = new LLUUID("ef62d355-c815-4816-2474-b1acc21094a6");
-        public readonly static LLUUID HOLD_BOW_L = new LLUUID("8b102617-bcba-037b-86c1-b76219f90c88");
-        public readonly static LLUUID HOLD_HANDGUN_R = new LLUUID("efdc1727-8b8a-c800-4077-975fc27ee2f2");
-        public readonly static LLUUID HOLD_RIFLE_R = new LLUUID("3d94bad0-c55b-7dcc-8763-033c59405d33");
-        public readonly static LLUUID HOLD_THROW_R = new LLUUID("7570c7b5-1f22-56dd-56ef-a9168241bbb6");
-        public readonly static LLUUID HOVER = new LLUUID("4ae8016b-31b9-03bb-c401-b1ea941db41d");
-        public readonly static LLUUID HOVER_DOWN = new LLUUID("20f063ea-8306-2562-0b07-5c853b37b31e");
-        public readonly static LLUUID HOVER_UP = new LLUUID("62c5de58-cb33-5743-3d07-9e4cd4352864");
-        public readonly static LLUUID IMPATIENT = new LLUUID("5ea3991f-c293-392e-6860-91dfa01278a3");
-        public readonly static LLUUID JUMP = new LLUUID("2305bd75-1ca9-b03b-1faa-b176b8a8c49e");
-        public readonly static LLUUID JUMP_FOR_JOY = new LLUUID("709ea28e-1573-c023-8bf8-520c8bc637fa");
-        public readonly static LLUUID KISS_MY_BUTT = new LLUUID("19999406-3a3a-d58c-a2ac-d72e555dcf51");
-        public readonly static LLUUID LAND = new LLUUID("7a17b059-12b2-41b1-570a-186368b6aa6f");
-        public readonly static LLUUID LAUGH_SHORT = new LLUUID("ca5b3f14-3194-7a2b-c894-aa699b718d1f");
-        public readonly static LLUUID MEDIUM_LAND = new LLUUID("f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57");
-        public readonly static LLUUID MOTORCYCLE_SIT = new LLUUID("08464f78-3a8e-2944-cba5-0c94aff3af29");
-        public readonly static LLUUID MUSCLE_BEACH = new LLUUID("315c3a41-a5f3-0ba4-27da-f893f769e69b");
-        public readonly static LLUUID NO = new LLUUID("5a977ed9-7f72-44e9-4c4c-6e913df8ae74");
-        public readonly static LLUUID NO_UNHAPPY = new LLUUID("d83fa0e5-97ed-7eb2-e798-7bd006215cb4");
-        public readonly static LLUUID NYAH_NYAH = new LLUUID("f061723d-0a18-754f-66ee-29a44795a32f");
-        public readonly static LLUUID ONETWO_PUNCH = new LLUUID("eefc79be-daae-a239-8c04-890f5d23654a");
-        public readonly static LLUUID PEACE = new LLUUID("b312b10e-65ab-a0a4-8b3c-1326ea8e3ed9");
-        public readonly static LLUUID POINT_ME = new LLUUID("17c024cc-eef2-f6a0-3527-9869876d7752");
-        public readonly static LLUUID POINT_YOU = new LLUUID("ec952cca-61ef-aa3b-2789-4d1344f016de");
-        public readonly static LLUUID PRE_JUMP = new LLUUID("7a4e87fe-de39-6fcb-6223-024b00893244");
-        public readonly static LLUUID PUNCH_LEFT = new LLUUID("f3300ad9-3462-1d07-2044-0fef80062da0");
-        public readonly static LLUUID PUNCH_RIGHT = new LLUUID("c8e42d32-7310-6906-c903-cab5d4a34656");
-        public readonly static LLUUID REPULSED = new LLUUID("36f81a92-f076-5893-dc4b-7c3795e487cf");
-        public readonly static LLUUID ROUNDHOUSE_KICK = new LLUUID("49aea43b-5ac3-8a44-b595-96100af0beda");
-        public readonly static LLUUID RPS_COUNTDOWN = new LLUUID("35db4f7e-28c2-6679-cea9-3ee108f7fc7f");
-        public readonly static LLUUID RPS_PAPER = new LLUUID("0836b67f-7f7b-f37b-c00a-460dc1521f5a");
-        public readonly static LLUUID RPS_ROCK = new LLUUID("42dd95d5-0bc6-6392-f650-777304946c0f");
-        public readonly static LLUUID RPS_SCISSORS = new LLUUID("16803a9f-5140-e042-4d7b-d28ba247c325");
-        public readonly static LLUUID RUN = new LLUUID("05ddbff8-aaa9-92a1-2b74-8fe77a29b445");
-        public readonly static LLUUID SAD = new LLUUID("0eb702e2-cc5a-9a88-56a5-661a55c0676a");
-        public readonly static LLUUID SALUTE = new LLUUID("cd7668a6-7011-d7e2-ead8-fc69eff1a104");
-        public readonly static LLUUID SHOOT_BOW_L = new LLUUID("e04d450d-fdb5-0432-fd68-818aaf5935f8");
-        public readonly static LLUUID SHOUT = new LLUUID("6bd01860-4ebd-127a-bb3d-d1427e8e0c42");
-        public readonly static LLUUID SHRUG = new LLUUID("70ea714f-3a97-d742-1b01-590a8fcd1db5");
-        public readonly static LLUUID SIT = new LLUUID("1a5fe8ac-a804-8a5d-7cbd-56bd83184568");
-        public readonly static LLUUID SIT_FEMALE = new LLUUID("b1709c8d-ecd3-54a1-4f28-d55ac0840782");
-        public readonly static LLUUID SIT_GENERIC = new LLUUID("245f3c54-f1c0-bf2e-811f-46d8eeb386e7");
-        public readonly static LLUUID SIT_GROUND = new LLUUID("1c7600d6-661f-b87b-efe2-d7421eb93c86");
-        public readonly static LLUUID SIT_GROUND_staticRAINED = new LLUUID("1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e");
-        public readonly static LLUUID SIT_TO_STAND = new LLUUID("a8dee56f-2eae-9e7a-05a2-6fb92b97e21e");
-        public readonly static LLUUID SLEEP = new LLUUID("f2bed5f9-9d44-39af-b0cd-257b2a17fe40");
-        public readonly static LLUUID SMOKE_IDLE = new LLUUID("d2f2ee58-8ad1-06c9-d8d3-3827ba31567a");
-        public readonly static LLUUID SMOKE_INHALE = new LLUUID("6802d553-49da-0778-9f85-1599a2266526");
-        public readonly static LLUUID SMOKE_THROW_DOWN = new LLUUID("0a9fb970-8b44-9114-d3a9-bf69cfe804d6");
-        public readonly static LLUUID SNAPSHOT = new LLUUID("eae8905b-271a-99e2-4c0e-31106afd100c");
-        public readonly static LLUUID STAND = new LLUUID("2408fe9e-df1d-1d7d-f4ff-1384fa7b350f");
-        public readonly static LLUUID STANDUP = new LLUUID("3da1d753-028a-5446-24f3-9c9b856d9422");
-        public readonly static LLUUID STAND_1 = new LLUUID("15468e00-3400-bb66-cecc-646d7c14458e");
-        public readonly static LLUUID STAND_2 = new LLUUID("370f3a20-6ca6-9971-848c-9a01bc42ae3c");
-        public readonly static LLUUID STAND_3 = new LLUUID("42b46214-4b44-79ae-deb8-0df61424ff4b");
-        public readonly static LLUUID STAND_4 = new LLUUID("f22fed8b-a5ed-2c93-64d5-bdd8b93c889f");
-        public readonly static LLUUID STRETCH = new LLUUID("80700431-74ec-a008-14f8-77575e73693f");
-        public readonly static LLUUID STRIDE = new LLUUID("1cb562b0-ba21-2202-efb3-30f82cdf9595");
-        public readonly static LLUUID SURF = new LLUUID("41426836-7437-7e89-025d-0aa4d10f1d69");
-        public readonly static LLUUID SURPRISE = new LLUUID("313b9881-4302-73c0-c7d0-0e7a36b6c224");
-        public readonly static LLUUID SWORD_STRIKE = new LLUUID("85428680-6bf9-3e64-b489-6f81087c24bd");
-        public readonly static LLUUID TALK = new LLUUID("5c682a95-6da4-a463-0bf6-0f5b7be129d1");
-        public readonly static LLUUID TANTRUM = new LLUUID("11000694-3f41-adc2-606b-eee1d66f3724");
-        public readonly static LLUUID THROW_R = new LLUUID("aa134404-7dac-7aca-2cba-435f9db875ca");
-        public readonly static LLUUID TRYON_SHIRT = new LLUUID("83ff59fe-2346-f236-9009-4e3608af64c1");
-        public readonly static LLUUID TURNLEFT = new LLUUID("56e0ba0d-4a9f-7f27-6117-32f2ebbf6135");
-        public readonly static LLUUID TURNRIGHT = new LLUUID("2d6daa51-3192-6794-8e2e-a15f8338ec30");
-        public readonly static LLUUID TYPE = new LLUUID("c541c47f-e0c0-058b-ad1a-d6ae3a4584d9");
-        public readonly static LLUUID WALK = new LLUUID("6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0");
-        public readonly static LLUUID WHISPER = new LLUUID("7693f268-06c7-ea71-fa21-2b30d6533f8f");
-        public readonly static LLUUID WHISTLE = new LLUUID("b1ed7982-c68e-a982-7561-52a88a5298c0");
-        public readonly static LLUUID WINK = new LLUUID("869ecdad-a44b-671e-3266-56aef2e3ac2e");
-        public readonly static LLUUID WINK_HOLLYWOOD = new LLUUID("c0c4030f-c02b-49de-24ba-2331f43fe41c");
-        public readonly static LLUUID WORRY = new LLUUID("9f496bd2-589a-709f-16cc-69bf7df1d36c");
-        public readonly static LLUUID YES = new LLUUID("15dd911d-be82-2856-26db-27659b142875");
-        public readonly static LLUUID YES_HAPPY = new LLUUID("b8c8b2a3-9008-1771-3bfc-90924955ab2d");
-        public readonly static LLUUID YOGA_FLOAT = new LLUUID("42ecd00b-9947-a97c-400a-bbc9174c7aeb");
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AppearanceManager.cs b/old/libsl1550/libsecondlife/AppearanceManager.cs
deleted file mode 100644
index 0e15708..0000000
--- a/old/libsl1550/libsecondlife/AppearanceManager.cs
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Text;
-using System.Collections.Generic;
-using System.Threading;
-using System.IO;
-using libsecondlife;
-using libsecondlife.Packets;
-using libsecondlife.Baking;
-
-namespace libsecondlife
-{
-    public class InvalidOutfitException : Exception
-    {
-        public InvalidOutfitException(string message) : base(message) { }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class AppearanceManager
-    {
-        /// <summary>
-        ///
-        /// </summary>
-        public enum TextureIndex
-        {
-            Unknown = -1,
-            HeadBodypaint = 0,
-            UpperShirt,
-            LowerPants,
-            EyesIris,
-            Hair,
-            UpperBodypaint,
-            LowerBodypaint,
-            LowerShoes,
-            HeadBaked,
-            UpperBaked,
-            LowerBaked,
-            EyesBaked,
-            LowerSocks,
-            UpperJacket,
-            LowerJacket,
-            UpperGloves,
-            UpperUndershirt,
-            LowerUnderpants,
-            Skirt,
-            SkirtBaked
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum BakeType
-        {
-            Unknown = -1,
-            Head = 0,
-            UpperBody = 1,
-            LowerBody = 2,
-            Eyes = 3,
-            Skirt = 4
-        }
-
-        public class WearableData
-        {
-            public InventoryWearable Item;
-            public AssetWearable Asset;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="wearables">A mapping of WearableTypes to KeyValuePairs
-        /// with Asset ID of the wearable as key and Item ID as value</param>
-        public delegate void AgentWearablesCallback(Dictionary<WearableType, KeyValuePair<LLUUID, LLUUID>> wearables);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="textures">List of the textures our avatar is currently wearing</param>
-        public delegate void AppearanceUpdatedCallback(LLObject.TextureEntry te);
-
-        /// <summary></summary>
-        public event AgentWearablesCallback OnAgentWearables;
-        /// <summary></summary>
-        public event AppearanceUpdatedCallback OnAppearanceUpdated;
-
-        /// <summary>Total number of wearables for each avatar</summary>
-        public const int WEARABLE_COUNT = 13;
-        /// <summary></summary>
-        public const int BAKED_TEXTURE_COUNT = 5;
-        /// <summary></summary>
-        public const int WEARABLES_PER_LAYER = 7;
-        /// <summary></summary>
-        public const int AVATAR_TEXTURE_COUNT = 20;
-        /// <summary>Map of what wearables are included in each bake</summary>
-        public static readonly WearableType[][] WEARABLE_BAKE_MAP = new WearableType[][]
-        {
-            new WearableType[] { WearableType.Shape, WearableType.Skin,    WearableType.Hair,    WearableType.Invalid, WearableType.Invalid, WearableType.Invalid,    WearableType.Invalid    },
-            new WearableType[] { WearableType.Shape, WearableType.Skin,    WearableType.Shirt,   WearableType.Jacket,  WearableType.Gloves,  WearableType.Undershirt, WearableType.Invalid    },
-            new WearableType[] { WearableType.Shape, WearableType.Skin,    WearableType.Pants,   WearableType.Shoes,   WearableType.Socks,   WearableType.Jacket,     WearableType.Underpants },
-            new WearableType[] { WearableType.Eyes,  WearableType.Invalid, WearableType.Invalid, WearableType.Invalid, WearableType.Invalid, WearableType.Invalid,    WearableType.Invalid    },
-            new WearableType[] { WearableType.Skin,  WearableType.Invalid, WearableType.Invalid, WearableType.Invalid, WearableType.Invalid, WearableType.Invalid,    WearableType.Invalid    }
-        };
-        /// <summary>Secret values to finalize the cache check hashes for each
-        /// bake</summary>
-        public static readonly LLUUID[] BAKED_TEXTURE_HASH = new LLUUID[]
-        {
-            new LLUUID("18ded8d6-bcfc-e415-8539-944c0f5ea7a6"),
-	        new LLUUID("338c29e3-3024-4dbb-998d-7c04cf4fa88f"),
-	        new LLUUID("91b4a2c7-1b1a-ba16-9a16-1f8f8dcc1c3f"),
-	        new LLUUID("b2cf28af-b840-1071-3c6a-78085d8128b5"),
-	        new LLUUID("ea800387-ea1a-14e0-56cb-24f2022f969a")
-        };
-        /// <summary>Default avatar texture, used to detect when a custom
-        /// texture is not set for a face</summary>
-        public static readonly LLUUID DEFAULT_AVATAR_TEXTURE = new LLUUID("c228d1cf-4b5d-4ba8-84f4-899a0796aa97");
-
-
-        private SecondLife Client;
-        private AssetManager Assets;
-        private Dictionary<WearableType, WearableData> Wearables = new Dictionary<WearableType, WearableData>();
-        // As wearable assets are downloaded and decoded, the textures are added to this array
-        private LLUUID[] AgentTextures = new LLUUID[AVATAR_TEXTURE_COUNT];
-
-        protected struct PendingAssetDownload
-        {
-            public LLUUID Id;
-            public AssetType Type;
-
-            public PendingAssetDownload(LLUUID id, AssetType type)
-            {
-                Id = id;
-                Type = type;
-            }
-        }
-
-        // Wearable assets are downloaded one at a time, a new request is pulled off the queue
-        // and started when the previous one completes
-        private Queue<PendingAssetDownload> AssetDownloads = new Queue<PendingAssetDownload>();
-        // A list of all the images we are currently downloading, prior to baking
-        private Dictionary<LLUUID, TextureIndex> ImageDownloads = new Dictionary<LLUUID, TextureIndex>();
-        // A list of all the bakes we need to complete
-        private Dictionary<BakeType, Baker> PendingBakes = new Dictionary<BakeType, Baker>(BAKED_TEXTURE_COUNT);
-        // A list of all the uploads that are in progress
-        private Dictionary<LLUUID, TextureIndex> PendingUploads = new Dictionary<LLUUID, TextureIndex>(BAKED_TEXTURE_COUNT);
-        // Whether the handler for our current wearable list should automatically start downloading the assets
-        //private bool DownloadWearables = false;
-        private static int CacheCheckSerialNum = 1; //FIXME
-        private static uint SetAppearanceSerialNum = 1; //FIXME
-        private AutoResetEvent WearablesRequestEvent = new AutoResetEvent(false);
-        private AutoResetEvent WearablesDownloadedEvent = new AutoResetEvent(false);
-        private AutoResetEvent CachedResponseEvent = new AutoResetEvent(false);
-        private AutoResetEvent UpdateEvent = new AutoResetEvent(false);
-        // FIXME: Create a class-level appearance thread so multiple threads can't be launched
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client"></param>
-        /// <param name="assets"></param>
-        public AppearanceManager(SecondLife client, AssetManager assets)
-        {
-            Client = client;
-            Assets = assets;
-
-            // Initialize AgentTextures to zero UUIDs
-            for (int i = 0; i < AgentTextures.Length; i++)
-                AgentTextures[i] = LLUUID.Zero;
-
-            Client.Network.RegisterCallback(PacketType.AgentWearablesUpdate, new NetworkManager.PacketCallback(AgentWearablesUpdateHandler));
-            Client.Network.RegisterCallback(PacketType.AgentCachedTextureResponse, new NetworkManager.PacketCallback(AgentCachedTextureResponseHandler));
-            Client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
-        }
-
-        private static AssetType WearableTypeToAssetType(WearableType type)
-        {
-            switch (type)
-            {
-                case WearableType.Shape:
-                case WearableType.Skin:
-                case WearableType.Hair:
-                case WearableType.Eyes:
-                    return AssetType.Bodypart;
-                case WearableType.Shirt:
-                case WearableType.Pants:
-                case WearableType.Shoes:
-                case WearableType.Socks:
-                case WearableType.Jacket:
-                case WearableType.Gloves:
-                case WearableType.Undershirt:
-                case WearableType.Underpants:
-                case WearableType.Skirt:
-                    return AssetType.Clothing;
-                default:
-                    throw new Exception("Unhandled wearable type " + type);
-            }
-        }
-
-        /// <summary>
-        /// Returns the assetID for a given WearableType
-        /// </summary>
-        /// <param name="type"></param>
-        /// <returns></returns>
-        public LLUUID GetWearableAsset(WearableType type)
-        {
-            WearableData wearable;
-
-            if (Wearables.TryGetValue(type, out wearable))
-                return wearable.Item.AssetUUID;
-            else
-                return LLUUID.Zero;
-        }
-
-        /// <summary>
-        /// Ask the server what we are wearing and set appearance based on that
-        /// </summary>
-        public void SetPreviousAppearance()
-        {
-            SetPreviousAppearance(true);
-        }
-
-        public void SetPreviousAppearance(bool bake)
-        {
-            _bake = bake;
-            Thread appearanceThread = new Thread(new ThreadStart(StartSetPreviousAppearance));
-            appearanceThread.Start();
-        }
-
-        private bool _bake;
-        private void StartSetPreviousAppearance()
-        {
-            SendAgentWearablesRequest();
-            WearablesRequestEvent.WaitOne();
-            UpdateAppearanceFromWearables(_bake);
-        }
-
-        private class WearParams
-        {
-            public object Param;
-            public bool Bake;
-
-            public WearParams(object param, bool bake)
-            {
-                Param = param;
-                Bake = bake;
-            }
-        }
-
-        /// <summary>
-        /// Replace the current outfit with a list of wearables and set appearance
-        /// </summary>
-        /// <param name="ibs">List of wearables that define the new outfit</param>
-        public void WearOutfit(List<InventoryBase> ibs)
-        {
-            WearOutfit(ibs, true);
-        }
-
-        /// <summary>
-        /// Replace the current outfit with a list of wearables and set appearance
-        /// </summary>
-        /// <param name="ibs">List of wearables that define the new outfit</param>
-        /// <param name="bake">Whether to bake textures for the avatar or not</param>
-        public void WearOutfit(List<InventoryBase> ibs, bool bake)
-        {
-            _wearParams = new WearParams(ibs, bake);
-            Thread appearanceThread = new Thread(new ThreadStart(StartWearOutfit));
-            appearanceThread.Start();
-        }
-
-        private WearParams _wearParams;
-        private void StartWearOutfit()
-        {
-            List<InventoryBase> ibs = (List<InventoryBase>)_wearParams.Param;
-            List<InventoryWearable> wearables = new List<InventoryWearable>();
-            List<InventoryBase> attachments = new List<InventoryBase>();
-
-            foreach (InventoryBase ib in ibs)
-            {
-                if (ib is InventoryWearable)
-                    wearables.Add((InventoryWearable)ib);
-                else if (ib is InventoryAttachment || ib is InventoryObject)
-                    attachments.Add(ib);
-            }
-
-            SendAgentWearablesRequest();
-            WearablesRequestEvent.WaitOne();
-            ReplaceOutfitWearables(wearables);
-            UpdateAppearanceFromWearables(_wearParams.Bake);
-            AddAttachments(attachments, true);
-        }
-
-        /// <summary>
-        /// Replace the current outfit with a folder and set appearance
-        /// </summary>
-        /// <param name="folder">UUID of the inventory folder to wear</param>
-        public void WearOutfit(LLUUID folder)
-        {
-            WearOutfit(folder, true);
-        }
-
-        /// <summary>
-        /// Replace the current outfit with a folder and set appearance
-        /// </summary>
-        /// <param name="path">Inventory path of the folder to wear</param>
-        public void WearOutfit(string[] path)
-        {
-            WearOutfit(path, true);
-        }
-
-        /// <summary>
-        /// Replace the current outfit with a folder and set appearance
-        /// </summary>
-        /// <param name="folder">Folder containing the new outfit</param>
-        /// <param name="bake">Whether to bake the avatar textures or not</param>
-        public void WearOutfit(LLUUID folder, bool bake)
-        {
-            _wearOutfitParams = new WearParams(folder, bake);
-            Thread appearanceThread = new Thread(new ThreadStart(StartWearOutfitFolder));
-            appearanceThread.Start();
-        }
-
-        /// <summary>
-        /// Replace the current outfit with a folder and set appearance
-        /// </summary>
-        /// <param name="path">Path of folder containing the new outfit</param>
-        /// <param name="bake">Whether to bake the avatar textures or not</param>
-        public void WearOutfit(string[] path, bool bake)
-        {
-            _wearOutfitParams = new WearParams(path, bake);
-            Thread appearanceThread = new Thread(new ThreadStart(StartWearOutfitFolder));
-            appearanceThread.Start();
-        }
-
-        private WearParams _wearOutfitParams;
-        private void StartWearOutfitFolder()
-        {
-            SendAgentWearablesRequest(); // request current wearables async
-            List<InventoryWearable> wearables;
-            List<InventoryBase> attachments;
-
-            if (!GetFolderWearables(_wearOutfitParams.Param, out wearables, out attachments)) // get wearables in outfit folder
-                return; // TODO: this error condition should be passed back to the client somehow
-
-            WearablesRequestEvent.WaitOne(); // wait for current wearables
-            ReplaceOutfitWearables(wearables); // replace current wearables with outfit folder
-            UpdateAppearanceFromWearables(_wearOutfitParams.Bake);
-            AddAttachments(attachments, true);
-        }
-
-        private bool GetFolderWearables(object _folder, out List<InventoryWearable> wearables, out List<InventoryBase> attachments)
-        {
-            LLUUID folder;
-            wearables = null;
-            attachments = null;
-
-            if (_folder.GetType() == typeof(string[]))
-            {
-                string[] path = (string[])_folder;
-
-                folder = Client.Inventory.FindObjectByPath(
-                    Client.Inventory.Store.RootFolder.UUID, Client.Self.AgentID, String.Join("/", path), 1000 * 20);
-
-                if (folder == LLUUID.Zero)
-                {
-                    Client.Log("Outfit path " + path + " not found", Helpers.LogLevel.Error);
-                    return false;
-                }
-            }
-            else
-                folder = (LLUUID)_folder;
-
-            wearables = new List<InventoryWearable>();
-            attachments = new List<InventoryBase>();
-            List<InventoryBase> objects = Client.Inventory.FolderContents(folder, Client.Self.AgentID,
-                false, true, InventorySortOrder.ByName, 1000 * 20);
-
-            if (objects != null)
-            {
-                foreach (InventoryBase ib in objects)
-                {
-                    if (ib is InventoryWearable)
-                    {
-                        Client.DebugLog("Adding wearable " + ib.Name);
-                        wearables.Add((InventoryWearable)ib);
-                    }
-                    else if (ib is InventoryAttachment)
-                    {
-                        Client.DebugLog("Adding attachment (attachment) " + ib.Name);
-                        attachments.Add(ib);
-                    }
-                    else if (ib is InventoryObject)
-                    {
-                        Client.DebugLog("Adding attachment (object) " + ib.Name);
-                        attachments.Add(ib);
-                    }
-                    else
-                    {
-                        Client.DebugLog("Ignoring inventory item " + ib.Name);
-                    }
-                }
-            }
-            else
-            {
-                Client.Log("Failed to download folder contents of + " + folder.ToString(),
-                    Helpers.LogLevel.Error);
-                return false;
-            }
-
-            return true;
-        }
-
-        // this method will download the assets for all inventory items in iws
-        private void ReplaceOutfitWearables(List<InventoryWearable> iws)
-        {
-            lock (Wearables)
-            {
-                Dictionary<WearableType, WearableData> preserve = new Dictionary<WearableType,WearableData>();
-
-                foreach (KeyValuePair<WearableType,WearableData> kvp in Wearables)
-                {
-                    if (kvp.Value.Item.AssetType == AssetType.Bodypart)
-                        preserve.Add(kvp.Key,kvp.Value);
-                }
-
-                Wearables = preserve;
-
-                foreach (InventoryWearable iw in iws)
-                {
-                    WearableData wd = new WearableData();
-                    wd.Item = iw;
-                    Wearables[wd.Item.WearableType] = wd;
-                }
-            }
-        }
-
-        public void AddAttachments(List<InventoryBase> attachments, bool removeExistingFirst)
-        {
-            // FIXME: Obey this
-            const int OBJECTS_PER_PACKET = 4;
-
-            // Use RezMultipleAttachmentsFromInv  to clear out current attachments, and attach new ones
-            RezMultipleAttachmentsFromInvPacket attachmentsPacket = new RezMultipleAttachmentsFromInvPacket();
-            attachmentsPacket.AgentData.AgentID = Client.Self.AgentID;
-            attachmentsPacket.AgentData.SessionID = Client.Self.SessionID;
-
-            attachmentsPacket.HeaderData.CompoundMsgID = LLUUID.Random();
-            attachmentsPacket.HeaderData.FirstDetachAll = true;
-            attachmentsPacket.HeaderData.TotalObjects = (byte)attachments.Count;
-
-            attachmentsPacket.ObjectData = new RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[attachments.Count];
-            for (int i = 0; i < attachments.Count; i++)
-            {
-                if (attachments[i] is InventoryAttachment)
-                {
-                    InventoryAttachment attachment = (InventoryAttachment)attachments[i];
-
-                    attachmentsPacket.ObjectData[i] = new RezMultipleAttachmentsFromInvPacket.ObjectDataBlock();
-                    attachmentsPacket.ObjectData[i].AttachmentPt = 0;
-                    attachmentsPacket.ObjectData[i].EveryoneMask = (uint)attachment.Permissions.EveryoneMask;
-                    attachmentsPacket.ObjectData[i].GroupMask = (uint)attachment.Permissions.GroupMask;
-                    attachmentsPacket.ObjectData[i].ItemFlags = attachment.Flags;
-                    attachmentsPacket.ObjectData[i].ItemID = attachment.UUID;
-                    attachmentsPacket.ObjectData[i].Name = Helpers.StringToField(attachment.Name);
-                    attachmentsPacket.ObjectData[i].Description = Helpers.StringToField(attachment.Description);
-                    attachmentsPacket.ObjectData[i].NextOwnerMask = (uint)attachment.Permissions.NextOwnerMask;
-                    attachmentsPacket.ObjectData[i].OwnerID = attachment.OwnerID;
-                }
-                else if (attachments[i] is InventoryObject)
-                {
-                    InventoryObject attachment = (InventoryObject)attachments[i];
-
-                    attachmentsPacket.ObjectData[i] = new RezMultipleAttachmentsFromInvPacket.ObjectDataBlock();
-                    attachmentsPacket.ObjectData[i].AttachmentPt = 0;
-                    attachmentsPacket.ObjectData[i].EveryoneMask = (uint)attachment.Permissions.EveryoneMask;
-                    attachmentsPacket.ObjectData[i].GroupMask = (uint)attachment.Permissions.GroupMask;
-                    attachmentsPacket.ObjectData[i].ItemFlags = attachment.Flags;
-                    attachmentsPacket.ObjectData[i].ItemID = attachment.UUID;
-                    attachmentsPacket.ObjectData[i].Name = Helpers.StringToField(attachment.Name);
-                    attachmentsPacket.ObjectData[i].Description = Helpers.StringToField(attachment.Description);
-                    attachmentsPacket.ObjectData[i].NextOwnerMask = (uint)attachment.Permissions.NextOwnerMask;
-                    attachmentsPacket.ObjectData[i].OwnerID = attachment.OwnerID;
-                }
-                else
-                {
-                    Client.Log("Cannot attach inventory item of type " + attachments[i].GetType().ToString(),
-                        Helpers.LogLevel.Warning);
-                }
-            }
-
-            Client.Network.SendPacket(attachmentsPacket);
-        }
-
-        public void Attach(InventoryItem item, AttachmentPoint attachPoint)
-        {
-            Attach(item.UUID, item.OwnerID, item.Name, item.Description, item.Permissions, item.Flags,
-                attachPoint);
-        }
-
-        public void Attach(LLUUID itemID, LLUUID ownerID, string name, string description,
-            Permissions perms, uint itemFlags, AttachmentPoint attachPoint)
-        {
-            // TODO: At some point it might be beneficial to have AppearanceManager track what we
-            // are currently wearing for attachments to make enumeration and detachment easier
-
-            RezSingleAttachmentFromInvPacket attach = new RezSingleAttachmentFromInvPacket();
-
-            attach.AgentData.AgentID = Client.Self.AgentID;
-            attach.AgentData.SessionID = Client.Self.SessionID;
-
-            attach.ObjectData.AttachmentPt = (byte)attachPoint;
-            attach.ObjectData.Description = Helpers.StringToField(description);
-            attach.ObjectData.EveryoneMask = (uint)perms.EveryoneMask;
-            attach.ObjectData.GroupMask = (uint)perms.GroupMask;
-            attach.ObjectData.ItemFlags = itemFlags;
-            attach.ObjectData.ItemID = itemID;
-            attach.ObjectData.Name = Helpers.StringToField(name);
-            attach.ObjectData.NextOwnerMask = (uint)perms.NextOwnerMask;
-            attach.ObjectData.OwnerID = ownerID;
-
-            Client.Network.SendPacket(attach);
-        }
-
-        public void Detach(InventoryItem item)
-        {
-            Detach(item.UUID);
-        }
-
-        public void Detach(LLUUID itemID)
-        {
-            DetachAttachmentIntoInvPacket detach = new DetachAttachmentIntoInvPacket();
-            detach.ObjectData.AgentID = Client.Self.AgentID;
-            detach.ObjectData.ItemID = itemID;
-
-            Client.Network.SendPacket(detach);
-        }
-
-        private void UpdateAppearanceFromWearables(bool bake)
-        {
-            lock (AgentTextures)
-            {
-                for (int i = 0; i < AgentTextures.Length; i++)
-                    AgentTextures[i] = LLUUID.Zero;
-            }
-
-            // Register an asset download callback to get wearable data
-            AssetManager.AssetReceivedCallback assetCallback = new AssetManager.AssetReceivedCallback(Assets_OnAssetReceived);
-            AssetManager.ImageReceivedCallback imageCallback = new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
-            AssetManager.AssetUploadedCallback uploadCallback = new AssetManager.AssetUploadedCallback(Assets_OnAssetUploaded);
-            Assets.OnAssetReceived += assetCallback;
-            Assets.OnImageReceived += imageCallback;
-            Assets.OnAssetUploaded += uploadCallback;
-
-            // Download assets for what we are wearing and fill in AgentTextures
-            DownloadWearableAssets();
-            WearablesDownloadedEvent.WaitOne();
-
-            // Unregister the asset download callback
-            Assets.OnAssetReceived -= assetCallback;
-
-            // Check if anything needs to be rebaked
-            if (bake) RequestCachedBakes();
-
-            // Tell the sim what we are wearing
-            SendAgentIsNowWearing();
-
-            // Wait for cached layer check to finish
-            if (bake) CachedResponseEvent.WaitOne();
-
-            // Unregister the image download and asset upload callbacks
-            Assets.OnImageReceived -= imageCallback;
-            Assets.OnAssetUploaded -= uploadCallback;
-
-            Client.DebugLog("CachedResponseEvent completed");
-
-            #region Send Appearance
-
-            LLObject.TextureEntry te = null;
-
-            ObjectManager.NewAvatarCallback updateCallback =
-                delegate(Simulator simulator, Avatar avatar, ulong regionHandle, ushort timeDilation)
-                {
-                    if (avatar.LocalID == Client.Self.LocalID)
-                    {
-                        if (avatar.Textures.FaceTextures != null)
-                        {
-                            bool match = true;
-
-                            for (uint i = 0; i < AgentTextures.Length; i++)
-                            {
-                                LLObject.TextureEntryFace face = avatar.Textures.FaceTextures[i];
-
-                                if (face == null)
-                                {
-                                    // If the texture is LLUUID.Zero the face should be null
-                                    if (AgentTextures[i] != LLUUID.Zero)
-                                    {
-                                        match = false;
-                                        break;
-                                    }
-                                }
-                                else if (face.TextureID != AgentTextures[i])
-                                {
-                                    match = false;
-                                    break;
-                                }
-                            }
-
-                            if (!match)
-                                Client.Log("TextureEntry mismatch after updating our appearance", Helpers.LogLevel.Warning);
-
-                            te = avatar.Textures;
-                            UpdateEvent.Set();
-                        }
-                        else
-                        {
-                            Client.Log("Received an update for our avatar with a null FaceTextures array",
-                                Helpers.LogLevel.Warning);
-                        }
-                    }
-                };
-            Client.Objects.OnNewAvatar += updateCallback;
-
-            // Send all of the visual params and textures for our agent
-            SendAgentSetAppearance();
-
-            // Wait for the ObjectUpdate to come in for our avatar after changing appearance
-            if (UpdateEvent.WaitOne(1000 * 60, false))
-            {
-                if (OnAppearanceUpdated != null)
-                {
-                    try { OnAppearanceUpdated(te); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-            else
-            {
-                Client.Log("Timed out waiting for our appearance to update on the simulator", Helpers.LogLevel.Warning);
-            }
-
-            Client.Objects.OnNewAvatar -= updateCallback;
-
-            #endregion Send Appearance
-        }
-
-        /// <summary>
-        /// Build hashes out of the texture assetIDs for each baking layer to
-        /// ask the simulator whether it has cached copies of each baked texture
-        /// </summary>
-        public void RequestCachedBakes()
-        {
-            Client.DebugLog("RequestCachedBakes()");
-
-            List<KeyValuePair<int, LLUUID>> hashes = new List<KeyValuePair<int,LLUUID>>();
-
-            AgentCachedTexturePacket cache = new AgentCachedTexturePacket();
-            cache.AgentData.AgentID = Client.Self.AgentID;
-            cache.AgentData.SessionID = Client.Self.SessionID;
-            cache.AgentData.SerialNum = CacheCheckSerialNum;
-
-            // Build hashes for each of the bake layers from the individual components
-            for (int bakedIndex = 0; bakedIndex < BAKED_TEXTURE_COUNT; bakedIndex++)
-            {
-                // Don't do a cache request for a skirt bake if we're not wearing a skirt
-                if (bakedIndex == (int)BakeType.Skirt &&
-                    (!Wearables.ContainsKey(WearableType.Skirt) || Wearables[WearableType.Skirt].Asset.AssetID == LLUUID.Zero))
-                    continue;
-
-                LLUUID hash = new LLUUID();
-
-                for (int wearableIndex = 0; wearableIndex < WEARABLES_PER_LAYER; wearableIndex++)
-                {
-                    WearableType type = WEARABLE_BAKE_MAP[bakedIndex][wearableIndex];
-                    LLUUID assetID = GetWearableAsset(type);
-
-                    // Build a hash of all the texture asset IDs in this baking layer
-                    if (assetID != null) hash ^= assetID;
-                }
-
-                if (hash != LLUUID.Zero)
-                {
-                    // Hash with our secret value for this baked layer
-                    hash ^= BAKED_TEXTURE_HASH[bakedIndex];
-
-                    // Add this to the list of hashes to send out
-                    hashes.Add(new KeyValuePair<int, LLUUID>(bakedIndex, hash));
-                }
-            }
-
-            // Only send the packet out if there's something to check
-            if (hashes.Count > 0)
-            {
-                cache.WearableData = new AgentCachedTexturePacket.WearableDataBlock[hashes.Count];
-
-                for (int i = 0; i < hashes.Count; i++)
-                {
-                    cache.WearableData[i] = new AgentCachedTexturePacket.WearableDataBlock();
-                    cache.WearableData[i].TextureIndex = (byte)hashes[i].Key;
-                    cache.WearableData[i].ID = hashes[i].Value;
-
-                    Client.DebugLog("Checking cache for index " + cache.WearableData[i].TextureIndex +
-                        ", ID: " + cache.WearableData[i].ID);
-                }
-
-                // Increment our serial number for this packet
-                CacheCheckSerialNum++;
-
-                // Send it out
-                Client.Network.SendPacket(cache);
-            }
-        }
-
-        /// <summary>
-        /// Ask the server what textures our avatar is currently wearing
-        /// </summary>
-        public void SendAgentWearablesRequest()
-        {
-            AgentWearablesRequestPacket request = new AgentWearablesRequestPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-
-            Client.Network.SendPacket(request);
-        }
-
-        private void AgentWearablesUpdateHandler(Packet packet, Simulator simulator)
-        {
-            // Lock to prevent a race condition with multiple AgentWearables packets
-            lock (WearablesRequestEvent)
-            {
-                AgentWearablesUpdatePacket update = (AgentWearablesUpdatePacket)packet;
-
-                // Reset the Wearables collection
-                lock (Wearables) Wearables.Clear();
-
-                for (int i = 0; i < update.WearableData.Length; i++)
-                {
-                    if (update.WearableData[i].AssetID != LLUUID.Zero)
-                    {
-                        WearableType type = (WearableType)update.WearableData[i].WearableType;
-                        WearableData data = new WearableData();
-                        data.Item = new InventoryWearable(update.WearableData[i].ItemID);
-                        data.Item.WearableType = type;
-                        data.Item.AssetType = WearableTypeToAssetType(type);
-                        data.Item.AssetUUID = update.WearableData[i].AssetID;
-
-                        // Add this wearable to our collection
-                        lock (Wearables) Wearables[type] = data;
-                    }
-                }
-            }
-
-            WearablesRequestEvent.Set();
-        }
-
-        private void SendAgentSetAppearance()
-        {
-            AgentSetAppearancePacket set = new AgentSetAppearancePacket();
-            set.AgentData.AgentID = Client.Self.AgentID;
-            set.AgentData.SessionID = Client.Self.SessionID;
-            set.AgentData.SerialNum = SetAppearanceSerialNum++;
-            set.VisualParam = new AgentSetAppearancePacket.VisualParamBlock[VisualParams.Params.Count];
-
-            lock (Wearables)
-            {
-                // Only for debugging output
-                int count = 0, vpIndex = 0;
-
-                // Build the visual param array
-                foreach (KeyValuePair<int,VisualParam> kvp in VisualParams.Params)
-                {
-                    bool found = false;
-                    set.VisualParam[vpIndex] = new AgentSetAppearancePacket.VisualParamBlock();
-                    VisualParam vp = kvp.Value;
-
-                    // Try and find this value in our collection of downloaded wearables
-                    foreach (WearableData data in Wearables.Values)
-                    {
-                        if (data.Asset != null && data.Asset.Params.ContainsKey(vp.ParamID))
-                        {
-                            set.VisualParam[vpIndex].ParamValue = Helpers.FloatToByte(data.Asset.Params[vp.ParamID],
-                                vp.MinValue, vp.MaxValue);
-                            found = true;
-                            count++;
-                            break;
-                        }
-                    }
-
-                    // Use a default value if we don't have one set for it
-                    if (!found)
-                    {
-                        set.VisualParam[vpIndex].ParamValue = Helpers.FloatToByte(vp.DefaultValue,
-                            vp.MinValue, vp.MaxValue);
-                    }
-
-                    vpIndex++;
-                }
-
-                Client.DebugLog("AgentSetAppearance contains " + count + " VisualParams");
-
-                // Build the texture entry for our agent
-                LLObject.TextureEntry te = new LLObject.TextureEntry(DEFAULT_AVATAR_TEXTURE);
-
-                // Put our AgentTextures array in to TextureEntry
-                lock (AgentTextures)
-                {
-                    for (uint i = 0; i < AgentTextures.Length; i++)
-                    {
-                        if (AgentTextures[i] != LLUUID.Zero)
-                        {
-                            LLObject.TextureEntryFace face = te.CreateFace(i);
-                            face.TextureID = AgentTextures[i];
-                        }
-                    }
-                }
-
-                foreach (WearableData data in Wearables.Values)
-                {
-                    if (data.Asset != null)
-                    {
-                        foreach (KeyValuePair<TextureIndex, LLUUID> texture in data.Asset.Textures)
-                        {
-                            LLObject.TextureEntryFace face = te.CreateFace((uint)texture.Key);
-                            face.TextureID = texture.Value;
-
-                            Client.DebugLog("Setting texture " + ((TextureIndex)texture.Key).ToString() + " to " +
-                                texture.Value.ToString());
-                        }
-                    }
-                }
-
-                // Set the packet TextureEntry
-                set.ObjectData.TextureEntry = te.ToBytes();
-            }
-
-            // FIXME: Our hackish algorithm is making squished avatars. See
-            // http://www.libsecondlife.org/wiki/Agent_Size for discussion of the correct algorithm
-            float height = Helpers.ByteToFloat(set.VisualParam[33].ParamValue, VisualParams.Params[33].MinValue,
-                VisualParams.Params[33].MaxValue);
-            set.AgentData.Size = new LLVector3(0.45f, 0.6f, 1.50856f + ((height / 255.0f) * (2.025506f - 1.50856f)));
-
-            // TODO: Account for not having all the textures baked yet
-            set.WearableData = new AgentSetAppearancePacket.WearableDataBlock[BAKED_TEXTURE_COUNT];
-
-            // Build hashes for each of the bake layers from the individual components
-            for (int bakedIndex = 0; bakedIndex < BAKED_TEXTURE_COUNT; bakedIndex++)
-            {
-                LLUUID hash = new LLUUID();
-
-                for (int wearableIndex = 0; wearableIndex < WEARABLES_PER_LAYER; wearableIndex++)
-                {
-                    WearableType type = WEARABLE_BAKE_MAP[bakedIndex][wearableIndex];
-                    LLUUID assetID = GetWearableAsset(type);
-
-                    // Build a hash of all the texture asset IDs in this baking layer
-                    if (assetID != LLUUID.Zero) hash ^= assetID;
-                }
-
-                if (hash != LLUUID.Zero)
-                {
-                    // Hash with our secret value for this baked layer
-                    hash ^= BAKED_TEXTURE_HASH[bakedIndex];
-                }
-
-                // Tell the server what cached texture assetID to use for each bake layer
-                set.WearableData[bakedIndex] = new AgentSetAppearancePacket.WearableDataBlock();
-                set.WearableData[bakedIndex].TextureIndex = (byte)bakedIndex;
-                set.WearableData[bakedIndex].CacheID = hash;
-            }
-
-            // Finally, send the packet
-            Client.Network.SendPacket(set);
-        }
-
-        private void SendAgentIsNowWearing()
-        {
-            Client.DebugLog("SendAgentIsNowWearing()");
-
-            AgentIsNowWearingPacket wearing = new AgentIsNowWearingPacket();
-            wearing.AgentData.AgentID = Client.Self.AgentID;
-            wearing.AgentData.SessionID = Client.Self.SessionID;
-            wearing.WearableData = new AgentIsNowWearingPacket.WearableDataBlock[WEARABLE_COUNT];
-
-            for (int i = 0; i < WEARABLE_COUNT; i++)
-            {
-                WearableType type = (WearableType)i;
-                wearing.WearableData[i] = new AgentIsNowWearingPacket.WearableDataBlock();
-                wearing.WearableData[i].WearableType = (byte)i;
-
-                if (Wearables.ContainsKey(type))
-                    wearing.WearableData[i].ItemID = Wearables[type].Item.UUID;
-                else
-                    wearing.WearableData[i].ItemID = LLUUID.Zero;
-            }
-
-            Client.Network.SendPacket(wearing);
-        }
-
-        private TextureIndex BakeTypeToAgentTextureIndex(BakeType index)
-        {
-            switch (index)
-            {
-                case BakeType.Head:
-                    return TextureIndex.HeadBaked;
-                case BakeType.UpperBody:
-                    return TextureIndex.UpperBaked;
-                case BakeType.LowerBody:
-                    return TextureIndex.LowerBaked;
-                case BakeType.Eyes:
-                    return TextureIndex.EyesBaked;
-                case BakeType.Skirt:
-                    return TextureIndex.SkirtBaked;
-                default:
-                    return TextureIndex.Unknown;
-            }
-        }
-
-        private void DownloadWearableAssets()
-        {
-            foreach (KeyValuePair<WearableType, WearableData> kvp in Wearables)
-            {
-                Client.DebugLog("Requesting asset for wearable item" + kvp.Value.Item.Name + " (" + kvp.Value.Item.AssetUUID + ")");
-                AssetDownloads.Enqueue(new PendingAssetDownload(kvp.Value.Item.AssetUUID, kvp.Value.Item.AssetType));
-            }
-
-            if (AssetDownloads.Count > 0)
-            {
-                PendingAssetDownload pad = AssetDownloads.Dequeue();
-                Assets.RequestAsset(pad.Id, pad.Type, true);
-            }
-        }
-
-        private void CallOnAgentWearables()
-        {
-            if (OnAgentWearables != null)
-            {
-                // Refactor our internal Wearables dictionary in to something for the callback
-                Dictionary<WearableType, KeyValuePair<LLUUID, LLUUID>> wearables =
-                    new Dictionary<WearableType, KeyValuePair<LLUUID, LLUUID>>();
-
-                lock (Wearables)
-                {
-                    foreach (KeyValuePair<WearableType, WearableData> data in Wearables)
-                        wearables.Add(data.Key, new KeyValuePair<LLUUID, LLUUID>(data.Value.Item.AssetUUID, data.Value.Item.UUID));
-                }
-
-                try { OnAgentWearables(wearables); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void UploadBake(Baker bake)
-        {
-            // Upload the completed layer data
-            LLUUID transactionID = Assets.RequestUpload(bake.BakedTexture, true, true, false);
-
-            Client.DebugLog(String.Format("Bake {0} completed. Uploading asset {1}", bake.BakeType,
-                bake.BakedTexture.AssetID.ToString()));
-
-            // Add it to a pending uploads list
-            lock (PendingUploads) PendingUploads.Add(bake.BakedTexture.AssetID, BakeTypeToAgentTextureIndex(bake.BakeType));
-        }
-
-        private int AddImageDownload(TextureIndex index)
-        {
-            LLUUID image = AgentTextures[(int)index];
-
-            if (image != LLUUID.Zero)
-            {
-                if (!ImageDownloads.ContainsKey(image))
-                {
-                    Client.DebugLog("Downloading layer " + index.ToString());
-                    ImageDownloads.Add(image, index);
-                }
-
-                return 1;
-            }
-
-            return 0;
-        }
-
-        #region Callbacks
-
-        private void AgentCachedTextureResponseHandler(Packet packet, Simulator simulator)
-        {
-            Client.DebugLog("AgentCachedTextureResponseHandler()");
-
-            AgentCachedTextureResponsePacket response = (AgentCachedTextureResponsePacket)packet;
-            Dictionary<int, float> paramValues = new Dictionary<int, float>(VisualParams.Params.Count);
-
-            // Build a dictionary of appearance parameter indices and values from the wearables
-            foreach (KeyValuePair<int,VisualParam> kvp in VisualParams.Params)
-            {
-                bool found = false;
-                VisualParam vp = kvp.Value;
-
-                // Try and find this value in our collection of downloaded wearables
-                foreach (WearableData data in Wearables.Values)
-                {
-                    if (data.Asset.Params.ContainsKey(vp.ParamID))
-                    {
-                        paramValues.Add(vp.ParamID,data.Asset.Params[vp.ParamID]);
-                        found = true;
-                        break;
-                    }
-                }
-
-                // Use a default value if we don't have one set for it
-                if (!found) paramValues.Add(vp.ParamID, vp.DefaultValue);
-            }
-
-            lock (AgentTextures)
-            {
-                foreach (AgentCachedTextureResponsePacket.WearableDataBlock block in response.WearableData)
-                {
-                    // For each missing element we need to bake our own texture
-                    Client.DebugLog("Cache response, index: " + block.TextureIndex + ", ID: " +
-                        block.TextureID.ToString());
-
-                    // FIXME: Use this. Right now we treat baked images on other sims as if they were missing
-                    string host = Helpers.FieldToUTF8String(block.HostName);
-                    if (host.Length > 0) Client.DebugLog("Cached bake exists on foreign host " + host);
-
-                    BakeType bakeType = (BakeType)block.TextureIndex;
-
-                    // Convert the baked index to an AgentTexture index
-                    if (block.TextureID != LLUUID.Zero && host.Length == 0)
-                    {
-                        TextureIndex index = BakeTypeToAgentTextureIndex(bakeType);
-                        AgentTextures[(int)index] = block.TextureID;
-                    }
-                    else
-                    {
-                        int imageCount = 0;
-
-                        // Download all of the images in this layer
-                        switch (bakeType)
-                        {
-                            case BakeType.Head:
-                                lock (ImageDownloads)
-                                {
-                                    imageCount += AddImageDownload(TextureIndex.HeadBodypaint);
-                                    //imageCount += AddImageDownload(TextureIndex.Hair);
-                                }
-                                break;
-                            case BakeType.UpperBody:
-                                lock (ImageDownloads)
-                                {
-                                    imageCount += AddImageDownload(TextureIndex.UpperBodypaint);
-                                    imageCount += AddImageDownload(TextureIndex.UpperGloves);
-                                    imageCount += AddImageDownload(TextureIndex.UpperUndershirt);
-                                    imageCount += AddImageDownload(TextureIndex.UpperShirt);
-                                    imageCount += AddImageDownload(TextureIndex.UpperJacket);
-                                }
-                                break;
-                            case BakeType.LowerBody:
-                                lock (ImageDownloads)
-                                {
-                                    imageCount += AddImageDownload(TextureIndex.LowerBodypaint);
-                                    imageCount += AddImageDownload(TextureIndex.LowerUnderpants);
-                                    imageCount += AddImageDownload(TextureIndex.LowerSocks);
-                                    imageCount += AddImageDownload(TextureIndex.LowerShoes);
-                                    imageCount += AddImageDownload(TextureIndex.LowerPants);
-                                    imageCount += AddImageDownload(TextureIndex.LowerJacket);
-                                }
-                                break;
-                            case BakeType.Eyes:
-                                lock (ImageDownloads)
-                                {
-                                    imageCount += AddImageDownload(TextureIndex.EyesIris);
-                                }
-                                break;
-                            case BakeType.Skirt:
-                                if (Wearables.ContainsKey(WearableType.Skirt))
-                                {
-                                    lock (ImageDownloads)
-                                    {
-                                        imageCount += AddImageDownload(TextureIndex.Skirt);
-                                    }
-                                }
-                                break;
-                            default:
-                                Client.Log("Unknown BakeType " + block.TextureIndex, Helpers.LogLevel.Warning);
-                                break;
-                        }
-
-                        if (!PendingBakes.ContainsKey(bakeType))
-                        {
-                            Client.DebugLog("Initializing " + bakeType.ToString() + " bake with " + imageCount + " textures");
-
-                            if (imageCount == 0)
-                            {
-                                // if there are no textures to download, we can bake right away and start the upload
-                                Baker bake = new Baker(Client, bakeType, 0, paramValues);
-                                UploadBake(bake);
-                            }
-                            else
-                            {
-                                lock (PendingBakes)
-                                    PendingBakes.Add(bakeType, new Baker(Client, bakeType, imageCount, paramValues));
-                            }
-                        }
-                        else if (!PendingBakes.ContainsKey(bakeType))
-                        {
-                            Client.Log("No cached bake for " + bakeType.ToString() + " and no textures for that " +
-                                "layer, this is an unhandled case", Helpers.LogLevel.Error);
-                        }
-                    }
-                }
-            }
-
-            if (ImageDownloads.Count == 0)
-            {
-                // No pending downloads for baking, we're done
-                CachedResponseEvent.Set();
-            }
-            else
-            {
-                lock (ImageDownloads)
-                {
-                    foreach (LLUUID image in ImageDownloads.Keys)
-                    {
-                        // Download all the images we need for baking
-                        Assets.RequestImage(image, ImageType.Normal, 1013000.0f, 0);
-                    }
-                }
-            }
-        }
-
-        private void Assets_OnAssetReceived(AssetDownload download, Asset asset)
-        {
-            lock (Wearables)
-            {
-                // Check if this is a wearable we were waiting on
-                foreach (KeyValuePair<WearableType,WearableData> kvp in Wearables)
-                {
-                    if (kvp.Value.Item.AssetUUID == download.AssetID)
-                    {
-                        // Make sure the download succeeded
-                        if (download.Success)
-                        {
-                            kvp.Value.Asset = (AssetWearable)asset;
-
-                            Client.DebugLog("Downloaded wearable asset " + kvp.Value.Asset.Name);
-
-                            if (!kvp.Value.Asset.Decode())
-                            {
-                                Client.Log("Failed to decode asset:" + Environment.NewLine +
-                                    Helpers.FieldToUTF8String(asset.AssetData), Helpers.LogLevel.Error);
-                            }
-
-                            lock (AgentTextures)
-                            {
-                                foreach (KeyValuePair<AppearanceManager.TextureIndex, LLUUID> texture in kvp.Value.Asset.Textures)
-                                {
-                                    if (texture.Value != DEFAULT_AVATAR_TEXTURE) // this texture is not meant to be displayed
-                                    {
-                                        Client.DebugLog("Setting " + texture.Key + " to " + texture.Value);
-                                        AgentTextures[(int)texture.Key] = texture.Value;
-                                    }
-                                }
-                            }
-                        }
-                        else
-                        {
-                            Client.Log("Wearable " + kvp.Key + "(" + download.AssetID.ToString() + ") failed to download, " + download.Status.ToString(),Helpers.LogLevel.Warning);
-                        }
-
-                        break;
-                    }
-                }
-            }
-
-            if (AssetDownloads.Count > 0)
-            {
-                // Dowload the next wearable in line
-                PendingAssetDownload pad = AssetDownloads.Dequeue();
-                Assets.RequestAsset(pad.Id, pad.Type, true);
-            }
-            else
-            {
-                // Everything is downloaded
-                WearablesDownloadedEvent.Set();
-            }
-        }
-
-        private void Assets_OnImageReceived(ImageDownload image, AssetTexture assetTexture)
-        {
-            lock (ImageDownloads)
-            {
-                if (ImageDownloads.ContainsKey(image.ID))
-                {
-                    // NOTE: this image may occupy more than one TextureIndex! We must finish this loop
-                    for (int at = 0; at < AgentTextures.Length; at++)
-                    {
-                        if (AgentTextures[at] == image.ID)
-                        {
-                            TextureIndex index = (TextureIndex)at;
-                            Client.DebugLog("Finished downloading texture for " + index.ToString());
-                            BakeType type = Baker.BakeTypeFor(index);
-
-                            //BinaryWriter writer = new BinaryWriter(File.Create("wearable_" + index.ToString() + "_" + image.ID.ToString() + ".jp2"));
-                            //writer.Write(image.AssetData);
-                            //writer.Close();
-
-                            bool baked = false;
-
-                            if (PendingBakes.ContainsKey(type))
-                            {
-                                if (image.Success)
-                                    baked = PendingBakes[type].AddTexture(index, assetTexture);
-                                else
-                                {
-                                    Client.Log("Texture for " + index.ToString() + " failed to download, " +
-                                        "bake will be incomplete", Helpers.LogLevel.Warning);
-
-                                    baked = PendingBakes[type].MissingTexture(index);
-                                }
-                            }
-
-                            if (baked)
-                            {
-                                UploadBake(PendingBakes[type]);
-                                PendingBakes.Remove(type);
-                            }
-
-                            ImageDownloads.Remove(image.ID);
-
-                            if (ImageDownloads.Count == 0 && PendingUploads.Count == 0)
-                            {
-                                // This is a failsafe catch, as the upload completed callback should normally
-                                // be triggering the event
-                                Client.DebugLog("No pending downloads or uploads detected in OnImageReceived");
-                                CachedResponseEvent.Set();
-                            }
-                            else
-                            {
-                                Client.DebugLog("Pending uploads: " + PendingUploads.Count + ", pending downloads: " +
-                                    ImageDownloads.Count);
-                            }
-
-                        }
-                    }
-                }
-                else
-                    Client.Log("Received an image download callback for an image we did not request " + image.ID.ToString(), Helpers.LogLevel.Warning);
-            }
-        }
-
-        private void Assets_OnAssetUploaded(AssetUpload upload)
-        {
-            lock (PendingUploads)
-            {
-                if (PendingUploads.ContainsKey(upload.AssetID))
-                {
-                    if (upload.Success)
-                    {
-                        // Setup the TextureEntry with the new baked upload
-                        TextureIndex index = PendingUploads[upload.AssetID];
-                        AgentTextures[(int)index] = upload.AssetID;
-
-                        Client.DebugLog("Upload complete, AgentTextures " + index.ToString() + " set to " +
-                            upload.AssetID.ToString());
-                    }
-                    else
-                    {
-                        Client.Log("Asset upload " + upload.AssetID.ToString() + " failed",
-                            Helpers.LogLevel.Warning);
-                    }
-
-                    PendingUploads.Remove(upload.AssetID);
-
-                    Client.DebugLog("Pending uploads: " + PendingUploads.Count + ", pending downloads: " +
-                        ImageDownloads.Count);
-
-                    if (PendingUploads.Count == 0 && ImageDownloads.Count == 0)
-                    {
-                        Client.DebugLog("All pending image downloads and uploads complete");
-
-                        CachedResponseEvent.Set();
-                    }
-                }
-                else
-                {
-                    // TEMP
-                    Client.DebugLog("Upload " + upload.AssetID.ToString() + " was not found in PendingUploads");
-                }
-            }
-        }
-
-        /// <summary>
-        /// Terminate any wait handles when the network layer disconnects
-        /// </summary>
-        private void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message)
-        {
-            WearablesRequestEvent.Set();
-            WearablesDownloadedEvent.Set();
-            CachedResponseEvent.Set();
-            UpdateEvent.Set();
-        }
-
-        #endregion Callbacks
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AssemblyInfo.cs b/old/libsl1550/libsecondlife/AssemblyInfo.cs
deleted file mode 100644
index 18acf60..0000000
--- a/old/libsl1550/libsecondlife/AssemblyInfo.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("libsecondlife")]
-[assembly: AssemblyDescription("Networking layer for the Second Life world")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("libsecondlife")]
-[assembly: AssemblyProduct("libsecondlife")]
-[assembly: AssemblyCopyright("Copyright © libsecondlife 2006")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("0.9.0.0")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-//   (*) If no key is specified, the assembly is not signed.
-//   (*) KeyName refers to a key that has been installed in the Crypto Service
-//       Provider (CSP) on your machine. KeyFile refers to a file which contains
-//       a key.
-//   (*) If the KeyFile and the KeyName values are both specified, the
-//       following processing occurs:
-//       (1) If the KeyName can be found in the CSP, that key is used.
-//       (2) If the KeyName does not exist and the KeyFile does exist, the key
-//           in the KeyFile is installed into the CSP and used.
-//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-//       When specifying the KeyFile, the location of the KeyFile should be
-//       relative to the project output directory which is
-//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
-//       located in the project directory, you would specify the AssemblyKeyFile
-//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-//       documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
diff --git a/old/libsl1550/libsecondlife/AssetManager.cs b/old/libsl1550/libsecondlife/AssetManager.cs
deleted file mode 100644
index bcf2e82..0000000
--- a/old/libsl1550/libsecondlife/AssetManager.cs
+++ /dev/null
@@ -1,1202 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    #region Enums
-
-    /// <summary>
-    /// The different types of assets in Second Life
-    /// </summary>
-    public enum AssetType : sbyte
-    {
-        /// <summary>Unknown asset type</summary>
-        Unknown = -1,
-        /// <summary>Texture asset, stores in JPEG2000 J2C stream format</summary>
-        Texture = 0,
-        /// <summary>Sound asset</summary>
-        Sound = 1,
-        /// <summary>Calling card for another avatar</summary>
-        CallingCard = 2,
-        /// <summary>Link to a location in world</summary>
-        Landmark = 3,
-        /// <summary>Legacy script asset, you should never see one of these</summary>
-        [Obsolete]
-        Script = 4,
-        /// <summary>Collection of textures and parameters that can be
-        /// worn by an avatar</summary>
-        Clothing = 5,
-        /// <summary>Primitive that can contain textures, sounds,
-        /// scripts and more</summary>
-        Object = 6,
-        /// <summary>Notecard asset</summary>
-        Notecard = 7,
-        /// <summary>Holds a collection of inventory items</summary>
-        Folder = 8,
-        /// <summary>Root inventory folder</summary>
-        RootFolder = 9,
-        /// <summary>Linden scripting language script</summary>
-        LSLText = 10,
-        /// <summary>LSO bytecode for a script</summary>
-        LSLBytecode = 11,
-        /// <summary>Uncompressed TGA texture</summary>
-        TextureTGA = 12,
-        /// <summary>Collection of textures and shape parameters that can
-        /// be worn</summary>
-        Bodypart = 13,
-        /// <summary>Trash folder</summary>
-        TrashFolder = 14,
-        /// <summary>Snapshot folder</summary>
-        SnapshotFolder = 15,
-        /// <summary>Lost and found folder</summary>
-        LostAndFoundFolder = 16,
-        /// <summary>Uncompressed sound</summary>
-        SoundWAV = 17,
-        /// <summary>Uncompressed TGA non-square image, not to be used as a
-        /// texture</summary>
-        ImageTGA = 18,
-        /// <summary>Compressed JPEG non-square image, not to be used as a
-        /// texture</summary>
-        ImageJPEG = 19,
-        /// <summary>Animation</summary>
-        Animation = 20,
-        /// <summary>Sequence of animations, sounds, chat, and pauses</summary>
-        Gesture = 21,
-        /// <summary>Simstate file</summary>
-        Simstate = 22,
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public enum StatusCode
-    {
-        /// <summary>OK</summary>
-        OK = 0,
-        /// <summary>Transfer completed</summary>
-        Done = 1,
-        /// <summary></summary>
-        Skip = 2,
-        /// <summary></summary>
-        Abort = 3,
-        /// <summary>Unknown error occurred</summary>
-        Error = -1,
-        /// <summary>Equivalent to a 404 error</summary>
-        UnknownSource = -2,
-        /// <summary>Client does not have permission for that resource</summary>
-        InsufficientPermissiosn = -3,
-        /// <summary>Unknown status</summary>
-        Unknown = -4
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public enum ChannelType : int
-    {
-        /// <summary></summary>
-        Unknown = 0,
-        /// <summary>Unknown</summary>
-        Misc = 1,
-        /// <summary>Virtually all asset transfers use this channel</summary>
-        Asset = 2
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public enum SourceType : int
-    {
-        /// <summary></summary>
-        Unknown = 0,
-        /// <summary>Arbitrary system files off the server</summary>
-        [Obsolete]
-        File = 1,
-        /// <summary>Asset from the asset server</summary>
-        Asset = 2,
-        /// <summary>Inventory item</summary>
-        SimInventoryItem = 3,
-        /// <summary></summary>
-        SimEstate = 4
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public enum TargetType : int
-    {
-        /// <summary></summary>
-        Unknown = 0,
-        /// <summary></summary>
-        File,
-        /// <summary></summary>
-        VFile
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public enum ImageType : byte
-    {
-        /// <summary></summary>
-        Normal = 0,
-        /// <summary></summary>
-        Baked = 1
-    }
-
-    #endregion Enums
-
-    #region Transfer Classes
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class Transfer
-    {
-        public LLUUID ID;
-        public int Size;
-        public byte[] AssetData = new byte[0];
-        public int Transferred;
-        public bool Success;
-        public AssetType AssetType;
-
-        internal int transferStart;
-
-        /// <summary>Number of milliseconds passed since this transfer was
-        /// initialized</summary>
-        public int TransferTime { get { return Environment.TickCount - transferStart; } }
-
-        public Transfer()
-        {
-            AssetData = new byte[0];
-            transferStart = Environment.TickCount;
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class AssetDownload : Transfer
-    {
-        public LLUUID AssetID;
-        public ChannelType Channel;
-        public SourceType Source;
-        public TargetType Target;
-        public StatusCode Status;
-        public float Priority;
-        public Simulator Simulator;
-
-        internal AutoResetEvent HeaderReceivedEvent = new AutoResetEvent(false);
-    }
-
-    public class XferDownload : Transfer
-    {
-        public ulong XferID;
-        public LLUUID VFileID;
-        public AssetType Type;
-        public uint PacketNum;
-        public string Filename = String.Empty;
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class ImageDownload : Transfer
-    {
-        public ushort PacketCount;
-        public int Codec;
-        public bool NotFound;
-        public Simulator Simulator;
-
-        internal int InitialDataSize;
-        internal AutoResetEvent HeaderReceivedEvent = new AutoResetEvent(false);
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class AssetUpload : Transfer
-    {
-        public LLUUID AssetID;
-        public AssetType Type;
-        public ulong XferID;
-        public uint PacketNum;
-    }
-    public class ImageRequest
-    {
-        public ImageRequest(LLUUID imageid, ImageType type, float priority, int discardLevel)
-        {
-            ImageID = imageid;
-            Type = type;
-            Priority = priority;
-            DiscardLevel = discardLevel;
-        }
-        public LLUUID ImageID;
-        public ImageType Type;
-        public float Priority;
-        public int DiscardLevel;
-    }
-    #endregion Transfer Classes
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class AssetManager
-    {
-        #region Delegates
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="asset"></param>
-        public delegate void AssetReceivedCallback(AssetDownload transfer, Asset asset);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="xfer"></param>
-        public delegate void XferReceivedCallback(XferDownload xfer);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="image"></param>
-        public delegate void ImageReceivedCallback(ImageDownload image, AssetTexture asset);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="upload"></param>
-        public delegate void AssetUploadedCallback(AssetUpload upload);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="upload"></param>
-        public delegate void UploadProgressCallback(AssetUpload upload);
-
-        #endregion Delegates
-
-        #region Events
-
-        /// <summary></summary>
-        public event AssetReceivedCallback OnAssetReceived;
-        /// <summary></summary>
-        public event XferReceivedCallback OnXferReceived;
-        /// <summary></summary>
-        public event ImageReceivedCallback OnImageReceived;
-        /// <summary></summary>
-        public event AssetUploadedCallback OnAssetUploaded;
-        /// <summary></summary>
-        public event UploadProgressCallback OnUploadProgress;
-
-        #endregion Events
-
-        private SecondLife Client;
-        private Dictionary<LLUUID, Transfer> Transfers = new Dictionary<LLUUID, Transfer>();
-        private AssetUpload PendingUpload;
-        private AutoResetEvent PendingUploadEvent = new AutoResetEvent(true);
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client">A reference to the SecondLife client object</param>
-        public AssetManager(SecondLife client)
-        {
-            Client = client;
-
-            // Transfer packets for downloading large assets
-            Client.Network.RegisterCallback(PacketType.TransferInfo, new NetworkManager.PacketCallback(TransferInfoHandler));
-            Client.Network.RegisterCallback(PacketType.TransferPacket, new NetworkManager.PacketCallback(TransferPacketHandler));
-
-            // Image downloading packets
-            Client.Network.RegisterCallback(PacketType.ImageData, new NetworkManager.PacketCallback(ImageDataHandler));
-            Client.Network.RegisterCallback(PacketType.ImagePacket, new NetworkManager.PacketCallback(ImagePacketHandler));
-            Client.Network.RegisterCallback(PacketType.ImageNotInDatabase, new NetworkManager.PacketCallback(ImageNotInDatabaseHandler));
-
-            // Xfer packets for uploading large assets
-            Client.Network.RegisterCallback(PacketType.RequestXfer, new NetworkManager.PacketCallback(RequestXferHandler));
-            Client.Network.RegisterCallback(PacketType.ConfirmXferPacket, new NetworkManager.PacketCallback(ConfirmXferPacketHandler));
-            Client.Network.RegisterCallback(PacketType.AssetUploadComplete, new NetworkManager.PacketCallback(AssetUploadCompleteHandler));
-
-            // Xfer packet for downloading misc assets
-            Client.Network.RegisterCallback(PacketType.SendXferPacket, new NetworkManager.PacketCallback(SendXferPacketHandler));
-        }
-
-        /// <summary>
-        /// Request an asset download
-        /// </summary>
-        /// <param name="assetID">Asset UUID</param>
-        /// <param name="type">Asset type, must be correct for the transfer to succeed</param>
-        /// <param name="priority">Whether to give this transfer an elevated priority</param>
-        /// <returns>The transaction ID generated for this transfer</returns>
-        public LLUUID RequestAsset(LLUUID assetID, AssetType type, bool priority)
-        {
-            AssetDownload transfer = new AssetDownload();
-            transfer.ID = LLUUID.Random();
-            transfer.AssetID = assetID;
-            //transfer.AssetType = type; // Set in TransferInfoHandler.
-            transfer.Priority = 100.0f + (priority ? 1.0f : 0.0f);
-            transfer.Channel = ChannelType.Asset;
-            transfer.Source = SourceType.Asset;
-            transfer.Simulator = Client.Network.CurrentSim;
-
-            // Add this transfer to the dictionary
-            lock (Transfers) Transfers[transfer.ID] = transfer;
-
-            // Build the request packet and send it
-            TransferRequestPacket request = new TransferRequestPacket();
-            request.TransferInfo.ChannelType = (int)transfer.Channel;
-            request.TransferInfo.Priority = transfer.Priority;
-            request.TransferInfo.SourceType = (int)transfer.Source;
-            request.TransferInfo.TransferID = transfer.ID;
-
-            byte[] paramField = new byte[20];
-            Array.Copy(assetID.GetBytes(), 0, paramField, 0, 16);
-            Array.Copy(Helpers.IntToBytes((int)type), 0, paramField, 16, 4);
-            request.TransferInfo.Params = paramField;
-
-            Client.Network.SendPacket(request, transfer.Simulator);
-            return transfer.ID;
-        }
-
-        /// <summary>
-        /// Request an asset download through the almost deprecated Xfer system
-        /// </summary>
-        /// <param name="filename">Filename of the asset to request</param>
-        /// <param name="deleteOnCompletion">Whether or not to delete the asset
-        /// off the server after it is retrieved</param>
-        /// <param name="useBigPackets">Use large transfer packets or not</param>
-        /// <param name="vFileID">UUID of the file to request, if filename is
-        /// left empty</param>
-        /// <param name="vFileType">Asset type of <code>vFileID</code>, or
-        /// <code>AssetType.Unknown</code> if filename is not empty</param>
-        /// <returns></returns>
-        public ulong RequestAssetXfer(string filename, bool deleteOnCompletion, bool useBigPackets, LLUUID vFileID, AssetType vFileType)
-        {
-            LLUUID uuid = LLUUID.Random();
-            ulong id = uuid.ToULong();
-
-            XferDownload transfer = new XferDownload();
-            transfer.XferID = id;
-            transfer.ID = new LLUUID(id); // Our dictionary tracks transfers with LLUUIDs, so convert the ulong back
-            transfer.Filename = filename;
-            transfer.VFileID = vFileID;
-            transfer.AssetType = vFileType;
-
-            // Add this transfer to the dictionary
-            lock (Transfers) Transfers[transfer.ID] = transfer;
-
-            RequestXferPacket request = new RequestXferPacket();
-            request.XferID.ID = id;
-            request.XferID.Filename = Helpers.StringToField(filename);
-            request.XferID.FilePath = 4; // "Cache". This is a horrible thing that hardcodes a file path enumeration in to the
-                                         // protocol. For asset downloads we should only ever need this value
-            request.XferID.DeleteOnCompletion = deleteOnCompletion;
-            request.XferID.UseBigPackets = useBigPackets;
-            request.XferID.VFileID = vFileID;
-            request.XferID.VFileType = (short)vFileType;
-
-            Client.Network.SendPacket(request);
-
-            return id;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="assetID">Use LLUUID.Zero if you do not have the
-        /// asset ID but have all the necessary permissions</param>
-        /// <param name="itemID">The item ID of this asset in the inventory</param>
-        /// <param name="taskID">Use LLUUID.Zero if you are not requesting an
-        /// asset from an object inventory</param>
-        /// <param name="ownerID">The owner of this asset</param>
-        /// <param name="type">Asset type</param>
-        /// <param name="priority">Whether to prioritize this asset download or not</param>
-        public LLUUID RequestInventoryAsset(LLUUID assetID, LLUUID itemID, LLUUID taskID, LLUUID ownerID, AssetType type, bool priority)
-        {
-            AssetDownload transfer = new AssetDownload();
-            transfer.ID = LLUUID.Random();
-            transfer.AssetID = assetID;
-            //transfer.AssetType = type; // Set in TransferInfoHandler.
-            transfer.Priority = 100.0f + (priority ? 1.0f : 0.0f);
-            transfer.Channel = ChannelType.Asset;
-            transfer.Source = SourceType.SimInventoryItem;
-            transfer.Simulator = Client.Network.CurrentSim;
-
-            // Add this transfer to the dictionary
-            lock (Transfers) Transfers[transfer.ID] = transfer;
-
-            // Build the request packet and send it
-            TransferRequestPacket request = new TransferRequestPacket();
-            request.TransferInfo.ChannelType = (int)transfer.Channel;
-            request.TransferInfo.Priority = transfer.Priority;
-            request.TransferInfo.SourceType = (int)transfer.Source;
-            request.TransferInfo.TransferID = transfer.ID;
-
-            byte[] paramField = new byte[100];
-            Buffer.BlockCopy(Client.Self.AgentID.GetBytes(), 0, paramField, 0, 16);
-            Buffer.BlockCopy(Client.Self.SessionID.GetBytes(), 0, paramField, 16, 16);
-            Buffer.BlockCopy(ownerID.GetBytes(), 0, paramField, 32, 16);
-            Buffer.BlockCopy(taskID.GetBytes(), 0, paramField, 48, 16);
-            Buffer.BlockCopy(itemID.GetBytes(), 0, paramField, 64, 16);
-            Buffer.BlockCopy(assetID.GetBytes(), 0, paramField, 80, 16);
-            Buffer.BlockCopy(Helpers.IntToBytes((int)type), 0, paramField, 96, 4);
-            request.TransferInfo.Params = paramField;
-
-            Client.Network.SendPacket(request, transfer.Simulator);
-            return transfer.ID;
-        }
-
-        public LLUUID RequestInventoryAsset(InventoryItem item, bool priority)
-        {
-            return RequestInventoryAsset(item.AssetUUID, item.UUID, LLUUID.Zero, item.OwnerID, item.AssetType, priority);
-        }
-
-        public void RequestEstateAsset()
-        {
-            throw new Exception("This function is not implemented yet!");
-        }
-
-        /// <summary>
-        /// Initiate an image download. This is an asynchronous function
-        /// </summary>
-        /// <param name="imageID">The image to download</param>
-        /// <param name="type">Type of the image to download, either a baked
-        /// avatar texture or a normal texture</param>
-        public void RequestImage(LLUUID imageID, ImageType type)
-        {
-            RequestImage(imageID, type, 1013000.0f, 0);
-        }
-
-        /// <summary>
-        /// Initiate an image download. This is an asynchronous function
-        /// </summary>
-        /// <param name="imageID">The image to download</param>
-        /// <param name="type">Type of the image to download, either a baked
-        /// avatar texture or a normal texture</param>
-        /// <param name="priority">Priority level of the download. Default is
-        /// <code>1,013,000.0f</code></param>
-        /// <param name="discardLevel">Number of quality layers to discard</param>
-        public void RequestImage(LLUUID imageID, ImageType type, float priority, int discardLevel)
-        {
-            if (!Transfers.ContainsKey(imageID))
-            {
-                ImageDownload transfer = new ImageDownload();
-                //transfer.AssetType = AssetType.Texture // Handled in ImageDataHandler.
-                transfer.ID = imageID;
-                transfer.Simulator = Client.Network.CurrentSim;
-
-                // Add this transfer to the dictionary
-                lock (Transfers) Transfers[transfer.ID] = transfer;
-
-                // Build and send the request packet
-                RequestImagePacket request = new RequestImagePacket();
-                request.AgentData.AgentID = Client.Self.AgentID;
-                request.AgentData.SessionID = Client.Self.SessionID;
-                request.RequestImage = new RequestImagePacket.RequestImageBlock[1];
-                request.RequestImage[0] = new RequestImagePacket.RequestImageBlock();
-                request.RequestImage[0].DiscardLevel = (sbyte)discardLevel;
-                request.RequestImage[0].DownloadPriority = priority;
-                request.RequestImage[0].Packet = 0;
-                request.RequestImage[0].Image = imageID;
-                request.RequestImage[0].Type = (byte)type;
-
-                Client.Network.SendPacket(request, transfer.Simulator);
-            }
-            else
-            {
-                Client.Log("RequestImage() called for an image we are already downloading, ignoring",
-                    Helpers.LogLevel.Info);
-            }
-        }
-        /// <summary>
-        /// Requests multiple Images
-        /// </summary>
-        /// <param name="Images">List of requested images</param>
-        public void RequestImages(List<ImageRequest> Images)
-        {
-            for (int iri = Images.Count; iri > 0; --iri)
-            {
-                if (Transfers.ContainsKey(Images[iri].ImageID))
-                {
-                    Images.RemoveAt(iri);
-                }
-            }
-
-            if (Images.Count > 0)
-            {
-
-                // Build and send the request packet
-                RequestImagePacket request = new RequestImagePacket();
-                request.AgentData.AgentID = Client.Self.AgentID;
-                request.AgentData.SessionID = Client.Self.SessionID;
-                request.RequestImage = new RequestImagePacket.RequestImageBlock[Images.Count];
-
-                for (int iru = 0; iru < Images.Count; ++iru)
-                {
-                    ImageDownload transfer = new ImageDownload();
-                    //transfer.AssetType = AssetType.Texture // Handled in ImageDataHandler.
-                    transfer.ID = Images[iru].ImageID;
-                    transfer.Simulator = Client.Network.CurrentSim;
-
-                    // Add this transfer to the dictionary
-                    lock (Transfers) Transfers[transfer.ID] = transfer;
-                    request.RequestImage[iru] = new RequestImagePacket.RequestImageBlock();
-                    request.RequestImage[iru].DiscardLevel = (sbyte)Images[iru].DiscardLevel;
-                    request.RequestImage[iru].DownloadPriority = Images[iru].Priority;
-                    request.RequestImage[iru].Packet = 0;
-                    request.RequestImage[iru].Image = Images[iru].ImageID;
-                    request.RequestImage[iru].Type = (byte)Images[iru].Type;
-                }
-                Client.Network.SendPacket(request, Client.Network.CurrentSim);
-            }
-            else
-            {
-                Client.Log("RequestImages() called for an image(s) we are already downloading or an empty list, ignoring",
-                    Helpers.LogLevel.Info);
-            }
-        }
-
-        public LLUUID RequestUpload(Asset asset, bool tempFile, bool storeLocal, bool isPriority)
-        {
-            if (asset.AssetData == null)
-                throw new ArgumentException("Can't upload an asset with no data (did you forget to call Encode?)");
-
-            LLUUID assetID;
-            LLUUID transferID = RequestUpload(out assetID, asset.AssetType, asset.AssetData, tempFile, storeLocal, isPriority);
-            asset.AssetID = assetID;
-            return transferID;
-        }
-
-        public LLUUID RequestUpload(AssetType type, byte[] data, bool tempFile, bool storeLocal, bool isPriority)
-        {
-            LLUUID assetID;
-            return RequestUpload(out assetID, type, data, tempFile, storeLocal, isPriority);
-        }
-
-        /// <summary>
-        /// Initiate an asset upload
-        /// </summary>
-        /// <param name="transactionID">The ID this asset will have if the
-        /// upload succeeds</param>
-        /// <param name="type">Asset type to upload this data as</param>
-        /// <param name="data">Raw asset data to upload</param>
-        /// <param name="tempFile">Whether this is a temporary file or not</param>
-        /// <param name="storeLocal">Whether to store this asset on the local
-        /// simulator or the grid-wide asset server</param>
-        /// <param name="isPriority">Give this upload a higher priority</param>
-        /// <returns>The transaction ID of this transfer</returns>
-        public LLUUID RequestUpload(out LLUUID assetID, AssetType type, byte[] data, bool tempFile, bool storeLocal, bool isPriority)
-        {
-            AssetUpload upload = new AssetUpload();
-            upload.AssetData = data;
-            upload.AssetType = type;
-            upload.ID = LLUUID.Random();
-            assetID = LLUUID.Combine(upload.ID, Client.Self.SecureSessionID);
-            upload.AssetID = assetID;
-            upload.Size = data.Length;
-            upload.XferID = 0;
-
-            // Build and send the upload packet
-            AssetUploadRequestPacket request = new AssetUploadRequestPacket();
-            request.AssetBlock.StoreLocal = storeLocal;
-            request.AssetBlock.Tempfile = tempFile;
-            request.AssetBlock.TransactionID = upload.ID;
-            request.AssetBlock.Type = (sbyte)type;
-
-            if (data.Length + 100 < Settings.MAX_PACKET_SIZE)
-            {
-                Client.Log(
-                    String.Format("Beginning asset upload [Single Packet], ID: {0}, AssetID: {1}, Size: {2}",
-                    upload.ID.ToString(), upload.AssetID.ToString(), upload.Size),
-                    Helpers.LogLevel.Info);
-
-                // The whole asset will fit in this packet, makes things easy
-                request.AssetBlock.AssetData = data;
-                upload.Transferred = data.Length;
-            }
-            else
-            {
-                Client.Log(
-                    String.Format("Beginning asset upload [Multiple Packets], ID: {0}, AssetID: {1}, Size: {2}",
-                    upload.ID.ToString(), upload.AssetID.ToString(), upload.Size),
-                    Helpers.LogLevel.Info);
-
-                // Asset is too big, send in multiple packets
-                request.AssetBlock.AssetData = new byte[0];
-            }
-
-            //Client.DebugLog(request.ToString());
-
-            /*
-            // Add this upload to the Transfers dictionary using the assetID as the key.
-            // Once the simulator assigns an actual identifier for this upload it will be
-            // removed from Transfers and reinserted with the proper identifier
-            lock (Transfers) Transfers[upload.AssetID] = upload;
-            */
-
-            // Wait for the previous upload to receive a RequestXferPacket
-            if (PendingUploadEvent.WaitOne(10000, false))
-            {
-                PendingUpload = upload;
-
-                Client.Network.SendPacket(request);
-
-                return upload.ID;
-            }
-            else
-                throw new Exception("Timeout waiting for previous asset upload to begin");
-        }
-
-        #region Helpers
-
-        private Asset CreateAssetWrapper(AssetType type)
-        {
-            Asset asset;
-
-            switch (type)
-            {
-                case AssetType.Notecard:
-                    asset = new AssetNotecard();
-                    break;
-                case AssetType.LSLText:
-                    asset = new AssetScriptText();
-                    break;
-                case AssetType.LSLBytecode:
-                    asset = new AssetScriptBinary();
-                    break;
-                case AssetType.Texture:
-                    asset = new AssetTexture();
-                    break;
-                case AssetType.Object:
-                    asset = new AssetPrim();
-                    break;
-                case AssetType.Clothing:
-                    asset = new AssetClothing();
-                    break;
-                case AssetType.Bodypart:
-                    asset = new AssetBodypart();
-                    break;
-                default:
-                    Client.Log("Unimplemented asset type: " + type, Helpers.LogLevel.Error);
-                    return null;
-            }
-
-            return asset;
-        }
-
-        private Asset WrapAsset(AssetDownload download)
-        {
-            Asset asset = CreateAssetWrapper(download.AssetType);
-            asset.AssetID = download.AssetID;
-            asset.AssetData = download.AssetData;
-            return asset;
-        }
-
-        private void SendNextUploadPacket(AssetUpload upload)
-        {
-            SendXferPacketPacket send = new SendXferPacketPacket();
-
-            send.XferID.ID = upload.XferID;
-            send.XferID.Packet = upload.PacketNum++;
-
-            if (send.XferID.Packet == 0)
-            {
-                // The first packet reserves the first four bytes of the data for the
-                // total length of the asset and appends 1000 bytes of data after that
-                send.DataPacket.Data = new byte[1004];
-                Buffer.BlockCopy(Helpers.IntToBytes(upload.Size), 0, send.DataPacket.Data, 0, 4);
-                Buffer.BlockCopy(upload.AssetData, 0, send.DataPacket.Data, 4, 1000);
-                upload.Transferred += 1000;
-
-                lock (Transfers)
-                {
-                    Transfers.Remove(upload.AssetID);
-                    Transfers[upload.ID] = upload;
-                }
-            }
-            else if ((send.XferID.Packet + 1) * 1000 < upload.Size)
-            {
-                // This packet is somewhere in the middle of the transfer, or a perfectly
-                // aligned packet at the end of the transfer
-                send.DataPacket.Data = new byte[1000];
-                Buffer.BlockCopy(upload.AssetData, upload.Transferred, send.DataPacket.Data, 0, 1000);
-                upload.Transferred += 1000;
-            }
-            else
-            {
-                // Special handler for the last packet which will be less than 1000 bytes
-                int lastlen = upload.Size - ((int)send.XferID.Packet * 1000);
-                send.DataPacket.Data = new byte[lastlen];
-                Buffer.BlockCopy(upload.AssetData, (int)send.XferID.Packet * 1000, send.DataPacket.Data, 0, lastlen);
-                send.XferID.Packet |= (uint)0x80000000; // This signals the final packet
-                upload.Transferred += lastlen;
-            }
-
-            Client.Network.SendPacket(send);
-        }
-
-        private void SendConfirmXferPacket(ulong xferID, uint packetNum)
-        {
-            ConfirmXferPacketPacket confirm = new ConfirmXferPacketPacket();
-            confirm.XferID.ID = xferID;
-            confirm.XferID.Packet = packetNum;
-
-            Client.Network.SendPacket(confirm);
-        }
-
-        #endregion Helpers
-
-        #region Transfer Callbacks
-
-        private void TransferInfoHandler(Packet packet, Simulator simulator)
-        {
-            if (OnAssetReceived != null)
-            {
-                TransferInfoPacket info = (TransferInfoPacket)packet;
-                Transfer transfer;
-                AssetDownload download;
-
-                if (Transfers.TryGetValue(info.TransferInfo.TransferID, out transfer))
-                {
-                    download = (AssetDownload)transfer;
-
-                    download.Channel = (ChannelType)info.TransferInfo.ChannelType;
-                    download.Status = (StatusCode)info.TransferInfo.Status;
-                    download.Target = (TargetType)info.TransferInfo.TargetType;
-                    download.Size = info.TransferInfo.Size;
-
-                    // TODO: Once we support mid-transfer status checking and aborting this
-                    // will need to become smarter
-                    if (download.Status != StatusCode.OK)
-                    {
-                        Client.Log("Transfer failed with status code " + download.Status, Helpers.LogLevel.Warning);
-
-                        lock (Transfers) Transfers.Remove(download.ID);
-
-                        // No data could have been received before the TransferInfo packet
-                        download.AssetData = null;
-
-                        // Fire the event with our transfer that contains Success = false;
-                        try { OnAssetReceived(download, null); }
-                        catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-                    else
-                    {
-                        download.AssetData = new byte[download.Size];
-
-                        if (download.Source == SourceType.Asset && info.TransferInfo.Params.Length == 20)
-                        {
-                            download.AssetID = new LLUUID(info.TransferInfo.Params, 0);
-                            download.AssetType = (AssetType)(sbyte)info.TransferInfo.Params[16];
-
-                            //Client.DebugLog(String.Format("TransferInfo packet received. AssetID: {0} Type: {1}",
-                            //    transfer.AssetID, type));
-                        }
-                        else if (download.Source == SourceType.SimInventoryItem && info.TransferInfo.Params.Length == 100)
-                        {
-                            // TODO: Can we use these?
-                            LLUUID agentID = new LLUUID(info.TransferInfo.Params, 0);
-                            LLUUID sessionID = new LLUUID(info.TransferInfo.Params, 16);
-                            LLUUID ownerID = new LLUUID(info.TransferInfo.Params, 32);
-                            LLUUID taskID = new LLUUID(info.TransferInfo.Params, 48);
-                            LLUUID itemID = new LLUUID(info.TransferInfo.Params, 64);
-                            download.AssetID = new LLUUID(info.TransferInfo.Params, 80);
-                            download.AssetType = (AssetType)(sbyte)info.TransferInfo.Params[96];
-
-                            //Client.DebugLog(String.Format("TransferInfo packet received. AgentID: {0} SessionID: {1} " +
-                            //    "OwnerID: {2} TaskID: {3} ItemID: {4} AssetID: {5} Type: {6}", agentID, sessionID,
-                            //    ownerID, taskID, itemID, transfer.AssetID, type));
-                        }
-                        else
-                        {
-                            Client.Log("Received a TransferInfo packet with a SourceType of " + download.Source.ToString() +
-                                " and a Params field length of " + info.TransferInfo.Params.Length,
-                                Helpers.LogLevel.Warning);
-                        }
-                    }
-                }
-                else
-                {
-                    Client.Log("Received a TransferInfo packet for an asset we didn't request, TransferID: " +
-                        info.TransferInfo.TransferID, Helpers.LogLevel.Warning);
-                }
-            }
-        }
-
-        private void TransferPacketHandler(Packet packet, Simulator simulator)
-        {
-            TransferPacketPacket asset = (TransferPacketPacket)packet;
-            Transfer transfer;
-            AssetDownload download;
-
-            if (Transfers.TryGetValue(asset.TransferData.TransferID, out transfer))
-            {
-                download = (AssetDownload)transfer;
-
-                if (download.Size == 0)
-                {
-                    Client.DebugLog("TransferPacket received ahead of the transfer header, blocking...");
-
-                    // We haven't received the header yet, block until it's received or times out
-                    download.HeaderReceivedEvent.WaitOne(1000 * 20, false);
-
-                    if (download.Size == 0)
-                    {
-                        Client.Log("Timed out while waiting for the asset header to download for " +
-                            download.ID.ToString(), Helpers.LogLevel.Warning);
-
-                        // Abort the transfer
-                        TransferAbortPacket abort = new TransferAbortPacket();
-                        abort.TransferInfo.ChannelType = (int)download.Channel;
-                        abort.TransferInfo.TransferID = download.ID;
-                        Client.Network.SendPacket(abort, download.Simulator);
-
-                        download.Success = false;
-                        lock (Transfers) Transfers.Remove(download.ID);
-
-                        // Fire the event with our transfer that contains Success = false
-                        if (OnAssetReceived != null)
-                        {
-                            try { OnAssetReceived(download, null); }
-                            catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                        }
-
-                        return;
-                    }
-                }
-
-                // This assumes that every transfer packet except the last one is exactly 1000 bytes,
-                // hopefully that is a safe assumption to make
-                Buffer.BlockCopy(asset.TransferData.Data, 0, download.AssetData, 1000 * asset.TransferData.Packet,
-                    asset.TransferData.Data.Length);
-                download.Transferred += asset.TransferData.Data.Length;
-
-                //Client.DebugLog(String.Format("Transfer packet {0}, received {1}/{2}/{3} bytes for asset {4}",
-                //    asset.TransferData.Packet, asset.TransferData.Data.Length, transfer.Transferred, transfer.Size,
-                //    transfer.AssetID.ToString()));
-
-                // Check if we downloaded the full asset
-                if (download.Transferred >= download.Size)
-                {
-                    Client.DebugLog("Transfer for asset " + download.AssetID.ToString() + " completed");
-
-                    download.Success = true;
-                    lock (Transfers) Transfers.Remove(download.ID);
-
-                    if (OnAssetReceived != null)
-                    {
-                        try { OnAssetReceived(download, WrapAsset(download)); }
-                        catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-            }
-        }
-
-        #endregion Transfer Callbacks
-
-        #region Xfer Callbacks
-
-        private void RequestXferHandler(Packet packet, Simulator simulator)
-        {
-            if (PendingUpload == null)
-                Client.Log("Received a RequestXferPacket for an unknown asset upload", Helpers.LogLevel.Warning);
-            else
-            {
-                AssetUpload upload = PendingUpload;
-                PendingUpload = null;
-                PendingUploadEvent.Set();
-                RequestXferPacket request = (RequestXferPacket)packet;
-
-                upload.XferID = request.XferID.ID;
-                upload.Type = (AssetType)request.XferID.VFileType;
-
-                LLUUID transferID = new LLUUID(upload.XferID);
-                Transfers[transferID] = upload;
-
-                // Send the first packet containing actual asset data
-                SendNextUploadPacket(upload);
-            }
-        }
-
-        private void ConfirmXferPacketHandler(Packet packet, Simulator simulator)
-        {
-            ConfirmXferPacketPacket confirm = (ConfirmXferPacketPacket)packet;
-
-            // Building a new UUID every time an ACK is received for an upload is a horrible
-            // thing, but this whole Xfer system is horrible
-            LLUUID transferID = new LLUUID(confirm.XferID.ID);
-            Transfer transfer;
-            AssetUpload upload = null;
-
-            if (Transfers.TryGetValue(transferID, out transfer))
-            {
-                upload = (AssetUpload)transfer;
-
-                //Client.DebugLog(String.Format("ACK for upload {0} of asset type {1} ({2}/{3})",
-                //    upload.AssetID.ToString(), upload.Type, upload.Transferred, upload.Size));
-
-                if (OnUploadProgress != null)
-                {
-                    try { OnUploadProgress(upload); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-
-                if (upload.Transferred < upload.Size)
-                    SendNextUploadPacket(upload);
-            }
-        }
-
-        private void AssetUploadCompleteHandler(Packet packet, Simulator simulator)
-        {
-            AssetUploadCompletePacket complete = (AssetUploadCompletePacket)packet;
-
-            if (OnAssetUploaded != null)
-            {
-                bool found = false;
-                KeyValuePair<LLUUID, Transfer> foundTransfer = new KeyValuePair<LLUUID, Transfer>();
-
-                // Xfer system sucks really really bad. Where is the damn XferID?
-                lock (Transfers)
-                {
-                    foreach (KeyValuePair<LLUUID, Transfer> transfer in Transfers)
-                    {
-                        if (transfer.Value.GetType() == typeof(AssetUpload))
-                        {
-                            AssetUpload upload = (AssetUpload)transfer.Value;
-
-                            if ((upload).AssetID == complete.AssetBlock.UUID)
-                            {
-                                found = true;
-                                foundTransfer = transfer;
-                                upload.Success = complete.AssetBlock.Success;
-                                upload.Type = (AssetType)complete.AssetBlock.Type;
-                                found = true;
-                                break;
-                            }
-                        }
-                    }
-                }
-
-                if (found)
-                {
-                    lock (Transfers) Transfers.Remove(foundTransfer.Key);
-
-                    try { OnAssetUploaded((AssetUpload)foundTransfer.Value); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        private void SendXferPacketHandler(Packet packet, Simulator simulator)
-        {
-            SendXferPacketPacket xfer = (SendXferPacketPacket)packet;
-
-            // Lame ulong to LLUUID conversion, please go away Xfer system
-            LLUUID transferID = new LLUUID(xfer.XferID.ID);
-            Transfer transfer;
-            XferDownload download = null;
-
-            if (Transfers.TryGetValue(transferID, out transfer))
-            {
-                download = (XferDownload)transfer;
-
-                // Apply a mask to get rid of the "end of transfer" bit
-                uint packetNum = xfer.XferID.Packet & 0x0FFFFFFF;
-
-                // Check for out of order packets, possibly indicating a resend
-                if (packetNum != download.PacketNum)
-                {
-                    if (packetNum == download.PacketNum - 1)
-                    {
-                        Client.DebugLog("Resending Xfer download confirmation for packet " + packetNum);
-                        SendConfirmXferPacket(download.XferID, packetNum);
-                    }
-                    else
-                    {
-                        Client.Log("Out of order Xfer packet in a download, got " + packetNum + " expecting " + download.PacketNum,
-                            Helpers.LogLevel.Warning);
-                    }
-
-                    return;
-                }
-
-                if (packetNum == 0)
-                {
-                    // This is the first packet received in the download, the first four bytes are a network order size integer
-                    download.Size = (int)Helpers.BytesToUIntBig(xfer.DataPacket.Data);
-                    download.AssetData = new byte[download.Size];
-
-                    Buffer.BlockCopy(xfer.DataPacket.Data, 4, download.AssetData, 0, xfer.DataPacket.Data.Length - 4);
-                    download.Transferred += xfer.DataPacket.Data.Length - 4;
-                }
-                else
-                {
-                    Buffer.BlockCopy(xfer.DataPacket.Data, 0, download.AssetData, 1000 * (int)packetNum, xfer.DataPacket.Data.Length);
-                    download.Transferred += xfer.DataPacket.Data.Length;
-                }
-
-                // Increment the packet number to the packet we are expecting next
-                download.PacketNum++;
-
-                // Confirm receiving this packet
-                SendConfirmXferPacket(download.XferID, packetNum);
-
-                if ((xfer.XferID.Packet & 0x80000000) != 0)
-                {
-                    // This is the last packet in the transfer
-                    if (!String.IsNullOrEmpty(download.Filename))
-                        Client.DebugLog("Xfer download for asset " + download.Filename + " completed");
-                    else
-                        Client.DebugLog("Xfer download for asset " + download.VFileID.ToString() + " completed");
-
-                    download.Success = true;
-                    lock (Transfers) Transfers.Remove(download.ID);
-
-                    if (OnXferReceived != null)
-                    {
-                        try { OnXferReceived(download); }
-                        catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-            }
-        }
-
-        #endregion Xfer Callbacks
-
-        #region Image Callbacks
-
-        /// <summary>
-        /// Handles the Image Data packet which includes the ID and Size of the image,
-        /// along with the first block of data for the image. If the image is small enough
-        /// there will be no additional packets
-        /// </summary>
-        private void ImageDataHandler(Packet packet, Simulator simulator)
-        {
-            ImageDataPacket data = (ImageDataPacket)packet;
-            ImageDownload transfer = null;
-
-            lock (Transfers)
-            {
-                if (Transfers.ContainsKey(data.ImageID.ID))
-                {
-                    transfer = (ImageDownload)Transfers[data.ImageID.ID];
-
-                    //Client.DebugLog("Received first " + data.ImageData.Data.Length + " bytes for image " +
-                    //    data.ImageID.ID.ToString());
-
-                    transfer.Codec = data.ImageID.Codec;
-                    transfer.PacketCount = data.ImageID.Packets;
-                    transfer.Size = (int)data.ImageID.Size;
-                    transfer.AssetData = new byte[transfer.Size];
-                    transfer.AssetType = AssetType.Texture;
-                    Buffer.BlockCopy(data.ImageData.Data, 0, transfer.AssetData, 0, data.ImageData.Data.Length);
-                    transfer.InitialDataSize = data.ImageData.Data.Length;
-                    transfer.Transferred += data.ImageData.Data.Length;
-
-                    // Check if we downloaded the full image
-                    if (transfer.Transferred >= transfer.Size)
-                    {
-                        Transfers.Remove(transfer.ID);
-                        transfer.Success = true;
-                    }
-                }
-            }
-
-            if (transfer != null)
-            {
-                transfer.HeaderReceivedEvent.Set();
-
-                if (OnImageReceived != null && transfer.Transferred >= transfer.Size)
-                {
-                    try { OnImageReceived(transfer, new AssetTexture(transfer.AssetData)); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Handles the remaining Image data that did not fit in the initial ImageData packet
-        /// </summary>
-        private void ImagePacketHandler(Packet packet, Simulator simulator)
-        {
-            ImagePacketPacket image = (ImagePacketPacket)packet;
-            ImageDownload transfer = null;
-
-            lock (Transfers)
-            {
-                if (Transfers.ContainsKey(image.ImageID.ID))
-                {
-                    transfer = (ImageDownload)Transfers[image.ImageID.ID];
-
-                    if (transfer.Size == 0)
-                    {
-                        // We haven't received the header yet, block until it's received or times out
-                        transfer.HeaderReceivedEvent.WaitOne(1000 * 20, false);
-
-                        if (transfer.Size == 0)
-                        {
-                            Client.Log("Timed out while waiting for the image header to download for " +
-                                transfer.ID.ToString(), Helpers.LogLevel.Warning);
-
-                            transfer.Success = false;
-                            Transfers.Remove(transfer.ID);
-                            goto Callback;
-                        }
-                    }
-
-                    // The header is downloaded, we can insert this data in to the proper position
-                    Array.Copy(image.ImageData.Data, 0, transfer.AssetData, transfer.InitialDataSize +
-                        (1000 * (image.ImageID.Packet - 1)), image.ImageData.Data.Length);
-                    transfer.Transferred += image.ImageData.Data.Length;
-
-                    //Client.DebugLog("Received " + image.ImageData.Data.Length + "/" + transfer.Transferred +
-                    //    "/" + transfer.Size + " bytes for image " + image.ImageID.ID.ToString());
-
-                    // Check if we downloaded the full image
-                    if (transfer.Transferred >= transfer.Size)
-                    {
-                        transfer.Success = true;
-                        Transfers.Remove(transfer.ID);
-                    }
-                }
-            }
-
-        Callback:
-
-            if (transfer != null && OnImageReceived != null && (transfer.Transferred >= transfer.Size || transfer.Size == 0))
-            {
-                try { OnImageReceived(transfer, new AssetTexture(transfer.AssetData)); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        /// <summary>
-        /// The requested image does not exist on the asset server
-        /// </summary>
-        private void ImageNotInDatabaseHandler(Packet packet, Simulator simulator)
-        {
-            ImageNotInDatabasePacket notin = (ImageNotInDatabasePacket)packet;
-            ImageDownload transfer = null;
-
-            lock (Transfers)
-            {
-                if (Transfers.ContainsKey(notin.ImageID.ID))
-                {
-                    transfer = (ImageDownload)Transfers[notin.ImageID.ID];
-                    transfer.NotFound = true;
-                    Transfers.Remove(transfer.ID);
-                }
-            }
-
-            // Fire the event with our transfer that contains Success = false;
-            if (transfer != null && OnImageReceived != null)
-            {
-                try { OnImageReceived(transfer, null); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        #endregion Image Callbacks
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AppearanceManager.cs b/old/libsl1550/libsecondlife/AssetSystem/AppearanceManager.cs
deleted file mode 100644
index 2b4a375..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AppearanceManager.cs
+++ /dev/null
@@ -1,663 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-using libsecondlife.InventorySystem;
-using libsecondlife.Packets;
-
-using System.Text;
-
-
-namespace libsecondlife.AssetSystem
-{
-    public class AppearanceManager
-    {
-    	public enum	WearableType
-		{
-			Shape = 0,
-			Skin = 1,
-			Hair = 2,
-			Eyes = 3,
-			Shirt = 4,
-			Pants = 5,
-			Shoes = 6,
-			Socks = 7,
-			Jacket = 8,
-			Gloves = 9,
-			Undershirt = 10,
-			Underpants = 11,
-			Skirt = 12,
-			Count = 13,
-			Invalid = 255
-		};
-
-        protected SecondLife Client;
-        protected AssetManager AManager;
-
-        protected uint SerialNum = 1;
-
-        protected ManualResetEvent AgentWearablesSignal = new ManualResetEvent(false);
-
-        protected Dictionary<LLUUID, AssetWearable> WearableCache = new Dictionary<LLUUID, AssetWearable>();
-        protected List<LLUUID> WearableAssetQueue = new List<LLUUID>();
-        protected Mutex WearableCacheQueueMutex = new Mutex();
-
-        // This data defines all appearance info for an avatar
-        public AgentWearablesUpdatePacket.WearableDataBlock[] AgentWearablesData;
-        public SerializableDictionary<int, float> AgentAppearanceParams = new SerializableDictionary<int, float>();
-        public LLObject.TextureEntry AgentTextureEntry = new LLObject.TextureEntry("C228D1CF4B5D4BA884F4899A0796AA97"); // if this isn't valid, blame JH ;-)
-
-        public bool LogWearableAssetQueue = false;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="client"></param>
-        public AppearanceManager(SecondLife client)
-        {
-            Client = client;
-            Client.Network.RegisterCallback(libsecondlife.Packets.PacketType.AgentWearablesUpdate, new NetworkManager.PacketCallback(AgentWearablesUpdateCallbackHandler));
-
-            AManager = client.Assets;
-            AManager.TransferRequestCompletedEvent += new AssetManager.On_TransferRequestCompleted(AManager_TransferRequestCompletedEvent);
-        }
-
-        #region Wear Stuff
-
-        /// <summary>
-        /// Add a single wearable to your outfit, replacing if nessesary.
-        /// </summary>
-        /// <param name="wearable"></param>
-        public void Wear(InventoryWearable wearable)
-        {
-            List<InventoryWearable> x = new List<InventoryWearable>();
-            x.Add(wearable);
-            Wear(x);
-        }
-
-        /// <summary>
-        /// Add the specified wearables to your outfit, replace existing ones if nessesary.
-        /// </summary>
-        /// <param name="wearables"></param>
-        public void Wear(List<InventoryWearable> wearables)
-        {
-            // Make sure we have some Wearable Data to start with.
-            if (AgentWearablesSignal.WaitOne(1000, false) == false)
-            {
-                Client.Log("You must have set appearance at least once, before calling Wear().  AgentWearablesSignal not set.", Helpers.LogLevel.Error);
-                return;
-            }
-
-            // Update with specified wearables
-            foreach (InventoryWearable iw in wearables)
-            {
-                byte type = (byte)((AssetWearable)iw.Asset).AppearanceLayer;
-                AgentWearablesData[type].ItemID = iw.ItemID;
-                AgentWearablesData[type].AssetID = iw.AssetID;
-            }
-
-            // Create AgentIsNowWearing Packet, and send it
-            SendAgentIsNowWearing();
-
-            // Update local Appearance Info
-            GetAvatarAppearanceInfoFromWearableAssets();
-
-            // Send updated AgentSetAppearance to the grid
-            BeginAgentSendAppearance();
-        }
-
-        /// <summary>
-        /// Equivalent to the SL "Replace Outfit" command.  All clothing is removed, and replaced with wearables in given folder.  Body wearables will be replaced if provided.
-        /// </summary>
-        /// <param name="outfitFolder">Contains the wearable items to put on.</param>
-        public void WearOutfit(InventoryFolder outfitFolder)
-        {
-            WearOutfit(outfitFolder, 10000, true);
-        }
-
-
-        /// <summary>
-        /// Equivalent to the SL "Replace Outfit" command.  All clothing is removed, and replaced with wearables in given folder.  Body wearables will be replaced if provided.
-        /// </summary>
-        /// <param name="outfitFolder">Contains the wearable items to put on.</param>
-        /// <param name="TimeOut">How long to wait for outfit directory information to download</param>
-        public void WearOutfit(InventoryFolder outfitFolder, int TimeOut, bool removeExistingAttachments)
-        {
-            // Refresh download of outfit folder
-            if (!outfitFolder.RequestDownloadContents(false, false, true).RequestComplete.WaitOne(TimeOut, false))
-            {
-                Client.Log("Outfit not changed. An error occured while downloads the folder contents of : " + outfitFolder.Name, Helpers.LogLevel.Error);
-                return;
-            }
-
-            // Make sure we have some Wearable Data to start with.
-            if (AgentWearablesSignal.WaitOne(1000, false) == false)
-            {
-                Client.Log("You must have set appearance at least once, before calling WearOutfit().  AgentWearablesSignal not set.", Helpers.LogLevel.Error);
-                return;
-            }
-
-            // Flush the cached clothing wearables so we can redefine them
-            for (byte i = 4; i <= 12; i++)
-            {
-                AgentWearablesData[i].ItemID  = LLUUID.Zero;
-                AgentWearablesData[i].AssetID = LLUUID.Zero;
-            }
-
-            List<InventoryItem> attachments = new List<InventoryItem>();
-
-            // Replace with wearables from Outfit folder
-            foreach (InventoryBase ib in outfitFolder.GetContents())
-            {
-                if (ib is InventoryWearable)
-                {
-                    try
-                    {
-                        InventoryWearable iw = (InventoryWearable)ib;
-                        Client.Log("Retrieving asset for " + iw.Name + "("+iw.AssetID+")", Helpers.LogLevel.Info);
-                        AssetWearable.AppearanceLayerType AppearanceLayer = ((AssetWearable)iw.Asset).AppearanceLayer;
-
-                        Client.Log("Adding skin/clothing layer for " + AppearanceLayer, Helpers.LogLevel.Info);
-                        AgentWearablesData[(byte)AppearanceLayer].ItemID = iw.ItemID;
-                        AgentWearablesData[(byte)AppearanceLayer].AssetID = iw.AssetID;
-                    }
-                    catch (Exception e)
-                    {
-                        Client.Log("Asset for " + ib._Name + " unavailable: " + e.Message, Helpers.LogLevel.Error);
-                    }
-                }
-                else if (ib is InventoryItem)
-                {
-                    InventoryItem ii = (InventoryItem)ib;
-                    attachments.Add(ii);
-                }
-            }
-
-            // Change attachments
-            AddAttachments(attachments, removeExistingAttachments);
-
-            // Create AgentIsNowWearing Packet, and send it
-            SendAgentIsNowWearing();
-
-            // Send updated AgentSetAppearance to the grid
-            SendAgentSetAppearance();
-        }
-
-        public void AddAttachments(List<InventoryItem> attachments, bool removeExistingFirst)
-        {
-            // Use RezMultipleAttachmentsFromInv  to clear out current attachments, and attach new ones
-            RezMultipleAttachmentsFromInvPacket attachmentsPacket = new RezMultipleAttachmentsFromInvPacket();
-            attachmentsPacket.AgentData.AgentID = Client.Network.AgentID;
-            attachmentsPacket.AgentData.SessionID = Client.Network.SessionID;
-
-            attachmentsPacket.HeaderData.CompoundMsgID = LLUUID.Random();
-            attachmentsPacket.HeaderData.FirstDetachAll = true;
-            attachmentsPacket.HeaderData.TotalObjects = (byte)attachments.Count;
-
-            attachmentsPacket.ObjectData = new RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[attachments.Count];
-            for (int i = 0; i < attachments.Count; i++)
-            {
-                attachmentsPacket.ObjectData[i] = new RezMultipleAttachmentsFromInvPacket.ObjectDataBlock();
-                attachmentsPacket.ObjectData[i].AttachmentPt = 0;
-                attachmentsPacket.ObjectData[i].EveryoneMask = attachments[i].EveryoneMask;
-                attachmentsPacket.ObjectData[i].GroupMask = attachments[i].GroupMask;
-                attachmentsPacket.ObjectData[i].ItemFlags = attachments[i].Flags;
-                attachmentsPacket.ObjectData[i].ItemID = attachments[i].ItemID;
-                attachmentsPacket.ObjectData[i].Name = Helpers.StringToField(attachments[i].Name);
-                attachmentsPacket.ObjectData[i].Description = Helpers.StringToField(attachments[i].Description);
-                attachmentsPacket.ObjectData[i].NextOwnerMask = attachments[i].NextOwnerMask;
-                attachmentsPacket.ObjectData[i].OwnerID = attachments[i].OwnerID;
-            }
-
-            Client.Network.SendPacket(attachmentsPacket);
-        }
-
-        #endregion
-
-
-        /// <summary>
-        /// Creates and sends an AgentIsNowWearing packet based on the local cached AgentWearablesData array.
-        /// </summary>
-        protected void SendAgentIsNowWearing()
-        {
-            AgentIsNowWearingPacket nowWearing = new AgentIsNowWearingPacket();
-            nowWearing.AgentData.AgentID = Client.Network.AgentID;
-            nowWearing.AgentData.SessionID = Client.Network.SessionID;
-            nowWearing.WearableData = new AgentIsNowWearingPacket.WearableDataBlock[13];
-            for (byte i = 0; i <= 12; i++)
-            {
-                nowWearing.WearableData[i] = new AgentIsNowWearingPacket.WearableDataBlock();
-                nowWearing.WearableData[i].WearableType = i;
-                nowWearing.WearableData[i].ItemID = AgentWearablesData[i].ItemID;
-            }
-
-            Client.Network.SendPacket(nowWearing);
-        }
-
-        /// <summary>
-        /// Update the local Avatar Appearance information based on the contents of the assets as defined in the cached wearable data info.
-        /// </summary>
-        protected void GetAvatarAppearanceInfoFromWearableAssets()
-        {
-            // Make sure we have some Wearable Data to start with.
-            if (AgentWearablesSignal.WaitOne(1000, false) == false)
-            {
-                Client.Log("Cannot get Visual Param data from wearable assets.  AgentWearablesSignal not set.", Helpers.LogLevel.Error);
-                return;
-            }
-
-            // Clear current look
-            AgentTextureEntry = new LLObject.TextureEntry("C228D1CF4B5D4BA884F4899A0796AA97"); // if this isn't valid, blame JH ;-)
-            AgentAppearanceParams = new SerializableDictionary<int, float>();
-
-
-            // Build params and texture entries from wearable data
-            foreach (AgentWearablesUpdatePacket.WearableDataBlock wdb in AgentWearablesData)
-            {
-                if (wdb.ItemID == LLUUID.Zero)
-                {
-                    continue;
-                }
-
-
-                AssetWearable wearableAsset;
-
-                switch (wdb.WearableType)
-                {
-                    case 0:
-                    case 1:
-                    case 2:
-                    case 3:
-                        wearableAsset = new AssetWearable_Body(wdb.AssetID, null);
-                        break;
-                    default:
-                        wearableAsset = new AssetWearable_Clothing(wdb.AssetID, null);
-                        break;
-                }
-
-                AssetRequestDownload request = Client.Assets.RequestInventoryAsset(wearableAsset.AssetID, wearableAsset.Type);
-                if (request.Wait(AssetManager.DefaultTimeout) != AssetRequestDownload.RequestStatus.Success)
-                {
-                    Client.Log("Asset (" + wearableAsset.AssetID.ToStringHyphenated() + ") unavailable (" + request.StatusMsg + ")", Helpers.LogLevel.Error);
-                }
-                else
-                {
-                    wearableAsset.SetAssetData(request.GetAssetData());
-                }
-
-                if ((wearableAsset.AssetData == null) || (wearableAsset.AssetData.Length == 0))
-                {
-                    Client.Log("Asset retrieval failed for AssetID: " + wearableAsset.AssetID, Helpers.LogLevel.Warning);
-                }
-
-                UpdateAgentTextureEntryAndAppearanceParams(wearableAsset);
-
-            }
-
-
-            UpdateAgentTextureEntryOrder();
-        }
-
-        /// <summary>
-        /// TextureEntry must have it's face textures in a specific order for avatars.
-        /// Should be called at least once before sending an AgentSetAppearance packet.
-        /// </summary>
-        protected void UpdateAgentTextureEntryOrder()
-        {
-            // Correct the order of the textures
-            foreach (uint faceid in AgentTextureEntry.FaceTextures.Keys)
-            {
-                if (faceid > 18)
-                {
-                    Client.Log("Unknown order for FaceID: " + faceid + Environment.NewLine +
-                        "Your wearables define a face that we don't know the order of.  Please " +
-                        "capture a AgentSetAppearance packet for your current outfit and submit to " +
-                        "static.sprocket@gmail.com, thanks!", Helpers.LogLevel.Info);
-                    break;
-                }
-            }
-
-            //Re-order texture faces to match Linden Labs internal data structure.
-            LLObject.TextureEntry te2 = new LLObject.TextureEntry(AgentTextureEntry.DefaultTexture.TextureID);
-            te2.CreateFace(18).TextureID = AgentTextureEntry.GetFace(18).TextureID;
-            te2.CreateFace(17).TextureID = AgentTextureEntry.GetFace(17).TextureID;
-            te2.CreateFace(16).TextureID = AgentTextureEntry.GetFace(16).TextureID;
-            te2.CreateFace(15).TextureID = AgentTextureEntry.GetFace(15).TextureID;
-            te2.CreateFace(14).TextureID = AgentTextureEntry.GetFace(14).TextureID;
-            te2.CreateFace(13).TextureID = AgentTextureEntry.GetFace(13).TextureID;
-            te2.CreateFace(12).TextureID = AgentTextureEntry.GetFace(12).TextureID;
-            // I wonder if shoes are somewhere in here?
-            te2.CreateFace(7).TextureID = AgentTextureEntry.GetFace(7).TextureID;
-            te2.CreateFace(6).TextureID = AgentTextureEntry.GetFace(6).TextureID;
-            te2.CreateFace(5).TextureID = AgentTextureEntry.GetFace(5).TextureID;
-            te2.CreateFace(4).TextureID = AgentTextureEntry.GetFace(4).TextureID;
-            te2.CreateFace(3).TextureID = AgentTextureEntry.GetFace(3).TextureID;
-            te2.CreateFace(2).TextureID = AgentTextureEntry.GetFace(2).TextureID;
-            te2.CreateFace(1).TextureID = AgentTextureEntry.GetFace(1).TextureID;
-            te2.CreateFace(0).TextureID = AgentTextureEntry.GetFace(0).TextureID;
-
-            AgentTextureEntry = te2;
-        }
-
-        /// <summary>
-        /// Updates the TextureEntry and Appearance Param structures with the data from an asset wearable.
-        /// Called once for each weable asset.
-        /// </summary>
-        /// <param name="wearableAsset"></param>
-        protected void UpdateAgentTextureEntryAndAppearanceParams(AssetWearable wearableAsset)
-        {
-
-            try
-            {
-                foreach (KeyValuePair<uint, LLUUID> texture in wearableAsset.Textures)
-                {
-                    AgentTextureEntry.CreateFace(texture.Key).TextureID = texture.Value;
-                }
-
-                lock (AgentAppearanceParams)
-                {
-                    foreach (KeyValuePair<int, float> kvp in wearableAsset.Parameters)
-                    {
-                        AgentAppearanceParams[kvp.Key] = kvp.Value;
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                Client.Log(e.ToString() + Environment.NewLine + wearableAsset.AssetDataToString(), Helpers.LogLevel.Error);
-            }
-        }
-
-        /// <summary>
-        /// Non-blocking async request of wearables, construction and sending of AgentSetAppearance
-        /// </summary>
-        public void BeginAgentSendAppearance()
-        {
-            AgentWearablesSignal.Reset();
-
-            AgentWearablesRequestPacket p = new AgentWearablesRequestPacket();
-            p.AgentData.AgentID = Client.Network.AgentID;
-            p.AgentData.SessionID = Client.Network.SessionID;
-            Client.Network.SendPacket(p);
-        }
-
-        /// <summary>
-        /// Send an AgentSetAppearance packet to the server to update your appearance.
-        /// </summary>
-
-        protected void SendAgentSetAppearance()
-        {
-            // Get latest appearance info
-            GetAvatarAppearanceInfoFromWearableAssets();
-
-            AgentSetAppearancePacket p = new AgentSetAppearancePacket();
-            p.AgentData.AgentID = Client.Network.AgentID;
-            p.AgentData.SessionID = Client.Network.SessionID;
-            p.AgentData.SerialNum = SerialNum++;
-
-            // Add Texture Data
-            p.ObjectData.TextureEntry = AgentTextureEntry.ToBytes();
-
-
-            p.VisualParam = new AgentSetAppearancePacket.VisualParamBlock[218];
-
-            string visualParamData = "";
-            int vpIndex = 0;
-
-            // Add Visual Params
-            lock (AgentAppearanceParams)
-            {
-                foreach (KeyValuePair<int,VisualParam> kvp in VisualParams.Params)
-                {
-                    VisualParam param = kvp.Value;
-                    p.VisualParam[vpIndex] = new AgentSetAppearancePacket.VisualParamBlock();
-
-                    visualParamData += vpIndex + "," + param.ParamID + ",";
-
-                    if (AgentAppearanceParams.ContainsKey(param.ParamID))
-                    {
-                        p.VisualParam[vpIndex].ParamValue = Helpers.FloatToByte(AgentAppearanceParams[param.ParamID],
-                            param.MinValue, param.MaxValue);
-
-                        visualParamData += AgentAppearanceParams[param.ParamID] + "," + p.VisualParam[vpIndex].ParamValue + Environment.NewLine;
-                    }
-                    else
-                    {
-                        // Use the default value for this parameter
-                        p.VisualParam[vpIndex].ParamValue = Helpers.FloatToByte(param.DefaultValue, param.MinValue,
-                            param.MaxValue);
-
-                        visualParamData += "NA," + p.VisualParam[vpIndex].ParamValue + Environment.NewLine;
-
-                    }
-
-                    vpIndex++;
-                }
-
-
-            }
-
-            // Add Size Data
-            p.AgentData.Size = GetAgentSizeFromVisualParam(Helpers.ByteToFloat(p.VisualParam[33].ParamValue,
-                VisualParams.Params[33].MinValue, VisualParams.Params[33].MaxValue));
-
-            Client.Network.SendPacket(p);
-        }
-
-        /// <summary>
-        /// Determine agent size for AgentSetAppearance based on Visual Param data.
-        /// </summary>
-        /// <param name="heightParam"></param>
-        /// <returns></returns>
-        protected LLVector3 GetAgentSizeFromVisualParam(float heightParam)
-        {
-            float AV_Height_Range = 2.025506f - 1.50856f;
-            float AV_Height = 1.50856f + ((heightParam / 255.0f) * AV_Height_Range);
-            return new LLVector3(0.45f, 0.6f, AV_Height);
-            //return new LLVector3(0.45f, 0.6f, 1.0f);
-        }
-
-        #region Callback Handlers
-
-        private void AgentWearablesUpdateCallbackHandler(Packet packet, Simulator simulator)
-        {
-            AgentWearablesUpdatePacket wearablesPacket = (AgentWearablesUpdatePacket)packet;
-
-            AgentWearablesData = wearablesPacket.WearableData;
-            AgentWearablesSignal.Set();
-
-            // Grab access mutex...
-            WearableCacheQueueMutex.WaitOne();
-
-            // Queue download of wearables
-            foreach (AgentWearablesUpdatePacket.WearableDataBlock wdb in AgentWearablesData)
-            {
-
-                // Don't try to download if AssetID is zero
-                if (wdb.AssetID == LLUUID.Zero)
-                {
-                    continue;
-                }
-
-                // Don't try to download, if it's already cached.
-                if (WearableCache.ContainsKey(wdb.AssetID))
-                {
-                    AssetWearable aw = WearableCache[wdb.AssetID];
-                    if (aw._AssetData != null)
-                    {
-                        continue;
-                    }
-                }
-
-                // Don't try to download, if it's already in the download queue
-                lock (WearableAssetQueue)
-                {
-                    if (WearableAssetQueue.Contains(wdb.AssetID))
-                    {
-                        continue;
-                    }
-                }
-
-                AssetWearable wearableAsset;
-
-                switch (wdb.WearableType)
-                {
-                    case 0:
-                    case 1:
-                    case 2:
-                    case 3:
-                        wearableAsset = new AssetWearable_Body(wdb.AssetID, null);
-                        break;
-                    default:
-                        wearableAsset = new AssetWearable_Clothing(wdb.AssetID, null);
-                        break;
-                }
-
-                WearableCache[wdb.AssetID] = wearableAsset;
-
-                lock (WearableAssetQueue)
-                {
-                    if (!WearableAssetQueue.Contains(wdb.AssetID))
-                    {
-                        WearableAssetQueue.Add(wdb.AssetID);
-
-                        LogWearableAssetQueueActivity("Added wearable asset to download queue: " + wearableAsset.GetType().Name + " : " + wdb.AssetID);
-                    }
-                }
-            }
-
-            RequestNextQueuedWearableAsset();
-
-            WearableCacheQueueMutex.ReleaseMutex();
-        }
-
-        /// <summary>
-        /// Sends a request for the next wearable asset.
-        /// </summary>
-        protected void RequestNextQueuedWearableAsset()
-        {
-            lock (WearableAssetQueue)
-            {
-                if (WearableAssetQueue.Count > 0)
-                {
-                    AssetWearable wearableAsset = WearableCache[WearableAssetQueue[0]];
-                    /*AssetRequestDownload request =*/Client.Assets.RequestInventoryAsset(wearableAsset.AssetID, wearableAsset.Type);
-                    LogWearableAssetQueueActivity("Requesting: " + wearableAsset.AssetID);
-                }
-                else
-                {
-                    if (AgentWearablesSignal.WaitOne(0, false) == true)
-                    {
-                        // Send updated AgentSetAppearance
-                        SendAgentSetAppearance();
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// use to debug wearable asset queue activity
-        /// </summary>
-        /// <param name="msg"></param>
-        protected void LogWearableAssetQueueActivity(string msg)
-        {
-            if (LogWearableAssetQueue)
-            {
-                StringBuilder sb = new StringBuilder();
-                sb.AppendLine("==================");
-                sb.AppendLine(msg);
-                sb.AppendLine("Current Queue:");
-                foreach (LLUUID uuid in WearableAssetQueue)
-                {
-                    sb.AppendLine(" ** " + uuid.ToStringHyphenated());
-                }
-                Client.Log(sb.ToString(), Helpers.LogLevel.Info);
-            }
-        }
-
-        /// <summary>
-        /// Called each time a wearable asset is done downloading
-        /// </summary>
-        /// <param name="request"></param>
-        void AManager_TransferRequestCompletedEvent(AssetRequest request)
-        {
-            if( !(request is AssetRequestDownload) )
-            {
-                return;
-            }
-
-            AssetRequestDownload dlrequest = (AssetRequestDownload)request;
-
-            if (dlrequest.AssetID == null)
-            {
-                Client.Log("AssetID is null in AssetRequestDownload: " + dlrequest.StatusMsg, Helpers.LogLevel.Error);
-            }
-
-            WearableCacheQueueMutex.WaitOne();
-
-            // Remove from the download queue
-            lock (WearableAssetQueue)
-            {
-                if (!WearableAssetQueue.Contains(dlrequest.AssetID))
-                {
-                    // Looks like we got an asset for something other then what we're waiting for, ignore it
-                    WearableCacheQueueMutex.ReleaseMutex();
-
-                    return;
-                }
-            }
-
-            // Since we got a response for this asset, remove it from the queue
-            WearableAssetQueue.Remove(dlrequest.AssetID);
-            LogWearableAssetQueueActivity("Received queued asset, and removed: " + dlrequest.AssetID);
-
-            // If the request wasn't successful, then don't try to process it.
-            if (request.Status != AssetRequest.RequestStatus.Success)
-            {
-                Client.Log("Error downloading wearable asset: " + dlrequest.AssetID, Helpers.LogLevel.Error);
-                WearableCacheQueueMutex.ReleaseMutex();
-
-                return;
-            }
-
-
-            AssetWearable wearableAsset = WearableCache[dlrequest.AssetID];
-            wearableAsset.SetAssetData(dlrequest.GetAssetData());
-
-            if ((wearableAsset.AssetData == null) || (wearableAsset.AssetData.Length == 0))
-            {
-                Client.Log("Asset retrieval failed for AssetID: " + wearableAsset.AssetID, Helpers.LogLevel.Error);
-                WearableCacheQueueMutex.ReleaseMutex();
-                return;
-            }
-            else
-            {
-                UpdateAgentTextureEntryAndAppearanceParams(wearableAsset);
-
-                UpdateAgentTextureEntryOrder();
-
-                lock(WearableAssetQueue)
-                {
-                    if (WearableAssetQueue.Count > 0)
-                    {
-                        RequestNextQueuedWearableAsset();
-                        WearableCacheQueueMutex.ReleaseMutex();
-                        return;
-
-                    }
-                }
-
-                // Now that all the wearable assets are done downloading,
-                // send an appearance packet
-                SendAgentSetAppearance();
-
-                WearableCacheQueueMutex.ReleaseMutex();
-                return;
-            }
-        }
-
-        #endregion
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/Asset.cs b/old/libsl1550/libsecondlife/AssetSystem/Asset.cs
deleted file mode 100644
index 10af2e6..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/Asset.cs
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-	/// Summary description for Asset.
-	/// </summary>
-	public class Asset
-	{
-/*
-		public const sbyte ASSET_TYPE_NOTECARD = 7;
-        public const sbyte ASSET_TYPE_IMAGE    = 0;
-        public const sbyte ASSET_TYPE_WEARABLE_BODY = 13;
-        public const sbyte ASSET_TYPE_WEARABLE_CLOTHING = 5;
-        public const sbyte ASSET_TYPE_SCRIPT = 10;
-*/
-        public enum AssetType : sbyte
-        {
-            /// <summary>Unknown asset type</summary>
-            Unknown = -1,
-
-            /// <summary>Texture asset, stores in JPEG2000 J2C stream format</summary>
-            Texture = 0,
-
-            /// <summary>Sound asset</summary>
-            Sound = 1,
-
-            /// <summary>Calling card for another avatar</summary>
-            CallingCard = 2,
-
-            /// <summary>Link to a location in world</summary>
-            Landmark = 3,
-
-            /// <summary>Legacy script asset, you should never see one of these</summary>
-            [Obsolete]
-            Script = 4,
-
-            /// <summary>Collection of textures and parameters that can be
-            /// worn by an avatar</summary>
-            Clothing = 5,
-
-            /// <summary>Primitive that can contain textures, sounds,
-            /// scripts and more</summary>
-            Object = 6,
-
-            /// <summary>Notecard asset</summary>
-            Notecard = 7,
-
-            /// <summary>Holds a collection of inventory items</summary>
-            Folder = 8,
-
-            /// <summary>Root inventory folder</summary>
-            RootFolder = 9,
-
-            /// <summary>Linden scripting language script</summary>
-            LSLText = 10,
-
-            /// <summary>LSO bytecode for a script</summary>
-            LSLBytecode = 11,
-
-            /// <summary>Uncompressed TGA texture</summary>
-            TextureTGA = 12,
-
-            /// <summary>Collection of textures and shape parameters that can
-            /// be worn</summary>
-            Bodypart = 13,
-
-            /// <summary>Trash folder</summary>
-            TrashFolder = 14,
-
-            /// <summary>Snapshot folder</summary>
-            SnapshotFolder = 15,
-
-            /// <summary>Lost and found folder</summary>
-            LostAndFoundFolder = 16,
-
-            /// <summary>Uncompressed sound</summary>
-            SoundWAV = 17,
-
-            /// <summary>Uncompressed TGA non-square image, not to be used as a
-            /// texture</summary>
-            ImageTGA = 18,
-
-            /// <summary>Compressed JPEG non-square image, not to be used as a
-            /// texture</summary>
-            ImageJPEG = 19,
-
-            /// <summary>Animation</summary>
-            Animation = 20,
-
-            /// <summary>Sequence of animations, sounds, chat, and pauses</summary>
-            Gesture = 21,
-
-            /// <summary>Simstate file</summary>
-            Simstate = 22
-        }
-
-		public LLUUID AssetID;
-
-		public sbyte Type;
-		public bool Tempfile;
-
-
-		internal byte[] _AssetData;
-        public byte[] AssetData
-        {
-            get
-            {
-                return _AssetData;
-            }
-        }
-
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="type"></param>
-        /// <param name="tempfile"></param>
-        /// <param name="assetData"></param>
-        public Asset(LLUUID assetID, sbyte type, bool tempfile, byte[] assetData)
-		{
-			AssetID		= assetID;
-			Type		= (sbyte)type;
-			Tempfile	= tempfile;
-			_AssetData	= assetData;
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="type"></param>
-        /// <param name="assetData"></param>
-        public Asset(LLUUID assetID, sbyte type, byte[] assetData)
-		{
-			AssetID		= assetID;
-			Type		= (sbyte)type;
-			Tempfile	= false;
-			_AssetData	= assetData;
-		}
-
-        /// <summary>
-        /// Return this asset's data as a pretty printable string.
-        /// </summary>
-		public string AssetDataToString()
-		{
-            return Helpers.FieldToUTF8String((byte[])_AssetData);
-		}
-
-        public virtual void SetAssetData(byte[] data)
-        {
-            _AssetData = data;
-        }
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetImage.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetImage.cs
deleted file mode 100644
index fada9b9..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetImage.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-	/// Summary description for AssetNotecard.
-	/// </summary>
-	public class AssetImage : Asset
-	{
-		public byte[] J2CData
-		{
-			get
-			{
-				return AssetData;
-			}
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="assetData"></param>
-        public AssetImage(LLUUID assetID, byte[] assetData)
-            : base(assetID, (sbyte)Asset.AssetType.Texture, false, assetData)
-		{
-		}
-
-
-
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetLandmark.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetLandmark.cs
deleted file mode 100644
index f9e87a0..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetLandmark.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-	/// Summary description for AssetLandmark.
-	/// </summary>
-	public class AssetLandmark : Asset
-	{
-		internal int _Version = 0;
-
-		public int Version
-		{
-			get { return _Version; }
-		}
-
-		internal LLVector3 _Pos = LLVector3.Zero;
-		public LLVector3 Pos
-		{
-			get { return _Pos; }
-			set {
-				_Pos = value;
-				setAsset();
-			}
-		}
-
-		internal LLUUID _Region = LLUUID.Zero;
-		public LLUUID Region
-		{
-			get { return _Region; }
-			set {
-				_Region = value;
-				setAsset();
-			}
-		}
-
-		private string _Body = "";
-		public string Body
-		{
-			get { return _Body; }
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="assetData"></param>
-        public AssetLandmark(LLUUID assetID, byte[] assetData)
-            : base(assetID, (sbyte)Asset.AssetType.Landmark, false, null)
-		{
-			_AssetData = assetData;
-
-			string temp	= System.Text.Encoding.UTF8.GetString(assetData).Trim();
-			processLandmark(temp);
-			_Body = temp;
-		}
-
-		private void processLandmark(string temp)
-		{
-			Console.Write(temp + "\n");
-			string[] parts = temp.Split('\n');
-			int.TryParse(parts[0].Substring(17, 1), out _Version);
-			LLUUID.TryParse(parts[1].Substring(10, 36), out _Region);
-			LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out _Pos);
-		}
-
-	        private void setAsset()
-		{
-			string body = "Landmark version " + _Version.ToString() + "\n";
-			body += "region_id " + _Region.ToStringHyphenated() + "\n";
-			body += "local_pos " + _Pos.X.ToString() + " " + _Pos.Y.ToString() + " " + _Pos.Z.ToString();
-			// Assume this is a string, add 1 for the null terminator
-			byte[] stringBytes = System.Text.Encoding.UTF8.GetBytes((string)body);
-			byte[] assetData = new byte[stringBytes.Length + 1];
-	                Buffer.BlockCopy(stringBytes, 0, assetData, 0, stringBytes.Length);
-
-			SetAssetData( assetData );
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetManager.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetManager.cs
deleted file mode 100644
index cb0c345..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetManager.cs
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-//#define DEBUG_PACKETS
-
-using System;
-using System.Collections.Generic;
-
-using libsecondlife;
-
-using libsecondlife.InventorySystem;
-
-using libsecondlife.Packets;
-using System.Threading;
-
-namespace libsecondlife.AssetSystem
-{
-    public enum AssetPermission : uint
-    {
-        All = 0x7FFFFFFF,
-        Copy = 0x00008000,
-        Modify = 0x00004000,
-        Transfer = 0x00002000,
-        Move = 0x00080000
-    }
-
-    public class AssetPermissionException : Exception
-    {
-        private InventoryItem _Item;
-        public InventoryItem Item
-        {
-            get { return _Item; }
-        }
-        private SecondLife _Client;
-        public SecondLife Client
-        {
-            get { return _Client; }
-        }
-
-        public AssetPermissionException(InventoryItem item, SecondLife client, string message)
-            : base (message)
-        {
-            _Item = item;
-            _Client = client;
-        }
-    }
-
-	/// <summary>
-	/// Summary description for AssetManager.
-	/// </summary>
-	public class AssetManager
-	{
-
-
-		protected SecondLife slClient;
-
-        protected AssetRequestUpload curUploadRequest = null;
-        protected Dictionary<LLUUID, AssetRequestDownload> htDownloadRequests = new Dictionary<LLUUID, AssetRequestDownload>();
-
-        /// <summary>
-        /// Time to wait for next packet, during an asset download.
-        /// </summary>
-        public readonly static int DefaultTimeout = 10000;
-
-        /// <summary>
-        /// Event singaling an asset transfer request has completed.
-        /// </summary>
-        /// <param name="request"></param>
-        public delegate void On_TransferRequestCompleted(AssetRequest request);
-        public event On_TransferRequestCompleted TransferRequestCompletedEvent;
-
-        /// <summary>
-        /// </summary>
-        /// <param name="client"></param>
-        public AssetManager(SecondLife client)
-		{
-			slClient = client;
-
-            // Need to know when we're Connected/Disconnected to clear state
-            slClient.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
-            slClient.Network.OnConnected += new NetworkManager.ConnectedCallback(Network_OnConnected);
-
-			// Used to upload small assets, or as an initial start packet for large transfers
-            slClient.Network.RegisterCallback(PacketType.AssetUploadComplete, new NetworkManager.PacketCallback(AssetUploadCompleteCallbackHandler));
-			// Transfer Packets for downloading large assets
-            slClient.Network.RegisterCallback(PacketType.TransferInfo, new NetworkManager.PacketCallback(TransferInfoCallbackHandler));
-            slClient.Network.RegisterCallback(PacketType.TransferPacket, new NetworkManager.PacketCallback(TransferPacketCallbackHandler));
-			// XFer packets for uploading large assets
-            slClient.Network.RegisterCallback(PacketType.ConfirmXferPacket, new NetworkManager.PacketCallback(ConfirmXferPacketCallbackHandler));
-            slClient.Network.RegisterCallback(PacketType.RequestXfer, new NetworkManager.PacketCallback(RequestXferCallbackHandler));
-        }
-
-        #region State Handling
-        private void Network_OnConnected(object sender)
-        {
-            ClearState();
-        }
-
-        private void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message)
-        {
-            ClearState();
-        }
-
-        protected void ClearState()
-        {
-            htDownloadRequests.Clear();
-            curUploadRequest = null;
-        }
-        #endregion
-
-        #region Asset Uploading
-
-        /// <summary>
-        /// Upload an asset to Second Life
-        /// </summary>
-        /// <param name="asset">The asset to be uploaded</param>
-        /// <returns>The Asset ID of the completed upload</returns>
-        public LLUUID UploadAsset(Asset asset)
-		{
-            if (curUploadRequest != null)
-            {
-                throw new Exception("An existing asset upload is currently in-progress.");
-            }
-
-            try
-            {
-                curUploadRequest = new AssetRequestUpload(slClient, LLUUID.Random(), asset);
-
-                LLUUID assetID = curUploadRequest.DoUpload();
-                if (asset.Type == (sbyte)Asset.AssetType.Texture)
-                {
-                    SinkFee();
-                }
-                return assetID;
-            }
-            finally
-            {
-                curUploadRequest = null;
-            }
-        }
-
-        /// <summary>
-        /// Handle the appropriate sink fee associated with an asset upload
-        /// </summary>
-        protected void SinkFee()
-        {
-            slClient.Self.GiveMoney(LLUUID.Zero, slClient.Settings.UPLOAD_COST, "Image Upload");
-        }
-
-        #endregion
-
-        #region Download Assets
-
-        /// <summary>
-        /// Get the Asset data for an item, must be used when requesting a Notecard
-        /// </summary>
-        /// <remarks>It is the responsibility of the calling party to retrieve the asset data from the request object when it is compelte.</remarks>
-        /// <param name="item"></param>
-        public AssetRequestDownload RequestInventoryAsset(InventoryItem item)
-		{
-            if (!(item is InventoryWearable))
-            {
-                if ((item.OwnerMask & (uint)AssetPermission.Copy) == 0)
-                    throw new AssetPermissionException(item, slClient, "Asset data refused, Copy permission needed.");
-                if ((item.OwnerMask & (uint)AssetPermission.Modify) == 0 && (item.Type == 10))
-                    throw new AssetPermissionException(item, slClient, "Asset data refused, Modify permission needed for scripts.");
-            }
-
-			LLUUID TransferID = LLUUID.Random();
-
-            AssetRequestDownload request = new AssetRequestDownload(slClient.Assets, TransferID, item.AssetID);
-            request.UpdateLastPacketTime(); // last time we recevied a packet for this request
-
-            htDownloadRequests[TransferID] = request;
-
-            // prep packet based on asset type
-            Packet packet;
-            switch (item.Type)
-            {
-                case 5:  //Shirt
-                case 13: //Bodyshape
-                    packet = AssetPacketHelpers.TransferRequestDirect(slClient.Network.SessionID, slClient.Network.AgentID, TransferID, item.AssetID, item.Type);
-                    break;
-                default:
-			        packet = AssetPacketHelpers.TransferRequest(slClient.Network.SessionID, slClient.Network.AgentID, TransferID, item );
-                    break;
-            }
-
-            // Send packet
-            slClient.Network.SendPacket(packet);
-
-            #if DEBUG_PACKETS
-                slClient.Log(packet.ToString(), Helpers.LogLevel.Info);
-            #endif
-
-            return request;
-        }
-
-        /// <summary>
-        /// Get Asset data, works with BodyShapes (type 13) but does not work with Notecards(type 7)
-        /// </summary>
-        public AssetRequestDownload RequestInventoryAsset(LLUUID AssetID, sbyte Type)
-		{
-			LLUUID TransferID = LLUUID.Random();
-
-            AssetRequestDownload request = new AssetRequestDownload(slClient.Assets, TransferID, AssetID);
-            request.UpdateLastPacketTime(); // last time we recevied a packet for this request
-
-            htDownloadRequests[TransferID] = request;
-
-            Packet packet = AssetPacketHelpers.TransferRequestDirect(slClient.Network.SessionID, slClient.Network.AgentID, TransferID, AssetID, Type);
-			slClient.Network.SendPacket(packet);
-
-            #if DEBUG_PACKETS
-            slClient.Log(packet.ToString(), Helpers.LogLevel.Info);
-            #endif
-
-            return request;
-
-        }
-
-        #endregion
-
-        #region Event Generation
-        internal void FireTransferRequestCompletedEvent(AssetRequest request)
-        {
-            if (TransferRequestCompletedEvent != null)
-            {
-                TransferRequestCompletedEvent(request);
-            }
-        }
-        #endregion
-
-        #region Deprecated Methods
-        /// <summary>
-        /// Get the Asset data for an item, must be used when requesting a Notecard
-        /// </summary>
-        /// <param name="item"></param>
-        [Obsolete("Use RequestInventoryAsset instead.", false)]
-        public void GetInventoryAsset(InventoryItem item)
-        {
-            RequestInventoryAsset(item).Wait(-1);
-        }
-
-        /// <summary>
-        /// Get Asset data, works with BodyShapes (type 13) but does not work with Notecards(type 7)
-        /// </summary>
-        /// <param name="asset"></param>
-        [Obsolete("Use RequestInventoryAsset instead.", false)]
-        public void GetInventoryAsset(Asset asset)
-        {
-            AssetRequestDownload request = RequestInventoryAsset(asset.AssetID, asset.Type);
-            request.Wait(-1);
-            asset.SetAssetData(request.GetAssetData());
-        }
-        #endregion
-
-        #region Callback Handlers (Uploading)
-
-        private void AssetUploadCompleteCallbackHandler(Packet packet, Simulator simulator)
-		{
-            #if DEBUG_PACKETS
-                slClient.Log(packet.ToString(), Helpers.LogLevel.Info);
-            #endif
-
-            if (curUploadRequest == null) return;
-
-            Packets.AssetUploadCompletePacket reply = (AssetUploadCompletePacket)packet;
-
-            if (reply.AssetBlock.Success)
-            {
-                curUploadRequest.UploadComplete(reply.AssetBlock.UUID, AssetRequest.RequestStatus.Success);
-            }
-            else
-            {
-                curUploadRequest.UploadComplete(reply.AssetBlock.UUID, AssetRequest.RequestStatus.Failure);
-            }
-
-            if (TransferRequestCompletedEvent != null)
-            {
-                try { TransferRequestCompletedEvent(curUploadRequest); }
-                catch (Exception e) { slClient.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-		}
-
-        private void RequestXferCallbackHandler(Packet packet, Simulator simulator)
-		{
-            #if DEBUG_PACKETS
-                slClient.Log(packet.ToString(), Helpers.LogLevel.Info);
-            #endif
-
-            RequestXferPacket reply = (RequestXferPacket)packet;
-
-            ulong XferID = reply.XferID.ID;
-			// LLUUID AssetID = reply.XferID.VFileID; //Not used...
-
-            if (curUploadRequest != null) curUploadRequest.RequestXfer(XferID);
-        }
-
-        private void ConfirmXferPacketCallbackHandler(Packet packet, Simulator simulator)
-        {
-            #if DEBUG_PACKETS
-                slClient.Log(packet.ToString(), Helpers.LogLevel.Info);
-            #endif
-
-            ConfirmXferPacketPacket reply = (ConfirmXferPacketPacket)packet;
-
-            if (curUploadRequest != null) curUploadRequest.ConfirmXferPacket(reply.XferID.ID, reply.XferID.Packet);
-        }
-
-        #endregion
-
-        #region Callback Handlers (Downloading)
-
-        // Download stuff
-        private void TransferInfoCallbackHandler(Packet packet, Simulator simulator)
-        {
-            #if DEBUG_PACKETS
-                slClient.Log(packet.ToString(), Helpers.LogLevel.Info);
-            #endif
-
-            TransferInfoPacket reply = (TransferInfoPacket)packet;
-
-            LLUUID TransferID = reply.TransferInfo.TransferID;
-            int Size = reply.TransferInfo.Size;
-            int Status = reply.TransferInfo.Status;
-
-            //TODO: AssetID should be pulled out of the TransferInfo, if available
-
-            // Lookup the request for this packet
-            if (!htDownloadRequests.ContainsKey(TransferID))
-            {
-                //slClient.Log("Received unexpected TransferInfo packet." + Environment.NewLine + packet.ToString(),
-                //    Helpers.LogLevel.Warning);
-                return;
-            }
-            AssetRequestDownload request = htDownloadRequests[TransferID];
-
-            // Mark it as either not found or update the request information
-            if (Status == -2)
-            {
-                request.SetExpectedSize(Size);
-                request.Fail("Asset Status -2 :: Likely Status Not Found");
-            }
-            else
-            {
-                request.SetExpectedSize(Size);
-            }
-        }
-
-        private void TransferPacketCallbackHandler(Packet packet, Simulator simulator)
-        {
-            #if DEBUG_PACKETS
-                slClient.Log(packet.ToString(), Helpers.LogLevel.Info);
-            #endif
-
-            TransferPacketPacket reply = (TransferPacketPacket)packet;
-
-            LLUUID TransferID = reply.TransferData.TransferID;
-            byte[] Data = reply.TransferData.Data;
-
-
-            // Lookup the request for this packet
-            if (!htDownloadRequests.ContainsKey(TransferID))
-            {
-                //slClient.Log("Received unexpected TransferPacket packet." + Environment.NewLine + packet.ToString(),
-                //    Helpers.LogLevel.Warning);
-                return;
-            }
-            AssetRequestDownload request = htDownloadRequests[TransferID];
-
-            // Append data to data received.
-            request.AddDownloadedData(reply.TransferData.Packet, Data);
-        }
-
-        #endregion
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetNotecard.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetNotecard.cs
deleted file mode 100644
index 20b88b2..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetNotecard.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-	/// Summary description for AssetNotecard.
-	/// </summary>
-	public class AssetNotecard : Asset
-	{
-		private string _Body = "";
-		public string Body
-		{
-			get { return _Body; }
-			set
-			{
-				_Body = value.Replace("\r", "");
-				setAsset( _Body );
-			}
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="body"></param>
-        public AssetNotecard(LLUUID assetID, string body)
-            : base(assetID, (sbyte)Asset.AssetType.Notecard, false, null)
-		{
-			_Body = body;
-			setAsset( body );
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="assetData"></param>
-        public AssetNotecard(LLUUID assetID, byte[] assetData)
-            : base(assetID, (sbyte)Asset.AssetType.Notecard, false, null)
-		{
-			_AssetData = assetData;
-
-			string temp	= System.Text.Encoding.UTF8.GetString(assetData).Trim();
-
-			// TODO: Calculate the correct header size to look for
-			// it's usually around 80 or so...
-			if( temp.Length > 50 )
-			{
-				// Trim trailing null terminator
-				temp = temp.Substring(0,temp.Length-1);
-
-				// Remove the header
-				temp = temp.Substring(temp.IndexOf("}") + 2);
-				temp = temp.Substring(temp.IndexOf('\n') + 1);
-
-				// Remove trailing close brace
-				temp = temp.Substring(0,temp.Length-2);
-			}
-			_Body = temp;
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="body"></param>
-        private void setAsset(string body)
-		{
-			// Format the string body into Linden text
-			string lindenText = "Linden text version 1\n";
-			lindenText += "{\n";
-			lindenText += "LLEmbeddedItems version 1\n";
-			lindenText += "{\n";
-			lindenText += "count 0\n";
-			lindenText += "}\n";
-			lindenText += "Text length " + body.Length + "\n";
-			lindenText += body;
-			lindenText += "}\n";
-
-
-
-			// Assume this is a string, add 1 for the null terminator
-			byte[] stringBytes = System.Text.Encoding.UTF8.GetBytes((string)lindenText);
-			byte[] assetData = new byte[stringBytes.Length + 1];
-            Buffer.BlockCopy(stringBytes, 0, assetData, 0, stringBytes.Length);
-
-			SetAssetData( assetData );
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetPacketHelpers.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetPacketHelpers.cs
deleted file mode 100644
index 55cd68a..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetPacketHelpers.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-using libsecondlife;
-using libsecondlife.InventorySystem;
-using libsecondlife.Packets;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-	/// </summary>
-    public class AssetPacketHelpers
-	{
-        private const bool DEBUG_PACKETS = true;
-
-        /// <summary>
-        /// Upload a small asset where the entire asset will fit in a single packet (less then 500 bytes)
-        /// </summary>
-        /// <param name="asset"></param>
-        public static Packet AssetUploadRequest(Asset asset, LLUUID TransactionID)
-		{
-            if (asset._AssetData.Length > 1000)
-            {
-                throw new Exception("Asset too large to use AssetUploadRequest, use AssetUploadRequestHaderOnly() instead.");
-            }
-
-            AssetUploadRequestPacket p = new AssetUploadRequestPacket();
-            p.AssetBlock.TransactionID = TransactionID;
-            p.AssetBlock.Type          = asset.Type;
-            p.AssetBlock.Tempfile      = asset.Tempfile;
-            p.AssetBlock.AssetData     = asset._AssetData;
-            p.AssetBlock.StoreLocal    = false;
-
-            return p;
-		}
-
-        /// <summary>
-        /// Send header to SL to let it know that a large asset upload is about to proceed.
-        /// </summary>
-        /// <param name="asset"></param>
-		public static Packet AssetUploadRequestHeaderOnly(Asset asset, LLUUID TransactionID)
-		{
-            AssetUploadRequestPacket p = new AssetUploadRequestPacket();
-            p.AssetBlock.TransactionID = TransactionID;
-            p.AssetBlock.Type          = asset.Type;
-            p.AssetBlock.Tempfile      = asset.Tempfile;
-            p.AssetBlock.AssetData     = new byte[0];
-            p.AssetBlock.StoreLocal    = false;
-
-            return p;
-        }
-
-
-        /// <summary>
-        /// Sends a packet of data to SL
-        /// </summary>
-        /// <param name="id"></param>
-        /// <param name="data">First xferpacket data must include a prefixed S32 for the length of the asset.</param>
-        /// <param name="packetNum"></param>
-        public static Packet SendXferPacket(ulong id, byte[] data, uint packetNum)
-		{
-            SendXferPacketPacket p = new SendXferPacketPacket();
-            p.DataPacket.Data = data;
-
-            p.XferID.ID = id;
-            p.XferID.Packet = (uint)packetNum;
-
-            return p;
-
-		}
-
-        /// <summary>
-		/// Request the download of an asset
-        /// The params field consists of a number of individual data components:
-        /// Params: 1: AgentID
-        /// Params: 2: SessionID
-        /// Params: 3: OwnerID
-        /// Params: 4: TaskID (LLUUID.Zero for assets not contained in an object)
-        /// Params: 5: ItemID
-        /// Params: 6: AssetID (LLUUIZ.Zero if it is unknown)
-        /// Params: 7: Type (32-bit field)
-        /// </summary>
-        /// <param name="SessionID"></param>
-        /// <param name="AgentID"></param>
-        /// <param name="TransferID"></param>
-        /// <param name="item"></param>
-        public static Packet TransferRequest(LLUUID SessionID, LLUUID AgentID, LLUUID TransferID, InventoryItem item)
-		{
-            if (item.Type != 7 && item.Type != 10 && item.Type != 3)
-            {
-                Console.WriteLine("Warning: TransferRequest may not work for items other then notecards of type 7 and scripts of type 10");
-            }
-
-			byte[] param = new byte[100];
-			int pos = 0;
-
-			Buffer.BlockCopy(AgentID.Data, 0, param, pos, 16);
-			pos += 16;
-
-			Buffer.BlockCopy(SessionID.Data, 0, param, pos, 16);
-			pos += 16;
-
-			Buffer.BlockCopy(item.OwnerID.Data, 0, param, pos, 16);
-			pos += 16;
-
-			Buffer.BlockCopy(item.GroupID.Data, 0, param, pos, 16);
-			pos += 16;
-
-			Buffer.BlockCopy(item.ItemID.Data, 0, param, pos, 16);
-			pos += 16;
-
-			Buffer.BlockCopy(item.AssetID.Data, 0, param, pos, 16);
-			pos += 16;
-
-			param[pos] = (byte)item.Type;
-			pos += 1;
-
-
-            TransferRequestPacket p = new TransferRequestPacket();
-            p.TransferInfo.TransferID   = TransferID;
-            p.TransferInfo.Params       = param;
-            p.TransferInfo.ChannelType  = 2;
-            p.TransferInfo.SourceType   = 3;
-            p.TransferInfo.Priority     = (float)101.0;
-            return p;
-        }
-
-        /**
-         * This doesn't seem to work for all asset types... Last noted not working was Notecards
-         **/
-        public static Packet TransferRequestDirect(LLUUID SessionID, LLUUID AgentID, LLUUID TransferID, LLUUID AssetID, sbyte Type)
-        {
-            byte[] param = new byte[20];
-            int pos = 0;
-
-            Buffer.BlockCopy(AssetID.Data, 0, param, pos, 16);
-            pos += 16;
-
-            param[pos] = (byte)Type;
-            pos += 1;
-
-
-            TransferRequestPacket p = new TransferRequestPacket();
-            p.TransferInfo.TransferID = TransferID;
-            p.TransferInfo.Params = param;
-            p.TransferInfo.ChannelType = 2;
-            p.TransferInfo.SourceType = 2;
-            p.TransferInfo.Priority = (float)101.0;
-            return p;
-        }
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetRequest.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetRequest.cs
deleted file mode 100644
index 22de41f..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetRequest.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-//#define DEBUG_PACKETS
-
-using System;
-using System.Collections.Generic;
-
-using libsecondlife;
-
-using libsecondlife.InventorySystem;
-
-using libsecondlife.Packets;
-using System.Threading;
-
-namespace libsecondlife.AssetSystem
-{
-    public class AssetRequest
-    {
-        public enum RequestStatus { Success, Failure };
-
-        protected AssetManager _AssetManager;
-
-        protected LLUUID _TransactionID;
-        public Asset AssetBeingTransferd;
-
-
-        protected ManualResetEvent _Completed = new ManualResetEvent(false);
-
-        protected RequestStatus _Status;
-        public RequestStatus Status
-        {
-            get { return _Status; }
-        }
-
-        protected string _StatusMsg = "";
-        public string StatusMsg
-        {
-            get { return _StatusMsg; }
-        }
-
-        protected int _Size;
-        protected byte[] _AssetData;
-
-        protected uint _LastPacketTime;
-        public uint LastPacketTime { get { return _LastPacketTime; } }
-
-        public uint SecondsSinceLastPacket { get { return Helpers.GetUnixTime() - _LastPacketTime; } }
-
-        public AssetRequest(AssetManager Manager, LLUUID TransID, Asset Asset)
-        {
-            _AssetManager = Manager;
-            _TransactionID = TransID;
-            AssetBeingTransferd = Asset;
-
-            _Size = int.MaxValue;
-
-            UpdateLastPacketTime();
-        }
-
-        public AssetRequest(AssetManager Manager, LLUUID TransID)
-        {
-            _AssetManager = Manager;
-            _TransactionID = TransID;
-            AssetBeingTransferd = null;
-
-            _Size = int.MaxValue;
-
-            UpdateLastPacketTime();
-        }
-
-
-        public void UpdateLastPacketTime()
-        {
-            _LastPacketTime = Helpers.GetUnixTime();
-        }
-
-        /// <summary>
-        /// Wait for this Request to be completed
-        /// </summary>
-        /// <param name="timeout">milliseconds to wait for next packet in download, -1 to wait indefinitely</param>
-        /// <returns></returns>
-        public RequestStatus Wait(int timeout)
-        {
-            return Wait(-1, timeout);
-        }
-
-        /// <summary>
-        /// Wait for this Request to be completed.
-        /// </summary>
-        /// <remarks>Hard Timeout should only be specified if you really can't wait for the download, even though it's still going and may be successful.</remarks>
-        /// <param name="hardTimeout">Return after hardTimeout milliseconds even if download is still in progress, -1 to wait indefinitely</param>
-        /// <param name="softTimeout">How long to wait, before deciding download is stalled, -1 to wait indefinitely</param>
-        /// <returns></returns>
-        public RequestStatus Wait(int hardTimeout, int softTimeout)
-        {
-            UpdateLastPacketTime();
-
-//            uint TimeStarted = LastPacketTime;
-
-            while (!_Completed.WaitOne(900, false))
-            {
-                if ((hardTimeout != -1) && (SecondsSinceLastPacket > hardTimeout))
-                {
-                    _StatusMsg += "Timeout Failure - Hard timeout reached (" + SecondsSinceLastPacket + " > " + hardTimeout + ")";
-                    return RequestStatus.Failure;
-                }
-                else
-                {
-                    if ((softTimeout != -1) && (SecondsSinceLastPacket > softTimeout))
-                    {
-                        _StatusMsg += "Timeout Failure - Soft Timeout ( " + SecondsSinceLastPacket + " > " + softTimeout + ")";
-                        return RequestStatus.Failure;
-                    }
-                }
-            }
-
-            return _Status;
-        }
-
-        protected void MarkCompleted(RequestStatus status, string status_msg)
-        {
-            _StatusMsg += status_msg;
-            _Status = status;
-
-            _Completed.Set();
-
-            _AssetManager.FireTransferRequestCompletedEvent(this);
-        }
-
-        internal void Fail(string status_msg)
-        {
-            MarkCompleted(RequestStatus.Failure, status_msg);
-        }
-
-    }
-
-
-    public class AssetRequestDownload : AssetRequest
-    {
-        protected int _Received;
-        protected SortedList<int, byte[]> _AssetDataReceived = new SortedList<int, byte[]>();
-        protected LLUUID _AssetID;
-        public LLUUID AssetID
-        {
-            get { return _AssetID; }
-        }
-
-        public AssetRequestDownload(AssetManager Manager, LLUUID TransID, LLUUID AssetID)
-            : base(Manager, TransID)
-        {
-            _Received = 0;
-            _AssetID = AssetID;
-        }
-
-        internal void AddDownloadedData(int packetNum, byte[] data)
-        {
-            if (!_AssetDataReceived.ContainsKey(packetNum))
-            {
-                _AssetDataReceived[packetNum] = data;
-                _Received += data.Length;
-            }
-
-            // If we've gotten all the data, mark it completed.
-            if (_Received >= _Size)
-            {
-                int curPos = 0;
-                foreach (KeyValuePair<int, byte[]> kvp in _AssetDataReceived)
-                {
-                    Buffer.BlockCopy(kvp.Value, 0, _AssetData, curPos, kvp.Value.Length);
-                    curPos += kvp.Value.Length;
-                }
-
-                MarkCompleted(AssetRequestDownload.RequestStatus.Success, "Download Completed");
-            }
-
-        }
-
-        internal void SetExpectedSize(int size)
-        {
-            _Size = size;
-            _AssetData = new byte[_Size];
-        }
-
-        /// <summary>
-        /// Get the asset data downloaded by this request.
-        /// </summary>
-        /// <returns></returns>
-        public byte[] GetAssetData()
-        {
-            return _AssetData;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetRequestUpload.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetRequestUpload.cs
deleted file mode 100644
index d8370f1..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetRequestUpload.cs
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-//#define DEBUG_PACKETS
-#define DEBUG_HEADERS
-
-using System;
-using System.Collections.Generic;
-
-using libsecondlife;
-
-using libsecondlife.InventorySystem;
-
-using libsecondlife.Packets;
-using System.Threading;
-
-namespace libsecondlife.AssetSystem
-{
-    public class AssetRequestUpload : AssetRequest
-    {
-        protected SecondLife _Client;
-        protected readonly int _MaxResendAttempts = 20;
-
-        protected ulong _XferID;
-
-        protected int _ResendCount;
-        protected uint _CurrentPacket;
-
-        protected int _NumPackets2Send;
-
-        public AssetRequestUpload(SecondLife Client, LLUUID TransID, Asset Asset2Upload) : base(Client.Assets, TransID, Asset2Upload)
-        {
-            if ((AssetBeingTransferd._AssetData == null) || (AssetBeingTransferd._AssetData.Length == 0))
-            {
-                throw new Exception("Asset data cannot be null.");
-            }
-
-            _Client = Client;
-
-            _CurrentPacket = 0;
-            _ResendCount = 0;
-            _NumPackets2Send = AssetBeingTransferd._AssetData.Length / 1000;
-            if (_NumPackets2Send < 1)
-            {
-                _NumPackets2Send = 1;
-            }
-        }
-
-        internal LLUUID DoUpload()
-        {
-            SendFirstPacket();
-
-            while ((_Completed.WaitOne(1000, true) == false) && (_ResendCount < _MaxResendAttempts))
-            {
-                if (this.SecondsSinceLastPacket > 2)
-                {
-                    _Client.Log("Resending Packet (more than 2 seconds since last confirm)", Helpers.LogLevel.Info);
-                    this.SendCurrentPacket();
-                    _ResendCount++;
-                }
-            }
-
-
-            if (_Status == RequestStatus.Failure)
-            {
-                throw new Exception(_StatusMsg);
-            }
-            else
-            {
-                return _TransactionID;
-            }
-        }
-
-        protected void SendFirstPacket()
-        {
-            Packet packet;
-
-            if (AssetBeingTransferd._AssetData.Length > 1000)
-            {
-                packet = AssetPacketHelpers.AssetUploadRequestHeaderOnly(AssetBeingTransferd, _TransactionID);
-            }
-            else
-            {
-                packet = AssetPacketHelpers.AssetUploadRequest(AssetBeingTransferd, _TransactionID);
-            }
-
-            _Client.Network.SendPacket(packet);
-
-            #if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-            #endif
-            #if DEBUG_HEADERS
-            _Client.DebugLog(packet.Header.ToString());
-            #endif
-        }
-
-        internal void RequestXfer(ulong XferID)
-        {
-            _XferID = XferID;
-            // Setup to send the first packet
-            SendCurrentPacket();
-        }
-
-        internal void ConfirmXferPacket(ulong XferID, uint PacketNumConfirmed)
-        {
-            // TODO should check that this is the same transfer?
-            this.UpdateLastPacketTime();
-
-            if (PacketNumConfirmed == _CurrentPacket)
-            {
-                // Increment Packet #
-                this._CurrentPacket++;
-                this._ResendCount = 0;
-                SendCurrentPacket();
-            }
-            else
-            {
-                throw new Exception("Something is wrong with uploading assets, a confirmation came in for a packet we didn't send.");
-            }
-        }
-
-        protected void SendCurrentPacket()
-        {
-            Packet uploadPacket;
-
-            // THREADING: snapshot this num so we use a consistent value throughout
-            uint packetNum = _CurrentPacket;
-            if (packetNum == 0)
-            {
-                if (AssetBeingTransferd._AssetData.Length <= 1000)
-                {
-                    throw new Exception("Should not use xfer for small assets");
-                }
-                int dataSize = 1000;
-
-                byte[] packetData = new byte[dataSize + 4]; // Extra space is for leading data length bytes
-
-                // Prefix the first Xfer packet with the data length
-                // FIXME: Apply endianness patch
-                Buffer.BlockCopy(BitConverter.GetBytes((int)AssetBeingTransferd._AssetData.Length), 0, packetData, 0, 4);
-                Buffer.BlockCopy(AssetBeingTransferd._AssetData, 0, packetData, 4, dataSize);
-
-                uploadPacket = AssetPacketHelpers.SendXferPacket(_XferID, packetData, packetNum);
-            }
-            else if (packetNum < _NumPackets2Send)
-            {
-                byte[] packetData = new byte[1000];
-                Buffer.BlockCopy(AssetBeingTransferd._AssetData, (int)packetNum * 1000, packetData, 0, 1000);
-
-                uploadPacket = AssetPacketHelpers.SendXferPacket(_XferID, packetData, packetNum);
-            }
-            else
-            {
-                // The last packet has to be handled slightly differently
-                int lastLen = this.AssetBeingTransferd._AssetData.Length - (_NumPackets2Send * 1000);
-                byte[] packetData = new byte[lastLen];
-                Buffer.BlockCopy(this.AssetBeingTransferd._AssetData, _NumPackets2Send * 1000, packetData, 0, lastLen);
-
-                uint lastPacket = (uint)int.MaxValue + (uint)_NumPackets2Send + (uint)1;
-                uploadPacket = AssetPacketHelpers.SendXferPacket(_XferID, packetData, lastPacket);
-            }
-
-            _Client.Network.SendPacket(uploadPacket);
-
-            #if DEBUG_PACKETS
-                slClient.DebugLog(uploadPacket);
-            #endif
-            #if DEBUG_HEADERS
-                _Client.DebugLog(uploadPacket.Header.ToString());
-            #endif
-        }
-
-        internal void UploadComplete(LLUUID assetID, RequestStatus success)
-        {
-            AssetBeingTransferd.AssetID = assetID;
-            UpdateLastPacketTime();
-            _Client.Log("Upload complete", Helpers.LogLevel.Info);
-
-            if (_Status == RequestStatus.Success)
-            {
-                MarkCompleted(success, "Success");
-            }
-            else
-            {
-                MarkCompleted(success, "Server returned failed");
-            }
-
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetScript.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetScript.cs
deleted file mode 100644
index 86b8e8b..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetScript.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace libsecondlife.AssetSystem
-{
-    public class AssetScript : Asset
-    {
-        private string _Source;
-        public string Source
-        {
-            get { return _Source; }
-            set
-            {
-                _Source = value.Replace("\r", "");
-                setAsset(_Source);
-            }
-        }
-
-        public AssetScript(LLUUID assetID, string source)
-            : base(assetID, (sbyte)Asset.AssetType.LSLText, false, null)
-        {
-            _Source = source;
-            setAsset(source);
-        }
-
-        public AssetScript(LLUUID assetID, byte[] assetData)
-            : base(assetID, (sbyte)Asset.AssetType.LSLText, false, assetData)
-        {
-            _Source = System.Text.Encoding.UTF8.GetString(assetData).Trim();
-        }
-
-        private void setAsset(string source)
-        {
-            // Assume this is a string, add 1 for the null terminator
-            byte[] stringBytes = System.Text.Encoding.UTF8.GetBytes(source);
-            byte[] assetData = new byte[stringBytes.Length + 1];
-            Buffer.BlockCopy(stringBytes, 0, assetData, 0, stringBytes.Length);
-            SetAssetData(assetData);
-        }
-
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetWearable.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetWearable.cs
deleted file mode 100644
index 062785f..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetWearable.cs
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-using System.Threading;
-using System.Globalization;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-    /// Asset for wearables such as Socks, Eyes, Gloves, Hair, Pants, Shape, Shirt, Shoes, Skin, Jacket, Skirt, Underpants
-	/// </summary>
-	public class AssetWearable : Asset
-	{
-        private string _Name = "";
-        public string Name
-        {
-            get { return _Name; }
-            set
-            {
-                _Name = value;
-                UpdateAssetData();
-            }
-        }
-        private string _Description = "";
-        public string Description
-        {
-            get { return _Description; }
-            set
-            {
-                _Description = value;
-                UpdateAssetData();
-            }
-        }
-
-        private AppearanceLayerType _AppearanceLayer = 0;
-        public AppearanceLayerType AppearanceLayer
-        {
-            get { return _AppearanceLayer; }
-            set
-            {
-                _AppearanceLayer = value;
-                UpdateAssetData();
-            }
-        }
-
-        private uint _Sale_Price = 10;
-        public uint Sale_Price
-        {
-            get { return _Sale_Price; }
-            set
-            {
-                _Sale_Price = value;
-                UpdateAssetData();
-            }
-        }
-
-        private LLUUID _Creator_ID = new LLUUID();
-        public LLUUID Creator_ID
-        {
-            get { return _Creator_ID; }
-            set
-            {
-                _Creator_ID = value;
-                UpdateAssetData();
-            }
-        }
-        private LLUUID _Owner_ID = new LLUUID();
-        public LLUUID Owner_ID
-        {
-            get { return _Owner_ID; }
-            set
-            {
-                _Owner_ID = value;
-                UpdateAssetData();
-            }
-        }
-        private LLUUID _Last_Owner_ID = new LLUUID();
-        public LLUUID Last_Owner_ID
-        {
-            get { return _Last_Owner_ID; }
-            set
-            {
-                _Last_Owner_ID = value;
-                UpdateAssetData();
-            }
-        }
-
-        private LLUUID _Group_ID = new LLUUID();
-        public LLUUID Group_ID
-        {
-            get { return _Group_ID; }
-            set
-            {
-                _Group_ID = value;
-                UpdateAssetData();
-            }
-        }
-
-        private bool _Group_Owned = false;
-        public bool Group_Owned
-        {
-            get { return _Group_Owned; }
-            set
-            {
-                _Group_Owned = value;
-                UpdateAssetData();
-            }
-        }
-
-
-        private uint _Permission_Base_Mask = 0;
-        public uint Permission_Base_Mask
-        {
-            get { return _Permission_Base_Mask; }
-            set
-            {
-                _Permission_Base_Mask = value;
-                UpdateAssetData();
-            }
-        }
-
-        private uint _Permission_Owner_Mask = 0;
-        public uint Permission_Owner_Mask
-        {
-            get { return _Permission_Owner_Mask; }
-            set
-            {
-                _Permission_Owner_Mask = value;
-                UpdateAssetData();
-            }
-        }
-
-        private uint _Permission_Group_Mask = 0;
-        public uint Permission_Group_Mask
-        {
-            get { return _Permission_Group_Mask; }
-            set
-            {
-                _Permission_Group_Mask = value;
-                UpdateAssetData();
-            }
-        }
-
-        private uint _Permission_Everyone_Mask = 0;
-        public uint Permission_Everyone_Mask
-        {
-            get { return _Permission_Everyone_Mask; }
-            set
-            {
-                _Permission_Everyone_Mask = value;
-                UpdateAssetData();
-            }
-        }
-
-        private uint _Permission_Next_Owner_Mask = 0;
-        public uint Permission_Next_Owner_Mask
-        {
-            get { return _Permission_Next_Owner_Mask; }
-            set
-            {
-                _Permission_Next_Owner_Mask = value;
-                UpdateAssetData();
-            }
-        }
-
-        private Dictionary<int, float> _Parameters = new Dictionary<int, float>();
-        public Dictionary<int, float> Parameters
-        {
-            get { return _Parameters; }
-            set
-            {
-                _Parameters = value;
-                UpdateAssetData();
-            }
-        }
-
-        private Dictionary<uint, LLUUID> _Textures = new Dictionary<uint, LLUUID>();
-        public Dictionary<uint, LLUUID> Textures
-        {
-            get { return _Textures; }
-            set
-            {
-                _Textures = value;
-                UpdateAssetData();
-            }
-        }
-
-        private string[] _ForSaleNames = new string[]
-        {
-            "not",
-            "orig",
-            "copy",
-            "cntn"
-        };
-
-        private enum _ForSale
-        {
-            /// <summary>Not for sale</summary>
-            Not = 0,
-            /// <summary>The original is for sale</summary>
-            Original = 1,
-            /// <summary>Copies are for sale</summary>
-            Copy = 2,
-            /// <summary>The contents of the object are for sale</summary>
-            Contents = 3
-        }
-
-        private _ForSale _Sale = _ForSale.Not;
-
-        public enum AppearanceLayerType : byte
-        {
-            /// <summary></summary>
-            Shape = 0,
-            /// <summary></summary>
-            Skin,
-            /// <summary></summary>
-            Hair,
-            /// <summary></summary>
-            Eyes,
-            /// <summary></summary>
-            Shirt,
-            /// <summary></summary>
-            Pants,
-            /// <summary></summary>
-            Shoes,
-            /// <summary></summary>
-            Socks,
-            /// <summary></summary>
-            Jacket,
-            /// <summary></summary>
-            Gloves,
-            /// <summary></summary>
-            Undershirt,
-            /// <summary></summary>
-            Underpants,
-            /// <summary></summary>
-            Skirt,
-            /// <summary></summary>
-            Invalid = 255
-        };
-
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="assetData"></param>
-        public AssetWearable(LLUUID assetID, sbyte assetType, byte[] assetData)
-            : base(assetID, assetType, false, assetData)
-		{
-            UpdateFromAssetData();
-		}
-
-        /// <summary>
-        /// Converts byte[] data from a data transfer into a bodypart class
-        /// </summary>
-        /// <returns></returns>
-        internal void UpdateFromAssetData()
-        {
-            if ( AssetData == null || AssetData.Length == 0)
-            {
-                return;
-            }
-
-            string wearableData = Helpers.FieldToUTF8String(this._AssetData);
-
-            int version = -1;
-            int n = -1;
-
-            try
-            {
-                n = wearableData.IndexOf('\n');
-                version = Int32.Parse(wearableData.Substring(19, n - 18));
-                wearableData = wearableData.Remove(0, n);
-
-                if (version != 22)
-                {
-                    Console.WriteLine("** WARNING ** : Wearable asset has unrecognized version " + version);
-                    return;
-                }
-
-                n = wearableData.IndexOf('\n');
-                Name = wearableData.Substring(0, n);
-                wearableData = wearableData.Remove(0, n);
-
-                n = wearableData.IndexOf('\n');
-                Description = wearableData.Substring(0, n);
-                wearableData = wearableData.Remove(0, n);
-
-                // Split in to an upper and lower half
-                string[] parts = wearableData.Split(new string[] { "parameters" }, StringSplitOptions.None);
-                parts[1] = "parameters" + parts[1];
-
-                // Parse the upper half
-                string[] lines = parts[0].Split('\n');
-                foreach (string thisline in lines)
-                {
-                    string line = thisline.Trim();
-                    string[] fields = line.Split('\t');
-
-                    if (fields.Length == 2)
-                    {
-                        if (fields[0] == "creator_mask")
-                        {
-                            // Deprecated, apply this as the base mask
-                            _Permission_Base_Mask = UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                        }
-                        else if (fields[0] == "base_mask")
-                        {
-                            _Permission_Base_Mask = UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                        }
-                        else if (fields[0] == "owner_mask")
-                        {
-                            _Permission_Owner_Mask = UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                        }
-                        else if (fields[0] == "group_mask")
-                        {
-                            _Permission_Group_Mask = UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                        }
-                        else if (fields[0] == "everyone_mask")
-                        {
-                            _Permission_Everyone_Mask = UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                        }
-                        else if (fields[0] == "next_owner_mask")
-                        {
-                            _Permission_Next_Owner_Mask = UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                        }
-                        else if (fields[0] == "creator_id")
-                        {
-                            _Creator_ID = new LLUUID(fields[1]);
-                        }
-                        else if (fields[0] == "owner_id")
-                        {
-                            _Owner_ID = new LLUUID(fields[1]);
-                        }
-                        else if (fields[0] == "last_owner_id")
-                        {
-                            _Last_Owner_ID = new LLUUID(fields[1]);
-                        }
-                        else if (fields[0] == "group_id")
-                        {
-                            _Group_ID = new LLUUID(fields[1]);
-                        }
-                        else if (fields[0] == "group_owned")
-                        {
-
-                            _Group_Owned = (Int32.Parse(fields[1]) != 0);
-                        }
-                        else if (fields[0] == "sale_type")
-                        {
-                            for (int i = 0; i < _ForSaleNames.Length; i++)
-                            {
-                                if (fields[1] == _ForSaleNames[i])
-                                {
-                                    _Sale = (_ForSale)i;
-                                    break;
-                                }
-                            }
-                        }
-                        else if (fields[0] == "sale_price")
-                        {
-                            _Sale_Price = UInt32.Parse(fields[1]);
-                        }
-                        else if (fields[0] == "perm_mask")
-                        {
-                            Console.WriteLine("** WARNING ** : Wearable asset has deprecated perm_mask field, ignoring");
-                        }
-                    }
-                    else if (line.StartsWith("type "))
-                    {
-                        AppearanceLayer = (AppearanceLayerType)Int32.Parse(line.Substring(5));
-                        break;
-                    }
-                }
-
-                // Break up the lower half in to parameters and textures
-                string[] lowerparts = parts[1].Split(new string[] { "textures" }, StringSplitOptions.None);
-                lowerparts[1] = "textures" + lowerparts[1];
-
-                // Parse the parameters
-                lines = lowerparts[0].Split('\n');
-                foreach (string line in lines)
-                {
-                    string[] fields = line.Split(' ');
-
-                    int id;
-                    if( Int32.TryParse(fields[0], out id) == false )
-                    {
-                        continue; // Not interested in this line
-                    }
-
-                    float weight = 0.0f;
-                    Single.TryParse(fields[1], System.Globalization.NumberStyles.Float,
-                        Helpers.EnUsCulture.NumberFormat, out weight);
-                    _Parameters[id] = weight;
-                }
-
-                // Parse the textures
-                lines = lowerparts[1].Split('\n');
-                foreach (string line in lines)
-                {
-                    string[] fields = line.Split(' ');
-
-                    uint id;
-                    if (UInt32.TryParse(fields[0], out id) == false)
-                    {
-                        continue; // Not interested in this line
-                    }
-
-                    LLUUID texture;
-
-                    if( LLUUID.TryParse(fields[1], out texture) == false )
-                    {
-                        continue; // if it won't parse, ignore and continue
-                    }
-
-                    _Textures[id] = texture;
-                }
-
-                return;
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("** WARNING **", "Failed to parse wearable asset: " + e.ToString());
-            }
-
-            return;
-        }
-
-        private void UpdateAssetData()
-        {
-            string data = "LLWearable version 22\n";
-            data += this._Name + "\n\n";
-            data += "\tpermissions 0\n\t{\n";
-            data += "\t\tbase_mask\t" + uintToHex(this._Permission_Base_Mask);
-            data += "\n\t\towner_mask\t" + uintToHex(this._Permission_Owner_Mask);
-            data += "\n\t\tgroup_mask\t" + uintToHex(this._Permission_Group_Mask);
-            data += "\n\t\teveryone_mask\t" + uintToHex(this._Permission_Everyone_Mask);
-            data += "\n\t\tnext_owner_mask\t" + uintToHex(this._Permission_Next_Owner_Mask);
-            data += "\n\t\tcreator_id\t" + this._Creator_ID.ToStringHyphenated();
-            data += "\n\t\towner_id\t" + this._Owner_ID.ToStringHyphenated();
-            data += "\n\t\tlast_owner_id\t" + this._Last_Owner_ID.ToStringHyphenated();
-            data += "\n\t\tgroup_id\t" + this._Group_ID.ToStringHyphenated();
-            data += "\n\t}";
-            data += "\n\tsale_info\t0";
-            data += "\n\t{";
-            data += "\n\t\tsale_type\t" + _ForSaleNames[(int)this._Sale];
-            data += "\n\t\tsale_price\t" + this._Sale_Price;
-            data += "\n\t}";
-            data += "\ntype " + this._AppearanceLayer;
-            data += "\nparameters " + this._Parameters.Count;
-            foreach (KeyValuePair<int, float> param in this._Parameters)
-            {
-                string prm = string.Format("{0:f1}", param.Value);
-                if (prm == "-1.0" || prm == "1.0" || prm == "0.0")
-                {
-                    switch (prm)
-                    {
-                        case "-1.0":
-                            prm = "-1";
-                            break;
-                        case "0.0":
-                            prm = "0";
-                            break;
-                        case "1.0":
-                            prm = "1";
-                            break;
-                    }
-                }
-                data += "\n" + param.Key + " " + prm;
-            }
-            data += "\ntextures " + this._Textures.Count;
-            foreach (KeyValuePair<uint, LLUUID> texture in this._Textures)
-            {
-                data += "\n" + texture.Key + " " + texture.Value.ToStringHyphenated();
-            }
-
-            _AssetData = System.Text.Encoding.ASCII.GetBytes(data.ToCharArray());
-        }
-
-        private static string uintToHex(uint i)
-        {
-            return string.Format("{0:x8}", i);
-        }
-
-        public override void SetAssetData(byte[] data)
-        {
-            _AssetData = data;
-            if ( (_AssetData != null) && (_AssetData.Length > 0) )
-            {
-                UpdateFromAssetData();
-            }
-        }
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetWearable_Body.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetWearable_Body.cs
deleted file mode 100644
index dc01eff..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetWearable_Body.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-	/// Asset for a body wearables (Skin, Eyes, Hair, Bodyshape)
-	/// </summary>
-	internal class AssetWearable_Body : AssetWearable
-	{
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="assetData"></param>
-        public AssetWearable_Body(LLUUID assetID, byte[] assetData)
-            : base(assetID, (sbyte)Asset.AssetType.Bodypart, assetData)
-		{
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/AssetWearable_Clothing.cs b/old/libsl1550/libsecondlife/AssetSystem/AssetWearable_Clothing.cs
deleted file mode 100644
index 3a23c0d..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/AssetWearable_Clothing.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-	/// Asset for a clothing wearables (Shirt, Pants, Socks, etc)
-	/// </summary>
-	internal class AssetWearable_Clothing : AssetWearable
-	{
-        /// <summary>
-        /// </summary>
-        /// <param name="assetID"></param>
-        /// <param name="assetData"></param>
-        public AssetWearable_Clothing(LLUUID assetID, byte[] assetData)
-            : base(assetID, (sbyte)Asset.AssetType.Clothing, assetData)
-		{
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/BodyPart_Deprecated.cs b/old/libsl1550/libsecondlife/AssetSystem/BodyPart_Deprecated.cs
deleted file mode 100644
index b67d13c..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/BodyPart_Deprecated.cs
+++ /dev/null
@@ -1,227 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.AssetSystem
-{
-    class BodyPart_Deprecated
-    {
-        public string name = "";
-        public uint type = 0;
-
-        public string sale_type = "not";
-        public uint sale_price = 10;
-
-        public LLUUID creator_id = new LLUUID();
-        public LLUUID owner_id = new LLUUID();
-        public LLUUID last_owner_id = new LLUUID();
-        public LLUUID group_id = new LLUUID();
-
-        public uint base_mask = 0;
-        public uint owner_mask = 0;
-        public uint group_mask = 0;
-        public uint everyone_mask = 0;
-        public uint next_owner_mask = 0;
-
-        public Dictionary<uint, float> parameters = new Dictionary<uint, float>();
-        public Dictionary<uint, LLUUID> textures = new Dictionary<uint, LLUUID>();
-
-        private static string intToHex(uint i)
-        {
-            return string.Format("{0:x8}", i);
-        }
-
-        public static byte[] BodyPartToByteData(BodyPart_Deprecated bp)
-        {
-            string data = "LLWearable version 22\n";
-            data += bp.name + "\n\n";
-            data += "\tpermissions 0\n\t{\n";
-            data += "\t\tbase_mask\t" + intToHex(bp.base_mask);
-            data += "\n\t\towner_mask\t" + intToHex(bp.owner_mask);
-            data += "\n\t\tgroup_mask\t" + intToHex(bp.group_mask);
-            data += "\n\t\teveryone_mask\t" + intToHex(bp.everyone_mask);
-            data += "\n\t\tnext_owner_mask\t" + intToHex(bp.next_owner_mask);
-            data += "\n\t\tcreator_id\t" + bp.creator_id.ToStringHyphenated();
-            data += "\n\t\towner_id\t" + bp.owner_id.ToStringHyphenated();
-            data += "\n\t\tlast_owner_id\t" + bp.last_owner_id.ToStringHyphenated();
-            data += "\n\t\tgroup_id\t" + bp.group_id.ToStringHyphenated();
-            data += "\n\t}";
-            data += "\n\tsale_info\t0";
-            data += "\n\t{";
-            data += "\n\t\tsale_type\t" + bp.sale_type;
-            data += "\n\t\tsale_price\t" + bp.sale_price;
-            data += "\n\t}";
-            data += "\ntype " + bp.type;
-            data += "\nparameters " + bp.parameters.Count;
-            foreach (KeyValuePair<uint, float> param in bp.parameters)
-            {
-                string prm = string.Format("{0:f1}", param.Value);
-                if(prm == "-1.0" || prm == "1.0" || prm == "0.0")
-                {
-                    switch(prm)
-                    {
-                        case "-1.0":
-                            prm = "-1";
-                            break;
-                        case "0.0":
-                            prm = "0";
-                            break;
-                        case "1.0":
-                            prm = "1";
-                            break;
-                    }
-                }
-                data += "\n" + param.Key + " " + prm;
-            }
-            data += "\ntextures " + bp.textures.Count;
-            foreach (KeyValuePair<uint, LLUUID> texture in bp.textures)
-            {
-                data += "\n" + texture.Key + " " + texture.Value.ToStringHyphenated();
-            }
-
-            return System.Text.Encoding.ASCII.GetBytes(data.ToCharArray());
-        }
-        /// <summary>
-        /// Converts byte[] data from a data transfer into a bodypart class
-        /// </summary>
-        /// <param name="data"></param>
-        /// <returns></returns>
-        public static BodyPart_Deprecated ByteDataToBodyPart(byte[] data)
-        {
-            BodyPart_Deprecated bp = new BodyPart_Deprecated();
-
-            byte state = 0;
-            const byte parameters_block = 4;
-            const byte textures_block = 6;
-
-            Exception Corrupted = new Exception("Corrupted Body Part data");
-            string whole_enchilada = System.Text.Encoding.ASCII.GetString(data);
-
-            //this seperates the whole enchilada into two, the header and the body.
-            string[] seperated_enchilada = whole_enchilada.Split(new string[] { "permissions" }, StringSplitOptions.RemoveEmptyEntries);
-            if (seperated_enchilada.Length != 2) throw Corrupted;
-
-            //this parses out the name out of the header
-            string[] header = seperated_enchilada[0].Split('\n');
-            if (header.Length < 2) throw Corrupted;
-            bp.name = header[1];
-
-            seperated_enchilada[1] = "permissions" + seperated_enchilada[1];
-            string[] body = seperated_enchilada[1].Split('\n');
-            foreach(string blk in body)
-            {
-               string block = blk.Trim();
-               if (block == "{" || block == "}") continue; //I hate those things..
-               if (block == "") continue;
-               //use the markers...
-               if(block.StartsWith("parameters "))
-               {
-                   state = parameters_block;
-                   continue;
-               }
-               else if(block.StartsWith("textures "))
-               {
-                   state = textures_block;
-                   continue;
-               }
-
-               if(state == 0)
-               {
-                   if(block.StartsWith("type "))
-                   {
-                       bp.type = uint.Parse(block.Substring(5));
-                   }
-                   else
-                   {
-                       string[] split_field = block.Split('\t');
-
-                       if(split_field.Length == 2)
-                       {
-                           switch(split_field[0])
-                           {
-                               case "base_mask":
-                                   bp.base_mask = uint.Parse(split_field[1], System.Globalization.NumberStyles.HexNumber);
-                                   break;
-                               case "owner_mask":
-                                   bp.owner_mask = uint.Parse(split_field[1], System.Globalization.NumberStyles.HexNumber);
-                                   break;
-                               case "group_mask":
-                                   bp.group_mask = uint.Parse(split_field[1], System.Globalization.NumberStyles.HexNumber);
-                                   break;
-                               case "everyone_mask":
-                                   bp.everyone_mask = uint.Parse(split_field[1], System.Globalization.NumberStyles.HexNumber);
-                                   break;
-                               case "next_owner_mask":
-                                   bp.next_owner_mask = uint.Parse(split_field[1], System.Globalization.NumberStyles.HexNumber);
-                                   break;
-                               case "creator_id":
-                                   bp.creator_id = new LLUUID(split_field[1]);
-                                   break;
-                               case "owner_id":
-                                   bp.owner_id = new LLUUID(split_field[1]);
-                                   break;
-                               case "last_owner_id":
-                                   bp.last_owner_id = new LLUUID(split_field[1]);
-                                   break;
-                               case "group_id":
-                                   bp.group_id = new LLUUID(split_field[1]);
-                                   break;
-                               case "sale_type":
-                                   bp.sale_type = split_field[1];
-                                   break;
-                               case "sale_price":
-                                   bp.sale_price = uint.Parse(split_field[1]);
-                                   break;
-                               default: break;
-                           }
-                       }
-                   }
-               }
-               else if (state == parameters_block)
-               {
-                   string[] split_up = block.Split(' ');
-                   // if (split_up.Length != 2) throw Corrupted;
-                   if (split_up.Length == 2)
-                   {
-                       if (bp.parameters.ContainsKey(uint.Parse(split_up[0]))) bp.parameters.Remove(uint.Parse(split_up[0]));
-                       bp.parameters.Add(uint.Parse(split_up[0]), float.Parse(split_up[1]));
-                   }
-               }
-               else if (state == textures_block)
-               {
-                   string[] split_up = block.Split(' ');
-                   if (split_up.Length != 2) throw Corrupted;
-
-                   if (bp.parameters.ContainsKey(uint.Parse(split_up[0]))) bp.parameters.Remove(uint.Parse(split_up[0]));
-                   bp.textures.Add(uint.Parse(split_up[0]), new LLUUID(split_up[1]));
-               }
-
-            }
-
-            return bp;
-        }
-        public BodyPart_Deprecated() { } //blank construction
-
-        public BodyPart_Deprecated(byte[] data)
-        {
-            BodyPart_Deprecated bp = BodyPart_Deprecated.ByteDataToBodyPart(data);
-            this.base_mask = bp.base_mask;
-            this.creator_id = bp.creator_id;
-            this.everyone_mask = bp.everyone_mask;
-            this.group_id = bp.group_id;
-            this.group_mask = bp.group_mask;
-            this.last_owner_id = bp.last_owner_id;
-            this.name = bp.name;
-            this.next_owner_mask = bp.next_owner_mask;
-            this.owner_id = bp.owner_id;
-            this.owner_mask = bp.owner_mask;
-            this.parameters = bp.parameters;
-            this.textures = bp.textures;
-            this.type = bp.type;
-            this.sale_price = bp.sale_price;
-            this.sale_type = bp.sale_type;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AssetSystem/ImageManager.cs b/old/libsl1550/libsecondlife/AssetSystem/ImageManager.cs
deleted file mode 100644
index 5f40ef3..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/ImageManager.cs
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-//#define DEBUG_PACKETS
-
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-
-using libsecondlife;
-using libsecondlife.Packets;
-
-using libsecondlife.InventorySystem;
-
-namespace libsecondlife.AssetSystem
-{
-    public delegate void ImageRetrievedCallback(LLUUID id, byte[] data, bool cached, string statusmsg); //this delegate is called when an image completed.
-
-    /// <summary>
-    /// Manages the uploading and downloading of Images from SecondLife
-    /// </summary>
-    public class ImageManager
-    {
-
-        private SecondLife slClient;
-
-        public enum CacheTypes { None, Memory, Disk };
-        private CacheTypes CacheType;
-        private string CacheDirectory = "ImageCache";
-        private Dictionary<LLUUID, Byte[]> CacheTable = new Dictionary<LLUUID, byte[]>();
-        private List<LLUUID> CachedDiskIndex = new List<LLUUID>();
-
-        private ImagePacketHelpers ImagePacketHelper;
-
-        private Dictionary<LLUUID, TransferRequest> htDownloadRequests = new Dictionary<LLUUID, TransferRequest>();
-
-        public ImageRetrievedCallback OnImageRetrieved;
-
-        private class TransferRequest
-        {
-            public ManualResetEvent ReceivedHeaderPacket = new ManualResetEvent(false);
-            public ManualResetEvent Completed = new ManualResetEvent(false);
-
-            public bool Status;
-            public string StatusMsg;
-
-            public uint Size;
-            public uint Received;
-            public uint TimeOfLastPacket;
-            public byte[] AssetData;
-
-            public int BaseDataReceived;
-
-            public TransferRequest()
-            {
-                Status = false;
-                StatusMsg = "";
-
-                AssetData = null;
-                BaseDataReceived = 0;
-            }
-        }
-
-        /// <summary>
-        /// </summary>
-        /// <param name="client"></param>
-        public ImageManager(SecondLife client)
-        {
-            Init(client, CacheTypes.None, null);
-        }
-
-        /// <summary>
-        /// </summary>
-        /// <param name="client"></param>
-        /// <param name="ctype">The type of Cache system to use for images.</param>
-        public ImageManager(SecondLife client, CacheTypes ctype)
-        {
-            Init(client, ctype, null);
-        }
-
-        /// <summary>
-        /// </summary>
-        /// <param name="client"></param>
-        /// <param name="ctype">The type of Cache system to use for images.</param>
-        /// <param name="directory">The directory to use for disk based caching.</param>
-        public ImageManager(SecondLife client, CacheTypes ctype, String directory)
-        {
-            Init(client, ctype, directory);
-        }
-
-        /// <summary>
-        /// </summary>
-        /// <param name="client"></param>
-        /// <param name="ctype">The type of Cache system to use for images.</param>
-        /// <param name="directory">The directory to use for disk based caching.</param>
-        private void Init(SecondLife client, CacheTypes ctype, string directory)
-        {
-            slClient = client;
-
-            // Setup Image Caching
-            CacheType = ctype;
-            if (ctype == CacheTypes.Disk)
-            {
-                if (directory != null)
-                {
-                    CacheDirectory = directory;
-                }
-
-                try
-                {
-                    if (!Directory.Exists(CacheDirectory))
-                    {
-                        Directory.CreateDirectory(CacheDirectory);
-                    }
-                }
-                catch (Exception e)
-                {
-                    slClient.Log("Disk Cache directory could not be established, defaulting to Memory Cache: " + Environment.NewLine +
-                        e.ToString(), Helpers.LogLevel.Warning);
-
-                    CacheType = CacheTypes.Memory;
-                }
-            }
-
-            // Image Packet Helpers
-            ImagePacketHelper = new ImagePacketHelpers(client);
-
-            // Image Callbacks
-            slClient.Network.RegisterCallback(PacketType.ImageData, new NetworkManager.PacketCallback(ImageDataCallbackHandler));
-            slClient.Network.RegisterCallback(PacketType.ImagePacket, new NetworkManager.PacketCallback(ImagePacketCallbackHandler));
-            slClient.Network.RegisterCallback(PacketType.ImageNotInDatabase, new NetworkManager.PacketCallback(ImageNotInDatabaseCallbackHandler));
-        }
-
-        private void CacheImage(LLUUID ImageID, byte[] ImageData)
-        {
-            switch (CacheType)
-            {
-                case CacheTypes.Memory:
-                    CacheTable[ImageID] = ImageData;
-                    break;
-                case CacheTypes.Disk:
-                    String filepath = Path.Combine(CacheDirectory, ImageID.ToStringHyphenated());
-                    File.WriteAllBytes(filepath, ImageData);
-                    CachedDiskIndex.Add(ImageID);
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        private byte[] CachedImage(LLUUID ImageID)
-        {
-            switch (CacheType)
-            {
-                case CacheTypes.Memory:
-                    if (CacheTable.ContainsKey(ImageID))
-                    {
-                        return CacheTable[ImageID];
-                    }
-                    else
-                    {
-                        return null;
-                    }
-                case CacheTypes.Disk:
-                    String filepath = Path.Combine(CacheDirectory, ImageID.ToStringHyphenated());
-                    if (File.Exists(filepath))
-                    {
-                        return File.ReadAllBytes(filepath);
-                    }
-                    else
-                    {
-                        return null;
-                    }
-
-                default:
-                    return null;
-            }
-        }
-
-        public bool isCachedImage(LLUUID ImageID)
-        {
-            if (ImageID == null)
-            {
-                throw new Exception("Don't go calling isCachedImage() with a null...");
-            }
-
-            switch (CacheType)
-            {
-                case CacheTypes.Memory:
-                    return CacheTable.ContainsKey(ImageID);
-                case CacheTypes.Disk:
-                    if (CachedDiskIndex.Contains(ImageID))
-                    {
-                        return true;
-                    }
-                    else
-                    {
-                        String filepath = Path.Combine(CacheDirectory, ImageID.ToStringHyphenated());
-                        if (File.Exists(filepath))
-                        {
-                            CachedDiskIndex.Add(ImageID);
-                            return true;
-                        }
-                        else
-                        {
-                            return false;
-                        }
-                    }
-                default:
-                    return false;
-            }
-        }
-
-        public bool isDownloadingImages()
-        {
-            bool isDownloading = false;
-            lock (htDownloadRequests)
-            {
-                isDownloading = htDownloadRequests.Count > 0 ? true : false;
-            }
-            return isDownloading;
-        }
-
-        /// <summary>
-        /// Requests an image from SecondLife and blocks until it's received.
-        /// </summary>
-        /// <param name="ImageID">The Image's AssetID</param>
-        public byte[] RequestImage(LLUUID ImageID)
-        {
-            byte[] imgData = CachedImage(ImageID);
-            if (imgData != null)
-            {
-                return imgData;
-            }
-
-            TransferRequest tr;
-            lock (htDownloadRequests)
-            {
-                if (htDownloadRequests.ContainsKey(ImageID) == false)
-                {
-                    tr = new TransferRequest();
-                    tr.Size = int.MaxValue; // Number of bytes expected
-                    tr.Received = 0; // Number of bytes received
-                    tr.TimeOfLastPacket = Helpers.GetUnixTime(); // last time we recevied a packet for this request
-
-                    htDownloadRequests[ImageID] = tr;
-
-                    Packet packet = ImagePacketHelper.RequestImage(ImageID);
-                    slClient.Network.SendPacket(packet);
-                }
-                else
-                {
-                    tr = htDownloadRequests[ImageID];
-                }
-            }
-
-            // Wait for transfer to complete.
-            while( !tr.Completed.WaitOne(10000, false) ) //If it times out, then check, otherwise loop again until WaitOne returns true
-            {
-                slClient.Log("Warning long running texture download: " + ImageID.ToStringHyphenated(), Helpers.LogLevel.Warning);
-                Console.WriteLine("Downloaded : " + tr.Received);
-                if( (Helpers.GetUnixTime() - tr.TimeOfLastPacket) > 10 )
-                {
-                    tr.Status = false;
-                    tr.StatusMsg = "Timeout while downloading image.";
-                    slClient.Log(tr.StatusMsg, Helpers.LogLevel.Error);
-                    tr.Completed.Set();
-                }
-            }
-
-            if (tr.Status == true)
-            {
-                return tr.AssetData;
-            }
-            else
-            {
-                throw new Exception("RequestImage: " + tr.StatusMsg);
-            }
-        }
-
-        /// <summary>
-        /// Requests an image from SecondLife.
-        /// </summary>
-        /// <param name="ImageID">The Image's AssetID</param>
-        public void RequestImageAsync(LLUUID ImageID)
-        {
-            if (ImageID == null)
-            {
-                throw new Exception("WTF!!!  Don't request Image Assets by passing in an ImageID of null");
-            }
-
-            byte[] imgData = CachedImage(ImageID);
-            if (imgData != null)
-            {
-                FireImageRetrieved(ImageID, imgData, true);
-            }
-
-            lock (htDownloadRequests)
-            {
-                if (htDownloadRequests.ContainsKey(ImageID) == false)
-                {
-                    TransferRequest tr = new TransferRequest();
-                    tr.Size = int.MaxValue; // Number of bytes expected
-                    tr.Received = 0; // Number of bytes received
-                    tr.TimeOfLastPacket = Helpers.GetUnixTime(); // last time we recevied a packet for this request
-
-                    htDownloadRequests[ImageID] = tr;
-
-                    Packet packet = ImagePacketHelper.RequestImage(ImageID);
-                    slClient.Network.SendPacket(packet);
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Handles the Image Data packet, which includes the ID, and Size of the image,
-        /// along with the first block of data for the image.  If the image is small enough
-        /// there will be no additional packets.
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        public void ImageDataCallbackHandler(Packet packet, Simulator simulator)
-        {
-#if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-#endif
-
-            ImageDataPacket reply = (ImageDataPacket)packet;
-
-            LLUUID ImageID = reply.ImageID.ID;
-            // unused?		ushort Packets = reply.ImageID.Packets;
-            uint Size = reply.ImageID.Size;
-            byte[] Data = reply.ImageData.Data;
-
-            // Lookup the request that this packet is for
-            TransferRequest tr;
-            lock (htDownloadRequests)
-            {
-                if( htDownloadRequests.ContainsKey(ImageID) )
-                {
-                    tr = htDownloadRequests[ImageID];
-                } else {
-                    // Received a packet for an image we didn't request...
-                    return;
-                }
-            }
-
-            // Initialize the request so that it's data buffer is the right size for the image
-            tr.Size = Size;
-            tr.AssetData = new byte[tr.Size];
-            tr.BaseDataReceived = Data.Length;
-
-            // Copy the first block of image data into the request.
-            Buffer.BlockCopy(Data, 0, tr.AssetData, (int)tr.Received, Data.Length);
-            tr.Received += (uint)Data.Length;
-
-            // Mark that the TransferRequest has received this header packet
-            tr.ReceivedHeaderPacket.Set();
-
-            tr.TimeOfLastPacket = Helpers.GetUnixTime(); // last time we recevied a packet for this request
-
-            // If we've gotten all the data, mark it completed.
-            if (tr.Received >= tr.Size)
-            {
-                tr.Status = true;
-                tr.Completed.Set();
-
-                // Fire off image downloaded event
-                CacheImage(ImageID, tr.AssetData);
-                FireImageRetrieved(ImageID, tr.AssetData, false);
-            }
-        }
-
-        /// <summary>
-        /// Handles the remaining Image data that did not fit in the initial ImageData packet
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        public void ImagePacketCallbackHandler(Packet packet, Simulator simulator)
-        {
-#if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-#endif
-
-            ImagePacketPacket reply = (ImagePacketPacket)packet;
-
-            LLUUID ImageID = reply.ImageID.ID;
-
-            // Lookup the request for this packet
-            TransferRequest tr = null;
-            lock (htDownloadRequests)
-            {
-                if (htDownloadRequests.ContainsKey(ImageID))
-                {
-                    tr = (TransferRequest)htDownloadRequests[ImageID];
-                }
-                else
-                {
-                    // Received a packet that doesn't belong to any requests in our queue, strange...
-                    return;
-                }
-            }
-
-
-            // TODO: Received data should probably be put into a temporary collection that's indected by ImageID.Packet
-            // then once we've received all data packets, it should be re-assembled into a complete array and marked
-            // completed.
-
-            // FIXME: Sometimes this gets called before ImageDataCallbackHandler, when that
-            // happens tr.AssetData will be null.  Implimenting the above TODO should fix this.
-
-            // Wait until we've received the header packet for this image, which creates the AssetData array
-            if (!tr.ReceivedHeaderPacket.WaitOne(15000,false))
-            {
-                tr.Status = false;
-                tr.StatusMsg = "Failed to receive Image Header packet in a timely manor, aborting.";
-                slClient.Log(tr.StatusMsg, Helpers.LogLevel.Error);
-                tr.Completed.Set();
-            }
-
-            // Add this packet's data to the request.
-            Buffer.BlockCopy(reply.ImageData.Data, 0, tr.AssetData, tr.BaseDataReceived + (1000 * (reply.ImageID.Packet - 1)), reply.ImageData.Data.Length);
-            tr.Received += (uint)reply.ImageData.Data.Length;
-
-            tr.TimeOfLastPacket = Helpers.GetUnixTime(); // last time we recevied a packet for this request
-
-            // If we've gotten all the data, mark it completed.
-            if (tr.Received >= tr.Size)
-            {
-                tr.Status = true;
-                tr.Completed.Set();
-
-                // Fire off image downloaded event
-                CacheImage(ImageID, tr.AssetData);
-                FireImageRetrieved(ImageID, tr.AssetData, false);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void ImageNotInDatabaseCallbackHandler(Packet packet, Simulator simulator)
-        {
-#if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-#endif
-
-            ImageNotInDatabasePacket reply = (ImageNotInDatabasePacket)packet;
-
-            LLUUID ImageID = reply.ImageID.ID;
-
-            // Lookup the request for this packet
-            TransferRequest tr = null;
-            lock (htDownloadRequests)
-            {
-                if (htDownloadRequests.ContainsKey(ImageID))
-                {
-                    tr = (TransferRequest)htDownloadRequests[ImageID];
-                }
-                else
-                {
-                    // Received a packet that doesn't belong to any requests in our queue, strange...
-                    return;
-                }
-            }
-
-            tr.Status = false;
-            tr.StatusMsg = "Image not in database";
-            tr.Completed.Set();
-
-            // Fire off image downloaded event
-            FireImageRetrieved(ImageID, null, false, tr.StatusMsg);
-        }
-
-        protected void FireImageRetrieved(LLUUID ImageID, byte[] ImageData, bool cached)
-        {
-            FireImageRetrieved(ImageID, ImageData, cached, "");
-        }
-
-        protected void FireImageRetrieved(LLUUID ImageID, byte[] ImageData, bool cached, string status)
-        {
-            if (OnImageRetrieved != null)
-            {
-                OnImageRetrieved(ImageID, ImageData, cached, status);
-            }
-        }
-
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/AssetSystem/ImagePacketHelpers.cs b/old/libsl1550/libsecondlife/AssetSystem/ImagePacketHelpers.cs
deleted file mode 100644
index 44bddca..0000000
--- a/old/libsl1550/libsecondlife/AssetSystem/ImagePacketHelpers.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.AssetSystem
-{
-	/// <summary>
-	/// Helper functions for packets relating to images.
-	/// </summary>
-    public class ImagePacketHelpers
-	{
-        private SecondLife Client;
-
-        public ImagePacketHelpers(SecondLife client)
-		{
-            this.Client   = client;
-		}
-
-
-        /// <summary>
-        /// Send a packet requesting an image.  This will either fail silently, or result in
-        /// one ImageData packet, along with zero or more ImagePacket packets.
-        /// </summary>
-        /// <param name="imageID">LLUUID of the AssetID of an image.</param>
-        public Packet RequestImage(LLUUID imageID)
-		{
-            RequestImagePacket p = new RequestImagePacket();
-            p.RequestImage    = new RequestImagePacket.RequestImageBlock[1];
-            p.RequestImage[0] = new RequestImagePacket.RequestImageBlock();
-            p.RequestImage[0].DownloadPriority = (float)1215000.0;
-            p.RequestImage[0].DiscardLevel     = (int)0;
-            p.RequestImage[0].Packet           = (uint)0;
-            p.RequestImage[0].Image            = imageID;
-
-            //FIXME: Find out what the appropriate values are here.
-            p.RequestImage[0].Type             = 0;
-
-            p.AgentData.AgentID   = Client.Network.AgentID;
-            p.AgentData.SessionID = Client.Network.SessionID;
-
-            return p;
-		}
-
-	}
-}
diff --git a/old/libsl1550/libsecondlife/AssetTypes.cs b/old/libsl1550/libsecondlife/AssetTypes.cs
deleted file mode 100644
index 5300a7b..0000000
--- a/old/libsl1550/libsecondlife/AssetTypes.cs
+++ /dev/null
@@ -1,399 +0,0 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-
-namespace libsecondlife
-{
-    public enum WearableType : byte
-    {
-        Shape = 0,
-        Skin,
-        Hair,
-        Eyes,
-        Shirt,
-        Pants,
-        Shoes,
-        Socks,
-        Jacket,
-        Gloves,
-        Undershirt,
-        Underpants,
-        Skirt,
-        Invalid = 255
-    };
-
-    public abstract class Asset
-    {
-        public byte[] AssetData;
-
-        private LLUUID _AssetID;
-        public LLUUID AssetID
-        {
-            get { return _AssetID; }
-            internal set { _AssetID = value; }
-        }
-
-        public abstract AssetType AssetType
-        {
-            get;
-        }
-
-        public Asset() { }
-
-        public Asset(byte[] assetData)
-        {
-            AssetData = assetData;
-        }
-
-        /// <summary>
-        /// Regenerates the <code>AssetData</code> byte array from the properties
-        /// of the derived class.
-        /// </summary>
-        public abstract void Encode();
-
-        /// <summary>
-        /// Decodes the AssetData, placing it in appropriate properties of the derived
-        /// class.
-        /// </summary>
-        /// <returns>True if the asset decoding succeeded, otherwise false</returns>
-        public abstract bool Decode();
-    }
-
-    public class AssetNotecard : Asset
-    {
-        public override AssetType AssetType { get { return AssetType.Notecard; } }
-
-        public string Text = null;
-
-        public AssetNotecard() { }
-
-        public AssetNotecard(byte[] assetData) : base(assetData) { }
-
-        public AssetNotecard(string text)
-        {
-            Text = text;
-        }
-
-        public override void Encode()
-        {
-            AssetData = Helpers.StringToField(Text);
-        }
-
-        public override bool Decode()
-        {
-            Text = Helpers.FieldToUTF8String(AssetData);
-            return true;
-        }
-    }
-
-    public class AssetScriptText : Asset
-    {
-        public override AssetType AssetType { get { return AssetType.LSLText; } }
-
-        public string Source;
-
-        public AssetScriptText() { }
-
-        public AssetScriptText(byte[] assetData) : base(assetData) { }
-
-        public AssetScriptText(string source)
-        {
-            Source = source;
-        }
-
-        public override void Encode()
-        {
-            AssetData = Helpers.StringToField(Source);
-        }
-
-        public override bool Decode()
-        {
-            Source = Helpers.FieldToUTF8String(AssetData);
-            return true;
-        }
-    }
-
-    public class AssetScriptBinary : Asset
-    {
-        public override AssetType AssetType { get { return AssetType.LSLBytecode; } }
-
-        public byte[] Bytecode;
-
-        public AssetScriptBinary() { }
-
-        public AssetScriptBinary(byte[] assetData) : base (assetData)
-        {
-            Bytecode = assetData;
-        }
-
-        public override void Encode() { AssetData = Bytecode; }
-        public override bool Decode() { Bytecode = AssetData; return true; }
-    }
-
-    public class AssetTexture : Asset
-    {
-        public override AssetType AssetType { get { return AssetType.Texture; } }
-
-        public Image Image;
-
-        public AssetTexture() { }
-
-        public AssetTexture(byte[] assetData) : base(assetData) { }
-
-        public AssetTexture(Image image)
-        {
-            Image = image;
-        }
-
-        public override void Encode()
-        {
-#if PocketPC
-            throw new Exception("OpenJPEG encoding is not supported on the PocketPC");
-#else
-            AssetData = OpenJPEGNet.OpenJPEG.Encode(Image);
-#endif
-        }
-
-        public override bool Decode()
-        {
-#if PocketPC
-            throw new Exception("OpenJPEG decoding is not supported on the PocketPC");
-#else
-            Image = OpenJPEGNet.OpenJPEG.Decode(AssetData);
-            return true;
-#endif
-        }
-    }
-
-    public class AssetPrim : Asset
-    {
-        public override AssetType AssetType { get { return AssetType.Object; } }
-
-        public AssetPrim() { }
-
-        public override void Encode() { }
-        public override bool Decode() { return false; }
-    }
-
-    public class AssetSound : Asset
-    {
-        public override AssetType AssetType { get { return AssetType.Sound; } }
-
-        public AssetSound() { }
-
-        // TODO: Sometime we could add OGG encoding/decoding?
-        public override void Encode() { }
-        public override bool Decode() { return false; }
-    }
-
-    public abstract class AssetWearable : Asset
-    {
-        public string Name = String.Empty;
-        public string Description = String.Empty;
-        public WearableType WearableType = WearableType.Shape;
-        public SaleType ForSale;
-        public int SalePrice;
-        public LLUUID Creator;
-        public LLUUID Owner;
-        public LLUUID LastOwner;
-        public LLUUID Group;
-        public bool GroupOwned;
-        public Permissions Permissions;
-        public Dictionary<int, float> Params = new Dictionary<int, float>();
-        public Dictionary<AppearanceManager.TextureIndex, LLUUID> Textures = new Dictionary<AppearanceManager.TextureIndex, LLUUID>();
-
-        public AssetWearable() { }
-
-        public AssetWearable(byte[] assetData) : base(assetData) { }
-
-        public AssetWearable(string source)
-        {
-            AssetData = Helpers.StringToField(source);
-        }
-
-        public override bool Decode()
-        {
-            int version = -1;
-            Permissions = new Permissions();
-            string data = Helpers.FieldToUTF8String(AssetData);
-
-            string[] lines = data.Split('\n');
-            for (int stri = 0; stri < lines.Length; stri++)
-            {
-                if (stri == 0)
-                {
-                    string versionstring = lines[stri];
-                    version = Int32.Parse(versionstring.Split(' ')[2]);
-                    if (version != 22 && version != 18)
-                        return false;
-                }
-                else if (stri == 1)
-                {
-                    Name = lines[stri];
-                }
-                else if (stri == 2)
-                {
-                    Description = lines[stri];
-                }
-                else
-                {
-                    string line = lines[stri].Trim();
-                    string[] fields = line.Split('\t');
-
-                    if (fields.Length == 1)
-                    {
-                        fields = line.Split(' ');
-                        if (fields[0] == "parameters")
-                        {
-
-                            int count = Int32.Parse(fields[1]) + stri;
-                            for (; stri < count; )
-                            {
-                                stri++;
-                                line = lines[stri].Trim();
-                                fields = line.Split(' ');
-
-                                int id = Int32.Parse(fields[0]);
-                                float weight = float.Parse(fields[1], System.Globalization.NumberStyles.Float,
-                                    Helpers.EnUsCulture.NumberFormat);
-
-                                Params[id] = weight;
-                            }
-                        }
-                        else if (fields[0] == "textures")
-                        {
-                            int count = Int32.Parse(fields[1]) + stri;
-                            for (; stri < count; )
-                            {
-                                stri++;
-                                line = lines[stri].Trim();
-                                fields = line.Split(' ');
-
-                                AppearanceManager.TextureIndex id = (AppearanceManager.TextureIndex)Int32.Parse(fields[0]);
-                                LLUUID texture = new LLUUID(fields[1]);
-
-                                Textures[id] = texture;
-                            }
-                        }
-                        else if (fields[0] == "type")
-                        {
-                            WearableType = (WearableType)Int32.Parse(fields[1]);
-                        }
-
-                    }
-                    else if (fields.Length == 2)
-                    {
-                        switch (fields[0])
-                        {
-                            case "creator_mask":
-                                // Deprecated, apply this as the base mask
-                                Permissions.BaseMask = (PermissionMask)UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                                break;
-                            case "base_mask":
-                                Permissions.BaseMask = (PermissionMask)UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                                break;
-                            case "owner_mask":
-                                Permissions.OwnerMask = (PermissionMask)UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                                break;
-                            case "group_mask":
-                                Permissions.GroupMask = (PermissionMask)UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                                break;
-                            case "everyone_mask":
-                                Permissions.EveryoneMask = (PermissionMask)UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                                break;
-                            case "next_owner_mask":
-                                Permissions.NextOwnerMask = (PermissionMask)UInt32.Parse(fields[1], System.Globalization.NumberStyles.HexNumber);
-                                break;
-                            case "creator_id":
-                                Creator = new LLUUID(fields[1]);
-                                break;
-                            case "owner_id":
-                                Owner = new LLUUID(fields[1]);
-                                break;
-                            case "last_owner_id":
-                                LastOwner = new LLUUID(fields[1]);
-                                break;
-                            case "group_id":
-                                Group = new LLUUID(fields[1]);
-                                break;
-                            case "group_owned":
-                                GroupOwned = (Int32.Parse(fields[1]) != 0);
-                                break;
-                            case "sale_type":
-                                ForSale = InventoryManager.StringToSaleType(fields[1]);
-                                break;
-                            case "sale_price":
-                                SalePrice = Int32.Parse(fields[1]);
-                                break;
-                            case "sale_info":
-                                // Container for sale_type and sale_price, ignore
-                                break;
-                            default:
-                                return false;
-                        }
-                    }
-                }
-            }
-
-            return true;
-        }
-
-        public override void Encode()
-        {
-            const string NL = "\n";
-
-            StringBuilder data = new StringBuilder("LLWearable version 22\n");
-            data.Append(Name); data.Append(NL); data.Append(NL);
-            data.Append("\tpermissions 0\n\t{\n");
-            data.Append("\t\tbase_mask\t"); data.Append(Helpers.UIntToHexString((uint)Permissions.BaseMask)); data.Append(NL);
-            data.Append("\t\towner_mask\t"); data.Append(Helpers.UIntToHexString((uint)Permissions.OwnerMask)); data.Append(NL);
-            data.Append("\t\tgroup_mask\t"); data.Append(Helpers.UIntToHexString((uint)Permissions.GroupMask)); data.Append(NL);
-            data.Append("\t\teveryone_mask\t"); data.Append(Helpers.UIntToHexString((uint)Permissions.EveryoneMask)); data.Append(NL);
-            data.Append("\t\tnext_owner_mask\t"); data.Append(Helpers.UIntToHexString((uint)Permissions.NextOwnerMask)); data.Append(NL);
-            data.Append("\t\tcreator_id\t"); data.Append(Creator.ToString()); data.Append(NL);
-            data.Append("\t\towner_id\t"); data.Append(Owner.ToString()); data.Append(NL);
-            data.Append("\t\tlast_owner_id\t"); data.Append(LastOwner.ToString()); data.Append(NL);
-            data.Append("\t\tgroup_id\t"); data.Append(Group.ToString()); data.Append(NL);
-            if (GroupOwned) data.Append("\t\tgroup_owned\t1\n");
-            data.Append("\t}\n");
-            data.Append("\tsale_info\t0\n");
-            data.Append("\t{\n");
-            data.Append("\t\tsale_type\t"); data.Append(InventoryManager.SaleTypeToString(ForSale)); data.Append(NL);
-            data.Append("\t\tsale_price\t"); data.Append(SalePrice); data.Append(NL);
-            data.Append("\t}\n");
-            data.Append("type "); data.Append((int)WearableType); data.Append(NL);
-
-            data.Append("parameters "); data.Append(Params.Count); data.Append(NL);
-            foreach (KeyValuePair<int, float> param in Params)
-            {
-                data.Append(param.Key); data.Append(" "); data.Append(Helpers.FloatToTerseString(param.Value)); data.Append(NL);
-            }
-
-            data.Append("textures "); data.Append(Textures.Count); data.Append(NL);
-            foreach (KeyValuePair<AppearanceManager.TextureIndex, LLUUID> texture in Textures)
-            {
-                data.Append(texture.Key); data.Append(" "); data.Append(texture.Value.ToString()); data.Append(NL);
-            }
-
-            AssetData = Helpers.StringToField(data.ToString());
-        }
-    }
-
-    public class AssetClothing : AssetWearable
-    {
-        public override AssetType AssetType { get { return AssetType.Clothing; } }
-
-        public AssetClothing() { }
-        public AssetClothing(byte[] assetData) : base(assetData) { }
-        public AssetClothing(string source) : base(source) { }
-    }
-
-    public class AssetBodypart : AssetWearable
-    {
-        public override AssetType AssetType { get { return AssetType.Bodypart; } }
-
-        public AssetBodypart() { }
-        public AssetBodypart(byte[] assetData) : base(assetData) { }
-        public AssetBodypart(string source) : base(source) { }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Avatar.cs b/old/libsl1550/libsecondlife/Avatar.cs
deleted file mode 100644
index b8e55ef..0000000
--- a/old/libsl1550/libsecondlife/Avatar.cs
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Net;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Represents an avatar in Second Life (other than your own)
-    /// </summary>
-    public class Avatar : LLObject
-    {
-        /// <summary>
-        /// Avatar profile flags
-        /// </summary>
-        [Flags]
-        public enum ProfileFlags
-        {
-            ALLOW_PUBLISH = 1,
-            MATURE_PUBLISH = 2,
-            IDENTIFIED = 4,
-            TRANSACTED = 8,
-            ONLINE = 16
-        }
-
-        #region Avatar Structs
-
-        /// <summary>
-        /// Positive and negative ratings
-        /// </summary>
-        public struct Statistics
-        {
-            /// <summary>Positive ratings for Behavior</summary>
-            public int BehaviorPositive;
-            /// <summary>Negative ratings for Behavior</summary>
-            public int BehaviorNegative;
-            /// <summary>Positive ratings for Appearance</summary>
-            public int AppearancePositive;
-            /// <summary>Negative ratings for Appearance</summary>
-            public int AppearanceNegative;
-            /// <summary>Positive ratings for Building</summary>
-            public int BuildingPositive;
-            /// <summary>Negative ratings for Building</summary>
-            public int BuildingNegative;
-            /// <summary>Positive ratings given by this avatar</summary>
-            public int GivenPositive;
-            /// <summary>Negative ratings given by this avatar</summary>
-            public int GivenNegative;
-        }
-
-        /// <summary>
-        /// Avatar properties including about text, profile URL, image IDs and
-        /// publishing settings
-        /// </summary>
-        public struct AvatarProperties
-        {
-            /// <summary>First Life about text</summary>
-            public string FirstLifeText;
-            /// <summary>First Life image ID</summary>
-            public LLUUID FirstLifeImage;
-            /// <summary></summary>
-            public LLUUID Partner;
-            /// <summary></summary>
-            public string AboutText;
-            /// <summary></summary>
-            public string BornOn;
-            /// <summary></summary>
-            public string CharterMember;
-            /// <summary>Profile image ID</summary>
-            public LLUUID ProfileImage;
-            /// <summary>Flags of the profile</summary>
-            public ProfileFlags Flags;
-            /// <summary>Web URL for this profile</summary>
-            public string ProfileURL;
-
-            #region Properties
-
-            /// <summary>Should this profile be published on the web</summary>
-            public bool AllowPublish
-            {
-                get
-                {
-                    return ((Flags & ProfileFlags.ALLOW_PUBLISH) != 0);
-                }
-                set
-                {
-                    if (value == true)
-                    {
-                        Flags |= ProfileFlags.ALLOW_PUBLISH;
-                    }
-                    else
-                    {
-                        Flags &= ~ProfileFlags.ALLOW_PUBLISH;
-                    }
-                }
-            }
-            /// <summary>Avatar Online Status</summary>
-            public bool Online
-            {
-                get
-                {
-                    return ((Flags & ProfileFlags.ONLINE) != 0);
-                }
-                set
-                {
-                    if (value == true)
-                    {
-                        Flags |= ProfileFlags.ONLINE;
-                    }
-                    else
-                    {
-                        Flags &= ~ProfileFlags.ONLINE;
-                    }
-                }
-            }
-            /// <summary>Is this a mature profile</summary>
-            public bool MaturePublish
-            {
-                get
-                {
-                    return ((Flags & ProfileFlags.MATURE_PUBLISH) != 0);
-                }
-                set
-                {
-                    if (value == true)
-                    {
-                        Flags |= ProfileFlags.MATURE_PUBLISH;
-                    }
-                    else
-                    {
-                        Flags &= ~ProfileFlags.MATURE_PUBLISH;
-                    }
-                }
-            }
-            /// <summary></summary>
-            public bool Identified
-            {
-                get
-                {
-                    return ((Flags & ProfileFlags.IDENTIFIED) != 0);
-                }
-                set
-                {
-                    if (value == true)
-                    {
-                        Flags |= ProfileFlags.IDENTIFIED;
-                    }
-                    else
-                    {
-                        Flags &= ~ProfileFlags.IDENTIFIED;
-                    }
-                }
-            }
-            ///// <summary></summary>
-            public bool Transacted
-            {
-                get
-                {
-                    return ((Flags & ProfileFlags.TRANSACTED) != 0);
-                }
-                set
-                {
-                    if (value == true)
-                    {
-                        Flags |= ProfileFlags.TRANSACTED;
-                    }
-                    else
-                    {
-                        Flags &= ~ProfileFlags.TRANSACTED;
-                    }
-                }
-            }
-
-            #endregion Properties
-        }
-
-        /// <summary>
-        /// Avatar interests including spoken languages, skills, and "want to"
-        /// choices
-        /// </summary>
-        public struct Interests
-        {
-            /// <summary>Languages profile field</summary>
-            public string LanguagesText;
-            /// <summary></summary>
-            // FIXME:
-            public uint SkillsMask;
-            /// <summary></summary>
-            public string SkillsText;
-            /// <summary></summary>
-            // FIXME:
-            public uint WantToMask;
-            /// <summary></summary>
-            public string WantToText;
-        }
-
-        #endregion Avatar Structs
-
-
-        #region Public Members
-
-        /// <summary>Groups that this avatar is a member of</summary>
-        public List<LLUUID> Groups = new List<LLUUID>();
-        /// <summary>Positive and negative ratings</summary>
-        public Statistics ProfileStatistics = new Statistics();
-        /// <summary>Avatar properties including about text, profile URL, image IDs and
-        /// publishing settings</summary>
-        public AvatarProperties ProfileProperties = new AvatarProperties();
-        /// <summary>Avatar interests including spoken languages, skills, and "want to"
-        /// choices</summary>
-        public Interests ProfileInterests = new Interests();
-        /// <summary>Simulator the avatar is in</summary>
-        public Simulator CurrentSim = null;
-
-        #endregion Public Members
-
-
-        /// <summary>Full name</summary>
-        public string Name
-        {
-            get
-            {
-                if (name.Length > 0)
-                {
-                    return name;
-                }
-                else if (NameValues == null || NameValues.Length == 0)
-                {
-                    return String.Empty;
-                }
-                else
-                {
-                    string firstName = String.Empty;
-                    string lastName = String.Empty;
-
-                    for (int i = 0; i < NameValues.Length; i++)
-                    {
-                        if (NameValues[i].Name == "FirstName" && NameValues[i].Type == NameValue.ValueType.String)
-                            firstName = (string)NameValues[i].Value;
-                        else if (NameValues[i].Name == "LastName" && NameValues[i].Type == NameValue.ValueType.String)
-                            lastName = (string)NameValues[i].Value;
-                    }
-
-                    if (firstName != String.Empty && lastName != String.Empty)
-                    {
-                        name = String.Format("{0} {1}", firstName, lastName);
-                        return name;
-                    }
-                    else
-                    {
-                        return String.Empty;
-                    }
-                }
-            }
-        }
-
-        /// <summary>Active group</summary>
-        public string GroupName
-        {
-            get
-            {
-                for (int i = 0; i < NameValues.Length; i++)
-                {
-                    if (NameValues[i].Name == "Title" && NameValues[i].Type == NameValue.ValueType.String)
-                    {
-                        groupName = (string)NameValues[i].Value;
-                        break;
-                    }
-                }
-
-                return groupName;
-            }
-        }
-
-        /// <summary>Gets the local ID of the prim the avatar is sitting on,
-        /// zero if the avatar is not currently sitting</summary>
-        public uint SittingOn { get { return sittingOn; } }
-
-
-        internal string name = String.Empty;
-        internal string groupName = String.Empty;
-        internal uint sittingOn
-        {
-            get
-            {
-                return ParentID;
-            }
-
-            set
-            {
-                ParentID = value;
-            }
-        }
-
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        public Avatar()
-        {
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/AvatarManager.cs b/old/libsl1550/libsecondlife/AvatarManager.cs
deleted file mode 100644
index 67891cd..0000000
--- a/old/libsl1550/libsecondlife/AvatarManager.cs
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Retrieve friend status notifications, and retrieve avatar names and
-    /// profiles
-    /// </summary>
-    public class AvatarManager
-    {
-        /// <summary>
-        /// Triggered when a UUIDNameReply is received
-        /// </summary>
-        /// <param name="names"></param>
-        public delegate void AvatarNamesCallback(Dictionary<LLUUID, string> names);
-        /// <summary>
-        /// Triggered when a response for avatar statistics (ratings) is returned
-        /// </summary>
-        /// <param name="avatarID"></param>
-        /// <param name="statistics"></param>
-        // public delegate void AvatarStatisticsCallback(LLUUID avatarID, Avatar.Statistics statistics);
-        /// <summary>
-        /// Triggered when a response for avatar interests is returned
-        /// </summary>
-        /// <param name="avatarID"></param>
-        /// <param name="interests"></param>
-        public delegate void AvatarInterestsCallback(LLUUID avatarID, Avatar.Interests interests);
-        /// <summary>
-        /// Triggered when avatar properties are received (AvatarPropertiesReply)
-        /// </summary>
-        /// <param name="avatarID"></param>
-        /// <param name="properties"></param>
-        public delegate void AvatarPropertiesCallback(LLUUID avatarID, Avatar.AvatarProperties properties);
-        /// <summary>
-        /// Triggered when an avatar group list is received (AvatarGroupsReply)
-        /// </summary>
-        /// <param name="avatarID"></param>
-        /// <param name="groups"></param>
-        public delegate void AvatarGroupsCallback(LLUUID avatarID, AvatarGroupsReplyPacket.GroupDataBlock[] groups);
-        /// <summary>
-        /// Triggered when a name search reply is received (AvatarPickerReply)
-        /// </summary>
-        /// <param name="queryID"></param>
-        /// <param name="avatars"></param>
-        public delegate void AvatarNameSearchCallback(LLUUID queryID, Dictionary<LLUUID, string> avatars);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="sourceID"></param>
-        /// <param name="targetID"></param>
-        /// <param name="targetPos"></param>
-        /// <param name="pointType"></param>
-        /// <param name="duration"></param>
-        /// <param name="id"></param>
-        public delegate void PointAtCallback(LLUUID sourceID, LLUUID targetID, LLVector3d targetPos,
-            PointAtType pointType, float duration, LLUUID id);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="sourceID"></param>
-        /// <param name="targetID"></param>
-        /// <param name="targetPos"></param>
-        /// <param name="lookType"></param>
-        /// <param name="duration"></param>
-        /// <param name="id"></param>
-        public delegate void LookAtCallback(LLUUID sourceID, LLUUID targetID, LLVector3d targetPos,
-            LookAtType lookType, float duration, LLUUID id);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="type"></param>
-        /// <param name="sourceID"></param>
-        /// <param name="targetID"></param>
-        /// <param name="targetPos"></param>
-        /// <param name="duration"></param>
-        /// <param name="id"></param>
-        public delegate void EffectCallback(EffectType type, LLUUID sourceID, LLUUID targetID,
-            LLVector3d targetPos, float duration, LLUUID id);
-
-
-        /// <summary></summary>
-        public event AvatarNamesCallback OnAvatarNames;
-        /// <summary></summary>
-        // public event AvatarStatisticsCallback OnAvatarStatistics;
-        /// <summary></summary>
-        public event AvatarInterestsCallback OnAvatarInterests;
-        /// <summary></summary>
-        public event AvatarPropertiesCallback OnAvatarProperties;
-        /// <summary></summary>
-        public event AvatarGroupsCallback OnAvatarGroups;
-        /// <summary></summary>
-        public event AvatarNameSearchCallback OnAvatarNameSearch;
-        /// <summary></summary>
-        public event PointAtCallback OnPointAt;
-        /// <summary></summary>
-        public event LookAtCallback OnLookAt;
-        /// <summary></summary>
-        public event EffectCallback OnEffect;
-
-        private SecondLife Client;
-
-        /// <summary>
-        /// Represents other avatars
-        /// </summary>
-        /// <param name="client"></param>
-        public AvatarManager(SecondLife client)
-        {
-            Client = client;
-
-            // Avatar profile callbacks
-            Client.Network.RegisterCallback(PacketType.AvatarPropertiesReply, new NetworkManager.PacketCallback(AvatarPropertiesHandler));
-            // Client.Network.RegisterCallback(PacketType.AvatarStatisticsReply, new NetworkManager.PacketCallback(AvatarStatisticsHandler));
-            Client.Network.RegisterCallback(PacketType.AvatarInterestsReply, new NetworkManager.PacketCallback(AvatarInterestsHandler));
-
-            // Avatar group callback
-            Client.Network.RegisterCallback(PacketType.AvatarGroupsReply, new NetworkManager.PacketCallback(AvatarGroupsHandler));
-
-            // Viewer effect callback
-            Client.Network.RegisterCallback(PacketType.ViewerEffect, new NetworkManager.PacketCallback(ViewerEffectHandler));
-
-            // Other callbacks
-            Client.Network.RegisterCallback(PacketType.UUIDNameReply, new NetworkManager.PacketCallback(AvatarNameHandler));
-            Client.Network.RegisterCallback(PacketType.AvatarPickerReply, new NetworkManager.PacketCallback(AvatarPickerReplyHandler));
-	        Client.Network.RegisterCallback(PacketType.AvatarAnimation, new NetworkManager.PacketCallback(AvatarAnimationHandler));
-        }
-
-        /// <summary>Tracks the specified avatar on your map</summary>
-        /// <param name="preyID">Avatar ID to track</param>
-        public void TrackAvatar(LLUUID preyID)
-        {
-            TrackAgentPacket p = new TrackAgentPacket();
-            p.AgentData.AgentID = Client.Self.AgentID;
-            p.AgentData.SessionID = Client.Self.SessionID;
-            p.TargetData.PreyID = preyID;
-            Client.Network.SendPacket(p);
-        }
-
-        /// <summary>
-        /// Request a single avatar name
-        /// </summary>
-        /// <param name="id">The avatar key to retrieve a name for</param>
-        public void RequestAvatarName(LLUUID id)
-        {
-            UUIDNameRequestPacket request = new UUIDNameRequestPacket();
-            request.UUIDNameBlock = new UUIDNameRequestPacket.UUIDNameBlockBlock[1];
-            request.UUIDNameBlock[0] = new UUIDNameRequestPacket.UUIDNameBlockBlock();
-            request.UUIDNameBlock[0].ID = id;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        /// Request a list of avatar names
-        /// </summary>
-        /// <param name="ids">The avatar keys to retrieve names for</param>
-        public void RequestAvatarNames(List<LLUUID> ids)
-        {
-            UUIDNameRequestPacket request = new UUIDNameRequestPacket();
-            request.UUIDNameBlock = new UUIDNameRequestPacket.UUIDNameBlockBlock[ids.Count];
-
-            for (int i = 0; i < ids.Count; i++)
-            {
-                request.UUIDNameBlock[i] = new UUIDNameRequestPacket.UUIDNameBlockBlock();
-                request.UUIDNameBlock[i].ID = ids[i];
-            }
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        /// Start a request for Avatar Properties
-        /// </summary>
-        /// <param name="avatarid"></param>
-        public void RequestAvatarProperties(LLUUID avatarid)
-        {
-            AvatarPropertiesRequestPacket aprp = new AvatarPropertiesRequestPacket();
-
-            aprp.AgentData.AgentID = Client.Self.AgentID;
-            aprp.AgentData.SessionID = Client.Self.SessionID;
-            aprp.AgentData.AvatarID = avatarid;
-
-            Client.Network.SendPacket(aprp);
-        }
-
-        /// <summary>
-        /// Search for an avatar (first name, last name, and uuid)
-        /// </summary>
-        /// <param name="name">The name to search for</param>
-        /// <param name="queryID">An ID to associate with this query</param>
-        public void RequestAvatarNameSearch(string name, LLUUID queryID)
-        {
-            AvatarPickerRequestPacket aprp = new AvatarPickerRequestPacket();
-
-            aprp.AgentData.AgentID = Client.Self.AgentID;
-            aprp.AgentData.SessionID = Client.Self.SessionID;
-            aprp.AgentData.QueryID = queryID;
-            aprp.Data.Name = Helpers.StringToField(name);
-
-            Client.Network.SendPacket(aprp);
-        }
-
-        #region Packet Handlers
-
-        /// <summary>
-        /// Process an incoming UUIDNameReply Packet and insert Full Names into the Avatars Dictionary
-        /// </summary>
-        /// <param name="packet">Incoming Packet to process</param>
-        /// <param name="simulator">Unused</param>
-        private void AvatarNameHandler(Packet packet, Simulator simulator)
-        {
-            if (OnAvatarNames != null)
-            {
-                Dictionary<LLUUID, string> names = new Dictionary<LLUUID, string>();
-                UUIDNameReplyPacket reply = (UUIDNameReplyPacket)packet;
-
-                foreach (UUIDNameReplyPacket.UUIDNameBlockBlock block in reply.UUIDNameBlock)
-                {
-                    names[block.ID] = Helpers.FieldToUTF8String(block.FirstName) +
-                        " " + Helpers.FieldToUTF8String(block.LastName);
-                }
-
-                OnAvatarNames(names);
-            }
-        }
-
-        /// <summary>
-        /// Process incoming avatar properties (profile data)
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="sim"></param>
-        private void AvatarPropertiesHandler(Packet packet, Simulator sim)
-        {
-            if (OnAvatarProperties != null)
-            {
-                AvatarPropertiesReplyPacket reply = (AvatarPropertiesReplyPacket)packet;
-                Avatar.AvatarProperties properties = new Avatar.AvatarProperties();
-
-                properties.ProfileImage = reply.PropertiesData.ImageID;
-                properties.FirstLifeImage = reply.PropertiesData.FLImageID;
-                properties.Partner = reply.PropertiesData.PartnerID;
-                properties.AboutText = Helpers.FieldToUTF8String(reply.PropertiesData.AboutText);
-                properties.FirstLifeText = Helpers.FieldToUTF8String(reply.PropertiesData.FLAboutText);
-                properties.BornOn = Helpers.FieldToUTF8String(reply.PropertiesData.BornOn);
-                //properties.CharterMember = Helpers.FieldToUTF8String(reply.PropertiesData.CharterMember);
-                uint charter = Helpers.BytesToUInt(reply.PropertiesData.CharterMember);
-                if ( charter == 0 ) {
-                    properties.CharterMember = "Resident";
-                } else if ( charter == 2 ) {
-                    properties.CharterMember = "Charter";
-                } else if ( charter == 3 ) {
-                    properties.CharterMember = "Linden";
-                } else {
-                    properties.CharterMember = Helpers.FieldToUTF8String(reply.PropertiesData.CharterMember);
-                }
-                properties.Flags = (Avatar.ProfileFlags)reply.PropertiesData.Flags;
-                properties.ProfileURL = Helpers.FieldToUTF8String(reply.PropertiesData.ProfileURL);
-
-                OnAvatarProperties(reply.AgentData.AvatarID, properties);
-            }
-        }
-
-        /// <summary>
-        /// Process incoming Avatar Interests information
-        /// </summary>
-        private void AvatarInterestsHandler(Packet packet, Simulator simulator)
-        {
-            if (OnAvatarInterests != null)
-            {
-                AvatarInterestsReplyPacket airp = (AvatarInterestsReplyPacket)packet;
-                Avatar.Interests interests = new Avatar.Interests();
-
-                interests.WantToMask = airp.PropertiesData.WantToMask;
-                interests.WantToText = Helpers.FieldToUTF8String(airp.PropertiesData.WantToText);
-                interests.SkillsMask = airp.PropertiesData.SkillsMask;
-                interests.SkillsText = Helpers.FieldToUTF8String(airp.PropertiesData.SkillsText);
-                interests.LanguagesText = Helpers.FieldToUTF8String(airp.PropertiesData.LanguagesText);
-
-                OnAvatarInterests(airp.AgentData.AvatarID, interests);
-            }
-        }
-
-        private void AvatarGroupsHandler(Packet packet, Simulator simulator)
-        {
-            if (OnAvatarGroups != null)
-            {
-                AvatarGroupsReplyPacket groups = (AvatarGroupsReplyPacket)packet;
-
-                // FIXME: Build a little struct to represent the groups.GroupData blocks so we keep
-                // libsecondlife.Packets abstracted away
-                OnAvatarGroups(groups.AgentData.AvatarID, groups.GroupData);
-            }
-        }
-
-        private void AvatarPickerReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnAvatarNameSearch != null)
-            {
-                AvatarPickerReplyPacket reply = (AvatarPickerReplyPacket)packet;
-                Dictionary<LLUUID, string> avatars = new Dictionary<LLUUID, string>();
-
-                foreach (AvatarPickerReplyPacket.DataBlock block in reply.Data)
-                {
-                    avatars[block.AvatarID] = Helpers.FieldToUTF8String(block.FirstName) +
-                        " " + Helpers.FieldToUTF8String(block.LastName);
-                }
-
-                OnAvatarNameSearch(reply.AgentData.QueryID, avatars);
-            }
-        }
-
-        /// <summary>
-        /// Process an incoming effect
-        /// </summary>
-        private void ViewerEffectHandler(Packet packet, Simulator simulator)
-        {
-            ViewerEffectPacket effect = (ViewerEffectPacket)packet;
-
-            foreach (ViewerEffectPacket.EffectBlock block in effect.Effect)
-            {
-                EffectType type = (EffectType)block.Type;
-
-                //LLColor color;
-                //if (block.Color.Length == 4)
-                //{
-                //    color = new LLColor(block.Color, 0);
-                //}
-                //else
-                //{
-                //    Client.Log("Received a ViewerEffect.EffectBlock.Color array with " + block.Color.Length +
-                //        " bytes", Helpers.LogLevel.Warning);
-                //    color = LLColor.Black;
-                //}
-
-                // Each ViewerEffect type uses it's own custom binary format for additional data. Fun eh?
-                switch (type)
-                {
-                    case EffectType.Text:
-                        Client.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!",
-                            Helpers.LogLevel.Warning);
-                        break;
-                    case EffectType.Icon:
-                        Client.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!",
-                            Helpers.LogLevel.Warning);
-                        break;
-                    case EffectType.Connector:
-                        Client.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!",
-                            Helpers.LogLevel.Warning);
-                        break;
-                    case EffectType.FlexibleObject:
-                        Client.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!",
-                            Helpers.LogLevel.Warning);
-                        break;
-                    case EffectType.AnimalControls:
-                        Client.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!",
-                            Helpers.LogLevel.Warning);
-                        break;
-                    case EffectType.AnimationObject:
-                        Client.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!",
-                            Helpers.LogLevel.Warning);
-                        break;
-                    case EffectType.Cloth:
-                        Client.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!",
-                            Helpers.LogLevel.Warning);
-                        break;
-                    case EffectType.Glow:
-                        Client.Log("Received a Glow ViewerEffect which is not implemented yet",
-                            Helpers.LogLevel.Warning);
-                        break;
-                    case EffectType.Beam:
-                    case EffectType.Point:
-                    case EffectType.Trail:
-                    case EffectType.Sphere:
-                    case EffectType.Spiral:
-                    case EffectType.Edit:
-                        if (OnEffect != null)
-                        {
-                            if (block.TypeData.Length == 56)
-                            {
-                                LLUUID sourceAvatar = new LLUUID(block.TypeData, 0);
-                                LLUUID targetObject = new LLUUID(block.TypeData, 16);
-                                LLVector3d targetPos = new LLVector3d(block.TypeData, 32);
-
-                                try { OnEffect(type, sourceAvatar, targetObject, targetPos, block.Duration, block.ID); }
-                                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                            }
-                            else
-                            {
-                                Client.Log("Received a " + type.ToString() +
-                                    " ViewerEffect with an incorrect TypeData size of " +
-                                    block.TypeData.Length + " bytes", Helpers.LogLevel.Warning);
-                            }
-                        }
-                        break;
-                    case EffectType.LookAt:
-                        if (OnLookAt != null)
-                        {
-                            if (block.TypeData.Length == 57)
-                            {
-                                LLUUID sourceAvatar = new LLUUID(block.TypeData, 0);
-                                LLUUID targetObject = new LLUUID(block.TypeData, 16);
-                                LLVector3d targetPos = new LLVector3d(block.TypeData, 32);
-                                LookAtType lookAt = (LookAtType)block.TypeData[56];
-
-                                try { OnLookAt(sourceAvatar, targetObject, targetPos, lookAt, block.Duration,
-                                    block.ID); }
-                                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                            }
-                            else
-                            {
-                                Client.Log("Received a LookAt ViewerEffect with an incorrect TypeData size of " +
-                                    block.TypeData.Length + " bytes", Helpers.LogLevel.Warning);
-                            }
-                        }
-                        break;
-                    case EffectType.PointAt:
-                        if (OnPointAt != null)
-                        {
-                            if (block.TypeData.Length == 57)
-                            {
-                                LLUUID sourceAvatar = new LLUUID(block.TypeData, 0);
-                                LLUUID targetObject = new LLUUID(block.TypeData, 16);
-                                LLVector3d targetPos = new LLVector3d(block.TypeData, 32);
-                                PointAtType pointAt = (PointAtType)block.TypeData[56];
-
-                                try { OnPointAt(sourceAvatar, targetObject, targetPos, pointAt, block.Duration,
-                                    block.ID); }
-                                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                            }
-                            else
-                            {
-                                Client.Log("Received a PointAt ViewerEffect with an incorrect TypeData size of " +
-                                    block.TypeData.Length + " bytes", Helpers.LogLevel.Warning);
-                            }
-                        }
-                        break;
-                    default:
-                        Client.Log("Received a ViewerEffect with an unknown type " + type, Helpers.LogLevel.Warning);
-                        break;
-                }
-            }
-        }
-
-        protected void AvatarAnimationHandler(Packet packet, Simulator sim)
-        {
-            //FIXME
-        }
-
-        #endregion Packet Handlers
-    }
-}
diff --git a/old/libsl1550/libsecondlife/BakeLayer.cs b/old/libsl1550/libsecondlife/BakeLayer.cs
deleted file mode 100644
index bffa8f7..0000000
--- a/old/libsl1550/libsecondlife/BakeLayer.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-
-namespace libsecondlife.Baking
-{
-    /// <summary>
-    /// A set of textures that are layered on texture of each other and "baked"
-    /// in to a single texture, for avatar appearances
-    /// </summary>
-    public class Baker
-    {
-        /// <summary>Reference to the SecondLife client</summary>
-        protected SecondLife Client;
-
-        /// <summary>Appearance parameters the drive the baking process</summary>
-        protected Dictionary<int, float> ParamValues;
-
-        /// <summary>Wearable textures</summary>
-        protected Dictionary<AppearanceManager.TextureIndex, AssetTexture> Textures = new Dictionary<AppearanceManager.TextureIndex, AssetTexture>();
-        protected int TextureCount;
-
-        public AssetTexture BakedTexture;
-
-        /// <summary>Width of the final baked image and scratchpad</summary>
-        protected int BakeWidth;
-        /// <summary>Height of the final baked image and scratchpad</summary>
-        protected int BakeHeight;
-        /// <summary>Bake type</summary>
-        public AppearanceManager.BakeType BakeType;
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client">Reference to the SecondLife client</param>
-        /// <param name="totalLayers">Total number of layers this layer set is
-        /// composed of</param>
-        /// <param name="paramValues">Appearance parameters the drive the
-        /// baking process</param>
-        /// <param name="width">Width of the final baked image</param>
-        /// <param name="height">Height of the final baked image</param>
-        public Baker(SecondLife client, AppearanceManager.BakeType bakeType, int textureCount, Dictionary<int, float> paramValues)
-        {
-            Client = client;
-            BakeType = bakeType;
-            TextureCount = textureCount;
-
-            if (bakeType == AppearanceManager.BakeType.Eyes)
-            {
-                BakeWidth = 128;
-                BakeHeight = 128;
-            }
-            else
-            {
-                BakeWidth = 512;
-                BakeHeight = 512;
-            }
-
-            ParamValues = paramValues;
-
-            if (textureCount == 0)
-                Bake();
-        }
-
-        /// <summary>
-        /// Adds an image to this baking texture and potentially processes it, or
-        /// stores it for processing later
-        /// </summary>
-        /// <param name="index">The baking texture index of the image to be added</param>
-        /// <param name="jp2data">JPEG2000 compressed image to be added to the
-        /// baking texture</param>
-        /// <returns>True if this texture is completely baked and JPEG2000 data
-        /// is available, otherwise false</returns>
-        public bool AddTexture(AppearanceManager.TextureIndex index, AssetTexture texture)
-        {
-            lock (Textures)
-            {
-                texture.Decode();
-                Textures.Add(index, texture);
-                Client.DebugLog("Adding texture " + index.ToString() + " to bake " + BakeType.ToString());
-            }
-
-            if (Textures.Count == TextureCount)
-            {
-                Bake();
-                return true;
-            }
-            else
-                return false;
-        }
-
-        public bool MissingTexture(AppearanceManager.TextureIndex index)
-        {
-            Client.DebugLog("Missing texture " + index.ToString() + " in bake " + BakeType.ToString());
-            TextureCount--;
-
-            if (Textures.Count == TextureCount)
-            {
-                Bake();
-                return true;
-            }
-            else
-                return false;
-        }
-
-        protected void Bake()
-        {
-            Client.DebugLog("Baking " + BakeType.ToString());
-            BakedTexture = new AssetTexture(new Image(BakeWidth, BakeHeight, ImageChannels.Color | ImageChannels.Alpha | ImageChannels.Bump));
-            int i = 0;
-
-            for (int y = 0; y < BakeHeight; y++)
-            {
-                for (int x = 0; x < BakeWidth; x++)
-                {
-                    if (((x ^ y) & 0x10) == 0)
-                    {
-                        BakedTexture.Image.Red[i] = 255;
-                        BakedTexture.Image.Green[i] = 0;
-                        BakedTexture.Image.Blue[i] = 0;
-                        BakedTexture.Image.Alpha[i] = 255;
-                        BakedTexture.Image.Bump[i] = 0;
-                    }
-                    else
-                    {
-                        BakedTexture.Image.Red[i] = 0;
-                        BakedTexture.Image.Green[i] = 0;
-                        BakedTexture.Image.Blue[i] = 255;
-                        BakedTexture.Image.Alpha[i] = 255;
-                        BakedTexture.Image.Bump[i] = 0;
-                    }
-
-                    ++i;
-                }
-            }
-
-            BakedTexture.Encode();
-        }
-
-        public static AppearanceManager.BakeType BakeTypeFor(AppearanceManager.TextureIndex index)
-        {
-            switch (index)
-            {
-                case AppearanceManager.TextureIndex.HeadBodypaint:
-                    return AppearanceManager.BakeType.Head;
-
-                case AppearanceManager.TextureIndex.UpperBodypaint:
-                case AppearanceManager.TextureIndex.UpperGloves:
-                case AppearanceManager.TextureIndex.UpperUndershirt:
-                case AppearanceManager.TextureIndex.UpperShirt:
-                case AppearanceManager.TextureIndex.UpperJacket:
-                    return AppearanceManager.BakeType.UpperBody;
-
-                case AppearanceManager.TextureIndex.LowerBodypaint:
-                case AppearanceManager.TextureIndex.LowerUnderpants:
-                case AppearanceManager.TextureIndex.LowerSocks:
-                case AppearanceManager.TextureIndex.LowerShoes:
-                case AppearanceManager.TextureIndex.LowerPants:
-                case AppearanceManager.TextureIndex.LowerJacket:
-                    return AppearanceManager.BakeType.LowerBody;
-
-                case AppearanceManager.TextureIndex.EyesIris:
-                    return AppearanceManager.BakeType.Eyes;
-
-                case AppearanceManager.TextureIndex.Skirt:
-                    return AppearanceManager.BakeType.Skirt;
-
-                default:
-                    return AppearanceManager.BakeType.Unknown;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/BitPack.cs b/old/libsl1550/libsecondlife/BitPack.cs
deleted file mode 100644
index 80e041d..0000000
--- a/old/libsl1550/libsecondlife/BitPack.cs
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Wrapper around a byte array that allows bit to be packed and unpacked
-    /// one at a time or by a variable amount. Useful for very tightly packed
-    /// data like LayerData packets
-    /// </summary>
-    public class BitPack
-    {
-        /// <summary></summary>
-        public byte[] Data;
-
-        /// <summary></summary>
-        public int BytePos
-        {
-            get
-            {
-                if (bytePos != 0 && bitPos == 0)
-                    return bytePos - 1;
-                else
-                    return bytePos;
-            }
-        }
-
-        /// <summary></summary>
-        public int BitPos { get { return bitPos; } }
-
-
-        private const int MAX_BITS = 8;
-
-        private int bytePos;
-        private int bitPos;
-        private bool weAreBigEndian = !BitConverter.IsLittleEndian;
-
-
-        /// <summary>
-        /// Default constructor, initialize the bit packer / bit unpacker
-        /// with a byte array and starting position
-        /// </summary>
-        /// <param name="data">Byte array to pack bits in to or unpack from</param>
-        /// <param name="pos">Starting position in the byte array</param>
-        public BitPack(byte[] data, int pos)
-        {
-            Data = data;
-            bytePos = pos;
-        }
-
-        /// <summary>
-        /// Pack a floating point value in to the data
-        /// </summary>
-        /// <param name="data">Floating point value to pack</param>
-        public void PackFloat(float data)
-        {
-            byte[] input = BitConverter.GetBytes(data);
-            if (weAreBigEndian) Array.Reverse(input);
-            PackBitArray(input, 32);
-        }
-
-        /// <summary>
-        /// Pack part or all of an integer in to the data
-        /// </summary>
-        /// <param name="data">Integer containing the data to pack</param>
-        /// <param name="totalCount">Number of bits of the integer to pack</param>
-        public void PackBits(int data, int totalCount)
-        {
-            byte[] input = BitConverter.GetBytes(data);
-            if (weAreBigEndian) Array.Reverse(input);
-            PackBitArray(input, totalCount);
-        }
-
-        /// <summary>
-        /// Pack part or all of an unsigned integer in to the data
-        /// </summary>
-        /// <param name="data">Unsigned integer containing the data to pack</param>
-        /// <param name="totalCount">Number of bits of the integer to pack</param>
-        public void PackBits(uint data, int totalCount)
-        {
-            byte[] input = BitConverter.GetBytes(data);
-            if (weAreBigEndian) Array.Reverse(input);
-            PackBitArray(input, totalCount);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="data"></param>
-        /// <param name="isSigned"></param>
-        /// <param name="intBits"></param>
-        /// <param name="fracBits"></param>
-        public void PackFixed(float data, bool isSigned, int intBits, int fracBits)
-        {
-            int unsignedBits = intBits + fracBits;
-            int totalBits = unsignedBits;
-            int min, max;
-
-            if (isSigned)
-            {
-                totalBits++;
-                min = 1 << intBits;
-                min *= -1;
-            }
-            else
-            {
-                min = 0;
-            }
-
-            max = 1 << intBits;
-
-            float fixedVal = Helpers.Clamp(data, (float)min, (float)max);
-            if (isSigned) fixedVal += max;
-            fixedVal *= 1 << fracBits;
-
-            if (totalBits <= 8)
-                PackBits((uint)fixedVal, 8);
-            else if (totalBits <= 16)
-                PackBits((uint)fixedVal, 16);
-            else if (totalBits <= 31)
-                PackBits((uint)fixedVal, 32);
-            else
-                throw new Exception("Can't use fixed point packing for " + totalBits);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="data"></param>
-        public void PackUUID(LLUUID data)
-        {
-            byte[] bytes = data.GetBytes();
-
-            // Not sure if our PackBitArray function can handle 128-bit byte
-            //arrays, so using this for now
-            for (int i = 0; i < 16; i++)
-                PackBits(bytes[i], 8);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="data"></param>
-        public void PackColor(LLColor data)
-        {
-            byte[] bytes = data.GetBytes();
-            PackBitArray(bytes, 32);
-        }
-
-        /// <summary>
-        /// Unpacking a floating point value from the data
-        /// </summary>
-        /// <returns>Unpacked floating point value</returns>
-        public float UnpackFloat()
-        {
-            byte[] output = UnpackBitsArray(32);
-
-            if (weAreBigEndian) Array.Reverse(output);
-            return BitConverter.ToSingle(output, 0);
-        }
-
-        /// <summary>
-        /// Unpack a variable number of bits from the data in to integer format
-        /// </summary>
-        /// <param name="totalCount">Number of bits to unpack</param>
-        /// <returns>An integer containing the unpacked bits</returns>
-        /// <remarks>This function is only useful up to 32 bits</remarks>
-        public int UnpackBits(int totalCount)
-        {
-            byte[] output = UnpackBitsArray(totalCount);
-
-            if (weAreBigEndian) Array.Reverse(output);
-            return BitConverter.ToInt32(output, 0);
-        }
-
-        /// <summary>
-        /// Unpack a variable number of bits from the data in to unsigned
-        /// integer format
-        /// </summary>
-        /// <param name="totalCount">Number of bits to unpack</param>
-        /// <returns>An unsigned integer containing the unpacked bits</returns>
-        /// <remarks>This function is only useful up to 32 bits</remarks>
-        public uint UnpackUBits(int totalCount)
-        {
-            byte[] output = UnpackBitsArray(totalCount);
-
-            if (weAreBigEndian) Array.Reverse(output);
-            return BitConverter.ToUInt32(output, 0);
-        }
-
-        public byte UnpackByte()
-        {
-            byte[] output = UnpackBitsArray(8);
-            return output[0];
-        }
-
-        public float UnpackFixed(bool signed, int intBits, int fracBits)
-        {
-            int minVal;
-            int maxVal;
-            int unsignedBits = intBits + fracBits;
-            int totalBits = unsignedBits;
-            float fixedVal;
-
-            if (signed)
-            {
-                totalBits++;
-
-                minVal = 1 << intBits;
-                minVal *= -1;
-            }
-            maxVal = 1 << intBits;
-
-            if (totalBits <= 8)
-                fixedVal = (float)UnpackByte();
-            else if (totalBits <= 16)
-                fixedVal = (float)UnpackUBits(16);
-            else if (totalBits <= 31)
-                fixedVal = (float)UnpackUBits(32);
-            else
-                return 0.0f;
-
-            fixedVal /= (float)(1 << fracBits);
-
-            if (signed) fixedVal -= (float)maxVal;
-
-            return fixedVal;
-        }
-
-        public LLUUID UnpackUUID()
-        {
-            if (bitPos != 0) return LLUUID.Zero;
-
-            LLUUID val = new LLUUID(Data, bytePos);
-            bytePos += 16;
-            return val;
-        }
-
-        private void PackBitArray(byte[] data, int totalCount)
-        {
-            int count = 0;
-            int curBytePos = 0;
-            int curBitPos = 0;
-
-            while (totalCount > 0)
-            {
-                if (totalCount > MAX_BITS)
-                {
-                    count = MAX_BITS;
-                    totalCount -= MAX_BITS;
-                }
-                else
-                {
-                    count = totalCount;
-                    totalCount = 0;
-                }
-
-                while (count > 0)
-                {
-                    if ((data[curBytePos] & (0x01 << (count - 1))) != 0)
-                        Data[bytePos] |= (byte)(0x80 >> bitPos);
-
-                    --count;
-                    ++bitPos;
-                    ++curBitPos;
-
-                    if (bitPos >= MAX_BITS)
-                    {
-                        bitPos = 0;
-                        ++bytePos;
-                    }
-                    if (curBitPos >= MAX_BITS)
-                    {
-                        curBitPos = 0;
-                        ++curBytePos;
-                    }
-                }
-            }
-        }
-
-        private byte[] UnpackBitsArray(int totalCount)
-        {
-            int count = 0;
-            byte[] output = new byte[4];
-            int curBytePos = 0;
-            int curBitPos = 0;
-
-            while (totalCount > 0)
-            {
-                if (totalCount > MAX_BITS)
-                {
-                    count = MAX_BITS;
-                    totalCount -= MAX_BITS;
-                }
-                else
-                {
-                    count = totalCount;
-                    totalCount = 0;
-                }
-
-                while (count > 0)
-                {
-                    // Shift the previous bits
-                    output[curBytePos] <<= 1;
-
-                    // Grab one bit
-                    if ((Data[bytePos] & (0x80 >> bitPos++)) != 0)
-                        ++output[curBytePos];
-
-                    --count;
-                    ++curBitPos;
-
-                    if (bitPos >= MAX_BITS)
-                    {
-                        bitPos = 0;
-                        ++bytePos;
-                    }
-                    if (curBitPos >= MAX_BITS)
-                    {
-                        curBitPos = 0;
-                        ++curBytePos;
-                    }
-                }
-            }
-
-            return output;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/BlockingQueue.cs b/old/libsl1550/libsecondlife/BlockingQueue.cs
deleted file mode 100644
index 8d95d36..0000000
--- a/old/libsl1550/libsecondlife/BlockingQueue.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Threading;
-using libsecondlife;
-
-namespace System.Collections
-{
-    /// <summary>
-    /// Same as Queue except Dequeue function blocks until there is an object to return.
-    /// Note: This class does not need to be synchronized
-    /// </summary>
-    public class BlockingQueue : Queue
-    {
-        private bool open;
-
-        /// <summary>
-        /// Create new BlockingQueue.
-        /// </summary>
-        /// <param name="col">The System.Collections.ICollection to copy elements from</param>
-        public BlockingQueue(ICollection col)
-            : base(col)
-        {
-            open = true;
-        }
-
-        /// <summary>
-        /// Create new BlockingQueue.
-        /// </summary>
-        /// <param name="capacity">The initial number of elements that the queue can contain</param>
-        /// <param name="growFactor">The factor by which the capacity of the queue is expanded</param>
-        public BlockingQueue(int capacity, float growFactor)
-            : base(capacity, growFactor)
-        {
-            open = true;
-        }
-
-        /// <summary>
-        /// Create new BlockingQueue.
-        /// </summary>
-        /// <param name="capacity">The initial number of elements that the queue can contain</param>
-        public BlockingQueue(int capacity)
-            : base(capacity)
-        {
-            open = true;
-        }
-
-        /// <summary>
-        /// Create new BlockingQueue.
-        /// </summary>
-        public BlockingQueue()
-            : base()
-        {
-            open = true;
-        }
-
-        /// <summary>
-        /// BlockingQueue Destructor (Close queue, resume any waiting thread).
-        /// </summary>
-        ~BlockingQueue()
-        {
-            Close();
-        }
-
-        /// <summary>
-        /// Remove all objects from the Queue.
-        /// </summary>
-        public override void Clear()
-        {
-            lock (base.SyncRoot)
-            {
-                base.Clear();
-            }
-        }
-
-        /// <summary>
-        /// Remove all objects from the Queue, resume all dequeue threads.
-        /// </summary>
-        public void Close()
-        {
-            lock (base.SyncRoot)
-            {
-                open = false;
-                base.Clear();
-                Monitor.PulseAll(base.SyncRoot); // resume any waiting threads
-            }
-        }
-
-        /// <summary>
-        /// Removes and returns the object at the beginning of the Queue.
-        /// </summary>
-        /// <returns>Object in queue.</returns>
-        public override object Dequeue()
-        {
-            return Dequeue(Timeout.Infinite);
-        }
-
-        /// <summary>
-        /// Removes and returns the object at the beginning of the Queue.
-        /// </summary>
-        /// <param name="timeout">time to wait before returning</param>
-        /// <returns>Object in queue.</returns>
-        public NetworkManager.IncomingPacket Dequeue(TimeSpan timeout)
-        {
-            return Dequeue(timeout.Milliseconds);
-        }
-
-        /// <summary>
-        /// Removes and returns the object at the beginning of the Queue.
-        /// </summary>
-        /// <param name="timeout">time to wait before returning (in milliseconds)</param>
-        /// <returns>Object in queue.</returns>
-        public NetworkManager.IncomingPacket Dequeue(int timeout)
-        {
-            lock (base.SyncRoot)
-            {
-                while (open && (base.Count == 0))
-                {
-                    if (!Monitor.Wait(base.SyncRoot, timeout))
-                        throw new InvalidOperationException("Timeout");
-                }
-                if (open)
-                    return (NetworkManager.IncomingPacket)base.Dequeue();
-                else
-                    throw new InvalidOperationException("Queue Closed");
-            }
-        }
-
-        public bool Dequeue(int timeout, ref NetworkManager.IncomingPacket packet)
-        {
-            lock (base.SyncRoot)
-            {
-                while (open && (base.Count == 0))
-                {
-                    if (!Monitor.Wait(base.SyncRoot, timeout))
-                        return false;
-                }
-                if (open)
-                {
-                    packet = (NetworkManager.IncomingPacket)base.Dequeue();
-                    return true;
-                }
-                else
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Adds an object to the end of the Queue.
-        /// </summary>
-        /// <param name="obj">Object to put in queue</param>
-        public override void Enqueue(object obj)
-        {
-            lock (base.SyncRoot)
-            {
-                base.Enqueue(obj);
-                Monitor.Pulse(base.SyncRoot);
-            }
-        }
-
-        /// <summary>
-        /// Open Queue.
-        /// </summary>
-        public void Open()
-        {
-            lock (base.SyncRoot)
-            {
-                open = true;
-            }
-        }
-
-        /// <summary>
-        /// Gets flag indicating if queue has been closed.
-        /// </summary>
-        public bool Closed
-        {
-            get { return !open; }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Capabilities/CapsBase.cs b/old/libsl1550/libsecondlife/Capabilities/CapsBase.cs
deleted file mode 100644
index eda7594..0000000
--- a/old/libsl1550/libsecondlife/Capabilities/CapsBase.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Net;
-
-namespace libsecondlife.Capabilities
-{
-    public class CapsBase : WebClient
-    {
-        public int Timeout;
-        public int ContentLength;
-
-        public Uri Location { get { return _Location; } }
-
-        protected Uri _Location;
-
-        public CapsBase(Uri location)
-        {
-            _Location = location;
-        }
-
-        protected override WebRequest GetWebRequest(Uri address)
-        {
-            HttpWebRequest request = base.GetWebRequest(address) as HttpWebRequest;
-
-            if (request == null)
-                throw new ArgumentException("CapsBase requires a Uri", "address");
-
-            // Disable keep-alive
-            request.KeepAlive = false;
-            request.ServicePoint.Expect100Continue = false;
-
-            // Set the timeout
-            if (Timeout > 0)
-                request.Timeout = Timeout;
-
-            return request;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Capabilities/CapsClient.cs b/old/libsl1550/libsecondlife/Capabilities/CapsClient.cs
deleted file mode 100644
index f40afe1..0000000
--- a/old/libsl1550/libsecondlife/Capabilities/CapsClient.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Net;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife.Capabilities
-{
-    public class CapsClient
-    {
-        public delegate void ProgressCallback(CapsClient client, long bytesReceived, long bytesSent,
-            long totalBytesToReceive, long totalBytesToSend);
-        public delegate void CompleteCallback(CapsClient client, LLSD result, Exception error);
-
-        public ProgressCallback OnProgress;
-        public CompleteCallback OnComplete;
-
-        public IWebProxy Proxy;
-        public object UserData;
-
-        protected CapsBase _Client;
-        protected byte[] _PostData;
-        protected string _ContentType;
-
-        public CapsClient(Uri capability)
-        {
-            _Client = new CapsBase(capability);
-            _Client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(Client_DownloadProgressChanged);
-            _Client.DownloadDataCompleted += new DownloadDataCompletedEventHandler(Client_DownloadDataCompleted);
-            _Client.UploadProgressChanged += new UploadProgressChangedEventHandler(Client_UploadProgressChanged);
-            _Client.UploadDataCompleted += new UploadDataCompletedEventHandler(Client_UploadDataCompleted);
-        }
-
-        public void StartRequest()
-        {
-            StartRequest(null, null);
-        }
-
-        public void StartRequest(LLSD llsd)
-        {
-            byte[] postData = LLSDParser.SerializeXmlBytes(llsd);
-            StartRequest(postData, null);
-        }
-
-        public void StartRequest(byte[] postData)
-        {
-            StartRequest(postData, null);
-        }
-
-        public void StartRequest(byte[] postData, string contentType)
-        {
-            _PostData = postData;
-            _ContentType = contentType;
-
-            if (_Client.IsBusy)
-            {
-                SecondLife.LogStatic("New CAPS request to " + _Client.Location +
-                    " initiated, closing previous request", Helpers.LogLevel.Warning);
-                _Client.CancelAsync();
-            }
-            else
-            {
-                SecondLife.DebugLogStatic("New CAPS request to " + _Client.Location + " initiated");
-            }
-
-            // Proxy
-            if (Proxy != null)
-                _Client.Proxy = Proxy;
-
-            // Content-Type
-            _Client.Headers.Clear();
-            if (!String.IsNullOrEmpty(contentType))
-                _Client.Headers.Add(HttpRequestHeader.ContentType, contentType);
-            else
-                _Client.Headers.Add(HttpRequestHeader.ContentType, "application/xml");
-
-            if (postData == null)
-                _Client.DownloadStringAsync(_Client.Location);
-            else
-                _Client.UploadDataAsync(_Client.Location, postData);
-        }
-
-        public void Cancel()
-        {
-            if (_Client.IsBusy)
-                _Client.CancelAsync();
-        }
-
-        #region Callback Handlers
-
-        private void Client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
-        {
-            if (OnProgress != null)
-            {
-                try { OnProgress(this, e.BytesReceived, 0, e.TotalBytesToReceive, 0); }
-                catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void Client_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
-        {
-            if (OnComplete != null && !e.Cancelled)
-            {
-                if (e.Error == null)
-                {
-                    LLSD result = LLSDParser.DeserializeXml(e.Result);
-
-                    try { OnComplete(this, result, e.Error); }
-                    catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
-                }
-                else
-                {
-                    if (Helpers.StringContains(e.Error.Message, "502"))
-                    {
-                        // These are normal, retry the request automatically
-                        StartRequest(_PostData, _ContentType);
-                    }
-                    else
-                    {
-                        try { OnComplete(this, null, e.Error); }
-                        catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-            }
-        }
-
-        private void Client_UploadProgressChanged(object sender, UploadProgressChangedEventArgs e)
-        {
-            if (OnProgress != null)
-            {
-                try { OnProgress(this, e.BytesReceived, e.BytesSent, e.TotalBytesToReceive, e.TotalBytesToSend); }
-                catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void Client_UploadDataCompleted(object sender, UploadDataCompletedEventArgs e)
-        {
-            if (OnComplete != null && !e.Cancelled)
-            {
-                if (e.Error == null)
-                {
-                    LLSD result = LLSDParser.DeserializeXml(e.Result);
-
-                    try { OnComplete(this, result, e.Error); }
-                    catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
-                }
-                else
-                {
-                    if (Helpers.StringContains(e.Error.Message, "502"))
-                    {
-                        // These are normal, retry the request automatically
-                        SecondLife.DebugLogStatic("502 error from capability " + _Client.Location);
-                        StartRequest(_PostData, _ContentType);
-                    }
-                    else
-                    {
-                        try { OnComplete(this, null, e.Error); }
-                        catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-            }
-            else if (e.Cancelled)
-            {
-                SecondLife.DebugLogStatic("Capability action at " + _Client.Location + " cancelled");
-            }
-        }
-
-        #endregion Callback Handlers
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Capabilities/CapsListener.cs b/old/libsl1550/libsecondlife/Capabilities/CapsListener.cs
deleted file mode 100644
index ce8db35..0000000
--- a/old/libsl1550/libsecondlife/Capabilities/CapsListener.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Net;
-
-#if !PocketPC
-
-namespace libsecondlife.Capabilities
-{
-    public class CapsListener
-    {
-    }
-}
-
-#endif
diff --git a/old/libsl1550/libsecondlife/Capabilities/EventQueueClient.cs b/old/libsl1550/libsecondlife/Capabilities/EventQueueClient.cs
deleted file mode 100644
index 7288157..0000000
--- a/old/libsl1550/libsecondlife/Capabilities/EventQueueClient.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Net;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife.Capabilities
-{
-    public class EventQueueClient
-    {
-        /// <summary>
-        ///
-        /// </summary>
-        public delegate void ConnectedCallback();
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="eventName"></param>
-        /// <param name="body"></param>
-        public delegate void EventCallback(string eventName, LLSDMap body);
-
-        /// <summary></summary>
-        public ConnectedCallback OnConnected;
-        /// <summary></summary>
-        public EventCallback OnEvent;
-
-        public IWebProxy Proxy;
-
-        public bool Running { get { return _Running && _Client.IsBusy; } }
-
-        protected CapsBase _Client;
-        protected bool _Dead;
-        protected bool _Running;
-
-        public EventQueueClient(Uri eventQueueLocation)
-        {
-            _Client = new CapsBase(eventQueueLocation);
-            _Client.OpenWriteCompleted += new OpenWriteCompletedEventHandler(Client_OpenWriteCompleted);
-            _Client.UploadDataCompleted += new UploadDataCompletedEventHandler(Client_UploadDataCompleted);
-        }
-
-        public void Start()
-        {
-            _Dead = false;
-            _Client.OpenWriteAsync(_Client.Location);
-        }
-
-        public void Stop(bool immediate)
-        {
-            _Dead = true;
-
-            if (immediate)
-                _Running = false;
-
-            if (_Client.IsBusy)
-            {
-                SecondLife.DebugLogStatic("Stopping a running event queue");
-                _Client.CancelAsync();
-            }
-            else
-            {
-                SecondLife.DebugLogStatic("Stopping an already dead event queue");
-            }
-        }
-
-        #region Callback Handlers
-
-        private void Client_OpenWriteCompleted(object sender, OpenWriteCompletedEventArgs e)
-        {
-            bool raiseEvent = false;
-
-            if (!_Dead)
-            {
-                if (!_Running) raiseEvent = true;
-
-                // We are connected to the event queue
-                _Running = true;
-            }
-
-            // Create an EventQueueGet request
-            LLSDMap request = new LLSDMap();
-            request["ack"] = new LLSD();
-            request["done"] = LLSD.FromBoolean(false);
-
-            byte[] postData = LLSDParser.SerializeXmlBytes(request);
-
-            _Client.UploadDataAsync(_Client.Location, postData);
-
-            if (raiseEvent)
-            {
-                SecondLife.DebugLogStatic("Capabilities event queue connected");
-
-                // The event queue is starting up for the first time
-                if (OnConnected != null)
-                {
-                    try { OnConnected(); }
-                    catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        private void Client_UploadDataCompleted(object sender, UploadDataCompletedEventArgs e)
-        {
-            LLSDArray events = null;
-            int ack = 0;
-
-            if (e.Error != null)
-            {
-                // Error occurred
-                string message = e.Error.Message.ToLower();
-
-                // Check what kind of exception happened
-                if (Helpers.StringContains(message, "404") || Helpers.StringContains(message, "410"))
-                {
-                    SecondLife.LogStatic("Closing event queue at " + _Client.Location  + " due to missing caps URI",
-                        Helpers.LogLevel.Info);
-
-                    _Running = false;
-                    _Dead = true;
-                }
-                else if (!e.Cancelled && !Helpers.StringContains(message, "502"))
-                {
-                    SecondLife.LogStatic("Unrecognized caps exception from " + _Client.Location  +
-                        ": " + e.Error.Message, Helpers.LogLevel.Warning);
-                }
-            }
-            else if (!e.Cancelled && e.Result != null)
-            {
-                // Got a response
-                LLSD result = LLSDParser.DeserializeXml(e.Result);
-                if (result != null && result.Type == LLSDType.Map)
-                {
-                    // Parse any events returned by the event queue
-                    LLSDMap map = (LLSDMap)result;
-
-                    events = (LLSDArray)map["events"];
-                    ack = map["id"].AsInteger();
-                }
-            }
-            else if (e.Cancelled)
-            {
-                // Connection was cancelled
-                SecondLife.DebugLogStatic("Cancelled connection to event queue at " + _Client.Location);
-            }
-
-            if (_Running)
-            {
-                LLSDMap request = new LLSDMap();
-                if (ack != 0) request["ack"] = LLSD.FromInteger(ack);
-                else request["ack"] = new LLSD();
-                request["done"] = LLSD.FromBoolean(_Dead);
-
-                byte[] postData = LLSDParser.SerializeXmlBytes(request);
-
-                _Client.UploadDataAsync(_Client.Location, postData);
-
-                // If the event queue is dead at this point, turn it off since
-                // that was the last thing we want to do
-                if (_Dead)
-                {
-                    _Running = false;
-                    SecondLife.DebugLogStatic("Sent event queue shutdown message");
-                }
-            }
-
-            if (OnEvent != null && events != null && events.Count > 0)
-            {
-                // Fire callbacks for each event received
-                foreach (LLSDMap evt in events)
-                {
-                    string msg = evt["message"].AsString();
-                    LLSDMap body = (LLSDMap)evt["body"];
-
-                    try { OnEvent(msg, body); }
-                    catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        #endregion Callback Handlers
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Capabilities/EventQueueListener.cs b/old/libsl1550/libsecondlife/Capabilities/EventQueueListener.cs
deleted file mode 100644
index 59cbb3b..0000000
--- a/old/libsl1550/libsecondlife/Capabilities/EventQueueListener.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Net;
-
-#if !PocketPC
-
-namespace libsecondlife.Capabilities
-{
-    public class EventQueueListener
-    {
-    }
-}
-
-#endif
diff --git a/old/libsl1550/libsecondlife/Caps.cs b/old/libsl1550/libsecondlife/Caps.cs
deleted file mode 100644
index 8266876..0000000
--- a/old/libsl1550/libsecondlife/Caps.cs
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading;
-using libsecondlife.StructuredData;
-using libsecondlife.Capabilities;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Capabilities is the name of the bi-directional HTTP REST protocol that
-    /// Second Life uses to communicate transactions such as teleporting or
-    /// group messaging
-    /// </summary>
-    public class Caps
-    {
-        /// <summary>
-        /// Triggered when an event is received via the EventQueueGet
-        /// capability
-        /// </summary>
-        /// <param name="message">Event name</param>
-        /// <param name="body">Decoded event data</param>
-        /// <param name="simulator">The simulator that generated the event</param>
-        public delegate void EventQueueCallback(string message, StructuredData.LLSD body, Simulator simulator);
-
-        /// <summary>Reference to the simulator this system is connected to</summary>
-        public Simulator Simulator;
-
-        internal string _SeedCapsURI;
-        internal Dictionary<string, Uri> _Caps = new Dictionary<string, Uri>();
-
-        private CapsClient _SeedRequest;
-        private EventQueueClient _EventQueueCap = null;
-
-        /// <summary>Capabilities URI this system was initialized with</summary>
-        public string SeedCapsURI { get { return _SeedCapsURI; } }
-
-        /// <summary>Whether the capabilities event queue is connected and
-        /// listening for incoming events</summary>
-        public bool IsEventQueueRunning
-        {
-            get
-            {
-                if (_EventQueueCap != null)
-                    return _EventQueueCap.Running;
-                else
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client"></param>
-        /// <param name="simulator"></param>
-        /// <param name="seedcaps"></param>
-        internal Caps(Simulator simulator, string seedcaps)
-        {
-            Simulator = simulator;
-            _SeedCapsURI = seedcaps;
-
-            MakeSeedRequest();
-        }
-
-        public void Disconnect(bool immediate)
-        {
-            Simulator.Client.Log(String.Format("Caps system for {0} is {1}", Simulator,
-                (immediate ? "aborting" : "disconnecting")), Helpers.LogLevel.Info);
-
-            if (_SeedRequest != null)
-                _SeedRequest.Cancel();
-
-            if (_EventQueueCap != null)
-                _EventQueueCap.Stop(immediate);
-        }
-
-        /// <summary>
-        /// Request the URI of a named capability
-        /// </summary>
-        /// <param name="capability">Name of the capability to request</param>
-        /// <returns>The URI of the requested capability, or String.Empty if
-        /// the capability does not exist</returns>
-        public Uri CapabilityURI(string capability)
-        {
-            Uri cap;
-
-            if (_Caps.TryGetValue(capability, out cap))
-                return cap;
-            else
-                return null;
-        }
-
-        private void MakeSeedRequest()
-        {
-            if (Simulator == null || !Simulator.Client.Network.Connected)
-                return;
-
-            // Create a request list
-            LLSDArray req = new LLSDArray();
-            req.Add("MapLayer");
-            req.Add("MapLayerGod");
-            req.Add("NewFileAgentInventory");
-            req.Add("EventQueueGet");
-            req.Add("UpdateGestureAgentInventory");
-            req.Add("UpdateNotecardAgentInventory");
-            req.Add("UpdateScriptAgentInventory");
-            req.Add("UpdateGestureTaskInventory");
-            req.Add("UpdateNotecardTaskInventory");
-            req.Add("UpdateScriptTaskInventory");
-            req.Add("SendPostcard");
-            req.Add("ViewerStartAuction");
-            req.Add("ParcelGodReserveForNewbie");
-            req.Add("SendUserReport");
-            req.Add("SendUserReportWithScreenshot");
-            req.Add("RequestTextureDownload");
-            req.Add("UntrustedSimulatorMessage");
-            req.Add("ParcelVoiceInfoRequest");
-            req.Add("ChatSessionRequest");
-            req.Add("ProvisionVoiceAccountRequest");
-
-            _SeedRequest = new CapsClient(new Uri(_SeedCapsURI));
-            _SeedRequest.OnComplete += new CapsClient.CompleteCallback(SeedRequestCompleteHandler);
-            _SeedRequest.StartRequest(req);
-        }
-
-        private void SeedRequestCompleteHandler(CapsClient client, LLSD result, Exception error)
-        {
-            if (result != null && result.Type == LLSDType.Map)
-            {
-                LLSDMap respTable = (LLSDMap)result;
-
-                StringBuilder capsList = new StringBuilder();
-
-                foreach (string cap in respTable.Keys)
-                {
-                    capsList.Append(cap);
-                    capsList.Append(' ');
-
-                    _Caps[cap] = respTable[cap].AsUri();
-                }
-
-                Simulator.Client.DebugLog("Got capabilities: " + capsList.ToString());
-
-                if (_Caps.ContainsKey("EventQueueGet"))
-                {
-                    Simulator.Client.DebugLog("Starting event queue for " + Simulator.ToString());
-
-                    _EventQueueCap = new EventQueueClient(_Caps["EventQueueGet"]);
-                    _EventQueueCap.OnConnected += new EventQueueClient.ConnectedCallback(EventQueueConnectedHandler);
-                    _EventQueueCap.OnEvent += new EventQueueClient.EventCallback(EventQueueEventHandler);
-                    _EventQueueCap.Start();
-                }
-            }
-            else
-            {
-                // The initial CAPS connection failed, try again
-                MakeSeedRequest();
-            }
-        }
-
-        private void EventQueueConnectedHandler()
-        {
-            Simulator.Client.Network.RaiseConnectedEvent(Simulator);
-        }
-
-        private void EventQueueEventHandler(string eventName, LLSDMap body)
-        {
-            if (Simulator.Client.Settings.SYNC_PACKETCALLBACKS)
-                Simulator.Client.Network.CapsEvents.RaiseEvent(eventName, body, Simulator);
-            else
-                Simulator.Client.Network.CapsEvents.BeginRaiseEvent(eventName, body, Simulator);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/CapsToPacket.cs b/old/libsl1550/libsecondlife/CapsToPacket.cs
deleted file mode 100644
index a801fe1..0000000
--- a/old/libsl1550/libsecondlife/CapsToPacket.cs
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife.Packets
-{
-    public abstract partial class Packet
-    {
-        #region Serialization/Deserialization
-
-        public static string ToXmlString(Packet packet)
-        {
-            return LLSDParser.SerializeXmlString(ToLLSD(packet));
-        }
-
-        public static LLSD ToLLSD(Packet packet)
-        {
-            LLSDMap body = new LLSDMap();
-            Type type = packet.GetType();
-
-            foreach (FieldInfo field in type.GetFields())
-            {
-                if (field.IsPublic)
-                {
-                    Type blockType = field.FieldType;
-
-                    if (blockType.IsArray)
-                    {
-                        object blockArray = field.GetValue(packet);
-                        Array array = (Array)blockArray;
-                        LLSDArray blockList = new LLSDArray(array.Length);
-                        IEnumerator ie = array.GetEnumerator();
-
-                        while (ie.MoveNext())
-                        {
-                            object block = ie.Current;
-                            blockList.Add(BuildLLSDBlock(block));
-                        }
-
-                        body[field.Name] = blockList;
-                    }
-                    else
-                    {
-                        object block = field.GetValue(packet);
-                        body[field.Name] = BuildLLSDBlock(block);
-                    }
-                }
-            }
-
-            return body;
-        }
-
-        public static byte[] ToBinary(Packet packet)
-        {
-            throw new NotImplementedException("Need to finish BinaryLLSD first");
-        }
-
-        public static Packet FromXmlString(string xml)
-        {
-            System.Xml.XmlTextReader reader =
-                new System.Xml.XmlTextReader(new System.IO.MemoryStream(Helpers.StringToField(xml)));
-
-            return FromLLSD(LLSDParser.DeserializeXml(reader));
-        }
-
-        public static Packet FromLLSD(LLSD llsd)
-        {
-            // FIXME: Need the inverse of the reflection magic above done here
-            throw new NotImplementedException();
-        }
-
-        #endregion Serialization/Deserialization
-
-        /// <summary>
-        /// Attempts to convert an LLSD structure to a known Packet type
-        /// </summary>
-        /// <param name="capsEventName">Event name, this must match an actual
-        /// packet name for a Packet to be successfully built</param>
-        /// <param name="body">LLSD to convert to a Packet</param>
-        /// <returns>A Packet on success, otherwise null</returns>
-        public static Packet BuildPacket(string capsEventName, LLSDMap body)
-        {
-            Assembly assembly = Assembly.GetExecutingAssembly();
-
-            // Check if we have a subclass of packet with the same name as this event
-            Type type = assembly.GetType("libsecondlife.Packets." + capsEventName + "Packet", false);
-            if (type == null)
-                return null;
-
-            Packet packet = null;
-
-            try
-            {
-                // Create an instance of the object
-                packet = (Packet)Activator.CreateInstance(type);
-
-                // Iterate over all of the fields in the packet class, looking for matches in the LLSD
-                foreach (FieldInfo field in type.GetFields())
-                {
-                    if (body.ContainsKey(field.Name))
-                    {
-                        Type blockType = field.FieldType;
-
-                        if (blockType.IsArray)
-                        {
-                            LLSDArray array = (LLSDArray)body[field.Name];
-                            Type elementType = blockType.GetElementType();
-                            object[] blockArray = (object[])Array.CreateInstance(elementType, array.Count);
-
-                            for (int i = 0; i < array.Count; i++)
-                            {
-                                LLSDMap map = (LLSDMap)array[i];
-                                blockArray[i] = ParseLLSDBlock(map, elementType);
-                            }
-
-                            field.SetValue(packet, blockArray);
-                        }
-                        else
-                        {
-                            LLSDMap map = (LLSDMap)((LLSDArray)body[field.Name])[0];
-                            field.SetValue(packet, ParseLLSDBlock(map, blockType));
-                        }
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                SecondLife.LogStatic(e.ToString(), Helpers.LogLevel.Warning);
-            }
-
-            return packet;
-        }
-
-        private static object ParseLLSDBlock(LLSDMap blockData, Type blockType)
-        {
-            object block = Activator.CreateInstance(blockType);
-
-            // Iterate over each field and set the value if a match was found in the LLSD
-            foreach (FieldInfo field in blockType.GetFields())
-            {
-                if (blockData.ContainsKey(field.Name))
-                {
-                    Type fieldType = field.FieldType;
-
-                    if (fieldType == typeof(ulong))
-                    {
-                        // ulongs come in as a byte array, convert it manually here
-                        byte[] bytes = blockData[field.Name].AsBinary();
-                        ulong value = Helpers.BytesToUInt64(bytes);
-                        field.SetValue(block, value);
-                    }
-                    else if (fieldType == typeof(uint))
-                    {
-                        // uints come in as a byte array, convert it manually here
-                        byte[] bytes = blockData[field.Name].AsBinary();
-                        uint value = Helpers.BytesToUIntBig(bytes);
-                        field.SetValue(block, value);
-                    }
-                    else if (fieldType == typeof(ushort))
-                    {
-                        // Just need a bit of manual typecasting love here
-                        field.SetValue(block, (ushort)blockData[field.Name].AsInteger());
-                    }
-                    else if (fieldType == typeof(byte))
-                    {
-                        // Just need a bit of manual typecasting love here
-                        field.SetValue(block, (byte)blockData[field.Name].AsInteger());
-                    }
-                    else if (fieldType == typeof(short))
-                    {
-                        field.SetValue(block, (short)blockData[field.Name].AsInteger());
-                    }
-                    else if (fieldType == typeof(LLUUID))
-                    {
-                        field.SetValue(block, blockData[field.Name].AsUUID());
-                    }
-                    else if (fieldType == typeof(LLVector3))
-                    {
-                        field.SetValue(block, LLVector3.FromLLSD(blockData[field.Name]));
-                    }
-                    else if (fieldType == typeof(LLVector4))
-                    {
-                        field.SetValue(block, LLVector4.FromLLSD(blockData[field.Name]));
-                    }
-                    else if (fieldType == typeof(LLQuaternion))
-                    {
-                        field.SetValue(block, LLQuaternion.FromLLSD(blockData[field.Name]));
-                    }
-                    else if (fieldType == typeof(string))
-                    {
-                        field.SetValue(block, blockData[field.Name].AsString());
-                    }
-                    else if (fieldType == typeof(bool))
-                    {
-                        field.SetValue(block, blockData[field.Name].AsBoolean());
-                    }
-                    else if (fieldType == typeof(float))
-                    {
-                        field.SetValue(block, (float)blockData[field.Name].AsReal());
-                    }
-                    else if (fieldType == typeof(double))
-                    {
-                        field.SetValue(block, blockData[field.Name].AsReal());
-                    }
-                    else if (fieldType == typeof(int))
-                    {
-                        field.SetValue(block, blockData[field.Name].AsInteger());
-                    }
-                }
-            }
-
-            // String fields are properties, pick those up as well
-            foreach (PropertyInfo property in blockType.GetProperties())
-            {
-                if (blockData.ContainsKey(property.Name))
-                {
-                    MethodInfo set = property.GetSetMethod();
-                    set.Invoke(block, new object[] { Helpers.StringToField(blockData[property.Name].AsString()) });
-                }
-            }
-
-            return block;
-        }
-
-        private static LLSD BuildLLSDBlock(object block)
-        {
-            LLSDMap map = new LLSDMap();
-            Type blockType = block.GetType();
-
-            foreach (FieldInfo field in blockType.GetFields())
-            {
-                if (field.IsPublic)
-                    map[field.Name] = LLSD.FromObject(field.GetValue(block));
-            }
-
-            foreach (PropertyInfo property in blockType.GetProperties())
-            {
-                if (property.Name != "Length")
-                {
-                    map[property.Name] = LLSD.FromObject(property.GetValue(block, null));
-                }
-            }
-
-            return map;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/CoordinateFrame.cs b/old/libsl1550/libsecondlife/CoordinateFrame.cs
deleted file mode 100644
index 188bdc6..0000000
--- a/old/libsl1550/libsecondlife/CoordinateFrame.cs
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-namespace libsecondlife
-{
-    public class CoordinateFrame
-    {
-        public static readonly LLVector3 X_AXIS = new LLVector3(1f, 0f, 0f);
-        public static readonly LLVector3 Y_AXIS = new LLVector3(0f, 1f, 0f);
-        public static readonly LLVector3 Z_AXIS = new LLVector3(0f, 0f, 1f);
-
-        /// <summary>Origin position of this coordinate frame</summary>
-        public LLVector3 Origin
-        {
-            get { return origin; }
-            set
-            {
-                if (!value.IsFinite())
-                    throw new ArgumentException("Non-finite in CoordinateFrame.Origin assignment");
-                origin = value;
-            }
-        }
-        /// <summary>X axis of this coordinate frame, or Forward/At in Second Life terms</summary>
-        public LLVector3 XAxis
-        {
-            get { return xAxis; }
-            set
-            {
-                if (!value.IsFinite())
-                    throw new ArgumentException("Non-finite in CoordinateFrame.XAxis assignment");
-                xAxis = value;
-            }
-        }
-        /// <summary>Y axis of this coordinate frame, or Left in Second Life terms</summary>
-        public LLVector3 YAxis
-        {
-            get { return yAxis; }
-            set
-            {
-                if (!value.IsFinite())
-                    throw new ArgumentException("Non-finite in CoordinateFrame.YAxis assignment");
-                yAxis = value;
-            }
-        }
-        /// <summary>Z axis of this coordinate frame, or Up in Second Life terms</summary>
-        public LLVector3 ZAxis
-        {
-            get { return zAxis; }
-            set
-            {
-                if (!value.IsFinite())
-                    throw new ArgumentException("Non-finite in CoordinateFrame.ZAxis assignment");
-                zAxis = value;
-            }
-        }
-
-        protected LLVector3 origin;
-        protected LLVector3 xAxis;
-        protected LLVector3 yAxis;
-        protected LLVector3 zAxis;
-
-        #region Constructors
-
-        public CoordinateFrame(LLVector3 origin)
-        {
-            this.origin = origin;
-            xAxis = X_AXIS;
-            yAxis = Y_AXIS;
-            zAxis = Z_AXIS;
-
-            if (!this.origin.IsFinite())
-                throw new ArgumentException("Non-finite in CoordinateFrame constructor");
-        }
-
-        public CoordinateFrame(LLVector3 origin, LLVector3 direction)
-        {
-            this.origin = origin;
-            LookDirection(direction);
-
-            if (!IsFinite())
-                throw new ArgumentException("Non-finite in CoordinateFrame constructor");
-        }
-
-        public CoordinateFrame(LLVector3 origin, LLVector3 xAxis, LLVector3 yAxis, LLVector3 zAxis)
-        {
-            this.origin = origin;
-            this.xAxis = xAxis;
-            this.yAxis = yAxis;
-            this.zAxis = zAxis;
-
-            if (!IsFinite())
-                throw new ArgumentException("Non-finite in CoordinateFrame constructor");
-        }
-
-        public CoordinateFrame(LLVector3 origin, LLMatrix3 rotation)
-        {
-            this.origin = origin;
-            xAxis = rotation[0];
-            yAxis = rotation[1];
-            zAxis = rotation[2];
-
-            if (!IsFinite())
-                throw new ArgumentException("Non-finite in CoordinateFrame constructor");
-        }
-
-        public CoordinateFrame(LLVector3 origin, LLQuaternion rotation)
-        {
-            LLMatrix3 m = new LLMatrix3(rotation);
-
-            this.origin = origin;
-            xAxis = m[0];
-            yAxis = m[1];
-            zAxis = m[2];
-
-            if (!IsFinite())
-                throw new ArgumentException("Non-finite in CoordinateFrame constructor");
-        }
-
-        #endregion Constructors
-
-        #region Public Methods
-
-        public void ResetAxes()
-        {
-            xAxis = X_AXIS;
-            yAxis = Y_AXIS;
-            zAxis = Z_AXIS;
-        }
-
-        public void Rotate(float angle, LLVector3 rotationAxis)
-        {
-            LLQuaternion q = new LLQuaternion(angle, rotationAxis);
-            Rotate(q);
-        }
-
-        public void Rotate(LLQuaternion q)
-        {
-            LLMatrix3 m = new LLMatrix3(q);
-            Rotate(m);
-        }
-
-        public void Rotate(LLMatrix3 m)
-        {
-            xAxis = LLVector3.Rot(xAxis, m);
-            yAxis = LLVector3.Rot(yAxis, m);
-
-            Orthonormalize();
-
-            if (!IsFinite())
-                throw new Exception("Non-finite in CoordinateFrame.Rotate()");
-        }
-
-        public void Roll(float angle)
-        {
-            LLQuaternion q = new LLQuaternion(angle, xAxis);
-            LLMatrix3 m = new LLMatrix3(q);
-            Rotate(m);
-
-            if (!yAxis.IsFinite() || !zAxis.IsFinite())
-                throw new Exception("Non-finite in CoordinateFrame.Roll()");
-        }
-
-        public void Pitch(float angle)
-        {
-            LLQuaternion q = new LLQuaternion(angle, yAxis);
-            LLMatrix3 m = new LLMatrix3(q);
-            Rotate(m);
-
-            if (!xAxis.IsFinite() || !zAxis.IsFinite())
-                throw new Exception("Non-finite in CoordinateFrame.Pitch()");
-        }
-
-        public void Yaw(float angle)
-        {
-            LLQuaternion q = new LLQuaternion(angle, zAxis);
-            LLMatrix3 m = new LLMatrix3(q);
-            Rotate(m);
-
-            if (!xAxis.IsFinite() || !yAxis.IsFinite())
-                throw new Exception("Non-finite in CoordinateFrame.Yaw()");
-        }
-
-        public void LookDirection(LLVector3 at)
-        {
-            LookDirection(at, Z_AXIS);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="at">Looking direction, must be a normalized vector</param>
-        /// <param name="upDirection">Up direction, must be a normalized vector</param>
-        public void LookDirection(LLVector3 at, LLVector3 upDirection)
-        {
-            // The two parameters cannot be parallel
-            LLVector3 left = LLVector3.Cross(upDirection, at);
-            if (left == LLVector3.Zero)
-            {
-                // Prevent left from being zero
-                at.X += 0.01f;
-                at = LLVector3.Norm(at);
-                left = LLVector3.Cross(upDirection, at);
-            }
-            left = LLVector3.Norm(left);
-
-            xAxis = at;
-            yAxis = left;
-            zAxis = LLVector3.Cross(at, left);
-        }
-
-        /// <summary>
-        /// Align the coordinate frame X and Y axis with a given rotation
-        /// around the Z axis in radians
-        /// </summary>
-        /// <param name="heading">Absolute rotation around the Z axis in
-        /// radians</param>
-        public void LookDirection(double heading)
-        {
-            yAxis.X = (float)Math.Cos(heading);
-            yAxis.Y = (float)Math.Sin(heading);
-            xAxis.X = (float)-Math.Sin(heading);
-            xAxis.Y = (float)Math.Cos(heading);
-        }
-
-        public void LookAt(LLVector3 origin, LLVector3 target)
-        {
-            LookAt(origin, target, new LLVector3(0f, 0f, 1f));
-        }
-
-        public void LookAt(LLVector3 origin, LLVector3 target, LLVector3 upDirection)
-        {
-            this.origin = origin;
-            LLVector3 at = new LLVector3(target - origin);
-            at = LLVector3.Norm(at);
-
-            LookDirection(at, upDirection);
-        }
-
-        #endregion Public Methods
-
-        protected bool IsFinite()
-        {
-            if (xAxis.IsFinite() && yAxis.IsFinite() && zAxis.IsFinite())
-                return true;
-            else
-                return false;
-        }
-
-        protected void Orthonormalize()
-        {
-            // Make sure the axis are orthagonal and normalized
-            xAxis = LLVector3.Norm(xAxis);
-            yAxis -= xAxis * (xAxis * yAxis);
-            yAxis = LLVector3.Norm(yAxis);
-            zAxis = LLVector3.Cross(xAxis, yAxis);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/DirectoryManager.cs b/old/libsl1550/libsecondlife/DirectoryManager.cs
deleted file mode 100644
index b561885..0000000
--- a/old/libsl1550/libsecondlife/DirectoryManager.cs
+++ /dev/null
@@ -1,664 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    ///
-    /// </summary>
-    public class DirectoryManager
-    {
-        /// <summary>
-        /// The different categories a classified ad can be placed in
-        /// </summary>
-        public enum ClassifiedCategories
-        {
-            /// <summary></summary>
-            Any = 0,
-            /// <summary></summary>
-            Shopping,
-            /// <summary></summary>
-            LandRental,
-            /// <summary></summary>
-            PropertyRental,
-            /// <summary></summary>
-            SpecialAttraction,
-            /// <summary></summary>
-            NewProducts,
-            /// <summary></summary>
-            Employment,
-            /// <summary></summary>
-            Wanted,
-            /// <summary></summary>
-            Service,
-            /// <summary></summary>
-            Personal
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        [Flags]
-        public enum DirFindFlags
-        {
-            /// <summary></summary>
-            People = 1 << 0,
-            /// <summary></summary>
-            Online = 1 << 1,
-            /// <summary></summary>
-            [Obsolete]
-            Places = 1 << 2,
-            /// <summary></summary>
-            Events = 1 << 3,
-            /// <summary></summary>
-            Groups = 1 << 4,
-            /// <summary></summary>
-            DateEvents = 1 << 5,
-            /// <summary></summary>
-            AgentOwned = 1 << 6,
-            /// <summary></summary>
-            ForSale = 1 << 7,
-            /// <summary></summary>
-            GroupOwned = 1 << 8,
-            /// <summary></summary>
-            [Obsolete]
-            Auction = 1 << 9,
-            /// <summary></summary>
-            DwellSort = 1 << 10,
-            /// <summary></summary>
-            PgSimsOnly = 1 << 11,
-            /// <summary></summary>
-            PicturesOnly = 1 << 12,
-            /// <summary></summary>
-            PgEventsOnly = 1 << 13,
-            /// <summary></summary>
-            MatureSimsOnly = 1 << 14,
-            /// <summary></summary>
-            SortAsc = 1 << 15,
-            /// <summary></summary>
-            PricesSort = 1 << 16,
-            /// <summary></summary>
-            PerMeterSort = 1 << 17,
-            /// <summary></summary>
-            AreaSort = 1 << 18,
-            /// <summary></summary>
-            NameSort = 1 << 19,
-            /// <summary></summary>
-            LimitByPrice = 1 << 20,
-            /// <summary></summary>
-            LimitByArea = 1 << 21
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        [Flags]
-        public enum SearchTypeFlags
-        {
-            /// <summary></summary>
-            None = 0,
-            /// <summary></summary>
-            Auction = 1 << 1,
-            /// <summary></summary>
-            Newbie = 1 << 2,
-            /// <summary></summary>
-            Mainland = 1 << 3,
-            /// <summary></summary>
-            Estate = 1 << 4
-        }
-
-        /// <summary>
-        /// A classified ad in Second Life
-        /// </summary>
-        public struct Classified
-        {
-            /// <summary>UUID for this ad, useful for looking up detailed
-            /// information about it</summary>
-            public LLUUID ID;
-            /// <summary>The title of this classified ad</summary>
-            public string Name;
-            /// <summary>Unknown</summary>
-            public byte Flags;
-            /// <summary>Creation date of the ad</summary>
-            public DateTime CreationDate;
-            /// <summary>Expiration date of the ad</summary>
-            public DateTime ExpirationDate;
-            /// <summary>Price that was paid for this ad</summary>
-            public int Price;
-        }
-
-        /// <summary>
-        /// A parcel retrieved from the dataserver such as results from the
-        /// "For-Sale" listings
-        /// </summary>
-        public struct DirectoryParcel
-        {
-            /// <summary></summary>
-            public LLUUID ID;
-            /// <summary></summary>
-            public string Name;
-            /// <summary></summary>
-            public int ActualArea;
-            /// <summary></summary>
-            public int SalePrice;
-            /// <summary></summary>
-            public bool Auction;
-            /// <summary></summary>
-            public bool ForSale;
-        }
-
-        public struct AgentSearchData
-        {
-            public bool Online;
-            public string FirstName;
-            public string LastName;
-            public LLUUID AgentID;
-        }
-        /// <summary>
-        ///  Response to a "Groups" Search
-        /// </summary>
-        public struct GroupSearchData
-        {
-            public LLUUID GroupID;
-            public string GroupName;
-            public int Members;
-        }
-
-        /// <summary>
-        /// Response to a "Places" Search
-        /// Note: This is not DirPlacesReply
-        /// </summary>
-        public struct PlacesSearchData
-        {
-            public LLUUID OwnerID;
-            public string Name;
-            public string Desc;
-            public int ActualArea;
-            public int BillableArea;
-            public byte Flags;
-            public float GlobalX;
-            public float GlobalY;
-            public float GlobalZ;
-            public string SimName;
-            public LLUUID SnapshotID;
-            public float Dwell;
-            public int Price;
-        }
-
-        /*/// <summary></summary>
-        public LLUUID OwnerID;
-        /// <summary></summary>
-        public LLUUID SnapshotID;
-        /// <summary></summary>
-        public ulong RegionHandle;
-        /// <summary></summary>
-        public string SimName;
-        /// <summary></summary>
-        public string Desc;
-        /// <summary></summary>
-        public LLVector3 GlobalPosition;
-        /// <summary></summary>
-        public LLVector3 SimPosition;
-        /// <summary></summary>
-        public float Dwell;*/
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="classifieds"></param>
-        public delegate void ClassifiedReplyCallback(List<Classified> classifieds);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="dirParcels"></param>
-        public delegate void DirLandReplyCallback(List<DirectoryParcel> dirParcels);
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="matchedPeople"></param>
-        public delegate void DirPeopleReplyCallback(LLUUID queryID, List<AgentSearchData> matchedPeople);
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="queryID"></param>
-        /// <param name="matchedGroups"></param>
-        public delegate void DirGroupsReplyCallback(LLUUID queryID, List<GroupSearchData> matchedGroups);
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="queryID"></param>
-        /// <param name="matchedPlaces"></param>
-        public delegate void PlacesReplyCallback(LLUUID queryID, List<PlacesSearchData> matchedPlaces);
-
-        /// <summary>
-        ///
-        /// </summary>
-        public event ClassifiedReplyCallback OnClassifiedReply;
-        /// <summary>
-        ///
-        /// </summary>
-        public event DirLandReplyCallback OnDirLandReply;
-
-        public event DirPeopleReplyCallback OnDirPeopleReply;
-
-        public event DirGroupsReplyCallback OnDirGroupsReply;
-
-        public event PlacesReplyCallback OnPlacesReply;
-
-        private SecondLife Client;
-
-
-        public DirectoryManager(SecondLife client)
-        {
-            Client = client;
-
-            Client.Network.RegisterCallback(PacketType.DirClassifiedReply, new NetworkManager.PacketCallback(DirClassifiedReplyHandler));
-            Client.Network.RegisterCallback(PacketType.DirLandReply, new NetworkManager.PacketCallback(DirLandReplyHandler));
-            Client.Network.RegisterCallback(PacketType.DirPeopleReply, new NetworkManager.PacketCallback(DirPeopleReplyHandler));
-            Client.Network.RegisterCallback(PacketType.DirGroupsReply, new NetworkManager.PacketCallback(DirGroupsReplyHandler));
-            Client.Network.RegisterCallback(PacketType.PlacesReply, new NetworkManager.PacketCallback(PlacesReplyHandler));
-
-        }
-
-        public LLUUID StartClassifiedSearch(string searchText, ClassifiedCategories categories, bool mature)
-        {
-            DirClassifiedQueryPacket query = new DirClassifiedQueryPacket();
-            LLUUID queryID = LLUUID.Random();
-
-            query.AgentData.AgentID = Client.Self.AgentID;
-            query.AgentData.SessionID = Client.Self.SessionID;
-            query.QueryData.Category = (uint)categories;
-            query.QueryData.QueryFlags = (uint)(mature ? 0 : 2);
-            query.QueryData.QueryID = queryID;
-            query.QueryData.QueryText = Helpers.StringToField(searchText);
-
-            Client.Network.SendPacket(query);
-
-            return queryID;
-        }
-
-        /// <summary>
-        /// Starts a search for land sales using the directory
-        /// </summary>
-        /// <param name="typeFlags">What type of land to search for. Auction,
-        /// estate, mainland, "first land", etc</param>
-        /// <returns>A unique identifier that can identify packets associated
-        /// with this query from other queries</returns>
-        /// <remarks>The OnDirLandReply event handler must be registered before
-        /// calling this function. There is no way to determine how many
-        /// results will be returned, or how many times the callback will be
-        /// fired other than you won't get more than 100 total parcels from
-        /// each query.</remarks>
-        public LLUUID StartLandSearch(SearchTypeFlags typeFlags)
-        {
-            return StartLandSearch(DirFindFlags.SortAsc | DirFindFlags.PerMeterSort, typeFlags, 0, 0, 0);
-        }
-
-        /// <summary>
-        /// Starts a search for land sales using the directory
-        /// </summary>
-        /// <param name="typeFlags">What type of land to search for. Auction,
-        /// estate, mainland, "first land", etc</param>
-        /// <param name="priceLimit">Maximum price to search for</param>
-        /// <param name="areaLimit">Maximum area to search for</param>
-        /// <param name="queryStart">Each request is limited to 100 parcels
-        /// being returned. To get the first 100 parcels of a request use 0,
-        /// from 100-199 use 1, 200-299 use 2, etc.</param>
-        /// <returns>A unique identifier that can identify packets associated
-        /// with this query from other queries</returns>
-        /// <remarks>The OnDirLandReply event handler must be registered before
-        /// calling this function. There is no way to determine how many
-        /// results will be returned, or how many times the callback will be
-        /// fired other than you won't get more than 100 total parcels from
-        /// each query.</remarks>
-        public LLUUID StartLandSearch(SearchTypeFlags typeFlags, int priceLimit, int areaLimit, int queryStart)
-        {
-            return StartLandSearch(DirFindFlags.SortAsc | DirFindFlags.PerMeterSort | DirFindFlags.LimitByPrice |
-                DirFindFlags.LimitByArea, typeFlags, priceLimit, areaLimit, queryStart);
-        }
-
-        /// <summary>
-        /// Starts a search for land sales using the directory
-        /// </summary>
-        /// <param name="findFlags">A flags parameter that can modify the way
-        /// search results are returned, for example changing the ordering of
-        /// results or limiting based on price or area</param>
-        /// <param name="typeFlags">What type of land to search for. Auction,
-        /// estate, mainland, "first land", etc</param>
-        /// <param name="priceLimit">Maximum price to search for, the
-        /// DirFindFlags.LimitByPrice flag must be set</param>
-        /// <param name="areaLimit">Maximum area to search for, the
-        /// DirFindFlags.LimitByArea flag must be set</param>
-        /// <param name="queryStart">Each request is limited to 100 parcels
-        /// being returned. To get the first 100 parcels of a request use 0,
-        /// from 100-199 use 100, 200-299 use 200, etc.</param>
-        /// <returns>A unique identifier that can identify packets associated
-        /// with this query from other queries</returns>
-        /// <remarks>The OnDirLandReply event handler must be registered before
-        /// calling this function. There is no way to determine how many
-        /// results will be returned, or how many times the callback will be
-        /// fired other than you won't get more than 100 total parcels from
-        /// each query.</remarks>
-        public LLUUID StartLandSearch(DirFindFlags findFlags, SearchTypeFlags typeFlags, int priceLimit,
-            int areaLimit, int queryStart)
-        {
-            LLUUID queryID = LLUUID.Random();
-
-            DirLandQueryPacket query = new DirLandQueryPacket();
-            query.AgentData.AgentID = Client.Self.AgentID;
-            query.AgentData.SessionID = Client.Self.SessionID;
-            query.QueryData.Area = areaLimit;
-            query.QueryData.Price = priceLimit;
-            query.QueryData.QueryStart = queryStart;
-            query.QueryData.SearchType = (uint)typeFlags;
-            query.QueryData.QueryFlags = (uint)findFlags;
-            query.QueryData.QueryID = queryID;
-
-            Client.Network.SendPacket(query);
-
-            return queryID;
-        }
-        /// <summary>
-        /// Starts a search for a Group in the directory manager
-        /// </summary>
-        /// <param name="findFlags"></param>
-        /// <param name="searchText">The text to search for</param>
-        /// <param name="queryStart">Each request is limited to 100 parcels
-        /// being returned. To get the first 100 parcels of a request use 0,
-        /// from 100-199 use 100, 200-299 use 200, etc.</param>
-        /// <returns>A unique identifier that can identify packets associated
-        /// with this query from other queries</returns>
-        /// <remarks>The OnDirLandReply event handler must be registered before
-        /// calling this function. There is no way to determine how many
-        /// results will be returned, or how many times the callback will be
-        /// fired other than you won't get more than 100 total parcels from
-        /// each query.</remarks>
-        public LLUUID StartGroupSearch(DirFindFlags findFlags, string searchText, int queryStart)
-        {
-            return StartGroupSearch(findFlags, searchText, queryStart, LLUUID.Random());
-        }
-
-        public LLUUID StartGroupSearch(DirFindFlags findFlags, string searchText, int queryStart, LLUUID queryID)
-        {
-            DirFindQueryPacket find = new DirFindQueryPacket();
-            find.AgentData.AgentID = Client.Self.AgentID;
-            find.AgentData.SessionID = Client.Self.SessionID;
-            find.QueryData.QueryFlags = (uint)findFlags;
-            find.QueryData.QueryText = Helpers.StringToField(searchText);
-            find.QueryData.QueryID = queryID;
-            find.QueryData.QueryStart = queryStart;
-            Client.Network.SendPacket(find);
-            return queryID;
-        }
-
-        public LLUUID StartPeopleSearch(DirFindFlags findFlags, string searchText, int queryStart)
-        {
-            return StartPeopleSearch(findFlags, searchText, queryStart, LLUUID.Random());
-        }
-
-        public LLUUID StartPeopleSearch(DirFindFlags findFlags, string searchText, int queryStart, LLUUID queryID)
-        {
-            DirFindQueryPacket find = new DirFindQueryPacket();
-            find.AgentData.AgentID = Client.Self.AgentID;
-            find.AgentData.SessionID = Client.Self.SessionID;
-            find.QueryData.QueryFlags = (uint)findFlags;
-            find.QueryData.QueryText = Helpers.StringToField(searchText);
-            find.QueryData.QueryID = queryID;
-            find.QueryData.QueryStart = queryStart;
-
-            Client.Network.SendPacket(find);
-
-            return queryID;
-        }
-
-        /// <summary>
-        /// Search "places" for Land you personally own
-        /// </summary>
-        public LLUUID StartPlacesSearch()
-        {
-            return StartPlacesSearch(DirFindFlags.AgentOwned, Parcel.ParcelCategory.Any, String.Empty, String.Empty,
-                LLUUID.Zero, LLUUID.Zero);
-        }
-
-        /// <summary>
-        /// Searches Places for Land owned by a specific user or group
-        /// </summary>
-        /// <param name="findFlags">One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc.</param>
-        /// <param name="groupID">LLUID of group you want to recieve land list for (You must be in group), or
-        /// LLUID.Zero for Your own land</param>
-        /// <returns>Transaction (Query) ID which can be associated with results from your request.</returns>
-        public LLUUID StartPlacesSearch(DirFindFlags findFlags, LLUUID groupID)
-        {
-            return StartPlacesSearch(findFlags, Parcel.ParcelCategory.Any, String.Empty, String.Empty, groupID,
-                LLUUID.Random());
-        }
-
-        /// <summary>
-        ///  Search Places
-        /// </summary>
-        /// <param name="findFlags">One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc.</param>
-        /// <param name="searchCategory">One of the values from the SearchCategory Struct, ie: Any, Linden, Newcomer</param>
-        /// <param name="groupID">LLUID of group you want to recieve results for</param>
-        /// <param name="transactionID">Transaction (Query) ID which can be associated with results from your request.</param>
-        /// <returns>Transaction (Query) ID which can be associated with results from your request.</returns>
-        public LLUUID StartPlacesSearch(DirFindFlags findFlags, Parcel.ParcelCategory searchCategory, LLUUID groupID, LLUUID transactionID)
-        {
-            return StartPlacesSearch(findFlags, searchCategory, String.Empty, String.Empty, groupID, transactionID);
-        }
-
-        /// <summary>
-        /// Search Places - All Options
-        /// </summary>
-        /// <param name="findFlags">One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc.</param>
-        /// <param name="searchCategory">One of the values from the SearchCategory Struct, ie: Any, Linden, Newcomer</param>
-        /// <param name="searchText">String Text to search for</param>
-        /// <param name="simulatorName">String Simulator Name to search in</param>
-        /// <param name="groupID">LLUID of group you want to recieve results for</param>
-        /// <param name="transactionID">Transaction (Query) ID which can be associated with results from your request.</param>
-        /// <returns>Transaction (Query) ID which can be associated with results from your request.</returns>
-        public LLUUID StartPlacesSearch(DirFindFlags findFlags, Parcel.ParcelCategory searchCategory, string searchText, string simulatorName, LLUUID groupID, LLUUID transactionID)
-        {
-            PlacesQueryPacket find = new PlacesQueryPacket();
-            find.AgentData.AgentID = Client.Self.AgentID;
-            find.AgentData.SessionID = Client.Self.SessionID;
-            find.AgentData.QueryID = groupID;
-
-            find.TransactionData.TransactionID = transactionID;
-
-            find.QueryData.QueryText = Helpers.StringToField(searchText);
-            find.QueryData.QueryFlags = (uint)findFlags;
-            find.QueryData.Category = (sbyte)searchCategory;
-            find.QueryData.SimName = Helpers.StringToField(simulatorName);
-
-            Client.Network.SendPacket(find);
-            return transactionID;
-        }
-
-        #region Blocking Functions
-
-        public bool PeopleSearch(DirFindFlags findFlags, string searchText, int queryStart,
-            int timeoutMS, out List<AgentSearchData> results)
-        {
-            AutoResetEvent searchEvent = new AutoResetEvent(false);
-            LLUUID id = LLUUID.Random();
-            List<AgentSearchData> people = null;
-
-            DirPeopleReplyCallback callback =
-                delegate(LLUUID queryid, List<AgentSearchData> matches)
-                {
-                    if (id == queryid)
-                    {
-                        people = matches;
-                        searchEvent.Set();
-                    }
-                };
-
-            OnDirPeopleReply += callback;
-            StartPeopleSearch(findFlags, searchText, queryStart, id);
-            searchEvent.WaitOne(timeoutMS, false);
-            OnDirPeopleReply -= callback;
-
-            results = people;
-            return (results != null);
-        }
-
-        #endregion Blocking Functions
-
-        #region Packet Handlers
-
-        private void DirClassifiedReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnClassifiedReply != null)
-            {
-                DirClassifiedReplyPacket reply = (DirClassifiedReplyPacket)packet;
-                List<Classified> classifieds = new List<Classified>();
-
-                foreach (DirClassifiedReplyPacket.QueryRepliesBlock block in reply.QueryReplies)
-                {
-                    Classified classified = new Classified();
-
-                    classified.CreationDate = Helpers.UnixTimeToDateTime(block.CreationDate);
-                    classified.ExpirationDate = Helpers.UnixTimeToDateTime(block.ExpirationDate);
-                    classified.Flags = block.ClassifiedFlags;
-                    classified.ID = block.ClassifiedID;
-                    classified.Name = Helpers.FieldToUTF8String(block.Name);
-                    classified.Price = block.PriceForListing;
-
-                    classifieds.Add(classified);
-                }
-
-                try { OnClassifiedReply(classifieds); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void DirLandReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnDirLandReply != null)
-            {
-                List<DirectoryParcel> parcelsForSale = new List<DirectoryParcel>();
-                DirLandReplyPacket reply = (DirLandReplyPacket)packet;
-
-                foreach (DirLandReplyPacket.QueryRepliesBlock block in reply.QueryReplies)
-                {
-                    DirectoryParcel dirParcel = new DirectoryParcel();
-
-                    dirParcel.ActualArea = block.ActualArea;
-                    dirParcel.ID = block.ParcelID;
-                    dirParcel.Name = Helpers.FieldToUTF8String(block.Name);
-                    dirParcel.SalePrice = block.SalePrice;
-                    dirParcel.Auction = block.Auction;
-                    dirParcel.ForSale = block.ForSale;
-
-                    parcelsForSale.Add(dirParcel);
-                }
-
-                try { OnDirLandReply(parcelsForSale); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void DirPeopleReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnDirPeopleReply != null)
-            {
-                DirPeopleReplyPacket peopleReply = packet as DirPeopleReplyPacket;
-                List<AgentSearchData> matches = new List<AgentSearchData>(peopleReply.QueryReplies.Length);
-                foreach (DirPeopleReplyPacket.QueryRepliesBlock reply in peopleReply.QueryReplies) {
-                    AgentSearchData searchData = new AgentSearchData();
-                    searchData.Online = reply.Online;
-                    searchData.FirstName = Helpers.FieldToUTF8String(reply.FirstName);
-                    searchData.LastName = Helpers.FieldToUTF8String(reply.LastName);
-                    searchData.AgentID = reply.AgentID;
-                    matches.Add(searchData);
-                }
-                try { OnDirPeopleReply(peopleReply.QueryData.QueryID, matches); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void DirGroupsReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnDirGroupsReply != null)
-            {
-                DirGroupsReplyPacket groupsReply = packet as DirGroupsReplyPacket;
-                List<GroupSearchData> matches = new List<GroupSearchData>(groupsReply.QueryReplies.Length);
-                foreach (DirGroupsReplyPacket.QueryRepliesBlock reply in groupsReply.QueryReplies)
-                {
-                    GroupSearchData groupsData = new GroupSearchData();
-                    groupsData.GroupID = reply.GroupID;
-                    groupsData.GroupName = Helpers.FieldToUTF8String(reply.GroupName);
-                    groupsData.Members = reply.Members;
-                    matches.Add(groupsData);
-                }
-                try { OnDirGroupsReply(groupsReply.QueryData.QueryID, matches); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void PlacesReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnPlacesReply != null)
-            {
-                PlacesReplyPacket placesReply = packet as PlacesReplyPacket;
-                List<PlacesSearchData> places = new List<PlacesSearchData>();
-
-                foreach (PlacesReplyPacket.QueryDataBlock block in placesReply.QueryData)
-                {
-                    PlacesSearchData place = new PlacesSearchData();
-                    place.OwnerID = block.OwnerID;
-                    place.Name = Helpers.FieldToUTF8String(block.Name);
-                    place.Desc = Helpers.FieldToUTF8String(block.Desc);
-                    place.ActualArea = block.ActualArea;
-                    place.BillableArea = block.BillableArea;
-                    place.Flags = block.Flags;
-                    place.GlobalX = block.GlobalX;
-                    place.GlobalY = block.GlobalY;
-                    place.GlobalZ = block.GlobalZ;
-                    place.SimName = Helpers.FieldToUTF8String(block.SimName);
-                    place.SnapshotID = block.SnapshotID;
-                    place.Dwell = block.Dwell;
-                    place.Price = block.Price;
-
-                    places.Add(place);
-                }
-                try { OnPlacesReply(placesReply.TransactionData.TransactionID, places); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        #endregion Packet Handlers
-    }
-}
diff --git a/old/libsl1550/libsecondlife/EstateTools.cs b/old/libsl1550/libsecondlife/EstateTools.cs
deleted file mode 100644
index d77896c..0000000
--- a/old/libsl1550/libsecondlife/EstateTools.cs
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-using System;
-using libsecondlife.Packets;
-using System.Collections.Generic;
-
-namespace libsecondlife
-{
-	/// <summary>
-	/// Estate level administration and utilities
-	/// </summary>
-	public class EstateTools
-	{
-		private SecondLife Client;
-        public GroundTextureSettings GroundTextures;
-
-        /// <summary>
-        /// Triggered on incoming LandStatReply
-        /// </summary>
-        /// <param name="reportType"></param>
-        /// <param name="requestFlags"></param>
-        /// <param name="objectCount"></param>
-        /// <param name="task"></param>
-        //public delegate void LandStatReply(LandStatReportType reportType, uint requestFlags, int objectCount, List<EstateTask> Tasks);
-        /// <summary>
-        /// Triggered on incoming LandStatReply when the report type is for "top colliders"
-        /// </summary>
-        /// <param name="objectCount"></param>
-        /// <param name="Tasks"></param>
-        public delegate void GetTopCollidersReply(int objectCount, List<EstateTask> Tasks);
-        /// <summary>
-        /// Triggered on incoming LandStatReply when the report type is for "top scripts"
-        /// </summary>
-        /// <param name="objectCount"></param>
-        /// <param name="Tasks"></param>
-        public delegate void GetTopScriptsReply(int objectCount, List<EstateTask> Tasks);
-
-        /// <summary>Callback for incoming LandStatReply packets</summary>
-        //public event LandStatReply OnLandStatReply;
-        /// <summary>Triggered upon a successful .GetTopColliders()</summary>
-        public event GetTopCollidersReply OnGetTopColliders;
-        /// <summary>Triggered upon a successful .GetTopScripts()</summary>
-        public event GetTopScriptsReply OnGetTopScripts;
-
-        /// <summary>
-        /// Constructor for EstateTools class
-        /// </summary>
-        /// <param name="client"></param>
-		public EstateTools(SecondLife client)
-		{
-			Client = client;
-            Client.Network.RegisterCallback(PacketType.LandStatReply, new NetworkManager.PacketCallback(LandStatReplyHandler));
-            //Client.Network.RegisterCallback(PacketType.EstateOwnerMessage, new NetworkManager.PacketCallback(EstateOwnerMessageHandler));
-		}
-
-        /// <summary>Describes tasks returned in LandStatReply</summary>
-        public class EstateTask
-        {
-            public LLVector3 Position;
-            public float Score;
-            public LLUUID TaskID;
-            public uint TaskLocalID;
-            public string TaskName;
-            public string OwnerName;
-        }
-
-        /// <summary>Used in the ReportType field of a LandStatRequest</summary>
-        public enum LandStatReportType
-        {
-            TopScripts = 0,
-            TopColliders = 1
-        }
-
-        /// <summary>Used by EstateOwnerMessage packets</summary>
-        public enum EstateAccessDelta
-        {
-            BanUser = 64,
-            UnbanUser = 128
-        }
-
-        /// <summary>Used by GroundTextureSettings</summary>
-        public class GroundTextureRegion
-        {
-            public LLUUID TextureID;
-            public float Low;
-            public float High;
-        }
-
-        /// <summary>Ground texture settings for each corner of the region</summary>
-        public class GroundTextureSettings
-        {
-            public GroundTextureRegion Southwest;
-            public GroundTextureRegion Northwest;
-            public GroundTextureRegion Southeast;
-            public GroundTextureRegion Northeast;
-        }
-
-        /// <summary>
-        /// Requests estate information such as top scripts and colliders
-        /// </summary>
-        /// <param name="parcelLocalID"></param>
-        /// <param name="reportType"></param>
-        /// <param name="requestFlags"></param>
-        /// <param name="filter"></param>
-        public void LandStatRequest(int parcelLocalID, LandStatReportType reportType, uint requestFlags, string filter)
-        {
-            LandStatRequestPacket p = new LandStatRequestPacket();
-            p.AgentData.AgentID = Client.Self.AgentID;
-            p.AgentData.SessionID = Client.Self.SessionID;
-            p.RequestData.Filter = Helpers.StringToField(filter);
-            p.RequestData.ParcelLocalID = parcelLocalID;
-            p.RequestData.ReportType = (uint)reportType;
-            p.RequestData.RequestFlags = requestFlags;
-            Client.Network.SendPacket(p);
-        }
-
-        /// <summary>Requests the "Top Scripts" list for the current region</summary>
-        public void GetTopScripts()
-        {
-            //EstateOwnerMessage("scripts", "");
-            LandStatRequest(0, LandStatReportType.TopScripts, 0, "");
-        }
-
-        /// <summary>Requests the "Top Colliders" list for the current region</summary>
-        public void GetTopColliders()
-        {
-            //EstateOwnerMessage("colliders", "");
-            LandStatRequest(0, LandStatReportType.TopColliders, 0, "");
-        }
-
-        /// <summary></summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        private void EstateOwnerMessageHandler(Packet packet, Simulator simulator)
-        {
-            EstateOwnerMessagePacket message = (EstateOwnerMessagePacket)packet;
-            string method = Helpers.FieldToUTF8String(message.MethodData.Method);
-
-            //FIXME - remove debug output
-            Console.WriteLine("--- " + method + " ---");
-            foreach (EstateOwnerMessagePacket.ParamListBlock block in message.ParamList)
-            {
-                Console.WriteLine(Helpers.FieldToUTF8String(block.Parameter));
-            }
-            Console.WriteLine("------");
-
-        }
-
-        /// <summary></summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        private void LandStatReplyHandler(Packet packet, Simulator simulator)
-        {
-            //if (OnLandStatReply != null || OnGetTopScripts != null || OnGetTopColliders != null)
-            if (OnGetTopScripts != null || OnGetTopColliders != null)
-            {
-                LandStatReplyPacket p = (LandStatReplyPacket)packet;
-                List<EstateTask> Tasks = new List<EstateTask>();
-
-                foreach (LandStatReplyPacket.ReportDataBlock rep in p.ReportData)
-                {
-                    EstateTask task = new EstateTask();
-                    task.Position = new LLVector3(rep.LocationX, rep.LocationY, rep.LocationZ);
-                    task.Score = rep.Score;
-                    task.TaskID = rep.TaskID;
-                    task.TaskLocalID = rep.TaskLocalID;
-                    task.TaskName = Helpers.FieldToUTF8String(rep.TaskName);
-                    task.OwnerName = Helpers.FieldToUTF8String(rep.OwnerName);
-                    Tasks.Add(task);
-                }
-
-                LandStatReportType type = (LandStatReportType)p.RequestData.ReportType;
-
-                if (OnGetTopScripts != null && type == LandStatReportType.TopScripts)
-                {
-                    OnGetTopScripts((int)p.RequestData.TotalObjectCount, Tasks);
-                }
-                else if (OnGetTopColliders != null && type == LandStatReportType.TopColliders)
-                {
-                    OnGetTopColliders((int)p.RequestData.TotalObjectCount, Tasks);
-                }
-
-                /*
-                if (OnGetTopColliders != null)
-                {
-                    //FIXME - System.UnhandledExceptionEventArgs
-                    OnLandStatReply(
-                        type,
-                        p.RequestData.RequestFlags,
-                        (int)p.RequestData.TotalObjectCount,
-                        Tasks
-                    );
-                }
-                */
-
-            }
-        }
-
-        public void EstateOwnerMessage(string method, string param)
-        {
-            List<string> listParams = new List<string>();
-            listParams.Add(param);
-            EstateOwnerMessage(method, listParams);
-        }
-
-        /// <summary>
-        /// Used for setting and retrieving various estate panel settings
-        /// </summary>
-        /// <param name="method">EstateOwnerMessage Method field</param>
-        /// <param name="listParams">List of parameters to include</param>
-        /// <param name="createInvoice">Use LLUUID.Random() for Invoice field instead of LLUUID.Zero</param>
-        public void EstateOwnerMessage(string method, List<string>listParams)
-        {
-            EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();
-            estate.AgentData.AgentID = Client.Self.AgentID;
-            estate.AgentData.SessionID = Client.Self.SessionID;
-            estate.MethodData.Invoice = LLUUID.Random();
-            estate.MethodData.Method = Helpers.StringToField(method);
-            estate.ParamList = new EstateOwnerMessagePacket.ParamListBlock[listParams.Count];
-            for (int i = 0; i < listParams.Count; i++)
-            {
-                estate.ParamList[i] = new EstateOwnerMessagePacket.ParamListBlock();
-                estate.ParamList[i].Parameter = Helpers.StringToField(listParams[i]);
-            }
-            Client.Network.SendPacket((Packet)estate);
-        }
-
-        /// <summary>
-        /// Kick an avatar from an estate
-        /// </summary>
-        /// <param name="prey">Key of Avatar to kick</param>
-		public void KickUser(LLUUID userID)
-		{
-            EstateOwnerMessage("kickestate", userID.ToString());
-		}
-
-        /// <summary>Ban an avatar from an estate</summary>
-        public void BanUser(LLUUID userID)
-        {
-            List<string> listParams = new List<string>();
-            uint flag = (uint)EstateAccessDelta.BanUser;
-            listParams.Add(Client.Self.AgentID.ToString());
-            listParams.Add(flag.ToString());
-            listParams.Add(userID.ToString());
-            EstateOwnerMessage("estateaccessdelta", listParams);
-        }
-
-        /// <summary>Unban an avatar from an estate</summary>
-        public void UnbanUser(LLUUID userID)
-        {
-            List<string> listParams = new List<string>();
-            uint flag = (uint)EstateAccessDelta.BanUser;
-            listParams.Add(Client.Self.AgentID.ToString());
-            listParams.Add(flag.ToString());
-            listParams.Add(userID.ToString());
-            EstateOwnerMessage("estateaccessdelta", listParams);
-        }
-
-        /// <summary>
-        /// Send a message dialog to everyone in an entire estate
-        /// </summary>
-        /// <param name="message">Message to send all users in the estate</param>
-        public void EstateMessage(string message)
-        {
-            List<string> listParams = new List<string>();
-            listParams.Add(Client.Self.FirstName + " " + Client.Self.LastName);
-            listParams.Add(message);
-            EstateOwnerMessage("instantmessage", listParams);
-        }
-
-        /// <summary>
-        /// Send a message dialog to everyone in a simulator
-        /// </summary>
-        /// <param name="message">Message to send all users in the simulator</param>
-        public void SimulatorMessage(string message)
-        {
-            List<string> listParams = new List<string>();
-            listParams.Add("-1");
-            listParams.Add("-1");
-            listParams.Add(Client.Self.AgentID.ToString());
-            listParams.Add(Client.Self.FirstName + " " + Client.Self.LastName);
-            listParams.Add(message);
-            EstateOwnerMessage("simulatormessage", listParams);
-        }
-
-        /// <summary>
-        /// Send an avatar back to their home location
-        /// </summary>
-        /// <param name="pest">Key of avatar to send home</param>
-        public void TeleportHomeUser(LLUUID pest)
-        {
-            List<string> listParams = new List<string>();
-            listParams.Add(Client.Self.AgentID.ToString());
-            listParams.Add(pest.ToString());
-            EstateOwnerMessage("teleporthomeuser", listParams);
-        }
-
-        /// <summary>
-        /// Begin the region restart process
-        /// </summary>
-        /// <param name="prey"></param>
-        public void RestartRegion()
-        {
-            EstateOwnerMessage("restart", "120");
-        }
-
-        /// <summary>
-        /// Cancels a region restart
-        /// </summary>
-        /// <param name="prey"></param>
-        public void CancelRestart()
-        {
-            EstateOwnerMessage("restart", "-1");
-        }
-
-        /// <summary>Estate panel "Region" tab settings</summary>
-        public void SetRegionInfo(bool blockTerraform, bool blockFly, bool allowDamage, bool allowLandResell, bool restrictPushing, bool allowParcelJoinDivide, float agentLimit, float objectBonus, bool mature)
-        {
-            List<string> listParams = new List<string>();
-            if (blockTerraform) listParams.Add("Y"); else listParams.Add("N");
-            if (blockFly) listParams.Add("Y"); else listParams.Add("N");
-            if (allowDamage) listParams.Add("Y"); else listParams.Add("N");
-            if (allowLandResell) listParams.Add("Y"); else listParams.Add("N");
-            listParams.Add(agentLimit.ToString());
-            listParams.Add(objectBonus.ToString());
-            if (mature) listParams.Add("21"); else listParams.Add("13"); //FIXME - enumerate these settings
-            if (restrictPushing) listParams.Add("Y"); else listParams.Add("N");
-            if (allowParcelJoinDivide) listParams.Add("Y"); else listParams.Add("N");
-            EstateOwnerMessage("setregioninfo", listParams);
-        }
-
-        /// <summary>Estate panel "Debug" tab settings</summary>
-        public void SetRegionDebug(bool disableScripts, bool disableCollisions, bool disablePhysics)
-        {
-            List<string> listParams = new List<string>();
-            if (disableScripts) listParams.Add("Y"); else listParams.Add("N");
-            if (disableCollisions) listParams.Add("Y"); else listParams.Add("N");
-            if (disablePhysics) listParams.Add("Y"); else listParams.Add("N");
-            EstateOwnerMessage("setregiondebug", listParams);
-        }
-
-	}
-
-}
diff --git a/old/libsl1550/libsecondlife/EventDictionary.cs b/old/libsl1550/libsecondlife/EventDictionary.cs
deleted file mode 100644
index 0285da8..0000000
--- a/old/libsl1550/libsecondlife/EventDictionary.cs
+++ /dev/null
@@ -1,349 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Registers, unregisters, and fires events generated by incoming packets
-    /// </summary>
-    public class PacketEventDictionary
-    {
-        /// <summary>
-        /// Object that is passed to worker threads in the ThreadPool for
-        /// firing packet callbacks
-        /// </summary>
-        private struct PacketCallbackWrapper
-        {
-            /// <summary>Callback to fire for this packet</summary>
-            public NetworkManager.PacketCallback Callback;
-            /// <summary>Reference to the simulator that this packet came from</summary>
-            public Simulator Simulator;
-            /// <summary>The packet that needs to be processed</summary>
-            public Packet Packet;
-        }
-
-        /// <summary>Reference to the SecondLife client</summary>
-        public SecondLife Client;
-
-        private Dictionary<PacketType, NetworkManager.PacketCallback> _EventTable =
-            new Dictionary<PacketType,NetworkManager.PacketCallback>();
-        private WaitCallback _ThreadPoolCallback;
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client"></param>
-        public PacketEventDictionary(SecondLife client)
-        {
-            Client = client;
-            _ThreadPoolCallback = new WaitCallback(ThreadPoolDelegate);
-        }
-
-        /// <summary>
-        /// Register an event handler
-        /// </summary>
-        /// <remarks>Use PacketType.Default to fire this event on every
-        /// incoming packet</remarks>
-        /// <param name="packetType">Packet type to register the handler for</param>
-        /// <param name="eventHandler">Callback to be fired</param>
-        public void RegisterEvent(PacketType packetType, NetworkManager.PacketCallback eventHandler)
-        {
-            lock (_EventTable)
-            {
-                if (_EventTable.ContainsKey(packetType))
-                    _EventTable[packetType] += eventHandler;
-                else
-                    _EventTable[packetType] = eventHandler;
-            }
-        }
-
-        /// <summary>
-        /// Unregister an event handler
-        /// </summary>
-        /// <param name="packetType">Packet type to unregister the handler for</param>
-        /// <param name="eventHandler">Callback to be unregistered</param>
-        public void UnregisterEvent(PacketType packetType, NetworkManager.PacketCallback eventHandler)
-        {
-            lock (_EventTable)
-            {
-                if (_EventTable.ContainsKey(packetType) && _EventTable[packetType] != null)
-                    _EventTable[packetType] -= eventHandler;
-            }
-        }
-
-        /// <summary>
-        /// Fire the events registered for this packet type synchronously
-        /// </summary>
-        /// <param name="packetType">Incoming packet type</param>
-        /// <param name="packet">Incoming packet</param>
-        /// <param name="simulator">Simulator this packet was received from</param>
-        internal void RaiseEvent(PacketType packetType, Packet packet, Simulator simulator)
-        {
-            NetworkManager.PacketCallback callback;
-
-            if (_EventTable.TryGetValue(packetType, out callback))
-            {
-                try
-                {
-                    callback(packet, simulator);
-                }
-                catch (Exception ex)
-                {
-                    Client.Log("Packet Event Handler: " + ex.ToString(), Helpers.LogLevel.Error);
-                }
-            }
-            else if (packetType != PacketType.Default && packetType != PacketType.PacketAck)
-            {
-                Client.Log("No handler registered for packet event " + packetType, Helpers.LogLevel.Debug);
-            }
-        }
-
-        /// <summary>
-        /// Fire the events registered for this packet type asynchronously
-        /// </summary>
-        /// <param name="packetType">Incoming packet type</param>
-        /// <param name="packet">Incoming packet</param>
-        /// <param name="simulator">Simulator this packet was received from</param>
-        internal void BeginRaiseEvent(PacketType packetType, Packet packet, Simulator simulator)
-        {
-            NetworkManager.PacketCallback callback;
-
-            if (_EventTable.TryGetValue(packetType, out callback))
-            {
-                if (callback != null)
-                {
-                    PacketCallbackWrapper wrapper;
-                    wrapper.Callback = callback;
-                    wrapper.Packet = packet;
-                    wrapper.Simulator = simulator;
-                    ThreadPool.QueueUserWorkItem(_ThreadPoolCallback, wrapper);
-
-                    return;
-                }
-            }
-
-            if (packetType != PacketType.Default && packetType != PacketType.PacketAck)
-            {
-                Client.Log("No handler registered for packet event " + packetType, Helpers.LogLevel.Debug);
-            }
-        }
-
-        private void ThreadPoolDelegate(Object state)
-        {
-            PacketCallbackWrapper wrapper = (PacketCallbackWrapper)state;
-
-            try
-            {
-                wrapper.Callback(wrapper.Packet, wrapper.Simulator);
-            }
-            catch (Exception ex)
-            {
-                Client.Log("Async Packet Event Handler: " + ex.ToString(), Helpers.LogLevel.Error);
-            }
-        }
-    }
-
-    /// <summary>
-    /// Registers, unregisters, and fires events generated by the Capabilities
-    /// event queue
-    /// </summary>
-    public class CapsEventDictionary
-    {
-        /// <summary>
-        /// Object that is passed to worker threads in the ThreadPool for
-        /// firing CAPS callbacks
-        /// </summary>
-        private struct CapsCallbackWrapper
-        {
-            /// <summary>Callback to fire for this packet</summary>
-            public Caps.EventQueueCallback Callback;
-            /// <summary>Name of the CAPS event</summary>
-            public string CapsEvent;
-            /// <summary>Decoded body of the CAPS event</summary>
-            public StructuredData.LLSD Body;
-            /// <summary>Reference to the simulator that generated this event</summary>
-            public Simulator Simulator;
-        }
-
-        /// <summary>Reference to the SecondLife client</summary>
-        public SecondLife Client;
-
-        private Dictionary<string, Caps.EventQueueCallback> _EventTable =
-            new Dictionary<string, Caps.EventQueueCallback>();
-        private WaitCallback _ThreadPoolCallback;
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client">Reference to the SecondLife client</param>
-        public CapsEventDictionary(SecondLife client)
-        {
-            Client = client;
-            _ThreadPoolCallback = new WaitCallback(ThreadPoolDelegate);
-        }
-
-        /// <summary>
-        /// Register an event handler
-        /// </summary>
-        /// <remarks>Use String.Empty to fire this event on every CAPS event</remarks>
-        /// <param name="capsEvent">Capability event name to register the
-        /// handler for</param>
-        /// <param name="eventHandler">Callback to fire</param>
-        public void RegisterEvent(string capsEvent, Caps.EventQueueCallback eventHandler)
-        {
-            lock (_EventTable)
-            {
-                if (_EventTable.ContainsKey(capsEvent))
-                    _EventTable[capsEvent] += eventHandler;
-                else
-                    _EventTable[capsEvent] = eventHandler;
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="capsEvent">Capability event name unregister the
-        /// handler for</param>
-        /// <param name="eventHandler">Callback to unregister</param>
-        public void UnregisterEvent(string capsEvent, Caps.EventQueueCallback eventHandler)
-        {
-            lock (_EventTable)
-            {
-                if (_EventTable.ContainsKey(capsEvent) && _EventTable[capsEvent] != null)
-                    _EventTable[capsEvent] -= eventHandler;
-            }
-        }
-
-        /// <summary>
-        /// Fire the events registered for this event type synchronously
-        /// </summary>
-        /// <param name="capsEvent">Capability name</param>
-        /// <param name="body">Decoded event body</param>
-        /// <param name="simulator">Reference to the simulator that
-        /// generated this event</param>
-        internal void RaiseEvent(string capsEvent, StructuredData.LLSD body, Simulator simulator)
-        {
-            bool specialHandler = false;
-            Caps.EventQueueCallback callback;
-
-            // Default handler first, if one exists
-            if (_EventTable.TryGetValue(capsEvent, out callback))
-            {
-                if (callback != null)
-                {
-                    try { callback(capsEvent, body, simulator); }
-                    catch (Exception ex) { Client.Log("CAPS Event Handler: " + ex.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-
-            // Generic parser next
-            if (body.Type == StructuredData.LLSDType.Map)
-            {
-                StructuredData.LLSDMap map = (StructuredData.LLSDMap)body;
-                Packet packet = Packet.BuildPacket(capsEvent, map);
-                if (packet != null)
-                {
-                    NetworkManager.IncomingPacket incomingPacket;
-                    incomingPacket.Simulator = simulator;
-                    incomingPacket.Packet = packet;
-
-                    Client.DebugLog("Serializing " + packet.Type.ToString() + " capability with generic handler");
-
-                    Client.Network.PacketInbox.Enqueue(incomingPacket);
-                    specialHandler = true;
-                }
-            }
-
-            // Explicit handler next
-            if (_EventTable.TryGetValue(capsEvent, out callback) && callback != null)
-            {
-                try { callback(capsEvent, body, simulator); }
-                catch (Exception ex) { Client.Log("CAPS Event Handler: " + ex.ToString(), Helpers.LogLevel.Error); }
-
-                specialHandler = true;
-            }
-
-            if (!specialHandler)
-                Client.Log("Unhandled CAPS event " + capsEvent, Helpers.LogLevel.Warning);
-        }
-
-        /// <summary>
-        /// Fire the events registered for this event type asynchronously
-        /// </summary>
-        /// <param name="capsEvent">Capability name</param>
-        /// <param name="body">Decoded event body</param>
-        /// <param name="simulator">Reference to the simulator that
-        /// generated this event</param>
-        internal void BeginRaiseEvent(string capsEvent, StructuredData.LLSD body, Simulator simulator)
-        {
-            bool specialHandler = false;
-            Caps.EventQueueCallback callback;
-
-            // Default handler first, if one exists
-            if (_EventTable.TryGetValue(String.Empty, out callback))
-            {
-                if (callback != null)
-                {
-                    CapsCallbackWrapper wrapper;
-                    wrapper.Callback = callback;
-                    wrapper.CapsEvent = capsEvent;
-                    wrapper.Body = body;
-                    wrapper.Simulator = simulator;
-                    ThreadPool.QueueUserWorkItem(_ThreadPoolCallback, wrapper);
-                }
-            }
-
-            // Generic parser next
-            if (body.Type == StructuredData.LLSDType.Map)
-            {
-                StructuredData.LLSDMap map = (StructuredData.LLSDMap)body;
-                Packet packet = Packet.BuildPacket(capsEvent, map);
-                if (packet != null)
-                {
-                    NetworkManager.IncomingPacket incomingPacket;
-                    incomingPacket.Simulator = simulator;
-                    incomingPacket.Packet = packet;
-
-                    Client.DebugLog("Serializing " + packet.Type.ToString() + " capability with generic handler");
-
-                    Client.Network.PacketInbox.Enqueue(incomingPacket);
-                    specialHandler = true;
-                }
-            }
-
-            // Explicit handler next
-            if (_EventTable.TryGetValue(capsEvent, out callback) && callback != null)
-            {
-                CapsCallbackWrapper wrapper;
-                wrapper.Callback = callback;
-                wrapper.CapsEvent = capsEvent;
-                wrapper.Body = body;
-                wrapper.Simulator = simulator;
-                ThreadPool.QueueUserWorkItem(_ThreadPoolCallback, wrapper);
-
-                specialHandler = true;
-            }
-
-            if (!specialHandler)
-                Client.Log("Unhandled CAPS event " + capsEvent, Helpers.LogLevel.Warning);
-        }
-
-        private void ThreadPoolDelegate(Object state)
-        {
-            CapsCallbackWrapper wrapper = (CapsCallbackWrapper)state;
-
-            try
-            {
-                wrapper.Callback(wrapper.CapsEvent, wrapper.Body, wrapper.Simulator);
-            }
-            catch (Exception ex)
-            {
-                Client.Log("Async CAPS Event Handler: " + ex.ToString(), Helpers.LogLevel.Error);
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/FriendsManager.cs b/old/libsl1550/libsecondlife/FriendsManager.cs
deleted file mode 100644
index b66787d..0000000
--- a/old/libsl1550/libsecondlife/FriendsManager.cs
+++ /dev/null
@@ -1,708 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    ///
-    /// </summary>
-    [Flags]
-    public enum FriendRights : int
-    {
-        /// <summary>The avatar has no rights</summary>
-        None = 0,
-        /// <summary>The avatar can see the online status of the target avatar</summary>
-        CanSeeOnline = 1,
-        /// <summary>The avatar can see the location of the target avatar on the map</summary>
-        CanSeeOnMap = 2,
-        /// <summary>The avatar can modify the ojects of the target avatar </summary>
-        CanModifyObjects = 4
-    }
-
-    /// <summary>
-    /// This class holds information about an avatar in the friends list.  There are two ways
-    /// to interface to this class.  The first is through the set of boolean properties.  This is the typical
-    /// way clients of this class will use it.  The second interface is through two bitmap properties.  While
-    /// the bitmap interface is public, it is intended for use the libsecondlife framework.
-    /// </summary>
-    public class FriendInfo
-    {
-        private LLUUID m_id;
-        private string m_name;
-        private bool m_isOnline;
-        private bool m_canSeeMeOnline;
-        private bool m_canSeeMeOnMap;
-        private bool m_canModifyMyObjects;
-        private bool m_canSeeThemOnline;
-        private bool m_canSeeThemOnMap;
-        private bool m_canModifyTheirObjects;
-
-        /// <summary>
-        /// Used by the libsecondlife framework when building the initial list of friends
-        /// at login time.  This constructor should not be called by consummer of this class.
-        /// </summary>
-        /// <param name="id">System ID of the avatar being prepesented</param>
-        /// <param name="theirRights">Rights the friend has to see you online and to modify your objects</param>
-        /// <param name="myRights">Rights you have to see your friend online and to modify their objects</param>
-        public FriendInfo(LLUUID id, FriendRights theirRights, FriendRights myRights)
-        {
-            m_id = id;
-            m_canSeeMeOnline = (theirRights & FriendRights.CanSeeOnline) != 0;
-            m_canSeeMeOnMap = (theirRights & FriendRights.CanSeeOnMap) != 0;
-            m_canModifyMyObjects = (theirRights & FriendRights.CanModifyObjects) != 0;
-
-            m_canSeeThemOnline = (myRights & FriendRights.CanSeeOnline) != 0;
-            m_canSeeThemOnMap = (myRights & FriendRights.CanSeeOnMap) != 0;
-            m_canModifyTheirObjects = (myRights & FriendRights.CanModifyObjects) != 0;
-        }
-
-        /// <summary>
-        /// System ID of the avatar
-        /// </summary>
-        public LLUUID UUID { get { return m_id; } }
-
-        /// <summary>
-        /// full name of the avatar
-        /// </summary>
-        public string Name
-        {
-            get { return m_name; }
-            set { m_name = value; }
-        }
-
-        /// <summary>
-        /// True if the avatar is online
-        /// </summary>
-        public bool IsOnline
-        {
-            get { return m_isOnline; }
-            set { m_isOnline = value; }
-        }
-
-        /// <summary>
-        /// True if the friend can see if I am online
-        /// </summary>
-        public bool CanSeeMeOnline
-        {
-            get { return m_canSeeMeOnline; }
-            set
-            {
-                m_canSeeMeOnline = value;
-
-                // if I can't see them online, then I can't see them on the map
-                if (!m_canSeeMeOnline)
-                    m_canSeeMeOnMap = false;
-            }
-        }
-
-        /// <summary>
-        /// True if the friend can see me on the map
-        /// </summary>
-        public bool CanSeeMeOnMap
-        {
-            get { return m_canSeeMeOnMap; }
-            set
-            {
-                // if I can't see them online, then I can't see them on the map
-                if (m_canSeeMeOnline)
-                    m_canSeeMeOnMap = value;
-            }
-        }
-
-        /// <summary>
-        /// True if the freind can modify my objects
-        /// </summary>
-        public bool CanModifyMyObjects
-        {
-            get { return m_canModifyMyObjects; }
-            set { m_canModifyMyObjects = value; }
-        }
-
-        /// <summary>
-        /// True if I can see if my friend is online
-        /// </summary>
-        public bool CanSeeThemOnline { get { return m_canSeeThemOnline; } }
-
-        /// <summary>
-        /// True if I can see if my friend is on the map
-        /// </summary>
-        public bool CanSeeThemOnMap { get { return m_canSeeThemOnMap; } }
-
-        /// <summary>
-        /// True if I can modify my friend's objects
-        /// </summary>
-        public bool CanModifyTheirObjects { get { return m_canModifyTheirObjects; } }
-
-        /// <summary>
-        /// My friend's rights represented as bitmapped flags
-        /// </summary>
-        public FriendRights TheirFriendRights
-        {
-            get
-            {
-                FriendRights results = FriendRights.None;
-                if (m_canSeeMeOnline)
-                    results |= FriendRights.CanSeeOnline;
-                if (m_canSeeMeOnMap)
-                    results |= FriendRights.CanSeeOnMap;
-                if (m_canModifyMyObjects)
-                    results |= FriendRights.CanModifyObjects;
-
-                return results;
-            }
-            set
-            {
-                m_canSeeMeOnline = (value & FriendRights.CanSeeOnline) != 0;
-                m_canSeeMeOnMap = (value & FriendRights.CanSeeOnMap) != 0;
-                m_canModifyMyObjects = (value & FriendRights.CanModifyObjects) != 0;
-            }
-        }
-
-        /// <summary>
-        /// My rights represented as bitmapped flags
-        /// </summary>
-        public FriendRights MyFriendRights
-        {
-            get
-            {
-                FriendRights results = FriendRights.None;
-                if (m_canSeeThemOnline)
-                    results |= FriendRights.CanSeeOnline;
-                if (m_canSeeThemOnMap)
-                    results |= FriendRights.CanSeeOnMap;
-                if (m_canModifyTheirObjects)
-                    results |= FriendRights.CanModifyObjects;
-
-                return results;
-            }
-            set
-            {
-                m_canSeeThemOnline = (value & FriendRights.CanSeeOnline) != 0;
-                m_canSeeThemOnMap = (value & FriendRights.CanSeeOnMap) != 0;
-                m_canModifyTheirObjects = (value & FriendRights.CanModifyObjects) != 0;
-            }
-        }
-
-        /// <summary>
-        /// FriendInfo represented as a string
-        /// </summary>
-        /// <returns>A string reprentation of both my rights and my friends rights</returns>
-        public override string ToString()
-        {
-            if (!String.IsNullOrEmpty(m_name))
-                return String.Format("{0} (Their Rights: {1}, My Rights: {2})", m_name, TheirFriendRights,
-                    MyFriendRights);
-            else
-                return String.Format("{0} (Their Rights: {1}, My Rights: {2})", m_id, TheirFriendRights,
-                    MyFriendRights);
-        }
-    }
-
-    /// <summary>
-    /// This class is used to add and remove avatars from your friends list and to manage their permission.
-    /// </summary>
-    public class FriendsManager
-    {
-        #region Delegates
-
-        /// <summary>
-        /// Triggered when an avatar in your friends list comes online
-        /// </summary>
-        /// <param name="friend"> System ID of the avatar</param>
-        public delegate void FriendOnlineEvent(FriendInfo friend);
-        /// <summary>
-        /// Triggered when an avatar in your friends list goes offline
-        /// </summary>
-        /// <param name="friend"> System ID of the avatar</param>
-        public delegate void FriendOfflineEvent(FriendInfo friend);
-        /// <summary>
-        /// Triggered in response to a call to the GrantRighs() method, or when a friend changes your rights
-        /// </summary>
-        /// <param name="friend"> System ID of the avatar you changed the right of</param>
-        public delegate void FriendRightsEvent(FriendInfo friend);
-        /// <summary>
-        /// Triggered when someone offers you friendship
-        /// </summary>
-        /// <param name="agentID">System ID of the agent offering friendship</param>
-        /// <param name="agentName">full name of the agent offereing friendship</param>
-        /// <param name="IMSessionID">session ID need when accepting/declining the offer</param>
-        /// <returns>Return true to accept the friendship, false to deny it</returns>
-        public delegate void FriendshipOfferedEvent(LLUUID agentID, string agentName, LLUUID imSessionID);
-        /// <summary>
-        /// Trigger when your friendship offer has been accepted or declined
-        /// </summary>
-        /// <param name="agentID">System ID of the avatar who accepted your friendship offer</param>
-        /// <param name="agentName">Full name of the avatar who accepted your friendship offer</param>
-        /// <param name="accepted">Whether the friendship request was accepted or declined</param>
-        public delegate void FriendshipResponseEvent(LLUUID agentID, string agentName, bool accepted);
-        /// <summary>
-        /// Trigger when someone terminates your friendship.
-        /// </summary>
-        /// <param name="agentID">System ID of the avatar who terminated your friendship</param>
-        /// <param name="agentName">Full name of the avatar who terminated your friendship</param>
-        public delegate void FriendshipTerminatedEvent(LLUUID agentID, string agentName);
-
-        #endregion Delegates
-
-        #region Events
-
-        public event FriendOnlineEvent OnFriendOnline;
-        public event FriendOfflineEvent OnFriendOffline;
-        public event FriendRightsEvent OnFriendRights;
-        public event FriendshipOfferedEvent OnFriendshipOffered;
-        public event FriendshipResponseEvent OnFriendshipResponse;
-        public event FriendshipTerminatedEvent OnFriendshipTerminated;
-
-        #endregion Events
-
-        private SecondLife Client;
-        private Dictionary<LLUUID, FriendInfo> _Friends = new Dictionary<LLUUID, FriendInfo>();
-        private Dictionary<LLUUID, LLUUID> _Requests = new Dictionary<LLUUID, LLUUID>();
-
-        /// <summary>
-        /// This constructor is intened to for use only the the libsecondlife framework
-        /// </summary>
-        /// <param name="client"></param>
-        public FriendsManager(SecondLife client)
-        {
-            Client = client;
-
-            Client.Network.OnConnected += new NetworkManager.ConnectedCallback(Network_OnConnect);
-            Client.Avatars.OnAvatarNames += new AvatarManager.AvatarNamesCallback(Avatars_OnAvatarNames);
-            Client.Self.OnInstantMessage += new AgentManager.InstantMessageCallback(MainAvatar_InstantMessage);
-
-            Client.Network.RegisterCallback(PacketType.OnlineNotification, OnlineNotificationHandler);
-            Client.Network.RegisterCallback(PacketType.OfflineNotification, OfflineNotificationHandler);
-            Client.Network.RegisterCallback(PacketType.ChangeUserRights, ChangeUserRightsHandler);
-            Client.Network.RegisterCallback(PacketType.TerminateFriendship, TerminateFriendshipHandler);
-
-            Client.Network.RegisterLoginResponseCallback(new NetworkManager.LoginResponseCallback(Network_OnLoginResponse),
-                new string[] { "buddy-list" });
-        }
-
-        /// <summary>
-        /// Get a list of all the friends we are currently aware of
-        /// </summary>
-        /// <remarks>
-        /// This function performs a shallow copy from the internal dictionary
-        /// in FriendsManager. Avoid calling it multiple times when it is not
-        /// necessary to as it can be expensive memory-wise
-        /// </remarks>
-        public List<FriendInfo> FriendsList()
-        {
-            List<FriendInfo> friends = new List<FriendInfo>();
-
-            lock (_Friends)
-            {
-                foreach (FriendInfo info in _Friends.Values)
-                    friends.Add(info);
-            }
-
-            return friends;
-        }
-
-        /// <summary>
-        /// Dictionary of unanswered friendship offers
-        /// </summary>
-        public Dictionary<LLUUID, LLUUID> PendingOffers()
-        {
-            Dictionary<LLUUID, LLUUID> requests = new Dictionary<LLUUID,LLUUID>();
-
-            lock (_Requests)
-            {
-                foreach(KeyValuePair<LLUUID, LLUUID> req in _Requests)
-                    requests.Add(req.Key, req.Value);
-            }
-
-            return requests;
-        }
-
-        /// <summary>
-        /// Accept a friendship request
-        /// </summary>
-        /// <param name="imSessionID">imSessionID of the friendship request message</param>
-        public void AcceptFriendship(LLUUID fromAgentID, LLUUID imSessionID)
-        {
-            LLUUID callingCardFolder = Client.Inventory.FindFolderForType(AssetType.CallingCard);
-
-            AcceptFriendshipPacket request = new AcceptFriendshipPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.TransactionBlock.TransactionID = imSessionID;
-            request.FolderData = new AcceptFriendshipPacket.FolderDataBlock[1];
-            request.FolderData[0] = new AcceptFriendshipPacket.FolderDataBlock();
-            request.FolderData[0].FolderID = callingCardFolder;
-
-            Client.Network.SendPacket(request);
-
-            FriendInfo friend = new FriendInfo(fromAgentID, FriendRights.CanSeeOnline,
-                FriendRights.CanSeeOnline);
-            lock (_Friends)
-            {
-                if(!_Friends.ContainsKey(fromAgentID))  _Friends.Add(friend.UUID, friend);
-            }
-            lock (_Requests) { if (_Requests.ContainsKey(fromAgentID)) _Requests.Remove(fromAgentID); }
-
-            Client.Avatars.RequestAvatarName(fromAgentID);
-        }
-
-        /// <summary>
-        /// Decline a friendship request
-        /// </summary>
-        /// <param name="imSessionID">imSessionID of the friendship request message</param>
-        public void DeclineFriendship(LLUUID fromAgentID, LLUUID imSessionID)
-        {
-            DeclineFriendshipPacket request = new DeclineFriendshipPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.TransactionBlock.TransactionID = imSessionID;
-            Client.Network.SendPacket(request);
-
-            lock (_Requests) { if (_Requests.ContainsKey(fromAgentID)) _Requests.Remove(fromAgentID); }
-        }
-
-        /// <summary>
-        /// Offer friendship to an avatar.
-        /// </summary>
-        /// <param name="agentID">System ID of the avatar you are offering friendship to</param>
-        public void OfferFriendship(LLUUID agentID)
-        {
-            // HACK: folder id stored as "message"
-            LLUUID callingCardFolder = Client.Inventory.FindFolderForType(AssetType.CallingCard);
-            Client.Self.InstantMessage(Client.Self.Name,
-                agentID,
-                callingCardFolder.ToString(),
-                LLUUID.Random(),
-                InstantMessageDialog.FriendshipOffered,
-                InstantMessageOnline.Online,
-                Client.Self.SimPosition,
-                Client.Network.CurrentSim.ID,
-                new byte[0]);
-        }
-
-
-        /// <summary>
-        /// Terminate a friendship with an avatar
-        /// </summary>
-        /// <param name="agentID">System ID of the avatar you are terminating the friendship with</param>
-        public void TerminateFriendship(LLUUID agentID)
-        {
-            if (_Friends.ContainsKey(agentID))
-            {
-                TerminateFriendshipPacket request = new TerminateFriendshipPacket();
-                request.AgentData.AgentID = Client.Self.AgentID;
-                request.AgentData.SessionID = Client.Self.SessionID;
-                request.ExBlock.OtherID = agentID;
-
-                Client.Network.SendPacket(request);
-
-                lock (_Friends)
-                {
-                    if (_Friends.ContainsKey(agentID))
-                        _Friends.Remove(agentID);
-                }
-            }
-        }
-        /// <summary>
-        /// Fired when another friend terminates friendship. We need to remove them from
-        /// our cached list.
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        private void TerminateFriendshipHandler(Packet packet, Simulator simulator)
-        {
-            TerminateFriendshipPacket itsOver = (TerminateFriendshipPacket)packet;
-            string name = String.Empty;
-            lock (_Friends)
-            {
-                if (_Friends.ContainsKey(itsOver.ExBlock.OtherID))
-                {
-                    name = _Friends[itsOver.ExBlock.OtherID].Name;
-                    _Friends.Remove(itsOver.ExBlock.OtherID);
-                }
-            }
-            if (OnFriendshipTerminated != null)
-            {
-                OnFriendshipTerminated(itsOver.ExBlock.OtherID, name);
-            }
-        }
-        /// <summary>
-        /// Change the rights of a friend avatar.  To use this routine, first change the right of the
-        /// avatar stored in the item property.
-        /// </summary>
-        /// <param name="agentID">System ID of the avatar you are changing the rights of</param>
-        public void GrantRights(LLUUID agentID)
-        {
-            GrantUserRightsPacket request = new GrantUserRightsPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.Rights = new GrantUserRightsPacket.RightsBlock[1];
-            request.Rights[0] = new GrantUserRightsPacket.RightsBlock();
-            request.Rights[0].AgentRelated = agentID;
-            request.Rights[0].RelatedRights = (int)(_Friends[agentID].TheirFriendRights);
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        /// Called when a connection to the SL server is established.  The list of friend avatars
-        /// is populated from XML returned by the login server.  That list contains the avatar's id
-        /// and right, but no names.  Here is where those names are requested.
-        /// </summary>
-        /// <param name="sender"></param>
-        private void Network_OnConnect(object sender)
-        {
-            List<LLUUID> names = new List<LLUUID>();
-
-            if ( _Friends.Count > 0 )
-            {
-                lock (_Friends)
-                {
-                    foreach (KeyValuePair<LLUUID, FriendInfo> kvp in _Friends)
-                    {
-                        if (String.IsNullOrEmpty(kvp.Value.Name))
-                            names.Add(kvp.Key);
-                    }
-                }
-
-                Client.Avatars.RequestAvatarNames(names);
-            }
-        }
-
-
-        /// <summary>
-        /// This handles the asynchronous response of a RequestAvatarNames call.
-        /// </summary>
-        /// <param name="names">names cooresponding to the the list of IDs sent the the RequestAvatarNames call.</param>
-        private void Avatars_OnAvatarNames(Dictionary<LLUUID, string> names)
-        {
-            lock (_Friends)
-            {
-                foreach (KeyValuePair<LLUUID, string> kvp in names)
-                {
-                    if (_Friends.ContainsKey(kvp.Key))
-                        _Friends[kvp.Key].Name = names[kvp.Key];
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Handle notifications sent when a friends has come online.
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        private void OnlineNotificationHandler(Packet packet, Simulator simulator)
-        {
-            if (packet.Type == PacketType.OnlineNotification)
-            {
-                OnlineNotificationPacket notification = ((OnlineNotificationPacket)packet);
-
-                foreach (OnlineNotificationPacket.AgentBlockBlock block in notification.AgentBlock)
-                {
-                    FriendInfo friend;
-
-                    lock (_Friends)
-                    {
-                        if (!_Friends.ContainsKey(block.AgentID))
-                        {
-                            friend = new FriendInfo(block.AgentID, FriendRights.CanSeeOnline,
-                                FriendRights.CanSeeOnline);
-                            _Friends.Add(block.AgentID, friend);
-                        }
-                        else
-                        {
-                            friend = _Friends[block.AgentID];
-                        }
-                    }
-
-                    bool doNotify = !friend.IsOnline;
-                    friend.IsOnline = true;
-
-                    if (OnFriendOnline != null && doNotify)
-                    {
-                        try { OnFriendOnline(friend); }
-                        catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Handle notifications sent when a friends has gone offline.
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        private void OfflineNotificationHandler(Packet packet, Simulator simulator)
-        {
-            if (packet.Type == PacketType.OfflineNotification)
-            {
-                OfflineNotificationPacket notification = ((OfflineNotificationPacket)packet);
-
-                foreach (OfflineNotificationPacket.AgentBlockBlock block in notification.AgentBlock)
-                {
-                    FriendInfo friend;
-
-                    lock (_Friends)
-                    {
-                        if (!_Friends.ContainsKey(block.AgentID))
-                            _Friends.Add(block.AgentID, new FriendInfo(block.AgentID, FriendRights.CanSeeOnline, FriendRights.CanSeeOnline));
-
-                        friend = _Friends[block.AgentID];
-                        friend.IsOnline = false;
-                    }
-
-                    if (OnFriendOffline != null)
-                    {
-                        try { OnFriendOffline(friend); }
-                        catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Handle notifications sent when a friend rights change.  This notification is also received
-        /// when my own rights change.
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        private void ChangeUserRightsHandler(Packet packet, Simulator simulator)
-        {
-            if (packet.Type == PacketType.ChangeUserRights)
-            {
-                FriendInfo friend;
-                ChangeUserRightsPacket rights = (ChangeUserRightsPacket)packet;
-
-                foreach (ChangeUserRightsPacket.RightsBlock block in rights.Rights)
-                {
-                    FriendRights newRights = (FriendRights)block.RelatedRights;
-                    if (_Friends.TryGetValue(block.AgentRelated, out friend))
-                    {
-                        friend.TheirFriendRights = newRights;
-                        if (OnFriendRights != null)
-                        {
-                            try { OnFriendRights(friend); }
-                            catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                        }
-                    }
-                    else if (block.AgentRelated == Client.Self.AgentID)
-                    {
-                        if (_Friends.TryGetValue(rights.AgentData.AgentID, out friend))
-                        {
-                            friend.MyFriendRights = newRights;
-                            if (OnFriendRights != null)
-                            {
-                                try { OnFriendRights(friend); }
-                                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Handles relevant messages from the server encapsulated in instant messages.
-        /// </summary>
-        /// <param name="fromAgentID"></param>
-        /// <param name="fromAgentName"></param>
-        /// <param name="toAgentID"></param>
-        /// <param name="parentEstateID"></param>
-        /// <param name="regionID"></param>
-        /// <param name="position"></param>
-        /// <param name="dialog"></param>
-        /// <param name="groupIM"></param>
-        /// <param name="imSessionID"></param>
-        /// <param name="timestamp"></param>
-        /// <param name="message"></param>
-        /// <param name="offline"></param>
-        /// <param name="binaryBucket"></param>
-        /// <param name="simulator"></param>
-        private void MainAvatar_InstantMessage(InstantMessage im, Simulator simulator)
-        {
-            if (im.Dialog == InstantMessageDialog.FriendshipOffered)
-            {
-                if (OnFriendshipOffered != null)
-                {
-                    lock (_Requests)
-                    {
-                        if (_Requests.ContainsKey(im.FromAgentID))
-                        	_Requests[im.FromAgentID] = im.IMSessionID;
-                        else
-                        	_Requests.Add(im.FromAgentID, im.IMSessionID);
-                    }
-                    try { OnFriendshipOffered(im.FromAgentID, im.FromAgentName, im.IMSessionID); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-            else if (im.Dialog == InstantMessageDialog.FriendshipAccepted)
-            {
-                FriendInfo friend = new FriendInfo(im.FromAgentID, FriendRights.CanSeeOnline,
-                    FriendRights.CanSeeOnline);
-                friend.Name = im.FromAgentName;
-                lock (_Friends) _Friends[friend.UUID] = friend;
-
-                if (OnFriendshipResponse != null)
-                {
-                    try { OnFriendshipResponse(im.FromAgentID, im.FromAgentName, true); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-            else if (im.Dialog == InstantMessageDialog.FriendshipDeclined)
-            {
-                if (OnFriendshipResponse != null)
-                {
-                    try { OnFriendshipResponse(im.FromAgentID, im.FromAgentName, false); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        private void Network_OnLoginResponse(bool loginSuccess, bool redirect, string message, string reason,
-            LoginResponseData replyData)
-        {
-            if (loginSuccess)
-            {
-                lock (_Friends)
-                {
-                    for (int i = 0; i < replyData.BuddyList.Length; i++)
-                    {
-                        FriendInfo friend = replyData.BuddyList[i];
-                        _Friends[friend.UUID] = friend;
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/GridManager.cs b/old/libsl1550/libsecondlife/GridManager.cs
deleted file mode 100644
index 6c45975..0000000
--- a/old/libsl1550/libsecondlife/GridManager.cs
+++ /dev/null
@@ -1,590 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife.StructuredData;
-using libsecondlife.Capabilities;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    ///
-    /// </summary>
-    public enum GridLayerType : uint
-    {
-        /// <summary>Objects and terrain are shown</summary>
-        Objects = 0,
-        /// <summary>Only the terrain is shown, no objects</summary>
-        Terrain = 1,
-        /// <summary>Overlay showing land for sale and for auction</summary>
-        LandForSale = 2
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public enum GridItemType : uint
-    {
-        Telehub = 1,
-        PgEvent = 2,
-        MatureEvent = 3,
-        Popular = 4,
-        AgentLocations = 6,
-        LandForSale = 7,
-        Classified = 8
-    }
-
-	/// <summary>
-	/// Information about a region on the grid map
-	/// </summary>
-	public struct GridRegion
-	{
-        /// <summary>Sim X position on World Map</summary>
-		public int X;
-        /// <summary>Sim Y position on World Map</summary>
-		public int Y;
-        /// <summary>Sim Name (NOTE: In lowercase!)</summary>
-		public string Name;
-        /// <summary></summary>
-		public Simulator.SimAccess Access;
-        /// <summary>Appears to always be zero (None)</summary>
-        public Simulator.RegionFlags RegionFlags;
-        /// <summary>Sim's defined Water Height</summary>
-		public byte WaterHeight;
-        /// <summary></summary>
-		public byte Agents;
-        /// <summary>UUID of the World Map image</summary>
-		public LLUUID MapImageID;
-        /// <summary>Unique identifier for this region, a combination of the X
-        /// and Y position</summary>
-		public ulong RegionHandle;
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override string ToString()
-        {
-            StringBuilder output = new StringBuilder("GridRegion: ");
-            output.Append(Name); output.Append(Helpers.NewLine);
-            output.Append("RegionHandle: " + RegionHandle); output.Append(Helpers.NewLine);
-            output.Append(String.Format("X: {0} Y: {1}", X, Y)); output.Append(Helpers.NewLine);
-            output.Append("MapImageID: " + MapImageID.ToString()); output.Append(Helpers.NewLine);
-            output.Append("Access: " + Access); output.Append(Helpers.NewLine);
-            output.Append("RegionFlags: " + RegionFlags); output.Append(Helpers.NewLine);
-            output.Append("WaterHeight: " + WaterHeight); output.Append(Helpers.NewLine);
-            output.Append("Agents: " + Agents);
-
-            return output.ToString();
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override int GetHashCode()
-        {
-            return X.GetHashCode() ^ Y.GetHashCode();
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-        public override bool Equals(object obj)
-        {
-            if (obj is GridRegion)
-                return Equals((GridRegion)obj);
-            else
-                return false;
-        }
-
-        private bool Equals(GridRegion region)
-        {
-            return (this.X == region.X && this.Y == region.Y);
-        }
-	}
-
-    /// <summary>
-    /// Visual chunk of the grid map
-    /// </summary>
-    public struct GridLayer
-    {
-        public int Bottom;
-        public int Left;
-        public int Top;
-        public int Right;
-        public LLUUID ImageID;
-
-        public bool ContainsRegion(int x, int y)
-        {
-            return (x >= Left && x <= Right && y >= Bottom && y <= Top);
-        }
-    }
-
-    public abstract class GridItem
-    {
-    }
-
-    public class GridAgentLocation : GridItem
-    {
-        public uint GlobalX;
-        public uint GlobalY;
-        public int AvatarCount;
-        public string Identifier;
-
-        public uint LocalX { get { return GlobalX % 256; } }
-        public uint LocalY { get { return GlobalY % 256; } }
-
-        public ulong RegionHandle
-        {
-            get { return Helpers.UIntsToLong((uint)(GlobalX - (GlobalX % 256)), (uint)(GlobalY - (GlobalY % 256))); }
-        }
-    }
-
-	/// <summary>
-	/// Manages grid-wide tasks such as the world map
-	/// </summary>
-	public class GridManager
-	{
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="region"></param>
-        public delegate void GridRegionCallback(GridRegion region);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="layer"></param>
-        public delegate void GridLayerCallback(GridLayer layer);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="type"></param>
-        /// <param name="items"></param>
-        public delegate void GridItemsCallback(GridItemType type, List<GridItem> items);
-
-        /// <summary>Triggered when a new region is discovered through GridManager</summary>
-        public event GridRegionCallback OnGridRegion;
-        /// <summary></summary>
-        public event GridLayerCallback OnGridLayer;
-        /// <summary></summary>
-        public event GridItemsCallback OnGridItems;
-
-        /// <summary>Unknown</summary>
-        public float SunPhase { get { return sunPhase; } }
-		/// <summary>Current direction of the sun</summary>
-        public LLVector3 SunDirection { get { return sunDirection; } }
-        /// <summary>Current angular velocity of the sun</summary>
-        public LLVector3 SunAngVelocity { get { return sunAngVelocity; } }
-
-        /// <summary>A dictionary of all the regions, indexed by region name</summary>
-        internal Dictionary<string, GridRegion> Regions = new Dictionary<string, GridRegion>();
-        /// <summary>A dictionary of all the regions, indexed by region handle</summary>
-        internal Dictionary<ulong, GridRegion> RegionsByHandle = new Dictionary<ulong, GridRegion>();
-
-		private SecondLife Client;
-        private float sunPhase;
-        private LLVector3 sunDirection;
-        private LLVector3 sunAngVelocity;
-
-        /// <summary>
-        /// Constructor
-        /// </summary>
-        /// <param name="client">Instance of type SecondLife to associate with this GridManager instance</param>
-		public GridManager(SecondLife client)
-		{
-			Client = client;
-
-            Client.Network.RegisterCallback(PacketType.MapBlockReply, new NetworkManager.PacketCallback(MapBlockReplyHandler));
-            Client.Network.RegisterCallback(PacketType.MapItemReply, new NetworkManager.PacketCallback(MapItemReplyHandler));
-            Client.Network.RegisterCallback(PacketType.SimulatorViewerTimeMessage, new NetworkManager.PacketCallback(TimeMessageHandler));
-            Client.Network.RegisterCallback(PacketType.CoarseLocationUpdate, new NetworkManager.PacketCallback(CoarseLocationHandler));
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="layer"></param>
-        public void RequestMapLayer(GridLayerType layer)
-        {
-            Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("MapLayer");
-
-            if (url != null)
-            {
-                LLSDMap body = new LLSDMap();
-                body["Flags"] = LLSD.FromInteger((int)layer);
-
-                CapsClient request = new CapsClient(url);
-                request.OnComplete += new CapsClient.CompleteCallback(MapLayerResponseHandler);
-                request.StartRequest(body);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="regionName"></param>
-        /// <param name="layer"></param>
-        public void RequestMapRegion(string regionName, GridLayerType layer)
-        {
-            MapNameRequestPacket request = new MapNameRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.AgentData.Flags = (uint)layer;
-            request.AgentData.EstateID = 0; // Filled in on the sim
-            request.AgentData.Godlike = false; // Filled in on the sim
-            request.NameData.Name = Helpers.StringToField(regionName.ToLower());
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="layer"></param>
-        /// <param name="minX"></param>
-        /// <param name="minY"></param>
-        /// <param name="maxX"></param>
-        /// <param name="maxY"></param>
-        /// <param name="returnNonExistent"></param>
-        public void RequestMapBlocks(GridLayerType layer, ushort minX, ushort minY, ushort maxX, ushort maxY,
-            bool returnNonExistent)
-        {
-            MapBlockRequestPacket request = new MapBlockRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.AgentData.Flags = (uint)layer;
-            request.AgentData.Flags |= (uint)(returnNonExistent ? 0x10000 : 0);
-            request.AgentData.EstateID = 0; // Filled in at the simulator
-            request.AgentData.Godlike = false; // Filled in at the simulator
-
-            request.PositionData.MinX = minX;
-            request.PositionData.MinY = minY;
-            request.PositionData.MaxX = maxX;
-            request.PositionData.MaxY = maxY;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="item"></param>
-        /// <param name="layer"></param>
-        /// <param name="timeoutMS"></param>
-        /// <returns></returns>
-        public List<GridItem> MapItems(ulong regionHandle, GridItemType item, GridLayerType layer, int timeoutMS)
-        {
-            List<GridItem> itemList = null;
-            AutoResetEvent itemsEvent = new AutoResetEvent(false);
-
-            GridItemsCallback callback =
-                delegate(GridItemType type, List<GridItem> items)
-                {
-                    if (type == GridItemType.AgentLocations)
-                    {
-                        itemList = items;
-                        itemsEvent.Set();
-                    }
-                };
-
-            OnGridItems += callback;
-
-            RequestMapItems(regionHandle, item, layer);
-            itemsEvent.WaitOne(timeoutMS, false);
-
-            OnGridItems -= callback;
-
-            return itemList;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="item"></param>
-        /// <param name="layer"></param>
-        public void RequestMapItems(ulong regionHandle, GridItemType item, GridLayerType layer)
-        {
-            MapItemRequestPacket request = new MapItemRequestPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.AgentData.Flags = (uint)layer;
-            request.AgentData.Godlike = false; // Filled in on the sim
-            request.AgentData.EstateID = 0; // Filled in on the sim
-
-            request.RequestData.ItemType = (uint)item;
-            request.RequestData.RegionHandle = regionHandle;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        /// Request data for all mainland (Linden managed) simulators
-        /// </summary>
-        public void RequestMainlandSims(GridLayerType layer)
-        {
-            RequestMapBlocks(layer, 0, 0, 65535, 65535, false);
-        }
-
-        /// <summary>
-        /// Get grid region information using the region name, this function
-        /// will block until it can find the region or gives up
-        /// </summary>
-        /// <param name="name">Name of sim you're looking for</param>
-        /// <param name="layer">Layer that you are requesting</param>
-        /// <param name="region">Will contain a GridRegion for the sim you're
-        /// looking for if successful, otherwise an empty structure</param>
-        /// <returns>True if the GridRegion was successfully fetched, otherwise
-        /// false</returns>
-        public bool GetGridRegion(string name, GridLayerType layer, out GridRegion region)
-        {
-            if (String.IsNullOrEmpty(name))
-            {
-                Client.Log("GetGridRegion called with a null or empty region name", Helpers.LogLevel.Error);
-                region = new GridRegion();
-                return false;
-            }
-
-            // All lookups are done using lowercase sim names
-            name = name.ToLower();
-
-            if (Regions.ContainsKey(name))
-            {
-                // We already have this GridRegion structure
-                region = Regions[name];
-                return true;
-            }
-            else
-            {
-                AutoResetEvent regionEvent = new AutoResetEvent(false);
-                GridRegionCallback callback =
-                    delegate(GridRegion gridRegion)
-                    {
-                        if (gridRegion.Name == name)
-                            regionEvent.Set();
-                    };
-                OnGridRegion += callback;
-
-                RequestMapRegion(name, layer);
-                regionEvent.WaitOne(Client.Settings.MAP_REQUEST_TIMEOUT, false);
-
-                OnGridRegion -= callback;
-
-                if (Regions.ContainsKey(name))
-                {
-                    // The region was found after our request
-                    region = Regions[name];
-                    return true;
-                }
-                else
-                {
-                    Client.Log("Couldn't find region " + name, Helpers.LogLevel.Warning);
-                    region = new GridRegion();
-                    return false;
-                }
-            }
-        }
-
-        private void MapLayerResponseHandler(CapsClient client, LLSD result, Exception error)
-        {
-            LLSDMap body = (LLSDMap)result;
-            LLSDArray layerData = (LLSDArray)body["LayerData"];
-
-            if (OnGridLayer != null)
-            {
-                for (int i = 0; i < layerData.Count; i++)
-                {
-                    LLSDMap thisLayerData = (LLSDMap)layerData[i];
-
-                    GridLayer layer;
-                    layer.Bottom = thisLayerData["Bottom"].AsInteger();
-                    layer.Left = thisLayerData["Left"].AsInteger();
-                    layer.Top = thisLayerData["Top"].AsInteger();
-                    layer.Right = thisLayerData["Right"].AsInteger();
-                    layer.ImageID = thisLayerData["ImageID"].AsUUID();
-
-                    try { OnGridLayer(layer); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-
-            if (body.ContainsKey("MapBlocks"))
-            {
-                // TODO: At one point this will become activated
-                Client.Log("Got MapBlocks through CAPS, please finish this function!", Helpers.LogLevel.Error);
-            }
-        }
-
-        /// <summary>
-        /// Populate Grid info based on data from MapBlockReplyPacket
-        /// </summary>
-        /// <param name="packet">Incoming MapBlockReplyPacket packet</param>
-        /// <param name="simulator">Unused</param>
-        private void MapBlockReplyHandler(Packet packet, Simulator simulator)
-        {
-            MapBlockReplyPacket map = (MapBlockReplyPacket)packet;
-
-            foreach (MapBlockReplyPacket.DataBlock block in map.Data)
-            {
-                if (block.X != 0 && block.Y != 0)
-                {
-                    GridRegion region;
-
-                    region.X = block.X;
-                    region.Y = block.Y;
-                    region.Name = Helpers.FieldToUTF8String(block.Name);
-                    // RegionFlags seems to always be zero here?
-                    region.RegionFlags = (Simulator.RegionFlags)block.RegionFlags;
-                    region.WaterHeight = block.WaterHeight;
-                    region.Agents = block.Agents;
-                    region.Access = (Simulator.SimAccess)block.Access;
-                    region.MapImageID = block.MapImageID;
-                    region.RegionHandle = Helpers.UIntsToLong((uint)(region.X * 256), (uint)(region.Y * 256));
-
-                    lock (Regions)
-                    {
-                        Regions[region.Name.ToLower()] = region;
-                        RegionsByHandle[region.RegionHandle] = region;
-                    }
-
-                    if (OnGridRegion != null)
-                    {
-                        try { OnGridRegion(region); }
-                        catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-            }
-        }
-
-        private void MapItemReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGridItems != null)
-            {
-                MapItemReplyPacket reply = (MapItemReplyPacket)packet;
-                GridItemType type = (GridItemType)reply.RequestData.ItemType;
-                List<GridItem> items = new List<GridItem>();
-
-                for (int i = 0; i < reply.Data.Length; i++)
-                {
-                    string name = Helpers.FieldToUTF8String(reply.Data[i].Name);
-
-                    switch (type)
-                    {
-                        case GridItemType.AgentLocations:
-                            GridAgentLocation location = new GridAgentLocation();
-                            location.GlobalX = reply.Data[i].X;
-                            location.GlobalY = reply.Data[i].Y;
-                            location.Identifier = name;
-                            location.AvatarCount = reply.Data[i].Extra;
-
-                            items.Add(location);
-
-                            break;
-                        case GridItemType.Classified:
-                            //FIXME:
-                            Client.Log("FIXME", Helpers.LogLevel.Error);
-                            break;
-                        case GridItemType.LandForSale:
-                            //FIXME:
-                            Client.Log("FIXME", Helpers.LogLevel.Error);
-                            break;
-                        case GridItemType.MatureEvent:
-                        case GridItemType.PgEvent:
-                            //FIXME:
-                            Client.Log("FIXME", Helpers.LogLevel.Error);
-                            break;
-                        case GridItemType.Popular:
-                            //FIXME:
-                            Client.Log("FIXME", Helpers.LogLevel.Error);
-                            break;
-                        case GridItemType.Telehub:
-                            //FIXME:
-                            Client.Log("FIXME", Helpers.LogLevel.Error);
-                            break;
-                        default:
-                            Client.Log("Unknown map item type " + type, Helpers.LogLevel.Warning);
-                            break;
-                    }
-                }
-
-                try { OnGridItems(type, items); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        /// <summary>
-        /// Get sim time from the appropriate packet
-        /// </summary>
-        /// <param name="packet">Incoming SimulatorViewerTimeMessagePacket from SL</param>
-        /// <param name="simulator">Unused</param>
-        private void TimeMessageHandler(Packet packet, Simulator simulator)
-        {
-            SimulatorViewerTimeMessagePacket time = (SimulatorViewerTimeMessagePacket)packet;
-
-            sunPhase = time.TimeInfo.SunPhase;
-            sunDirection = time.TimeInfo.SunDirection;
-            sunAngVelocity = time.TimeInfo.SunAngVelocity;
-
-            // TODO: Does anyone have a use for the time stuff?
-        }
-
-        private void CoarseLocationHandler(Packet packet, Simulator simulator)
-        {
-            CoarseLocationUpdatePacket coarse = (CoarseLocationUpdatePacket)packet;
-
-            lock (simulator.avatarPositions)
-            {
-                simulator.avatarPositions.Clear();
-
-                for (int i = 0; i < coarse.Location.Length; i++)
-                {
-                    if (i == coarse.Index.You)
-                    {
-                        simulator.positionIndexYou = i;
-                    }
-                    else if (i == coarse.Index.Prey)
-                    {
-                        simulator.positionIndexPrey = i;
-                    }
-                    simulator.avatarPositions.Add(new LLVector3(coarse.Location[i].X, coarse.Location[i].Y,
-                        coarse.Location[i].Z));
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/GroupManager.cs b/old/libsl1550/libsecondlife/GroupManager.cs
deleted file mode 100644
index 225b528..0000000
--- a/old/libsl1550/libsecondlife/GroupManager.cs
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    #region Structs
-
-    /// <summary>
-    /// Avatar group management
-    /// </summary>
-    public struct GroupMember
-    {
-        /// <summary>Key of Group Member</summary>
-        public LLUUID ID;
-        /// <summary>Total land contribution</summary>
-        public int Contribution;
-        /// <summary>Online status information</summary>
-        public string OnlineStatus;
-        /// <summary>Abilities that the Group Member has</summary>
-        public GroupPowers Powers;
-        /// <summary>Current group title</summary>
-        public string Title;
-        /// <summary>Is a group owner</summary>
-        public bool IsOwner;
-    }
-
-    /// <summary>
-    /// Role manager for a group
-    /// </summary>
-    public struct GroupRole
-    {
-        /// <summary>Key of Role</summary>
-        public LLUUID ID;
-        /// <summary>Name of Role</summary>
-        public string Name;
-        /// <summary>Group Title associated with Role</summary>
-        public string Title;
-        /// <summary>Description of Role</summary>
-        public string Description;
-        /// <summary>Abilities Associated with Role</summary>
-        public GroupPowers Powers;
-        /// <summary>
-        /// Returns the role's title
-        /// </summary>
-        /// <returns>The role's title</returns>
-        public override string ToString()
-        {
-            return Name;
-        }
-    }
-
-    /// <summary>
-    /// Class to represent Group Title
-    /// </summary>
-    public struct GroupTitle
-    {
-        /// <summary>Group Title</summary>
-        public string Title;
-        /// <summary>Whether title is Active</summary>
-        public bool Selected;
-    }
-
-    /// <summary>
-    /// Represents a group in Second Life
-    /// </summary>
-    public struct Group
-    {
-        /// <summary>Key of Group</summary>
-        public LLUUID ID;
-        /// <summary>Key of Group Insignia</summary>
-        public LLUUID InsigniaID;
-        /// <summary>Key of Group Founder</summary>
-        public LLUUID FounderID;
-        /// <summary>Key of Group Role for Owners</summary>
-        public LLUUID OwnerRole;
-        /// <summary>Name of Group</summary>
-        public string Name;
-        /// <summary>Text of Group Charter</summary>
-        public string Charter;
-        /// <summary>Title of "everyone" role</summary>
-        public string MemberTitle;
-        /// <summary>Is the group open for enrolement to everyone</summary>
-        public bool OpenEnrollment;
-        /// <summary>Will group show up in search</summary>
-        public bool ShowInList;
-        /// <summary></summary>
-        public GroupPowers Powers;
-        /// <summary></summary>
-        public bool AcceptNotices;
-        /// <summary></summary>
-        public bool AllowPublish;
-        /// <summary>Is the group Mature</summary>
-        public bool MaturePublish;
-        /// <summary>Cost of group membership</summary>
-        public int MembershipFee;
-        /// <summary></summary>
-        public int Money;
-        /// <summary></summary>
-        public int Contribution;
-        /// <summary></summary>
-        public int GroupMembershipCount;
-        /// <summary></summary>
-        public int GroupRolesCount;
-
-        /// <summary>
-        /// Returns the name of the group
-        /// </summary>
-        /// <returns></returns>
-        public override string ToString()
-        {
-            return Name;
-        }
-    }
-
-    /// <summary>
-    /// Profile of a group
-    /// </summary>
-    public struct GroupProfile
-    {
-        /// <summary></summary>
-        public LLUUID ID;
-        /// <summary>Key of Group Insignia</summary>
-        public LLUUID InsigniaID;
-        /// <summary>Key of Group Founder</summary>
-        public LLUUID FounderID;
-        /// <summary>Key of Group Role for Owners</summary>
-        public LLUUID OwnerRole;
-        /// <summary>Name of Group</summary>
-        public string Name;
-        /// <summary>Text of Group Charter</summary>
-        public string Charter;
-        /// <summary></summary>
-        public string MemberTitle;
-        /// <summary></summary>
-        public bool OpenEnrollment;
-        /// <summary></summary>
-        public bool ShowInList;
-        /// <summary></summary>
-        public GroupPowers Powers;
-        /// <summary></summary>
-        public bool AcceptNotices;
-        /// <summary></summary>
-        public bool AllowPublish;
-        /// <summary></summary>
-        public bool MaturePublish;
-        /// <summary></summary>
-        public int MembershipFee;
-        /// <summary></summary>
-        public int Money;
-        /// <summary></summary>
-        public int Contribution;
-        /// <summary></summary>
-        public int GroupMembershipCount;
-        /// <summary></summary>
-        public int GroupRolesCount;
-    }
-
-    /// <summary>
-    /// A group Vote
-    /// </summary>
-    public struct Vote
-    {
-        /// <summary>Key of Avatar who created Vote</summary>
-        public LLUUID Candidate;
-        /// <summary>Text of the Vote proposal</summary>
-        public string VoteString;
-        /// <summary>Total number of votes</summary>
-        public int NumVotes;
-    }
-
-    public struct GroupProposal
-    {
-
-        public string VoteText;
-
-        public int Quorum;
-
-        public float Majority;
-
-        public int Duration;
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public struct GroupAccountSummary
-    {
-        /// <summary></summary>
-        public int IntervalDays;
-        /// <summary></summary>
-        public int CurrentInterval;
-        /// <summary></summary>
-        public string StartDate;
-        /// <summary></summary>
-        public int Balance;
-        /// <summary></summary>
-        public int TotalCredits;
-        /// <summary></summary>
-        public int TotalDebits;
-        /// <summary></summary>
-        public int ObjectTaxCurrent;
-        /// <summary></summary>
-        public int LightTaxCurrent;
-        /// <summary></summary>
-        public int LandTaxCurrent;
-        /// <summary></summary>
-        public int GroupTaxCurrent;
-        /// <summary></summary>
-        public int ParcelDirFeeCurrent;
-        /// <summary></summary>
-        public int ObjectTaxEstimate;
-        /// <summary></summary>
-        public int LightTaxEstimate;
-        /// <summary></summary>
-        public int LandTaxEstimate;
-        /// <summary></summary>
-        public int GroupTaxEstimate;
-        /// <summary></summary>
-        public int ParcelDirFeeEstimate;
-        /// <summary></summary>
-        public int NonExemptMembers;
-        /// <summary></summary>
-        public string LastTaxDate;
-        /// <summary></summary>
-        public string TaxDate;
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public struct GroupAccountDetails
-    {
-        /// <summary></summary>
-        public int IntervalDays;
-        /// <summary></summary>
-        public int CurrentInterval;
-        /// <summary></summary>
-        public string StartDate;
-        /// <summary>A list of description/amount pairs making up the account
-        /// history</summary>
-        public List<KeyValuePair<string, int>> HistoryItems;
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public struct GroupAccountTransactions
-    {
-        /// <summary></summary>
-        public int IntervalDays;
-        /// <summary></summary>
-        public int CurrentInterval;
-        /// <summary></summary>
-        public string StartDate;
-        /// <summary>List of all the transactions for this group</summary>
-        public List<Transaction> Transactions;
-    }
-
-    /// <summary>
-    /// A single transaction made by a group
-    /// </summary>
-    public struct Transaction
-    {
-        /// <summary></summary>
-        public string Time;
-        /// <summary></summary>
-        public string User;
-        /// <summary></summary>
-        public int Type;
-        /// <summary></summary>
-        public string Item;
-        /// <summary></summary>
-        public int Amount;
-    }
-
-    /// <summary>
-    /// Struct representing a group notice
-    /// </summary>
-    public struct GroupNotice
-    {
-        /// <summary></summary>
-        public string Subject;
-        /// <summary></summary>
-        public string Message;
-        /// <summary></summary>
-        public LLUUID AttachmentID;
-        /// <summary></summary>
-        public LLUUID OwnerID;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public byte[] SerializeAttachment()
-        {
-            if (OwnerID == null || OwnerID == LLUUID.Zero || AttachmentID == null || AttachmentID == LLUUID.Zero)
-                return new byte[0];
-            //I guess this is how this works, no gaurentees
-            string lsd = "<llsd><item_id>" + AttachmentID.ToString() + "</item_id><owner_id>"
-                + OwnerID.ToString() + "</owner_id></llsd>";
-            return Helpers.StringToField(lsd);
-        }
-    }
-
-    #endregion Structs
-
-    #region Enums
-
-    /// <summary>
-    /// Role update flags
-    /// </summary>
-    public enum GroupRoleUpdate : uint
-    {
-        NoUpdate,
-        UpdateData,
-        UpdatePowers,
-        UpdateAll,
-        Create,
-        Delete
-    }
-
-    /// <summary>
-    /// Group role powers flags
-    /// </summary>
-    [Flags]
-    public enum GroupRolePowers : long
-    {
-        None = 0,
-        Invite = 1 << 1,
-        Eject = 1 << 2,
-        ChangeOptions = 1 << 3,
-        CreateRole = 1 << 4,
-        DeleteRole = 1 << 5,
-        RoleProperties = 1 << 6,
-        AssignMemberLimited = 1 << 7,
-        AssignMember = 1 << 8,
-        RemoveMember = 1 << 9,
-        ChangeActions = 1 << 10,
-        ChangeIdentity = 1 << 11,
-        LandDeed = 1 << 12,
-        LandRelease = 1 << 13,
-        LandSetSale = 1 << 14,
-        LandDevideJoin = 1 << 15,
-        FindPlaces = 1 << 17,
-        LandChangeIdentity = 1 << 18,
-        SetLandingPoint = 1 << 19,
-        ChangeMedia = 1 << 20,
-        LandEdit = 1 << 21,
-        LandOptions = 1 << 22,
-        AllowEditLand = 1 << 23,
-        AllowFly = 1 << 24,
-        AllowRez = 1 << 25,
-        AllowLandmark = 1 << 26,
-        AllowSetHome = 1 << 28,
-        LandManageAllowed = 1 << 29,
-        LandManageBanned = 1 << 30,
-        LandManagePasses = 1 << 31,
-        LandEjectAndFreeze = 1 << 32,
-        ReturnGroupOwned = 1 << 48,
-        ReturnGroupSet = 1 << 33,
-        ReturnNonGroup = 1 << 34,
-        LandGardening = 1 << 35,
-        DeedObject = 1 << 36,
-        ObjectManipulate = 1 << 38,
-        ObjectSetForSale = 1 << 39,
-        Accountable = 1 << 40,
-        SendNotices = 1 << 42,
-        ReceiveNotices = 1 << 43,
-        StartProposal = 1 << 44,
-        VoteOnProposal = 1 << 45
-    }
-
-    [Flags]
-    public enum GroupPowers : ulong
-    {
-        MemberInvite = 2,
-        MemberEject = 4,
-        MemberOptions = 8,
-        MemberVisibleInDir = 140737488355328,
-        RoleCreate = 16,
-        RoleDelete = 32,
-        RoleProperties = 64,
-        RoleAssignMemberLimited = 128,
-        RoleAssignMember = 256,
-        RoleRemoveMember = 512,
-        RoleChangeActions = 1024,
-        GroupChangeIdentity = 2048,
-        LandDeed = 4096,
-        LandRelease = 8192,
-        LandSetSaleInfo = 16384,
-        LandDivideJoin = 32768,
-        LandFindPlaces = 131072,
-        LandChangeIdentity = 262144,
-        LandSetLandingPoint = 524288,
-        LandChangeMedia = 1048576,
-        LandEdit = 2097152,
-        LandOptions = 4194304,
-        LandAllowEditLand = 8388608,
-        LandAllowFly = 16777216,
-        LandAllowCreate = 33554432,
-        LandAllowLandmark = 67108864,
-        LandAllowSetHome = 268435456,
-        LandManageAllowed = 536870912,
-        LandManageBanned = 1073741824,
-        LandManagePasses = 2147483648,
-        LandAdmin = 4294967296,
-        LandReturnGroupOwned = 281474976710656,
-        LandReturnGroupSet = 8589934592,
-        LandReturnNonGroup = 17179869184,
-        LandReturn = LandReturnGroupOwned | LandReturnGroupSet | LandReturnNonGroup,
-        LandGardening = 34359738368,
-        ObjectDeed = 68719476736,
-        ObjectManipulate = 274877906944,
-        ObjectSetSale = 549755813888,
-        AccountingAccountable = 1099511627776,
-        NoticesSend = 4398046511104,
-        NoticesReceive = 8796093022208,
-        ProposalStart = 17592186044416,
-        ProposalVote = 35184372088832
-    }
-
-    #endregion Enums
-
-    /// <summary>
-    /// Handles all network traffic related to reading and writing group
-    /// information
-    /// </summary>
-    public class GroupManager
-    {
-        #region Delegates
-
-        /// <summary>
-        /// Callback for the list of groups the avatar is currently a member of
-        /// </summary>
-        /// <param name="groups"></param>
-        public delegate void CurrentGroupsCallback(Dictionary<LLUUID, Group> groups);
-        /// <summary>
-        /// Callback for the profile of a group
-        /// </summary>
-        /// <param name="group"></param>
-        public delegate void GroupProfileCallback(GroupProfile group);
-        /// <summary>
-        /// Callback for the member list of a group
-        /// </summary>
-        /// <param name="members"></param>
-        public delegate void GroupMembersCallback(Dictionary<LLUUID, GroupMember> members);
-        /// <summary>
-        /// Callback for the role list of a group
-        /// </summary>
-        /// <param name="roles"></param>
-        public delegate void GroupRolesCallback(Dictionary<LLUUID, GroupRole> roles);
-        /// <summary>
-        /// Callback for a pairing of roles to members
-        /// </summary>
-        /// <param name="rolesMembers"></param>
-        public delegate void GroupRolesMembersCallback(List<KeyValuePair<LLUUID, LLUUID>> rolesMembers);
-        /// <summary>
-        /// Callback for the title list of a group
-        /// </summary>
-        /// <param name="titles"></param>
-        public delegate void GroupTitlesCallback(Dictionary<LLUUID, GroupTitle> titles);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="summary"></param>
-        public delegate void GroupAccountSummaryCallback(GroupAccountSummary summary);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="details"></param>
-        public delegate void GroupAccountDetailsCallback(GroupAccountDetails details);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="transactions"></param>
-        public delegate void GroupAccountTransactionsCallback(GroupAccountTransactions transactions);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="groupID"></param>
-        /// <param name="success"></param>
-        /// <param name="message"></param>
-        public delegate void GroupCreatedCallback(LLUUID groupID, bool success, string message);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="groupID"></param>
-        /// <param name="success"></param>
-        public delegate void GroupJoinedCallback(LLUUID groupID, bool success);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="groupID"></param>
-        /// <param name="success"></param>
-        public delegate void GroupLeftCallback(LLUUID groupID, bool success);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="groupID"></param>
-        public delegate void GroupDroppedCallback(LLUUID groupID);
-
-        #endregion Delegates
-
-        #region Events
-
-        /// <summary></summary>
-        public event CurrentGroupsCallback OnCurrentGroups;
-        /// <summary></summary>
-        public event GroupProfileCallback OnGroupProfile;
-        /// <summary></summary>
-        public event GroupMembersCallback OnGroupMembers;
-        /// <summary></summary>
-        public event GroupRolesCallback OnGroupRoles;
-        /// <summary></summary>
-        public event GroupRolesMembersCallback OnGroupRolesMembers;
-        /// <summary></summary>
-        public event GroupTitlesCallback OnGroupTitles;
-        /// <summary></summary>
-        public event GroupAccountSummaryCallback OnGroupAccountSummary;
-        /// <summary></summary>
-        public event GroupAccountDetailsCallback OnGroupAccountDetails;
-        /// <summary></summary>
-        public event GroupCreatedCallback OnGroupCreated;
-        /// <summary></summary>
-        public event GroupJoinedCallback OnGroupJoined;
-        /// <summary></summary>
-        public event GroupLeftCallback OnGroupLeft;
-        /// <summary></summary>
-        public event GroupDroppedCallback OnGroupDropped;
-
-        #endregion Events
-
-
-        private SecondLife Client;
-        /// <summary>A list of all the lists of group members, indexed by the request ID</summary>
-        private Dictionary<LLUUID, Dictionary<LLUUID, GroupMember>> GroupMembersCaches;
-        /// <summary>A list of all the lists of group roles, indexed by the request ID</summary>
-        private Dictionary<LLUUID, Dictionary<LLUUID, GroupRole>> GroupRolesCaches;
-        /// <summary>A list of all the role to member mappings</summary>
-        private Dictionary<LLUUID, List<KeyValuePair<LLUUID, LLUUID>>> GroupRolesMembersCaches;
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="client"></param>
-        public GroupManager(SecondLife client)
-        {
-            Client = client;
-
-            GroupMembersCaches = new Dictionary<LLUUID, Dictionary<LLUUID, GroupMember>>();
-            GroupRolesCaches = new Dictionary<LLUUID, Dictionary<LLUUID, GroupRole>>();
-            GroupRolesMembersCaches = new Dictionary<LLUUID, List<KeyValuePair<LLUUID, LLUUID>>>();
-
-            Client.Network.RegisterCallback(PacketType.AgentGroupDataUpdate, new NetworkManager.PacketCallback(GroupDataHandler));
-            Client.Network.RegisterCallback(PacketType.AgentDropGroup, new NetworkManager.PacketCallback(AgentDropGroupHandler));
-            Client.Network.RegisterCallback(PacketType.GroupTitlesReply, new NetworkManager.PacketCallback(GroupTitlesHandler));
-            Client.Network.RegisterCallback(PacketType.GroupProfileReply, new NetworkManager.PacketCallback(GroupProfileHandler));
-            Client.Network.RegisterCallback(PacketType.GroupMembersReply, new NetworkManager.PacketCallback(GroupMembersHandler));
-            Client.Network.RegisterCallback(PacketType.GroupRoleDataReply, new NetworkManager.PacketCallback(GroupRoleDataHandler));
-            Client.Network.RegisterCallback(PacketType.GroupRoleMembersReply, new NetworkManager.PacketCallback(GroupRoleMembersHandler));
-            Client.Network.RegisterCallback(PacketType.GroupActiveProposalItemReply, new NetworkManager.PacketCallback(GroupActiveProposalItemHandler));
-            Client.Network.RegisterCallback(PacketType.GroupVoteHistoryItemReply, new NetworkManager.PacketCallback(GroupVoteHistoryItemHandler));
-            Client.Network.RegisterCallback(PacketType.GroupAccountSummaryReply, new NetworkManager.PacketCallback(GroupAccountSummaryHandler));
-            Client.Network.RegisterCallback(PacketType.GroupAccountDetailsReply, new NetworkManager.PacketCallback(GroupAccountDetailsHandler));
-            Client.Network.RegisterCallback(PacketType.GroupAccountTransactionsReply, new NetworkManager.PacketCallback(GroupAccountTransactionsHandler));
-            Client.Network.RegisterCallback(PacketType.CreateGroupReply, new NetworkManager.PacketCallback(CreateGroupReplyHandler));
-            Client.Network.RegisterCallback(PacketType.JoinGroupReply, new NetworkManager.PacketCallback(JoinGroupReplyHandler));
-            Client.Network.RegisterCallback(PacketType.LeaveGroupReply, new NetworkManager.PacketCallback(LeaveGroupReplyHandler));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void RequestCurrentGroups()
-        {
-            AgentDataUpdateRequestPacket request = new AgentDataUpdateRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="group"></param>
-        public void RequestGroupProfile(LLUUID group)
-        {
-            GroupProfileRequestPacket request = new GroupProfileRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.GroupData.GroupID = group;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="group"></param>
-        public void RequestGroupMembers(LLUUID group)
-        {
-            LLUUID requestID = LLUUID.Random();
-            lock (GroupMembersCaches) GroupMembersCaches[requestID] = new Dictionary<LLUUID, GroupMember>();
-
-            GroupMembersRequestPacket request = new GroupMembersRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.GroupData.GroupID = group;
-            request.GroupData.RequestID = requestID;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="group"></param>
-        public void RequestGroupRoles(LLUUID group)
-        {
-            LLUUID requestID = LLUUID.Random();
-            lock (GroupRolesCaches) GroupRolesCaches[requestID] = new Dictionary<LLUUID, GroupRole>();
-
-            GroupRoleDataRequestPacket request = new GroupRoleDataRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.GroupData.GroupID = group;
-            request.GroupData.RequestID = requestID;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="group"></param>
-        public void RequestGroupRoleMembers(LLUUID group)
-        {
-            LLUUID requestID = LLUUID.Random();
-            lock (GroupRolesMembersCaches)
-            {
-                GroupRolesMembersCaches[requestID] = new List<KeyValuePair<LLUUID, LLUUID>>();
-            }
-
-            GroupRoleMembersRequestPacket request = new GroupRoleMembersRequestPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.GroupData.GroupID = group;
-            request.GroupData.RequestID = requestID;
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="group"></param>
-        public void RequestGroupTitles(LLUUID group)
-        {
-            LLUUID requestID = LLUUID.Random();
-
-            GroupTitlesRequestPacket request = new GroupTitlesRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.AgentData.GroupID = group;
-            request.AgentData.RequestID = requestID;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        /// Begin to get the group account summary
-        /// </summary>
-        /// <param name="group">The group's ID</param>
-        /// <param name="intervalDays">How long of an interval</param>
-        /// <param name="currentInterval">Which interval (0 for current, 1 for last)</param>
-        public void RequestGroupAccountSummary(LLUUID group, int intervalDays, int currentInterval)
-        {
-            GroupAccountSummaryRequestPacket p = new GroupAccountSummaryRequestPacket();
-            p.AgentData.AgentID = Client.Self.AgentID;
-            p.AgentData.SessionID = Client.Self.SessionID;
-            p.AgentData.GroupID = group;
-            p.MoneyData.RequestID = LLUUID.Random();
-            p.MoneyData.CurrentInterval = currentInterval;
-            p.MoneyData.IntervalDays = intervalDays;
-            Client.Network.SendPacket(p);
-        }
-
-        /// <summary>
-        /// Invites a user to a group
-        /// </summary>
-        /// <param name="group">The group to invite to</param>
-        /// <param name="roles">A list of roles to invite a person to</param>
-        /// <param name="personkey">Key of person to invite</param>
-        public void Invite(LLUUID group, List<LLUUID> roles, LLUUID personkey)
-        {
-            InviteGroupRequestPacket igp = new InviteGroupRequestPacket();
-
-            igp.AgentData = new InviteGroupRequestPacket.AgentDataBlock();
-            igp.AgentData.AgentID = Client.Self.AgentID;
-            igp.AgentData.SessionID = Client.Self.SessionID;
-
-            igp.GroupData = new InviteGroupRequestPacket.GroupDataBlock();
-            igp.GroupData.GroupID = group;
-
-            igp.InviteData = new InviteGroupRequestPacket.InviteDataBlock[roles.Count];
-
-            for (int i = 0; i < roles.Count; i++)
-            {
-                igp.InviteData[i] = new InviteGroupRequestPacket.InviteDataBlock();
-                igp.InviteData[i].InviteeID = personkey;
-                igp.InviteData[i].RoleID = roles[i];
-            }
-
-            Client.Network.SendPacket(igp);
-        }
-
-        /// <summary>
-        /// Set a group as the current active group
-        /// </summary>
-        /// <param name="id"></param>
-        public void ActivateGroup(LLUUID id)
-        {
-            ActivateGroupPacket activate = new ActivateGroupPacket();
-            activate.AgentData.AgentID = Client.Self.AgentID;
-            activate.AgentData.SessionID = Client.Self.SessionID;
-            activate.AgentData.GroupID = id;
-
-            Client.Network.SendPacket(activate);
-        }
-
-        /// <summary>
-        /// Change the role that determines your active title
-        /// </summary>
-        /// <param name="group">Group to use</param>
-        /// <param name="role">Role to change to</param>
-        public void ActivateTitle(LLUUID group, LLUUID role)
-        {
-            GroupTitleUpdatePacket gtu = new GroupTitleUpdatePacket();
-            gtu.AgentData.AgentID = Client.Self.AgentID;
-            gtu.AgentData.SessionID = Client.Self.SessionID;
-            gtu.AgentData.TitleRoleID = role;
-            gtu.AgentData.GroupID = group;
-
-            Client.Network.SendPacket(gtu);
-        }
-
-        /// <summary>
-        /// Set this avatar's tier contribution
-        /// </summary>
-        /// <param name="group">Group to change tier in</param>
-        /// <param name="contribution">amount of tier to donate</param>
-        public void SetGroupContribution(LLUUID group, int contribution)
-        {
-            SetGroupContributionPacket sgp = new SetGroupContributionPacket();
-            sgp.AgentData.AgentID = Client.Self.AgentID;
-            sgp.AgentData.SessionID = Client.Self.SessionID;
-            sgp.Data.GroupID = group;
-            sgp.Data.Contribution = contribution;
-
-            Client.Network.SendPacket(sgp);
-        }
-
-        /// <summary>
-        /// Request to join a group
-        /// </summary>
-        /// <param name="id">Group ID to join</param>
-        public void RequestJoinGroup(LLUUID id)
-        {
-            JoinGroupRequestPacket join = new JoinGroupRequestPacket();
-            join.AgentData.AgentID = Client.Self.AgentID;
-            join.AgentData.SessionID = Client.Self.SessionID;
-
-            join.GroupData.GroupID = id;
-
-            Client.Network.SendPacket(join);
-        }
-
-        /// <summary>
-        /// Request to create a new group. If the group is successfully
-        /// created, L$100 will automatically be deducted
-        /// </summary>
-        /// <param name="group">Group struct containing the new group info</param>
-        public void RequestCreateGroup(Group group)
-        {
-            libsecondlife.Packets.CreateGroupRequestPacket cgrp = new CreateGroupRequestPacket();
-            //Fill in agent data
-            cgrp.AgentData = new CreateGroupRequestPacket.AgentDataBlock();
-            cgrp.AgentData.AgentID = Client.Self.AgentID;
-            cgrp.AgentData.SessionID = Client.Self.SessionID;
-            //Fill in group data
-            cgrp.GroupData = new CreateGroupRequestPacket.GroupDataBlock();
-            cgrp.GroupData.AllowPublish = group.AllowPublish;
-            cgrp.GroupData.Charter = Helpers.StringToField(group.Charter);
-            cgrp.GroupData.InsigniaID = group.InsigniaID;
-            cgrp.GroupData.MaturePublish = group.MaturePublish;
-            cgrp.GroupData.MembershipFee = group.MembershipFee;
-            cgrp.GroupData.Name = Helpers.StringToField(group.Name);
-            cgrp.GroupData.OpenEnrollment = group.OpenEnrollment;
-            cgrp.GroupData.ShowInList = group.ShowInList;
-            //Send it
-            Client.Network.SendPacket(cgrp);
-        }
-
-        /// <summary>
-        /// Update a group's profile and other information
-        /// </summary>
-        /// <param name="group">Group struct to update</param>
-        public void UpdateGroup(LLUUID id, Group group)
-        {
-            libsecondlife.Packets.UpdateGroupInfoPacket cgrp = new UpdateGroupInfoPacket();
-            //Fill in agent data
-            cgrp.AgentData = new UpdateGroupInfoPacket.AgentDataBlock();
-            cgrp.AgentData.AgentID = Client.Self.AgentID;
-            cgrp.AgentData.SessionID = Client.Self.SessionID;
-            //Fill in group data
-            cgrp.GroupData = new UpdateGroupInfoPacket.GroupDataBlock();
-            cgrp.GroupData.GroupID = id;
-            cgrp.GroupData.AllowPublish = group.AllowPublish;
-            cgrp.GroupData.Charter = Helpers.StringToField(group.Charter);
-            cgrp.GroupData.InsigniaID = group.InsigniaID;
-            cgrp.GroupData.MaturePublish = group.MaturePublish;
-            cgrp.GroupData.MembershipFee = group.MembershipFee;
-            cgrp.GroupData.OpenEnrollment = group.OpenEnrollment;
-            cgrp.GroupData.ShowInList = group.ShowInList;
-            //Send it
-            Client.Network.SendPacket(cgrp);
-        }
-
-        /// <summary>
-        /// Eject a user from a group
-        /// </summary>
-        /// <param name="group">Group to eject the user from</param>
-        /// <param name="member">Avatar's key to eject</param>
-        public void EjectUser(LLUUID group, LLUUID member)
-        {
-            libsecondlife.Packets.EjectGroupMemberRequestPacket eject = new EjectGroupMemberRequestPacket();
-            eject.AgentData = new EjectGroupMemberRequestPacket.AgentDataBlock();
-            eject.AgentData.AgentID = Client.Self.AgentID;
-            eject.AgentData.SessionID = Client.Self.SessionID;
-            //Group
-            eject.GroupData = new EjectGroupMemberRequestPacket.GroupDataBlock();
-            eject.GroupData.GroupID = group;
-            //People to eject
-            eject.EjectData = new EjectGroupMemberRequestPacket.EjectDataBlock[1];
-            eject.EjectData[0] = new EjectGroupMemberRequestPacket.EjectDataBlock();
-            eject.EjectData[0].EjecteeID = member;
-            //send it
-            Client.Network.SendPacket(eject);
-        }
-
-        /// <summary>
-        /// Update role information
-        /// </summary>
-        /// <param name="group">Group to update</param>
-        /// <param name="role">Role to update</param>
-        public void UpdateRole(LLUUID group, GroupRole role)
-        {
-            libsecondlife.Packets.GroupRoleUpdatePacket gru = new GroupRoleUpdatePacket();
-            gru.AgentData.AgentID = Client.Self.AgentID;
-            gru.AgentData.SessionID = Client.Self.SessionID;
-            gru.AgentData.GroupID = group;
-            gru.RoleData = new GroupRoleUpdatePacket.RoleDataBlock[1];
-            gru.RoleData[0].Name = Helpers.StringToField(role.Name);
-            gru.RoleData[0].Description = Helpers.StringToField(role.Description);
-            gru.RoleData[0].Powers = (ulong)role.Powers;
-            gru.RoleData[0].Title = Helpers.StringToField(role.Title);
-            gru.RoleData[0].UpdateType = (byte)GroupRoleUpdate.UpdateAll;
-            Client.Network.SendPacket(gru);
-        }
-
-        /// <summary>
-        /// Create a new role
-        /// </summary>
-        /// <param name="group">Group to update</param>
-        /// <param name="role">Role to create</param>
-        public void CreateRole(LLUUID group, GroupRole role)
-        {
-            libsecondlife.Packets.GroupRoleUpdatePacket gru = new GroupRoleUpdatePacket();
-            gru.AgentData.AgentID = Client.Self.AgentID;
-            gru.AgentData.SessionID = Client.Self.SessionID;
-            gru.AgentData.GroupID = group;
-            gru.RoleData = new GroupRoleUpdatePacket.RoleDataBlock[1];
-            gru.RoleData[0].Name = Helpers.StringToField(role.Name);
-            gru.RoleData[0].Description = Helpers.StringToField(role.Description);
-            gru.RoleData[0].Powers = (ulong)role.Powers;
-            gru.RoleData[0].Title = Helpers.StringToField(role.Title);
-            gru.RoleData[0].UpdateType = (byte)GroupRoleUpdate.Create;
-            Client.Network.SendPacket(gru);
-        }
-
-        /// <summary>
-        /// Remove an avatar from a role
-        /// </summary>
-        /// <param name="group">Group to update</param>
-        /// <param name="role">Role to be removed from</param>
-        /// <param name="member">Avatar to remove</param>
-        public void RemoveFromRole(LLUUID group, LLUUID role, LLUUID member)
-        {
-            libsecondlife.Packets.GroupRoleChangesPacket grc = new GroupRoleChangesPacket();
-            grc.AgentData.AgentID = Client.Self.AgentID;
-            grc.AgentData.SessionID = Client.Self.SessionID;
-            grc.AgentData.GroupID = group;
-            grc.RoleChange = new GroupRoleChangesPacket.RoleChangeBlock[1];
-            grc.RoleChange[0] = new GroupRoleChangesPacket.RoleChangeBlock();
-            //Add to members and role
-            grc.RoleChange[0].MemberID = member;
-            grc.RoleChange[0].RoleID = role;
-            //1 = Remove From Role
-            grc.RoleChange[0].Change = 1;
-            Client.Network.SendPacket(grc);
-        }
-
-        /// <summary>
-        /// Assign an avatar to a role
-        /// </summary>
-        /// <param name="group">Group to update</param>
-        /// <param name="role">Role to assign to</param>
-        /// <param name="member">Avatar to assign</param>
-        public void AddToRole(LLUUID group, LLUUID role, LLUUID member)
-        {
-            libsecondlife.Packets.GroupRoleChangesPacket grc = new GroupRoleChangesPacket();
-            grc.AgentData.AgentID = Client.Self.AgentID;
-            grc.AgentData.SessionID = Client.Self.SessionID;
-            grc.AgentData.GroupID = group;
-            grc.RoleChange = new GroupRoleChangesPacket.RoleChangeBlock[1];
-            grc.RoleChange[0] = new GroupRoleChangesPacket.RoleChangeBlock();
-            //Add to members and role
-            grc.RoleChange[0].MemberID = member;
-            grc.RoleChange[0].RoleID = role;
-            //0 = Add to Role
-            grc.RoleChange[0].Change = 0;
-            Client.Network.SendPacket(grc);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="group"></param>
-        /// <param name="notice"></param>
-        public void SendGroupNotice(LLUUID group, GroupNotice notice)
-        {
-            Client.Self.InstantMessage(Client.Self.Name, group, notice.Subject + "|" + notice.Message,
-                LLUUID.Zero, InstantMessageDialog.GroupNotice, InstantMessageOnline.Online,
-                LLVector3.Zero, LLUUID.Zero, notice.SerializeAttachment());
-        }
-
-        /// <summary>
-        /// Start a group proposal (vote)
-        /// </summary>
-        /// <param name="group">The group to send it to</param>
-        /// <param name="prop">The proposal to start</param>
-        public void StartProposal(LLUUID group, GroupProposal prop)
-        {
-            StartGroupProposalPacket p = new StartGroupProposalPacket();
-            p.AgentData.AgentID = Client.Self.AgentID;
-            p.AgentData.SessionID = Client.Self.SessionID;
-            p.ProposalData.GroupID = group;
-            p.ProposalData.ProposalText = Helpers.StringToField(prop.VoteText);
-            p.ProposalData.Quorum = prop.Quorum;
-            p.ProposalData.Majority = prop.Majority;
-            p.ProposalData.Duration = prop.Duration;
-            Client.Network.SendPacket(p);
-        }
-
-        /// <summary>
-        /// Request to leave a group
-        /// </summary>
-        /// <param name="groupID">The group to leave</param>
-        public void LeaveGroup(LLUUID groupID)
-        {
-            LeaveGroupRequestPacket p = new LeaveGroupRequestPacket();
-            p.AgentData.AgentID = Client.Self.AgentID;
-            p.AgentData.SessionID = Client.Self.SessionID;
-            p.GroupData.GroupID = groupID;
-            Client.Network.SendPacket(p);
-        }
-
-        #region Packet Handlers
-
-        private void GroupDataHandler(Packet packet, Simulator simulator)
-        {
-            if (OnCurrentGroups != null)
-            {
-                AgentGroupDataUpdatePacket update = (AgentGroupDataUpdatePacket)packet;
-
-                Dictionary<LLUUID, Group> currentGroups = new Dictionary<LLUUID, Group>();
-
-                foreach (AgentGroupDataUpdatePacket.GroupDataBlock block in update.GroupData)
-                {
-                    Group group = new Group();
-
-                    group.ID = block.GroupID;
-                    group.InsigniaID = block.GroupInsigniaID;
-                    group.Name = Helpers.FieldToUTF8String(block.GroupName);
-                    group.Powers = (GroupPowers)block.GroupPowers;
-                    group.Contribution = block.Contribution;
-                    group.AcceptNotices = block.AcceptNotices;
-
-                    currentGroups[block.GroupID] = group;
-                }
-
-                try { OnCurrentGroups(currentGroups); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void AgentDropGroupHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGroupDropped != null)
-            {
-                try { OnGroupDropped(((AgentDropGroupPacket)packet).AgentData.GroupID); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void GroupProfileHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGroupProfile != null)
-            {
-                GroupProfileReplyPacket profile = (GroupProfileReplyPacket)packet;
-                GroupProfile group = new GroupProfile();
-
-                group.ID = profile.GroupData.GroupID;
-                group.AllowPublish = profile.GroupData.AllowPublish;
-                group.Charter = Helpers.FieldToUTF8String(profile.GroupData.Charter);
-                group.FounderID = profile.GroupData.FounderID;
-                group.GroupMembershipCount = profile.GroupData.GroupMembershipCount;
-                group.GroupRolesCount = profile.GroupData.GroupRolesCount;
-                group.InsigniaID = profile.GroupData.InsigniaID;
-                group.MaturePublish = profile.GroupData.MaturePublish;
-                group.MembershipFee = profile.GroupData.MembershipFee;
-                group.MemberTitle = Helpers.FieldToUTF8String(profile.GroupData.MemberTitle);
-                group.Money = profile.GroupData.Money;
-                group.Name = Helpers.FieldToUTF8String(profile.GroupData.Name);
-                group.OpenEnrollment = profile.GroupData.OpenEnrollment;
-                group.OwnerRole = profile.GroupData.OwnerRole;
-                group.Powers = (GroupPowers)profile.GroupData.PowersMask;
-                group.ShowInList = profile.GroupData.ShowInList;
-
-                try { OnGroupProfile(group); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void GroupTitlesHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGroupTitles != null)
-            {
-                GroupTitlesReplyPacket titles = (GroupTitlesReplyPacket)packet;
-                Dictionary<LLUUID, GroupTitle> groupTitleCache = new Dictionary<LLUUID, GroupTitle>();
-
-                foreach (GroupTitlesReplyPacket.GroupDataBlock block in titles.GroupData)
-                {
-                    GroupTitle groupTitle = new GroupTitle();
-
-                    groupTitle.Title = Helpers.FieldToUTF8String(block.Title);
-                    groupTitle.Selected = block.Selected;
-
-                    groupTitleCache[block.RoleID] = groupTitle;
-                }
-
-                try { OnGroupTitles(groupTitleCache); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void GroupMembersHandler(Packet packet, Simulator simulator)
-        {
-            GroupMembersReplyPacket members = (GroupMembersReplyPacket)packet;
-            Dictionary<LLUUID, GroupMember> groupMemberCache = null;
-
-            lock (GroupMembersCaches)
-            {
-                // If nothing is registered to receive this RequestID drop the data
-                if (GroupMembersCaches.ContainsKey(members.GroupData.RequestID))
-                {
-                    groupMemberCache = GroupMembersCaches[members.GroupData.RequestID];
-
-                    foreach (GroupMembersReplyPacket.MemberDataBlock block in members.MemberData)
-                    {
-                        GroupMember groupMember = new GroupMember();
-
-                        groupMember.ID = block.AgentID;
-                        groupMember.Contribution = block.Contribution;
-                        groupMember.IsOwner = block.IsOwner;
-                        groupMember.OnlineStatus = Helpers.FieldToUTF8String(block.OnlineStatus);
-                        groupMember.Powers = (GroupPowers)block.AgentPowers;
-                        groupMember.Title = Helpers.FieldToUTF8String(block.Title);
-
-                        groupMemberCache[block.AgentID] = groupMember;
-                    }
-                }
-            }
-
-            // Check if we've received all the group members that are showing up
-            if (OnGroupMembers != null && groupMemberCache != null && groupMemberCache.Count >= members.GroupData.MemberCount)
-            {
-                try { OnGroupMembers(groupMemberCache); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void GroupRoleDataHandler(Packet packet, Simulator simulator)
-        {
-            GroupRoleDataReplyPacket roles = (GroupRoleDataReplyPacket)packet;
-            Dictionary<LLUUID, GroupRole> groupRoleCache = null;
-
-            lock (GroupRolesCaches)
-            {
-                // If nothing is registered to receive this RequestID drop the data
-                if (GroupRolesCaches.ContainsKey(roles.GroupData.RequestID))
-                {
-                    groupRoleCache = GroupRolesCaches[roles.GroupData.RequestID];
-
-                    foreach (GroupRoleDataReplyPacket.RoleDataBlock block in roles.RoleData)
-                    {
-                        GroupRole groupRole = new GroupRole();
-
-                        groupRole.ID = block.RoleID;
-                        groupRole.Description = Helpers.FieldToUTF8String(block.Description);
-                        groupRole.Name = Helpers.FieldToUTF8String(block.Name);
-                        groupRole.Powers = (GroupPowers)block.Powers;
-                        groupRole.Title = Helpers.FieldToUTF8String(block.Title);
-
-                        groupRoleCache[block.RoleID] = groupRole;
-                    }
-                }
-            }
-
-            // Check if we've received all the group members that are showing up
-            if (OnGroupRoles != null && groupRoleCache != null && groupRoleCache.Count >= roles.GroupData.RoleCount)
-            {
-                try { OnGroupRoles(groupRoleCache); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void GroupRoleMembersHandler(Packet packet, Simulator simulator)
-        {
-            GroupRoleMembersReplyPacket members = (GroupRoleMembersReplyPacket)packet;
-            List<KeyValuePair<LLUUID, LLUUID>> groupRoleMemberCache = null;
-
-            try
-            {
-                lock (GroupRolesMembersCaches)
-                {
-                    // If nothing is registered to receive this RequestID drop the data
-                    if (GroupRolesMembersCaches.ContainsKey(members.AgentData.RequestID))
-                    {
-                        groupRoleMemberCache = GroupRolesMembersCaches[members.AgentData.RequestID];
-
-                        foreach (GroupRoleMembersReplyPacket.MemberDataBlock block in members.MemberData)
-                        {
-                            KeyValuePair<LLUUID, LLUUID> rolemember =
-                                new KeyValuePair<LLUUID, LLUUID>(block.RoleID, block.MemberID);
-
-                            groupRoleMemberCache.Add(rolemember);
-                        }
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                Client.Log(e.ToString(), Helpers.LogLevel.Error);
-            }
-
-            //Client.DebugLog("Pairs Ratio: " + groupRoleMemberCache.Count + "/" + members.AgentData.TotalPairs);
-
-            // Check if we've received all the pairs that are showing up
-            if (OnGroupRolesMembers != null && groupRoleMemberCache != null && groupRoleMemberCache.Count >= members.AgentData.TotalPairs)
-            {
-                try { OnGroupRolesMembers(groupRoleMemberCache); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void GroupActiveProposalItemHandler(Packet packet, Simulator simulator)
-        {
-            //GroupActiveProposalItemReplyPacket proposal = (GroupActiveProposalItemReplyPacket)packet;
-
-            // TODO: Create a proposal struct to represent the fields in a proposal item
-        }
-
-        private void GroupVoteHistoryItemHandler(Packet packet, Simulator simulator)
-        {
-            //GroupVoteHistoryItemReplyPacket history = (GroupVoteHistoryItemReplyPacket)packet;
-
-            // TODO: This was broken in the official viewer when I was last trying to work  on it
-        }
-
-        private void GroupAccountSummaryHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGroupAccountSummary != null)
-            {
-                GroupAccountSummaryReplyPacket summary = (GroupAccountSummaryReplyPacket)packet;
-                GroupAccountSummary account = new GroupAccountSummary();
-
-                account.Balance = summary.MoneyData.Balance;
-                account.CurrentInterval = summary.MoneyData.CurrentInterval;
-                account.GroupTaxCurrent = summary.MoneyData.GroupTaxCurrent;
-                account.GroupTaxEstimate = summary.MoneyData.GroupTaxEstimate;
-                account.IntervalDays = summary.MoneyData.IntervalDays;
-                account.LandTaxCurrent = summary.MoneyData.LandTaxCurrent;
-                account.LandTaxEstimate = summary.MoneyData.LandTaxEstimate;
-                account.LastTaxDate = Helpers.FieldToUTF8String(summary.MoneyData.LastTaxDate);
-                account.LightTaxCurrent = summary.MoneyData.LightTaxCurrent;
-                account.LightTaxEstimate = summary.MoneyData.LightTaxEstimate;
-                account.NonExemptMembers = summary.MoneyData.NonExemptMembers;
-                account.ObjectTaxCurrent = summary.MoneyData.ObjectTaxCurrent;
-                account.ObjectTaxEstimate = summary.MoneyData.ObjectTaxEstimate;
-                account.ParcelDirFeeCurrent = summary.MoneyData.ParcelDirFeeCurrent;
-                account.ParcelDirFeeEstimate = summary.MoneyData.ParcelDirFeeEstimate;
-                account.StartDate = Helpers.FieldToUTF8String(summary.MoneyData.StartDate);
-                account.TaxDate = Helpers.FieldToUTF8String(summary.MoneyData.TaxDate);
-                account.TotalCredits = summary.MoneyData.TotalCredits;
-                account.TotalDebits = summary.MoneyData.TotalDebits;
-
-                try { OnGroupAccountSummary(account); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void GroupAccountDetailsHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGroupAccountDetails != null)
-            {
-                GroupAccountDetailsReplyPacket details = (GroupAccountDetailsReplyPacket)packet;
-                GroupAccountDetails account = new GroupAccountDetails();
-
-                account.CurrentInterval = details.MoneyData.CurrentInterval;
-                account.IntervalDays = details.MoneyData.IntervalDays;
-                account.StartDate = Helpers.FieldToUTF8String(details.MoneyData.StartDate);
-
-                account.HistoryItems = new List<KeyValuePair<string, int>>();
-
-                foreach (GroupAccountDetailsReplyPacket.HistoryDataBlock block in details.HistoryData)
-                {
-                    KeyValuePair<string, int> item =
-                        new KeyValuePair<string, int>(Helpers.FieldToUTF8String(block.Description), block.Amount);
-
-                    account.HistoryItems.Add(item);
-                }
-
-                try { OnGroupAccountDetails(account); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void GroupAccountTransactionsHandler(Packet packet, Simulator simulator)
-        {
-            GroupAccountTransactionsReplyPacket reply = (GroupAccountTransactionsReplyPacket)packet;
-
-            Client.Log("Got a GroupAccountTransactionsReply packet, implement this callback!\n" +
-                reply.ToString(), Helpers.LogLevel.Error);
-        }
-
-        private void CreateGroupReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGroupCreated != null)
-            {
-                CreateGroupReplyPacket reply = (CreateGroupReplyPacket)packet;
-
-                string message = Helpers.FieldToUTF8String(reply.ReplyData.Message);
-
-                try { OnGroupCreated(reply.ReplyData.GroupID, reply.ReplyData.Success, message); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void JoinGroupReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGroupJoined != null)
-            {
-                JoinGroupReplyPacket reply = (JoinGroupReplyPacket)packet;
-
-                try { OnGroupJoined(reply.GroupData.GroupID, reply.GroupData.Success); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void LeaveGroupReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnGroupLeft != null)
-            {
-                LeaveGroupReplyPacket reply = (LeaveGroupReplyPacket)packet;
-
-                try { OnGroupLeft(reply.GroupData.GroupID, reply.GroupData.Success); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        #endregion Packet Handlers
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Helpers.cs b/old/libsl1550/libsecondlife/Helpers.cs
deleted file mode 100644
index e0f34fe..0000000
--- a/old/libsl1550/libsecondlife/Helpers.cs
+++ /dev/null
@@ -1,1338 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Static helper functions and global variables
-    /// </summary>
-    public class Helpers
-    {
-        /// <summary>
-        /// Operating system enumeration
-        /// </summary>
-        public enum Platform
-        {
-            /// <summary>Unknown</summary>
-            Unknown,
-            /// <summary>Microsoft Windows</summary>
-            Windows,
-            /// <summary>Microsoft Windows CE</summary>
-            WindowsCE,
-            /// <summary>Linux</summary>
-            Linux,
-            /// <summary>Apple OSX</summary>
-            OSX
-        }
-
-        /// <summary>This header flag signals that ACKs are appended to the packet</summary>
-        public const byte MSG_APPENDED_ACKS = 0x10;
-        /// <summary>This header flag signals that this packet has been sent before</summary>
-        public const byte MSG_RESENT = 0x20;
-        /// <summary>This header flags signals that an ACK is expected for this packet</summary>
-        public const byte MSG_RELIABLE = 0x40;
-        /// <summary>This header flag signals that the message is compressed using zerocoding</summary>
-        public const byte MSG_ZEROCODED = 0x80;
-        /// <summary>Used for converting degrees to radians</summary>
-        public const double DEG_TO_RAD = Math.PI / 180.0d;
-        /// <summary>Used for converting radians to degrees</summary>
-        public const double RAD_TO_DEG = 180.0d / Math.PI;
-
-#if PocketPC
-        public static string NewLine = "\r\n";
-#else
-        public static string NewLine = Environment.NewLine;
-#endif
-
-        /// <summary>UNIX epoch in DateTime format</summary>
-        public static DateTime Epoch = new DateTime(1970, 1, 1);
-
-        /// <summary>
-        /// Passed to SecondLife.Log() to identify the severity of a log entry
-        /// </summary>
-        public enum LogLevel
-        {
-            /// <summary>Non-noisy useful information, may be helpful in
-            /// debugging a problem</summary>
-            Info,
-            /// <summary>A non-critical error occurred. A warning will not
-            /// prevent the rest of libsecondlife from operating as usual,
-            /// although it may be indicative of an underlying issue</summary>
-            Warning,
-            /// <summary>A critical error has occurred. Generally this will
-            /// be followed by the network layer shutting down, although the
-            /// stability of libsecondlife after an error is uncertain</summary>
-            Error,
-            /// <summary>Used for internal testing, this logging level can
-            /// generate very noisy (long and/or repetitive) messages. Don't
-            /// pass this to the Log() function, use DebugLog() instead.
-            /// </summary>
-            Debug
-        };
-
-        /// <summary>Provide a single instance of the MD5 class to avoid making
-        /// duplicate copies</summary>
-        public static System.Security.Cryptography.MD5 MD5Builder =
-            new System.Security.Cryptography.MD5CryptoServiceProvider();
-
-        /// <summary>Provide a single instance of the CultureInfo class to
-        /// help parsing in situations where Second Life assumes an en-us
-        /// culture</summary>
-        public static readonly System.Globalization.CultureInfo EnUsCulture =
-            new System.Globalization.CultureInfo("en-us");
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="offset"></param>
-        /// <returns></returns>
-        public static short TEOffsetShort(float offset)
-        {
-            offset = Clamp(offset, -1.0f, 1.0f);
-            offset *= 32767.0f;
-            return (short)Math.Round(offset);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <returns></returns>
-        public static float TEOffsetFloat(byte[] bytes, int pos)
-        {
-            float offset = (float)BitConverter.ToInt16(bytes, pos);
-            return offset / 32767.0f;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="rotation"></param>
-        /// <returns></returns>
-        public static short TERotationShort(float rotation)
-        {
-            const double TWO_PI = Math.PI * 2.0d;
-            double remainder = Math.IEEERemainder(rotation, TWO_PI);
-            return (short)Math.Round((remainder / TWO_PI) * 32767.0d);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <returns></returns>
-        public static float TERotationFloat(byte[] bytes, int pos)
-        {
-            const float TWO_PI = (float)(Math.PI * 2.0d);
-            return (float)((bytes[pos] | (bytes[pos + 1] << 8)) / 32767.0f) * TWO_PI;
-        }
-
-        public static byte TEGlowByte(float glow)
-        {
-            return (byte)(glow * 255.0f);
-        }
-
-        public static float TEGlowFloat(byte[] bytes, int pos)
-        {
-            return (float)bytes[pos] / 255.0f;
-        }
-
-        /// <summary>
-        /// Converts an unsigned integer to a hexadecimal string
-        /// </summary>
-        /// <param name="i">An unsigned integer to convert to a string</param>
-        /// <returns>A hexadecimal string 10 characters long</returns>
-        /// <example>0x7fffffff</example>
-        public static string UIntToHexString(uint i)
-        {
-            return string.Format("{0:x8}", i);
-        }
-
-        /// <summary>
-        /// Packs to 32-bit unsigned integers in to a 64-bit unsigned integer
-        /// </summary>
-        /// <param name="a">The left-hand (or X) value</param>
-        /// <param name="b">The right-hand (or Y) value</param>
-        /// <returns>A 64-bit integer containing the two 32-bit input values</returns>
-        public static ulong UIntsToLong(uint a, uint b)
-        {
-            return ((ulong)a << 32) | (ulong)b;
-        }
-
-        /// <summary>
-        /// Given an X/Y location in absolute (grid-relative) terms, a region
-        /// handle is returned along with the local X/Y location in that region
-        /// </summary>
-        /// <param name="globalX">The absolute X location, a number such as
-        /// 255360.35</param>
-        /// <param name="globalY">The absolute Y location, a number such as
-        /// 255360.35</param>
-        /// <param name="localX">The sim-local X position of the global X
-        /// position, a value from 0.0 to 256.0</param>
-        /// <param name="localY">The sim-local Y position of the global Y
-        /// position, a value from 0.0 to 256.0</param>
-        /// <returns>A 64-bit region handle that can be used to teleport to</returns>
-        public static ulong GlobalPosToRegionHandle(float globalX, float globalY, out float localX, out float localY)
-        {
-            uint x = ((uint)globalX / 256) * 256;
-            uint y = ((uint)globalY / 256) * 256;
-            localX = globalX - (float)x;
-            localY = globalY - (float)y;
-            return UIntsToLong(x, y);
-        }
-
-        /// <summary>
-        /// Unpacks two 32-bit unsigned integers from a 64-bit unsigned integer
-        /// </summary>
-        /// <param name="a">The 64-bit input integer</param>
-        /// <param name="b">The left-hand (or X) output value</param>
-        /// <param name="c">The right-hand (or Y) output value</param>
-        public static void LongToUInts(ulong a, out uint b, out uint c)
-        {
-            b = (uint)(a >> 32);
-            c = (uint)(a & 0x00000000FFFFFFFF);
-        }
-
-        /// <summary>
-        /// Convert an integer to a byte array in little endian format
-        /// </summary>
-        /// <param name="x">The integer to convert</param>
-        /// <returns>A four byte little endian array</returns>
-        public static byte[] IntToBytes(int x)
-        {
-            byte[] bytes = new byte[4];
-
-            bytes[0]= (byte)(x % 256);
-            bytes[1] = (byte)((x >> 8) % 256);
-            bytes[2] = (byte)((x >> 16) % 256);
-            bytes[3] = (byte)((x >> 24) % 256);
-
-            return bytes;
-        }
-
-        /// <summary>
-        /// Convert the first two bytes starting at the given position in
-        /// little endian ordering to an unsigned short
-        /// </summary>
-        /// <param name="bytes">Byte array containing the ushort</param>
-        /// <param name="pos">Position to start reading the ushort from</param>
-        /// <returns>An unsigned short, will be zero if a ushort can't be read
-        /// at the given position</returns>
-        public static ushort BytesToUInt16(byte[] bytes, int pos)
-        {
-            if (bytes.Length <= pos + 1) return 0;
-            return (ushort)(bytes[pos] + (bytes[pos + 1] << 8));
-        }
-
-        /// <summary>
-        /// Convert the first four bytes starting at the given position in
-        /// little endian ordering to an unsigned integer
-        /// </summary>
-        /// <param name="bytes">Byte array containing the uint</param>
-        /// <param name="pos">Position to start reading the uint from</param>
-        /// <returns>An unsigned integer, will be zero if a uint can't be read
-        /// at the given position</returns>
-        public static uint BytesToUInt(byte[] bytes, int pos)
-        {
-            if (bytes.Length <= pos + 4) return 0;
-            return (uint)(bytes[pos + 3] + (bytes[pos + 2] << 8) + (bytes[pos + 1] << 16) + (bytes[pos] << 24));
-        }
-
-        /// <summary>
-        /// Convert the first four bytes of the given array in little endian
-        /// ordering to an unsigned integer
-        /// </summary>
-        /// <param name="bytes">An array four bytes or longer</param>
-        /// <returns>An unsigned integer, will be zero if the array contains
-        /// less than four bytes</returns>
-        public static uint BytesToUInt(byte[] bytes)
-        {
-            return BytesToUInt(bytes, 0);
-        }
-
-        /// <summary>
-        /// Convert the first four bytes starting at the given position in
-        /// big endian ordering to an unsigned integer
-        /// </summary>
-        /// <param name="bytes">Byte array containing the uint</param>
-        /// <param name="pos">Position to start reading the uint from</param>
-        /// <returns>An unsigned integer, will be zero if a uint can't be read
-        /// at the given position</returns>
-        public static uint BytesToUIntBig(byte[] bytes, int pos)
-        {
-            if (bytes.Length <= pos + 4) return 0;
-            return (uint)(bytes[pos] + (bytes[pos + 1] << 8) + (bytes[pos + 2] << 16) + (bytes[pos + 3] << 24));
-        }
-
-        /// <summary>
-        /// Convert the first four bytes of the given array in big endian
-        /// ordering to an unsigned integer
-        /// </summary>
-        /// <param name="bytes">An array four bytes or longer</param>
-        /// <returns>An unsigned integer, will be zero if the array contains
-        /// less than four bytes</returns>
-        public static uint BytesToUIntBig(byte[] bytes)
-        {
-            if (bytes.Length < 4) return 0;
-            return (uint)(bytes[0] + (bytes[1] << 8) + (bytes[2] << 16) + (bytes[3] << 24));
-        }
-
-        /// <summary>
-        /// Convert the first eight bytes of the given array in little endian
-        /// ordering to an unsigned 64-bit integer
-        /// </summary>
-        /// <param name="bytes">An array eight bytes or longer</param>
-        /// <returns>An unsigned 64-bit integer, will be zero if the array
-        /// contains less than eight bytes</returns>
-        public static ulong BytesToUInt64(byte[] bytes)
-        {
-            if (bytes.Length < 8) return 0;
-            return (ulong)
-                ((ulong)bytes[7] +
-                ((ulong)bytes[6] << 8) +
-                ((ulong)bytes[5] << 16) +
-                ((ulong)bytes[4] << 24) +
-                ((ulong)bytes[3] << 32) +
-                ((ulong)bytes[2] << 40) +
-                ((ulong)bytes[1] << 48) +
-                ((ulong)bytes[0] << 56));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <returns></returns>
-        public static float BytesToFloat(byte[] bytes, int pos)
-        {
-            if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, pos, 4);
-            return BitConverter.ToSingle(bytes, pos);
-        }
-
-        /// <summary>
-        /// Convert a floating point value to four bytes in little endian
-        /// ordering
-        /// </summary>
-        /// <param name="value">A floating point value</param>
-        /// <returns>A four byte array containing the value in little endian
-        /// ordering</returns>
-        public static byte[] FloatToBytes(float value)
-        {
-            byte[] bytes = BitConverter.GetBytes(value);
-            if (!BitConverter.IsLittleEndian)
-                Array.Reverse(bytes);
-            return bytes;
-        }
-
-        /// <summary>
-        /// Converts a floating point number to a terse string format used for
-        /// transmitting numbers in wearable asset files
-        /// </summary>
-        /// <param name="val">Floating point number to convert to a string</param>
-        /// <returns>A terse string representation of the input number</returns>
-        public static string FloatToTerseString(float val)
-        {
-            string s = string.Format("{0:.00}", val);
-
-            // Trim trailing zeroes
-            while (s[s.Length - 1] == '0')
-                s = s.Remove(s.Length - 1, 1);
-
-            // Remove superfluous decimal places after the trim
-            if (s[s.Length - 1] == '.')
-                s = s.Remove(s.Length - 1, 1);
-            // Remove leading zeroes after a negative sign
-            else if (s[0] == '-' && s[1] == '0')
-                s = s.Remove(1, 1);
-            // Remove leading zeroes in positive numbers
-            else if (s[0] == '0')
-                s = s.Remove(0, 1);
-
-            return s;
-        }
-
-        /// <summary>
-        /// Convert a float value to a byte given a minimum and maximum range
-        /// </summary>
-        /// <param name="val">Value to convert to a byte</param>
-        /// <param name="lower">Minimum value range</param>
-        /// <param name="upper">Maximum value range</param>
-        /// <returns>A single byte representing the original float value</returns>
-        public static byte FloatToByte(float val, float lower, float upper)
-        {
-            val = Clamp(val, lower, upper);
-            // Normalize the value
-            val -= lower;
-            val /= (upper - lower);
-
-            return (byte)Math.Floor(val * (float)byte.MaxValue);
-        }
-
-        /// <summary>
-        /// Convert a byte to a float value given a minimum and maximum range
-        /// </summary>
-        /// <param name="bytes">Byte array to get the byte from</param>
-        /// <param name="pos">Position in the byte array the desired byte is at</param>
-        /// <param name="lower">Minimum value range</param>
-        /// <param name="upper">Maximum value range</param>
-        /// <returns>A float value inclusively between lower and upper</returns>
-        public static float ByteToFloat(byte[] bytes, int pos, float lower, float upper)
-        {
-            if (bytes.Length <= pos) return 0;
-            return ByteToFloat(bytes[pos], lower, upper);
-        }
-
-        /// <summary>
-        /// Convert a byte to a float value given a minimum and maximum range
-        /// </summary>
-        /// <param name="val">Byte to convert to a float value</param>
-        /// <param name="lower">Minimum value range</param>
-        /// <param name="upper">Maximum value range</param>
-        /// <returns>A float value inclusively between lower and upper</returns>
-        public static float ByteToFloat(byte val, float lower, float upper)
-        {
-            const float ONE_OVER_BYTEMAX = 1.0f / (float)byte.MaxValue;
-
-            float fval = (float)val * ONE_OVER_BYTEMAX;
-            float delta = (upper - lower);
-            fval *= delta;
-            fval += lower;
-
-            // Test for values very close to zero
-            float error = delta * ONE_OVER_BYTEMAX;
-            if (Math.Abs(fval) < error)
-                fval = 0.0f;
-
-            return fval;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="lower"></param>
-        /// <param name="upper"></param>
-        /// <returns></returns>
-        public static float UInt16ToFloat(byte[] bytes, int pos, float lower, float upper)
-        {
-            ushort val = BytesToUInt16(bytes, pos);
-            return UInt16ToFloat(val, lower, upper);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="val"></param>
-        /// <param name="lower"></param>
-        /// <param name="upper"></param>
-        /// <returns></returns>
-        public static float UInt16ToFloat(ushort val, float lower, float upper)
-        {
-            const float ONE_OVER_U16_MAX = 1.0f / 65535.0f;
-
-            float fval = (float)val * ONE_OVER_U16_MAX;
-            float delta = upper - lower;
-            fval *= delta;
-            fval += lower;
-
-            // Make sure zeroes come through as zero
-            float maxError = delta * ONE_OVER_U16_MAX;
-            if (Math.Abs(fval) < maxError)
-                fval = 0.0f;
-
-            return fval;
-        }
-
-        /// <summary>
-        /// Convert an IP address object to an unsigned 32-bit integer
-        /// </summary>
-        /// <param name="address">IP address to convert</param>
-        /// <returns>32-bit unsigned integer holding the IP address bits</returns>
-        public static uint IPToUInt(System.Net.IPAddress address)
-        {
-            byte[] bytes = address.GetAddressBytes();
-            return (uint)((bytes[3] << 24) + (bytes[2] << 16) + (bytes[1] << 8) + bytes[0]);
-        }
-
-        /// <summary>
-        /// Clamp a given value between a range
-        /// </summary>
-        /// <param name="val">Value to clamp</param>
-        /// <param name="lower">Minimum allowable value</param>
-        /// <param name="upper">Maximum allowable value</param>
-        /// <returns>A value inclusively between lower and upper</returns>
-        public static float Clamp(float val, float lower, float upper)
-        {
-            return Math.Min(Math.Max(val, lower), upper);
-        }
-
-        /// <summary>
-        /// Convert a variable length UTF8 byte array to a string
-        /// </summary>
-        /// <param name="bytes">The UTF8 encoded byte array to convert</param>
-        /// <returns>The decoded string</returns>
-        public static string FieldToUTF8String(byte[] bytes)
-        {
-            if (bytes.Length > 0 && bytes[bytes.Length - 1] == 0x00)
-                return UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1);
-            else
-                return UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length);
-        }
-
-        /// <summary>
-        /// Convert a variable length field (byte array) to a string
-        /// </summary>
-        /// <remarks>If the byte array has unprintable characters in it, a
-        /// hex dump will be written instead</remarks>
-        /// <param name="output">The StringBuilder object to write to</param>
-        /// <param name="bytes">The byte array to convert to a string</param>
-        internal static void FieldToString(StringBuilder output, byte[] bytes)
-        {
-            FieldToString(output, bytes, String.Empty);
-        }
-
-        /// <summary>
-        /// Convert a variable length field (byte array) to a string, with a
-        /// field name prepended to each line of the output
-        /// </summary>
-        /// <remarks>If the byte array has unprintable characters in it, a
-        /// hex dump will be written instead</remarks>
-        /// <param name="output">The StringBuilder object to write to</param>
-        /// <param name="bytes">The byte array to convert to a string</param>
-        /// <param name="fieldName">A field name to prepend to each line of output</param>
-        internal static void FieldToString(StringBuilder output, byte[] bytes, string fieldName)
-        {
-            // Check for a common case
-            if (bytes.Length == 0) return;
-
-            bool printable = true;
-
-            for (int i = 0; i < bytes.Length; ++i)
-            {
-                // Check if there are any unprintable characters in the array
-                if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09
-                    && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00)
-                {
-                    printable = false;
-                    break;
-                }
-            }
-
-            if (printable)
-            {
-                if (fieldName.Length > 0)
-                {
-                    output.Append(fieldName);
-                    output.Append(": ");
-                }
-
-                if (bytes[bytes.Length - 1] == 0x00)
-                    output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1));
-                else
-                    output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length));
-            }
-            else
-            {
-                for (int i = 0; i < bytes.Length; i += 16)
-                {
-                    if (i != 0)
-                        output.Append('\n');
-                    if (fieldName.Length > 0)
-                    {
-                        output.Append(fieldName);
-                        output.Append(": ");
-                    }
-
-                    for (int j = 0; j < 16; j++)
-                    {
-                        if ((i + j) < bytes.Length)
-                            output.Append(String.Format("{0:X2} ", bytes[i + j]));
-                        else
-                            output.Append("   ");
-                    }
-
-                    for (int j = 0; j < 16 && (i + j) < bytes.Length; j++)
-                    {
-                        if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E)
-                            output.Append((char)bytes[i + j]);
-                        else
-                            output.Append(".");
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Converts a byte array to a string containing hexadecimal characters
-        /// </summary>
-        /// <param name="bytes">The byte array to convert to a string</param>
-        /// <param name="fieldName">The name of the field to prepend to each
-        /// line of the string</param>
-        /// <returns>A string containing hexadecimal characters on multiple
-        /// lines. Each line is prepended with the field name</returns>
-        public static string FieldToHexString(byte[] bytes, string fieldName)
-        {
-            StringBuilder output = new StringBuilder();
-
-            for (int i = 0; i < bytes.Length; i += 16)
-            {
-                if (i != 0)
-                    output.Append('\n');
-
-                if (fieldName.Length > 0)
-                {
-                    output.Append(fieldName);
-                    output.Append(": ");
-                }
-
-                for (int j = 0; j < 16; j++)
-                {
-                    if ((i + j) < bytes.Length)
-                        output.Append(String.Format("{0:X2} ", bytes[i + j]));
-                    else
-                        output.Append("   ");
-                }
-
-                for (int j = 0; j < 16 && (i + j) < bytes.Length; j++)
-                {
-                    if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E)
-                        output.Append(bytes[i + j]);
-                    else
-                        output.Append(".");
-                }
-            }
-
-            return output.ToString();
-        }
-
-        ///// <summary>
-        ///// Converts a string containing hexadecimal characters to a byte array
-        ///// </summary>
-        ///// <param name="hexString">String containing hexadecimal characters</param>
-        ///// <returns>The converted byte array</returns>
-        //public static byte[] HexStringToField(string hexString)
-        //{
-        //    string newString = "";
-        //    char c;
-
-        //    // FIXME: For each line of the string, if a colon is found
-        //    // remove everything before it
-
-        //    // remove all non A-F, 0-9, characters
-        //    for (int i = 0; i < hexString.Length; i++)
-        //    {
-        //        c = hexString[i];
-        //        if (IsHexDigit(c))
-        //            newString += c;
-        //    }
-
-        //    // if odd number of characters, discard last character
-        //    if (newString.Length % 2 != 0)
-        //    {
-        //        newString = newString.Substring(0, newString.Length - 1);
-        //    }
-
-        //    int byteLength = newString.Length / 2;
-        //    byte[] bytes = new byte[byteLength];
-        //    string hex;
-        //    int j = 0;
-        //    for (int i = 0; i < bytes.Length; i++)
-        //    {
-        //        hex = new String(new Char[] { newString[j], newString[j + 1] });
-        //        bytes[i] = HexToByte(hex);
-        //        j = j + 2;
-        //    }
-        //    return bytes;
-        //}
-
-        /// <summary>
-        /// Returns the string between and exclusive of two search characters
-        /// </summary>
-        /// <param name="src">Source string</param>
-        /// <param name="start">Beginning and exclusive of the substring</param>
-        /// <param name="end">End and exclusive of the substring</param>
-        /// <returns>Substring between the start and end characters</returns>
-        public static string StringBetween(string src, char start, char end)
-        {
-            string ret = String.Empty;
-            int idxStart = src.IndexOf(start);
-            if (idxStart != -1)
-            {
-                ++idxStart;
-                int idxEnd = src.IndexOf(end, idxStart);
-                if (idxEnd != -1)
-                {
-                    ret = src.Substring(idxStart, idxEnd - idxStart);
-                }
-            }
-            return ret;
-        }
-
-        /// <summary>
-        /// Convert a string to a UTF8 encoded byte array
-        /// </summary>
-        /// <param name="str">The string to convert</param>
-        /// <returns>A null-terminated UTF8 byte array</returns>
-        public static byte[] StringToField(string str)
-        {
-            if (str.Length == 0) { return new byte[0]; }
-            if (!str.EndsWith("\0")) { str += "\0"; }
-            return System.Text.UTF8Encoding.UTF8.GetBytes(str);
-        }
-
-        /// <summary>
-        /// Gets a unix timestamp for the current time
-        /// </summary>
-        /// <returns>An unsigned integer representing a unix timestamp for now</returns>
-        public static uint GetUnixTime()
-        {
-            return (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds;
-        }
-
-        /// <summary>
-        /// Convert a UNIX timestamp to a native DateTime object
-        /// </summary>
-        /// <param name="timestamp">An unsigned integer representing a UNIX
-        /// timestamp</param>
-        /// <returns>A DateTime object containing the same time specified in
-        /// the given timestamp</returns>
-        public static DateTime UnixTimeToDateTime(uint timestamp)
-        {
-            System.DateTime dateTime = Epoch;
-
-            // Add the number of seconds in our UNIX timestamp
-            dateTime = dateTime.AddSeconds(timestamp);
-
-            return dateTime;
-        }
-
-        /// <summary>
-        /// Convert a UNIX timestamp to a native DateTime object
-        /// </summary>
-        /// <param name="timestamp">A signed integer representing a UNIX
-        /// timestamp</param>
-        /// <returns>A DateTime object containing the same time specified in
-        /// the given timestamp</returns>
-        public static DateTime UnixTimeToDateTime(int timestamp)
-        {
-#if PocketPC
-            System.DateTime dateTime = Epoch;
-
-            // Add the number of seconds in our UNIX timestamp
-            dateTime = dateTime.AddSeconds(timestamp);
-
-            return dateTime;
-#else
-            return DateTime.FromBinary(timestamp);
-#endif
-        }
-
-        /// <summary>
-        /// Convert a native DateTime object to a UNIX timestamp
-        /// </summary>
-        /// <param name="time">A DateTime object you want to convert to a
-        /// timestamp</param>
-        /// <returns>An unsigned integer representing a UNIX timestamp</returns>
-        public static uint DateTimeToUnixTime(DateTime time)
-        {
-            TimeSpan ts = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0));
-            return (uint)ts.TotalSeconds;
-        }
-
-        /// <summary>
-        /// Swap two values
-        /// </summary>
-        /// <typeparam name="T">Type of the values to swap</typeparam>
-        /// <param name="lhs">First value</param>
-        /// <param name="rhs">Second value</param>
-        public static void Swap<T>(ref T lhs, ref T rhs)
-        {
-            T temp = lhs;
-            lhs = rhs;
-            rhs = temp;
-        }
-
-        /// <summary>
-        /// Test if a single precision float is a finite number
-        /// </summary>
-        public static bool IsFinite(float value)
-        {
-            return !(Single.IsNaN(value) || Single.IsInfinity(value));
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="val"></param>
-        /// <returns></returns>
-        public static int Round(float val)
-        {
-            return (int)Math.Floor(val + 0.5f);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="a"></param>
-        /// <param name="b"></param>
-        /// <param name="u"></param>
-        /// <returns></returns>
-        public static float Lerp(float a, float b, float u)
-        {
-            return a + ((b - a) * u);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="a"></param>
-        /// <param name="b"></param>
-        /// <param name="u"></param>
-        /// <returns></returns>
-        public static LLVector3 Lerp(LLVector3 a, LLVector3 b, float u)
-        {
-            return new LLVector3(
-                a.X + (b.X - a.X) * u,
-                a.Y + (b.Y - a.Y) * u,
-                a.Z + (b.Z - a.Z) * u);
-        }
-
-        /// <summary>
-        /// Decode a zerocoded byte array, used to decompress packets marked
-        /// with the zerocoded flag
-        /// </summary>
-        /// <remarks>Any time a zero is encountered, the next byte is a count
-        /// of how many zeroes to expand. One zero is encoded with 0x00 0x01,
-        /// two zeroes is 0x00 0x02, three zeroes is 0x00 0x03, etc. The
-        /// first four bytes are copied directly to the output buffer.
-        /// </remarks>
-        /// <param name="src">The byte array to decode</param>
-        /// <param name="srclen">The length of the byte array to decode. This
-        /// would be the length of the packet up to (but not including) any
-        /// appended ACKs</param>
-        /// <param name="dest">The output byte array to decode to</param>
-        /// <returns>The length of the output buffer</returns>
-        public static int ZeroDecode(byte[] src, int srclen, byte[] dest)
-        {
-            uint zerolen = 0;
-            int bodylen = 0;
-            uint i = 0;
-
-            try
-            {
-                Buffer.BlockCopy(src, 0, dest, 0, 6);
-                zerolen = 6;
-                bodylen = srclen;
-
-                for (i = zerolen; i < bodylen; i++)
-                {
-                    if (src[i] == 0x00)
-                    {
-                        for (byte j = 0; j < src[i + 1]; j++)
-                        {
-                            dest[zerolen++] = 0x00;
-                        }
-
-                        i++;
-                    }
-                    else
-                    {
-                        dest[zerolen++] = src[i];
-                    }
-                }
-
-                // Copy appended ACKs
-                for (; i < srclen; i++)
-                {
-                    dest[zerolen++] = src[i];
-                }
-
-                return (int)zerolen;
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Zerodecoding error: " + Helpers.NewLine +
-                    "i=" + i + "srclen=" + srclen + ", bodylen=" + bodylen + ", zerolen=" + zerolen + Helpers.NewLine +
-                    FieldToHexString(src, "src") + Helpers.NewLine +
-                    e.ToString());
-            }
-
-            return 0;
-        }
-
-        /// <summary>
-        /// Decode enough of a byte array to get the packet ID.  Data before and
-        /// after the packet ID is undefined.
-        /// </summary>
-        /// <param name="src">The byte array to decode</param>
-        /// <param name="dest">The output byte array to encode to</param>
-        public static void ZeroDecodeCommand(byte[] src, byte[] dest)
-        {
-            for (int srcPos = 6, destPos = 6; destPos < 10; ++srcPos)
-            {
-                if (src[srcPos] == 0x00)
-                {
-                    for (byte j = 0; j < src[srcPos + 1]; ++j)
-                    {
-                        dest[destPos++] = 0x00;
-                    }
-
-                    ++srcPos;
-                }
-                else
-                {
-                    dest[destPos++] = src[srcPos];
-                }
-            }
-        }
-
-        /// <summary>
-        /// Encode a byte array with zerocoding. Used to compress packets marked
-        /// with the zerocoded flag. Any zeroes in the array are compressed down
-        /// to a single zero byte followed by a count of how many zeroes to expand
-        /// out. A single zero becomes 0x00 0x01, two zeroes becomes 0x00 0x02,
-        /// three zeroes becomes 0x00 0x03, etc. The first four bytes are copied
-        /// directly to the output buffer.
-        /// </summary>
-        /// <param name="src">The byte array to encode</param>
-        /// <param name="srclen">The length of the byte array to encode</param>
-        /// <param name="dest">The output byte array to encode to</param>
-        /// <returns>The length of the output buffer</returns>
-        public static int ZeroEncode(byte[] src, int srclen, byte[] dest)
-        {
-            uint zerolen = 0;
-            byte zerocount = 0;
-
-            Buffer.BlockCopy(src, 0, dest, 0, 6);
-            zerolen += 6;
-
-            int bodylen;
-            if ((src[0] & MSG_APPENDED_ACKS) == 0)
-            {
-                bodylen = srclen;
-            }
-            else
-            {
-                bodylen = srclen - src[srclen - 1] * 4 - 1;
-            }
-
-            uint i;
-            for (i = zerolen; i < bodylen; i++)
-            {
-                if (src[i] == 0x00)
-                {
-                    zerocount++;
-
-                    if (zerocount == 0)
-                    {
-                        dest[zerolen++] = 0x00;
-                        dest[zerolen++] = 0xff;
-                        zerocount++;
-                    }
-                }
-                else
-                {
-                    if (zerocount != 0)
-                    {
-                        dest[zerolen++] = 0x00;
-                        dest[zerolen++] = (byte)zerocount;
-                        zerocount = 0;
-                    }
-
-                    dest[zerolen++] = src[i];
-                }
-            }
-
-            if (zerocount != 0)
-            {
-                dest[zerolen++] = 0x00;
-                dest[zerolen++] = (byte)zerocount;
-            }
-
-            // copy appended ACKs
-            for (; i < srclen; i++)
-            {
-                dest[zerolen++] = src[i];
-            }
-
-            return (int)zerolen;
-        }
-
-        /// <summary>
-        /// Calculates the CRC (cyclic redundancy check) needed to upload inventory.
-        /// </summary>
-        /// <param name="creationDate">Creation date</param>
-        /// <param name="saleType">Sale type</param>
-        /// <param name="invType">Inventory type</param>
-        /// <param name="type">Type</param>
-        /// <param name="assetID">Asset ID</param>
-        /// <param name="groupID">Group ID</param>
-        /// <param name="salePrice">Sale price</param>
-        /// <param name="ownerID">Owner ID</param>
-        /// <param name="creatorID">Creator ID</param>
-        /// <param name="itemID">Item ID</param>
-        /// <param name="folderID">Folder ID</param>
-        /// <param name="everyoneMask">Everyone mask (permissions)</param>
-        /// <param name="flags">Flags</param>
-        /// <param name="nextOwnerMask">Next owner mask (permissions)</param>
-        /// <param name="groupMask">Group mask (permissions)</param>
-        /// <param name="ownerMask">Owner mask (permisions)</param>
-        /// <returns>The calculated CRC</returns>
-        public static uint InventoryCRC(int creationDate, byte saleType, sbyte invType, sbyte type,
-            LLUUID assetID, LLUUID groupID, int salePrice, LLUUID ownerID, LLUUID creatorID,
-            LLUUID itemID, LLUUID folderID, uint everyoneMask, uint flags, uint nextOwnerMask,
-            uint groupMask, uint ownerMask)
-        {
-            uint CRC = 0;
-
-            // IDs
-            CRC += assetID.CRC(); // AssetID
-            CRC += folderID.CRC(); // FolderID
-            CRC += itemID.CRC(); // ItemID
-
-            // Permission stuff
-            CRC += creatorID.CRC(); // CreatorID
-            CRC += ownerID.CRC(); // OwnerID
-            CRC += groupID.CRC(); // GroupID
-
-            // CRC += another 4 words which always seem to be zero -- unclear if this is a LLUUID or what
-            CRC += ownerMask;
-            CRC += nextOwnerMask;
-            CRC += everyoneMask;
-            CRC += groupMask;
-
-            // The rest of the CRC fields
-            CRC += flags; // Flags
-            CRC += (uint)invType; // InvType
-            CRC += (uint)type; // Type
-            CRC += (uint)creationDate; // CreationDate
-            CRC += (uint)salePrice;    // SalePrice
-            CRC += (uint)((uint)saleType * 0x07073096); // SaleType
-
-            return CRC;
-        }
-
-        /// <summary>
-        /// Calculate the MD5 hash of a given string
-        /// </summary>
-        /// <param name="password">The password to hash</param>
-        /// <returns>An MD5 hash in string format, with $1$ prepended</returns>
-        public static string MD5(string password)
-        {
-            StringBuilder digest = new StringBuilder();
-            byte[] hash;
-            lock(MD5Builder) hash = MD5Builder.ComputeHash(ASCIIEncoding.Default.GetBytes(password));
-
-            // Convert the hash to a hex string
-            foreach (byte b in hash)
-            {
-                digest.AppendFormat(Helpers.EnUsCulture, "{0:x2}", b);
-            }
-
-            return "$1$" + digest.ToString();
-        }
-
-        /// <summary>
-        /// Attempts to load a file embedded in the assembly
-        /// </summary>
-        /// <param name="resourceName">The filename of the resource to load</param>
-        /// <returns>A Stream for the requested file, or null if the resource
-        /// was not successfully loaded</returns>
-        public static System.IO.Stream GetResourceStream(string resourceName)
-        {
-            return GetResourceStream(resourceName, Settings.RESOURCE_DIR);
-        }
-
-        /// <summary>
-        /// Attempts to load a file either embedded in the assembly or found in
-        /// a given search path
-        /// </summary>
-        /// <param name="resourceName">The filename of the resource to load</param>
-        /// <param name="searchPath">An optional path that will be searched if
-        /// the asset is not found embedded in the assembly</param>
-        /// <returns>A Stream for the requested file, or null if the resource
-        /// was not successfully loaded</returns>
-        public static System.IO.Stream GetResourceStream(string resourceName, string searchPath)
-        {
-            try
-            {
-                System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
-                System.IO.Stream s = a.GetManifestResourceStream("libsecondlife.Resources." + resourceName);
-                if (s != null) return s;
-            }
-            catch (Exception)
-            {
-                // Failed to load the resource from the assembly itself
-            }
-
-            try
-            {
-                return new System.IO.FileStream(searchPath + System.IO.Path.DirectorySeparatorChar + resourceName,
-                    System.IO.FileMode.Open);
-            }
-            catch (Exception)
-            {
-                // Failed to load the resource from the given path
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// Get the current running platform
-        /// </summary>
-        /// <returns>Enumeration of the current platform we are running on</returns>
-        public static Platform GetRunningPlatform()
-        {
-            const string OSX_CHECK_FILE = "/Library/Extensions.kextcache";
-
-            if (Environment.OSVersion.Platform == PlatformID.WinCE)
-            {
-                return Platform.WindowsCE;
-            }
-            else
-            {
-                int plat = (int)Environment.OSVersion.Platform;
-
-                if ((plat != 4) && (plat != 128))
-                {
-                    return Platform.Windows;
-                }
-                else
-                {
-                    if (System.IO.File.Exists(OSX_CHECK_FILE))
-                        return Platform.OSX;
-                    else
-                        return Platform.Linux;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Converts a list of primitives to an object that can be serialized
-        /// with the LLSD system
-        /// </summary>
-        /// <param name="prims">Primitives to convert to a serializable object</param>
-        /// <returns>An object that can be serialized with LLSD</returns>
-        public static StructuredData.LLSD PrimListToLLSD(List<Primitive> prims)
-        {
-            StructuredData.LLSDMap map = new libsecondlife.StructuredData.LLSDMap(prims.Count);
-
-            for (int i = 0; i < prims.Count; i++)
-                map.Add(prims[i].LocalID.ToString(), prims[i].ToLLSD());
-
-            return map;
-        }
-
-        /// <summary>
-        /// Deserializes LLSD in to a list of primitives
-        /// </summary>
-        /// <param name="llsd">Structure holding the serialized primitive list,
-        /// must be of the LLSDMap type</param>
-        /// <returns>A list of deserialized primitives</returns>
-        public static List<Primitive> LLSDToPrimList(StructuredData.LLSD llsd)
-        {
-            if (llsd.Type != StructuredData.LLSDType.Map)
-                throw new ArgumentException("LLSD must be in the Map structure");
-
-            StructuredData.LLSDMap map = (StructuredData.LLSDMap)llsd;
-            List<Primitive> prims = new List<Primitive>(map.Count);
-
-            foreach (KeyValuePair<string, StructuredData.LLSD> kvp in map)
-            {
-                Primitive prim = Primitive.FromLLSD(kvp.Value);
-                prim.LocalID = UInt32.Parse(kvp.Key);
-                prims.Add(prim);
-            }
-
-            return prims;
-        }
-
-        /// <summary>
-        /// Looks up parcel localID from ParcelTracker Dictionary based on parcel bounding box.
-        /// </summary>
-        /// <param name="sim">Simulator parcel is in</param>
-        /// <param name="location">llVector3 location</param>
-        /// <returns>parcel localID, 0 = not found</returns>
-        /// <remarks>Bounding box is defined by parcel landing point.</remarks>
-        [Obsolete("Replaced by ParcelManager.GetParcelLocalID")]
-        public static int VecToParcelLocalID(Simulator sim, LLVector3 location)
-        {
-            int localID = 0;
-            sim.Parcels.ForEach(delegate(Parcel parcel)
-            {
-                if (location.X <= parcel.AABBMax.X &&
-                    location.X >= parcel.AABBMin.X &&
-                    location.Y <= parcel.AABBMax.Y &&
-                    location.Y >= parcel.AABBMin.Y)
-                {
-                    // FIXME: This only checks the AABB of parcels. For non-rectangular parcels
-                    // it will return random results
-                    localID = parcel.LocalID;
-                }
-            });
-
-            return localID;
-        }
-
-        public static AttachmentPoint StateToAttachmentPoint(uint state)
-        {
-            const uint ATTACHMENT_MASK = 0xF0;
-            uint fixedState = (((byte)state & ATTACHMENT_MASK) >> 4) | (((byte)state & ~ATTACHMENT_MASK) << 4);
-            return (AttachmentPoint)fixedState;
-        }
-
-        #region Platform Helper Functions
-
-        public static bool TryParse(string s, out DateTime result)
-        {
-#if PocketPC
-            try { result = DateTime.Parse(s); return true; }
-            catch (FormatException) { result = Helpers.Epoch; return false; }
-#else
-            return DateTime.TryParse(s, out result);
-#endif
-        }
-
-        public static bool TryParse(string s, out int result)
-        {
-#if PocketPC
-            try { result = Int32.Parse(s); return true; }
-            catch (FormatException) { result = 0; return false; }
-#else
-            return Int32.TryParse(s, out result);
-#endif
-        }
-
-        public static bool TryParse(string s, out uint result)
-        {
-#if PocketPC
-            try { result = UInt32.Parse(s); return true; }
-            catch (FormatException) { result = 0; return false; }
-#else
-            return UInt32.TryParse(s, out result);
-#endif
-        }
-
-        public static bool TryParse(string s, out ulong result)
-        {
-#if PocketPC
-            try { result = UInt64.Parse(s); return true; }
-            catch (FormatException) { result = 0; return false; }
-#else
-            return UInt64.TryParse(s, out result);
-#endif
-        }
-
-        public static bool TryParse(string s, out float result)
-        {
-#if PocketPC
-            try { result = Single.Parse(s, System.Globalization.NumberStyles.Float, Helpers.EnUsCulture.NumberFormat); return true; }
-            catch (FormatException) { result = 0f; return false; }
-#else
-            return Single.TryParse(s, System.Globalization.NumberStyles.Float, Helpers.EnUsCulture.NumberFormat, out result);
-#endif
-        }
-
-        public static bool TryParse(string s, out double result)
-        {
-#if PocketPC
-            try { result = Double.Parse(s, System.Globalization.NumberStyles.Float, Helpers.EnUsCulture.NumberFormat); return true; }
-            catch (FormatException) { result = 0d; return false; }
-#else
-            return Double.TryParse(s, System.Globalization.NumberStyles.Float, Helpers.EnUsCulture.NumberFormat, out result);
-#endif
-        }
-
-        public static bool TryParse(string s, out System.Net.IPAddress result)
-        {
-#if PocketPC
-            try { result = System.Net.IPAddress.Parse(s); return true; }
-            catch (FormatException) { result = System.Net.IPAddress.Loopback; return false; }
-#else
-            return System.Net.IPAddress.TryParse(s, out result);
-#endif
-        }
-
-        public static bool TryParse(string s, out LLUUID result)
-        {
-            return LLUUID.TryParse(s, out result);
-        }
-
-        public static bool TryParse(string s, out LLVector3 result)
-        {
-            return LLVector3.TryParse(s, out result);
-        }
-
-        public static bool TryParseHex(string s, out uint result)
-        {
-#if PocketPC
-            try { result = UInt32.Parse(s, System.Globalization.NumberStyles.HexNumber, Helpers.EnUsCulture.NumberFormat); return true; }
-            catch (FormatException) { result = 0; return false; }
-#else
-            return UInt32.TryParse(s, System.Globalization.NumberStyles.HexNumber, Helpers.EnUsCulture.NumberFormat, out result);
-#endif
-        }
-
-        public static bool StringContains(string haystack, string needle)
-        {
-#if PocketPC
-            return (haystack.IndexOf(needle) != -1);
-#else
-            return haystack.Contains(needle);
-#endif
-        }
-
-        public static bool StringSplitAt(string input, string separator, out string before, out string after)
-        {
-            int index = input.IndexOf(separator);
-
-            if (index != -1)
-            {
-                before = input.Substring(0, index);
-                after = input.Substring(index);
-                return true;
-            }
-            else
-            {
-                before = String.Empty;
-                after = String.Empty;
-                return false;
-            }
-        }
-
-        #endregion Platform Helper Functions
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Image.cs b/old/libsl1550/libsecondlife/Image.cs
deleted file mode 100644
index 282de57..0000000
--- a/old/libsl1550/libsecondlife/Image.cs
+++ /dev/null
@@ -1,267 +0,0 @@
-using System;
-
-namespace libsecondlife
-{
-    [Flags]
-    public enum ImageChannels
-    {
-        Color = 1,
-        Bump = 2,
-        Alpha = 4,
-    };
-
-    public enum ImageResizeAlgorithm
-    {
-        NearestNeighbor
-    }
-
-    public class Image
-    {
-        /// <summary>
-        /// Image width
-        /// </summary>
-        public int Width;
-
-        /// <summary>
-        /// Image height
-        /// </summary>
-        public int Height;
-
-        /// <summary>
-        /// Image channel flags
-        /// </summary>
-        public ImageChannels Channels;
-
-        /// <summary>
-        /// Red channel data
-        /// </summary>
-        public byte[] Red;
-
-        /// <summary>
-        /// Green channel data
-        /// </summary>
-        public byte[] Green;
-
-        /// <summary>
-        /// Blue channel data
-        /// </summary>
-        public byte[] Blue;
-
-        /// <summary>
-        /// Alpha channel data
-        /// </summary>
-        public byte[] Alpha;
-
-        /// <summary>
-        /// Bump channel data
-        /// </summary>
-        public byte[] Bump;
-
-        /// <summary>
-        /// Create a new blank image
-        /// </summary>
-        /// <param name="width">width</param>
-        /// <param name="height">height</param>
-        /// <param name="channels">channel flags</param>
-        public Image(int width, int height, ImageChannels channels)
-        {
-            Width = width;
-            Height = height;
-            Channels = channels;
-
-            int n = width * height;
-
-            if ((channels & ImageChannels.Color) != 0)
-            {
-                Red = new byte[n];
-                Green = new byte[n];
-                Blue = new byte[n];
-            }
-
-            if ((channels & ImageChannels.Bump) != 0) Bump = new byte[n];
-
-            if ((channels & ImageChannels.Alpha) != 0)
-                Alpha = new byte[n];
-        }
-
-        /// <summary>
-        /// Convert the channels in the image. Channels are created or destroyed as required.
-        /// </summary>
-        /// <param name="channels">new channel flags</param>
-        public void ConvertChannels(ImageChannels channels)
-        {
-            if (Channels == channels)
-                return;
-
-            int n = Width * Height;
-            ImageChannels add = Channels ^ channels & channels;
-            ImageChannels del = Channels ^ channels & Channels;
-
-            if ((add & ImageChannels.Color) != 0)
-            {
-                Red = new byte[n];
-                Green = new byte[n];
-                Blue = new byte[n];
-            }
-            else if ((del & ImageChannels.Color) != 0)
-            {
-                Red = null;
-                Green = null;
-                Blue = null;
-            }
-
-            if ((add & ImageChannels.Alpha) != 0)
-            {
-                Alpha = new byte[n];
-                Fill(Alpha, 255);
-            }
-            else if ((del & ImageChannels.Alpha) != 0)
-                Alpha = null;
-
-            if ((add & ImageChannels.Bump) != 0)
-                Bump = new byte[n];
-            else if ((del & ImageChannels.Bump) != 0)
-                Bump = null;
-
-            Channels = channels;
-        }
-
-        /// <summary>
-        /// Resize or stretch the image using nearest neighbor (ugly) resampling
-        /// </summary>
-        /// <param name="width">new width</param>
-        /// <param name="height">new height</param>
-        public void ResizeNearestNeighbor(int width, int height)
-        {
-            if (width == Width && height == Height)
-                return;
-
-            byte[]
-                red = null,
-                green = null,
-                blue = null,
-                alpha = null,
-                bump = null;
-            int n = width * height;
-            int di = 0, si;
-
-            if (Red != null) red = new byte[n];
-            if (Green != null) green = new byte[n];
-            if (Blue != null) blue = new byte[n];
-            if (Alpha != null) alpha = new byte[n];
-            if (Bump != null) bump = new byte[n];
-
-            for (int y = 0; y < height; y++)
-            {
-                for (int x = 0; x < width; x++)
-                {
-                    si = (y * Height / height) * Width + (x * Width / width);
-                    if (Red != null) red[di] = Red[si];
-                    if (Green != null) green[di] = Green[si];
-                    if (Blue != null) blue[di] = Blue[si];
-                    if (Alpha != null) alpha[di] = Alpha[si];
-                    if (Bump != null) bump[di] = Bump[si];
-                    di++;
-                }
-            }
-
-            Width = width;
-            Height = height;
-            Red = red;
-            Green = green;
-            Blue = blue;
-            Alpha = alpha;
-            Bump = bump;
-        }
-
-        public byte[] ExportTGA()
-        {
-            byte[] tga = new byte[Width * Height * 4 + 32];
-            int di = 0;
-            tga[di++] = 0; // idlength
-            tga[di++] = 0; // colormaptype = 0: no colormap
-            tga[di++] = 2; // image type = 2: uncompressed RGB
-            tga[di++] = 0; // color map spec is five zeroes for no color map
-            tga[di++] = 0; // color map spec is five zeroes for no color map
-            tga[di++] = 0; // color map spec is five zeroes for no color map
-            tga[di++] = 0; // color map spec is five zeroes for no color map
-            tga[di++] = 0; // color map spec is five zeroes for no color map
-            tga[di++] = 0; // x origin = two bytes
-            tga[di++] = 0; // x origin = two bytes
-            tga[di++] = 0; // y origin = two bytes
-            tga[di++] = 0; // y origin = two bytes
-            tga[di++] = (byte)(Width & 0xFF); // width - low byte
-            tga[di++] = (byte)(Width >> 8); // width - hi byte
-            tga[di++] = (byte)(Height & 0xFF); // height - low byte
-            tga[di++] = (byte)(Height >> 8); // height - hi byte
-            tga[di++] = (byte)((Channels & ImageChannels.Alpha) == 0 ? 24 : 32); // 24/32 bits per pixel
-            tga[di++] = (byte)((Channels & ImageChannels.Alpha) == 0 ? 32 : 40); // image descriptor byte
-
-            int n = Width * Height;
-
-            if ((Channels & ImageChannels.Alpha) != 0)
-            {
-                if ((Channels & ImageChannels.Color) != 0)
-                {
-                    for (int i = 0; i < n; i++)
-                    {
-                        tga[di++] = Blue[i];
-                        tga[di++] = Green[i];
-                        tga[di++] = Red[i];
-                        tga[di++] = Alpha[i];
-                    }
-                }
-                else
-                {
-                    for (int i = 0; i < n; i++)
-                    {
-                        tga[di++] = Alpha[i];
-                        tga[di++] = Alpha[i];
-                        tga[di++] = Alpha[i];
-                        tga[di++] = Alpha[i];
-                    }
-                }
-            }
-            else
-            {
-                for (int i = 0; i < n; i++)
-                {
-                    tga[di++] = Blue[i];
-                    tga[di++] = Green[i];
-                    tga[di++] = Red[i];
-                }
-            }
-
-            return tga;
-        }
-
-        private void Fill(byte[] array, byte value)
-        {
-            if (array != null)
-            {
-                for (int i = 0; i < array.Length; i++)
-                    array[i] = value;
-            }
-        }
-
-        public void Clear()
-        {
-            Fill(Red, 0);
-            Fill(Green, 0);
-            Fill(Blue, 0);
-            Fill(Alpha, 0);
-            Fill(Bump, 0);
-        }
-
-        public Image Clone()
-        {
-            Image image = new Image(Width, Height, Channels);
-            if (Red != null) image.Red = (byte[])Red.Clone();
-            if (Green != null) image.Green = (byte[])Green.Clone();
-            if (Blue != null) image.Blue = (byte[])Blue.Clone();
-            if (Alpha != null) image.Alpha = (byte[])Alpha.Clone();
-            if (Bump != null) image.Bump = (byte[])Bump.Clone();
-            return image;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Inventory.cs b/old/libsl1550/libsecondlife/Inventory.cs
deleted file mode 100644
index 5ad0962..0000000
--- a/old/libsl1550/libsecondlife/Inventory.cs
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Exception class to identify inventory exceptions
-    /// </summary>
-    public class InventoryException : Exception
-    {
-        public InventoryException(string message)
-            : base(message) { }
-    }
-
-    /// <summary>
-    /// Responsible for maintaining inventory structure. Inventory constructs nodes
-    /// and manages node children as is necessary to maintain a coherant hirarchy.
-    /// Other classes should not manipulate or create InventoryNodes explicitly. When
-    /// A node's parent changes (when a folder is moved, for example) simply pass
-    /// Inventory the updated InventoryFolder and it will make the appropriate changes
-    /// to its internal representation.
-    /// </summary>
-    public class Inventory
-    {
-        /// <summary>
-        /// Delegate to use for the OnInventoryObjectUpdated event.
-        /// </summary>
-        /// <param name="oldObject">The state of the InventoryObject before the update occured.</param>
-        /// <param name="newObject">The state of the InventoryObject after the update occured.</param>
-        public delegate void InventoryObjectUpdated(InventoryBase oldObject, InventoryBase newObject);
-        /// <summary>
-        /// Delegate to use for the OnInventoryObjectRemoved event.
-        /// </summary>
-        /// <param name="obj">The InventoryObject that was removed.</param>
-        public delegate void InventoryObjectRemoved(InventoryBase obj);
-
-        /// <summary>
-        /// Called when an InventoryObject's state is changed.
-        /// </summary>
-        public event InventoryObjectUpdated OnInventoryObjectUpdated;
-        /// <summary>
-        /// Called when an item or folder is removed from inventory.
-        /// </summary>
-        public event InventoryObjectRemoved OnInventoryObjectRemoved;
-
-        /// <summary>
-        ///
-        /// </summary>
-        public InventoryFolder RootFolder
-        {
-            get { return RootNode.Data as InventoryFolder; }
-            set
-            {
-                UpdateNodeFor(value);
-                _RootNode = Items[value.UUID];
-            }
-        }
-
-        private InventoryNode _RootNode;
-
-        /// <summary>
-        ///
-        /// </summary>
-        public InventoryNode RootNode
-        {
-            get
-            {
-                if (_RootNode == null)
-                    throw new InventoryException("Root node unknown. Are you completely logged in?");
-                return _RootNode;
-            }
-        }
-
-        private SecondLife Client;
-        private InventoryManager Manager;
-        private Dictionary<LLUUID, InventoryNode> Items = new Dictionary<LLUUID, InventoryNode>();
-
-        public Inventory(SecondLife client, InventoryManager manager)
-        {
-            Client = client;
-            Manager = manager;
-            Items = new Dictionary<LLUUID, InventoryNode>();
-        }
-
-        public List<InventoryBase> GetContents(InventoryFolder folder)
-        {
-            return GetContents(folder.UUID);
-        }
-
-        /// <summary>
-        /// Returns the contents of the specified folder
-        /// </summary>
-        /// <param name="folder">A folder's UUID</param>
-        /// <returns>The contents of the folder corresponding to <code>folder</code></returns>
-        /// <exception cref="InventoryException">When <code>folder</code> does not exist in the inventory</exception>
-        public List<InventoryBase> GetContents(LLUUID folder)
-        {
-            InventoryNode folderNode;
-            if (!Items.TryGetValue(folder, out folderNode))
-                throw new InventoryException("Unknown folder: " + folder);
-            lock (folderNode.Nodes.SyncRoot)
-            {
-                List<InventoryBase> contents = new List<InventoryBase>(folderNode.Nodes.Count);
-                foreach (InventoryNode node in folderNode.Nodes.Values)
-                {
-                    contents.Add(node.Data);
-                }
-                return contents;
-            }
-        }
-
-        /// <summary>
-        /// Updates the state of the InventoryNode and inventory data structure that
-        /// is responsible for the InventoryObject. If the item was previously not added to inventory,
-        /// it adds the item, and updates structure accordingly. If it was, it updates the
-        /// InventoryNode, changing the parent node if <code>item.parentUUID</code> does
-        /// not match <code>node.Parent.Data.UUID</code>.
-        ///
-        /// You can not set the inventory root folder using this method
-        /// </summary>
-        /// <param name="item">The InventoryObject to store</param>
-        public void UpdateNodeFor(InventoryBase item)
-        {
-            lock (Items)
-            {
-                InventoryNode itemParent = null;
-                if (item.ParentUUID != LLUUID.Zero && !Items.TryGetValue(item.ParentUUID, out itemParent))
-                {
-                    // OK, we have no data on the parent, let's create a fake one.
-                    InventoryFolder fakeParent = new InventoryFolder(item.ParentUUID);
-                    fakeParent.DescendentCount = 1; // Dear god, please forgive me.
-                    itemParent = new InventoryNode(fakeParent);
-                    Items[item.ParentUUID] = itemParent;
-                    // Unfortunately, this breaks the nice unified tree
-                    // while we're waiting for the parent's data to come in.
-                    // As soon as we get the parent, the tree repairs itself.
-                    Client.DebugLog("Attempting to update inventory child of " +
-                        item.ParentUUID.ToString() +
-                        " when we have no local reference to that folder");
-
-                    if (Client.Settings.FETCH_MISSING_INVENTORY)
-                    {
-                        // Fetch the parent
-                        List<LLUUID> fetchreq = new List<LLUUID>(1);
-                        fetchreq.Add(item.ParentUUID);
-                        //Manager.FetchInventory(fetchreq); // we cant fetch folder data! :-O
-                    }
-                }
-
-                InventoryNode itemNode;
-                if (Items.TryGetValue(item.UUID, out itemNode)) // We're updating.
-                {
-                    InventoryNode oldParent = itemNode.Parent;
-                    // Handle parent change
-                    if (oldParent == null || itemParent == null || itemParent.Data.UUID != oldParent.Data.UUID)
-                    {
-                        if (oldParent != null)
-                        {
-                            lock (oldParent.Nodes.SyncRoot)
-                                oldParent.Nodes.Remove(item.UUID);
-                        }
-                        if (itemParent != null)
-                        {
-                            lock (itemParent.Nodes.SyncRoot)
-                                itemParent.Nodes[item.UUID] = itemNode;
-                        }
-                    }
-
-                    itemNode.Parent = itemParent;
-
-                    if (item != itemNode.Data)
-                        FireOnInventoryObjectUpdated(itemNode.Data, item);
-
-                    itemNode.Data = item;
-                }
-                else // We're adding.
-                {
-                    itemNode = new InventoryNode(item, itemParent);
-                    Items.Add(item.UUID, itemNode);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Removes the InventoryObject and all related node data from Inventory.
-        /// </summary>
-        /// <param name="item">The InventoryObject to remove.</param>
-        public void RemoveNodeFor(InventoryBase item)
-        {
-            lock (Items)
-            {
-                InventoryNode node;
-                if (Items.TryGetValue(item.UUID, out node))
-                {
-                    if (node.Parent != null)
-                        lock (node.Parent.Nodes.SyncRoot)
-                            node.Parent.Nodes.Remove(item.UUID);
-                    Items.Remove(item.UUID);
-                    FireOnInventoryObjectRemoved(item);
-                }
-
-                // In case there's a new parent:
-                InventoryNode newParent;
-                if (Items.TryGetValue(item.ParentUUID, out newParent))
-                {
-                    lock (newParent.Nodes.SyncRoot)
-                        newParent.Nodes.Remove(item.UUID);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Used to find out if Inventory contains the InventoryObject
-        /// specified by <code>uuid</code>.
-        /// </summary>
-        /// <param name="uuid">The LLUUID to check.</param>
-        /// <returns>true if inventory contains uuid, false otherwise</returns>
-        public bool Contains(LLUUID uuid)
-        {
-            return Items.ContainsKey(uuid);
-        }
-
-        public bool Contains(InventoryBase obj)
-        {
-            return Contains(obj.UUID);
-        }
-
-        #region Operators
-
-        /// <summary>
-        /// By using the bracket operator on this class, the program can get the
-        /// InventoryObject designated by the specified uuid. If the value for the corresponding
-        /// UUID is null, the call is equivelant to a call to <code>RemoveNodeFor(this[uuid])</code>.
-        /// If the value is non-null, it is equivelant to a call to <code>UpdateNodeFor(value)</code>,
-        /// the uuid parameter is ignored.
-        /// </summary>
-        /// <param name="uuid">The UUID of the InventoryObject to get or set, ignored if set to non-null value.</param>
-        /// <returns>The InventoryObject corresponding to <code>uuid</code>.</returns>
-        public InventoryBase this[LLUUID uuid]
-        {
-            get
-            {
-                InventoryNode node = Items[uuid];
-                return node.Data;
-            }
-            set
-            {
-                if (value != null)
-                {
-                    // Log a warning if there is a UUID mismatch, this will cause problems
-                    if (value.UUID != uuid)
-                        Client.Log("Inventory[uuid]: uuid " + uuid.ToString() + " is not equal to value.UUID " +
-                            value.UUID.ToString(), Helpers.LogLevel.Warning);
-
-                    UpdateNodeFor(value);
-                }
-                else
-                {
-                    InventoryNode node;
-                    if (Items.TryGetValue(uuid, out node))
-                    {
-                        RemoveNodeFor(node.Data);
-                    }
-                }
-            }
-        }
-
-        #endregion Operators
-
-        #region Event Firing
-
-        protected void FireOnInventoryObjectUpdated(InventoryBase oldObject, InventoryBase newObject)
-        {
-            if (OnInventoryObjectUpdated != null)
-            {
-                try { OnInventoryObjectUpdated(oldObject, newObject); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnInventoryObjectRemoved(InventoryBase obj)
-        {
-            if (OnInventoryObjectRemoved != null)
-            {
-                try { OnInventoryObjectRemoved(obj); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        #endregion
-    }
-}
diff --git a/old/libsl1550/libsecondlife/InventoryManager.cs b/old/libsl1550/libsecondlife/InventoryManager.cs
deleted file mode 100644
index b7ad54b..0000000
--- a/old/libsl1550/libsecondlife/InventoryManager.cs
+++ /dev/null
@@ -1,2602 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Text;
-using libsecondlife.Capabilities;
-using libsecondlife.StructuredData;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    #region Enums
-
-    public enum InventoryType : sbyte
-    {
-        Unknown = -1,
-        Texture = 0,
-        Sound = 1,
-        CallingCard = 2,
-        Landmark = 3,
-        [Obsolete] Script = 4,
-        [Obsolete] Clothing = 5,
-        Object = 6,
-        Notecard = 7,
-        Category = 8,
-        Folder = 8,
-        RootCategory = 0,
-        LSL = 10,
-        [Obsolete] LSLBytecode = 11,
-        [Obsolete] TextureTGA = 12,
-        [Obsolete] Bodypart = 13,
-        [Obsolete] Trash = 14,
-        Snapshot = 15,
-        [Obsolete] LostAndFound = 16,
-        Attachment = 17,
-        Wearable = 18,
-        Animation = 19,
-        Gesture = 20
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public enum SaleType : byte
-    {
-        /// <summary>Not for sale</summary>
-        Not = 0,
-        /// <summary>The original is for sale</summary>
-        Original = 1,
-        /// <summary>Copies are for sale</summary>
-        Copy = 2,
-        /// <summary>The contents of the object are for sale</summary>
-        Contents = 3
-    }
-
-    [Flags]
-    public enum InventorySortOrder : int
-    {
-        /// <summary>Sort by name</summary>
-        ByName = 0,
-        /// <summary>Sort by date</summary>
-        ByDate = 1,
-        /// <summary>Sort folders by name, regardless of whether items are
-        /// sorted by name or date</summary>
-        FoldersByName = 2,
-        /// <summary>Place system folders at the top</summary>
-        SystemFoldersToTop = 4
-    }
-
-    #endregion Enums
-
-    #region Inventory Object Classes
-
-    public abstract class InventoryBase
-    {
-        public readonly LLUUID UUID;
-        public LLUUID ParentUUID;
-        public string Name;
-        public LLUUID OwnerID;
-
-        public InventoryBase(LLUUID itemID)
-        {
-            if (itemID == LLUUID.Zero)
-                throw new ArgumentException("Inventory item ID cannot be NULL_KEY (LLUUID.Zero)");
-            UUID = itemID;
-        }
-
-        public override int GetHashCode()
-        {
-            return UUID.GetHashCode() ^ ParentUUID.GetHashCode() ^ Name.GetHashCode() ^ OwnerID.GetHashCode();
-        }
-
-        public override bool Equals(object o)
-        {
-            InventoryBase inv = o as InventoryBase;
-            return inv != null && Equals(inv);
-        }
-
-        public virtual bool Equals(InventoryBase o)
-        {
-            return o.UUID == UUID
-                && o.ParentUUID == ParentUUID
-                && o.Name == Name
-                && o.OwnerID == OwnerID;
-        }
-    }
-
-    public class InventoryItem : InventoryBase
-    {
-        public LLUUID AssetUUID;
-        public Permissions Permissions;
-        public AssetType AssetType;
-        public InventoryType InventoryType;
-        public LLUUID CreatorID;
-        public string Description;
-        public LLUUID GroupID;
-        public bool GroupOwned;
-        public int SalePrice;
-        public SaleType SaleType;
-        public uint Flags;
-        /// <summary>Time and date this inventory item was created, stored as
-        /// UTC (Coordinated Universal Time)</summary>
-        public DateTime CreationDate;
-
-        public InventoryItem(LLUUID itemID)
-            : base(itemID) { }
-
-        public InventoryItem(InventoryType type, LLUUID itemID) : base(itemID) { InventoryType = type; }
-
-        public override int GetHashCode()
-        {
-            return AssetUUID.GetHashCode() ^ Permissions.GetHashCode() ^ AssetType.GetHashCode() ^
-                InventoryType.GetHashCode() ^ Description.GetHashCode() ^ GroupID.GetHashCode() ^
-                GroupOwned.GetHashCode() ^ SalePrice.GetHashCode() ^ SaleType.GetHashCode() ^
-                Flags.GetHashCode() ^ CreationDate.GetHashCode();
-        }
-
-        public override bool Equals(object o)
-        {
-            InventoryItem item = o as InventoryItem;
-            return item != null && Equals(item);
-        }
-
-        public override bool Equals(InventoryBase o)
-        {
-            InventoryItem item = o as InventoryItem;
-            return item != null && Equals(item);
-        }
-
-        public bool Equals(InventoryItem o)
-        {
-            return base.Equals(o as InventoryBase)
-                && o.AssetType == AssetType
-                && o.AssetUUID == AssetUUID
-                && o.CreationDate == CreationDate
-                && o.Description == Description
-                && o.Flags == Flags
-                && o.GroupID == GroupID
-                && o.GroupOwned == GroupOwned
-                && o.InventoryType == InventoryType
-                && o.Permissions.Equals(Permissions)
-                && o.SalePrice == SalePrice
-                && o.SaleType == SaleType;
-        }
-    }
-
-    public class InventoryTexture     : InventoryItem { public InventoryTexture(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Texture; } }
-    public class InventorySound       : InventoryItem { public InventorySound(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Sound; } }
-    public class InventoryCallingCard : InventoryItem { public InventoryCallingCard(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.CallingCard; } }
-    public class InventoryLandmark    : InventoryItem { public InventoryLandmark(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Landmark; } }
-    public class InventoryObject      : InventoryItem { public InventoryObject(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Object; } }
-    public class InventoryNotecard    : InventoryItem { public InventoryNotecard(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Notecard; } }
-    public class InventoryCategory    : InventoryItem { public InventoryCategory(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Category; } }
-    public class InventoryLSL         : InventoryItem { public InventoryLSL(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.LSL; } }
-    public class InventorySnapshot    : InventoryItem { public InventorySnapshot(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Snapshot; } }
-    public class InventoryAttachment  : InventoryItem { public InventoryAttachment(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Attachment; } }
-
-    public class InventoryWearable : InventoryItem
-    {
-        public InventoryWearable(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Wearable; }
-
-        public WearableType WearableType
-        {
-            get { return (WearableType)Flags; }
-            set { Flags = (uint)value; }
-        }
-    }
-
-    public class InventoryAnimation   : InventoryItem { public InventoryAnimation(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Animation; } }
-    public class InventoryGesture     : InventoryItem { public InventoryGesture(LLUUID itemID) : base(itemID) { InventoryType = InventoryType.Gesture; } }
-
-    public class InventoryFolder : InventoryBase
-    {
-        public AssetType PreferredType;
-        public int Version;
-        public int DescendentCount;
-
-        public InventoryFolder(LLUUID itemID)
-            : base(itemID) { }
-
-        public override string ToString()
-        {
-            return Name;
-        }
-
-        public override int GetHashCode()
-        {
-            return PreferredType.GetHashCode() ^ Version.GetHashCode() ^ DescendentCount.GetHashCode();
-        }
-
-        public override bool Equals(object o)
-        {
-            InventoryFolder folder = o as InventoryFolder;
-            return folder != null && Equals(folder);
-        }
-
-        public override bool Equals(InventoryBase o)
-        {
-            InventoryFolder folder = o as InventoryFolder;
-            return folder != null && Equals(folder);
-        }
-
-        public bool Equals(InventoryFolder o)
-        {
-            return base.Equals(o as InventoryBase)
-                && o.DescendentCount == DescendentCount
-                && o.PreferredType == PreferredType
-                && o.Version == Version;
-        }
-    }
-
-    #endregion Inventory Object Classes
-
-    public class InventoryManager
-    {
-        protected struct InventorySearch
-        {
-            public LLUUID Folder;
-            public LLUUID Owner;
-            public string[] Path;
-            public int Level;
-        }
-
-        #region Delegates
-
-        /// <summary>
-        /// Callback for inventory item creation finishing
-        /// </summary>
-        /// <param name="success">Whether the request to create an inventory
-        /// item succeeded or not</param>
-        /// <param name="item">Inventory item being created. If success is
-        /// false this will be null</param>
-        public delegate void ItemCreatedCallback(bool success, InventoryItem item);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="success"></param>
-        /// <param name="status"></param>
-        /// <param name="itemID"></param>
-        /// <param name="assetID"></param>
-        public delegate void ItemCreatedFromAssetCallback(bool success, string status, LLUUID itemID, LLUUID assetID);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="items"></param>
-        public delegate void ItemCopiedCallback(InventoryBase item);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="item"></param>
-        public delegate void ItemReceivedCallback(InventoryItem item);
-        /// <summary>
-        /// Callback for an inventory folder updating
-        /// </summary>
-        /// <param name="folderID">UUID of the folder that was updated</param>
-        public delegate void FolderUpdatedCallback(LLUUID folderID);
-        /// <summary>
-        /// Callback when an inventory object is received from another avatar
-        /// or a primitive
-        /// </summary>
-        /// <param name="fromAgentID"></param>
-        /// <param name="fromAgentName"></param>
-        /// <param name="parentEstateID"></param>
-        /// <param name="regionID"></param>
-        /// <param name="position"></param>
-        /// <param name="timestamp"></param>
-        /// <param name="type"></param>
-        /// <param name="objectID">Will be null if offered from a primitive</param>
-        /// <param name="fromTask"></param>
-        /// <returns>True to accept the inventory offer, false to reject it</returns>
-        public delegate bool ObjectOfferedCallback(LLUUID fromAgentID, string fromAgentName, uint parentEstateID,
-            LLUUID regionID, LLVector3 position, DateTime timestamp, AssetType type, LLUUID objectID, bool fromTask);
-        /// <summary>
-        /// Callback when an inventory object is accepted and received from a
-        /// task inventory. This is the callback in which you actually get
-        /// the ItemID, as in ObjectOfferedCallback it is null when received
-        /// from a task.
-        /// </summary>
-        /// <param name="ItemID"></param>
-        /// <param name="FolderID"></param>
-        /// <param name="CreatorID"></param>
-        /// <param name="AssetID"></param>
-        public delegate void TaskItemReceivedCallback(LLUUID itemID, LLUUID folderID, LLUUID creatorID,
-            LLUUID assetID, InventoryType type);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="path"></param>
-        /// <param name="inventoryObjectID"></param>
-        public delegate void FindObjectByPathCallback(string path, LLUUID inventoryObjectID);
-        /// <summary>
-        /// Reply received after calling <code>RequestTaskInventory</code>,
-        /// contains a filename that can be used in an asset download request
-        /// </summary>
-        /// <param name="itemID">UUID of the inventory item</param>
-        /// <param name="serial">Version number of the task inventory asset</param>
-        /// <param name="assetFilename">Filename of the task inventory asset</param>
-        public delegate void TaskInventoryReplyCallback(LLUUID itemID, short serial, string assetFilename);
-
-        #endregion Delegates
-
-        #region Events
-
-        public event ItemReceivedCallback OnItemReceived;
-        public event FolderUpdatedCallback OnFolderUpdated;
-        public event ObjectOfferedCallback OnObjectOffered;
-        public event TaskItemReceivedCallback OnTaskItemReceived;
-        public event FindObjectByPathCallback OnFindObjectByPath;
-        public event TaskInventoryReplyCallback OnTaskInventoryReply;
-
-        #endregion Events
-
-        private SecondLife _Client;
-        private Inventory _Store;
-        private Random _RandNumbers = new Random();
-        private object _CallbacksLock = new object();
-        private uint _CallbackPos;
-        private Dictionary<uint, ItemCreatedCallback> _ItemCreatedCallbacks = new Dictionary<uint, ItemCreatedCallback>();
-        private Dictionary<uint, ItemCopiedCallback> _ItemCopiedCallbacks = new Dictionary<uint,ItemCopiedCallback>();
-        private List<InventorySearch> _Searches = new List<InventorySearch>();
-
-        #region String Arrays
-
-        /// <summary>Partial mapping of AssetTypes to folder names</summary>
-        private static readonly string[] _NewFolderNames = new string[]
-        {
-            "Textures",
-            "Sounds",
-            "Calling Cards",
-            "Landmarks",
-            "Scripts",
-            "Clothing",
-            "Objects",
-            "Notecards",
-            "New Folder",
-            "Inventory",
-            "Scripts",
-            "Scripts",
-            "Uncompressed Images",
-            "Body Parts",
-            "Trash",
-            "Photo Album",
-            "Lost And Found",
-            "Uncompressed Sounds",
-            "Uncompressed Images",
-            "Uncompressed Images",
-            "Animations",
-            "Gestures"
-        };
-
-        private static readonly string[] _AssetTypeNames = new string[]
-        {
-            "texture",
-	        "sound",
-	        "callcard",
-	        "landmark",
-	        "script",
-	        "clothing",
-	        "object",
-	        "notecard",
-	        "category",
-	        "root",
-	        "lsltext",
-	        "lslbyte",
-	        "txtr_tga",
-	        "bodypart",
-	        "trash",
-	        "snapshot",
-	        "lstndfnd",
-	        "snd_wav",
-	        "img_tga",
-	        "jpeg",
-	        "animatn",
-	        "gesture",
-	        "simstate"
-        };
-
-        private static readonly string[] _InventoryTypeNames = new string[]
-        {
-            "texture",
-	        "sound",
-	        "callcard",
-	        "landmark",
-	        String.Empty,
-	        String.Empty,
-	        "object",
-	        "notecard",
-	        "category",
-	        "root",
-	        "script",
-	        String.Empty,
-	        String.Empty,
-	        String.Empty,
-	        String.Empty,
-	        "snapshot",
-	        String.Empty,
-	        "attach",
-	        "wearable",
-	        "animation",
-	        "gesture",
-        };
-
-        private static readonly string[] _SaleTypeNames = new string[]
-        {
-            "not",
-            "orig",
-            "copy",
-            "cntn"
-        };
-
-        #endregion String Arrays
-
-        #region Properties
-
-        public Inventory Store { get { return _Store; } }
-
-        #endregion Properties
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client">Reference to the SecondLife client</param>
-        public InventoryManager(SecondLife client)
-        {
-            _Client = client;
-            _Store = new Inventory(client, this);
-
-            _Client.Network.RegisterCallback(PacketType.UpdateCreateInventoryItem, new NetworkManager.PacketCallback(UpdateCreateInventoryItemHandler));
-            _Client.Network.RegisterCallback(PacketType.SaveAssetIntoInventory, new NetworkManager.PacketCallback(SaveAssetIntoInventoryHandler));
-            _Client.Network.RegisterCallback(PacketType.BulkUpdateInventory, new NetworkManager.PacketCallback(BulkUpdateInventoryHandler));
-            _Client.Network.RegisterCallback(PacketType.MoveInventoryItem, new NetworkManager.PacketCallback(MoveInventoryItemHandler));
-            _Client.Network.RegisterCallback(PacketType.InventoryDescendents, new NetworkManager.PacketCallback(InventoryDescendentsHandler));
-            _Client.Network.RegisterCallback(PacketType.FetchInventoryReply, new NetworkManager.PacketCallback(FetchInventoryReplyHandler));
-            _Client.Network.RegisterCallback(PacketType.ReplyTaskInventory, new NetworkManager.PacketCallback(ReplyTaskInventoryHandler));
-
-            // Watch for inventory given to us through instant message
-            _Client.Self.OnInstantMessage += new AgentManager.InstantMessageCallback(Self_OnInstantMessage);
-
-            // Register extra parameters with login and parse the inventory data that comes back
-            _Client.Network.RegisterLoginResponseCallback(
-                new NetworkManager.LoginResponseCallback(Network_OnLoginResponse),
-                new string[] {
-                    "inventory-root", "inventory-skeleton", "inventory-lib-root",
-                    "inventory-lib-owner", "inventory-skel-lib"});
-        }
-
-
-        //public IAsyncResult BeginFindObjects(LLUUID baseFolder, string regex, bool recurse, bool refresh, bool firstOnly, AsyncCallback callback, object asyncState)
-        //{
-        //    return BeginFindObjects(baseFolder, new Regex(regex), recurse, refresh, firstOnly, callback, asyncState);
-        //}
-
-        //public IAsyncResult BeginFindObjects(LLUUID baseFolder, Regex regexp, bool recurse, bool refresh, bool firstOnly, AsyncCallback callback, object asyncState)
-        //{
-        //    FindResult result = new FindResult(regexp, recurse, callback);
-        //    result.FirstOnly = firstOnly;
-        //    result.AsyncState = asyncState;
-        //    result.FoldersWaiting = 1;
-        //    if (refresh)
-        //    {
-        //        lock (FindDescendantsMap)
-        //        {
-        //            IAsyncResult descendReq = BeginRequestFolderContents(baseFolder, _Client.Self.AgentID, true, true, recurse && !firstOnly, InventorySortOrder.ByName, new AsyncCallback(SearchDescendantsCallback), baseFolder);
-        //            FindDescendantsMap.Add(descendReq, result);
-        //        }
-        //    }
-        //    else
-        //    {
-        //        result.Result = LocalFind(baseFolder, regexp, recurse, firstOnly);
-        //        result.CompletedSynchronously = true;
-        //        result.IsCompleted = true;
-        //    }
-        //    return result;
-        //}
-
-        //private List<InventoryBase> LocalFind(LLUUID baseFolder, Regex regexp, bool recurse, bool firstOnly)
-        //{
-        //    List<InventoryBase> objects = new List<InventoryBase>();
-        //    List<InventoryFolder> folders = new List<InventoryFolder>();
-
-        //    List<InventoryBase> contents = _Store.GetContents(baseFolder);
-        //    foreach (InventoryBase inv in contents)
-        //    {
-        //        if (regexp.IsMatch(inv.Name))
-        //        {
-        //            objects.Add(inv);
-        //            if (firstOnly)
-        //                return objects;
-        //        }
-        //        if (inv is InventoryFolder)
-        //        {
-        //            folders.Add(inv as InventoryFolder);
-        //        }
-        //    }
-        //    // Recurse outside of the loop because subsequent calls to FindObjects may
-        //    // modify the baseNode.Nodes collection.
-        //    // FIXME: I'm pretty sure this is not necessary
-        //    if (recurse)
-        //    {
-        //        foreach (InventoryFolder folder in folders)
-        //        {
-        //            objects.AddRange(LocalFind(folder.UUID, regexp, true, firstOnly));
-        //        }
-        //    }
-        //    return objects;
-        //}
-
-        //public List<InventoryBase> FindObjectsByPath(LLUUID baseFolder, string[] path, bool refresh, bool firstOnly)
-        //{
-        //    IAsyncResult r = BeginFindObjectsByPath(baseFolder, path, refresh, firstOnly, null, null, true);
-        //    return EndFindObjects(r);
-        //}
-
-        //public IAsyncResult BeginFindObjectsByPath(LLUUID baseFolder, string[] path, bool refresh, bool firstOnly, AsyncCallback callback, object asyncState, bool recurse)
-        //{
-        //    if (path.Length == 0)
-        //        throw new ArgumentException("Empty path is not supported");
-        //    FindResult result = new FindResult(new Regex(String.Join("/",path)), recurse, callback);
-        //    result.FirstOnly = firstOnly;
-        //    result.AsyncState = asyncState;
-
-        //    if (refresh)
-        //    {
-        //        result.FoldersWaiting = 1;
-        //        BeginRequestFolderContents(
-        //            baseFolder,
-        //            _Client.Self.AgentID,
-        //            true,
-        //            true,
-        //            false,
-        //            InventorySortOrder.ByName,
-        //            new AsyncCallback(FindObjectsByPathCallback),
-        //            new FindObjectsByPathState(result, baseFolder, 0));
-        //    }
-        //    else
-        //    {
-        //        result.Result = LocalFind(baseFolder, path, 0, firstOnly);
-        //        result.CompletedSynchronously = true;
-        //        result.IsCompleted = true;
-        //    }
-
-        //    return result;
-        //}
-
-        #region Fetch
-
-        public InventoryItem FetchItem(LLUUID itemID, LLUUID ownerID, int timeoutMS)
-        {
-            AutoResetEvent fetchEvent = new AutoResetEvent(false);
-            InventoryItem fetchedItem = null;
-
-            ItemReceivedCallback callback =
-                delegate(InventoryItem item)
-                {
-                    if (item.UUID == itemID)
-                    {
-                        fetchedItem = item;
-                        fetchEvent.Set();
-                    }
-                };
-
-            OnItemReceived += callback;
-            RequestFetchInventory(itemID, ownerID);
-
-            fetchEvent.WaitOne(timeoutMS, false);
-            OnItemReceived -= callback;
-
-            return fetchedItem;
-        }
-
-        public void RequestFetchInventory(LLUUID itemID, LLUUID ownerID)
-        {
-            FetchInventoryPacket fetch = new FetchInventoryPacket();
-            fetch.AgentData = new FetchInventoryPacket.AgentDataBlock();
-            fetch.AgentData.AgentID = _Client.Self.AgentID;
-            fetch.AgentData.SessionID = _Client.Self.SessionID;
-
-            fetch.InventoryData = new FetchInventoryPacket.InventoryDataBlock[1];
-            fetch.InventoryData[0] = new FetchInventoryPacket.InventoryDataBlock();
-            fetch.InventoryData[0].ItemID = itemID;
-            fetch.InventoryData[0].OwnerID = ownerID;
-
-            _Client.Network.SendPacket(fetch);
-        }
-
-        /// <summary>
-        /// Request inventory items
-        /// </summary>
-        /// <param name="itemIDs">Inventory items to request</param>
-        /// <param name="ownerIDs">Owners of the inventory items</param>
-        public void RequestFetchInventory(List<LLUUID> itemIDs, List<LLUUID> ownerIDs)
-        {
-            if (itemIDs.Count != ownerIDs.Count)
-                throw new ArgumentException("itemIDs and ownerIDs must contain the same number of entries");
-
-            FetchInventoryPacket fetch = new FetchInventoryPacket();
-            fetch.AgentData = new FetchInventoryPacket.AgentDataBlock();
-            fetch.AgentData.AgentID = _Client.Self.AgentID;
-            fetch.AgentData.SessionID = _Client.Self.SessionID;
-
-            fetch.InventoryData = new FetchInventoryPacket.InventoryDataBlock[itemIDs.Count];
-            for (int i = 0; i < itemIDs.Count; i++)
-            {
-                fetch.InventoryData[i] = new FetchInventoryPacket.InventoryDataBlock();
-                fetch.InventoryData[i].ItemID = itemIDs[i];
-                fetch.InventoryData[i].OwnerID = ownerIDs[i];
-            }
-
-            _Client.Network.SendPacket(fetch);
-        }
-
-        public List<InventoryBase> FolderContents(LLUUID folder, LLUUID owner, bool folders, bool items,
-            InventorySortOrder order, int timeoutMS)
-        {
-            List<InventoryBase> objects = null;
-            AutoResetEvent fetchEvent = new AutoResetEvent(false);
-
-            FolderUpdatedCallback callback =
-                delegate(LLUUID folderID)
-                {
-                    if (folderID == folder)
-                        fetchEvent.Set();
-                };
-
-            OnFolderUpdated += callback;
-
-            RequestFolderContents(folder, owner, folders, items, order);
-            if (fetchEvent.WaitOne(timeoutMS, false))
-                objects = _Store.GetContents(folder);
-
-            OnFolderUpdated -= callback;
-
-            return objects;
-        }
-
-        public void RequestFolderContents(LLUUID folder, LLUUID owner, bool folders, bool items,
-            InventorySortOrder order)
-        {
-            FetchInventoryDescendentsPacket fetch = new FetchInventoryDescendentsPacket();
-            fetch.AgentData.AgentID = _Client.Self.AgentID;
-            fetch.AgentData.SessionID = _Client.Self.SessionID;
-
-            fetch.InventoryData.FetchFolders = folders;
-            fetch.InventoryData.FetchItems = items;
-            fetch.InventoryData.FolderID = folder;
-            fetch.InventoryData.OwnerID = owner;
-            fetch.InventoryData.SortOrder = (int)order;
-
-            _Client.Network.SendPacket(fetch);
-        }
-
-        #endregion Fetch
-
-        #region Find
-
-        /// <summary>
-        /// Returns the UUID of the folder (category) that defaults to
-        /// containing 'type'. The folder is not necessarily only for that
-        /// type
-        /// </summary>
-        /// <remarks>This will return the root folder if one does not exist</remarks>
-        /// <param name="type"></param>
-        /// <returns>The UUID of the desired folder if found, the UUID of the RootFolder
-        /// if not found, or LLUUID.Zero on failure</returns>
-        public LLUUID FindFolderForType(AssetType type)
-        {
-            if (_Store == null)
-            {
-                _Client.Log("Inventory is null, FindFolderForType() lookup cannot continue",
-                    Helpers.LogLevel.Error);
-                return LLUUID.Zero;
-            }
-
-            // Folders go in the root
-            if (type == AssetType.Folder)
-                return _Store.RootFolder.UUID;
-
-            // Loop through each top-level directory and check if PreferredType
-            // matches the requested type
-            List<InventoryBase> contents = _Store.GetContents(_Store.RootFolder.UUID);
-            foreach (InventoryBase inv in contents)
-            {
-                if (inv is InventoryFolder)
-                {
-                    InventoryFolder folder = inv as InventoryFolder;
-
-                    if (folder.PreferredType == type)
-                        return folder.UUID;
-                }
-            }
-
-            // No match found, return Root Folder ID
-            return _Store.RootFolder.UUID;
-        }
-
-        public LLUUID FindObjectByPath(LLUUID baseFolder, LLUUID inventoryOwner, string path, int timeoutMS)
-        {
-            AutoResetEvent findEvent = new AutoResetEvent(false);
-            LLUUID foundItem = LLUUID.Zero;
-
-            FindObjectByPathCallback callback =
-                delegate(string thisPath, LLUUID inventoryObjectID)
-                {
-                    if (thisPath == path)
-                    {
-                        foundItem = inventoryObjectID;
-                        findEvent.Set();
-                    }
-                };
-
-            OnFindObjectByPath += callback;
-
-            RequestFindObjectByPath(baseFolder, inventoryOwner, path);
-            findEvent.WaitOne(timeoutMS, false);
-
-            OnFindObjectByPath -= callback;
-
-            return foundItem;
-        }
-
-        public void RequestFindObjectByPath(LLUUID baseFolder, LLUUID inventoryOwner, string path)
-        {
-
-            if (path == null || path.Length == 0)
-                throw new ArgumentException("Empty path is not supported");
-
-            // Store this search
-            InventorySearch search;
-            search.Folder = baseFolder;
-            search.Owner = inventoryOwner;
-            search.Path = path.Split('/');
-            search.Level = 0;
-            lock (_Searches) _Searches.Add(search);
-
-            // Start the search
-            RequestFolderContents(baseFolder, inventoryOwner, true, true, InventorySortOrder.ByName);
-        }
-
-        public List<InventoryBase> LocalFind(LLUUID baseFolder, string[] path, int level, bool firstOnly)
-        {
-            List<InventoryBase> objects = new List<InventoryBase>();
-            //List<InventoryFolder> folders = new List<InventoryFolder>();
-            List<InventoryBase> contents = _Store.GetContents(baseFolder);
-
-            foreach (InventoryBase inv in contents)
-            {
-                if (inv.Name.CompareTo(path[level]) == 0)
-                {
-                    if (level == path.Length - 1)
-                    {
-                        objects.Add(inv);
-                        if (firstOnly) return objects;
-                    }
-                    else if (inv is InventoryFolder)
-                        objects.AddRange(LocalFind(inv.UUID, path, level + 1, firstOnly));
-                }
-            }
-
-            return objects;
-        }
-
-        #endregion Find
-
-        #region Move
-
-        public void Move(InventoryBase item, InventoryFolder newParent)
-        {
-            if (item is InventoryFolder)
-                MoveFolder(item.UUID, newParent.UUID);
-            else
-                MoveItem(item.UUID, newParent.UUID);
-        }
-
-        public void MoveFolder(LLUUID folder, LLUUID newParent)
-        {
-            lock (Store)
-            {
-                if (_Store.Contains(folder))
-                {
-                    InventoryBase inv = Store[folder];
-                    inv.ParentUUID = newParent;
-                    _Store.UpdateNodeFor(inv);
-                }
-            }
-
-            MoveInventoryFolderPacket move = new MoveInventoryFolderPacket();
-            move.AgentData.AgentID = _Client.Self.AgentID;
-            move.AgentData.SessionID = _Client.Self.SessionID;
-            move.AgentData.Stamp = false; //FIXME: ??
-
-            move.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[1];
-            move.InventoryData[0] = new MoveInventoryFolderPacket.InventoryDataBlock();
-            move.InventoryData[0].FolderID = folder;
-            move.InventoryData[0].ParentID = newParent;
-
-            _Client.Network.SendPacket(move);
-        }
-
-        /// <summary>
-        /// Moves the folders, the keys in the Dictionary parameter,
-        /// to a new parents, the value of that folder's key.
-        /// </summary>
-        /// <param name="FoldersNewParents"></param>
-        public void MoveFolders(Dictionary<LLUUID, LLUUID> foldersNewParents)
-        {
-            // FIXME: Use two List<LLUUID> to stay consistent
-
-            lock (Store)
-            {
-                foreach (KeyValuePair<LLUUID, LLUUID> entry in foldersNewParents)
-                {
-                    if (_Store.Contains(entry.Key))
-                    {
-                        InventoryBase inv = _Store[entry.Key];
-                        inv.ParentUUID = entry.Value;
-                        _Store.UpdateNodeFor(inv);
-                    }
-                }
-            }
-
-            //TODO: Test if this truly supports multiple-folder move
-            MoveInventoryFolderPacket move = new MoveInventoryFolderPacket();
-            move.AgentData.AgentID = _Client.Self.AgentID;
-            move.AgentData.SessionID = _Client.Self.SessionID;
-            move.AgentData.Stamp = false; //FIXME: ??
-
-            move.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[foldersNewParents.Count];
-
-            int index = 0;
-            foreach (KeyValuePair<LLUUID, LLUUID> folder in foldersNewParents)
-            {
-                MoveInventoryFolderPacket.InventoryDataBlock block = new MoveInventoryFolderPacket.InventoryDataBlock();
-                block.FolderID = folder.Key;
-                block.ParentID = folder.Value;
-                move.InventoryData[index++] = block;
-            }
-
-            _Client.Network.SendPacket(move);
-        }
-
-        public void MoveItem(LLUUID item, LLUUID folder)
-        {
-            MoveItem(item, folder, String.Empty);
-        }
-
-        public void MoveItem(LLUUID item, LLUUID folder, string newItemName)
-        {
-            lock (_Store)
-            {
-                    if (_Store.Contains(item))
-                    {
-                        InventoryBase inv = _Store[item];
-                        inv.ParentUUID = folder;
-                        _Store.UpdateNodeFor(inv);
-                    }
-            }
-
-            MoveInventoryItemPacket move = new MoveInventoryItemPacket();
-            move.AgentData.AgentID = _Client.Self.AgentID;
-            move.AgentData.SessionID = _Client.Self.SessionID;
-            move.AgentData.Stamp = false; //FIXME: ??
-
-            move.InventoryData = new MoveInventoryItemPacket.InventoryDataBlock[1];
-            move.InventoryData[0] = new MoveInventoryItemPacket.InventoryDataBlock();
-            move.InventoryData[0].ItemID = item;
-            move.InventoryData[0].FolderID = folder;
-            move.InventoryData[0].NewName = Helpers.StringToField(newItemName);
-
-            _Client.Network.SendPacket(move);
-        }
-
-        public void MoveItems(Dictionary<LLUUID, LLUUID> itemsNewParents)
-        {
-            lock (_Store)
-            {
-                foreach (KeyValuePair<LLUUID, LLUUID> entry in itemsNewParents)
-                {
-                    if (_Store.Contains(entry.Key))
-                    {
-                        InventoryBase inv = _Store[entry.Key];
-                        inv.ParentUUID = entry.Value;
-                        _Store.UpdateNodeFor(inv);
-                    }
-                }
-            }
-
-            MoveInventoryItemPacket move = new MoveInventoryItemPacket();
-            move.AgentData.AgentID = _Client.Self.AgentID;
-            move.AgentData.SessionID = _Client.Self.SessionID;
-            move.AgentData.Stamp = false; //FIXME: ??
-
-            move.InventoryData = new MoveInventoryItemPacket.InventoryDataBlock[itemsNewParents.Count];
-
-            int index = 0;
-            foreach (KeyValuePair<LLUUID, LLUUID> entry in itemsNewParents)
-            {
-                MoveInventoryItemPacket.InventoryDataBlock block = new MoveInventoryItemPacket.InventoryDataBlock();
-                block.ItemID = entry.Key;
-                block.FolderID = entry.Value;
-                block.NewName = new byte[0];
-                move.InventoryData[index++] = block;
-            }
-
-            _Client.Network.SendPacket(move);
-        }
-
-        #endregion Move
-
-        #region Remove
-
-        public void RemoveDescendants(LLUUID folder)
-        {
-            PurgeInventoryDescendentsPacket purge = new PurgeInventoryDescendentsPacket();
-            purge.AgentData.AgentID = _Client.Self.AgentID;
-            purge.AgentData.SessionID = _Client.Self.SessionID;
-            purge.InventoryData.FolderID = folder;
-            _Client.Network.SendPacket(purge);
-
-            // Update our local copy
-            lock (_Store)
-            {
-                if (_Store.Contains(folder))
-                {
-                    List<InventoryBase> contents = _Store.GetContents(folder);
-                    foreach (InventoryBase obj in contents)
-                    {
-                        _Store.RemoveNodeFor(obj);
-                    }
-                }
-            }
-        }
-
-        public void RemoveItem(LLUUID item)
-        {
-            List<LLUUID> items = new List<LLUUID>(1);
-            items.Add(item);
-
-            Remove(items, null);
-        }
-
-        public void RemoveFolder(LLUUID folder)
-        {
-            List<LLUUID> folders = new List<LLUUID>(1);
-            folders.Add(folder);
-
-            Remove(null, folders);
-        }
-
-        public void Remove(List<LLUUID> items, List<LLUUID> folders)
-        {
-            if ((items == null || items.Count == 0) && (folders == null || folders.Count == 0))
-                return;
-
-            RemoveInventoryObjectsPacket rem = new RemoveInventoryObjectsPacket();
-            rem.AgentData.AgentID = _Client.Self.AgentID;
-            rem.AgentData.SessionID = _Client.Self.SessionID;
-
-            if (items == null || items.Count == 0)
-            {
-                // To indicate that we want no items removed:
-                rem.ItemData = new RemoveInventoryObjectsPacket.ItemDataBlock[1];
-                rem.ItemData[0] = new RemoveInventoryObjectsPacket.ItemDataBlock();
-                rem.ItemData[0].ItemID = LLUUID.Zero;
-            }
-            else
-            {
-                lock (_Store)
-                {
-                    rem.ItemData = new RemoveInventoryObjectsPacket.ItemDataBlock[items.Count];
-                    for (int i = 0; i < items.Count; i++)
-                    {
-                        rem.ItemData[i] = new RemoveInventoryObjectsPacket.ItemDataBlock();
-                        rem.ItemData[i].ItemID = items[i];
-
-                        // Update local copy
-                        if (_Store.Contains(items[i]))
-                            _Store.RemoveNodeFor(Store[items[i]]);
-                    }
-                }
-            }
-
-            if (folders == null || folders.Count == 0)
-            {
-                // To indicate we want no folders removed:
-                rem.FolderData = new RemoveInventoryObjectsPacket.FolderDataBlock[1];
-                rem.FolderData[0] = new RemoveInventoryObjectsPacket.FolderDataBlock();
-                rem.FolderData[0].FolderID = LLUUID.Zero;
-            }
-            else
-            {
-                lock (_Store)
-                {
-                    rem.FolderData = new RemoveInventoryObjectsPacket.FolderDataBlock[folders.Count];
-                    for (int i = 0; i < folders.Count; i++)
-                    {
-                        rem.FolderData[i] = new RemoveInventoryObjectsPacket.FolderDataBlock();
-                        rem.FolderData[i].FolderID = folders[i];
-
-                        // Update local copy
-                        if (_Store.Contains(folders[i]))
-                            _Store.RemoveNodeFor(Store[folders[i]]);
-                    }
-                }
-            }
-            _Client.Network.SendPacket(rem);
-        }
-
-        public void EmptyLostAndFound()
-        {
-            EmptySystemFolder(AssetType.LostAndFoundFolder);
-        }
-        public void EmptyTrash()
-        {
-            EmptySystemFolder(AssetType.TrashFolder);
-        }
-        private void EmptySystemFolder(AssetType folderType)
-        {
-            List<InventoryBase> items = _Store.GetContents(_Store.RootFolder);
-
-            LLUUID folderKey = LLUUID.Zero;
-            foreach (InventoryBase item in items)
-            {
-                if ((item as InventoryFolder) != null)
-                {
-                    InventoryFolder folder = item as InventoryFolder;
-                    if (folder.PreferredType == folderType)
-                    {
-                        folderKey = folder.UUID;
-                        break;
-                    }
-                }
-            }
-            items = _Store.GetContents(folderKey);
-            List<LLUUID> remItems = new List<LLUUID>();
-            List<LLUUID> remFolders = new List<LLUUID>();
-            foreach (InventoryBase item in items)
-            {
-                if ((item as InventoryFolder) != null)
-                {
-                    remFolders.Add(item.UUID);
-                }
-                else
-                {
-                    remItems.Add(item.UUID);
-                }
-            }
-            Remove(remItems, remFolders);
-        }
-        #endregion Remove
-
-        #region Create
-
-        public void RequestCreateItem(LLUUID parentFolder, string name, string description, AssetType type,
-            InventoryType invType, PermissionMask nextOwnerMask, ItemCreatedCallback callback)
-        {
-            // Even though WearableType 0 is Shape, in this context it is treated as NOT_WEARABLE
-            RequestCreateItem(parentFolder, name, description, type, invType, (WearableType)0, nextOwnerMask,
-                callback);
-        }
-
-        public void RequestCreateItem(LLUUID parentFolder, string name, string description, AssetType type,
-            InventoryType invType, WearableType wearableType, PermissionMask nextOwnerMask,
-            ItemCreatedCallback callback)
-        {
-            CreateInventoryItemPacket create = new CreateInventoryItemPacket();
-            create.AgentData.AgentID = _Client.Self.AgentID;
-            create.AgentData.SessionID = _Client.Self.SessionID;
-
-            create.InventoryBlock.CallbackID = RegisterItemCreatedCallback(callback);
-            create.InventoryBlock.FolderID = parentFolder;
-            create.InventoryBlock.TransactionID = LLUUID.Random();
-            create.InventoryBlock.NextOwnerMask = (uint)nextOwnerMask;
-            create.InventoryBlock.Type = (sbyte)type;
-            create.InventoryBlock.InvType = (sbyte)invType;
-            create.InventoryBlock.WearableType = (byte)wearableType;
-            create.InventoryBlock.Name = Helpers.StringToField(name);
-            create.InventoryBlock.Description = Helpers.StringToField(description);
-
-            _Client.Network.SendPacket(create);
-        }
-
-        public LLUUID CreateFolder(LLUUID parentID, AssetType preferredType, string name)
-        {
-            LLUUID id = LLUUID.Random();
-
-            // Assign a folder name if one is not already set
-            if (String.IsNullOrEmpty(name))
-            {
-                if (preferredType >= AssetType.Texture && preferredType <= AssetType.Gesture)
-                {
-                    name = _NewFolderNames[(int)preferredType];
-                }
-                else
-                {
-                    name = "New Folder";
-                }
-            }
-
-            // Create the new folder locally
-            InventoryFolder newFolder = new InventoryFolder(id);
-            newFolder.Version = 1;
-            newFolder.DescendentCount = 0;
-            newFolder.ParentUUID = parentID;
-            newFolder.PreferredType = preferredType;
-            newFolder.Name = name;
-            newFolder.OwnerID = _Client.Self.AgentID;
-
-            // Update the local store
-            try { _Store[newFolder.UUID] = newFolder; }
-            catch (InventoryException ie) { _Client.Log(ie.Message, Helpers.LogLevel.Warning); }
-
-            // Create the create folder packet and send it
-            CreateInventoryFolderPacket create = new CreateInventoryFolderPacket();
-            create.AgentData.AgentID = _Client.Self.AgentID;
-            create.AgentData.SessionID = _Client.Self.SessionID;
-
-            create.FolderData.FolderID = id;
-            create.FolderData.ParentID = parentID;
-            create.FolderData.Type = (sbyte)preferredType;
-            create.FolderData.Name = Helpers.StringToField(name);
-
-            _Client.Network.SendPacket(create);
-
-            return id;
-        }
-
-        public void RequestCreateItemFromAsset(byte[] data, string name, string description, AssetType assetType,
-            InventoryType invType, LLUUID folderID, ItemCreatedFromAssetCallback callback)
-        {
-            if (_Client.Network.CurrentSim == null || _Client.Network.CurrentSim.Caps == null)
-                throw new Exception("NewFileAgentInventory capability is not currently available");
-
-            Uri url = _Client.Network.CurrentSim.Caps.CapabilityURI("NewFileAgentInventory");
-
-            if (url != null)
-            {
-                LLSDMap query = new LLSDMap();
-                query.Add("folder_id", LLSD.FromUUID(folderID));
-                query.Add("asset_type", LLSD.FromString(AssetTypeToString(assetType)));
-                query.Add("inventory_type", LLSD.FromString(InventoryTypeToString(invType)));
-                query.Add("name", LLSD.FromString(name));
-                query.Add("description", LLSD.FromString(description));
-
-                byte[] postData = StructuredData.LLSDParser.SerializeXmlBytes(query);
-
-                // Make the request
-                CapsClient request = new CapsClient(url);
-                request.OnComplete += new CapsClient.CompleteCallback(CreateItemFromAssetResponse);
-                request.UserData = new KeyValuePair<ItemCreatedFromAssetCallback, byte[]>(callback, data);
-                request.StartRequest(postData);
-            }
-            else
-            {
-                throw new Exception("NewFileAgentInventory capability is not currently available");
-            }
-        }
-
-        #endregion Create
-
-        #region Copy
-
-        public void RequestCopyItem(LLUUID item, LLUUID newParent, string newName, ItemCopiedCallback callback)
-        {
-            RequestCopyItem(item, newParent, newName, _Client.Self.AgentID, callback);
-        }
-
-        public void RequestCopyItem(LLUUID item, LLUUID newParent, string newName, LLUUID oldOwnerID,
-            ItemCopiedCallback callback)
-        {
-            List<LLUUID> items = new List<LLUUID>(1);
-            items.Add(item);
-
-            List<LLUUID> folders = new List<LLUUID>(1);
-            folders.Add(newParent);
-
-            List<string> names = new List<string>(1);
-            names.Add(newName);
-
-            RequestCopyItems(items, folders, names, oldOwnerID, callback);
-        }
-
-        public void RequestCopyItems(List<LLUUID> items, List<LLUUID> targetFolders, List<string> newNames,
-            LLUUID oldOwnerID, ItemCopiedCallback callback)
-        {
-            if (items.Count != targetFolders.Count || (newNames != null && items.Count != newNames.Count))
-                throw new ArgumentException("All list arguments must have an equal number of entries");
-
-            uint callbackID = RegisterItemsCopiedCallback(callback);
-
-            CopyInventoryItemPacket copy = new CopyInventoryItemPacket();
-            copy.AgentData.AgentID = _Client.Self.AgentID;
-            copy.AgentData.SessionID = _Client.Self.SessionID;
-
-            copy.InventoryData = new CopyInventoryItemPacket.InventoryDataBlock[items.Count];
-            for (int i = 0; i < items.Count; ++i)
-            {
-                copy.InventoryData[i] = new CopyInventoryItemPacket.InventoryDataBlock();
-                copy.InventoryData[i].CallbackID = callbackID;
-                copy.InventoryData[i].NewFolderID = targetFolders[i];
-                copy.InventoryData[i].OldAgentID = oldOwnerID;
-                copy.InventoryData[i].OldItemID = items[i];
-
-                if (newNames != null && !String.IsNullOrEmpty(newNames[i]))
-                    copy.InventoryData[i].NewName = Helpers.StringToField(newNames[i]);
-                else
-                    copy.InventoryData[i].NewName = new byte[0];
-            }
-
-            _Client.Network.SendPacket(copy);
-        }
-
-        public void RequestCopyItemFromNotecard(LLUUID objectID, LLUUID notecardID, LLUUID folderID, LLUUID itemID)
-        {
-            CopyInventoryFromNotecardPacket copy = new CopyInventoryFromNotecardPacket();
-            copy.AgentData.AgentID = _Client.Self.AgentID;
-            copy.AgentData.SessionID = _Client.Self.SessionID;
-
-            copy.NotecardData.ObjectID = objectID;
-            copy.NotecardData.NotecardItemID = notecardID;
-
-            copy.InventoryData = new CopyInventoryFromNotecardPacket.InventoryDataBlock[1];
-            copy.InventoryData[0] = new CopyInventoryFromNotecardPacket.InventoryDataBlock();
-            copy.InventoryData[0].FolderID = folderID;
-            copy.InventoryData[0].ItemID = itemID;
-
-            _Client.Network.SendPacket(copy);
-        }
-
-        #endregion Copy
-
-        #region Update
-
-        public void RequestUpdateItem(InventoryItem item)
-        {
-            List<InventoryItem> items = new List<InventoryItem>(1);
-            items.Add(item);
-
-            RequestUpdateItems(items, LLUUID.Random());
-        }
-
-        public void RequestUpdateItems(List<InventoryItem> items)
-        {
-            RequestUpdateItems(items, LLUUID.Random());
-        }
-
-        public void RequestUpdateItems(List<InventoryItem> items, LLUUID transactionID)
-        {
-            UpdateInventoryItemPacket update = new UpdateInventoryItemPacket();
-            update.AgentData.AgentID = _Client.Self.AgentID;
-            update.AgentData.SessionID = _Client.Self.SessionID;
-            update.AgentData.TransactionID = transactionID;
-
-            update.InventoryData = new UpdateInventoryItemPacket.InventoryDataBlock[items.Count];
-            for (int i = 0; i < items.Count; i++)
-            {
-                InventoryItem item = items[i];
-
-                UpdateInventoryItemPacket.InventoryDataBlock block = new UpdateInventoryItemPacket.InventoryDataBlock();
-                block.BaseMask = (uint)item.Permissions.BaseMask;
-                block.CRC = ItemCRC(item);
-                block.CreationDate = (int)Helpers.DateTimeToUnixTime(item.CreationDate);
-                block.CreatorID = item.CreatorID;
-                block.Description = Helpers.StringToField(item.Description);
-                block.EveryoneMask = (uint)item.Permissions.EveryoneMask;
-                block.Flags = item.Flags;
-                block.FolderID = item.ParentUUID;
-                block.GroupID = item.GroupID;
-                block.GroupMask = (uint)item.Permissions.GroupMask;
-                block.GroupOwned = item.GroupOwned;
-                block.InvType = (sbyte)item.InventoryType;
-                block.ItemID = item.UUID;
-                block.Name = Helpers.StringToField(item.Name);
-                block.NextOwnerMask = (uint)item.Permissions.NextOwnerMask;
-                block.OwnerID = item.OwnerID;
-                block.OwnerMask = (uint)item.Permissions.OwnerMask;
-                block.SalePrice = item.SalePrice;
-                block.SaleType = (byte)item.SaleType;
-                block.TransactionID = LLUUID.Zero;
-                block.Type = (sbyte)item.AssetType;
-
-                update.InventoryData[i] = block;
-            }
-
-            _Client.Network.SendPacket(update);
-        }
-
-        #endregion Update
-
-        #region Rez/Give
-
-        /// <summary>
-        /// Rez an object from inventory
-        /// </summary>
-        /// <param name="simulator">Simulator to place object in</param>
-        /// <param name="rotation">Rotation of the object when rezzed</param>
-        /// <param name="position">Vector of where to place object</param>
-        /// <param name="item">InventoryObject object containing item details</param>
-        public LLUUID RequestRezFromInventory(Simulator simulator, LLQuaternion rotation, LLVector3 position,
-            InventoryObject item)
-        {
-            return RequestRezFromInventory(simulator, rotation, position, item, _Client.Self.ActiveGroup,
-                LLUUID.Random(), false);
-        }
-
-        /// <summary>
-        /// Rez an object from inventory
-        /// </summary>
-        /// <param name="simulator">Simulator to place object in</param>
-        /// <param name="rotation">Rotation of the object when rezzed</param>
-        /// <param name="position">Vector of where to place object</param>
-        /// <param name="item">InventoryObject object containing item details</param>
-        /// <param name="groupOwner">LLUUID of group to own the object</param>
-        public LLUUID RequestRezFromInventory(Simulator simulator, LLQuaternion rotation, LLVector3 position,
-            InventoryObject item, LLUUID groupOwner)
-        {
-            return RequestRezFromInventory(simulator, rotation, position, item, groupOwner, LLUUID.Random(), false);
-        }
-
-        /// <summary>
-        /// Rez an object from inventory
-        /// </summary>
-        /// <param name="simulator">Simulator to place object in</param>
-        /// <param name="rotation">Rotation of the object when rezzed</param>
-        /// <param name="position">Vector of where to place object</param>
-        /// <param name="item">InventoryObject object containing item details</param>
-        /// <param name="groupOwner">LLUUID of group to own the object</param>
-        /// <param name="queryID">User defined queryID to correlate replies</param>
-        /// <param name="requestObjectDetails">if set to true the simulator
-        /// will automatically send object detail packet(s) back to the client</param>
-        public LLUUID RequestRezFromInventory(Simulator simulator, LLQuaternion rotation, LLVector3 position,
-            InventoryObject item, LLUUID groupOwner, LLUUID queryID, bool requestObjectDetails)
-        {
-            RezObjectPacket add = new RezObjectPacket();
-
-            add.AgentData.AgentID = _Client.Self.AgentID;
-            add.AgentData.SessionID = _Client.Self.SessionID;
-            add.AgentData.GroupID = groupOwner;
-
-            add.RezData.FromTaskID = LLUUID.Zero;
-            add.RezData.BypassRaycast = 1;
-            add.RezData.RayStart = position;
-            add.RezData.RayEnd = position;
-            add.RezData.RayTargetID = LLUUID.Zero;
-            add.RezData.RayEndIsIntersection = false;
-            add.RezData.RezSelected = requestObjectDetails;
-            add.RezData.RemoveItem = false;
-            add.RezData.ItemFlags = item.Flags;
-            add.RezData.GroupMask = (uint)item.Permissions.GroupMask;
-            add.RezData.EveryoneMask = (uint)item.Permissions.EveryoneMask;
-            add.RezData.NextOwnerMask = (uint)item.Permissions.NextOwnerMask;
-
-            add.InventoryData.ItemID = item.UUID;
-            add.InventoryData.FolderID = item.ParentUUID;
-            add.InventoryData.CreatorID = item.CreatorID;
-            add.InventoryData.OwnerID = item.OwnerID;
-            add.InventoryData.GroupID = item.GroupID;
-            add.InventoryData.BaseMask = (uint)item.Permissions.BaseMask;
-            add.InventoryData.OwnerMask = (uint)item.Permissions.OwnerMask;
-            add.InventoryData.GroupMask = (uint)item.Permissions.GroupMask;
-            add.InventoryData.EveryoneMask = (uint)item.Permissions.EveryoneMask;
-            add.InventoryData.NextOwnerMask = (uint)item.Permissions.NextOwnerMask;
-            add.InventoryData.GroupOwned = item.GroupOwned;
-            add.InventoryData.TransactionID = queryID;
-            add.InventoryData.Type = (sbyte)item.InventoryType;
-            add.InventoryData.InvType = (sbyte)item.InventoryType;
-            add.InventoryData.Flags = item.Flags;
-            add.InventoryData.SaleType = (byte)item.SaleType;
-            add.InventoryData.SalePrice = item.SalePrice;
-            add.InventoryData.Name = Helpers.StringToField(item.Name);
-            add.InventoryData.Description = Helpers.StringToField(item.Description);
-            add.InventoryData.CreationDate = (int)Helpers.DateTimeToUnixTime(item.CreationDate);
-
-            _Client.Network.SendPacket(add, simulator);
-
-            return queryID;
-        }
-
-        public void GiveItem(LLUUID itemID, string itemName, AssetType assetType, LLUUID recipient, bool doEffect)
-        {
-            byte[] bucket = new byte[17];
-            bucket[0] = (byte)assetType;
-            Buffer.BlockCopy(itemID.GetBytes(), 0, bucket, 1, 16);
-
-            _Client.Self.InstantMessage(
-                _Client.Self.Name,
-                recipient,
-                itemName,
-                LLUUID.Random(),
-                InstantMessageDialog.InventoryOffered,
-                InstantMessageOnline.Online,
-                _Client.Self.SimPosition,
-                _Client.Network.CurrentSim.ID,
-                bucket);
-
-            if (doEffect)
-            {
-                _Client.Self.BeamEffect(_Client.Self.AgentID, recipient, LLVector3d.Zero,
-                    _Client.Settings.DEFAULT_EFFECT_COLOR, 1f, LLUUID.Random());
-            }
-        }
-
-        #endregion Rez/Give
-
-        #region Task
-
-        public LLUUID UpdateTaskInventory(uint objectLocalID, InventoryItem item)
-        {
-            LLUUID transactionID = LLUUID.Random();
-
-            UpdateTaskInventoryPacket update = new UpdateTaskInventoryPacket();
-            update.AgentData.AgentID = _Client.Self.AgentID;
-            update.AgentData.SessionID = _Client.Self.SessionID;
-            update.UpdateData.Key = 0;
-            update.UpdateData.LocalID = objectLocalID;
-
-            update.InventoryData.ItemID = item.UUID;
-            update.InventoryData.FolderID = item.ParentUUID;
-            update.InventoryData.CreatorID = item.CreatorID;
-            update.InventoryData.OwnerID = item.OwnerID;
-            update.InventoryData.GroupID = item.GroupID;
-            update.InventoryData.BaseMask = (uint)item.Permissions.BaseMask;
-            update.InventoryData.OwnerMask = (uint)item.Permissions.OwnerMask;
-            update.InventoryData.GroupMask = (uint)item.Permissions.GroupMask;
-            update.InventoryData.EveryoneMask = (uint)item.Permissions.EveryoneMask;
-            update.InventoryData.NextOwnerMask = (uint)item.Permissions.NextOwnerMask;
-            update.InventoryData.GroupOwned = item.GroupOwned;
-            update.InventoryData.TransactionID = transactionID;
-            update.InventoryData.Type = (sbyte)item.AssetType;
-            update.InventoryData.InvType = (sbyte)item.InventoryType;
-            update.InventoryData.Flags = item.Flags;
-            update.InventoryData.SaleType = (byte)item.SaleType;
-            update.InventoryData.SalePrice = item.SalePrice;
-            update.InventoryData.Name = Helpers.StringToField(item.Name);
-            update.InventoryData.Description = Helpers.StringToField(item.Description);
-            update.InventoryData.CreationDate = (int)Helpers.DateTimeToUnixTime(item.CreationDate);
-            update.InventoryData.CRC = ItemCRC(item);
-
-            _Client.Network.SendPacket(update);
-
-            return transactionID;
-        }
-
-        public List<InventoryBase> GetTaskInventory(LLUUID objectID, uint objectLocalID, int timeoutMS)
-        {
-            string filename = null;
-            AutoResetEvent taskReplyEvent = new AutoResetEvent(false);
-
-            TaskInventoryReplyCallback callback =
-                delegate(LLUUID itemID, short serial, string assetFilename)
-                {
-                    if (itemID == objectID)
-                    {
-                        filename = assetFilename;
-                        taskReplyEvent.Set();
-                    }
-                };
-
-            OnTaskInventoryReply += callback;
-
-            RequestTaskInventory(objectLocalID);
-
-            if (taskReplyEvent.WaitOne(timeoutMS, false))
-            {
-                OnTaskInventoryReply -= callback;
-
-                byte[] assetData = null;
-                ulong xferID = 0;
-                AutoResetEvent taskDownloadEvent = new AutoResetEvent(false);
-
-                AssetManager.XferReceivedCallback xferCallback =
-                    delegate(XferDownload xfer)
-                    {
-                        if (xfer.XferID == xferID)
-                        {
-                            assetData = xfer.AssetData;
-                            taskDownloadEvent.Set();
-                        }
-                    };
-
-                _Client.Assets.OnXferReceived += xferCallback;
-
-                // Start the actual asset xfer
-                xferID = _Client.Assets.RequestAssetXfer(filename, true, false, LLUUID.Zero, AssetType.Unknown);
-
-                if (taskDownloadEvent.WaitOne(timeoutMS, false))
-                {
-                    _Client.Assets.OnXferReceived -= xferCallback;
-
-                    string taskList = Helpers.FieldToUTF8String(assetData);
-                    return ParseTaskInventory(taskList);
-                }
-                else
-                {
-                    _Client.Log("Timed out waiting for task inventory download for " + filename, Helpers.LogLevel.Warning);
-                    _Client.Assets.OnXferReceived -= xferCallback;
-                    return null;
-                }
-            }
-            else
-            {
-                _Client.Log("Timed out waiting for task inventory reply for " + objectLocalID, Helpers.LogLevel.Warning);
-                OnTaskInventoryReply -= callback;
-                return null;
-            }
-        }
-
-        public void RequestTaskInventory(uint objectLocalID)
-        {
-            RequestTaskInventory(objectLocalID, _Client.Network.CurrentSim);
-        }
-
-        public void RequestTaskInventory(uint objectLocalID, Simulator simulator)
-        {
-            RequestTaskInventoryPacket request = new RequestTaskInventoryPacket();
-            request.AgentData.AgentID = _Client.Self.AgentID;
-            request.AgentData.SessionID = _Client.Self.SessionID;
-            request.InventoryData.LocalID = objectLocalID;
-
-            _Client.Network.SendPacket(request, simulator);
-        }
-
-        #endregion Task
-
-        #region Helper Functions
-
-        public static string AssetTypeToString(AssetType type)
-        {
-            return _AssetTypeNames[(int)type];
-        }
-
-        public static AssetType StringToAssetType(string type)
-        {
-            for (int i = 0; i < _AssetTypeNames.Length; i++)
-            {
-                if (_AssetTypeNames[i] == type)
-                    return (AssetType)i;
-            }
-
-            return AssetType.Unknown;
-        }
-
-        public static string InventoryTypeToString(InventoryType type)
-        {
-            return _InventoryTypeNames[(int)type];
-        }
-
-        public static InventoryType StringToInventoryType(string type)
-        {
-            for (int i = 0; i < _InventoryTypeNames.Length; i++)
-            {
-                if (_InventoryTypeNames[i] == type)
-                    return (InventoryType)i;
-            }
-
-            return InventoryType.Unknown;
-        }
-
-        public static string SaleTypeToString(SaleType type)
-        {
-            return _SaleTypeNames[(int)type];
-        }
-
-        public static SaleType StringToSaleType(string value)
-        {
-            for (int i = 0; i < _SaleTypeNames.Length; i++)
-            {
-                if (value == _SaleTypeNames[i])
-                    return (SaleType)i;
-            }
-
-            return SaleType.Not;
-        }
-
-        private uint RegisterItemCreatedCallback(ItemCreatedCallback callback)
-        {
-            lock (_CallbacksLock)
-            {
-                if (_CallbackPos == UInt32.MaxValue)
-                    _CallbackPos = 0;
-
-                _CallbackPos++;
-
-                if (_ItemCreatedCallbacks.ContainsKey(_CallbackPos))
-                    _Client.Log("Overwriting an existing ItemCreatedCallback", Helpers.LogLevel.Warning);
-
-                _ItemCreatedCallbacks[_CallbackPos] = callback;
-
-                return _CallbackPos;
-            }
-        }
-
-        private uint RegisterItemsCopiedCallback(ItemCopiedCallback callback)
-        {
-            lock (_CallbacksLock)
-            {
-                if (_CallbackPos == UInt32.MaxValue)
-                    _CallbackPos = 0;
-
-                _CallbackPos++;
-
-                if (_ItemCopiedCallbacks.ContainsKey(_CallbackPos))
-                    _Client.Log("Overwriting an existing ItemsCopiedCallback", Helpers.LogLevel.Warning);
-
-                _ItemCopiedCallbacks[_CallbackPos] = callback;
-
-                return _CallbackPos;
-            }
-        }
-
-        public static uint ItemCRC(InventoryItem iitem)
-        {
-            uint CRC = 0;
-
-            // IDs
-            CRC += iitem.AssetUUID.CRC(); // AssetID
-            CRC += iitem.ParentUUID.CRC(); // FolderID
-            CRC += iitem.UUID == null ? LLUUID.Zero.CRC() : iitem.UUID.CRC(); // ItemID
-
-            // Permission stuff
-            CRC += iitem.CreatorID.CRC(); // CreatorID
-            CRC += iitem.OwnerID.CRC(); // OwnerID
-            CRC += iitem.GroupID.CRC(); // GroupID
-
-            // CRC += another 4 words which always seem to be zero -- unclear if this is a LLUUID or what
-            CRC += (uint)iitem.Permissions.OwnerMask; //owner_mask;      // Either owner_mask or next_owner_mask may need to be
-            CRC += (uint)iitem.Permissions.NextOwnerMask; //next_owner_mask; // switched with base_mask -- 2 values go here and in my
-            CRC += (uint)iitem.Permissions.EveryoneMask; //everyone_mask;   // study item, the three were identical.
-            CRC += (uint)iitem.Permissions.GroupMask; //group_mask;
-
-            // The rest of the CRC fields
-            CRC += iitem.Flags; // Flags
-            CRC += (uint)iitem.InventoryType; // InvType
-            CRC += (uint)iitem.AssetType; // Type
-            CRC += (uint)Helpers.DateTimeToUnixTime(iitem.CreationDate); // CreationDate
-            CRC += (uint)iitem.SalePrice;    // SalePrice
-            CRC += (uint)((uint)iitem.SaleType * 0x07073096); // SaleType
-
-            return CRC;
-        }
-
-        public static InventoryItem CreateInventoryItem(InventoryType type, LLUUID id)
-        {
-            switch (type)
-            {
-                case InventoryType.Texture: return new InventoryTexture(id);
-                case InventoryType.Sound: return new InventorySound(id);
-                case InventoryType.CallingCard: return new InventoryCallingCard(id);
-                case InventoryType.Landmark: return new InventoryLandmark(id);
-                case InventoryType.Object: return new InventoryObject(id);
-                case InventoryType.Notecard: return new InventoryNotecard(id);
-                case InventoryType.Category: return new InventoryCategory(id);
-                case InventoryType.LSL: return new InventoryLSL(id);
-                case InventoryType.Snapshot: return new InventorySnapshot(id);
-                case InventoryType.Attachment: return new InventoryAttachment(id);
-                case InventoryType.Wearable: return new InventoryWearable(id);
-                case InventoryType.Animation: return new InventoryAnimation(id);
-                case InventoryType.Gesture: return new InventoryGesture(id);
-                default: return new InventoryItem(type, id);
-            }
-        }
-
-        private InventoryItem SafeCreateInventoryItem(InventoryType InvType, LLUUID ItemID)
-        {
-            InventoryItem ret = null;
-
-            if (_Store.Contains(ItemID))
-                ret = _Store[ItemID] as InventoryItem;
-
-            if (ret == null)
-                ret = CreateInventoryItem(InvType, ItemID);
-
-            return ret;
-        }
-
-        private static bool ParseLine(string line, out string key, out string value)
-        {
-            string origLine = line;
-
-            // Clean up and convert tabs to spaces
-            line = line.Trim();
-            line = line.Replace('\t', ' ');
-
-            // Shrink all whitespace down to single spaces
-            while (line.IndexOf("  ") > 0)
-                line = line.Replace("  ", " ");
-
-            if (line.Length > 2)
-            {
-                int sep = line.IndexOf(' ');
-                if (sep > 0)
-                {
-                    key = line.Substring(0, sep);
-                    value = line.Substring(sep + 1);
-
-                    return true;
-                }
-            }
-            else if (line.Length == 1)
-            {
-                key = line;
-                value = String.Empty;
-                return true;
-            }
-
-            key = null;
-            value = null;
-            return false;
-        }
-
-        public static List<InventoryBase> ParseTaskInventory(string taskData)
-        {
-            List<InventoryBase> items = new List<InventoryBase>();
-            int lineNum = 0;
-            string[] lines = taskData.Replace("\r\n", "\n").Split('\n');
-
-            while (lineNum < lines.Length)
-            {
-                string key, value;
-                if (ParseLine(lines[lineNum++], out key, out value))
-                {
-                    if (key == "inv_object")
-                    {
-                        #region inv_object
-
-                        // In practice this appears to only be used for folders
-                        LLUUID itemID = LLUUID.Zero;
-                        LLUUID parentID = LLUUID.Zero;
-                        string name = String.Empty;
-                        AssetType assetType = AssetType.Unknown;
-
-                        while (lineNum < lines.Length)
-                        {
-                            if (ParseLine(lines[lineNum++], out key, out value))
-                            {
-                                if (key == "{")
-                                {
-                                    continue;
-                                }
-                                else if (key == "}")
-                                {
-                                    break;
-                                }
-                                else if (key == "obj_id")
-                                {
-                                    LLUUID.TryParse(value, out itemID);
-                                }
-                                else if (key == "parent_id")
-                                {
-                                    LLUUID.TryParse(value, out parentID);
-                                }
-                                else if (key == "type")
-                                {
-                                    assetType = StringToAssetType(value);
-                                }
-                                else if (key == "name")
-                                {
-                                    name = value.Substring(0, value.IndexOf('|'));
-                                }
-                            }
-                        }
-
-                        if (assetType == AssetType.Folder)
-                        {
-                            InventoryFolder folder = new InventoryFolder(itemID);
-                            folder.Name = name;
-                            folder.ParentUUID = parentID;
-
-                            items.Add(folder);
-                        }
-                        else
-                        {
-                            InventoryItem item = new InventoryItem(itemID);
-                            item.Name = name;
-                            item.ParentUUID = parentID;
-                            item.AssetType = assetType;
-
-                            items.Add(item);
-                        }
-
-                        #endregion inv_object
-                    }
-                    else if (key == "inv_item")
-                    {
-                        #region inv_item
-
-                        // Any inventory item that links to an assetID, has permissions, etc
-                        LLUUID itemID = LLUUID.Zero;
-                        LLUUID assetID = LLUUID.Zero;
-                        LLUUID parentID = LLUUID.Zero;
-                        LLUUID creatorID = LLUUID.Zero;
-                        LLUUID ownerID = LLUUID.Zero;
-                        LLUUID lastOwnerID = LLUUID.Zero;
-                        LLUUID groupID = LLUUID.Zero;
-                        bool groupOwned = false;
-                        string name = String.Empty;
-                        string desc = String.Empty;
-                        AssetType assetType = AssetType.Unknown;
-                        InventoryType inventoryType = InventoryType.Unknown;
-                        DateTime creationDate = Helpers.Epoch;
-                        uint flags = 0;
-                        Permissions perms = Permissions.NoPermissions;
-                        SaleType saleType = SaleType.Not;
-                        int salePrice = 0;
-
-                        while (lineNum < lines.Length)
-                        {
-                            if (ParseLine(lines[lineNum++], out key, out value))
-                            {
-                                if (key == "{")
-                                {
-                                    continue;
-                                }
-                                else if (key == "}")
-                                {
-                                    break;
-                                }
-                                else if (key == "item_id")
-                                {
-                                    LLUUID.TryParse(value, out itemID);
-                                }
-                                else if (key == "parent_id")
-                                {
-                                    LLUUID.TryParse(value, out parentID);
-                                }
-                                else if (key == "permissions")
-                                {
-                                    #region permissions
-
-                                    while (lineNum < lines.Length)
-                                    {
-                                        if (ParseLine(lines[lineNum++], out key, out value))
-                                        {
-                                            if (key == "{")
-                                            {
-                                                continue;
-                                            }
-                                            else if (key == "}")
-                                            {
-                                                break;
-                                            }
-                                            else if (key == "creator_mask")
-                                            {
-                                                // Deprecated
-                                                uint val;
-                                                if (Helpers.TryParseHex(value, out val))
-                                                    perms.BaseMask = (PermissionMask)val;
-                                            }
-                                            else if (key == "base_mask")
-                                            {
-                                                uint val;
-                                                if (Helpers.TryParseHex(value, out val))
-                                                    perms.BaseMask = (PermissionMask)val;
-                                            }
-                                            else if (key == "owner_mask")
-                                            {
-                                                uint val;
-                                                if (Helpers.TryParseHex(value, out val))
-                                                    perms.OwnerMask = (PermissionMask)val;
-                                            }
-                                            else if (key == "group_mask")
-                                            {
-                                                uint val;
-                                                if (Helpers.TryParseHex(value, out val))
-                                                    perms.GroupMask = (PermissionMask)val;
-                                            }
-                                            else if (key == "everyone_mask")
-                                            {
-                                                uint val;
-                                                if (Helpers.TryParseHex(value, out val))
-                                                    perms.EveryoneMask = (PermissionMask)val;
-                                            }
-                                            else if (key == "next_owner_mask")
-                                            {
-                                                uint val;
-                                                if (Helpers.TryParseHex(value, out val))
-                                                    perms.NextOwnerMask = (PermissionMask)val;
-                                            }
-                                            else if (key == "creator_id")
-                                            {
-                                                Helpers.TryParse(value, out creatorID);
-                                            }
-                                            else if (key == "owner_id")
-                                            {
-                                                Helpers.TryParse(value, out ownerID);
-                                            }
-                                            else if (key == "last_owner_id")
-                                            {
-                                                Helpers.TryParse(value, out lastOwnerID);
-                                            }
-                                            else if (key == "group_id")
-                                            {
-                                                Helpers.TryParse(value, out groupID);
-                                            }
-                                            else if (key == "group_owned")
-                                            {
-                                                uint val;
-                                                if (Helpers.TryParse(value, out val))
-                                                    groupOwned = (val != 0);
-                                            }
-                                        }
-                                    }
-
-                                    #endregion permissions
-                                }
-                                else if (key == "sale_info")
-                                {
-                                    #region sale_info
-
-                                    while (lineNum < lines.Length)
-                                    {
-                                        if (ParseLine(lines[lineNum++], out key, out value))
-                                        {
-                                            if (key == "{")
-                                            {
-                                                continue;
-                                            }
-                                            else if (key == "}")
-                                            {
-                                                break;
-                                            }
-                                            else if (key == "sale_type")
-                                            {
-                                                saleType = StringToSaleType(value);
-                                            }
-                                            else if (key == "sale_price")
-                                            {
-                                                Helpers.TryParse(value, out salePrice);
-                                            }
-                                        }
-                                    }
-
-                                    #endregion sale_info
-                                }
-                                else if (key == "shadow_id")
-                                {
-                                    //FIXME:
-                                }
-                                else if (key == "asset_id")
-                                {
-                                    LLUUID.TryParse(value, out assetID);
-                                }
-                                else if (key == "type")
-                                {
-                                    assetType = StringToAssetType(value);
-                                }
-                                else if (key == "inv_type")
-                                {
-                                    inventoryType = StringToInventoryType(value);
-                                }
-                                else if (key == "flags")
-                                {
-                                    Helpers.TryParse(value, out flags);
-                                }
-                                else if (key == "name")
-                                {
-                                    name = value.Substring(0, value.IndexOf('|'));
-                                }
-                                else if (key == "desc")
-                                {
-                                    desc = value.Substring(0, value.IndexOf('|'));
-                                }
-                                else if (key == "creation_date")
-                                {
-                                    uint timestamp;
-                                    if (Helpers.TryParse(value, out timestamp))
-                                        creationDate = Helpers.UnixTimeToDateTime(timestamp);
-                                    else
-                                        SecondLife.LogStatic("Failed to parse creation_date " + value, Helpers.LogLevel.Warning);
-                                }
-                            }
-                        }
-
-                        InventoryItem item = CreateInventoryItem(inventoryType, itemID);
-                        item.AssetUUID = assetID;
-                        item.AssetType = assetType;
-                        item.CreationDate = creationDate;
-                        item.CreatorID = creatorID;
-                        item.Description = desc;
-                        item.Flags = flags;
-                        item.GroupID = groupID;
-                        item.GroupOwned = groupOwned;
-                        item.Name = name;
-                        item.OwnerID = ownerID;
-                        item.ParentUUID = parentID;
-                        item.Permissions = perms;
-                        item.SalePrice = salePrice;
-                        item.SaleType = saleType;
-
-                        items.Add(item);
-
-                        #endregion inv_item
-                    }
-                    else
-                    {
-                        SecondLife.LogStatic("Unrecognized token " + key + " in: " + Helpers.NewLine + taskData,
-                            Helpers.LogLevel.Error);
-                    }
-                }
-            }
-
-            return items;
-        }
-
-        #endregion Helper Functions
-
-        #region Callbacks
-
-        private void CreateItemFromAssetResponse(CapsClient client, LLSD result, Exception error)
-        {
-            LLSDMap contents = (LLSDMap)result;
-            KeyValuePair<ItemCreatedFromAssetCallback, byte[]> kvp = (KeyValuePair<ItemCreatedFromAssetCallback, byte[]>)client.UserData;
-            ItemCreatedFromAssetCallback callback = kvp.Key;
-            byte[] itemData = (byte[])kvp.Value;
-
-            string status = contents["state"].AsString();
-
-            if (status == "upload")
-            {
-                string uploadURL = contents["uploader"].AsString();
-
-                // This makes the assumption that all uploads go to CurrentSim, to avoid
-                // the problem of HttpRequestState not knowing anything about simulators
-                CapsClient upload = new CapsClient(new Uri(uploadURL));
-                upload.OnComplete += new CapsClient.CompleteCallback(CreateItemFromAssetResponse);
-                upload.UserData = kvp;
-                upload.StartRequest(itemData, "application/octet-stream");
-            }
-            else if (status == "complete")
-            {
-                if (contents.ContainsKey("new_inventory_item") && contents.ContainsKey("new_asset"))
-                {
-                    try { callback(true, String.Empty, contents["new_inventory_item"].AsUUID(), contents["new_asset"].AsUUID()); }
-                    catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-                else
-                {
-                    try { callback(false, "Failed to parse asset and item UUIDs", LLUUID.Zero, LLUUID.Zero); }
-                    catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-            else
-            {
-                // Failure
-                try { callback(false, status, LLUUID.Zero, LLUUID.Zero); }
-                catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void SaveAssetIntoInventoryHandler(Packet packet, Simulator simulator)
-        {
-            SaveAssetIntoInventoryPacket save = (SaveAssetIntoInventoryPacket)packet;
-
-            // FIXME: Find this item in the inventory structure and mark the parent as needing an update
-            //save.InventoryData.ItemID;
-            _Client.Log("SaveAssetIntoInventory packet received, someone write this function!",
-                Helpers.LogLevel.Error);
-        }
-
-        private void InventoryDescendentsHandler(Packet packet, Simulator simulator)
-        {
-            InventoryDescendentsPacket reply = (InventoryDescendentsPacket)packet;
-
-            if (reply.AgentData.Descendents > 0)
-            {
-                // InventoryDescendantsReply sends a null folder if the parent doesnt contain any folders
-                if (reply.FolderData[0].FolderID != LLUUID.Zero)
-                {
-                    // Iterate folders in this packet
-                    for (int i = 0; i < reply.FolderData.Length; i++)
-                    {
-                        InventoryFolder folder = new InventoryFolder(reply.FolderData[i].FolderID);
-                        folder.ParentUUID = reply.FolderData[i].ParentID;
-                        folder.Name = Helpers.FieldToUTF8String(reply.FolderData[i].Name);
-                        folder.PreferredType = (AssetType)reply.FolderData[i].Type;
-                        folder.OwnerID = reply.AgentData.OwnerID;
-
-                        _Store[folder.UUID] = folder;
-                    }
-                }
-
-                // InventoryDescendantsReply sends a null item if the parent doesnt contain any items.
-                if (reply.ItemData[0].ItemID != LLUUID.Zero)
-                {
-                    // Iterate items in this packet
-                    for (int i = 0; i < reply.ItemData.Length; i++)
-                    {
-                        if (reply.ItemData[i].ItemID != LLUUID.Zero)
-                        {
-                            InventoryItem item = CreateInventoryItem((InventoryType)reply.ItemData[i].InvType,reply.ItemData[i].ItemID);
-                            item.ParentUUID = reply.ItemData[i].FolderID;
-                            item.CreatorID = reply.ItemData[i].CreatorID;
-                            item.AssetType = (AssetType)reply.ItemData[i].Type;
-                            item.AssetUUID = reply.ItemData[i].AssetID;
-                            item.CreationDate = Helpers.UnixTimeToDateTime((uint)reply.ItemData[i].CreationDate);
-                            item.Description = Helpers.FieldToUTF8String(reply.ItemData[i].Description);
-                            item.Flags = reply.ItemData[i].Flags;
-                            item.Name = Helpers.FieldToUTF8String(reply.ItemData[i].Name);
-                            item.GroupID = reply.ItemData[i].GroupID;
-                            item.GroupOwned = reply.ItemData[i].GroupOwned;
-                            item.Permissions = new Permissions(
-                                reply.ItemData[i].BaseMask,
-                                reply.ItemData[i].EveryoneMask,
-                                reply.ItemData[i].GroupMask,
-                                reply.ItemData[i].NextOwnerMask,
-                                reply.ItemData[i].OwnerMask);
-                            item.SalePrice = reply.ItemData[i].SalePrice;
-                            item.SaleType = (SaleType)reply.ItemData[i].SaleType;
-                            item.OwnerID = reply.AgentData.OwnerID;
-
-                            _Store[item.UUID] = item;
-                        }
-                    }
-                }
-            }
-
-            InventoryFolder parentFolder = null;
-
-            if (_Store.Contains(reply.AgentData.FolderID) &&
-                _Store[reply.AgentData.FolderID] is InventoryFolder)
-            {
-                parentFolder = _Store[reply.AgentData.FolderID] as InventoryFolder;
-            }
-            else
-            {
-                _Client.Log("Don't have a reference to FolderID " + reply.AgentData.FolderID.ToString() +
-                    " or it is not a folder", Helpers.LogLevel.Error);
-                return;
-            }
-
-            if (reply.AgentData.Version < parentFolder.Version)
-            {
-                _Client.Log("Got an outdated InventoryDescendents packet for folder " + parentFolder.Name +
-                    ", this version = " + reply.AgentData.Version + ", latest version = " + parentFolder.Version,
-                    Helpers.LogLevel.Warning);
-                return;
-            }
-
-            parentFolder.Version = reply.AgentData.Version;
-            // FIXME: reply.AgentData.Descendants is not parentFolder.DescendentCount if we didn't
-            // request items and folders
-            parentFolder.DescendentCount = reply.AgentData.Descendents;
-
-            #region FindObjectsByPath Handling
-
-            if (_Searches.Count > 0)
-            {
-                lock (_Searches)
-                {
-                StartSearch:
-
-                    // Iterate over all of the outstanding searches
-                    for (int i = 0; i < _Searches.Count; i++)
-                    {
-                        InventorySearch search = _Searches[i];
-                        List<InventoryBase> folderContents = _Store.GetContents(search.Folder);
-
-                        // Iterate over all of the inventory objects in the base search folder
-                        for (int j = 0; j < folderContents.Count; j++)
-                        {
-                            // Check if this inventory object matches the current path node
-                            if (folderContents[j].Name == search.Path[search.Level])
-                            {
-                                if (search.Level == search.Path.Length - 1)
-                                {
-                                    _Client.DebugLog("Finished patch search of " + String.Join("/", search.Path));
-
-                                    // This is the last node in the path, fire the callback and clean up
-                                    if (OnFindObjectByPath != null)
-                                    {
-                                        try { OnFindObjectByPath(String.Join("/", search.Path), folderContents[j].UUID); }
-                                        catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                                    }
-
-                                    // Remove this entry and restart the loop since we are changing the collection size
-                                    _Searches.RemoveAt(i);
-                                    goto StartSearch;
-                                }
-                                else
-                                {
-                                    // We found a match but it is not the end of the path, request the next level
-                                    _Client.DebugLog(String.Format("Matched level {0}/{1} in a path search of {2}",
-                                        search.Level, search.Path.Length - 1, String.Join("/", search.Path)));
-
-                                    search.Folder = folderContents[j].UUID;
-                                    search.Level++;
-                                    _Searches[i] = search;
-
-                                    RequestFolderContents(search.Folder, search.Owner, true, true,
-                                        InventorySortOrder.ByName);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            #endregion FindObjectsByPath Handling
-
-            // Callback for inventory folder contents being updated
-            if (OnFolderUpdated != null)
-            {
-                try { OnFolderUpdated(parentFolder.UUID); }
-                catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        /// <summary>
-        /// UpdateCreateInventoryItem packets are received when a new inventory item
-        /// is created. This may occur when an object that's rezzed in world is
-        /// taken into inventory, when an item is created using the CreateInventoryItem
-        /// packet, or when an object is purchased
-        /// </summary>
-        private void UpdateCreateInventoryItemHandler(Packet packet, Simulator simulator)
-        {
-            UpdateCreateInventoryItemPacket reply = packet as UpdateCreateInventoryItemPacket;
-
-            foreach (UpdateCreateInventoryItemPacket.InventoryDataBlock dataBlock in reply.InventoryData)
-            {
-                if (dataBlock.InvType == (sbyte)InventoryType.Folder)
-                {
-                    _Client.Log("Received InventoryFolder in an UpdateCreateInventoryItem packet, this should not happen!",
-                        Helpers.LogLevel.Error);
-                    continue;
-                }
-
-                InventoryItem item = CreateInventoryItem((InventoryType)dataBlock.InvType,dataBlock.ItemID);
-                item.AssetType = (AssetType)dataBlock.Type;
-                item.AssetUUID = dataBlock.AssetID;
-                item.CreationDate = Helpers.UnixTimeToDateTime(dataBlock.CreationDate);
-                item.CreatorID = dataBlock.CreatorID;
-                item.Description = Helpers.FieldToUTF8String(dataBlock.Description);
-                item.Flags = dataBlock.Flags;
-                item.GroupID = dataBlock.GroupID;
-                item.GroupOwned = dataBlock.GroupOwned;
-                item.Name = Helpers.FieldToUTF8String(dataBlock.Name);
-                item.OwnerID = dataBlock.OwnerID;
-                item.ParentUUID = dataBlock.FolderID;
-                item.Permissions = new Permissions(
-                        dataBlock.BaseMask,
-                        dataBlock.EveryoneMask,
-                        dataBlock.GroupMask,
-                        dataBlock.NextOwnerMask,
-                        dataBlock.OwnerMask);
-                item.SalePrice = dataBlock.SalePrice;
-                item.SaleType = (SaleType)dataBlock.SaleType;
-
-                // Update the local copy
-                _Store[item.UUID] = item;
-
-                // Look for an "item created" callback
-                ItemCreatedCallback createdCallback;
-                if (_ItemCreatedCallbacks.TryGetValue(dataBlock.CallbackID, out createdCallback))
-                {
-                    _ItemCreatedCallbacks.Remove(dataBlock.CallbackID);
-
-                    try { createdCallback(true, item); }
-                    catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-
-                // TODO: Is this callback even triggered when items are copied?
-                // Look for an "item copied" callback
-                ItemCopiedCallback copyCallback;
-                if (_ItemCopiedCallbacks.TryGetValue(dataBlock.CallbackID, out copyCallback))
-                {
-                    _ItemCopiedCallbacks.Remove(dataBlock.CallbackID);
-
-                    try { copyCallback(item); }
-                    catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-
-                //This is triggered when an item is received from a task
-                if (OnTaskItemReceived != null)
-                {
-                    try { OnTaskItemReceived(item.UUID, dataBlock.FolderID, item.CreatorID, item.AssetUUID,
-                        item.InventoryType); }
-                    catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        private void MoveInventoryItemHandler(Packet packet, Simulator simulator)
-        {
-            MoveInventoryItemPacket move = (MoveInventoryItemPacket)packet;
-
-            for (int i = 0; i < move.InventoryData.Length; i++)
-            {
-                // FIXME: Do something here
-                string newName = Helpers.FieldToUTF8String(move.InventoryData[i].NewName);
-
-                _Client.Log(String.Format(
-                    "MoveInventoryItemHandler: Item {0} is moving to Folder {1} with new name \"{2}\". Someone write this function!",
-                    move.InventoryData[i].ItemID.ToString(), move.InventoryData[i].FolderID.ToString(),
-                    newName), Helpers.LogLevel.Warning);
-            }
-        }
-
-        private void BulkUpdateInventoryHandler(Packet packet, Simulator simulator)
-        {
-            BulkUpdateInventoryPacket update = packet as BulkUpdateInventoryPacket;
-
-            if (update.FolderData.Length > 0 && update.FolderData[0].FolderID != LLUUID.Zero)
-            {
-                foreach (BulkUpdateInventoryPacket.FolderDataBlock dataBlock in update.FolderData)
-                {
-                    if (!_Store.Contains(dataBlock.FolderID))
-                        _Client.Log("Received BulkUpdate for unknown folder: " + dataBlock.FolderID, Helpers.LogLevel.Warning);
-
-                    InventoryFolder folder = new InventoryFolder(dataBlock.FolderID);
-                    folder.Name = Helpers.FieldToUTF8String(dataBlock.Name);
-                    folder.OwnerID = update.AgentData.AgentID;
-                    folder.ParentUUID = dataBlock.ParentID;
-                    _Store[folder.UUID] = folder;
-                }
-            }
-
-            if (update.ItemData.Length > 0 && update.ItemData[0].ItemID != LLUUID.Zero)
-            {
-                for (int i = 0; i < update.ItemData.Length; i++)
-                {
-                    BulkUpdateInventoryPacket.ItemDataBlock dataBlock = update.ItemData[i];
-
-                    if (!_Store.Contains(dataBlock.ItemID))
-                        _Client.Log("Received BulkUpdate for unknown item: " + dataBlock.ItemID, Helpers.LogLevel.Warning);
-
-                    InventoryItem item = SafeCreateInventoryItem((InventoryType)dataBlock.InvType, dataBlock.ItemID);
-
-                    item.AssetType = (AssetType)dataBlock.Type;
-                    if (dataBlock.AssetID != LLUUID.Zero) item.AssetUUID = dataBlock.AssetID;
-                    item.CreationDate = Helpers.UnixTimeToDateTime(dataBlock.CreationDate);
-                    item.CreatorID = dataBlock.CreatorID;
-                    item.Description = Helpers.FieldToUTF8String(dataBlock.Description);
-                    item.Flags = dataBlock.Flags;
-                    item.GroupID = dataBlock.GroupID;
-                    item.GroupOwned = dataBlock.GroupOwned;
-                    item.Name = Helpers.FieldToUTF8String(dataBlock.Name);
-                    item.OwnerID = dataBlock.OwnerID;
-                    item.ParentUUID = dataBlock.FolderID;
-                    item.Permissions = new Permissions(
-                        dataBlock.BaseMask,
-                        dataBlock.EveryoneMask,
-                        dataBlock.GroupMask,
-                        dataBlock.NextOwnerMask,
-                        dataBlock.OwnerMask);
-                    item.SalePrice = dataBlock.SalePrice;
-                    item.SaleType = (SaleType)dataBlock.SaleType;
-
-                    _Store[item.UUID] = item;
-
-                    // Look for an "item created" callback
-                    ItemCreatedCallback callback;
-                    if (_ItemCreatedCallbacks.TryGetValue(dataBlock.CallbackID, out callback))
-                    {
-                        _ItemCreatedCallbacks.Remove(dataBlock.CallbackID);
-
-                        try { callback(true, item); }
-                        catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-
-                    // Look for an "item copied" callback
-                    ItemCopiedCallback copyCallback;
-                    if (_ItemCopiedCallbacks.TryGetValue(dataBlock.CallbackID, out copyCallback))
-                    {
-                        _ItemCopiedCallbacks.Remove(dataBlock.CallbackID);
-
-                        try { copyCallback(item); }
-                        catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-            }
-        }
-
-        private void FetchInventoryReplyHandler(Packet packet, Simulator simulator)
-        {
-            FetchInventoryReplyPacket reply = packet as FetchInventoryReplyPacket;
-
-            foreach (FetchInventoryReplyPacket.InventoryDataBlock dataBlock in reply.InventoryData)
-            {
-                if (dataBlock.InvType == (sbyte)InventoryType.Folder)
-                {
-                    _Client.Log("Received FetchInventoryReply for an inventory folder, this should not happen!",
-                        Helpers.LogLevel.Error);
-                    continue;
-                }
-
-                InventoryItem item = CreateInventoryItem((InventoryType)dataBlock.InvType,dataBlock.ItemID);
-                item.AssetType = (AssetType)dataBlock.Type;
-                item.AssetUUID = dataBlock.AssetID;
-                item.CreationDate = Helpers.UnixTimeToDateTime(dataBlock.CreationDate);
-                item.CreatorID = dataBlock.CreatorID;
-                item.Description = Helpers.FieldToUTF8String(dataBlock.Description);
-                item.Flags = dataBlock.Flags;
-                item.GroupID = dataBlock.GroupID;
-                item.GroupOwned = dataBlock.GroupOwned;
-                item.Name = Helpers.FieldToUTF8String(dataBlock.Name);
-                item.OwnerID = dataBlock.OwnerID;
-                item.ParentUUID = dataBlock.FolderID;
-                item.Permissions = new Permissions(
-                    dataBlock.BaseMask,
-                    dataBlock.EveryoneMask,
-                    dataBlock.GroupMask,
-                    dataBlock.NextOwnerMask,
-                    dataBlock.OwnerMask);
-                item.SalePrice = dataBlock.SalePrice;
-                item.SaleType = (SaleType)dataBlock.SaleType;
-
-                _Store[item.UUID] = item;
-
-                // Fire the callback for an item being fetched
-                if (OnItemReceived != null)
-                {
-                    try { OnItemReceived(item); }
-                    catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        private void ReplyTaskInventoryHandler(Packet packet, Simulator simulator)
-        {
-            if (OnTaskInventoryReply != null)
-            {
-                ReplyTaskInventoryPacket reply = (ReplyTaskInventoryPacket)packet;
-
-                try
-                {
-                    OnTaskInventoryReply(reply.InventoryData.TaskID, reply.InventoryData.Serial,
-                        Helpers.FieldToUTF8String(reply.InventoryData.Filename));
-                }
-                catch (Exception e) { _Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void Self_OnInstantMessage(InstantMessage im, Simulator simulator)
-        {
-            // TODO: MainAvatar.InstantMessageDialog.GroupNotice can also be an inventory offer, should we
-            // handle it here?
-
-            if (OnObjectOffered != null &&
-                (im.Dialog == InstantMessageDialog.InventoryOffered || im.Dialog == InstantMessageDialog.TaskInventoryOffered))
-            {
-                AssetType type = AssetType.Unknown;
-                LLUUID objectID = LLUUID.Zero;
-                bool fromTask = false;
-
-                if (im.Dialog == InstantMessageDialog.InventoryOffered)
-                {
-                    if (im.BinaryBucket.Length == 17)
-                    {
-                        type = (AssetType)im.BinaryBucket[0];
-                        objectID = new LLUUID(im.BinaryBucket, 1);
-                        fromTask = false;
-                    }
-                    else
-                    {
-                        _Client.Log("Malformed inventory offer from agent", Helpers.LogLevel.Warning);
-                        return;
-                    }
-                }
-                else if (im.Dialog == InstantMessageDialog.TaskInventoryOffered)
-                {
-                    if (im.BinaryBucket.Length == 1)
-                    {
-                        type = (AssetType)im.BinaryBucket[0];
-                        fromTask = true;
-                    }
-                    else
-                    {
-                        _Client.Log("Malformed inventory offer from object", Helpers.LogLevel.Warning);
-                        return;
-                    }
-                }
-
-                // Find the folder where this is going to go
-                LLUUID destinationFolderID = FindFolderForType(type);
-
-                // Fire the callback
-                try
-                {
-                    ImprovedInstantMessagePacket imp = new ImprovedInstantMessagePacket();
-                    imp.AgentData.AgentID = _Client.Self.AgentID;
-                    imp.AgentData.SessionID = _Client.Self.SessionID;
-                    imp.MessageBlock.FromGroup = false;
-                    imp.MessageBlock.ToAgentID = im.FromAgentID;
-                    imp.MessageBlock.Offline = 0;
-                    imp.MessageBlock.ID = im.IMSessionID;
-                    imp.MessageBlock.Timestamp = 0;
-                    imp.MessageBlock.FromAgentName = Helpers.StringToField(_Client.Self.Name);
-                    imp.MessageBlock.Message = new byte[0];
-                    imp.MessageBlock.ParentEstateID = 0;
-                    imp.MessageBlock.RegionID = LLUUID.Zero;
-                    imp.MessageBlock.Position = _Client.Self.SimPosition;
-
-                    if (OnObjectOffered(im.FromAgentID, im.FromAgentName, im.ParentEstateID, im.RegionID, im.Position,
-                        im.Timestamp, type, objectID, fromTask))
-                    {
-                        // Accept the inventory offer
-                        switch (im.Dialog)
-                        {
-                            case InstantMessageDialog.InventoryOffered:
-                                imp.MessageBlock.Dialog = (byte)InstantMessageDialog.InventoryAccepted;
-                                break;
-                            case InstantMessageDialog.TaskInventoryOffered:
-                                imp.MessageBlock.Dialog = (byte)InstantMessageDialog.TaskInventoryAccepted;
-                                break;
-                            case InstantMessageDialog.GroupNotice:
-                                imp.MessageBlock.Dialog = (byte)InstantMessageDialog.GroupNoticeInventoryAccepted;
-                                break;
-                        }
-
-                        imp.MessageBlock.BinaryBucket = destinationFolderID.GetBytes();
-                    }
-                    else
-                    {
-                        // Decline the inventory offer
-                        switch (im.Dialog)
-                        {
-                            case InstantMessageDialog.InventoryOffered:
-                                imp.MessageBlock.Dialog = (byte)InstantMessageDialog.InventoryDeclined;
-                                break;
-                            case InstantMessageDialog.TaskInventoryOffered:
-                                imp.MessageBlock.Dialog = (byte)InstantMessageDialog.TaskInventoryDeclined;
-                                break;
-                            case InstantMessageDialog.GroupNotice:
-                                imp.MessageBlock.Dialog = (byte)InstantMessageDialog.GroupNoticeInventoryDeclined;
-                                break;
-                        }
-
-                        imp.MessageBlock.BinaryBucket = new byte[0];
-                    }
-
-                    _Client.Network.SendPacket(imp, simulator);
-                }
-                catch (Exception e)
-                {
-                    _Client.Log(e.ToString(), Helpers.LogLevel.Error);
-                }
-            }
-        }
-
-        private void Network_OnLoginResponse(bool loginSuccess, bool redirect, string message, string reason, LoginResponseData replyData)
-        {
-            if (loginSuccess)
-            {
-                _Client.DebugLog("Setting InventoryRoot to " + replyData.InventoryRoot.ToString());
-                InventoryFolder rootFolder = new InventoryFolder(replyData.InventoryRoot);
-                rootFolder.Name = String.Empty;
-                rootFolder.ParentUUID = LLUUID.Zero;
-                _Store.RootFolder = rootFolder;
-
-                for (int i = 0; i < replyData.InventorySkeleton.Length; i++)
-                    _Store.UpdateNodeFor(replyData.InventorySkeleton[i]);
-            }
-        }
-
-        #endregion Callbacks
-    }
-}
diff --git a/old/libsl1550/libsecondlife/InventoryNode.cs b/old/libsl1550/libsecondlife/InventoryNode.cs
deleted file mode 100644
index 2854786..0000000
--- a/old/libsl1550/libsecondlife/InventoryNode.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace libsecondlife
-{
-    public class InventoryNode
-    {
-        private InventoryBase data;
-        private InventoryNode parent;
-        private InventoryNodeDictionary nodes;
-
-        /// <summary></summary>
-        public InventoryBase Data
-        {
-            get { return data; }
-            set { data = value; }
-        }
-
-        /// <summary></summary>
-        public InventoryNode Parent
-        {
-            get { return parent; }
-            set { parent = value; }
-        }
-
-        /// <summary></summary>
-        public InventoryNodeDictionary Nodes
-        {
-            get
-            {
-                if (nodes == null)
-                    nodes = new InventoryNodeDictionary(this);
-
-                return nodes;
-            }
-            set { nodes = value; }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public InventoryNode()
-        {
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="data"></param>
-        public InventoryNode(InventoryBase data)
-        {
-            this.data = data;
-        }
-
-        public InventoryNode(InventoryBase data, InventoryNode parent)
-        {
-            this.data = data;
-            this.parent = parent;
-
-            if (parent != null)
-            {
-                // Add this node to the collection of parent nodes
-                lock (parent.Nodes.SyncRoot) parent.Nodes.Add(data.UUID, this);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override string ToString()
-        {
-            if (this.Data == null) return "[Empty Node]";
-            return this.Data.ToString();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/InventoryNodeDictionary.cs b/old/libsl1550/libsecondlife/InventoryNodeDictionary.cs
deleted file mode 100644
index a6938ba..0000000
--- a/old/libsl1550/libsecondlife/InventoryNodeDictionary.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace libsecondlife
-{
-    public class InventoryNodeDictionary
-    {
-        protected Dictionary<LLUUID, InventoryNode> Dictionary = new Dictionary<LLUUID, InventoryNode>();
-        protected InventoryNode parent;
-        protected object syncRoot = new object();
-
-        public InventoryNode Parent
-        {
-            get { return parent; }
-            set { parent = value; }
-        }
-
-        public object SyncRoot { get { return syncRoot; } }
-
-        public int Count { get { return Dictionary.Count; } }
-
-        public InventoryNodeDictionary(InventoryNode parentNode)
-        {
-            parent = parentNode;
-        }
-
-        public InventoryNode this[LLUUID key]
-        {
-            get { return (InventoryNode)this.Dictionary[key]; }
-            set
-            {
-                value.Parent = parent;
-                lock (syncRoot) this.Dictionary[key] = value;
-            }
-        }
-
-        public ICollection<LLUUID> Keys { get { return this.Dictionary.Keys; } }
-        public ICollection<InventoryNode> Values { get { return this.Dictionary.Values; } }
-
-        public void Add(LLUUID key, InventoryNode value)
-        {
-            value.Parent = parent;
-            lock (syncRoot) this.Dictionary.Add(key, value);
-        }
-
-        public void Remove(LLUUID key)
-        {
-            lock (syncRoot) this.Dictionary.Remove(key);
-        }
-
-        public bool Contains(LLUUID key)
-        {
-            return this.Dictionary.ContainsKey(key);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/DownloadRequest_Folder.cs b/old/libsl1550/libsecondlife/InventorySystem/DownloadRequest_Folder.cs
deleted file mode 100644
index a50cf9d..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/DownloadRequest_Folder.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-
-namespace libsecondlife.InventorySystem
-{
-    public class DownloadRequest_Folder
-    {
-        public string Name;
-        public LLUUID FolderID;
-
-        public int Expected = int.MaxValue;
-        public int Received = 0;
-        public int LastReceivedAtTick = 0;
-
-        public bool FetchFolders = true;
-        public bool FetchItems = true;
-
-        public bool IsCompleted
-        {
-            get { return (Received >= Expected);}
-        }
-
-        /// <summary>
-        /// Do we want to recursively download this folder?
-        /// </summary>
-        public bool Recurse = true;
-
-        public ManualResetEvent RequestComplete = new ManualResetEvent(false);
-
-        internal DownloadRequest_Folder(LLUUID folderID, bool recurse, bool fetchFolders, bool fetchItems, string requestName)
-        {
-            FolderID = folderID;
-            Recurse = recurse;
-            FetchFolders = fetchFolders;
-            FetchItems = fetchItems;
-            LastReceivedAtTick = Environment.TickCount;
-            Name = requestName;
-        }
-
-        public override string ToString()
-        {
-            // return FolderID.ToStringHyphenated() + " [Pg:" + Received + "/" + Expected + "](R:" + Recurse + ",F:" + FetchFolders + ",I:" + FetchItems + ")" + Name;
-            return " [Pg:" + Received + "/" + Expected + "](R:" + Recurse + ",F:" + FetchFolders + ",I:" + FetchItems + ")\t" + Name;
-        }
-
-        public override bool Equals(object obj)
-        {
-            if (obj is DownloadRequest_Folder)
-            {
-                DownloadRequest_Folder df = (DownloadRequest_Folder)obj;
-
-                if ((this.FolderID == df.FolderID)
-                    && (this.Recurse == df.Recurse)
-                    && (this.FetchFolders == df.FetchFolders)
-                    && (this.FetchItems == df.FetchItems)
-                    && (this.Received == df.Received)
-                    && (this.Expected == df.Expected)
-                    )
-                {
-                    return true;
-                }
-                else
-                {
-                    return false;
-                }
-            }
-            else
-            {
-                return base.Equals(obj);
-            }
-        }
-
-        public override int GetHashCode()
-        {
-            string Compound = FolderID.ToString() + Recurse + Received + FetchFolders + Expected + FetchItems;
-            return Compound.GetHashCode();
-        }
-    }
-
-    public class DownloadRequest_EventArgs : EventArgs
-    {
-        public DownloadRequest_Folder DownloadRequest;
-    }
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryBase.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryBase.cs
deleted file mode 100644
index 541e476..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryBase.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using System;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
-	/// <summary>
-	/// Base class for Inventory items
-	/// </summary>
-	abstract public class InventoryBase
-	{
-		protected InventoryManager iManager;
-
-		internal string _Name;
-
-        /// <summary>
-        /// </summary>
-        /// <param name="manager"></param>
-        internal InventoryBase(InventoryManager manager)
-		{
-			if( manager == null )
-			{
-				throw new Exception( "Inventory Manager cannot be null" );
-			}
-			iManager = manager;
-		}
-
-        /// <summary>
-        /// Output this item as XML
-        /// </summary>
-        /// <param name="outputAssets">Include an asset data as well, TRUE/FALSE</param>
-        abstract public string toXML(bool outputAssets);
-
-        /// <summary>
-        /// Get a short string describing this item's type
-        /// </summary>
-        abstract public string GetDisplayType();
-
-        /// <summary>
-        /// Utility function to simply making text XML safe
-        /// </summary>
-        /// <param name="str"></param>
-        protected string xmlSafe(string str)
-		{
-			if( str != null )
-			{
-				string clean = str.Replace("&","&amp;");
-				clean = clean.Replace("<","&lt;");
-				clean = clean.Replace(">","&gt;");
-				clean = clean.Replace("'","&apos;");
-				clean = clean.Replace("\"","&quot;");
-				return clean;
-			}
-			else
-			{
-				return "";
-			}
-		}
-
-	}
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryFolder.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryFolder.cs
deleted file mode 100644
index b9ef069..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryFolder.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-using System.Collections.Generic;
-using System;
-using libsecondlife;
-
-namespace libsecondlife.InventorySystem
-{
-    /// <summary>
-    /// Summary description for InventoryFolder.
-    /// </summary>
-    public class InventoryFolder : InventoryBase
-    {
-        public enum FolderUpdateFlag { None, NoRecurse, Recurse };
-
-        public string Name
-        {
-            get { return _Name; }
-        }
-
-
-        private LLUUID _FolderID;
-        public LLUUID FolderID
-        {
-            get { return _FolderID; }
-        }
-
-        internal LLUUID _ParentID;
-        public LLUUID ParentID
-        {
-            get { return _ParentID; }
-        }
-
-        internal sbyte _Type;
-        public sbyte Type
-        {
-            get { return _Type; }
-        }
-
-        internal List<InventoryBase> _Contents = new List<InventoryBase>();
-
-        #region Constructors
-        internal InventoryFolder(InventoryManager manager)
-            : base(manager)
-        {
-            _Name = "";
-            _FolderID = LLUUID.Zero;
-            _ParentID = LLUUID.Zero;
-            _Type = -1;
-        }
-
-        internal InventoryFolder(InventoryManager manager, String name, LLUUID folderID, LLUUID parentID)
-            : base(manager)
-        {
-            this._Name = name;
-            this._FolderID = folderID;
-            this._ParentID = parentID;
-            this._Type = 0;
-        }
-
-        internal InventoryFolder(InventoryManager manager, String name, LLUUID folderID, LLUUID parentID, sbyte Type)
-            : base(manager)
-        {
-            this._Name = name;
-            this._FolderID = folderID;
-            this._ParentID = parentID;
-            this._Type = Type;
-        }
-        #endregion
-
-        /// <summary>
-        /// Get the contents of this folder
-        /// </summary>
-        /// <returns>Contents of this folder</returns>
-        public List<InventoryBase> GetContents()
-        {
-            return _Contents;
-        }
-
-        /// <summary>
-        /// Request a download of this folder's content information.
-        /// </summary>
-        /// <param name="recurse">Indicate if we should recursively download content information.</param>
-        /// <param name="folders">Indicate if folders data should be downloaded</param>
-        /// <param name="items">Indicate if item data should be downloaded</param>
-        /// <returns>The Request object for this download</returns>
-        public DownloadRequest_Folder RequestDownloadContents(bool recurse, bool folders, bool items)
-        {
-            return RequestDownloadContents(recurse, folders, items, 0);
-        }
-
-        [Obsolete("Clearing is no longer an option when requesting a download, you should use another version of this method", false)]
-        public DownloadRequest_Folder RequestDownloadContents(bool recurse, bool folders, bool items, bool clear)
-        {
-            return RequestDownloadContents(recurse, folders, items, 0);
-        }
-
-
-        /// <summary>
-        /// Request a download of this folder's content information.  Block until done, or timeout is reached
-        /// </summary>
-        /// <param name="recurse">Indicate if we should recursively download content information.</param>
-        /// <param name="folders">Indicate if sub-folder data should be downloaded (true)</param>
-        /// <param name="items">Indicate if item data should be downloaded too (true)</param>
-        /// <param name="timeout">Milliseconds to wait before timing out, or -1 to wait indefinately.</param>
-        /// <returns>The Request object for this download</returns>
-        public DownloadRequest_Folder RequestDownloadContents(bool recurse, bool folders, bool items, int timeout)
-        {
-            DownloadRequest_Folder dr = iManager.FolderRequestAppend(FolderID, recurse, true, items, Name);
-            dr.RequestComplete.WaitOne(timeout, false);
-            return dr;
-        }
-
-        [Obsolete("Clearing is no longer an option when requesting a download, you should use another version of this method", false)]
-        public DownloadRequest_Folder RequestDownloadContents(bool recurse, bool folders, bool items, bool clear, int timeout)
-        {
-            return RequestDownloadContents(recurse, folders, items, timeout);
-        }
-
-        /// <summary>
-        /// Request that a sub-folder be created
-        /// </summary>
-        /// <param name="name">Name of folder</param>
-        /// <returns>A reference to the folder, or null if it fails</returns>
-        public InventoryFolder CreateFolder(string name)
-        {
-            // Request folder creation
-            LLUUID requestedFolderUUID = iManager.FolderCreate(name, FolderID);
-
-            // Refresh child folders, to find created folder.
-            if (RequestDownloadContents(false, true, false).RequestComplete.WaitOne(30000, false) == false)
-            {
-                // Should probably note the timeout somewhere...
-            }
-
-            foreach (InventoryBase ib in GetContents())
-            {
-                if (ib is InventoryFolder)
-                {
-                    InventoryFolder iFolder = (InventoryFolder)ib;
-                    if (iFolder.FolderID == requestedFolderUUID)
-                    {
-                        return iFolder;
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// Request this folder be deleted
-        /// </summary>
-        /// <remarks>You should re-request the parent folder's contents.</remarks>
-        public void Delete()
-        {
-            iManager.getFolder(this.ParentID)._Contents.Remove(this);
-            iManager.FolderRemove(this);
-        }
-
-        public void MoveTo(InventoryFolder newParent)
-        {
-            MoveTo(newParent.FolderID);
-        }
-
-        public void MoveTo(LLUUID newParentID)
-        {
-            iManager.FolderMove(this, newParentID);
-        }
-
-        public InventoryNotecard NewNotecard(string name, string description, string body)
-        {
-            return iManager.NewNotecard(name, description, body, this.FolderID);
-        }
-		public InventoryLandmark NewLandmark(string name, string description)
-        {
-            return iManager.NewLandmark(name, description, this.FolderID);
-        }
-        public InventoryImage NewImage(string name, string description, byte[] j2cdata)
-        {
-            return iManager.NewImage(name, description, j2cdata, this.FolderID);
-        }
-
-        public List<InventoryBase> GetItemByName(string name)
-        {
-            List<InventoryBase> items = new List<InventoryBase>();
-            foreach (InventoryBase ib in _Contents)
-            {
-                if (ib is InventoryFolder)
-                {
-                    items.AddRange(((InventoryFolder)ib).GetItemByName(name));
-                }
-                else if (ib is InventoryItem)
-                {
-                    if (((InventoryItem)ib).Name.Equals(name))
-                    {
-                        items.Add(ib);
-                    }
-                }
-            }
-
-            return items;
-        }
-
-        public override string GetDisplayType()
-        {
-            return "Folder";
-        }
-
-        /// <summary>
-        /// Output this folder as XML
-        /// </summary>
-        /// <param name="outputAssets">Include an asset data as well, TRUE/FALSE</param>
-        override public string toXML(bool outputAssets)
-        {
-            string output = "<folder ";
-
-            output += "name = '" + xmlSafe(Name) + "' ";
-            output += "uuid = '" + FolderID + "' ";
-            output += "parent = '" + ParentID + "' ";
-            output += "Type = '" + Type + "' ";
-            output += ">\n";
-
-            foreach (Object oContent in _Contents)
-            {
-                output += ((InventoryBase)oContent).toXML(outputAssets);
-            }
-
-            output += "</folder>\n";
-
-            return output;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryImage.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryImage.cs
deleted file mode 100644
index 9e96d9d..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryImage.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-using System;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
-	/// <summary>
-	/// Summary description for InventoryNotecard.
-	/// </summary>
-	public class InventoryImage : InventoryItem
-	{
-		public byte[] J2CData
-		{
-			get
-			{
-                if (_Asset != null)
-                {
-					return ((AssetImage)Asset).J2CData;
-				}
-				else
-				{
-                    if ((AssetID != null))
-					{
-                        AssetRequestDownload request = base.iManager.AssetManager.RequestInventoryAsset(this);
-                        if (request.Wait(libsecondlife.AssetSystem.AssetManager.DefaultTimeout) != AssetRequestDownload.RequestStatus.Success)
-                        {
-                            throw new Exception("Asset (" + AssetID.ToStringHyphenated() + ") unavailable (" + request.StatusMsg + ") for " + this.Name);
-                        }
-                        _Asset = new AssetImage(AssetID, request.GetAssetData());
-
-                        return ((AssetImage)Asset).J2CData;
-					}
-				}
-
-				return null;
-			}
-
-			set
-			{
-				base._Asset = new AssetImage( LLUUID.Random(), value );
-				LLUUID TransactionID = base.iManager.AssetManager.UploadAsset( Asset );
-                base.SetAssetTransactionIDs( Asset.AssetID, TransactionID );
-			}
-
-		}
-
-		internal InventoryImage( InventoryManager manager, string name, string description,  LLUUID folderID, LLUUID uuidOwnerCreater )
-			: base(manager, name, description, folderID, 0, 0, uuidOwnerCreater)
-		{
-
-		}
-
-		internal InventoryImage( InventoryManager manager, InventoryItem ii )
-			: base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
-		{
-			if( (ii.InvType != 0) || (ii.Type != (sbyte)Asset.AssetType.Texture) )
-			{
-				throw new Exception("The InventoryItem cannot be converted to a Image/Texture, wrong InvType/Type.");
-			}
-
-			this.iManager = manager;
-            this._ItemID = ii._ItemID;
-			this._Asset = ii._Asset;
-			this._AssetID = ii._AssetID;
-			this._BaseMask = ii._BaseMask;
-			this._CRC = ii._CRC;
-			this._CreationDate = ii._CreationDate;
-			this._EveryoneMask = ii._EveryoneMask;
-			this._Flags = ii._Flags;
-			this._GroupID = ii._GroupID;
-			this._GroupMask = ii._GroupMask;
-			this._GroupOwned = ii._GroupOwned;
-			this._InvType = ii._InvType;
-			this._NextOwnerMask = ii._NextOwnerMask;
-			this._OwnerID = ii._OwnerID;
-			this._OwnerMask = ii._OwnerMask;
-			this._SalePrice = ii._SalePrice;
-			this._SaleType = ii._SaleType;
-			this._Type = ii._Type;
-		}
-
-
-		override internal void SetAssetData( byte[] assetData )
-		{
-			if( _Asset == null )
-			{
-				if( _AssetID != null )
-				{
-					_Asset = new AssetImage( _AssetID, assetData );
-				}
-				else
-				{
-					_Asset   = new AssetImage( LLUUID.Random(), assetData );
-					_AssetID = _Asset.AssetID;
-				}
-			}
-			else
-			{
-				Asset.SetAssetData(assetData);
-			}
-
-		}
-
-        public override string GetDisplayType()
-        {
-            return "Image";
-        }
-
-
-        /// <summary>
-        /// Output this image as XML
-        /// </summary>
-        /// <param name="outputAssets">Include an asset data as well, TRUE/FALSE</param>
-        override public string toXML(bool outputAssets)
-		{
-			string output = "<image ";
-
-			output += "name = '" + xmlSafe(Name) + "' ";
-			output += "uuid = '" + ItemID + "' ";
-			output += "invtype = '" + InvType + "' ";
-			output += "type = '" + Type + "' ";
-
-
-
-			output += "description = '" + xmlSafe(Description) + "' ";
-			output += "crc = '" + CRC + "' ";
-			output += "debug = '" + InventoryPacketHelper.InventoryUpdateCRC(this) + "' ";
-			output += "ownerid = '" + OwnerID + "' ";
-			output += "creatorid = '" + CreatorID + "' ";
-
-			output += "assetid = '" + AssetID + "' ";
-			output += "groupid = '" + GroupID + "' ";
-
-			output += "groupowned = '" + GroupOwned + "' ";
-			output += "creationdate = '" + CreationDate + "' ";
-			output += "flags = '" + Flags + "' ";
-
-			output += "saletype = '" + SaleType + "' ";
-			output += "saleprice = '" + SalePrice + "' ";
-			output += "basemask = '" + BaseMask + "' ";
-			output += "everyonemask = '" + EveryoneMask + "' ";
-			output += "nextownermask = '" + NextOwnerMask + "' ";
-			output += "groupmask = '" + GroupMask + "' ";
-			output += "ownermask = '" + OwnerMask + "' ";
-
-			output += ">\n";
-
-			if( outputAssets )
-			{
-				output += xmlSafe(base.Asset.AssetDataToString());
-			}
-
-			output += "</image>";
-
-
-			return output;
-		}
-
-	}
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryItem.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryItem.cs
deleted file mode 100644
index 838e557..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryItem.cs
+++ /dev/null
@@ -1,602 +0,0 @@
-using System.Collections.Generic;
-using System;
-using System.Xml;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-using libsecondlife.Packets;
-
-namespace libsecondlife.InventorySystem
-{
-    /// <summary>
-    /// Base class for most inventory items, providing a lot of general inventory management functions.
-    /// </summary>
-    public class InventoryItem : InventoryBase
-    {
-        private const uint FULL_MASK_PERMISSIONS = 2147483647;
-
-        public string Name
-        {
-            get { return base._Name; }
-            set
-            {
-                _Name = value;
-                UpdateItem();
-            }
-        }
-
-        internal LLUUID _FolderID = LLUUID.Zero;
-        public LLUUID FolderID
-        {
-            get { return _FolderID; }
-            set
-            {
-                InventoryFolder iTargetFolder = base.iManager.getFolder(value);
-                if (iTargetFolder == null)
-                {
-                    throw new Exception("Target Folder [" + value + "] does not exist.");
-                }
-
-                base.iManager.getFolder(this.FolderID)._Contents.Remove(this);
-                iTargetFolder._Contents.Add(this);
-
-                _FolderID = value;
-                base.iManager.MoveItem(ItemID, FolderID);
-            }
-        }
-
-        internal LLUUID _ItemID = null;
-        public LLUUID ItemID
-        {
-            set
-            {
-                if (_ItemID == null)
-                {
-                    _ItemID = value;
-                }
-                else
-                {
-                    throw new Exception("You can not change an item's ID once it's been set.");
-                }
-            }
-            get
-            {
-                return _ItemID;
-            }
-        }
-
-        internal sbyte _InvType = 0;
-        public sbyte InvType
-        {
-            get { return _InvType; }
-        }
-
-        internal sbyte _Type = 0;
-        public sbyte Type
-        {
-            get { return _Type; }
-            set
-            {
-                _Type = value;
-                UpdateItem();
-            }
-        }
-
-
-        internal string _Description = "";
-        public string Description
-        {
-            get { return _Description; }
-            set
-            {
-                _Description = value;
-                UpdateItem();
-            }
-        }
-
-        internal uint _CRC = 0;
-        public uint CRC
-        {
-            get { return _CRC; }
-            set
-            {
-                _CRC = value;
-            }
-        }
-
-
-        internal LLUUID _OwnerID = LLUUID.Zero;
-        public LLUUID OwnerID
-        {
-            get { return _OwnerID; }
-        }
-
-        internal LLUUID _CreatorID = LLUUID.Zero;
-        public LLUUID CreatorID
-        {
-            get { return _CreatorID; }
-        }
-
-        internal Asset _Asset;
-        public Asset Asset
-        {
-            get
-            {
-                if (_Asset != null)
-                {
-                    return _Asset;
-                }
-                else
-                {
-                    if ((AssetID != null))
-                    {
-                        AssetRequestDownload request = base.iManager.AssetManager.RequestInventoryAsset(this);
-                        if (request.Wait(libsecondlife.AssetSystem.AssetManager.DefaultTimeout) != AssetRequestDownload.RequestStatus.Success)
-                        {
-                            throw new Exception("Asset (" + AssetID.ToStringHyphenated() + ") unavailable (" + request.StatusMsg + ") for " + this.Name);
-                        }
-                        switch (Type)
-                        {
-                            case (sbyte)Asset.AssetType.Clothing:
-                                _Asset = new AssetWearable_Clothing(AssetID, request.GetAssetData());
-                                break;
-                            case (sbyte)Asset.AssetType.Bodypart:
-                                _Asset = new AssetWearable_Body(AssetID, request.GetAssetData());
-                                break;
-                            case (sbyte)Asset.AssetType.LSLText:
-                                _Asset = new AssetScript(AssetID, request.GetAssetData());
-                                break;
-                            case (sbyte)Asset.AssetType.Notecard:
-                                _Asset = new AssetNotecard(AssetID, request.GetAssetData());
-                                break;
-                            case (sbyte)Asset.AssetType.Texture:
-                                _Asset = new AssetImage(AssetID, request.GetAssetData());
-                                break;
-                            default:
-                                _Asset = new Asset(AssetID, Type, request.GetAssetData());
-                                break;
-                        }
-
-                        return Asset;
-                    }
-                }
-                return null;
-            }
-        }
-
-        internal LLUUID _TransactionID = LLUUID.Zero;
-        public LLUUID TransactionID
-        {
-            get { return _TransactionID; }
-        }
-
-        internal LLUUID _AssetID = LLUUID.Zero;
-        public LLUUID AssetID
-        {
-            get { return _AssetID; }
-        }
-
-
-        internal LLUUID _GroupID = LLUUID.Zero;
-        public LLUUID GroupID
-        {
-            get { return _GroupID; }
-            set
-            {
-                _GroupID = value;
-                UpdateItem();
-            }
-        }
-
-        internal bool _GroupOwned = false;
-        public bool GroupOwned
-        {
-            get { return _GroupOwned; }
-            set
-            {
-                _GroupOwned = value;
-                UpdateItem();
-            }
-        }
-
-        internal int _CreationDate = (int)((TimeSpan)(DateTime.UtcNow - new DateTime(1970, 1, 1))).TotalSeconds;
-        public int CreationDate
-        {
-            get { return _CreationDate; }
-        }
-
-        internal byte _SaleType = 0;
-        public byte SaleType
-        {
-            get { return _SaleType; }
-            set
-            {
-                _SaleType = value;
-                UpdateItem();
-            }
-        }
-
-        internal uint _BaseMask = FULL_MASK_PERMISSIONS;
-        public uint BaseMask
-        {
-            get { return _BaseMask; }
-        }
-
-        internal int _SalePrice = 0;
-        public int SalePrice
-        {
-            get { return _SalePrice; }
-            set
-            {
-                _SalePrice = value;
-                UpdateItem();
-            }
-        }
-
-        internal uint _EveryoneMask = 0;
-        public uint EveryoneMask
-        {
-            get { return _EveryoneMask; }
-            set
-            {
-                _EveryoneMask = value;
-                UpdateItem();
-            }
-        }
-
-        internal uint _Flags = 0;
-        public uint Flags
-        {
-            get { return _Flags; }
-            set
-            {
-                _Flags = value;
-                UpdateItem();
-            }
-        }
-
-        internal uint _NextOwnerMask = FULL_MASK_PERMISSIONS;
-        public uint NextOwnerMask
-        {
-            get { return _NextOwnerMask; }
-            set
-            {
-                _NextOwnerMask = value;
-                UpdateItem();
-            }
-        }
-
-        internal uint _GroupMask = 0;
-        public uint GroupMask
-        {
-            get { return _GroupMask; }
-            set
-            {
-                _GroupMask = value;
-                UpdateItem();
-            }
-        }
-
-        internal uint _OwnerMask = FULL_MASK_PERMISSIONS;
-        public uint OwnerMask
-        {
-            get { return _OwnerMask; }
-        }
-
-
-
-        internal InventoryItem(InventoryManager manager)
-            : base(manager)
-        {
-        }
-
-        internal InventoryItem(InventoryManager manager, InventoryDescendentsPacket.ItemDataBlock itemData)
-            : base(manager)
-        {
-
-            _Name = System.Text.Encoding.UTF8.GetString(itemData.Name).Trim().Replace("\0", "");
-            _Description = System.Text.Encoding.UTF8.GetString(itemData.Description).Trim().Replace("\0", "");
-            _CreationDate = itemData.CreationDate;
-
-            _InvType = itemData.InvType;
-            _Type = itemData.Type;
-
-            _ItemID = itemData.ItemID;
-            _AssetID = itemData.AssetID;
-            _FolderID = itemData.FolderID;
-
-            _GroupOwned = itemData.GroupOwned;
-            _GroupID = itemData.GroupID;
-            _GroupMask = itemData.GroupMask;
-
-            _CreatorID = itemData.CreatorID;
-            _OwnerID = itemData.OwnerID;
-            _OwnerMask = itemData.OwnerMask;
-
-
-            _Flags = itemData.Flags;
-            _BaseMask = itemData.BaseMask;
-            _EveryoneMask = itemData.EveryoneMask;
-            _NextOwnerMask = itemData.NextOwnerMask;
-
-            _SaleType = itemData.SaleType;
-            _SalePrice = itemData.SalePrice;
-
-            _CRC = itemData.CRC;
-        }
-
-        internal InventoryItem(InventoryManager manager, string name, LLUUID folderID, sbyte invType, sbyte type, LLUUID uuidOwnerCreater)
-            : base(manager)
-        {
-            _Name = name;
-            _FolderID = folderID;
-            _InvType = invType;
-            _Type = type;
-            _OwnerID = uuidOwnerCreater;
-            _CreatorID = uuidOwnerCreater;
-
-            UpdateCRC();
-        }
-
-        internal InventoryItem(InventoryManager manager, string name, string description, LLUUID folderID, sbyte invType, sbyte type, LLUUID uuidOwnerCreater)
-            : base(manager)
-        {
-            _Name = name;
-            _Description = description;
-            _FolderID = folderID;
-            _InvType = invType;
-            _Type = type;
-            _OwnerID = uuidOwnerCreater;
-            _CreatorID = uuidOwnerCreater;
-
-            UpdateCRC();
-        }
-
-        /// <summary></summary>
-        ///
-        protected void SetAssetTransactionIDs(LLUUID assetID, LLUUID transactionID)
-        {
-            _AssetID = assetID;
-            _TransactionID = transactionID;
-            UpdateItem();
-        }
-
-        /// <summary>
-        /// </summary>
-        /// <param name="o"></param>
-        public override bool Equals(object o)
-        {
-            if ((o is InventoryItem) == false)
-            {
-                return false;
-            }
-
-            return this._ItemID == ((InventoryItem)o)._ItemID;
-        }
-
-        /// <summary>
-        /// </summary>
-        public override int GetHashCode()
-        {
-            return this._ItemID.GetHashCode();
-        }
-
-        /// <summary>
-        /// CompareTo provided so that items can be sorted by name
-        /// </summary>
-        /// <param name="obj"></param>
-        public int CompareTo(object obj)
-        {
-            if (obj is InventoryBase)
-            {
-                InventoryBase temp = (InventoryBase)obj;
-                return this._Name.CompareTo(temp._Name);
-            }
-            throw new ArgumentException("object is not an InventoryItem");
-        }
-
-        private void UpdateItem()
-        {
-            UpdateCRC();
-            base.iManager.ItemUpdate(this);
-        }
-
-        private void UpdateCRC()
-        {
-            _CRC = InventoryPacketHelper.InventoryUpdateCRC(this);
-        }
-
-        /// <summary>
-        /// Move this item to the target folder
-        /// </summary>
-        /// <param name="targetFolder"></param>
-        public void MoveTo(InventoryFolder targetFolder)
-        {
-            this.FolderID = targetFolder.FolderID;
-        }
-
-        /// <summary>
-        /// Move this item to the target folder
-        /// </summary>
-        /// <param name="targetFolderID"></param>
-        public void MoveTo(LLUUID targetFolderID)
-        {
-            this.FolderID = targetFolderID;
-        }
-
-        /// <summary>
-        /// If you have Copy permission, a copy is placed in the target folder
-        /// </summary>
-        /// <param name="targetFolder"></param>
-        public void CopyTo(LLUUID targetFolder)
-        {
-            base.iManager.ItemCopy(this.ItemID, targetFolder);
-        }
-
-        /// <summary>
-        /// Give this item to another agent.  If you have Copy permission, a copy will be given
-        /// </summary>
-        /// <param name="ToAgentID"></param>
-        public void GiveTo(LLUUID ToAgentID)
-        {
-            base.iManager.ItemGiveTo(this, ToAgentID);
-        }
-
-        /// <summary>
-        /// Delete this item from Second Life
-        /// </summary>
-        public void Delete()
-        {
-            iManager.getFolder(this.FolderID)._Contents.Remove(this);
-            iManager.ItemRemove(this);
-
-        }
-
-        /// <summary>
-        /// Attempt to rez this inventory item at the given point
-        /// </summary>
-        /// <param name="TargetPos">Region/Sim coordinates</param>
-        public void RezObject(LLVector3 TargetPos)
-        {
-            RezObject(TargetPos, null);
-        }
-
-        /// <summary>
-        /// Attempt to rez this inventory item at the given point, in the given simulator
-        /// </summary>
-        /// <param name="TargetPos">Region/Sim coords</param>
-        /// <param name="TargetSim"></param>
-        public void RezObject(LLVector3 TargetPos, Simulator TargetSim)
-        {
-            iManager.ItemRezObject(this, TargetSim, TargetPos);
-        }
-
-        /// <summary>
-        /// Attempt to attach this item
-        /// </summary>
-        public void Attach()
-        {
-            Attach(0); //Use default attach point.
-        }
-
-        /// <summary>
-        /// Attempt to attach this item.
-        /// </summary>
-        /// <param name="AttachmentPt">Where to attach to</param>
-        public void Attach(ObjectManager.AttachmentPoint AttachmentPt)
-        {
-            iManager.ItemRezAttach(this, 0);
-        }
-
-        /// <summary>
-        /// Attempt to detach this item
-        /// </summary>
-        public void Detach()
-        {
-            iManager.ItemDetach(this);
-        }
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetData"></param>
-        virtual internal void SetAssetData(byte[] assetData)
-        {
-            if (_Asset == null)
-            {
-                if (AssetID != null)
-                {
-                    _Asset = new Asset(AssetID, Type, assetData);
-                }
-                else
-                {
-                    _Asset = new Asset(LLUUID.Random(), Type, assetData);
-                    _AssetID = _Asset.AssetID;
-                }
-            }
-            else
-            {
-                _Asset.SetAssetData(assetData);
-            }
-        }
-
-        public override string GetDisplayType()
-        {
-            return "Unknown_Item";
-        }
-
-        /// <summary>
-        /// Output this item as XML
-        /// </summary>
-        /// <param name="outputAssets">Include an asset data as well, TRUE/FALSE</param>
-        override public string toXML(bool outputAssets)
-        {
-            string output = "<item ";
-
-            output += "name = '" + xmlSafe(Name) + "' ";
-            output += "uuid = '" + ItemID + "' ";
-            output += "invtype = '" + InvType + "' ";
-            output += "type = '" + Type + "' ";
-
-
-
-            output += "description = '" + xmlSafe(Description) + "' ";
-            output += "crc = '" + CRC + "' ";
-            output += "debug = '" + InventoryPacketHelper.InventoryUpdateCRC(this) + "' ";
-            output += "ownerid = '" + OwnerID + "' ";
-            output += "creatorid = '" + CreatorID + "' ";
-
-            output += "assetid = '" + AssetID + "' ";
-            output += "groupid = '" + GroupID + "' ";
-
-            output += "groupowned = '" + GroupOwned + "' ";
-            output += "creationdate = '" + CreationDate + "' ";
-            output += "flags = '" + Flags + "' ";
-
-            output += "saletype = '" + SaleType + "' ";
-            output += "saleprice = '" + SalePrice + "' ";
-            output += "basemask = '" + BaseMask + "' ";
-            output += "everyonemask = '" + EveryoneMask + "' ";
-            output += "nextownermask = '" + NextOwnerMask + "' ";
-            output += "groupmask = '" + GroupMask + "' ";
-            output += "ownermask = '" + OwnerMask + "' ";
-
-            output += ">";
-
-            if (outputAssets)
-            {
-                if (AssetID != LLUUID.Zero)
-                {
-                    output += xmlSafe(Helpers.FieldToUTF8String(Asset.AssetData));
-                }
-            }
-            output += "</item>";
-
-            return output;
-        }
-    }
-}
-
-/*
-	1044 ItemData (Variable)
-		0047 GroupOwned (BOOL / 1)
-		0149 CRC (U32 / 1)
-		0159 CreationDate (S32 / 1)
-		0345 SaleType (U8 / 1)
-		0395 BaseMask (U32 / 1)
-		0506 Name (Variable / 1)
-		0562 InvType (S8 / 1)
-		0630 Type (S8 / 1)
-		0680 AssetID (LLUUID / 1)
-		0699 GroupID (LLUUID / 1)
-		0716 SalePrice (S32 / 1)
-		0719 OwnerID (LLUUID / 1)
-		0736 CreatorID (LLUUID / 1)
-		0968 ItemID (LLUUID / 1)
-		1025 FolderID (LLUUID / 1)
-		1084 EveryoneMask (U32 / 1)
-		1101 Description (Variable / 1)
-		1189 Flags (U32 / 1)
-		1348 NextOwnerMask (U32 / 1)
-		1452 GroupMask (U32 / 1)
-		1505 OwnerMask (U32 / 1)
-*/
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryLandmark.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryLandmark.cs
deleted file mode 100644
index f3da2d9..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryLandmark.cs
+++ /dev/null
@@ -1,233 +0,0 @@
-using System;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
-	/// <summary>
-	/// Summary description for InventoryLandmark.
-	/// </summary>
-	public class InventoryLandmark : InventoryItem
-	{
-		public string Body
-		{
-			get
-			{
-				if( _Asset != null )
-				{
-					return ((AssetLandmark)Asset).Body;
-				} else {
-                    if ((AssetID != null))
-					{
-						return grabAsset(AssetID);
-					}
-				}
-
-				return null;
-			}
-
-		}
-
-		public int Version
-		{
-			get
-			{
-				if ( _Asset != null )
-				{
-					return ((AssetLandmark)Asset).Version;
-				} else {
-                    if ((AssetID != null))
-					{
-						grabAsset(AssetID);
-						return ((AssetLandmark)Asset).Version;
-					}
-					return 0;
-				}
-			}
-		}
-
-		public LLVector3 Pos
-		{
-			get
-			{
-				if ( _Asset != null )
-				{
-					return ((AssetLandmark)Asset).Pos;
-				} else {
-                    if ((AssetID != null))
-					{
-						grabAsset(AssetID);
-						return ((AssetLandmark)Asset).Pos;
-					}
-					return LLVector3.Zero;
-				}
-			}
-			set {
-				((AssetLandmark)Asset).Pos = value;
-				LLUUID TransactionID = base.iManager.AssetManager.UploadAsset( Asset );
-				base.SetAssetTransactionIDs(Asset.AssetID, TransactionID);
-			}
-		}
-
-		public LLUUID Region
-		{
-			get
-			{
-				if ( _Asset != null )
-				{
-					return ((AssetLandmark)Asset).Region;
-				} else {
-                    if ((AssetID != null))
-					{
-						grabAsset(AssetID);
-						return ((AssetLandmark)Asset).Region;
-					}
-					return LLUUID.Zero;
-				}
-			}
-			set {
-				((AssetLandmark)Asset).Region = value;
-				LLUUID TransactionID = base.iManager.AssetManager.UploadAsset( Asset );
-				base.SetAssetTransactionIDs(Asset.AssetID, TransactionID);
-			}
-		}
-		private string grabAsset( LLUUID AssetID )
-		{
-			AssetRequestDownload request = base.iManager.AssetManager.RequestInventoryAsset(this);
-            if (request.Wait(libsecondlife.AssetSystem.AssetManager.DefaultTimeout) != AssetRequestDownload.RequestStatus.Success)
-			{
-				throw new Exception("Asset (" + AssetID.ToStringHyphenated() + ") unavailable (" + request.StatusMsg + ") for " + this.Name);
-			}
-			_Asset = new AssetLandmark(AssetID, request.GetAssetData());
-			return ((AssetLandmark)Asset).Body;
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="manager"></param>
-        /// <param name="name"></param>
-        /// <param name="description"></param>
-        /// <param name="folderID"></param>
-        /// <param name="uuidOwnerCreater"></param>
-        internal InventoryLandmark(InventoryManager manager, string name, string description, LLUUID folderID, LLUUID uuidOwnerCreater)
-			: base(manager, name, description, folderID, 3, 3, uuidOwnerCreater)
-		{
-
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="manager"></param>
-        /// <param name="ii"></param>
-        internal InventoryLandmark(InventoryManager manager, InventoryItem ii)
-			: base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
-		{
-            if ((ii.InvType != 3) || (ii.Type != (sbyte)Asset.AssetType.Landmark))
-			{
-				throw new Exception("The InventoryItem cannot be converted to a Landmark, wrong InvType/Type.");
-			}
-
-			this.iManager = manager;
-            this._ItemID = ii._ItemID;
-			this._Asset = ii._Asset;
-			this._AssetID = ii._AssetID;
-			this._BaseMask = ii._BaseMask;
-			this._CRC = ii._CRC;
-			this._CreationDate = ii._CreationDate;
-			this._EveryoneMask = ii._EveryoneMask;
-			this._Flags = ii._Flags;
-			this._GroupID = ii._GroupID;
-			this._GroupMask = ii._GroupMask;
-			this._GroupOwned = ii._GroupOwned;
-			this._InvType = ii._InvType;
-			this._NextOwnerMask = ii._NextOwnerMask;
-			this._OwnerID = ii._OwnerID;
-			this._OwnerMask = ii._OwnerMask;
-			this._SalePrice = ii._SalePrice;
-			this._SaleType = ii._SaleType;
-			this._Type = ii._Type;
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetData"></param>
-        override internal void SetAssetData(byte[] assetData)
-		{
-			if( _Asset == null )
-			{
-				if( AssetID != null )
-				{
-					_Asset = new AssetLandmark( AssetID, assetData );
-				}
-				else
-				{
-					_Asset   = new AssetLandmark( LLUUID.Random(), assetData );
-					_AssetID = _Asset.AssetID;
-				}
-			}
-			else
-			{
-				_Asset.SetAssetData(assetData);
-			}
-
-		}
-
-
-        public override string GetDisplayType()
-        {
-            return "Landmark";
-        }
-
-        /// <summary>
-        /// Output this item as XML
-        /// </summary>
-        /// <param name="outputAssets">Include an asset data as well, TRUE/FALSE</param>
-        override public string toXML(bool outputAssets)
-		{
-			string output = "<Landmark ";
-
-			output += "name = '" + xmlSafe(Name) + "' ";
-			output += "uuid = '" + ItemID + "' ";
-			output += "invtype = '" + InvType + "' ";
-			output += "type = '" + Type + "' ";
-
-
-
-			output += "description = '" + xmlSafe(Description) + "' ";
-			output += "crc = '" + CRC + "' ";
-			output += "debug = '" + InventoryPacketHelper.InventoryUpdateCRC(this) + "' ";
-			output += "ownerid = '" + OwnerID + "' ";
-			output += "creatorid = '" + CreatorID + "' ";
-
-			output += "assetid = '" + AssetID + "' ";
-			output += "groupid = '" + GroupID + "' ";
-
-			output += "groupowned = '" + GroupOwned + "' ";
-			output += "creationdate = '" + CreationDate + "' ";
-			output += "flags = '" + Flags + "' ";
-
-			output += "saletype = '" + SaleType + "' ";
-			output += "saleprice = '" + SalePrice + "' ";
-			output += "basemask = '" + BaseMask + "' ";
-			output += "everyonemask = '" + EveryoneMask + "' ";
-			output += "nextownermask = '" + NextOwnerMask + "' ";
-			output += "groupmask = '" + GroupMask + "' ";
-			output += "ownermask = '" + OwnerMask + "' ";
-
-			output += ">";
-
-			if( outputAssets )
-			{
-				output += xmlSafe(Body);
-			}
-
-			output += "</Landmark>";
-
-
-			return output;
-		}
-
-	}
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryManager.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryManager.cs
deleted file mode 100644
index e5ec569..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryManager.cs
+++ /dev/null
@@ -1,1316 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-//#define DEBUG_PACKETS
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-using libsecondlife.Packets;
-
-
-namespace libsecondlife.InventorySystem
-{
-
-    /// <summary>
-    /// Summary description for Inventory.
-    /// </summary>
-    public class InventoryManager
-    {
-
-        // Reference to the SLClient Library
-        private SecondLife slClient;
-//        private ManualResetEvent InventoryManagerInitialized = new ManualResetEvent(false);
-
-        // Reference to the Asset Manager
-        internal libsecondlife.AssetManager AssetManager
-        {
-            get { return slClient.Assets; }
-        }
-
-
-        // Packet assembly helper
-        public InventoryPacketHelper InvPacketHelper = null;
-
-        // Setup a dictionary to easily lookup folders by UUID
-        private Dictionary<LLUUID, InventoryFolder> FoldersByUUID = new Dictionary<LLUUID, InventoryFolder>();
-
-        // Setup a dictionary to track download progress
-//        protected Dictionary<LLUUID, DownloadRequest_Folder> FolderDownloadStatus = new Dictionary<LLUUID, DownloadRequest_Folder>();
-        protected List<DownloadRequest_Folder> FolderRequests = new List<DownloadRequest_Folder>();
-        protected bool CurrentlyDownloadingAFolder = false;
-        protected DownloadRequest_Folder CurrentlyDownloadingRequest = null;
-        private Mutex CurrentlyDownloadingMutex = new Mutex();
-
-        protected Dictionary<sbyte, InventoryFolder> FolderByType = new Dictionary<sbyte, InventoryFolder>();
-
-        // Used to track current item being created
-        private InventoryItem iiCreationInProgress;
-        public ManualResetEvent ItemCreationCompleted;
-
-        // Used to track to see if a download has timed out or not
-//        private int LastPacketRecievedAtTick;
-
-        public enum InventoryType : sbyte
-        {
-            Unknown = -1,
-            Texture = 0,
-            Sound = 1,
-            CallingCard = 2,
-            Landmark = 3,
-            [Obsolete]
-            Script = 4,
-            [Obsolete]
-            Clothing = 5,
-            Object = 6,
-            Notecard = 7,
-            Category = 8,
-            Folder = 8,
-            RootCategory = 0,
-            LSL = 10,
-            [Obsolete]
-            LSLBytecode = 11,
-            [Obsolete]
-            TextureTGA = 12,
-            [Obsolete]
-            Bodypart = 13,
-            [Obsolete]
-            Trash = 14,
-            Snapshot = 15,
-            [Obsolete]
-            LostAndFound = 16,
-            Attachment = 17,
-            Wearable = 18,
-            Animation = 19,
-            Gesture = 20
-        }
-
-        /// <summary>
-        /// Used to turn on debug logging of descendant downloading.
-        /// </summary>
-        public bool LogDescendantQueue = false;
-
-        /// <summary>
-        /// Download event singalling that folder contents have been downloaded.
-        /// </summary>
-        /// <param name="InventoryFolder">The Inventory Folder that was updated</param>
-        /// <param name="e"></param>
-        public delegate void On_RequestDownloadContents_Finished(object iFolder, EventArgs e);
-        public event On_RequestDownloadContents_Finished OnRequestDownloadFinishedEvent;
-
-        public delegate void On_InventoryItemReceived(LLUUID fromAgentID, string fromAgentName, uint parentEstateID, LLUUID regionID, LLVector3 position, DateTime timestamp, InventoryItem item);
-        public event On_InventoryItemReceived OnInventoryItemReceived;
-
-        public delegate void On_InventoryFolderReceived(LLUUID fromAgentID, string fromAgentName, uint parentEstateID, LLUUID regionID, LLVector3 position, DateTime timestamp, InventoryFolder folder);
-        public event On_InventoryFolderReceived OnInventoryFolderReceived;
-
-        /// <summary>
-        /// Primary constructor
-        /// </summary>
-        /// <param name="client"></param>
-        public InventoryManager(SecondLife client)
-        {
-            slClient = client;
-
-            InvPacketHelper = new InventoryPacketHelper(slClient);
-
-            // Need to know what when we're connected/disconnected
-            slClient.Network.OnConnected += new NetworkManager.ConnectedCallback(Network_OnConnected);
-            slClient.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
-
-            // Setup the callback for Inventory Downloads
-            slClient.Network.RegisterCallback(PacketType.InventoryDescendents, new NetworkManager.PacketCallback(InventoryDescendentsHandler));
-
-            // Setup the callback for Inventory Creation Update
-            slClient.Network.RegisterCallback(PacketType.UpdateCreateInventoryItem, new NetworkManager.PacketCallback(UpdateCreateInventoryItemHandler));
-
-            // Lets listen for inventory being given to us
-            slClient.Self.OnInstantMessage += new MainAvatar.InstantMessageCallback(Self_OnInstantMessage);
-        }
-
-        #region State Management
-        /// <summary>
-        /// Inventory Management state should be cleared on connect/disconnect.
-        /// </summary>
-        /// <param name="reason"></param>
-        /// <param name="message"></param>
-        void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message)
-        {
-            // Clear out current state
-            ClearState();
-        }
-
-        /// <summary>
-        /// Inventory Management state should be cleared on connect/disconnect.
-        /// </summary>
-        /// <param name="sender"></param>
-        void Network_OnConnected(object sender)
-        {
-            // Clear out current state
-            ClearState();
-        }
-
-        /// <summary>
-        /// Reset the current state of the InventorySystem
-        /// </summary>
-        private void ClearState()
-        {
-            FoldersByUUID.Clear();
-
-            lock (FolderRequests)
-            {
-                FolderRequests.Clear();
-            }
-            if (slClient.Self.InventoryRootFolderUUID != null)
-            {
-                // Init folder structure with root
-                InventoryFolder ifRootFolder = new InventoryFolder(this, "My Inventory", slClient.Self.InventoryRootFolderUUID, null);
-                FoldersByUUID[slClient.Self.InventoryRootFolderUUID] = ifRootFolder;
-            }
-        }
-        #endregion
-
-        #region Folder Navigation
-        /// <summary>
-        /// Get the root folder of a client's inventory
-        /// </summary>
-        /// <returns></returns>
-        public InventoryFolder GetRootFolder()
-        {
-            return FoldersByUUID[slClient.Self.InventoryRootFolderUUID];
-        }
-
-        /// <summary>
-        /// Get a specific folder by FolderID from the local cached inventory information
-        /// </summary>
-        /// <param name="folderID"></param>
-        /// <returns>Returns null if the folder doesn't exist in cached inventory</returns>
-        public InventoryFolder getFolder(LLUUID folderID)
-        {
-            if (FoldersByUUID.ContainsKey(folderID))
-            {
-                return FoldersByUUID[folderID];
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        /// <summary>
-        /// Get a specific folder by Name from the local cached inventory information
-        /// </summary>
-        /// <param name="sFolderPath"></param>
-        /// <returns></returns>
-        public InventoryFolder getFolder(String sFolderPath)
-        {
-            string sSecretConst = "+@#%$#$%^%^%$^$%SV$#%FR$G";
-            sFolderPath = sFolderPath.Replace("//", sSecretConst);
-
-            if (sFolderPath.StartsWith("/"))
-            {
-                sFolderPath = sFolderPath.Remove(0, 1);
-            }
-
-            if (sFolderPath.Length == 0)
-            {
-                return GetRootFolder();
-            }
-
-            char[] seperators = { '/' };
-            string[] sFolderPathParts = sFolderPath.Split(seperators);
-
-            for (int i = 0; i < sFolderPathParts.Length; i++)
-            {
-                sFolderPathParts[i] = sFolderPathParts[i].Replace(sSecretConst, "/");
-            }
-
-            Queue<string> pathParts = new Queue<string>(sFolderPathParts);
-
-            return getFolder(pathParts);
-        }
-
-        /// <summary>
-        /// Recursive helper function for public InventoryFolder getFolder(String sFolderPath)
-        /// </summary>
-        /// <param name="qFolderPath">Queue</param>
-        /// <returns></returns>
-        private InventoryFolder getFolder(Queue<string> qFolderPath)
-        {
-            return getFolder(qFolderPath, GetRootFolder());
-        }
-
-        /// <summary>
-        /// Recursive helper function for public InventoryFolder getFolder(String sFolderPath)
-        /// </summary>
-        /// <param name="qFolderPath"></param>
-        /// <param name="ifRoot"></param>
-        /// <returns></returns>
-        private InventoryFolder getFolder(Queue<string> qFolderPath, InventoryFolder ifRoot)
-        {
-            string sCurFolder = qFolderPath.Dequeue();
-
-            foreach (InventoryBase ibFolder in ifRoot._Contents)
-            {
-                if (ibFolder is libsecondlife.InventorySystem.InventoryFolder)
-                {
-                    if (((InventoryFolder)ibFolder).Name.Equals(sCurFolder))
-                    {
-                        if (qFolderPath.Count == 0)
-                        {
-                            return (InventoryFolder)ibFolder;
-                        }
-                        else
-                        {
-                            return getFolder(qFolderPath, (InventoryFolder)ibFolder);
-                        }
-                    }
-                }
-            }
-
-            // Try updating the current level's child folders, then look again
-            if (ifRoot.RequestDownloadContents(false, true, false).RequestComplete.WaitOne(1000, false))
-            {
-                foreach (InventoryBase ibFolder in ifRoot._Contents)
-                {
-                    if (ibFolder is libsecondlife.InventorySystem.InventoryFolder)
-                    {
-                        if (((InventoryFolder)ibFolder).Name.Equals(sCurFolder))
-                        {
-                            // NOTE: We only found it because we did a folder download,
-                            // perhaps we should initiate a recursive download at this point
-
-                            if (qFolderPath.Count == 0)
-                            {
-                                return (InventoryFolder)ibFolder;
-                            }
-                            else
-                            {
-                                return getFolder(qFolderPath, (InventoryFolder)ibFolder);
-                            }
-                        }
-                    }
-                }
-            }
-
-            return null;
-        }
-        #endregion
-
-        #region Inventory Creation Functions
-
-        /// <summary>
-        /// Request that a folder be created
-        /// </summary>
-        /// <param name="name"></param>
-        /// <param name="parentid"></param>
-        internal LLUUID FolderCreate(String name, LLUUID parentid)
-        {
-            LLUUID requestedFolderID = LLUUID.Random();
-            InventoryFolder ifolder = new InventoryFolder(this, name, requestedFolderID, parentid);
-            ifolder._Type = -1;
-
-            if (FoldersByUUID.ContainsKey(ifolder.ParentID))
-            {
-                if (((InventoryFolder)FoldersByUUID[ifolder.ParentID])._Contents.Contains(ifolder) == false)
-                {
-                    // Add new folder to the contents of the parent folder.
-                    ((InventoryFolder)FoldersByUUID[ifolder.ParentID])._Contents.Add(ifolder);
-                }
-            }
-            else
-            {
-                throw new Exception("Parent Folder " + ifolder.ParentID + " does not exist in this Inventory Manager.");
-            }
-
-            if (FoldersByUUID.ContainsKey(ifolder.FolderID) == false)
-            {
-                FoldersByUUID[ifolder.FolderID] = ifolder;
-            }
-
-            Packet packet = InvPacketHelper.CreateInventoryFolder(ifolder.Name, ifolder.ParentID, ifolder.Type, ifolder.FolderID);
-            slClient.Network.SendPacket(packet);
-
-            return requestedFolderID;
-        }
-        /// <summary>
-        /// Create a new notecard
-        /// </summary>
-        /// <param name="Name"></param>
-        /// <param name="Description"></param>
-        /// <param name="Body"></param>
-        /// <param name="FolderID"></param>
-        /// <returns></returns>
-        internal InventoryNotecard NewNotecard(string Name, string Description, string Body, LLUUID FolderID)
-        {
-            InventoryNotecard iNotecard = new InventoryNotecard(this, Name, Description, FolderID, slClient.Network.AgentID);
-
-            // Create this notecard on the server.
-            ItemCreate(iNotecard);
-
-            if ((Body != null) && (Body.Equals("") != true))
-            {
-                iNotecard.Body = Body;
-            }
-
-            return iNotecard;
-        }
-
-		internal InventoryLandmark NewLandmark(string Name, string Description, LLUUID FolderID)
-        {
-            InventoryLandmark iLandmark = new InventoryLandmark(this, Name, Description, FolderID, slClient.Network.AgentID);
-
-            // Create this notecard on the server.
-            ItemCreate(iLandmark);
-
-            return iLandmark;
-        }
-        /// <summary>
-        /// Create a new image
-        /// </summary>
-        /// <param name="Name"></param>
-        /// <param name="Description"></param>
-        /// <param name="j2cdata"></param>
-        /// <param name="FolderID"></param>
-        /// <returns></returns>
-        internal InventoryImage NewImage(string Name, string Description, byte[] j2cdata, LLUUID FolderID)
-        {
-            InventoryImage iImage = new InventoryImage(this, Name, Description, FolderID, slClient.Network.AgentID);
-
-            // Create this image on the server.
-            ItemCreate(iImage);
-
-            if ((j2cdata != null) && (j2cdata.Length != 0))
-            {
-                iImage.J2CData = j2cdata;
-            }
-
-            return iImage;
-        }
-        #endregion
-
-        #region Folder Management
-
-        /// <summary>
-        /// Flushes the local cache of this folder's contents
-        /// </summary>
-        /// <param name="iFolder"></param>
-        /// <param name="Folders">Clear Folders</param>
-        /// <param name="Items">Clear Items</param>
-        public void FolderClearContents(InventoryFolder iFolder, bool Folders, bool Items)
-        {
-            // Need to recursively do this...
-            while( iFolder._Contents.Count > 0 )
-            {
-                InventoryBase ib = iFolder._Contents[0];
-
-                if ((ib is InventoryFolder) && Folders)
-                {
-                    InventoryFolder ChildFolder = (InventoryFolder)ib;
-                    FolderClearContents(ChildFolder, Folders, Items);
-
-                    if (FoldersByUUID.ContainsKey(ChildFolder.FolderID))
-                    {
-                        FoldersByUUID.Remove(ChildFolder.FolderID);
-                    }
-                    iFolder._Contents.Remove(ib);
-                }
-                else if (Items)
-                {
-                    iFolder._Contents.Remove(ib);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Delete/Remove a folder
-        /// </summary>
-        /// <param name="ifolder"></param>
-        internal void FolderRemove(InventoryFolder ifolder)
-        {
-            // Need to recursively remove children
-            foreach (InventoryBase ib in ifolder.GetContents())
-            {
-                if (ib is InventoryFolder)
-                {
-                    InventoryFolder ifChild = (InventoryFolder)ib;
-                    FolderRemove(ifChild);
-                }
-            }
-
-            // Remove from parent
-            if (FoldersByUUID.ContainsKey(ifolder.ParentID))
-            {
-                InventoryFolder ifParent = FoldersByUUID[ifolder.ParentID];
-                if (ifParent._Contents.Contains(ifolder))
-                {
-                    ifParent._Contents.Remove(ifolder);
-                }
-            }
-
-            // Remove from lookup cache
-            if (FoldersByUUID.ContainsKey(ifolder.FolderID))
-            {
-                FoldersByUUID.Remove(ifolder.FolderID);
-            }
-
-            Packet packet = InvPacketHelper.RemoveInventoryFolder(ifolder.FolderID);
-            slClient.Network.SendPacket(packet);
-        }
-
-        /// <summary>
-        /// Delete/Remove a folder
-        /// </summary>
-        /// <param name="folderID"></param>
-        internal void FolderRemove(LLUUID folderID)
-        {
-            if (FoldersByUUID.ContainsKey(folderID))
-            {
-                FolderRemove(FoldersByUUID[folderID]);
-            }
-        }
-
-        /// <summary>
-        /// Move a folder
-        /// </summary>
-        /// <param name="iFolder"></param>
-        /// <param name="newParentID"></param>
-        internal void FolderMove(InventoryFolder iFolder, LLUUID newParentID)
-        {
-            //Remove this folder from the old parent
-            if (FoldersByUUID.ContainsKey(iFolder.ParentID))
-            {
-                InventoryFolder ParentFolder = FoldersByUUID[iFolder.ParentID];
-                if (ParentFolder._Contents.Contains(iFolder))
-                {
-                    ParentFolder._Contents.Remove(iFolder);
-                }
-            }
-
-            // Set Parent ID
-            iFolder._ParentID = newParentID;
-
-            // Add to Parent's contents
-            if (FoldersByUUID.ContainsKey(iFolder.ParentID))
-            {
-                InventoryFolder ParentFolder = FoldersByUUID[iFolder.ParentID];
-                if (!ParentFolder._Contents.Contains(iFolder))
-                {
-                    ParentFolder._Contents.Add(iFolder);
-                }
-            }
-
-
-            Packet packet = InvPacketHelper.MoveInventoryFolder(newParentID, iFolder.FolderID);
-            slClient.Network.SendPacket(packet);
-        }
-
-        /// <summary>
-        /// Rename a folder
-        /// </summary>
-        /// <param name="ifolder"></param>
-        internal void FolderRename(InventoryFolder ifolder)
-        {
-            Packet packet = InvPacketHelper.UpdateInventoryFolder(ifolder.Name, ifolder.ParentID, ifolder.Type, ifolder.FolderID);
-            slClient.Network.SendPacket(packet);
-        }
-        #endregion
-
-        #region Item Management
-
-        /// <summary>
-        /// Create a new inventory item
-        /// </summary>
-        /// <param name="iitem"></param>
-        internal void ItemCreate(InventoryItem iitem)
-        {
-            if( iiCreationInProgress != null )
-            {
-                throw new Exception("Can only create one item at a time, and an item creation is already in progress.");
-            }
-
-            try
-            {
-                ItemCreationCompleted = new ManualResetEvent(false);
-                iiCreationInProgress = iitem;
-
-
-                Packet packet = InvPacketHelper.CreateInventoryItem(iitem);
-                int i = 0;
-                do
-                {
-                    if (i++ > 10)
-                        throw new Exception("Could not create " + iitem.Name);
-                    slClient.Network.SendPacket(packet);
-
-#if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-#endif
-                } while (!ItemCreationCompleted.WaitOne(5000, false));
-            }
-            finally
-            {
-                iiCreationInProgress = null;
-            }
-        }
-
-        /// <summary>
-        /// Update an existing item
-        /// </summary>
-        /// <param name="iitem"></param>
-        internal void ItemUpdate(InventoryItem iitem)
-        {
-            Packet packet = InvPacketHelper.UpdateInventoryItem(iitem);
-            slClient.Network.SendPacket(packet);
-
-            #if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-            #endif
-        }
-
-        /// <summary>
-        /// Copy an item
-        /// </summary>
-        /// <param name="ItemID"></param>
-        /// <param name="TargetFolderID"></param>
-        internal void ItemCopy(LLUUID ItemID, LLUUID TargetFolderID)
-        {
-            Packet packet = InvPacketHelper.CopyInventoryItem(ItemID, TargetFolderID);
-            slClient.Network.SendPacket(packet);
-
-            #if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-            #endif
-        }
-
-
-        internal void MoveItem(LLUUID itemID, LLUUID targetFolderID)
-        {
-            Packet packet = InvPacketHelper.MoveInventoryItem(itemID, targetFolderID);
-            slClient.Network.SendPacket(packet);
-
-            #if DEBUG_PACKETS
-                slClient.Log(packet.ToString(), Helpers.LogLevel.Info);
-            #endif
-        }
-
-        /// <summary>
-        /// Give an item to someone
-        /// </summary>
-        /// <param name="iitem"></param>
-        /// <param name="ToAgentID"></param>
-        internal void ItemGiveTo(InventoryItem iitem, LLUUID ToAgentID)
-        {
-            LLUUID MessageID = LLUUID.Random();
-
-            Packet packet = InvPacketHelper.GiveItemViaImprovedInstantMessage(
-                MessageID
-                , ToAgentID
-                , slClient.Self.FirstName + " " + slClient.Self.LastName
-                , slClient.Self.Position
-                , iitem
-                );
-
-            slClient.Network.SendPacket(packet);
-
-            #if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-            #endif
-        }
-
-        /// <summary>
-        /// Remove/Delete an item
-        /// </summary>
-        /// <param name="iitem"></param>
-        internal void ItemRemove(InventoryItem iitem)
-        {
-            InventoryFolder ifolder = getFolder(iitem.FolderID);
-            ifolder._Contents.Remove(iitem);
-
-            Packet packet = InvPacketHelper.RemoveInventoryItem(iitem.ItemID);
-            slClient.Network.SendPacket(packet);
-
-            #if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-            #endif
-        }
-
-        #endregion
-
-        #region Misc
-
-        /// <summary>
-        /// Rez the given item into the given sim.
-        /// </summary>
-        /// <param name="item"></param>
-        /// <param name="TargetSim">You can specify null to use the current sim</param>
-        /// <param name="TargetPos">Position is in Region coordinates</param>
-        internal void ItemRezObject(InventoryItem item, Simulator TargetSim, LLVector3 TargetPos)
-        {
-            Packet packet = InvPacketHelper.RezObject(item, TargetPos);
-            if (TargetSim == null)
-            {
-                slClient.Network.SendPacket(packet);
-            }
-            else
-            {
-                slClient.Network.SendPacket(packet, TargetSim);
-            }
-        }
-
-        /// <summary>
-        /// Attempt to rez and attach an inventory item
-        /// </summary>
-        /// <param name="Item"></param>
-        /// <param name="AttachmentPt"></param>
-        internal void ItemRezAttach(InventoryItem Item, ObjectManager.AttachmentPoint AttachmentPt)
-        {
-            Packet p = InvPacketHelper.RezSingleAttachmentFromInv(Item, AttachmentPt);
-            slClient.Network.SendPacket(p);
-        }
-
-        /// <summary>
-        /// Attempt to detach and return an item to your inventory
-        /// </summary>
-        /// <param name="Item"></param>
-        internal void ItemDetach(InventoryItem Item)
-        {
-            Packet p = InvPacketHelper.DetachAttachmentIntoInv(Item.ItemID);
-            slClient.Network.SendPacket(p);
-        }
-        #endregion
-
-
-        #region Folder Downloading
-
-        protected void LogDescendantQueueEvent(string msg)
-        {
-            if (LogDescendantQueue)
-            {
-                StringBuilder sb = new StringBuilder();
-                sb.AppendLine("==============================");
-                sb.AppendLine(msg);
-
-                if (CurrentlyDownloadingRequest == null)
-                {
-                    sb.AppendLine("CurrentlyDownloadingRequest: NULL");
-                }
-                else
-                {
-                    sb.AppendLine("CurrentlyDownloadingRequest: " + CurrentlyDownloadingRequest.ToString());
-                }
-
-                sb.AppendLine("Current queue status:");
-
-                lock (FolderRequests)
-                {
-                    if (FolderRequests.Count == 0)
-                    {
-                        sb.AppendLine(" *** Download Queue Empty ***");
-                    }
-                    else
-                    {
-                        foreach (DownloadRequest_Folder dr in FolderRequests)
-                        {
-                            sb.AppendLine(" * " + dr.ToString());
-                        }
-                    }
-                }
-
-                slClient.Log(sb.ToString(), Helpers.LogLevel.Info);
-            }
-        }
-
-        /// <summary>
-        /// Append a request to the end of the queue.
-        /// </summary>
-        internal DownloadRequest_Folder FolderRequestAppend(LLUUID folderID, bool recurse, bool fetchFolders, bool fetchItems, string requestName)
-        {
-
-            DownloadRequest_Folder dr = new DownloadRequest_Folder(folderID, recurse, fetchFolders, fetchItems, requestName);
-
-            // Add new request to the tail of the queue
-            lock (FolderRequests)
-            {
-                if (FolderRequests.Contains(dr))
-                {
-                    foreach (DownloadRequest_Folder existing in FolderRequests)
-                    {
-                        if (dr.Equals(existing))
-                        {
-                            dr = existing;
-                            break;
-                        }
-                    }
-                    LogDescendantQueueEvent("Append(returned existing): " + dr.ToString());
-                }
-                else
-                {
-                    FolderRequests.Add(dr);
-                    LogDescendantQueueEvent("Append: " + dr.ToString());
-                }
-            }
-
-            FolderRequestBegin();
-            return dr;
-        }
-
-        protected DownloadRequest_Folder FolderRequestPrepend(LLUUID folderID, bool recurse, bool fetchFolders, bool fetchItems, string requestName)
-        {
-            DownloadRequest_Folder dr = new DownloadRequest_Folder(folderID, recurse, fetchFolders, fetchItems, requestName);
-
-            // Prepend the request at the head of the queue
-            lock (FolderRequests)
-            {
-                if (FolderRequests.Contains(dr))
-                {
-                    foreach (DownloadRequest_Folder existing in FolderRequests)
-                    {
-                        if (dr.Equals(existing))
-                        {
-                            dr = existing;
-                            break;
-                        }
-                    }
-
-                    LogDescendantQueueEvent("Append(returned existing): " + dr.ToString());
-                }
-                else
-                {
-                    FolderRequests.Insert(0, dr);
-                    LogDescendantQueueEvent("Prepend: " + dr.ToString());
-                }
-            }
-            return dr;
-        }
-
-        /// <summary>
-        /// If not currently downloading a request, dequeue the next request and start it.
-        /// </summary>
-        protected void FolderRequestBegin()
-        {
-            // Wait until it's safe to be modifying what is currently downloading.
-            CurrentlyDownloadingMutex.WaitOne();
-
-            // If we not already downloading stuff, then lets start
-            if (CurrentlyDownloadingAFolder == false)
-            {
-                // Start downloading the first thing at the head of the queue
-                lock (FolderRequests)
-                {
-                    while ((FolderRequests.Count > 0) && (FolderRequests[0].IsCompleted))
-                    {
-                        LogDescendantQueueEvent("Head request completed, notify recurse completed: " + FolderRequests[0]);
-                        FolderRequests.RemoveAt(0);
-                    }
-
-                    if (FolderRequests.Count > 0)
-                    {
-                        CurrentlyDownloadingRequest = FolderRequests[0];
-                        LogDescendantQueueEvent("Starting download of head of queue: " + FolderRequests[0].ToString());
-                    }
-                    else
-                    {
-                        // Nothing to do
-
-                        // Release so that we can let other things look at and modify what is currently downloading.
-                        CurrentlyDownloadingMutex.ReleaseMutex();
-
-                        return;
-                    }
-                }
-
-                // Mark that we're currently downloading
-                CurrentlyDownloadingAFolder = true;
-
-                // Download!
-                Packet packet = InvPacketHelper.FetchInventoryDescendents(
-                                CurrentlyDownloadingRequest.FolderID
-                                , CurrentlyDownloadingRequest.FetchFolders
-                                , CurrentlyDownloadingRequest.FetchItems);
-
-                slClient.Network.SendPacket(packet);
-            }
-
-            // Release so that we can let other things look at and modify what is currently downloading.
-            CurrentlyDownloadingMutex.ReleaseMutex();
-        }
-
-        /// <summary>
-        /// Issue a RequestDownload Finished event.  Happens after each download request completes.
-        /// </summary>
-        /// <param name="o"></param>
-        /// <param name="e"></param>
-        protected void FireRequestDownloadFinishedEvent(object o, EventArgs e)
-        {
-            if (OnRequestDownloadFinishedEvent != null)
-            {
-                OnRequestDownloadFinishedEvent(o, e);
-            }
-        }
-
-        #endregion
-
-        #region libsecondlife callback handlers
-
-        /// <summary>
-        /// Used to track when inventory is dropped onto/into agent
-        /// </summary>
-        /// <param name="fromAgentID"></param>
-        /// <param name="fromAgentName"></param>
-        /// <param name="toAgentID"></param>
-        /// <param name="parentEstateID"></param>
-        /// <param name="regionID"></param>
-        /// <param name="position"></param>
-        /// <param name="dialog"></param>
-        /// <param name="groupIM"></param>
-        /// <param name="imSessionID"></param>
-        /// <param name="timestamp"></param>
-        /// <param name="message"></param>
-        /// <param name="offline"></param>
-        /// <param name="binaryBucket"></param>
-        void Self_OnInstantMessage(LLUUID fromAgentID, string fromAgentName, LLUUID toAgentID, uint parentEstateID,
-            LLUUID regionID, LLVector3 position, MainAvatar.InstantMessageDialog dialog, bool groupIM,
-            LLUUID imSessionID, DateTime timestamp,  string message, MainAvatar.InstantMessageOnline offline,
-            byte[] binaryBucket)
-        {
-            if ((dialog == MainAvatar.InstantMessageDialog.InventoryOffered) && ((OnInventoryItemReceived != null) || (OnInventoryFolderReceived !=null)))
-            {
-                sbyte IncomingItemType = (sbyte)binaryBucket[0];
-                LLUUID IncomingUUID = new LLUUID(binaryBucket, 1);
-
-                // Update root folders
-                InventoryFolder root = GetRootFolder();
-                if (root.GetContents().Count == 0)
-                {
-                    root.RequestDownloadContents(false, true, false).RequestComplete.WaitOne(3000, false);
-                }
-
-                // Handle the case of the incoming inventory folder
-                if (IncomingItemType == (sbyte)InventoryManager.InventoryType.Folder)
-                {
-                    if (OnInventoryFolderReceived == null)
-                    {
-                        // Short-circuit early exit, we're not interested...
-                        return;
-                    }
-
-                    InventoryFolder iFolder = null;
-                    int numAttempts = 6;
-                    int timeBetweenAttempts = 500;
-                    while( numAttempts-- > 0 )
-                    {
-                        foreach( InventoryBase ib in root.GetContents() )
-                        {
-                            if (ib is InventoryFolder)
-                            {
-                                InventoryFolder tiFolder = (InventoryFolder)ib;
-                                if (tiFolder.FolderID == IncomingUUID)
-                                {
-                                    iFolder = tiFolder;
-                                    break;
-                                }
-                            }
-                        }
-                        if ( iFolder != null)
-                        {
-                            try { OnInventoryFolderReceived(fromAgentID, fromAgentName, parentEstateID, regionID, position, timestamp, iFolder); }
-                            catch (Exception e) { slClient.Log(e.ToString(), Helpers.LogLevel.Error); }
-                            return;
-                        } else {
-                            Thread.Sleep(timeBetweenAttempts);
-                            timeBetweenAttempts *= 2;
-                            root.RequestDownloadContents(false, true, false).RequestComplete.WaitOne(3000, false);
-                        }
-                    }
-
-                    slClient.Log("Incoming folder [" + IncomingUUID.ToStringHyphenated() + "] not found in inventory.", Helpers.LogLevel.Error);
-                    return;
-                }
-
-                if (OnInventoryItemReceived == null)
-                {
-                    // Short-circuit, early exit, we're not interested
-                    return;
-                }
-
-                // Make sure we have a folder lookup by type table ready.
-                lock (FolderByType)
-                {
-                    if (FolderByType.Count == 0)
-                    {
-                        foreach (InventoryBase ib in root.GetContents())
-                        {
-                            if (ib is InventoryFolder)
-                            {
-                                InventoryFolder iFolder = (InventoryFolder)ib;
-                                FolderByType[iFolder.Type] = iFolder;
-                            }
-                        }
-                    }
-                }
-
-                // Get a reference to the incoming/receiving folder
-                if (!FolderByType.ContainsKey(IncomingItemType))
-                {
-                    slClient.Log("Incoming item specifies type (" + IncomingItemType  + ") with no matching inventory folder found.", Helpers.LogLevel.Error);
-                }
-
-
-                InventoryFolder incomingFolder = FolderByType[IncomingItemType];
-                InventoryItem incomingItem = null;
-
-                // lock just incase another item comes into the same directory while processing this one.
-                lock (incomingFolder)
-                {
-                    // Refresh contents of receiving folder
-                    incomingFolder.RequestDownloadContents(false, false, true).RequestComplete.WaitOne(3000, false);
-
-                    int numAttempts = 2;
-                    while( numAttempts-- > 0 )
-                    {
-                        // Search folder for incoming item
-                        foreach (InventoryBase ib2 in incomingFolder.GetContents())
-                        {
-                            if (ib2 is InventoryItem)
-                            {
-                                InventoryItem tiItem = (InventoryItem)ib2;
-
-                                if (tiItem.ItemID == IncomingUUID)
-                                {
-                                    incomingItem = tiItem;
-                                    break;
-                                }
-                            }
-                        }
-                        // If found, send out notification
-                        if (incomingItem != null)
-                        {
-                            try { OnInventoryItemReceived(fromAgentID, fromAgentName, parentEstateID, regionID, position, timestamp, incomingItem); }
-                            catch (Exception e) { slClient.Log(e.ToString(), Helpers.LogLevel.Error); }
-                            return;
-                        }
-                        else
-                        {
-                            Thread.Sleep(500);
-                            incomingFolder.RequestDownloadContents(false, false, true).RequestComplete.WaitOne(3000, false);
-                        }
-                    }
-                }
-                slClient.Log("Incoming item/folder [" + IncomingUUID.ToStringHyphenated() + "] not found in inventory.", Helpers.LogLevel.Error);
-
-            }
-        }
-
-
-
-        /// <summary>
-        /// This is called in response to an item creation request
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        public void UpdateCreateInventoryItemHandler(Packet packet, Simulator simulator)
-        {
-            #if DEBUG_PACKETS
-                slClient.DebugLog(packet);
-            #endif
-
-            if (iiCreationInProgress != null)
-            {
-                UpdateCreateInventoryItemPacket reply = (UpdateCreateInventoryItemPacket)packet;
-
-                // Use internal variable references, so we don't fire off any update code by using the public accessors
-
-                iiCreationInProgress._ItemID = reply.InventoryData[0].ItemID;
-
-                iiCreationInProgress._GroupOwned = reply.InventoryData[0].GroupOwned;
-                iiCreationInProgress._SaleType = reply.InventoryData[0].SaleType;
-                iiCreationInProgress._CreationDate = reply.InventoryData[0].CreationDate;
-                iiCreationInProgress._BaseMask = reply.InventoryData[0].BaseMask;
-
-                iiCreationInProgress._Name = Helpers.FieldToUTF8String(reply.InventoryData[0].Name);
-                iiCreationInProgress._InvType = reply.InventoryData[0].InvType;
-                iiCreationInProgress._Type = reply.InventoryData[0].Type;
-                iiCreationInProgress._AssetID = reply.InventoryData[0].AssetID;
-                iiCreationInProgress._GroupID = reply.InventoryData[0].GroupID;
-                iiCreationInProgress._SalePrice = reply.InventoryData[0].SalePrice;
-                iiCreationInProgress._OwnerID = reply.InventoryData[0].OwnerID;
-                iiCreationInProgress._CreatorID = reply.InventoryData[0].CreatorID;
-                iiCreationInProgress._ItemID = reply.InventoryData[0].ItemID;
-                iiCreationInProgress._FolderID = reply.InventoryData[0].FolderID;
-                iiCreationInProgress._EveryoneMask = reply.InventoryData[0].EveryoneMask;
-                iiCreationInProgress._Description = Helpers.FieldToUTF8String(reply.InventoryData[0].Description);
-                iiCreationInProgress._NextOwnerMask = reply.InventoryData[0].NextOwnerMask;
-                iiCreationInProgress._GroupMask = reply.InventoryData[0].GroupMask;
-                iiCreationInProgress._OwnerMask = reply.InventoryData[0].OwnerMask;
-
-                // NOT USED YET: iiCreationInProgress._CallbackID = reply.InventoryData[0].CallbackID;
-
-                ItemCreationCompleted.Set();
-            }
-            else
-            {
-                slClient.DebugLog(packet.ToString());
-
-                // TODO:  Looks like this packet may be sent in response to a Buy.
-                //        Should probably use it to update local cached inventory, to show the bought item(s)
-                //
-                // throw new Exception("Received a packet for item creation, but no such response was expected.  This is probably a bad thing...");
-            }
-        }
-
-        /// <summary>
-        /// Returned in response to a FetchInventoryDescendents request.  Contains information about the
-        /// contents of a folder.
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        public void InventoryDescendentsHandler(Packet packet, Simulator simulator)
-        {
-            InventoryDescendentsPacket reply = (InventoryDescendentsPacket)packet;
-
-            // The UUID of this folder.
-            LLUUID uuidFolderID = reply.AgentData.FolderID;
-
-            // Wait until it's safe to be looking at what is currently downloading.
-            CurrentlyDownloadingMutex.WaitOne();
-
-            // Make sure this request matches the one we believe is the currently downloading request
-            if (((CurrentlyDownloadingRequest != null) && (CurrentlyDownloadingRequest.FolderID != uuidFolderID)) || (CurrentlyDownloadingRequest == null))
-            {
-                // Release so that we can let other things look at and modify what is currently downloading.
-                CurrentlyDownloadingMutex.ReleaseMutex();
-
-                // Log problem
-                LogDescendantQueueEvent("Unexpected descendent packet for folder: " + uuidFolderID.ToStringHyphenated());
-
-                // Just discard this packet...
-                return;
-            }
-
-            // Get the Inventory folder that we'll be updating
-            InventoryFolder InvFolderUpdating = (InventoryFolder)FoldersByUUID[uuidFolderID];
-
-
-            // Update Inventory Manager's last tick point, used for timeouts and such
-//            LastPacketRecievedAtTick = Environment.TickCount;
-
-            // Used to count the number of descendants received to see if we're finished or not.
-            int iDescendentsExpected = reply.AgentData.Descendents;
-            int iDescendentsReceivedThisBlock = 0;
-
-            #region Handle Child Items
-            foreach (InventoryDescendentsPacket.ItemDataBlock itemBlock in reply.ItemData)
-            {
-                // There is always an item block, even if there isn't any items
-                // the "filler" block will not have a name
-                if (itemBlock.Name.Length != 0)
-                {
-                    iDescendentsReceivedThisBlock++;
-
-                    if (itemBlock.ItemID == LLUUID.Zero)
-                    {
-                        // this shouldn't ever happen, unless you've uploaded an invalid item
-                        // to yourself while developping inventory code :-(
-                    }
-                    else
-                    {
-                        InventoryItem TempInvItem = new InventoryItem(this, itemBlock);
-
-                        if (InvFolderUpdating._Contents.Contains(TempInvItem) == false)
-                        {
-                            #region Create an instance of the appriopriate Inventory class
-                            if ((TempInvItem.InvType == 7) && (TempInvItem.Type == (sbyte)Asset.AssetType.Notecard))
-                            {
-                                InventoryItem temp = new InventoryNotecard(this, TempInvItem);
-                                TempInvItem = temp;
-                            }
-                            if ((TempInvItem.InvType == 3) && (TempInvItem.Type == (sbyte)Asset.AssetType.Landmark))
-                            {
-                                InventoryItem temp = new InventoryLandmark(this, TempInvItem);
-                                TempInvItem = temp;
-                            }
-
-                            if ((TempInvItem.InvType == 0) && (TempInvItem.Type == (sbyte)Asset.AssetType.Texture))
-                            {
-                                InventoryItem temp = new InventoryImage(this, TempInvItem);
-                                TempInvItem = temp;
-                            }
-
-                            if ((TempInvItem.InvType == 10) && (TempInvItem.Type == (sbyte)Asset.AssetType.LSLText))
-                            {
-                                InventoryItem temp = new InventoryScript(this, TempInvItem);
-                                TempInvItem = temp;
-                            }
-
-                            if ((TempInvItem.InvType == 18) &&
-                                (
-                                    (TempInvItem.Type == (sbyte)Asset.AssetType.Bodypart)
-                                    || (TempInvItem.Type == (sbyte)Asset.AssetType.Clothing)
-                                )
-                               )
-                            {
-                                InventoryItem temp = new InventoryWearable(this, TempInvItem);
-                                TempInvItem = temp;
-                            }
-                            #endregion
-
-                            InvFolderUpdating._Contents.Add(TempInvItem);
-                        }
-                    }
-                }
-            }
-            #endregion
-
-            #region Handle Child Folders
-            foreach (InventoryDescendentsPacket.FolderDataBlock folderBlock in reply.FolderData)
-            {
-                String IncomingName = System.Text.Encoding.UTF8.GetString(folderBlock.Name).Trim().Replace("\0", "");
-                LLUUID IncomingFolderID = folderBlock.FolderID;
-                LLUUID IncomingParentID = folderBlock.ParentID;
-                sbyte IncomingType = folderBlock.Type;
-
-                // There is always an folder block, even if there isn't any folders
-                // the "filler" block will not have a name
-                if (folderBlock.Name.Length != 0)
-                {
-                    iDescendentsReceivedThisBlock++;
-
-                    // See if the Incoming Folder already exists locally
-                    if (FoldersByUUID.ContainsKey(IncomingFolderID))
-                    {
-                        InventoryFolder existingFolder = FoldersByUUID[IncomingFolderID];
-                        existingFolder._Name = IncomingName;
-                        existingFolder._Type = IncomingType;
-
-                        // Check if parent of existing is the same as the incoming
-                        if (!existingFolder.ParentID.Equals(IncomingParentID))
-                        {
-                            // Remove existing from old parent
-                            if (FoldersByUUID.ContainsKey(existingFolder.ParentID))
-                            {
-                                InventoryFolder ExistingParent = FoldersByUUID[existingFolder.ParentID];
-                                if (ExistingParent._Contents.Contains(existingFolder))
-                                {
-                                    ExistingParent._Contents.Remove(existingFolder);
-                                }
-                            }
-
-                            // Set existings parent to new
-                            existingFolder._ParentID = IncomingParentID;
-
-                            // Connect existing folder to parent specified in new
-                            if (FoldersByUUID.ContainsKey(IncomingParentID))
-                            {
-                                InventoryFolder ExistingParent = FoldersByUUID[IncomingParentID];
-                                if (!ExistingParent._Contents.Contains(existingFolder))
-                                {
-                                    ExistingParent._Contents.Add(existingFolder);
-                                }
-                            }
-                        }
-                    }
-                    else
-                    {
-                        InventoryFolder TempInvFolder = new InventoryFolder(this, IncomingName, IncomingFolderID, IncomingParentID, IncomingType);
-
-                        // Add folder to Parent
-                        if (InvFolderUpdating._Contents.Contains(TempInvFolder) == false)
-                        {
-                            InvFolderUpdating._Contents.Add(TempInvFolder);
-                        }
-
-                        // Add folder to local cache lookup
-                        FoldersByUUID[TempInvFolder.FolderID] = TempInvFolder;
-
-                    }
-
-
-                    // Do we recurse?
-                    if (CurrentlyDownloadingRequest.Recurse)
-                    {
-                        // It's not the root, should be safe to "recurse"
-                        if (!IncomingFolderID.Equals(slClient.Self.InventoryRootFolderUUID))
-                        {
-                            FolderRequestPrepend(IncomingFolderID, CurrentlyDownloadingRequest.Recurse, CurrentlyDownloadingRequest.FetchFolders, CurrentlyDownloadingRequest.FetchItems, CurrentlyDownloadingRequest.Name + "/" + IncomingName);
-                        }
-                    }
-                }
-            }
-            #endregion
-
-            // Update total number of descendants expected , and update the total downloaded
-            CurrentlyDownloadingRequest.Expected = iDescendentsExpected;
-            CurrentlyDownloadingRequest.Received += iDescendentsReceivedThisBlock;
-            CurrentlyDownloadingRequest.LastReceivedAtTick = Environment.TickCount;
-
-            if ((iDescendentsExpected > 1) && (iDescendentsReceivedThisBlock == 0))
-            {
-                slClient.Log("Received an InventoryDescendant packet where it indicated that there should be at least 1 descendant, but none were present... [" + CurrentlyDownloadingRequest.Name + "]", Helpers.LogLevel.Warning);
-                CurrentlyDownloadingRequest.Expected = 0;
-            }
-
-            if (LogDescendantQueue)
-            {
-                slClient.Log("Received packet for: " + CurrentlyDownloadingRequest.ToString(), Helpers.LogLevel.Info);
-            }
-
-            // Check if we're finished
-            if (CurrentlyDownloadingRequest.Received >= CurrentlyDownloadingRequest.Expected)
-            {
-                LogDescendantQueueEvent("Done downloading request: " + CurrentlyDownloadingRequest);
-
-                // Singal anyone that was waiting for this request to finish
-                CurrentlyDownloadingRequest.RequestComplete.Set();
-
-                // Raise an event for anyone that cares to listen for downloaded folder events
-                if (OnRequestDownloadFinishedEvent != null)
-                {
-                    DownloadRequest_EventArgs e = new DownloadRequest_EventArgs();
-                    e.DownloadRequest = CurrentlyDownloadingRequest;
-                    FireRequestDownloadFinishedEvent(InvFolderUpdating, e);
-                }
-
-                // Set Inventory Manager state to reflect that we're done with the current download
-                CurrentlyDownloadingAFolder = false;
-                CurrentlyDownloadingRequest = null;
-            }
-
-            // Release so that we can let other things look at and modify what is currently downloading.
-            CurrentlyDownloadingMutex.ReleaseMutex();
-
-
-            // If there's any more download requests queued, grab one, and go
-            FolderRequestBegin();
-        }
-        #endregion
-    }
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryNotecard.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryNotecard.cs
deleted file mode 100644
index 36d3b19..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryNotecard.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-using System;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
-	/// <summary>
-	/// Summary description for InventoryNotecard.
-	/// </summary>
-	public class InventoryNotecard : InventoryItem
-	{
-		public string Body
-		{
-			get
-			{
-				if( _Asset != null )
-				{
-					return ((AssetNotecard)Asset).Body;
-				} else {
-                    if ((AssetID != null))
-					{
-                        AssetRequestDownload request = base.iManager.AssetManager.RequestInventoryAsset(this);
-                        if (request.Wait(libsecondlife.AssetSystem.AssetManager.DefaultTimeout) != AssetRequestDownload.RequestStatus.Success)
-                        {
-                            throw new Exception("Asset (" + AssetID.ToStringHyphenated() + ") unavailable (" + request.StatusMsg + ") for " + this.Name);
-                        }
-                        _Asset = new AssetNotecard(AssetID, request.GetAssetData());
-
-                        return ((AssetNotecard)Asset).Body;
-					}
-				}
-
-				return null;
-			}
-
-			set
-			{
-				base._Asset          = new AssetNotecard( LLUUID.Random(), value );
-				LLUUID TransactionID = base.iManager.AssetManager.UploadAsset( Asset );
-                base.SetAssetTransactionIDs(Asset.AssetID, TransactionID);
-			}
-		}
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="manager"></param>
-        /// <param name="name"></param>
-        /// <param name="description"></param>
-        /// <param name="folderID"></param>
-        /// <param name="uuidOwnerCreater"></param>
-        internal InventoryNotecard(InventoryManager manager, string name, string description, LLUUID folderID, LLUUID uuidOwnerCreater)
-			: base(manager, name, description, folderID, 7, 7, uuidOwnerCreater)
-		{
-
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="manager"></param>
-        /// <param name="ii"></param>
-        internal InventoryNotecard(InventoryManager manager, InventoryItem ii)
-			: base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
-		{
-            if ((ii.InvType != 7) || (ii.Type != (sbyte)Asset.AssetType.Notecard))
-			{
-				throw new Exception("The InventoryItem cannot be converted to a Notecard, wrong InvType/Type.");
-			}
-
-			this.iManager = manager;
-            this._ItemID = ii._ItemID;
-			this._Asset = ii._Asset;
-			this._AssetID = ii._AssetID;
-			this._BaseMask = ii._BaseMask;
-			this._CRC = ii._CRC;
-			this._CreationDate = ii._CreationDate;
-			this._EveryoneMask = ii._EveryoneMask;
-			this._Flags = ii._Flags;
-			this._GroupID = ii._GroupID;
-			this._GroupMask = ii._GroupMask;
-			this._GroupOwned = ii._GroupOwned;
-			this._InvType = ii._InvType;
-			this._NextOwnerMask = ii._NextOwnerMask;
-			this._OwnerID = ii._OwnerID;
-			this._OwnerMask = ii._OwnerMask;
-			this._SalePrice = ii._SalePrice;
-			this._SaleType = ii._SaleType;
-			this._Type = ii._Type;
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="assetData"></param>
-        override internal void SetAssetData(byte[] assetData)
-		{
-			if( _Asset == null )
-			{
-				if( AssetID != null )
-				{
-					_Asset = new AssetNotecard( AssetID, assetData );
-				}
-				else
-				{
-					_Asset   = new AssetNotecard( LLUUID.Random(), assetData );
-					_AssetID = _Asset.AssetID;
-				}
-			}
-			else
-			{
-				_Asset.SetAssetData(assetData);
-			}
-
-		}
-
-
-        public override string GetDisplayType()
-        {
-            return "Notecard";
-        }
-
-        /// <summary>
-        /// Output this item as XML
-        /// </summary>
-        /// <param name="outputAssets">Include an asset data as well, TRUE/FALSE</param>
-        override public string toXML(bool outputAssets)
-		{
-			string output = "<notecard ";
-
-			output += "name = '" + xmlSafe(Name) + "' ";
-			output += "uuid = '" + ItemID + "' ";
-			output += "invtype = '" + InvType + "' ";
-			output += "type = '" + Type + "' ";
-
-
-
-			output += "description = '" + xmlSafe(Description) + "' ";
-			output += "crc = '" + CRC + "' ";
-			output += "debug = '" + InventoryPacketHelper.InventoryUpdateCRC(this) + "' ";
-			output += "ownerid = '" + OwnerID + "' ";
-			output += "creatorid = '" + CreatorID + "' ";
-
-			output += "assetid = '" + AssetID + "' ";
-			output += "groupid = '" + GroupID + "' ";
-
-			output += "groupowned = '" + GroupOwned + "' ";
-			output += "creationdate = '" + CreationDate + "' ";
-			output += "flags = '" + Flags + "' ";
-
-			output += "saletype = '" + SaleType + "' ";
-			output += "saleprice = '" + SalePrice + "' ";
-			output += "basemask = '" + BaseMask + "' ";
-			output += "everyonemask = '" + EveryoneMask + "' ";
-			output += "nextownermask = '" + NextOwnerMask + "' ";
-			output += "groupmask = '" + GroupMask + "' ";
-			output += "ownermask = '" + OwnerMask + "' ";
-
-			output += ">";
-
-			if( outputAssets )
-			{
-				output += xmlSafe(Body);
-			}
-
-			output += "</notecard>";
-
-
-			return output;
-		}
-
-	}
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryPacketHelper.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryPacketHelper.cs
deleted file mode 100644
index 0610710..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryPacketHelper.cs
+++ /dev/null
@@ -1,500 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.InventorySystem
-{
-	/// <summary>
-	/// Summary description for Other.
-	/// </summary>
-    public class InventoryPacketHelper
-	{
-        private SecondLife Client;
-
-        private LLUUID AgentID
-        {
-            get { return Client.Network.AgentID; }
-        }
-
-        private LLUUID SessionID
-        {
-            get { return Client.Network.SessionID; }
-        }
-
-        public InventoryPacketHelper(SecondLife client)
-		{
-            Client = client;
-		}
-
-		public const int FETCH_INVENTORY_SORT_NAME = 0;
-		public const int FETCH_INVENTORY_SORT_TIME = 1;
-
-
-		public Packet FetchInventoryDescendents( LLUUID folderID )
-		{
-			return FetchInventoryDescendents( folderID, true, true );
-		}
-
-		public Packet FetchInventoryDescendents( LLUUID folderID, bool fetchFolders, bool fetchItems )
-		{
-            FetchInventoryDescendentsPacket p = new FetchInventoryDescendentsPacket();
-            p.InventoryData.OwnerID      = AgentID;
-            p.InventoryData.FolderID     = folderID;
-            p.InventoryData.SortOrder    = FETCH_INVENTORY_SORT_NAME;
-            p.InventoryData.FetchFolders = fetchFolders;
-            p.InventoryData.FetchItems   = fetchItems;
-
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            return p;
-		}
-
-        public Packet FetchInventory(LLUUID OwnerID, LLUUID ItemID)
-        {
-            FetchInventoryPacket p = new FetchInventoryPacket();
-            p.InventoryData = new FetchInventoryPacket.InventoryDataBlock[1];
-            p.InventoryData[0] = new FetchInventoryPacket.InventoryDataBlock();
-            p.InventoryData[0].OwnerID = OwnerID;
-            p.InventoryData[0].ItemID = ItemID;
-
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            return p;
-        }
-
-		public Packet CreateInventoryFolder(
-			string name
-			, LLUUID parentID
-			, sbyte  type
-			, LLUUID folderID
-			)
-		{
-            CreateInventoryFolderPacket p = new CreateInventoryFolderPacket();
-            p.AgentData.AgentID   = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            p.FolderData.Name     = Helpers.StringToField(name);
-            p.FolderData.ParentID = parentID;
-            p.FolderData.Type     = type;
-            p.FolderData.FolderID = folderID;
-
-            return p;
-        }
-
-
-
-		public Packet MoveInventoryFolder(
-			LLUUID parentID
-			, LLUUID folderID
-			)
-		{
-            MoveInventoryFolderPacket p = new MoveInventoryFolderPacket();
-            p.AgentData.AgentID   = AgentID;
-            p.AgentData.SessionID = SessionID;
-            p.AgentData.Stamp     = false;
-
-            p.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[1];
-            p.InventoryData[0] = new MoveInventoryFolderPacket.InventoryDataBlock();
-
-            p.InventoryData[0].ParentID = parentID;
-            p.InventoryData[0].FolderID = folderID;
-
-            return p;
-
-		}
-
-
-		public Packet RemoveInventoryFolder(
-			LLUUID folderID
-			)
-		{
-            RemoveInventoryFolderPacket p = new RemoveInventoryFolderPacket();
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            p.FolderData = new RemoveInventoryFolderPacket.FolderDataBlock[1];
-            p.FolderData[0] = new RemoveInventoryFolderPacket.FolderDataBlock();
-
-            p.FolderData[0].FolderID = folderID;
-
-            return p;
-
-		}
-
-
-		public Packet UpdateInventoryFolder(
-			string name
-			, LLUUID parentID
-			, sbyte  type
-			, LLUUID folderID
-			)
-		{
-            UpdateInventoryFolderPacket p = new UpdateInventoryFolderPacket();
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            p.FolderData = new UpdateInventoryFolderPacket.FolderDataBlock[1];
-            p.FolderData[0] = new UpdateInventoryFolderPacket.FolderDataBlock();
-
-
-            p.FolderData[0].Name     = Helpers.StringToField(name);
-            p.FolderData[0].ParentID = parentID;
-            p.FolderData[0].Type     = type;
-            p.FolderData[0].FolderID = folderID;
-
-            return p;
-
-		}
-
-        /// <summary>
-        /// Move an item to a new folder
-        /// </summary>
-        /// <param name="itemID"></param>
-        /// <param name="folderID"></param>
-        /// <returns></returns>
-        public Packet MoveInventoryItem(
-            LLUUID itemID
-            , LLUUID folderID
-            )
-        {
-            return MoveInventoryItem(itemID, folderID, null);
-        }
-
-        /// <summary>
-        /// Move item to new folder, optionally changing it's name in the process
-        /// </summary>
-        /// <param name="itemID"></param>
-        /// <param name="folderID"></param>
-        /// <param name="itemName">specify null to not change the name</param>
-        /// <returns></returns>
-        public Packet MoveInventoryItem(
-            LLUUID itemID
-            , LLUUID folderID
-            , string itemName
-            )
-        {
-            MoveInventoryItemPacket p = new MoveInventoryItemPacket();
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-            p.AgentData.Stamp = false; //the official client uses false.
-
-            p.InventoryData = new MoveInventoryItemPacket.InventoryDataBlock[1];
-            p.InventoryData[0] = new MoveInventoryItemPacket.InventoryDataBlock();
-
-            p.InventoryData[0].ItemID = itemID;
-            p.InventoryData[0].FolderID = folderID;
-
-            if (itemName == null)
-            {
-                p.InventoryData[0].NewName = new byte[0];
-            }
-            else
-            {
-                p.InventoryData[0].NewName = Helpers.StringToField(itemName);
-            }
-
-            return p;
-
-        }
-
-        public Packet CopyInventoryItem(
-            LLUUID itemID
-            , LLUUID folderID
-            )
-        {
-
-            return CopyInventoryItem( itemID, folderID, null );
-        }
-
-        public Packet CopyInventoryItem(
-            LLUUID itemID
-            , LLUUID folderID
-            , string newItemName
-            )
-        {
-            CopyInventoryItemPacket p = new CopyInventoryItemPacket();
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            p.InventoryData = new CopyInventoryItemPacket.InventoryDataBlock[1];
-            p.InventoryData[0] = new CopyInventoryItemPacket.InventoryDataBlock();
-
-            p.InventoryData[0].CallbackID = 0;
-            p.InventoryData[0].OldAgentID = AgentID; //TODO: Find out what this is supposed to be.  Added field 10/11/06, no docs in Message Template
-
-            p.InventoryData[0].OldItemID = itemID;
-            p.InventoryData[0].NewFolderID = folderID;
-
-            if (newItemName != null)
-            {
-                p.InventoryData[0].NewName = Helpers.StringToField(newItemName);
-            }
-
-            return p;
-        }
-
-        public Packet RemoveInventoryItem(
-			LLUUID itemID
-			)
-		{
-            RemoveInventoryItemPacket p = new RemoveInventoryItemPacket();
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            p.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1];
-            p.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock();
-
-            p.InventoryData[0].ItemID = itemID;
-
-            return p;
-
-        }
-
-		public Packet GiveItemViaImprovedInstantMessage(
-			LLUUID ID
-			, LLUUID ToAgentID
-			, String FromAgentName
-			, LLVector3 FromAgentLoc
-			, InventoryItem Item
-			)
-		{
-			byte[] BinaryBucket = new byte[17];
-			BinaryBucket[0] = (byte)Item.Type;
-            Buffer.BlockCopy(Item.ItemID.Data, 0, BinaryBucket, 1, 16);
-
-            ImprovedInstantMessagePacket p = new ImprovedInstantMessagePacket();
-            p.AgentData.AgentID   = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            p.MessageBlock.ID        = ID;
-            p.MessageBlock.ToAgentID = ToAgentID;
-            p.MessageBlock.Offline   = (byte)0;
-            p.MessageBlock.Timestamp = Helpers.GetUnixTime();
-            p.MessageBlock.Message   = Helpers.StringToField(Item.Name);
-            p.MessageBlock.Dialog    = (byte)4;
-            p.MessageBlock.BinaryBucket  = BinaryBucket;
-            p.MessageBlock.FromAgentName = Helpers.StringToField(FromAgentName);
-            p.MessageBlock.Position      = FromAgentLoc;
-
-            // TODO: Either overload this method to allow inclusion of region info or
-            // overload the ImprovedInstantMessage in the avatar class to allow item payloads
-            p.MessageBlock.RegionID = LLUUID.Zero;
-            p.MessageBlock.ParentEstateID = (uint)0;
-
-            return p;
-		}
-
-
-
-        public Packet CreateInventoryItem(InventoryItem iitem)
-        {
-            CreateInventoryItemPacket p = new CreateInventoryItemPacket();
-
-            p.InventoryBlock.CallbackID    = 0;
-            p.InventoryBlock.TransactionID = LLUUID.Zero;
-
-            p.InventoryBlock.WearableType  = 0; //TODO: Specify the current type here
-            p.InventoryBlock.Type    = iitem.Type;
-            p.InventoryBlock.InvType = iitem.InvType;
-
-            p.InventoryBlock.Name = Helpers.StringToField(iitem.Name);
-            p.InventoryBlock.FolderID = iitem.FolderID;
-            p.InventoryBlock.Description = Helpers.StringToField(iitem.Description);
-
-            p.InventoryBlock.NextOwnerMask = iitem.NextOwnerMask;
-
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            return p;
-
-        }
-
-        public Packet UpdateInventoryItem(InventoryItem iitem)
-        {
-            UpdateInventoryItemPacket p = new UpdateInventoryItemPacket();
-            p.InventoryData = new UpdateInventoryItemPacket.InventoryDataBlock[1];
-            p.InventoryData[0] = new UpdateInventoryItemPacket.InventoryDataBlock();
-
-            p.InventoryData[0].TransactionID = iitem.TransactionID;
-
-            p.InventoryData[0].GroupOwned   = iitem.GroupOwned;
-            p.InventoryData[0].CRC          = iitem.CRC;
-            p.InventoryData[0].CreationDate = iitem.CreationDate;
-			p.InventoryData[0].SaleType		= iitem.SaleType;
-			p.InventoryData[0].BaseMask		= iitem.BaseMask;
-            p.InventoryData[0].Name         = Helpers.StringToField(iitem.Name);
-			p.InventoryData[0].InvType		= iitem.InvType;
-			p.InventoryData[0].Type			= iitem.Type;
-			p.InventoryData[0].GroupID		= iitem.GroupID;
-			p.InventoryData[0].SalePrice	= iitem.SalePrice;
-			p.InventoryData[0].OwnerID		= iitem.OwnerID;
-			p.InventoryData[0].CreatorID	= iitem.CreatorID;
-			p.InventoryData[0].ItemID		= iitem.ItemID;
-			p.InventoryData[0].FolderID		= iitem.FolderID;
-            p.InventoryData[0].EveryoneMask = iitem.EveryoneMask;
-            p.InventoryData[0].Description  = Helpers.StringToField(iitem.Description);
-			p.InventoryData[0].Flags		= iitem.Flags;
-			p.InventoryData[0].NextOwnerMask= iitem.NextOwnerMask;
-			p.InventoryData[0].GroupMask	= iitem.GroupMask;
-			p.InventoryData[0].OwnerMask	= iitem.OwnerMask;
-
-
-			p.AgentData.AgentID   = AgentID;
-			p.AgentData.SessionID = SessionID;
-
-            return p;
-		}
-
-
-        public Packet RezObject(InventoryItem iitem, LLVector3 TargetPos)
-        {
-            if (iitem.Type != 6)
-            {
-                Client.Log("RezObject has only been tested with items of type 6", Helpers.LogLevel.Warning);
-            }
-
-            RezObjectPacket p = new RezObjectPacket();
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-            p.AgentData.GroupID = LLUUID.Zero;
-
-            p.InventoryData.TransactionID = LLUUID.Random();
-
-            p.InventoryData.GroupOwned   = iitem.GroupOwned;
-            p.InventoryData.CRC          = iitem.CRC;
-            p.InventoryData.CreationDate = iitem.CreationDate;
-			p.InventoryData.SaleType	 = iitem.SaleType;
-			p.InventoryData.BaseMask	 = iitem.BaseMask;
-            p.InventoryData.Name         = Helpers.StringToField(iitem.Name);
-			p.InventoryData.InvType		 = iitem.InvType;
-			p.InventoryData.Type			= iitem.Type;
-			p.InventoryData.GroupID		 = iitem.GroupID;
-			p.InventoryData.SalePrice	 = iitem.SalePrice;
-			p.InventoryData.OwnerID		 = iitem.OwnerID;
-			p.InventoryData.CreatorID	 = iitem.CreatorID;
-			p.InventoryData.ItemID		 = iitem.ItemID;
-			p.InventoryData.FolderID	 = iitem.FolderID;
-            p.InventoryData.EveryoneMask = iitem.EveryoneMask;
-            p.InventoryData.Description  = Helpers.StringToField(iitem.Description);
-			p.InventoryData.Flags		 = iitem.Flags;
-			p.InventoryData.NextOwnerMask= iitem.NextOwnerMask;
-			p.InventoryData.GroupMask	 = iitem.GroupMask;
-			p.InventoryData.OwnerMask	 = iitem.OwnerMask;
-
-	        p.RezData.FromTaskID = LLUUID.Zero;
-		    p.RezData.BypassRaycast = 1;
-		    p.RezData.RayStart = Client.Self.Position;
-            p.RezData.RayEnd = TargetPos;
-		    p.RezData.RayTargetID = LLUUID.Zero;
-		    p.RezData.RayEndIsIntersection = false;
-		    p.RezData.RezSelected = false;
-		    p.RezData.RemoveItem = false;
-		    p.RezData.ItemFlags = iitem.Flags;
-		    p.RezData.GroupMask = iitem.GroupMask;
-		    p.RezData.EveryoneMask = iitem.EveryoneMask;
-            p.RezData.NextOwnerMask = iitem.NextOwnerMask;
-
-            return p;
-        }
-
-        public Packet RezSingleAttachmentFromInv(InventoryItem item)
-        {
-            return RezSingleAttachmentFromInv(item, 0); // Use default point
-        }
-
-        public Packet RezSingleAttachmentFromInv(InventoryItem item, ObjectManager.AttachmentPoint AttachmentPt)
-        {
-            RezSingleAttachmentFromInvPacket p = new RezSingleAttachmentFromInvPacket();
-            p.AgentData.AgentID = AgentID;
-            p.AgentData.SessionID = SessionID;
-
-            p.ObjectData.Description = Helpers.StringToField(item.Description);
-            p.ObjectData.EveryoneMask = item.EveryoneMask;
-            p.ObjectData.GroupMask = item.GroupMask;
-            p.ObjectData.ItemFlags = item.Flags;
-            p.ObjectData.ItemID = item.ItemID;
-            p.ObjectData.Name = Helpers.StringToField(item.Name);
-            p.ObjectData.NextOwnerMask = item.NextOwnerMask;
-            p.ObjectData.OwnerID = item.OwnerID;
-
-            p.ObjectData.AttachmentPt = (byte)AttachmentPt; // Default;
-
-
-            return p;
-        }
-
-        public Packet DetachAttachmentIntoInv( LLUUID ItemID )
-        {
-            DetachAttachmentIntoInvPacket p = new DetachAttachmentIntoInvPacket();
-            p.ObjectData.AgentID = AgentID;
-            p.ObjectData.ItemID = ItemID;
-
-            return p;
-        }
-
-/*
-			// Confirm InventoryUpdate CRC
-			uint test = libsecondlife.Packets.InventoryPackets.InventoryUpdateCRC
-				        (
-							(int)1159214416
-							, (byte)0
-							, (sbyte)7
-							, (sbyte)7
-							, (LLUUID)"00000000000000000000000000000000"
-							, (LLUUID)"00000000000000000000000000000000"
-							, (int)10
-							, (LLUUID)"25472683cb324516904a6cd0ecabf128"
-							, (LLUUID)"25472683cb324516904a6cd0ecabf128"
-							, (LLUUID)"77364021f09f13dfb692f036be53b9e2"
-							, (LLUUID)"a4947fc066c247518d9854aaf90097f4"
-							, (uint)0
-							, (uint)0
-							, (uint)2147483647
-							, (uint)0
-							, (uint)2147483647
-				        );
-
-			if( test != (uint)895206313 )
-			{
-				Console.WriteLine("CRC Generation is no longer correct.");
-				return;
-			}
-*/
-
-		public static uint InventoryUpdateCRC(InventoryItem iitem)
-		{
-			uint CRC = 0;
-
-			/* IDs */
-            CRC += iitem.AssetID.CRC(); // AssetID
-            CRC += iitem.FolderID.CRC(); // FolderID
-            CRC += iitem.ItemID == null ? LLUUID.Zero.CRC() : iitem.ItemID.CRC(); // ItemID
-
-			/* Permission stuff */
-            CRC += iitem.CreatorID.CRC(); // CreatorID
-            CRC += iitem.OwnerID.CRC(); // OwnerID
-            CRC += iitem.GroupID.CRC(); // GroupID
-
-			/* CRC += another 4 words which always seem to be zero -- unclear if this is a LLUUID or what */
-            CRC += iitem.OwnerMask; //owner_mask;      // Either owner_mask or next_owner_mask may need to be
-            CRC += iitem.NextOwnerMask; //next_owner_mask; // switched with base_mask -- 2 values go here and in my
-            CRC += iitem.EveryoneMask; //everyone_mask;   // study item, the three were identical.
-            CRC += iitem.GroupMask; //group_mask;
-
-			/* The rest of the CRC fields */
-            CRC += iitem.Flags; // Flags
-            CRC += (uint)iitem.InvType; // InvType
-            CRC += (uint)iitem.Type; // Type
-            CRC += (uint)iitem.CreationDate; // CreationDate
-            CRC += (uint)iitem.SalePrice;    // SalePrice
-            CRC += (uint)((uint)iitem.SaleType * 0x07073096); // SaleType
-
-			return CRC;
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryScript.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryScript.cs
deleted file mode 100644
index 702ad73..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryScript.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
-    public class InventoryScript : InventoryItem
-    {
-        public string Source
-        {
-            get
-            {
-                if (_Asset != null)
-                {
-                    return ((AssetScript)Asset).Source;
-                }
-                else
-                {
-                    if ( (AssetID != null) )
-                    {
-                        AssetRequestDownload request = base.iManager.AssetManager.RequestInventoryAsset(this);
-                        if (request.Wait(libsecondlife.AssetSystem.AssetManager.DefaultTimeout) != AssetRequestDownload.RequestStatus.Success)
-                        {
-                            throw new Exception("Asset (" + AssetID.ToStringHyphenated() + ") unavailable (" + request.StatusMsg + ") for " + this.Name);
-                        }
-                        _Asset = new AssetScript(AssetID, request.GetAssetData());
-                        return ((AssetScript)Asset).Source;
-                    }
-                }
-                return null;
-            }
-            set
-            {
-                base._Asset = new AssetScript(LLUUID.Random(), value);
-                LLUUID TransactionID = base.iManager.AssetManager.UploadAsset(Asset);
-                base.SetAssetTransactionIDs(Asset.AssetID, TransactionID);
-            }
-        }
-
-        public InventoryScript(InventoryManager manager, string name, string description, LLUUID folderID, LLUUID uuidOwnerCreater)
-            : base(manager, name, description, folderID, 10, 10, uuidOwnerCreater)
-        {
-        }
-
-        public InventoryScript(InventoryManager manager, InventoryItem ii)
-            : base(manager, ii.Name, ii.Description, ii.FolderID, ii.InvType, ii.Type, ii.CreatorID)
-        {
-            if (ii.InvType != 10 || ii.Type != (sbyte)Asset.AssetType.LSLText)
-                throw new Exception("The InventoryItem cannot be converted to a Script, wrong InvType/Type.");
-            this.iManager = manager;
-            this._ItemID = ii._ItemID;
-            this._Asset = ii._Asset;
-            this._AssetID = ii._AssetID;
-            this._BaseMask = ii._BaseMask;
-            this._CRC = ii._CRC;
-            this._CreationDate = ii._CreationDate;
-            this._EveryoneMask = ii._EveryoneMask;
-            this._Flags = ii._Flags;
-            this._GroupID = ii._GroupID;
-            this._GroupMask = ii._GroupMask;
-            this._GroupOwned = ii._GroupOwned;
-            this._InvType = ii._InvType;
-            this._NextOwnerMask = ii._NextOwnerMask;
-            this._OwnerID = ii._OwnerID;
-            this._OwnerMask = ii._OwnerMask;
-            this._SalePrice = ii._SalePrice;
-            this._SaleType = ii._SaleType;
-            this._Type = ii._Type;
-        }
-
-        internal override void SetAssetData(byte[] assetData)
-        {
-            if ( _Asset == null )
-            {
-                if ( AssetID == null )
-                {
-                    _Asset = new AssetScript(AssetID, assetData);
-                }
-                else
-                {
-                    _Asset = new AssetScript(LLUUID.Random(), assetData);
-                    _AssetID = _Asset.AssetID;
-                }
-            }
-            else
-            {
-                _Asset.SetAssetData(assetData);
-            }
-        }
-
-        public override string GetDisplayType()
-        {
-            return "Script";
-        }
-
-        override public string toXML(bool outputAssets)
-        {
-            string output = "<script ";
-
-            output += "name = '" + xmlSafe(Name) + "' ";
-            output += "uuid = '" + ItemID + "' ";
-            output += "invtype = '" + InvType + "' ";
-            output += "type = '" + Type + "' ";
-
-
-
-            output += "description = '" + xmlSafe(Description) + "' ";
-            output += "crc = '" + CRC + "' ";
-            output += "debug = '" + InventoryPacketHelper.InventoryUpdateCRC(this) + "' ";
-            output += "ownerid = '" + OwnerID + "' ";
-            output += "creatorid = '" + CreatorID + "' ";
-
-            output += "assetid = '" + AssetID + "' ";
-            output += "groupid = '" + GroupID + "' ";
-
-            output += "groupowned = '" + GroupOwned + "' ";
-            output += "creationdate = '" + CreationDate + "' ";
-            output += "flags = '" + Flags + "' ";
-
-            output += "saletype = '" + SaleType + "' ";
-            output += "saleprice = '" + SalePrice + "' ";
-            output += "basemask = '" + BaseMask + "' ";
-            output += "everyonemask = '" + EveryoneMask + "' ";
-            output += "nextownermask = '" + NextOwnerMask + "' ";
-            output += "groupmask = '" + GroupMask + "' ";
-            output += "ownermask = '" + OwnerMask + "' ";
-
-            output += ">";
-
-            if ( outputAssets )
-            {
-                output += xmlSafe(Source);
-            }
-
-            output += "</script>";
-
-
-            return output;
-        }
-
-    }
-}
diff --git a/old/libsl1550/libsecondlife/InventorySystem/InventoryWearable.cs b/old/libsl1550/libsecondlife/InventorySystem/InventoryWearable.cs
deleted file mode 100644
index 5923eb2..0000000
--- a/old/libsl1550/libsecondlife/InventorySystem/InventoryWearable.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-using System;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
-	/// <summary>
-	/// Summary description for InventoryNotecard.
-	/// </summary>
-	public class InventoryWearable : InventoryItem
-	{
-        // Wearable Inventory/Asset constants
-        public enum WearableType : sbyte { Clothing = 5, Body = 13 };
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="manager"></param>
-        /// <param name="name"></param>
-        /// <param name="description"></param>
-        /// <param name="folderID"></param>
-        /// <param name="uuidOwnerCreater"></param>
-        internal InventoryWearable(InventoryManager manager, string name, string description, LLUUID folderID, LLUUID uuidOwnerCreater, WearableType wtype)
-			: base(manager, name, description, folderID, 18, (sbyte)wtype, uuidOwnerCreater)
-		{
-
-		}
-
-        /// <summary>
-        /// </summary>
-        /// <param name="manager"></param>
-        /// <param name="ii"></param>
-        internal InventoryWearable(InventoryManager manager, InventoryItem ii)
-			: base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
-		{
-			if( (ii.InvType != 18) )
-			{
-				throw new Exception("The InventoryItem cannot be converted to a Wearable, wrong InvType.");
-			}
-
-			this.iManager = manager;
-            this._ItemID = ii._ItemID;
-			this._Asset = ii._Asset;
-			this._AssetID = ii._AssetID;
-			this._BaseMask = ii._BaseMask;
-			this._CRC = ii._CRC;
-			this._CreationDate = ii._CreationDate;
-			this._EveryoneMask = ii._EveryoneMask;
-			this._Flags = ii._Flags;
-			this._GroupID = ii._GroupID;
-			this._GroupMask = ii._GroupMask;
-			this._GroupOwned = ii._GroupOwned;
-			this._InvType = ii._InvType;
-			this._NextOwnerMask = ii._NextOwnerMask;
-			this._OwnerID = ii._OwnerID;
-			this._OwnerMask = ii._OwnerMask;
-			this._SalePrice = ii._SalePrice;
-			this._SaleType = ii._SaleType;
-			this._Type = ii._Type;
-		}
-
-        override internal void SetAssetData(byte[] assetData)
-        {
-            // Must reference all variables by internal _private names, so as not to trigger accessor code
-            if (_Asset == null)
-            {
-                if (_AssetID != null)
-                {
-                    if (_Type == (sbyte)WearableType.Clothing)
-                    {
-                        _Asset = new AssetWearable_Clothing(_AssetID, assetData);
-                    }
-                    else
-                    {
-                        _Asset = new AssetWearable_Body(_AssetID, assetData);
-                    }
-                }
-                else
-                {
-                    if (_Type == (sbyte)WearableType.Clothing)
-                    {
-                        _Asset = new AssetWearable_Clothing(LLUUID.Random(), assetData);
-                    }
-                    else
-                    {
-                        _Asset = new AssetWearable_Body(LLUUID.Random(), assetData);
-                    }
-                    _AssetID = _Asset.AssetID;
-                }
-            }
-            else
-            {
-                _Asset.SetAssetData(assetData);
-            }
-        }
-
-        public override string GetDisplayType()
-        {
-            return "Wearable_" + ((_Type == (sbyte)WearableType.Clothing) ? "Clothing" : "Body");;
-        }
-
-
-        /// <summary>
-        /// Output this image as XML
-        /// </summary>
-        /// <param name="outputAssets">Include an asset data as well, TRUE/FALSE</param>
-        override public string toXML(bool outputAssets)
-        {
-            string output = "<wearable ";
-
-            output += "name = '" + xmlSafe(Name) + "' ";
-            output += "uuid = '" + ItemID + "' ";
-
-            if (Type == (sbyte)WearableType.Body)
-            {
-                output += "wearabletype = 'Body' ";
-            }
-            else if (Type == (sbyte)WearableType.Clothing)
-            {
-                output += "wearabletype = 'Clothing' ";
-            }
-            else
-            {
-                output += "wearabletype = 'Unknown' ";
-            }
-
-            output += "invtype = '" + InvType + "' ";
-            output += "type = '" + Type + "' ";
-
-
-
-            output += "description = '" + xmlSafe(Description) + "' ";
-            output += "crc = '" + CRC + "' ";
-
-            output += "ownerid = '" + OwnerID + "' ";
-            output += "creatorid = '" + CreatorID + "' ";
-
-            output += "assetid = '" + AssetID + "' ";
-            output += "groupid = '" + GroupID + "' ";
-
-            output += "groupowned = '" + GroupOwned + "' ";
-            output += "creationdate = '" + CreationDate + "' ";
-            output += "flags = '" + Flags + "' ";
-
-            output += "saletype = '" + SaleType + "' ";
-            output += "saleprice = '" + SalePrice + "' ";
-            output += "basemask = '" + BaseMask + "' ";
-            output += "everyonemask = '" + EveryoneMask + "' ";
-            output += "nextownermask = '" + NextOwnerMask + "' ";
-            output += "groupmask = '" + GroupMask + "' ";
-            output += "ownermask = '" + OwnerMask + "' ";
-
-            output += ">\n";
-
-            if (outputAssets)
-            {
-                output += xmlSafe(base.Asset.AssetDataToString());
-            }
-
-            output += "</image>";
-
-
-            return output;
-        }
-
-	}
-}
diff --git a/old/libsl1550/libsecondlife/LLObject.cs b/old/libsl1550/libsecondlife/LLObject.cs
deleted file mode 100644
index ba4ed9d..0000000
--- a/old/libsl1550/libsecondlife/LLObject.cs
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Base class for primitives and avatars
-    /// </summary>
-    public abstract partial class LLObject
-    {
-        // Used for packing and unpacking parameters
-        protected const float CUT_QUANTA = 0.00002f;
-        protected const float SCALE_QUANTA = 0.01f;
-        protected const float SHEAR_QUANTA = 0.01f;
-        protected const float TAPER_QUANTA = 0.01f;
-        protected const float REV_QUANTA = 0.015f;
-        protected const float HOLLOW_QUANTA = 0.00002f;
-
-        #region Enumerations
-
-        /// <summary>
-        /// Primary parameters for primitives such as Physics Enabled or Phantom
-        /// </summary>
-        [Flags]
-        public enum ObjectFlags : uint
-        {
-            /// <summary>None of the primary flags are enabled</summary>
-            None = 0,
-            /// <summary>Whether physics are enabled for this object</summary>
-            Physics = 0x00000001,
-            /// <summary></summary>
-            CreateSelected = 0x00000002,
-            /// <summary></summary>
-            ObjectModify = 0x00000004,
-            /// <summary></summary>
-            ObjectCopy = 0x00000008,
-            /// <summary></summary>
-            ObjectAnyOwner = 0x00000010,
-            /// <summary></summary>
-            ObjectYouOwner = 0x00000020,
-            /// <summary></summary>
-            Scripted = 0x00000040,
-            /// <summary>Whether this object contains an active touch script</summary>
-            Touch = 0x00000080,
-            /// <summary></summary>
-            ObjectMove = 0x00000100,
-            /// <summary>Whether this object can receive payments</summary>
-            Money = 0x00000200,
-            /// <summary>Whether this object is phantom (no collisions)</summary>
-            Phantom = 0x00000400,
-            /// <summary></summary>
-            InventoryEmpty = 0x00000800,
-            /// <summary></summary>
-            JointHinge = 0x00001000,
-            /// <summary></summary>
-            JointP2P = 0x00002000,
-            /// <summary></summary>
-            JointLP2P = 0x00004000,
-            /// <summary>Deprecated</summary>
-            JointWheel = 0x00008000,
-            /// <summary></summary>
-            AllowInventoryDrop = 0x00010000,
-            /// <summary></summary>
-            ObjectTransfer = 0x00020000,
-            /// <summary></summary>
-            ObjectGroupOwned = 0x00040000,
-            /// <summary>Deprecated</summary>
-            ObjectYouOfficer = 0x00080000,
-            /// <summary></summary>
-            CameraDecoupled = 0x00100000,
-            /// <summary></summary>
-            AnimSource = 0x00200000,
-            /// <summary></summary>
-            CameraSource = 0x00400000,
-            /// <summary></summary>
-            CastShadows = 0x00800000,
-            /// <summary></summary>
-            ObjectOwnerModify = 0x10000000,
-            /// <summary></summary>
-            TemporaryOnRez = 0x20000000,
-            /// <summary></summary>
-            Temporary = 0x40000000,
-            /// <summary></summary>
-            ZlibCompressed = 0x80000000
-        }
-
-        public enum ProfileCurve : byte
-        {
-            Circle = 0x00,
-            Square = 0x01,
-            IsoTriangle = 0x02,
-            EqualTriangle = 0x03,
-            RightTriangle = 0x04,
-            HalfCircle = 0x05
-        }
-
-        public enum HoleType : byte
-        {
-            Same = 0x00,
-            Circle = 0x10,
-            Square = 0x20,
-            Triangle = 0x30
-        }
-
-        public enum PathCurve : byte
-        {
-            Line = 0x10,
-            Circle = 0x20,
-            Circle2 = 0x30,
-            Test = 0x40,
-            Flexible = 0x80
-        }
-
-        /// <summary>
-        /// Material type for a primitive
-        /// </summary>
-        public enum MaterialType : byte
-        {
-            /// <summary></summary>
-            Stone = 0,
-            /// <summary></summary>
-            Metal,
-            /// <summary></summary>
-            Glass,
-            /// <summary></summary>
-            Wood,
-            /// <summary></summary>
-            Flesh,
-            /// <summary></summary>
-            Plastic,
-            /// <summary></summary>
-            Rubber,
-            /// <summary></summary>
-            Light
-        }
-
-        #endregion Enumerations
-
-        #region Structs
-
-        /// <summary>
-        ///
-        /// </summary>
-        public struct ObjectData
-        {
-            private const byte PROFILE_MASK = 0x0F;
-            private const byte HOLE_MASK = 0xF0;
-
-            /// <summary></summary>
-            internal byte profileCurve;
-
-            /// <summary></summary>
-            public PathCurve PathCurve;
-            /// <summary></summary>
-            public float PathEnd;
-            /// <summary></summary>
-            public float PathRadiusOffset;
-            /// <summary></summary>
-            public float PathSkew;
-            /// <summary></summary>
-            public float PathScaleX;
-            /// <summary></summary>
-            public float PathScaleY;
-            /// <summary></summary>
-            public float PathShearX;
-            /// <summary></summary>
-            public float PathShearY;
-            /// <summary></summary>
-            public float PathTaperX;
-            /// <summary></summary>
-            public float PathTaperY;
-            /// <summary></summary>
-            public float PathBegin;
-            /// <summary></summary>
-            public float PathTwist;
-            /// <summary></summary>
-            public float PathTwistBegin;
-            /// <summary></summary>
-            public float PathRevolutions;
-            /// <summary></summary>
-            public float ProfileBegin;
-            /// <summary></summary>
-            public float ProfileEnd;
-            /// <summary></summary>
-            public float ProfileHollow;
-
-            /// <summary></summary>
-            public MaterialType Material;
-            /// <summary></summary>
-            public byte State;
-            /// <summary></summary>
-            public PCode PCode;
-
-            /// <summary></summary>
-            public ProfileCurve ProfileCurve
-            {
-                get { return (ProfileCurve)(profileCurve & PROFILE_MASK); }
-                set
-                {
-                    profileCurve &= HOLE_MASK;
-                    profileCurve |= (byte)value;
-                }
-            }
-
-            /// <summary></summary>
-            public HoleType ProfileHole
-            {
-                get { return (HoleType)(profileCurve & HOLE_MASK); }
-                set
-                {
-                    profileCurve &= PROFILE_MASK;
-                    profileCurve |= (byte)value;
-                }
-            }
-
-            /// <summary></summary>
-            public LLVector2 PathBeginScale
-            {
-                get
-                {
-                    LLVector2 begin = new LLVector2(1f, 1f);
-                    if (PathScaleX > 1f)
-                        begin.X = 2f - PathScaleX;
-                    if (PathScaleY > 1f)
-                        begin.Y = 2f - PathScaleY;
-                    return begin;
-                }
-            }
-
-            /// <summary></summary>
-            public LLVector2 PathEndScale
-            {
-                get
-                {
-                    LLVector2 end = new LLVector2(1f, 1f);
-                    if (PathScaleX < 1f)
-                        end.X = PathScaleX;
-                    if (PathScaleY < 1f)
-                        end.Y = PathScaleY;
-                    return end;
-                }
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public struct ObjectProperties
-        {
-            /// <summary></summary>
-            public LLUUID ObjectID;
-            /// <summary></summary>
-            public LLUUID CreatorID;
-            /// <summary></summary>
-            public LLUUID OwnerID;
-            /// <summary></summary>
-            public LLUUID GroupID;
-            /// <summary></summary>
-            public ulong CreationDate;
-            /// <summary></summary>
-            public Permissions Permissions;
-            /// <summary></summary>
-            public int OwnershipCost;
-            /// <summary></summary>
-            public byte SaleType;
-            /// <summary></summary>
-            public int SalePrice;
-            /// <summary></summary>
-            public byte AggregatePerms;
-            /// <summary></summary>
-            public byte AggregatePermTextures;
-            /// <summary></summary>
-            public byte AggregatePermTexturesOwner;
-            /// <summary></summary>
-            public uint Category;
-            /// <summary></summary>
-            public short InventorySerial;
-            /// <summary></summary>
-            public LLUUID ItemID;
-            /// <summary></summary>
-            public LLUUID FolderID;
-            /// <summary></summary>
-            public LLUUID FromTaskID;
-            /// <summary></summary>
-            public LLUUID LastOwnerID;
-            /// <summary></summary>
-            public string Name;
-            /// <summary></summary>
-            public string Description;
-            /// <summary></summary>
-            public string TouchName;
-            /// <summary></summary>
-            public string SitName;
-            /// <summary></summary>
-            public LLUUID[] TextureIDs;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public struct ObjectPropertiesFamily
-        {
-            /// <summary>
-            ///
-            /// </summary>
-            public enum RequestFlagsType
-            {
-                /// <summary></summary>
-                None = 0,
-                /// <summary></summary>
-                BugReportRequest = 1,
-                /// <summary></summary>
-                ComplaintReportRequest = 2
-            }
-
-            /// <summary></summary>
-            public RequestFlagsType RequestFlags;
-            /// <summary></summary>
-            public LLUUID ObjectID;
-            /// <summary></summary>
-            public LLUUID OwnerID;
-            /// <summary></summary>
-            public LLUUID GroupID;
-            /// <summary></summary>
-            public Permissions Permissions;
-            /// <summary></summary>
-            public int OwnershipCost;
-            /// <summary></summary>
-            public byte SaleType;
-            /// <summary></summary>
-            public int SalePrice;
-            /// <summary></summary>
-            public uint Category;
-            /// <summary></summary>
-            public LLUUID LastOwnerID;
-            /// <summary></summary>
-            public string Name;
-            /// <summary></summary>
-            public string Description;
-
-            //public bool IsOwnedBy(SecondLife client)
-            //{
-            //    if (GroupID != LLUUID.Zero)
-            //    {
-            //        // Group owned, iterate through all of this clients groups
-            //        // and see if it is a member
-            //        //client.Groups.
-            //        // FIXME: Current groups should be stored in GroupManager and auto-requested (with a setting to turn off)
-            //    }
-            //    else
-            //    {
-            //        // Avatar owned
-            //    }
-            //}
-        }
-
-        #endregion Structs
-
-        #region Public Members
-
-        /// <summary></summary>
-        public LLUUID ID;
-        /// <summary></summary>
-        public LLUUID GroupID;
-        /// <summary></summary>
-        public uint LocalID;
-        /// <summary></summary>
-        public uint ParentID;
-        /// <summary></summary>
-        public ulong RegionHandle;
-        /// <summary></summary>
-        public ObjectFlags Flags;
-        /// <summary>Unknown</summary>
-        public byte[] GenericData;
-        /// <summary></summary>
-        public LLVector3 Position;
-        /// <summary></summary>
-        public LLVector3 Scale;
-        /// <summary></summary>
-        public LLQuaternion Rotation;
-        /// <summary></summary>
-        public LLVector3 Velocity;
-        /// <summary></summary>
-        public LLVector3 AngularVelocity;
-        /// <summary></summary>
-        public LLVector3 Acceleration;
-        /// <summary></summary>
-        public LLVector4 CollisionPlane;
-        /// <summary></summary>
-        public TextureEntry Textures;
-        /// <summary></summary>
-        public ObjectProperties Properties;
-        /// <summary></summary>
-        public ObjectPropertiesFamily PropertiesFamily;
-        /// <summary></summary>
-        public NameValue[] NameValues;
-        /// <summary></summary>
-        public ObjectData Data;
-
-        #endregion Public Members
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-        public override bool Equals(object obj)
-        {
-            LLObject llobj = obj as LLObject;
-            if (llobj == null)
-                return false;
-            return ID.Equals(llobj.ID);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override int GetHashCode()
-        {
-            return ID.GetHashCode();
-        }
-
-        #region Parameter Packing Methods
-
-        public static ushort PackBeginCut(float beginCut)
-        {
-            return (ushort)Math.Round(beginCut / CUT_QUANTA);
-        }
-
-        public static ushort PackEndCut(float endCut)
-        {
-            return (ushort)(50000 - (ushort)Math.Round(endCut / CUT_QUANTA));
-        }
-
-        public static byte PackPathScale(float pathScale)
-        {
-            return (byte)(200 - (byte)Math.Round(pathScale / SCALE_QUANTA));
-        }
-
-        public static byte PackPathShear(float pathShear)
-        {
-            return (byte)Math.Round(pathShear / SHEAR_QUANTA);
-        }
-
-        /// <summary>
-        /// Packs PathTwist, PathTwistBegin, PathRadiusOffset, and PathSkew
-        /// parameters in to signed eight bit values
-        /// </summary>
-        /// <param name="pathTwist">Floating point parameter to pack</param>
-        /// <returns>Signed eight bit value containing the packed parameter</returns>
-        public static sbyte PackPathTwist(float pathTwist)
-        {
-            return (sbyte)Math.Round(pathTwist / SCALE_QUANTA);
-        }
-
-        public static sbyte PackPathTaper(float pathTaper)
-        {
-            return (sbyte)Math.Round(pathTaper / TAPER_QUANTA);
-        }
-
-        public static byte PackPathRevolutions(float pathRevolutions)
-        {
-            return (byte)Math.Round((pathRevolutions - 1f) / REV_QUANTA);
-        }
-
-        public static ushort PackProfileHollow(float profileHollow)
-        {
-            return (ushort)Math.Round(profileHollow / HOLLOW_QUANTA);
-        }
-
-        #endregion Parameter Packing Methods
-
-        #region Parameter Unpacking Methods
-
-        public static float UnpackBeginCut(ushort beginCut)
-        {
-            return (float)beginCut * CUT_QUANTA;
-        }
-
-        public static float UnpackEndCut(ushort endCut)
-        {
-            return (float)(50000 - endCut) * CUT_QUANTA;
-        }
-
-        public static float UnpackPathScale(byte pathScale)
-        {
-            return (float)(200 - pathScale) * SCALE_QUANTA;
-        }
-
-        public static float UnpackPathShear(byte pathShear)
-        {
-            return (float)pathShear * SHEAR_QUANTA;
-        }
-
-        /// <summary>
-        /// Unpacks PathTwist, PathTwistBegin, PathRadiusOffset, and PathSkew
-        /// parameters from signed eight bit integers to floating point values
-        /// </summary>
-        /// <param name="pathTwist">Signed eight bit value to unpack</param>
-        /// <returns>Unpacked floating point value</returns>
-        public static float UnpackPathTwist(sbyte pathTwist)
-        {
-            return (float)pathTwist * SCALE_QUANTA;
-        }
-
-        public static float UnpackPathTaper(sbyte pathTaper)
-        {
-            return (float)pathTaper * TAPER_QUANTA;
-        }
-
-        public static float UnpackPathRevolutions(byte pathRevolutions)
-        {
-            return (float)pathRevolutions * REV_QUANTA + 1f;
-        }
-
-        public static float UnpackProfileHollow(ushort profileHollow)
-        {
-            return (float)profileHollow * HOLLOW_QUANTA;
-        }
-
-        #endregion Parameter Unpacking Methods
-    }
-}
diff --git a/old/libsl1550/libsecondlife/LLSD/BinaryLLSD.cs b/old/libsl1550/libsecondlife/LLSD/BinaryLLSD.cs
deleted file mode 100644
index 276665c..0000000
--- a/old/libsl1550/libsecondlife/LLSD/BinaryLLSD.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace libsecondlife.StructuredData
-{
-    public static partial class LLSDParser
-    {
-        public static object DeserializeBinary(byte[] binaryData)
-        {
-            throw new NotImplementedException();
-        }
-
-        public static byte[] SerializeBinary(object data)
-        {
-            throw new NotImplementedException();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/LLSD/LLSD.cs b/old/libsl1550/libsecondlife/LLSD/LLSD.cs
deleted file mode 100644
index 123a9e1..0000000
--- a/old/libsl1550/libsecondlife/LLSD/LLSD.cs
+++ /dev/null
@@ -1,518 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace libsecondlife.StructuredData
-{
-    public enum LLSDType
-    {
-        Unknown,
-        Boolean,
-        Integer,
-        Real,
-        String,
-        UUID,
-        Date,
-        URI,
-        Binary,
-        Map,
-        Array
-    }
-
-    public class LLSDException : Exception
-    {
-        public LLSDException(string message) : base(message) { }
-    }
-
-    public partial class LLSD
-    {
-        public virtual LLSDType Type { get { return LLSDType.Unknown; } }
-
-        public virtual bool AsBoolean() { return false; }
-        public virtual int AsInteger() { return 0; }
-        public virtual double AsReal() { return 0d; }
-        public virtual string AsString() { return String.Empty; }
-        public virtual LLUUID AsUUID() { return LLUUID.Zero; }
-        public virtual DateTime AsDate() { return Helpers.Epoch; }
-        public virtual Uri AsUri() { return new Uri(String.Empty); }
-        public virtual byte[] AsBinary() { return new byte[0]; }
-
-        public static LLSD FromBoolean(bool value) { return new LLSDBoolean(value); }
-        public static LLSD FromInteger(int value) { return new LLSDInteger(value); }
-        public static LLSD FromInteger(uint value) { return new LLSDInteger((int)value); }
-        public static LLSD FromInteger(short value) { return new LLSDInteger((int)value); }
-        public static LLSD FromInteger(ushort value) { return new LLSDInteger((int)value); }
-        public static LLSD FromInteger(sbyte value) { return new LLSDInteger((int)value); }
-        public static LLSD FromInteger(byte value) { return new LLSDInteger((int)value); }
-        public static LLSD FromReal(double value) { return new LLSDReal(value); }
-        public static LLSD FromReal(float value) { return new LLSDReal((double)value); }
-        public static LLSD FromString(string value) { return new LLSDString(value); }
-        public static LLSD FromUUID(LLUUID value) { return new LLSDUUID(value); }
-        public static LLSD FromDate(DateTime value) { return new LLSDDate(value); }
-        public static LLSD FromUri(Uri value) { return new LLSDURI(value); }
-        public static LLSD FromBinary(byte[] value) { return new LLSDBinary(value); }
-        public static LLSD FromBinary(long value) { return new LLSDBinary(value); }
-        public static LLSD FromBinary(ulong value) { return new LLSDBinary(value); }
-        public static LLSD FromObject(object value)
-        {
-            if (value == null) { return new LLSD(); }
-            else if (value is bool) { return new LLSDBoolean((bool)value); }
-            else if (value is int) { return new LLSDInteger((int)value); }
-            else if (value is uint) { return new LLSDInteger((int)(uint)value); }
-            else if (value is short) { return new LLSDInteger((int)(short)value); }
-            else if (value is ushort) { return new LLSDInteger((int)(ushort)value); }
-            else if (value is sbyte) { return new LLSDInteger((int)(sbyte)value); }
-            else if (value is byte) { return new LLSDInteger((int)(byte)value); }
-            else if (value is double) { return new LLSDReal((double)value); }
-            else if (value is float) { return new LLSDReal((double)(float)value); }
-            else if (value is string) { return new LLSDString((string)value); }
-            else if (value is LLUUID) { return new LLSDUUID((LLUUID)value); }
-            else if (value is DateTime) { return new LLSDDate((DateTime)value); }
-            else if (value is Uri) { return new LLSDURI((Uri)value); }
-            else if (value is byte[]) { return new LLSDBinary((byte[])value); }
-            else if (value is long) { return new LLSDBinary((long)value); }
-            else if (value is ulong) { return new LLSDBinary((ulong)value); }
-            else return new LLSD();
-        }
-    }
-
-    public class LLSDBoolean : LLSD
-    {
-        private bool value;
-
-        public override LLSDType Type { get { return LLSDType.Boolean; } }
-
-        public LLSDBoolean(bool value)
-        {
-            this.value = value;
-        }
-
-        public override bool AsBoolean() { return value; }
-        public override int AsInteger() { return value ? 1 : 0; }
-        public override double AsReal() { return value ? 1d : 0d; }
-        public override string AsString() { return value ? "1" : "0"; }
-
-        public override string ToString() { return AsString(); }
-    }
-
-    public class LLSDInteger : LLSD
-    {
-        private int value;
-
-        public override LLSDType Type { get { return LLSDType.Integer; } }
-
-        public LLSDInteger(int value)
-        {
-            this.value = value;
-        }
-
-        public override bool AsBoolean() { return value != 0; }
-        public override int AsInteger() { return value; }
-        public override double AsReal() { return (double)value; }
-        public override string AsString() { return value.ToString(); }
-
-        public override string ToString() { return AsString(); }
-    }
-
-    public class LLSDReal : LLSD
-    {
-        private double value;
-
-        public override LLSDType Type { get { return LLSDType.Real; } }
-
-        public LLSDReal(double value)
-        {
-            this.value = value;
-        }
-
-        public override bool AsBoolean() { return (!Double.IsNaN(value) && value != 0d); }
-        public override int AsInteger() { return !Double.IsNaN(value) ? (int)value : 0; }
-        public override double AsReal() { return value; }
-        public override string AsString() { return value.ToString(Helpers.EnUsCulture); }
-
-        public override string ToString() { return AsString(); }
-    }
-
-    public class LLSDString : LLSD
-    {
-        private string value;
-
-        public override LLSDType Type { get { return LLSDType.String; } }
-
-        public LLSDString(string value)
-        {
-            // Refuse to hold null pointers
-            if (value != null)
-                this.value = value;
-            else
-                this.value = String.Empty;
-        }
-
-        public override bool AsBoolean() { return !String.IsNullOrEmpty(value); }
-        public override int AsInteger()
-        {
-            double dbl;
-            if (Double.TryParse(value, out dbl))
-                return (int)dbl;
-            else
-                return 0;
-        }
-        public override double AsReal()
-        {
-            double dbl;
-            if (Double.TryParse(value, out dbl))
-                return dbl;
-            else
-                return 0d;
-        }
-        public override string AsString() { return value; }
-        public override LLUUID AsUUID()
-        {
-            LLUUID uuid;
-            if (LLUUID.TryParse(value, out uuid))
-                return uuid;
-            else
-                return LLUUID.Zero;
-        }
-        public override DateTime AsDate()
-        {
-            DateTime dt;
-            if (DateTime.TryParse(value, out dt))
-                return dt;
-            else
-                return Helpers.Epoch;
-        }
-        public override Uri AsUri() { return new Uri(value); }
-
-        public override string ToString() { return AsString(); }
-    }
-
-    public class LLSDUUID : LLSD
-    {
-        private LLUUID value;
-
-        public override LLSDType Type { get { return LLSDType.UUID; } }
-
-        public LLSDUUID(LLUUID value)
-        {
-            this.value = value;
-        }
-
-        public override string AsString() { return value.ToString(); }
-        public override LLUUID AsUUID() { return value; }
-
-        public override string ToString() { return AsString(); }
-    }
-
-    public class LLSDDate : LLSD
-    {
-        private DateTime value;
-
-        public override LLSDType Type { get { return LLSDType.Date; } }
-
-        public LLSDDate(DateTime value)
-        {
-            this.value = value;
-        }
-
-        public override string AsString() { return value.ToString(); }
-        public override DateTime AsDate() { return value; }
-
-        public override string ToString() { return AsString(); }
-    }
-
-    public class LLSDURI : LLSD
-    {
-        private Uri value;
-
-        public override LLSDType Type { get { return LLSDType.URI; } }
-
-        public LLSDURI(Uri value)
-        {
-            this.value = value;
-        }
-
-        public override string AsString() { return value.ToString(); }
-        public override Uri AsUri() { return value; }
-
-        public override string ToString() { return AsString(); }
-    }
-
-    public class LLSDBinary : LLSD
-    {
-        private byte[] value;
-
-        public override LLSDType Type { get { return LLSDType.Binary; } }
-
-        public LLSDBinary(byte[] value)
-        {
-            if (value != null)
-                this.value = value;
-            else
-                this.value = new byte[0];
-        }
-
-        public LLSDBinary(long value)
-        {
-            this.value = BitConverter.GetBytes(value);
-        }
-
-        public LLSDBinary(ulong value)
-        {
-            this.value = BitConverter.GetBytes(value);
-        }
-
-        public override string AsString() { return Convert.ToBase64String(value); }
-        public override byte[] AsBinary() { return value; }
-
-        public override string ToString()
-        {
-            // TODO: ToString() is only meant for friendly display, a hex string would
-            // be more friendly then a base64 string
-            return AsString();
-        }
-    }
-
-    public class LLSDMap : LLSD, IDictionary<string, LLSD>
-    {
-        private Dictionary<string, LLSD> value;
-
-        public override LLSDType Type { get { return LLSDType.Map; } }
-
-        public LLSDMap()
-        {
-            value = new Dictionary<string, LLSD>();
-        }
-
-        public LLSDMap(int capacity)
-        {
-            value = new Dictionary<string, LLSD>(capacity);
-        }
-
-        public LLSDMap(Dictionary<string, LLSD> value)
-        {
-            if (value != null)
-                this.value = value;
-            else
-                this.value = new Dictionary<string, LLSD>();
-        }
-
-        public override bool AsBoolean() { return value.Count > 0; }
-
-        public override string ToString()
-        {
-            System.Text.StringBuilder output = new System.Text.StringBuilder("{");
-
-            foreach (KeyValuePair<string, LLSD> kvp in value)
-            {
-                output.AppendFormat("(\"{0}\": \"{1}\")", kvp.Key, kvp.Value);
-            }
-            output.Append("}");
-
-            return output.ToString();
-        }
-
-        #region IDictionary Implementation
-
-        public int Count { get { return value.Count; } }
-        public bool IsReadOnly { get { return false; } }
-        public ICollection<string> Keys { get { return value.Keys; } }
-        public ICollection<LLSD> Values { get { return value.Values; } }
-        public LLSD this[string key]
-        {
-            get
-            {
-                LLSD llsd;
-                if (this.value.TryGetValue(key, out llsd))
-                    return llsd;
-                else
-                    return new LLSD();
-            }
-            set { this.value[key] = value; }
-        }
-
-        public bool ContainsKey(string key)
-        {
-            return value.ContainsKey(key);
-        }
-
-        public void Add(string key, LLSD llsd)
-        {
-            value.Add(key, llsd);
-        }
-
-        public void Add(KeyValuePair<string, LLSD> kvp)
-        {
-            value.Add(kvp.Key, kvp.Value);
-        }
-
-        public bool Remove(string key)
-        {
-            return value.Remove(key);
-        }
-
-        public bool TryGetValue(string key, out LLSD llsd)
-        {
-            return value.TryGetValue(key, out llsd);
-        }
-
-        public void Clear()
-        {
-            value.Clear();
-        }
-
-        public bool Contains(KeyValuePair<string, LLSD> kvp)
-        {
-            // This is a bizarre function... we don't really implement it
-            // properly, hopefully no one wants to use it
-            return value.ContainsKey(kvp.Key);
-        }
-
-        public void CopyTo(KeyValuePair<string, LLSD>[] array, int index)
-        {
-            throw new NotImplementedException();
-        }
-
-        public bool Remove(KeyValuePair<string, LLSD> kvp)
-        {
-            return this.value.Remove(kvp.Key);
-        }
-
-        public System.Collections.IDictionaryEnumerator GetEnumerator()
-        {
-            return value.GetEnumerator();
-        }
-
-        IEnumerator<KeyValuePair<string, LLSD>> IEnumerable<KeyValuePair<string, LLSD>>.GetEnumerator()
-        {
-            return null;
-        }
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return value.GetEnumerator();
-        }
-
-        #endregion IDictionary Implementation
-    }
-
-    public class LLSDArray : LLSD, IList<LLSD>
-    {
-        private List<LLSD> value;
-
-        public override LLSDType Type { get { return LLSDType.Array; } }
-
-        public LLSDArray()
-        {
-            value = new List<LLSD>();
-        }
-
-        public LLSDArray(int capacity)
-        {
-            value = new List<LLSD>(capacity);
-        }
-
-        public LLSDArray(List<LLSD> value)
-        {
-            if (value != null)
-                this.value = value;
-            else
-                this.value = new List<LLSD>();
-        }
-
-        public override bool AsBoolean() { return value.Count > 0; }
-
-        public override string ToString()
-        {
-            System.Text.StringBuilder output = new System.Text.StringBuilder("[");
-            for (int i = 0; i < value.Count; i++)
-            {
-                output.AppendFormat("\"{0}\"", value[i]);
-                if (i != value.Count - 1)
-                    output.Append(",");
-            }
-            output.Append("]");
-
-            return output.ToString();
-        }
-
-        #region IList Implementation
-
-        public int Count { get { return value.Count; } }
-        public bool IsReadOnly { get { return false; } }
-        public LLSD this[int index]
-        {
-            get { return value[index]; }
-            set { this.value[index] = value; }
-        }
-
-        public int IndexOf(LLSD llsd)
-        {
-            return value.IndexOf(llsd);
-        }
-
-        public void Insert(int index, LLSD llsd)
-        {
-            value.Insert(index, llsd);
-        }
-
-        public void RemoveAt(int index)
-        {
-            value.RemoveAt(index);
-        }
-
-        public void Add(LLSD llsd)
-        {
-            value.Add(llsd);
-        }
-
-        public void Add(string str)
-        {
-            // This is so common that we throw a little helper in here
-            value.Add(LLSD.FromString(str));
-        }
-
-        public void Clear()
-        {
-            value.Clear();
-        }
-
-        public bool Contains(LLSD llsd)
-        {
-            return value.Contains(llsd);
-        }
-
-        public bool Contains(string element)
-        {
-            for (int i = 0; i < value.Count; i++)
-            {
-                if (value[i].Type == LLSDType.String && value[i].AsString() == element)
-                    return true;
-            }
-
-            return false;
-        }
-
-        public void CopyTo(LLSD[] array, int index)
-        {
-            throw new NotImplementedException();
-        }
-
-        public bool Remove(LLSD llsd)
-        {
-            return value.Remove(llsd);
-        }
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return value.GetEnumerator();
-        }
-
-        IEnumerator<LLSD> IEnumerable<LLSD>.GetEnumerator()
-        {
-            return value.GetEnumerator();
-        }
-
-        #endregion IList Implementation
-    }
-}
diff --git a/old/libsl1550/libsecondlife/LLSD/NotationLLSD.cs b/old/libsl1550/libsecondlife/LLSD/NotationLLSD.cs
deleted file mode 100644
index 76b50a2..0000000
--- a/old/libsl1550/libsecondlife/LLSD/NotationLLSD.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace libsecondlife.StructuredData
-{
-    public static partial class LLSDParser
-    {
-        public static LLSD DeserializeNotation(string notationData)
-        {
-            int unused;
-            return ParseNotationElement(notationData, out unused);
-        }
-
-        private static LLSD ParseNotationElement(string notationData, out int endPos)
-        {
-            if (notationData.Length == 0)
-            {
-                endPos = 0;
-                return null;
-            }
-
-            // Identify what type of object this is
-            switch (notationData[0])
-            {
-                case '!':
-                    endPos = 1;
-                    return new LLSD();
-                case '1':
-                    endPos = 1;
-                    return LLSD.FromBoolean(true);
-                case '0':
-                    endPos = 1;
-                    return LLSD.FromBoolean(false);
-                case 'i':
-                {
-                    if (notationData.Length < 2)
-                    {
-                        endPos = notationData.Length;
-                        return LLSD.FromInteger(0);
-                    }
-
-                    int value;
-                    endPos = FindEnd(notationData, 1);
-
-                    if (Helpers.TryParse(notationData.Substring(1, endPos - 1), out value))
-                        return LLSD.FromInteger(value);
-                    else
-                        return LLSD.FromInteger(0);
-                }
-                case 'r':
-                {
-                    if (notationData.Length < 2)
-                    {
-                        endPos = notationData.Length;
-                        return LLSD.FromReal(0d);
-                    }
-
-                    double value;
-                    endPos = FindEnd(notationData, 1);
-
-                    if (Helpers.TryParse(notationData.Substring(1, endPos - 1), out value))
-                        return LLSD.FromReal(value);
-                    else
-                        return LLSD.FromReal(0d);
-                }
-                case 'u':
-                {
-                    if (notationData.Length < 17)
-                    {
-                        endPos = notationData.Length;
-                        return LLSD.FromUUID(LLUUID.Zero);
-                    }
-
-                    LLUUID value;
-                    endPos = FindEnd(notationData, 1);
-
-                    if (Helpers.TryParse(notationData.Substring(1, endPos - 1), out value))
-                        return LLSD.FromUUID(value);
-                    else
-                        return LLSD.FromUUID(LLUUID.Zero);
-                }
-                case 'b':
-                    throw new NotImplementedException("Notation binary type is unimplemented");
-                case 's':
-                case '"':
-                case '\'':
-                    if (notationData.Length < 2)
-                    {
-                        endPos = notationData.Length;
-                        return LLSD.FromString(String.Empty);
-                    }
-
-                    endPos = FindEnd(notationData, 1);
-                    return LLSD.FromString(notationData.Substring(1, endPos - 1).Trim(new char[] { '"', '\'' }));
-                case 'l':
-                    throw new NotImplementedException("Notation URI type is unimplemented");
-                case 'd':
-                    throw new NotImplementedException("Notation date type is unimplemented");
-                case '[':
-                {
-                    if (notationData.IndexOf(']') == -1)
-                        throw new LLSDException("Invalid notation array");
-
-                    int pos = 0;
-                    LLSDArray array = new LLSDArray();
-
-                    while (notationData[pos] != ']')
-                    {
-                        ++pos;
-
-                        // Advance past comma if need be
-                        if (notationData[pos] == ',') ++pos;
-
-                        // Allow a single whitespace character
-                        if (pos < notationData.Length && notationData[pos] == ' ') ++pos;
-
-                        int end;
-                        array.Add(ParseNotationElement(notationData.Substring(pos), out end));
-                        pos += end;
-                    }
-
-                    endPos = pos + 1;
-                    return array;
-                }
-                case '{':
-                {
-                    if (notationData.IndexOf('}') == -1)
-                        throw new LLSDException("Invalid notation map");
-
-                    int pos = 0;
-                    LLSDMap hashtable = new LLSDMap();
-
-                    while (notationData[pos] != '}')
-                    {
-                        ++pos;
-
-                        // Advance past comma if need be
-                        if (notationData[pos] == ',') ++pos;
-
-                        // Allow a single whitespace character
-                        if (pos < notationData.Length && notationData[pos] == ' ') ++pos;
-
-                        if (notationData[pos] != '\'')
-                            throw new LLSDException("Expected a map key");
-
-                        int endquote = notationData.IndexOf('\'', pos + 1);
-                        if (endquote == -1 || (endquote + 1) >= notationData.Length || notationData[endquote + 1] != ':')
-                            throw new LLSDException("Invalid map format");
-
-                        string key = notationData.Substring(pos, endquote - pos);
-                        key = key.Trim(new char[] { '"', '\'' }); //key.Replace("'", String.Empty);
-                        pos += (endquote - pos) + 2;
-
-                        int end;
-                        hashtable[key] = ParseNotationElement(notationData.Substring(pos), out end);
-                        pos += end;
-                    }
-
-                    endPos = pos + 1;
-                    return hashtable;
-                }
-                default:
-                    throw new LLSDException("Unknown notation value type");
-            }
-        }
-
-        private static int FindEnd(string llsd, int start)
-        {
-            int end = llsd.IndexOfAny(new char[] { ',', ']', '}' });
-            if (end == -1) end = llsd.Length - 1;
-            return end;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/LLSD/XmlLLSD.cs b/old/libsl1550/libsecondlife/LLSD/XmlLLSD.cs
deleted file mode 100644
index 1052b14..0000000
--- a/old/libsl1550/libsecondlife/LLSD/XmlLLSD.cs
+++ /dev/null
@@ -1,570 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Xml;
-using System.Xml.Schema;
-using System.Text;
-
-namespace libsecondlife.StructuredData
-{
-    public static partial class LLSDParser
-    {
-        private static XmlSchema XmlSchema;
-        private static XmlTextReader XmlTextReader;
-        private static string LastXmlErrors = String.Empty;
-        private static object XmlValidationLock = new object();
-
-        public static LLSD DeserializeXml(byte[] xmlData)
-        {
-            return DeserializeXml(new XmlTextReader(new MemoryStream(xmlData, false)));
-        }
-
-        public static LLSD DeserializeXml(string xmlData)
-        {
-            byte[] bytes = Helpers.StringToField(xmlData);
-            return DeserializeXml(new XmlTextReader(new MemoryStream(bytes, false)));
-        }
-
-        public static LLSD DeserializeXml(XmlTextReader xmlData)
-        {
-            xmlData.Read();
-            SkipWhitespace(xmlData);
-
-            xmlData.Read();
-            LLSD ret = ParseXmlElement(xmlData);
-
-            return ret;
-        }
-
-        public static byte[] SerializeXmlBytes(LLSD data)
-        {
-            return Encoding.UTF8.GetBytes(SerializeXmlString(data));
-        }
-
-        public static string SerializeXmlString(LLSD data)
-        {
-            StringWriter sw = new StringWriter();
-            XmlTextWriter writer = new XmlTextWriter(sw);
-            writer.Formatting = Formatting.None;
-
-            writer.WriteStartElement(String.Empty, "llsd", String.Empty);
-            SerializeXmlElement(writer, data);
-            writer.WriteEndElement();
-
-            writer.Close();
-
-            return sw.ToString();
-        }
-
-        public static void SerializeXmlElement(XmlTextWriter writer, LLSD data)
-        {
-            switch (data.Type)
-            {
-                case LLSDType.Unknown:
-                    writer.WriteStartElement(String.Empty, "undef", String.Empty);
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.Boolean:
-                    writer.WriteStartElement(String.Empty, "boolean", String.Empty);
-                    writer.WriteString(data.AsString());
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.Integer:
-                    writer.WriteStartElement(String.Empty, "integer", String.Empty);
-                    writer.WriteString(data.AsString());
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.Real:
-                    writer.WriteStartElement(String.Empty, "real", String.Empty);
-                    writer.WriteString(data.AsString());
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.String:
-                    writer.WriteStartElement(String.Empty, "string", String.Empty);
-                    writer.WriteString(data.AsString());
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.UUID:
-                    writer.WriteStartElement(String.Empty, "uuid", String.Empty);
-                    writer.WriteString(data.AsString());
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.Date:
-                    writer.WriteStartElement(String.Empty, "date", String.Empty);
-                    writer.WriteString(data.AsString());
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.URI:
-                    writer.WriteStartElement(String.Empty, "uri", String.Empty);
-                    writer.WriteString(data.AsString());
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.Binary:
-                    writer.WriteStartElement(String.Empty, "binary", String.Empty);
-                        writer.WriteStartAttribute(String.Empty, "encoding", String.Empty);
-                        writer.WriteString("base64");
-                        writer.WriteEndAttribute();
-                    writer.WriteString(data.AsString());
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.Map:
-                    LLSDMap map = (LLSDMap)data;
-                    writer.WriteStartElement(String.Empty, "map", String.Empty);
-                    foreach (KeyValuePair<string, LLSD> kvp in map)
-                    {
-                        writer.WriteStartElement(String.Empty, "key", String.Empty);
-                        writer.WriteString(kvp.Key);
-                        writer.WriteEndElement();
-
-                        SerializeXmlElement(writer, kvp.Value);
-                    }
-                    writer.WriteEndElement();
-                    break;
-                case LLSDType.Array:
-                    LLSDArray array = (LLSDArray)data;
-                    writer.WriteStartElement(String.Empty, "array", String.Empty);
-                    for (int i = 0; i < array.Count; i++)
-                    {
-                        SerializeXmlElement(writer, array[i]);
-                    }
-                    writer.WriteEndElement();
-                    break;
-            }
-        }
-
-        public static bool TryValidate(XmlTextReader xmlData, out string error)
-        {
-            lock (XmlValidationLock)
-            {
-                LastXmlErrors = String.Empty;
-                XmlTextReader = xmlData;
-
-                CreateSchema();
-
-                XmlReaderSettings readerSettings = new XmlReaderSettings();
-                readerSettings.ValidationType = ValidationType.Schema;
-                readerSettings.Schemas.Add(XmlSchema);
-                readerSettings.ValidationEventHandler += new ValidationEventHandler(SchemaValidationHandler);
-
-                XmlReader reader = XmlReader.Create(xmlData, readerSettings);
-
-                try
-                {
-                    while (reader.Read()) { }
-                }
-                catch (XmlException)
-                {
-                    error = LastXmlErrors;
-                    return false;
-                }
-
-                if (LastXmlErrors == String.Empty)
-                {
-                    error = null;
-                    return true;
-                }
-                else
-                {
-                    error = LastXmlErrors;
-                    return false;
-                }
-            }
-        }
-
-        private static LLSD ParseXmlElement(XmlTextReader reader)
-        {
-            SkipWhitespace(reader);
-
-            if (reader.NodeType != XmlNodeType.Element)
-                throw new LLSDException("Expected an element");
-
-            string type = reader.LocalName;
-            LLSD ret;
-
-            switch (type)
-            {
-                case "undef":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return new LLSD();
-                    }
-
-                    reader.Read();
-                    SkipWhitespace(reader);
-                    ret = new LLSD();
-                    break;
-                case "boolean":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return LLSD.FromBoolean(false);
-                    }
-
-                    if (reader.Read())
-                    {
-                        string s = reader.ReadString().Trim();
-
-                        if (!String.IsNullOrEmpty(s) && (s == "true" || s == "1"))
-                        {
-                            ret = LLSD.FromBoolean(true);
-                            break;
-                        }
-                    }
-
-                    ret = LLSD.FromBoolean(false);
-                    break;
-                case "integer":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return LLSD.FromInteger(0);
-                    }
-
-                    if (reader.Read())
-                    {
-                        int value = 0;
-                        Helpers.TryParse(reader.ReadString().Trim(), out value);
-                        ret = LLSD.FromInteger(value);
-                        break;
-                    }
-
-                    ret = LLSD.FromInteger(0);
-                    break;
-                case "real":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return LLSD.FromReal(0d);
-                    }
-
-                    if (reader.Read())
-                    {
-                        double value = 0d;
-                        string str = reader.ReadString().Trim().ToLower();
-
-                        if (str == "nan")
-                            value = Double.NaN;
-                        else
-                            Helpers.TryParse(str, out value);
-
-                        ret = LLSD.FromReal(value);
-                        break;
-                    }
-
-                    ret = LLSD.FromReal(0d);
-                    break;
-                case "uuid":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return LLSD.FromUUID(LLUUID.Zero);
-                    }
-
-                    if (reader.Read())
-                    {
-                        LLUUID value = LLUUID.Zero;
-                        LLUUID.TryParse(reader.ReadString().Trim(), out value);
-                        ret = LLSD.FromUUID(value);
-                        break;
-                    }
-
-                    ret = LLSD.FromUUID(LLUUID.Zero);
-                    break;
-                case "date":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return LLSD.FromDate(Helpers.Epoch);
-                    }
-
-                    if (reader.Read())
-                    {
-                        DateTime value = Helpers.Epoch;
-                        Helpers.TryParse(reader.ReadString().Trim(), out value);
-                        ret = LLSD.FromDate(value);
-                        break;
-                    }
-
-                    ret = LLSD.FromDate(Helpers.Epoch);
-                    break;
-                case "string":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return LLSD.FromString(String.Empty);
-                    }
-
-                    if (reader.Read())
-                    {
-                        ret = LLSD.FromString(reader.ReadString());
-                        break;
-                    }
-
-                    ret = LLSD.FromString(String.Empty);
-                    break;
-                case "binary":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return LLSD.FromBinary(new byte[0]);
-                    }
-
-                    if (reader.GetAttribute("encoding") != null && reader.GetAttribute("encoding") != "base64")
-                        throw new LLSDException("Unsupported binary encoding: " + reader.GetAttribute("encoding"));
-
-                    if (reader.Read())
-                    {
-                        try
-                        {
-                            ret = LLSD.FromBinary(Convert.FromBase64String(reader.ReadString().Trim()));
-                            break;
-                        }
-                        catch (FormatException ex)
-                        {
-                            throw new LLSDException("Binary decoding exception: " + ex.Message);
-                        }
-                    }
-
-                    ret = LLSD.FromBinary(new byte[0]);
-                    break;
-                case "uri":
-                    if (reader.IsEmptyElement)
-                    {
-                        reader.Read();
-                        return LLSD.FromUri(new Uri(String.Empty, UriKind.RelativeOrAbsolute));
-                    }
-
-                    if (reader.Read())
-                    {
-                        ret = LLSD.FromUri(new Uri(reader.ReadString(), UriKind.RelativeOrAbsolute));
-                        break;
-                    }
-
-                    ret = LLSD.FromUri(new Uri(String.Empty, UriKind.RelativeOrAbsolute));
-                    break;
-                case "map":
-                    return ParseXmlMap(reader);
-                case "array":
-                    return ParseXmlArray(reader);
-                default:
-                    reader.Read();
-                    ret = null;
-                    break;
-            }
-
-            if (reader.NodeType != XmlNodeType.EndElement || reader.LocalName != type)
-            {
-                throw new LLSDException("Expected </" + type + ">");
-            }
-            else
-            {
-                reader.Read();
-                return ret;
-            }
-        }
-
-        private static LLSDMap ParseXmlMap(XmlTextReader reader)
-        {
-            if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "map")
-                throw new NotImplementedException("Expected <map>");
-
-            LLSDMap map = new LLSDMap();
-
-            if (reader.IsEmptyElement)
-            {
-                reader.Read();
-                return map;
-            }
-
-            if (reader.Read())
-            {
-                while (true)
-                {
-                    SkipWhitespace(reader);
-
-                    if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "map")
-                    {
-                        reader.Read();
-                        break;
-                    }
-
-                    if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "key")
-                        throw new LLSDException("Expected <key>");
-
-                    string key = reader.ReadString();
-
-                    if (reader.NodeType != XmlNodeType.EndElement || reader.LocalName != "key")
-                        throw new LLSDException("Expected </key>");
-
-                    if (reader.Read())
-                        map[key] = ParseXmlElement(reader);
-                    else
-                        throw new LLSDException("Failed to parse a value for key " + key);
-                }
-            }
-
-            return map;
-        }
-
-        private static LLSDArray ParseXmlArray(XmlTextReader reader)
-        {
-            if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "array")
-                throw new LLSDException("Expected <array>");
-
-            LLSDArray array = new LLSDArray();
-
-            if (reader.IsEmptyElement)
-            {
-                reader.Read();
-                return array;
-            }
-
-            if (reader.Read())
-            {
-                while (true)
-                {
-                    SkipWhitespace(reader);
-
-                    if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "array")
-                    {
-                        reader.Read();
-                        break;
-                    }
-
-                    array.Add(ParseXmlElement(reader));
-                }
-            }
-
-            return array;
-        }
-
-        private static void SkipWhitespace(XmlTextReader reader)
-        {
-            while (
-                reader.NodeType == XmlNodeType.Comment ||
-                reader.NodeType == XmlNodeType.Whitespace ||
-                reader.NodeType == XmlNodeType.SignificantWhitespace ||
-                reader.NodeType == XmlNodeType.XmlDeclaration)
-            {
-                reader.Read();
-            }
-        }
-
-        private static void CreateSchema()
-        {
-            if (XmlSchema == null)
-            {
-                #region XSD
-                string schemaText = @"
-<?xml version=""1.0"" encoding=""utf-8""?>
-<xs:schema elementFormDefault=""qualified"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">
-  <xs:import schemaLocation=""xml.xsd"" namespace=""http://www.w3.org/XML/1998/namespace"" />
-  <xs:element name=""uri"" type=""xs:string"" />
-  <xs:element name=""uuid"" type=""xs:string"" />
-  <xs:element name=""KEYDATA"">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element ref=""key"" />
-        <xs:element ref=""DATA"" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name=""date"" type=""xs:string"" />
-  <xs:element name=""key"" type=""xs:string"" />
-  <xs:element name=""boolean"" type=""xs:string"" />
-  <xs:element name=""undef"">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element ref=""EMPTY"" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name=""map"">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element minOccurs=""0"" maxOccurs=""unbounded"" ref=""KEYDATA"" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name=""real"" type=""xs:string"" />
-  <xs:element name=""ATOMIC"">
-    <xs:complexType>
-      <xs:choice>
-        <xs:element ref=""undef"" />
-        <xs:element ref=""boolean"" />
-        <xs:element ref=""integer"" />
-        <xs:element ref=""real"" />
-        <xs:element ref=""uuid"" />
-        <xs:element ref=""string"" />
-        <xs:element ref=""date"" />
-        <xs:element ref=""uri"" />
-        <xs:element ref=""binary"" />
-      </xs:choice>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name=""DATA"">
-    <xs:complexType>
-      <xs:choice>
-        <xs:element ref=""ATOMIC"" />
-        <xs:element ref=""map"" />
-        <xs:element ref=""array"" />
-      </xs:choice>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name=""llsd"">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element ref=""DATA"" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name=""binary"">
-    <xs:complexType>
-      <xs:simpleContent>
-        <xs:extension base=""xs:string"">
-          <xs:attribute default=""base64"" name=""encoding"" type=""xs:string"" />
-        </xs:extension>
-      </xs:simpleContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name=""array"">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element minOccurs=""0"" maxOccurs=""unbounded"" ref=""DATA"" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name=""integer"" type=""xs:string"" />
-  <xs:element name=""string"">
-    <xs:complexType>
-      <xs:simpleContent>
-        <xs:extension base=""xs:string"">
-          <xs:attribute ref=""xml:space"" />
-        </xs:extension>
-      </xs:simpleContent>
-    </xs:complexType>
-  </xs:element>
-</xs:schema>
-";
-                #endregion XSD
-
-                MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(schemaText));
-
-                XmlSchema = new XmlSchema();
-                XmlSchema = XmlSchema.Read(stream, new ValidationEventHandler(SchemaValidationHandler));
-            }
-        }
-
-        private static void SchemaValidationHandler(object sender, ValidationEventArgs args)
-        {
-            string error = String.Format("Line: {0} - Position: {1} - {2}", XmlTextReader.LineNumber, XmlTextReader.LinePosition,
-                args.Message);
-
-            if (LastXmlErrors == String.Empty)
-                LastXmlErrors = error;
-            else
-                LastXmlErrors += Helpers.NewLine + error;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/LLSD/xml-llsd.dtd b/old/libsl1550/libsecondlife/LLSD/xml-llsd.dtd
deleted file mode 100644
index 7ec91ae..0000000
--- a/old/libsl1550/libsecondlife/LLSD/xml-llsd.dtd
+++ /dev/null
@@ -1,19 +0,0 @@
-<!ELEMENT llsd (DATA)>
-<!ELEMENT DATA (ATOMIC|map|array)>
-<!ELEMENT ATOMIC (undef|boolean|integer|real|uuid|string|date|uri|binary)>
-<!ELEMENT KEYDATA (key,DATA)>
-<!ELEMENT key (#PCDATA)>
-<!ELEMENT map (KEYDATA*)>
-<!ELEMENT array (DATA*)>
-<!ELEMENT undef (EMPTY)>
-<!ELEMENT boolean (#PCDATA)>
-<!ELEMENT integer (#PCDATA)>
-<!ELEMENT real (#PCDATA)>
-<!ELEMENT uuid (#PCDATA)>
-<!ELEMENT string (#PCDATA)>
-<!ELEMENT date (#PCDATA)>
-<!ELEMENT uri (#PCDATA)>
-<!ELEMENT binary (#PCDATA)>
-
-<!ATTLIST string xml:space (default|preserve) 'preserve'>
-<!ATTLIST binary encoding CDATA "base64">
diff --git a/old/libsl1550/libsecondlife/LLSD/xml-llsd.xsd b/old/libsl1550/libsecondlife/LLSD/xml-llsd.xsd
deleted file mode 100644
index d528331..0000000
--- a/old/libsl1550/libsecondlife/LLSD/xml-llsd.xsd
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-  <xs:import schemaLocation="xml.xsd" namespace="http://www.w3.org/XML/1998/namespace" />
-  <xs:element name="uri" type="xs:string" />
-  <xs:element name="uuid" type="xs:string" />
-  <xs:element name="KEYDATA">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element ref="key" />
-        <xs:element ref="DATA" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="date" type="xs:string" />
-  <xs:element name="key" type="xs:string" />
-  <xs:element name="boolean" type="xs:string" />
-  <xs:element name="undef">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element ref="EMPTY" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="map">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element minOccurs="0" maxOccurs="unbounded" ref="KEYDATA" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="real" type="xs:string" />
-  <xs:element name="ATOMIC">
-    <xs:complexType>
-      <xs:choice>
-        <xs:element ref="undef" />
-        <xs:element ref="boolean" />
-        <xs:element ref="integer" />
-        <xs:element ref="real" />
-        <xs:element ref="uuid" />
-        <xs:element ref="string" />
-        <xs:element ref="date" />
-        <xs:element ref="uri" />
-        <xs:element ref="binary" />
-      </xs:choice>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="DATA">
-    <xs:complexType>
-      <xs:choice>
-        <xs:element ref="ATOMIC" />
-        <xs:element ref="map" />
-        <xs:element ref="array" />
-      </xs:choice>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="llsd">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element ref="DATA" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="binary">
-    <xs:complexType>
-      <xs:simpleContent>
-        <xs:extension base="xs:string">
-          <xs:attribute default="base64" name="encoding" type="xs:string" />
-        </xs:extension>
-      </xs:simpleContent>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="array">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element minOccurs="0" maxOccurs="unbounded" ref="DATA" />
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="integer" type="xs:string" />
-  <xs:element name="string">
-    <xs:complexType>
-      <xs:simpleContent>
-        <xs:extension base="xs:string">
-          <xs:attribute ref="xml:space" />
-        </xs:extension>
-      </xs:simpleContent>
-    </xs:complexType>
-  </xs:element>
-</xs:schema>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/Login.cs b/old/libsl1550/libsecondlife/Login.cs
deleted file mode 100644
index f0850e4..0000000
--- a/old/libsl1550/libsecondlife/Login.cs
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.IO;
-using System.Net;
-using System.Security.Cryptography.X509Certificates;
-using libsecondlife.StructuredData;
-using libsecondlife.Packets;
-using CookComputing.XmlRpc;
-
-namespace libsecondlife
-{
-    /// <summary>
-    ///
-    /// </summary>
-    public enum LoginStatus
-    {
-        /// <summary></summary>
-        Failed = -1,
-        /// <summary></summary>
-        None = 0,
-        /// <summary></summary>
-        ConnectingToLogin,
-        /// <summary></summary>
-        ReadingResponse,
-        /// <summary></summary>
-        ConnectingToSim,
-        /// <summary></summary>
-        Redirecting,
-        /// <summary></summary>
-        Success
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public struct LoginParams
-    {
-        /// <summary></summary>
-        public string URI;
-        /// <summary></summary>
-        public int Timeout;
-        /// <summary></summary>
-        public string MethodName;
-        /// <summary></summary>
-        public string FirstName;
-        /// <summary></summary>
-        public string LastName;
-        /// <summary></summary>
-        public string Password;
-        /// <summary></summary>
-        public string Start;
-        /// <summary></summary>
-        public string Channel;
-        /// <summary></summary>
-        public string Version;
-        /// <summary></summary>
-        public string Platform;
-        /// <summary></summary>
-        public string MAC;
-        /// <summary></summary>
-        public string ViewerDigest;
-        /// <summary></summary>
-        public List<string> Options;
-    }
-
-    // TODO: Remove me when MONO can handle ServerCertificateValidationCallback
-    internal class AcceptAllCertificatePolicy : ICertificatePolicy
-    {
-        public AcceptAllCertificatePolicy()
-        {
-        }
-
-        public bool CheckValidationResult(ServicePoint sPoint,
-            System.Security.Cryptography.X509Certificates.X509Certificate cert,
-            WebRequest wRequest, int certProb)
-        {
-            // Always accept
-            return true;
-        }
-    }
-
-    public struct LoginResponseData
-    {
-        public LLUUID AgentID;
-        public LLUUID SessionID;
-        public LLUUID SecureSessionID;
-        public string FirstName;
-        public string LastName;
-        public string StartLocation;
-        public string AgentAccess;
-        public LLVector3 LookAt;
-        public LLVector3 HomePosition;
-        public LLVector3 HomeLookAt;
-        public uint CircuitCode;
-        public uint RegionX;
-        public uint RegionY;
-        public ushort SimPort;
-        public IPAddress SimIP;
-        public string SeedCapability;
-        public FriendInfo[] BuddyList;
-        public DateTime SecondsSinceEpoch;
-        public LLUUID InventoryRoot;
-        public LLUUID LibraryRoot;
-        public InventoryFolder[] InventorySkeleton;
-        public InventoryFolder[] LibrarySkeleton;
-        public LLUUID LibraryOwner;
-
-        public void Parse(NetworkManager.LoginMethodResponse reply)
-        {
-            AgentID = LLUUID.Parse(reply.agent_id);
-            SessionID = LLUUID.Parse(reply.session_id);
-            SecureSessionID = LLUUID.Parse(reply.secure_session_id);
-            FirstName = reply.first_name;
-            LastName = reply.last_name;
-            StartLocation = reply.start_location;
-            AgentAccess = reply.agent_access;
-
-            LLSDArray look_at = (LLSDArray)LLSDParser.DeserializeNotation(reply.look_at);
-            LookAt = new LLVector3(
-                (float)look_at[0].AsReal(),
-                (float)look_at[1].AsReal(),
-                (float)look_at[2].AsReal());
-
-            if (reply.home != null)
-            {
-                LLSDMap home = (LLSDMap)LLSDParser.DeserializeNotation(reply.home);
-                LLSDArray array = (LLSDArray)home["position"];
-                HomePosition = new LLVector3(
-                    (float)array[0].AsReal(),
-                    (float)array[1].AsReal(),
-                    (float)array[2].AsReal());
-
-                array = (LLSDArray)home["look_at"];
-                HomeLookAt = new LLVector3(
-                    (float)array[0].AsReal(),
-                    (float)array[1].AsReal(),
-                    (float)array[2].AsReal());
-            }
-
-            CircuitCode = (uint)reply.circuit_code;
-            RegionX = (uint)reply.region_x;
-            RegionY = (uint)reply.region_y;
-            SimPort = (ushort)reply.sim_port;
-            SimIP = IPAddress.Parse(reply.sim_ip);
-            SeedCapability = reply.seed_capability;
-
-            if (reply.buddy_list != null)
-            {
-                BuddyList = new FriendInfo[reply.buddy_list.Length];
-                for (int i = 0; i < BuddyList.Length; ++i)
-                {
-                    NetworkManager.BuddyListEntry buddy = reply.buddy_list[i];
-                    BuddyList[i] = new FriendInfo(buddy.buddy_id, (FriendRights)buddy.buddy_rights_given,
-                            (FriendRights)buddy.buddy_rights_has);
-                }
-            }
-            else
-            {
-                BuddyList = new FriendInfo[0];
-            }
-
-            InventoryRoot = LLUUID.Parse(reply.inventory_root[0].folder_id);
-            LibraryRoot = LLUUID.Parse(reply.inventory_lib_root[0].folder_id);
-            LibraryOwner = LLUUID.Parse(reply.inventory_lib_owner[0].agent_id);
-            InventorySkeleton = ParseSkeleton(reply.inventory_skeleton, AgentID);
-            LibrarySkeleton = ParseSkeleton(reply.inventory_skel_lib, LibraryOwner);
-        }
-
-        public InventoryFolder[] ParseSkeleton(NetworkManager.InventorySkeletonEntry[] skeleton, LLUUID owner)
-        {
-            Dictionary<LLUUID, InventoryFolder> Folders = new Dictionary<LLUUID, InventoryFolder>();
-            Dictionary<LLUUID, List<InventoryFolder>> FoldersChildren = new Dictionary<LLUUID, List<InventoryFolder>>(skeleton.Length);
-
-            foreach (NetworkManager.InventorySkeletonEntry entry in skeleton)
-            {
-                InventoryFolder folder = new InventoryFolder(entry.folder_id);
-                if (entry.type_default != -1)
-                    folder.PreferredType = (AssetType)entry.type_default;
-                folder.Version = entry.version;
-                folder.OwnerID = owner;
-                folder.ParentUUID = LLUUID.Parse(entry.parent_id);
-                folder.Name = entry.name;
-                Folders.Add(entry.folder_id, folder);
-
-                if (entry.parent_id != LLUUID.Zero)
-                {
-                    List<InventoryFolder> parentChildren;
-                    if (!FoldersChildren.TryGetValue(entry.parent_id, out parentChildren))
-                    {
-                        parentChildren = new List<InventoryFolder>();
-                        FoldersChildren.Add(entry.parent_id, parentChildren);
-                    }
-                    parentChildren.Add(folder);
-                }
-            }
-
-            foreach (KeyValuePair<LLUUID, List<InventoryFolder>> pair in FoldersChildren)
-            {
-                if (Folders.ContainsKey(pair.Key))
-                {
-                    InventoryFolder parentFolder = Folders[pair.Key];
-                    parentFolder.DescendentCount = pair.Value.Count; // Should we set this here? it's just the folders, not the items!
-                }
-            }
-
-            // Should we do this or just return an IEnumerable?
-            InventoryFolder[] ret = new InventoryFolder[Folders.Count];
-            int index = 0;
-            foreach (InventoryFolder folder in Folders.Values)
-            {
-                ret[index] = folder;
-                ++index;
-            }
-            return ret;
-        }
-    }
-
-    public partial class NetworkManager
-    {
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="login"></param>
-        /// <param name="message"></param>
-        public delegate void LoginCallback(LoginStatus login, string message);
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="loginSuccess"></param>
-        /// <param name="redirect"></param>
-        /// <param name="replyData"></param>
-        public delegate void LoginResponseCallback(bool loginSuccess, bool redirect, string message, string reason, LoginResponseData replyData);
-
-        /// <summary>Called any time the login status changes, will eventually
-        /// return LoginStatus.Success or LoginStatus.Failure</summary>
-        public event LoginCallback OnLogin;
-
-        /// <summary>Called when a reply is received from the login server, the
-        /// login sequence will block until this event returns</summary>
-        private event LoginResponseCallback OnLoginResponse;
-
-        /// <summary>Seed CAPS URL returned from the login server</summary>
-        public string LoginSeedCapability = String.Empty;
-
-        /// <summary>Current state of logging in</summary>
-        public LoginStatus LoginStatusCode { get { return InternalStatusCode; } }
-
-        /// <summary>Upon login failure, contains a short string key for the
-        /// type of login error that occurred</summary>
-        public string LoginErrorKey { get { return InternalErrorKey; } }
-
-        /// <summary>The raw XML-RPC reply from the login server, exactly as it
-        /// was received (minus the HTTP header)</summary>
-        public string RawLoginReply { get { return InternalRawLoginReply; } }
-
-        /// <summary>During login this contains a descriptive version of
-        /// LoginStatusCode. After a successful login this will contain the
-        /// message of the day, and after a failed login a descriptive error
-        /// message will be returned</summary>
-        public string LoginMessage { get { return InternalLoginMessage; } }
-
-        private class LoginContext
-        {
-            public LoginParams Params;
-        }
-
-        private LoginContext CurrentContext = null;
-        private AutoResetEvent LoginEvent = new AutoResetEvent(false);
-        private LoginStatus InternalStatusCode = LoginStatus.None;
-        private string InternalErrorKey = String.Empty;
-        private string InternalLoginMessage = String.Empty;
-        private string InternalRawLoginReply = String.Empty;
-        private Dictionary<LoginResponseCallback, string[]> CallbackOptions = new Dictionary<LoginResponseCallback, string[]>();
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="firstName">Account first name</param>
-        /// <param name="lastName">Account last name</param>
-        /// <param name="password">Account password</param>
-        /// <param name="userAgent">Client application name</param>
-        /// <param name="userVersion">Client application version</param>
-        /// <returns></returns>
-        public LoginParams DefaultLoginParams(string firstName, string lastName, string password,
-            string userAgent, string userVersion)
-        {
-            List<string> options = new List<string>();
-            options.Add("inventory-root");
-            options.Add("inventory-skeleton");
-            options.Add("inventory-lib-root");
-            options.Add("inventory-lib-owner");
-            options.Add("inventory-skel-lib");
-            options.Add("gestures");
-            options.Add("event_categories");
-            options.Add("event_notifications");
-            options.Add("classified_categories");
-            options.Add("buddy-list");
-            options.Add("ui-config");
-            options.Add("login-flags");
-            options.Add("global-textures");
-            // initial-outfit?
-
-            LoginParams loginParams = new LoginParams();
-
-            loginParams.URI = Client.Settings.LOGIN_SERVER;
-            loginParams.Timeout = Client.Settings.LOGIN_TIMEOUT;
-            loginParams.MethodName = "login_to_simulator";
-            loginParams.FirstName = firstName;
-            loginParams.LastName = lastName;
-            loginParams.Password = password;
-            loginParams.Start = "last";
-            loginParams.Channel = userAgent + " (libsecondlife)";
-            loginParams.Version = userVersion;
-            loginParams.Platform = "Win";
-            loginParams.MAC = String.Empty;
-            loginParams.ViewerDigest = String.Empty;
-            loginParams.Options = options;
-
-            return loginParams;
-        }
-
-        /// <summary>
-        /// Simplified login that takes the most common and required fields
-        /// </summary>
-        /// <param name="firstName">Account first name</param>
-        /// <param name="lastName">Account last name</param>
-        /// <param name="password">Account password</param>
-        /// <param name="userAgent">Client application name and version</param>
-        /// <param name="author">Client application author</param>
-        /// <returns>Whether the login was successful or not. On failure the
-        /// LoginErrorKey string will contain the error code and LoginMessage
-        /// will contain a description of the error</returns>
-        public bool Login(string firstName, string lastName, string password, string userAgent, string author)
-        {
-            return Login(firstName, lastName, password, userAgent, "last", author);
-        }
-
-        /// <summary>
-        /// Simplified login that takes the most common fields along with a
-        /// starting location URI, and can accept an MD5 string instead of a
-        /// plaintext password
-        /// </summary>
-        /// <param name="firstName">Account first name</param>
-        /// <param name="lastName">Account last name</param>
-        /// <param name="password">Account password or MD5 hash of the password
-        /// such as $1$1682a1e45e9f957dcdf0bb56eb43319c</param>
-        /// <param name="userAgent">Client application name and version</param>
-        /// <param name="start">Starting location URI that can be built with
-        /// StartLocation()</param>
-        /// <param name="author">Client application author</param>
-        /// <returns>Whether the login was successful or not. On failure the
-        /// LoginErrorKey string will contain the error code and LoginMessage
-        /// will contain a description of the error</returns>
-        public bool Login(string firstName, string lastName, string password, string userAgent, string start,
-            string author)
-        {
-            LoginParams loginParams = DefaultLoginParams(firstName, lastName, password, userAgent, author);
-            loginParams.Start = start;
-
-            return Login(loginParams);
-        }
-
-        /// <summary>
-        /// Login that takes a struct of all the values that will be passed to
-        /// the login server
-        /// </summary>
-        /// <param name="loginParams">The values that will be passed to the login
-        /// server, all fields must be set even if they are String.Empty</param>
-        /// <returns>Whether the login was successful or not. On failure the
-        /// LoginErrorKey string will contain the error code and LoginMessage
-        /// will contain a description of the error</returns>
-        public bool Login(LoginParams loginParams)
-        {
-            BeginLogin(loginParams);
-
-            LoginEvent.WaitOne(loginParams.Timeout, false);
-
-            if (CurrentContext != null)
-            {
-                CurrentContext = null; // Will force any pending callbacks to bail out early
-                InternalStatusCode = LoginStatus.Failed;
-                InternalLoginMessage = "Timed out";
-                return false;
-            }
-
-            return (InternalStatusCode == LoginStatus.Success);
-        }
-
-        private void BeginLogin()
-        {
-            // Sanity check some of the parameters
-            if (CurrentContext.Params.ViewerDigest == null)
-                CurrentContext.Params.ViewerDigest = String.Empty;
-            if (CurrentContext.Params.Version == null)
-                CurrentContext.Params.Version = String.Empty;
-            if (CurrentContext.Params.Platform == null)
-                CurrentContext.Params.Platform = String.Empty;
-            if (CurrentContext.Params.Options == null)
-                CurrentContext.Params.Options = new List<string>();
-            if (CurrentContext.Params.MAC == null)
-                CurrentContext.Params.MAC = String.Empty;
-            if (CurrentContext.Params.Channel == null)
-                CurrentContext.Params.Channel = String.Empty;
-            if (CurrentContext.Params.Password == null)
-                CurrentContext.Params.Password = String.Empty;
-
-            // Convert the password to MD5 if it isn't already
-            if (CurrentContext.Params.Password.Length != 35 && !CurrentContext.Params.Password.StartsWith("$1$"))
-                CurrentContext.Params.Password = Helpers.MD5(CurrentContext.Params.Password);
-
-            // Override SSL authentication mechanisms. DO NOT convert this to the
-            // .NET 2.0 preferred method, the equivalent function in Mono has a
-            // different name and it will break compatibility!
-            ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
-            // TODO: At some point, maybe we should check the cert?
-
-            LoginMethodParams loginParams;
-            loginParams.first = CurrentContext.Params.FirstName;
-            loginParams.last = CurrentContext.Params.LastName;
-            loginParams.passwd = CurrentContext.Params.Password;
-            loginParams.start = CurrentContext.Params.Start;
-            loginParams.channel = CurrentContext.Params.Channel;
-            loginParams.version = CurrentContext.Params.Version;
-            loginParams.platform = CurrentContext.Params.Platform;
-            loginParams.mac = CurrentContext.Params.MAC;
-            loginParams.agree_to_tos = "true";
-            loginParams.read_critical = "true";
-            loginParams.viewer_digest = CurrentContext.Params.ViewerDigest;
-
-            List<string> options = new List<string>(CurrentContext.Params.Options.Count + CallbackOptions.Values.Count);
-            options.AddRange(CurrentContext.Params.Options);
-            foreach (string[] callbackOpts in CallbackOptions.Values)
-            {
-                if (callbackOpts != null)
-                    foreach (string option in callbackOpts)
-                        if (!options.Contains(option)) // TODO: Replace with some kind of Dictionary/Set?
-                            options.Add(option);
-            }
-            loginParams.options = options.ToArray();
-
-            try
-            {
-                LoginProxy proxy = new LoginProxy();
-
-                proxy.KeepAlive = false;
-                proxy.ResponseEvent += new XmlRpcResponseEventHandler(proxy_ResponseEvent);
-                proxy.Url = CurrentContext.Params.URI;
-                proxy.XmlRpcMethod = CurrentContext.Params.MethodName;
-#if !PocketPC
-                proxy.Expect100Continue = false;
-#endif
-
-                // Start the request
-                proxy.BeginLoginToSimulator(loginParams, new AsyncCallback(LoginMethodCallback), new object[] { proxy, CurrentContext });
-            }
-            catch (Exception e)
-            {
-                UpdateLoginStatus(LoginStatus.Failed, "Error opening the login server connection: " + e);
-            }
-        }
-
-        public void BeginLogin(LoginParams loginParams)
-        {
-            if (CurrentContext != null)
-                throw new Exception("Login already in progress");
-
-            LoginEvent.Reset();
-
-            CurrentContext = new LoginContext();
-            CurrentContext.Params = loginParams;
-
-            BeginLogin();
-        }
-
-        public void RegisterLoginResponseCallback(LoginResponseCallback callback)
-        {
-            RegisterLoginResponseCallback(callback, null);
-        }
-
-        public void RegisterLoginResponseCallback(LoginResponseCallback callback, string[] options) {
-            CallbackOptions.Add(callback, options);
-            OnLoginResponse += callback;
-        }
-
-        public void UnregisterLoginResponseCallback(LoginResponseCallback callback)
-        {
-            CallbackOptions.Remove(callback);
-            OnLoginResponse -= callback;
-        }
-
-        /// <summary>
-        /// Build a start location URI for passing to the Login function
-        /// </summary>
-        /// <param name="sim">Name of the simulator to start in</param>
-        /// <param name="x">X coordinate to start at</param>
-        /// <param name="y">Y coordinate to start at</param>
-        /// <param name="z">Z coordinate to start at</param>
-        /// <returns>String with a URI that can be used to login to a specified
-        /// location</returns>
-        public static string StartLocation(string sim, int x, int y, int z)
-        {
-            return String.Format("uri:{0}&{1}&{2}&{3}", sim.ToLower(), x, y, z);
-        }
-
-        private void UpdateLoginStatus(LoginStatus status, string message)
-        {
-            InternalStatusCode = status;
-            InternalLoginMessage = message;
-
-            Client.DebugLog("Login status: " + status.ToString() + ": " + message);
-
-            if (OnLogin != null)
-            {
-                try { OnLogin(status, message); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-
-            if (status == LoginStatus.Success || status == LoginStatus.Failed)
-            {
-                CurrentContext = null;
-                LoginEvent.Set();
-            }
-        }
-
-        private void proxy_ResponseEvent(object sender, XmlRpcResponseEventArgs args)
-        {
-            TextReader reader = new StreamReader(args.ResponseStream);
-            InternalRawLoginReply = reader.ReadToEnd();
-        }
-
-        private void LoginMethodCallback(IAsyncResult result)
-        {
-            object[] asyncState = result.AsyncState as object[];
-            LoginProxy proxy = asyncState[0] as LoginProxy;
-            LoginContext context = asyncState[1] as LoginContext;
-            XmlRpcAsyncResult clientResult = result as XmlRpcAsyncResult;
-            LoginMethodResponse reply;
-            IPAddress simIP = IPAddress.Any; // Temporary
-            ushort simPort = 0;
-            uint regionX = 0;
-            uint regionY = 0;
-            bool loginSuccess = false;
-
-            // Fetch the login response
-            try
-            {
-                reply = proxy.EndLoginToSimulator(clientResult);
-                if (context != CurrentContext)
-                    return;
-            }
-            catch (Exception ex)
-            {
-                Client.DebugLog(ex.ToString());
-
-                UpdateLoginStatus(LoginStatus.Failed, "Error retrieving the login response from the server");
-                return;
-            }
-
-            string reason = reply.reason;
-            string message = reply.message;
-
-            if (reply.login == "true")
-            {
-                loginSuccess = true;
-
-                // FIXME: No information should be set here, everything can take care of itself
-                // through login reply handlers
-
-                #region Critical Information
-
-                try
-                {
-                    // Networking
-                    Client.Network.CircuitCode = (uint)reply.circuit_code;
-                    regionX = (uint)reply.region_x;
-                    regionY = (uint)reply.region_y;
-                    simPort = (ushort)reply.sim_port;
-                    Helpers.TryParse(reply.sim_ip, out simIP);
-                    LoginSeedCapability = reply.seed_capability;
-                }
-                catch (Exception)
-                {
-                    UpdateLoginStatus(LoginStatus.Failed, "Login server failed to return critical information");
-                    return;
-                }
-
-                #endregion Critical Information
-            }
-
-            bool redirect = (reply.login == "indeterminate");
-
-            try
-            {
-                if (OnLoginResponse != null)
-                {
-                    LoginResponseData data = new LoginResponseData();
-                    if (loginSuccess)
-                    {
-                        data.Parse(reply);
-                    }
-                    try { OnLoginResponse(loginSuccess, redirect, message, reason, data); }
-                    catch (Exception ex) { Client.Log(ex.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-            catch (Exception ex) { Client.Log(ex.ToString(), Helpers.LogLevel.Error); }
-
-            // Make the next network jump, if needed
-            if (redirect)
-            {
-                UpdateLoginStatus(LoginStatus.Redirecting, "Redirecting login...");
-
-                // Handle indeterminate logins
-                CurrentContext.Params.URI = reply.next_url;
-                CurrentContext.Params.MethodName = reply.next_method;
-
-                // Ignore next_options and next_duration for now
-                BeginLogin();
-            }
-            else if (loginSuccess)
-            {
-                UpdateLoginStatus(LoginStatus.ConnectingToSim, "Connecting to simulator...");
-
-                ulong handle = Helpers.UIntsToLong(regionX, regionY);
-
-                // Connect to the sim given in the login reply
-                if (Connect(simIP, simPort, handle, true, LoginSeedCapability) != null)
-                {
-                    // Request the economy data right after login
-                    SendPacket(new EconomyDataRequestPacket());
-
-                    // Update the login message with the MOTD returned from the server
-                    UpdateLoginStatus(LoginStatus.Success, message);
-
-                    // Fire an event for connecting to the grid
-                    if (OnConnected != null)
-                    {
-                        try { OnConnected(this.Client); }
-                        catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-                }
-                else
-                {
-                    UpdateLoginStatus(LoginStatus.Failed, "Unable to connect to simulator");
-                }
-            }
-            else
-            {
-                // Make sure a usable error key is set
-                if (!String.IsNullOrEmpty(reason))
-                    InternalErrorKey = reason;
-                else
-                    InternalErrorKey = "unknown";
-
-                UpdateLoginStatus(LoginStatus.Failed, message);
-            }
-        }
-
-        public interface ILoginProxy : IXmlRpcProxy
-        {
-            [XmlRpcMethod("login_to_simulator")]
-            LoginMethodResponse LoginToSimulator(LoginMethodParams loginParams);
-
-            [XmlRpcBegin("login_to_simulator")]
-            IAsyncResult BeginLoginToSimulator(LoginMethodParams loginParams, AsyncCallback callback, object asyncState);
-
-            [XmlRpcEnd("login_to_simulator")]
-            LoginMethodResponse EndLoginToSimulator(IAsyncResult result);
-        }
-
-        public sealed class LoginProxy : XmlRpcClientProtocol, ILoginProxy
-        {
-            [XmlRpcMethod("login_to_simulator")]
-            public LoginMethodResponse LoginToSimulator(LoginMethodParams loginParams)
-            {
-                object xrtTemp = null;
-                LoginMethodResponse xrtReturn;
-                object[] xrtArray = new object[] {
-                    loginParams};
-                xrtTemp = this.Invoke("LoginToSimulator", xrtArray);
-                xrtReturn = ((LoginMethodResponse)(xrtTemp));
-                return xrtReturn;
-            }
-
-            [XmlRpcBegin("login_to_simulator")]
-            public IAsyncResult BeginLoginToSimulator(LoginMethodParams loginParams, AsyncCallback callback,
-                object asyncState)
-            {
-                return BeginInvoke("LoginToSimulator", new object[] { loginParams }, this, callback, asyncState);
-            }
-
-            [XmlRpcEnd("login_to_simulator")]
-            public LoginMethodResponse EndLoginToSimulator(IAsyncResult xrtResult)
-            {
-                object xrtTemp = null;
-                LoginMethodResponse xrtReturn;
-                xrtTemp = this.EndInvoke(xrtResult);
-                xrtReturn = ((LoginMethodResponse)(xrtTemp));
-                return xrtReturn;
-            }
-        }
-
-        #region XML-RPC structs
-
-        public struct LoginMethodParams
-        {
-            public string first;
-            public string last;
-            public string passwd;
-            public string start;
-            public string channel;
-            public string version;
-            public string platform;
-            public string mac;
-            public string agree_to_tos;
-            public string read_critical;
-            public string viewer_digest;
-            public string[] options;
-        }
-
-        public struct LoginMethodResponse
-        {
-            public string login;
-            public string message;
-
-            #region Login Failure
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string reason;
-            #endregion
-
-            #region Login Success
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            [XmlRpcMember("inventory-skeleton")]
-            public InventorySkeletonEntry[] inventory_skeleton;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string session_id;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            [XmlRpcMember("inventory-root")]
-            public InventoryRootEntry[] inventory_root;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public EventNotificationEntry[] event_notifications;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public CategoryEntry[] event_categories;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string secure_session_id;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string start_location;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string first_name;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string last_name;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public int region_x;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public int region_y;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            [XmlRpcMember("global-textures")]
-            public GlobalTextureEntry[] global_textures;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string home;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            [XmlRpcMember("inventory-lib-owner")]
-            public InventoryLibraryOwnerEntry[] inventory_lib_owner;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            [XmlRpcMember("inventory-lib-root")]
-            public InventoryRootEntry[] inventory_lib_root;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            [XmlRpcMember("inventory-skel-lib")]
-            public InventorySkeletonEntry[] inventory_skel_lib;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public CategoryEntry[] classified_categories;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            [XmlRpcMember("login-flags")]
-            public LoginFlagsEntry[] login_flags;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string agent_access;
-
-            [XmlRpcMember("buddy-list")]
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public BuddyListEntry[] buddy_list;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public int circuit_code;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public int sim_port;
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public GestureEntry[] gestures;
-            [XmlRpcMember("ui-config")]
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public UIConfigEntry[] ui_config;
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string sim_ip;
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string look_at;
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string agent_id;
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public int seconds_since_epoch;
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string seed_capability;
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            [XmlRpcMember("initial-outfit")]
-            public OutfitEntry[] initial_outfit;
-            #endregion
-
-            #region Redirection
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string next_method;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string next_url;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string[] next_options;
-
-            [XmlRpcMissingMapping(MappingAction.Ignore)]
-            public string next_duration;
-            #endregion
-        }
-
-        public struct InventoryRootEntry
-        {
-            public string folder_id;
-        }
-
-        public struct InventorySkeletonEntry
-        {
-            public int type_default;
-            public int version;
-            public string name;
-            public string folder_id;
-            public string parent_id;
-        }
-
-        public struct CategoryEntry
-        {
-            public int category_id;
-            public string category_name;
-        }
-
-        public struct EventNotificationEntry
-        {
-            // ???
-        }
-
-        public struct OutfitEntry
-        {
-            // ???
-        }
-
-        public struct GlobalTextureEntry
-        {
-            public string cloud_texture_id;
-            public string sun_texture_id;
-            public string moon_texture_id;
-        }
-
-        public struct InventoryLibraryOwnerEntry
-        {
-            public string agent_id;
-        }
-
-        public struct LoginFlagsEntry
-        {
-            public string ever_logged_in;
-            public string daylight_savings;
-            public string stipend_since_login;
-            public string gendered;
-        }
-
-        public struct BuddyListEntry
-        {
-            public int buddy_rights_given;
-            public string buddy_id;
-            public int buddy_rights_has;
-        }
-
-        public struct GestureEntry
-        {
-            public string asset_id;
-            public string item_id;
-        }
-
-        public struct UIConfigEntry
-        {
-            public string allow_first_life;
-        }
-
-        #endregion
-    }
-}
diff --git a/old/libsl1550/libsecondlife/NameValue.cs b/old/libsl1550/libsecondlife/NameValue.cs
deleted file mode 100644
index 747fdb2..0000000
--- a/old/libsl1550/libsecondlife/NameValue.cs
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// A Name Value pair with additional settings, used in the protocol
-    /// primarily to transmit avatar names and active group in object packets
-    /// </summary>
-    public struct NameValue
-    {
-        /// <summary>Type of the value</summary>
-        public enum ValueType
-        {
-            /// <summary>Unknown</summary>
-            Unknown = -1,
-            /// <summary>String value</summary>
-            String,
-            /// <summary></summary>
-            F32,
-            /// <summary></summary>
-            S32,
-            /// <summary></summary>
-            VEC3,
-            /// <summary></summary>
-            U32,
-            /// <summary>Deprecated</summary>
-            [Obsolete]
-            CAMERA,
-            /// <summary>String value, but designated as an asset</summary>
-            Asset,
-            /// <summary></summary>
-            U64
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum ClassType
-        {
-            /// <summary></summary>
-            Unknown = -1,
-            /// <summary></summary>
-            ReadOnly,
-            /// <summary></summary>
-            ReadWrite,
-            /// <summary></summary>
-            Callback
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum SendtoType
-        {
-            /// <summary></summary>
-            Unknown = -1,
-            /// <summary></summary>
-            Sim,
-            /// <summary></summary>
-            DataSim,
-            /// <summary></summary>
-            SimViewer,
-            /// <summary></summary>
-            DataSimViewer
-        }
-
-
-        /// <summary></summary>
-        public string Name;
-        /// <summary></summary>
-        public ValueType Type;
-        /// <summary></summary>
-        public ClassType Class;
-        /// <summary></summary>
-        public SendtoType Sendto;
-        /// <summary></summary>
-        public object Value;
-
-
-        private static readonly string[] TypeStrings = new string[]
-        {
-            "STRING",
-            "F32",
-            "S32",
-            "VEC3",
-            "U32",
-            "CAMERA", // Obsolete
-            "ASSET",
-            "U64"
-        };
-        private static readonly string[] ClassStrings = new string[]
-        {
-            "R",    // Read-only
-            "RW",   // Read-write
-            "CB"    // Callback
-        };
-        private static readonly string[] SendtoStrings = new string[]
-        {
-            "S",    // Sim
-            "DS",   // Data Sim
-            "SV",   // Sim Viewer
-            "DSV"   // Data Sim Viewer
-        };
-
-        /// <summary>
-        /// Constructor that takes all the fields as parameters
-        /// </summary>
-        /// <param name="name"></param>
-        /// <param name="valueType"></param>
-        /// <param name="classType"></param>
-        /// <param name="sendtoType"></param>
-        /// <param name="value"></param>
-        public NameValue(string name, ValueType valueType, ClassType classType, SendtoType sendtoType, object value)
-        {
-            Name = name;
-            Type = valueType;
-            Class = classType;
-            Sendto = sendtoType;
-            Value = value;
-        }
-
-        /// <summary>
-        /// Constructor that takes a single line from a NameValue field
-        /// </summary>
-        /// <param name="data"></param>
-        public NameValue(string data)
-        {
-            int i;
-            char[] seps = new char[]{ ' ', '\n', '\t', '\r' };
-
-            // Name
-            i = data.IndexOfAny(seps);
-            if (i < 1)
-            {
-                Name = String.Empty;
-                Type = ValueType.Unknown;
-                Class = ClassType.Unknown;
-                Sendto = SendtoType.Unknown;
-                Value = null;
-                return;
-            }
-            Name = data.Substring(0, i);
-            data = data.Substring(i + 1);
-
-            // Type
-            i = data.IndexOfAny(seps);
-            if (i > 0)
-            {
-                Type = GetValueType(data.Substring(0, i));
-                data = data.Substring(i + 1);
-
-                // Class
-                i = data.IndexOfAny(seps);
-                if (i > 0)
-                {
-                    Class = GetClassType(data.Substring(0, i));
-                    data = data.Substring(i + 1);
-
-                    // Sendto
-                    i = data.IndexOfAny(seps);
-                    if (i > 0)
-                    {
-                        Sendto = GetSendtoType(data.Substring(0, 1));
-                        data = data.Substring(i + 1);
-                    }
-                }
-            }
-
-            // Value
-            Type = ValueType.String;
-            Class = ClassType.ReadOnly;
-            Sendto = SendtoType.Sim;
-            Value = null;
-            SetValue(data);
-        }
-
-        private void SetValue(string value)
-        {
-            switch (Type)
-            {
-                case ValueType.Asset:
-                case ValueType.String:
-                    Value = value;
-                    break;
-                case ValueType.F32:
-                {
-                    float temp;
-                    Helpers.TryParse(value, out temp);
-                    Value = temp;
-                    break;
-                }
-                case ValueType.S32:
-                {
-                    int temp;
-                    Helpers.TryParse(value, out temp);
-                    Value = temp;
-                    break;
-                }
-                case ValueType.U32:
-                {
-                    uint temp;
-                    Helpers.TryParse(value, out temp);
-                    Value = temp;
-                    break;
-                }
-                case ValueType.U64:
-                {
-                    ulong temp;
-                    Helpers.TryParse(value, out temp);
-                    Value = temp;
-                    break;
-                }
-                case ValueType.VEC3:
-                {
-                    LLVector3 temp;
-                    Helpers.TryParse(value, out temp);
-                    Value = temp;
-                    break;
-                }
-                default:
-                    Value = null;
-                    break;
-            }
-        }
-
-        private static ValueType GetValueType(string value)
-        {
-            ValueType type = ValueType.Unknown;
-
-            for (int i = 0; i < TypeStrings.Length; i++)
-            {
-                if (value == TypeStrings[i])
-                {
-                    type = (ValueType)i;
-                    break;
-                }
-            }
-
-            if (type == ValueType.Unknown)
-                type = ValueType.String;
-
-            return type;
-        }
-
-        private static ClassType GetClassType(string value)
-        {
-            ClassType type = ClassType.Unknown;
-
-            for (int i = 0; i < ClassStrings.Length; i++)
-            {
-                if (value == ClassStrings[i])
-                {
-                    type = (ClassType)i;
-                    break;
-                }
-            }
-
-            if (type == ClassType.Unknown)
-                type = ClassType.ReadOnly;
-
-            return type;
-        }
-
-        private static SendtoType GetSendtoType(string value)
-        {
-            SendtoType type = SendtoType.Unknown;
-
-            for (int i = 0; i < SendtoStrings.Length; i++)
-            {
-                if (value == SendtoStrings[i])
-                {
-                    type = (SendtoType)i;
-                    break;
-                }
-            }
-
-            if (type == SendtoType.Unknown)
-                type = SendtoType.Sim;
-
-            return type;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/NetworkManager.cs b/old/libsl1550/libsecondlife/NetworkManager.cs
deleted file mode 100644
index 81531e5..0000000
--- a/old/libsl1550/libsecondlife/NetworkManager.cs
+++ /dev/null
@@ -1,1063 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Threading;
-using System.Collections;
-using System.Collections.Generic;
-using System.Net;
-using System.Net.Sockets;
-using System.Globalization;
-using System.IO;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// This exception is thrown whenever a network operation is attempted
-    /// without a network connection.
-    /// </summary>
-    public class NotConnectedException : ApplicationException { }
-
-    /// <summary>
-    /// NetworkManager is responsible for managing the network layer of
-    /// libsecondlife. It tracks all the server connections, serializes
-    /// outgoing traffic and deserializes incoming traffic, and provides
-    /// instances of delegates for network-related events.
-    /// </summary>
-    public partial class NetworkManager
-    {
-        /// <summary>
-        /// Holds a simulator reference and a packet, these structs are put in
-        /// the packet inbox for decoding
-        /// </summary>
-        public struct IncomingPacket
-        {
-            /// <summary>Reference to the simulator that this packet came from</summary>
-            public Simulator Simulator;
-            /// <summary>The packet that needs to be processed</summary>
-            public Packet Packet;
-        }
-
-        /// <summary>
-        /// Explains why a simulator or the grid disconnected from us
-        /// </summary>
-        public enum DisconnectType
-        {
-            /// <summary>The client requested the logout or simulator disconnect</summary>
-            ClientInitiated,
-            /// <summary>The server notified us that it is disconnecting</summary>
-            ServerInitiated,
-            /// <summary>Either a socket was closed or network traffic timed out</summary>
-            NetworkTimeout,
-            /// <summary>The last active simulator shut down</summary>
-            SimShutdown
-        }
-
-        /// <summary>
-        /// Coupled with RegisterCallback(), this is triggered whenever a packet
-        /// of a registered type is received
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        public delegate void PacketCallback(Packet packet, Simulator simulator);
-        /// <summary>
-        /// Assigned by the OnConnected event. Raised when login was a success
-        /// </summary>
-        /// <param name="sender">Reference to the SecondLife class that called the event</param>
-        public delegate void ConnectedCallback(object sender);
-        /// <summary>
-        /// Assigned by the OnLogoutReply callback. Raised upone receipt of a LogoutReply packet during logout process.
-        /// </summary>
-        /// <param name="inventoryItems"></param>
-        public delegate void LogoutCallback(List<LLUUID> inventoryItems);
-        /// <summary>
-        /// Triggered before a new connection to a simulator is established
-        /// </summary>
-        /// <remarks>The connection to the new simulator won't be established
-        /// until this callback returns</remarks>
-        /// <param name="simulator">The simulator that is being connected to</param>
-        /// <returns>Whether to continue connecting to the simulator or abort
-        /// the connection</returns>
-        public delegate bool SimConnectingCallback(Simulator simulator);
-        /// <summary>
-        /// Triggered when a new connection to a simulator is established
-        /// </summary>
-        /// <param name="simulator">The simulator that is being connected to</param>
-        public delegate void SimConnectedCallback(Simulator simulator);
-        /// <summary>
-        /// Triggered when a simulator other than the simulator that is currently
-        /// being occupied disconnects for whatever reason
-        /// </summary>
-        /// <param name="simulator">The simulator that disconnected, which will become a null
-        /// reference after the callback is finished</param>
-        /// <param name="reason">Enumeration explaining the reason for the disconnect</param>
-        public delegate void SimDisconnectedCallback(Simulator simulator, DisconnectType reason);
-        /// <summary>
-        /// Triggered when we are logged out of the grid due to a simulator request,
-        /// client request, network timeout, or any other cause
-        /// </summary>
-        /// <param name="reason">Enumeration explaining the reason for the disconnect</param>
-        /// <param name="message">If we were logged out by the simulator, this
-        /// is a message explaining why</param>
-        public delegate void DisconnectedCallback(DisconnectType reason, string message);
-        /// <summary>
-        /// Triggered when CurrentSim changes
-        /// </summary>
-        /// <param name="PreviousSimulator">A reference to the old value of CurrentSim</param>
-        public delegate void CurrentSimChangedCallback(Simulator PreviousSimulator);
-        /// <summary>
-        /// Triggered when an event queue makes the initial connection
-        /// </summary>
-        /// <param name="simulator">Simulator this event queue is tied to</param>
-        public delegate void EventQueueRunningCallback(Simulator simulator);
-
-        /// <summary>
-        /// Event raised when the client was able to connected successfully.
-        /// </summary>
-        /// <remarks>Uses the ConnectedCallback delegate.</remarks>
-        public event ConnectedCallback OnConnected;
-        /// <summary>
-        /// Event raised when a logout is confirmed by the simulator
-        /// </summary>
-        public event LogoutCallback OnLogoutReply;
-        /// <summary>
-        /// Event raised when a before a connection to a simulator is
-        /// initialized
-        /// </summary>
-        public event SimConnectingCallback OnSimConnecting;
-        /// <summary>
-        /// Event raised when a connection to a simulator is established
-        /// </summary>
-        public event SimConnectedCallback OnSimConnected;
-        /// <summary>
-        /// An event for the connection to a simulator other than the currently
-        /// occupied one disconnecting
-        /// </summary>
-        /// <remarks>The Simulators list is locked when this event is
-        /// triggered, do not attempt to modify the collection or acquire a
-        /// lock on it when this callback is fired</remarks>
-        public event SimDisconnectedCallback OnSimDisconnected;
-        /// <summary>
-        /// An event for being logged out either through client request, server
-        /// forced, or network error
-        /// </summary>
-        public event DisconnectedCallback OnDisconnected;
-        /// <summary>
-        /// An event for when CurrentSim changes
-        /// </summary>
-        public event CurrentSimChangedCallback OnCurrentSimChanged;
-        /// <summary>
-        /// Triggered when an event queue makes the initial connection
-        /// </summary>
-        public event EventQueueRunningCallback OnEventQueueRunning;
-
-        /// <summary>Uniquely identifier associated with our connections to
-        /// simulators</summary>
-        public uint CircuitCode;
-        /// <summary>The simulator that the logged in avatar is currently
-        /// occupying</summary>
-        public Simulator CurrentSim = null;
-        /// <summary>All of the simulators we are currently connected to</summary>
-        public List<Simulator> Simulators = new List<Simulator>();
-
-        /// <summary>
-        /// Shows whether the network layer is logged in to the grid or not
-        /// </summary>
-        public bool Connected { get { return connected; } }
-        public int InboxCount { get { return PacketInbox.Count; } }
-
-        [Obsolete("AgentID has been moved to Self.AgentID")]
-        public LLUUID AgentID { get { return Client.Self.AgentID; } }
-        [Obsolete("SessionID has been moved to Self.SessionID")]
-        public LLUUID SessionID { get { return Client.Self.SessionID; } }
-        [Obsolete("SecureSessionID has been mvoed to Self.SecureSessionID")]
-        public LLUUID SecureSessionID { get { return Client.Self.SecureSessionID; } }
-
-        /// <summary>Handlers for incoming capability events</summary>
-        internal CapsEventDictionary CapsEvents;
-        /// <summary>Handlers for incoming packets</summary>
-        internal PacketEventDictionary PacketEvents;
-        /// <summary>Incoming packets that are awaiting handling</summary>
-        internal BlockingQueue PacketInbox = new BlockingQueue(Settings.PACKET_INBOX_SIZE);
-
-        private SecondLife Client;
-        private Timer DisconnectTimer;
-        private bool connected = false;
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client">Reference to the SecondLife client</param>
-        public NetworkManager(SecondLife client)
-        {
-            Client = client;
-
-            PacketEvents = new PacketEventDictionary(client);
-            CapsEvents = new CapsEventDictionary(client);
-
-            // Register the internal callbacks
-            RegisterCallback(PacketType.RegionHandshake, new PacketCallback(RegionHandshakeHandler));
-            RegisterCallback(PacketType.StartPingCheck, new PacketCallback(StartPingCheckHandler));
-            RegisterCallback(PacketType.ParcelOverlay, new PacketCallback(ParcelOverlayHandler));
-            RegisterCallback(PacketType.EnableSimulator, new PacketCallback(EnableSimulatorHandler));
-            RegisterCallback(PacketType.DisableSimulator, new PacketCallback(DisableSimulatorHandler));
-            RegisterCallback(PacketType.KickUser, new PacketCallback(KickUserHandler));
-            RegisterCallback(PacketType.LogoutReply, new PacketCallback(LogoutReplyHandler));
-            RegisterCallback(PacketType.CompletePingCheck, new PacketCallback(PongHandler));
-			RegisterCallback(PacketType.SimStats, new PacketCallback(SimStatsHandler));
-
-            // GLOBAL SETTING: Don't force Expect-100: Continue headers on HTTP POST calls
-            ServicePointManager.Expect100Continue = false;
-        }
-
-        /// <summary>
-        /// Register an event handler for a packet. This is a low level event
-        /// interface and should only be used if you are doing something not
-        /// supported in libsecondlife
-        /// </summary>
-        /// <param name="type">Packet type to trigger events for</param>
-        /// <param name="callback">Callback to fire when a packet of this type
-        /// is received</param>
-        public void RegisterCallback(PacketType type, PacketCallback callback)
-        {
-            PacketEvents.RegisterEvent(type, callback);
-        }
-
-        /// <summary>
-        /// Unregister an event handler for a packet. This is a low level event
-        /// interface and should only be used if you are doing something not
-        /// supported in libsecondlife
-        /// </summary>
-        /// <param name="type">Packet type this callback is registered with</param>
-        /// <param name="callback">Callback to stop firing events for</param>
-        public void UnregisterCallback(PacketType type, PacketCallback callback)
-        {
-            PacketEvents.UnregisterEvent(type, callback);
-        }
-
-        /// <summary>
-        /// Register a CAPS event handler. This is a low level event interface
-        /// and should only be used if you are doing something not supported in
-        /// libsecondlife
-        /// </summary>
-        /// <param name="eventName">Name of the CAPS event to register a handler for</param>
-        /// <param name="callback">Callback to fire when a CAPS event is received</param>
-        public void RegisterEventCallback(string capsEvent, Caps.EventQueueCallback callback)
-        {
-            CapsEvents.RegisterEvent(capsEvent, callback);
-        }
-
-        /// <summary>
-        /// Unregister a CAPS event handler. This is a low level event interface
-        /// and should only be used if you are doing something not supported in
-        /// libsecondlife
-        /// </summary>
-        /// <param name="capsEvent">Name of the CAPS event this callback is
-        /// registered with</param>
-        /// <param name="callback">Callback to stop firing events for</param>
-        public void UnregisterEventCallback(string capsEvent, Caps.EventQueueCallback callback)
-        {
-            CapsEvents.UnregisterEvent(capsEvent, callback);
-        }
-
-        /// <summary>
-        /// Send a packet to the simulator the avatar is currently occupying
-        /// </summary>
-        /// <param name="packet">Packet to send</param>
-        public void SendPacket(Packet packet)
-        {
-            if (CurrentSim != null && CurrentSim.Connected)
-                CurrentSim.SendPacket(packet, true);
-        }
-
-        /// <summary>
-        /// Send a packet to a specified simulator
-        /// </summary>
-        /// <param name="packet">Packet to send</param>
-        /// <param name="simulator">Simulator to send the packet to</param>
-        public void SendPacket(Packet packet, Simulator simulator)
-        {
-            if (simulator != null)
-                simulator.SendPacket(packet, true);
-        }
-
-        /// <summary>
-        /// Send a raw byte array as a packet to the current simulator
-        /// </summary>
-        /// <param name="payload">Byte array containing a packet</param>
-        /// <param name="setSequence">Whether to set the second, third, and fourth
-        /// bytes of the payload to the current sequence number</param>
-        public void SendPacket(byte[] payload, bool setSequence)
-        {
-            if (CurrentSim != null)
-                CurrentSim.SendPacket(payload, setSequence);
-        }
-
-        /// <summary>
-        /// Send a raw byte array as a packet to the specified simulator
-        /// </summary>
-        /// <param name="payload">Byte array containing a packet</param>
-        /// <param name="simulator">Simulator to send the packet to</param>
-        /// <param name="setSequence">Whether to set the second, third, and fourth
-        /// bytes of the payload to the current sequence number</param>
-        public void SendPacket(byte[] payload, Simulator simulator, bool setSequence)
-        {
-            if (simulator != null)
-                simulator.SendPacket(payload, setSequence);
-        }
-
-        /// <summary>
-        /// Connect to a simulator
-        /// </summary>
-        /// <param name="ip">IP address to connect to</param>
-        /// <param name="port">Port to connect to</param>
-        /// <param name="handle">Handle for this simulator, to identify its
-        /// location in the grid</param>
-        /// <param name="setDefault">Whether to set CurrentSim to this new
-        /// connection, use this if the avatar is moving in to this simulator</param>
-        /// <param name="seedcaps">URL of the capabilities server to use for
-        /// this sim connection</param>
-        /// <returns>A Simulator object on success, otherwise null</returns>
-        public Simulator Connect(IPAddress ip, ushort port, ulong handle, bool setDefault, string seedcaps)
-        {
-            IPEndPoint endPoint = new IPEndPoint(ip, (int)port);
-            Simulator simulator = FindSimulator(endPoint);
-
-            if (simulator == null)
-            {
-                // We're not tracking this sim, create a new Simulator object
-                simulator = new Simulator(Client, endPoint, handle);
-
-                // Immediately add this simulator to the list of current sims. It will be removed if the
-                // connection fails
-                lock (Simulators) Simulators.Add(simulator);
-            }
-
-            if (!simulator.Connected)
-            {
-                if (!connected)
-                {
-                    // Mark that we are connecting/connected to the grid
-                    connected = true;
-
-                    // Start the packet decoding thread
-                    Thread decodeThread = new Thread(new ThreadStart(PacketHandler));
-                    decodeThread.Start();
-                }
-
-                // Fire the OnSimConnecting event
-                if (OnSimConnecting != null)
-                {
-                    try
-                    {
-                        if (!OnSimConnecting(simulator))
-                        {
-                            // Callback is requesting that we abort this connection
-                            lock (Simulators) Simulators.Remove(simulator);
-                            return null;
-                        }
-                    }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-
-                // Attempt to establish a connection to the simulator
-                if (simulator.Connect(setDefault))
-                {
-                    if (DisconnectTimer == null)
-                    {
-                        // Start a timer that checks if we've been disconnected
-                        DisconnectTimer = new Timer(new TimerCallback(DisconnectTimer_Elapsed), null,
-                            Client.Settings.SIMULATOR_TIMEOUT, Client.Settings.SIMULATOR_TIMEOUT);
-                    }
-
-                    if (setDefault) SetCurrentSim(simulator, seedcaps);
-
-                    // Fire the simulator connection callback if one is registered
-                    if (OnSimConnected != null)
-                    {
-                        try { OnSimConnected(simulator); }
-                        catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                    }
-
-                    // If enabled, send an AgentThrottle packet to the server to increase our bandwidth
-                    if (Client.Settings.SEND_AGENT_THROTTLE) Client.Throttle.Set(simulator);
-
-                    return simulator;
-                }
-                else
-                {
-                    // Connection failed, remove this simulator from our list and destroy it
-                    lock (Simulators) Simulators.Remove(simulator);
-                    return null;
-                }
-            }
-            else if (setDefault)
-            {
-                // We're already connected to this server, but need to set it to the default
-                SetCurrentSim(simulator, seedcaps);
-
-                // Move in to this simulator
-                Client.Self.CompleteAgentMovement(simulator);
-
-                // Send an initial AgentUpdate to complete our movement in to the sim
-                if (Client.Settings.SEND_AGENT_UPDATES)
-                    Client.Self.Movement.SendUpdate(true, simulator);
-
-                return simulator;
-            }
-            else
-            {
-                // Already connected to this simulator and wasn't asked to set it as the default,
-                // just return a reference to the existing object
-                return simulator;
-            }
-        }
-
-        /// <summary>
-        /// Initiate a blocking logout request. This will return when the logout
-        /// handshake has completed or when <code>Settings.LOGOUT_TIMEOUT</code>
-        /// has expired and the network layer is manually shut down
-        /// </summary>
-        public void Logout()
-        {
-            AutoResetEvent logoutEvent = new AutoResetEvent(false);
-            LogoutCallback callback =
-                delegate(List<LLUUID> inventoryItems) { logoutEvent.Set(); };
-            OnLogoutReply += callback;
-
-            // Send the packet requesting a clean logout
-            RequestLogout();
-
-            // Wait for a logout response. If the response is received, shutdown
-            // will be fired in the callback. Otherwise we fire it manually with
-            // a NetworkTimeout type
-            if (!logoutEvent.WaitOne(Client.Settings.LOGOUT_TIMEOUT, false))
-                Shutdown(DisconnectType.NetworkTimeout);
-
-            OnLogoutReply -= callback;
-        }
-
-        /// <summary>
-        /// Initiate the logout process. Check if logout succeeded with the
-        /// <code>OnLogoutReply</code> event, and if this does not fire the
-        /// <code>Shutdown()</code> function needs to be manually called
-        /// </summary>
-        public void RequestLogout()
-        {
-            // No need to run the disconnect timer any more
-            if (DisconnectTimer != null) DisconnectTimer.Dispose();
-
-            // This will catch a Logout when the client is not logged in
-            if (CurrentSim == null || !connected)
-            {
-                Client.Log("Ignoring RequestLogout(), client is already logged out", Helpers.LogLevel.Warning);
-                return;
-            }
-
-            Client.Log("Logging out", Helpers.LogLevel.Info);
-
-            // Send a logout request to the current sim
-            LogoutRequestPacket logout = new LogoutRequestPacket();
-            logout.AgentData.AgentID = Client.Self.AgentID;
-            logout.AgentData.SessionID = Client.Self.SessionID;
-            CurrentSim.SendPacket(logout, true);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="sim"></param>
-        public void DisconnectSim(Simulator sim, bool sendCloseCircuit)
-        {
-            if (sim != null)
-            {
-                sim.Disconnect(sendCloseCircuit);
-
-                // Fire the SimDisconnected event if a handler is registered
-                if (OnSimDisconnected != null)
-                {
-                    try { OnSimDisconnected(sim, DisconnectType.NetworkTimeout); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-
-                lock (Simulators) Simulators.Remove(sim);
-
-                if (Simulators.Count == 0) Shutdown(DisconnectType.SimShutdown);
-            }
-            else
-            {
-                Client.Log("DisconnectSim() called with a null Simulator reference", Helpers.LogLevel.Warning);
-            }
-        }
-
-        /// <summary>
-        /// Shutdown will disconnect all the sims except for the current sim
-        /// first, and then kill the connection to CurrentSim. This should only
-        /// be called if the logout process times out on <code>RequestLogout</code>
-        /// </summary>
-        public void Shutdown(DisconnectType type)
-        {
-            Client.Log("NetworkManager shutdown initiated", Helpers.LogLevel.Info);
-
-            // Send a CloseCircuit packet to simulators if we are initiating the disconnect
-            bool sendCloseCircuit = (type == DisconnectType.ClientInitiated || type == DisconnectType.NetworkTimeout);
-
-            lock (Simulators)
-            {
-                // Disconnect all simulators except the current one
-                for (int i = 0; i < Simulators.Count; i++)
-                {
-                    if (Simulators[i] != null && Simulators[i] != CurrentSim)
-                    {
-                        Simulators[i].Disconnect(sendCloseCircuit);
-
-                        // Fire the SimDisconnected event if a handler is registered
-                        if (OnSimDisconnected != null)
-                        {
-                            try { OnSimDisconnected(Simulators[i], type); }
-                            catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                        }
-                    }
-                }
-
-                Simulators.Clear();
-            }
-
-            if (CurrentSim != null)
-            {
-                // Kill the connection to the curent simulator
-                CurrentSim.Disconnect(sendCloseCircuit);
-
-                // Fire the SimDisconnected event if a handler is registered
-                if (OnSimDisconnected != null)
-                {
-                    try { OnSimDisconnected(CurrentSim, type); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-
-            // Clear out all of the packets that never had time to process
-            PacketInbox.Close();
-
-            connected = false;
-
-            // Fire the disconnected callback
-            if (OnDisconnected != null)
-            {
-                try { OnDisconnected(DisconnectType.ClientInitiated, String.Empty); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        /// <summary>
-        /// Searches through the list of currently connected simulators to find
-        /// one attached to the given IPEndPoint
-        /// </summary>
-        /// <param name="endPoint">IPEndPoint of the Simulator to search for</param>
-        /// <returns>A Simulator reference on success, otherwise null</returns>
-        public Simulator FindSimulator(IPEndPoint endPoint)
-        {
-            lock (Simulators)
-            {
-                for (int i = 0; i < Simulators.Count; i++)
-                {
-                    if (Simulators[i].IPEndPoint.Equals(endPoint))
-                        return Simulators[i];
-                }
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// Fire an event when an event queue connects for capabilities
-        /// </summary>
-        /// <param name="simulator">Simulator the event queue is attached to</param>
-        internal void RaiseConnectedEvent(Simulator simulator)
-        {
-            if (OnEventQueueRunning != null)
-            {
-                try { OnEventQueueRunning(simulator); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void PacketHandler()
-        {
-            IncomingPacket incomingPacket = new IncomingPacket();
-            Packet packet = null;
-            Simulator simulator = null;
-
-            while (connected)
-            {
-                // Reset packet to null for the check below
-                packet = null;
-
-                if (PacketInbox.Dequeue(200, ref incomingPacket))
-                {
-                    packet = incomingPacket.Packet;
-                    simulator = incomingPacket.Simulator;
-
-                    if (packet != null)
-                    {
-                        // Skip the ACK handling on packets synthesized from CAPS messages
-                        if (packet.Header.Sequence != 0)
-                        {
-                            #region ACK accounting
-                            // TODO: Replace PacketArchive Queue<> with something more efficient
-
-                            // Check the archives to see whether we already received this packet
-                            lock (simulator.PacketArchive)
-                            {
-                                if (simulator.PacketArchive.Contains(packet.Header.Sequence))
-                                {
-                                    if (packet.Header.Resent)
-                                    {
-                                        Client.DebugLog("Received resent packet #" + packet.Header.Sequence);
-                                    }
-                                    else
-                                    {
-                                        Client.Log(String.Format("Received a duplicate of packet #{0}, current type: {1}",
-                                            packet.Header.Sequence, packet.Type), Helpers.LogLevel.Warning);
-                                    }
-
-                                    // Avoid firing a callback twice for the same packet
-                                    continue;
-                                }
-                                else
-                                {
-                                    // Keep the PacketArchive size within a certain capacity
-                                    while (simulator.PacketArchive.Count >= Settings.PACKET_ARCHIVE_SIZE)
-                                    {
-                                        simulator.PacketArchive.Dequeue(); simulator.PacketArchive.Dequeue();
-                                        simulator.PacketArchive.Dequeue(); simulator.PacketArchive.Dequeue();
-                                    }
-
-                                    simulator.PacketArchive.Enqueue(packet.Header.Sequence);
-                                }
-                            }
-
-                            #endregion ACK accounting
-
-                            #region ACK handling
-
-                            // Handle appended ACKs
-                            if (packet.Header.AppendedAcks)
-                            {
-                                lock (simulator.NeedAck)
-                                {
-                                    for (int i = 0; i < packet.Header.AckList.Length; i++)
-                                        simulator.NeedAck.Remove(packet.Header.AckList[i]);
-                                }
-                            }
-
-                            // Handle PacketAck packets
-                            if (packet.Type == PacketType.PacketAck)
-                            {
-                                PacketAckPacket ackPacket = (PacketAckPacket)packet;
-
-                                lock (simulator.NeedAck)
-                                {
-                                    for (int i = 0; i < ackPacket.Packets.Length; i++)
-                                        simulator.NeedAck.Remove(ackPacket.Packets[i].ID);
-                                }
-                            }
-
-                            #endregion ACK handling
-                        }
-
-                        #region FireCallbacks
-
-                        if (Client.Settings.SYNC_PACKETCALLBACKS)
-                        {
-                            PacketEvents.RaiseEvent(PacketType.Default, packet, simulator);
-                            PacketEvents.RaiseEvent(packet.Type, packet, simulator);
-                        }
-                        else
-                        {
-                            PacketEvents.BeginRaiseEvent(PacketType.Default, packet, simulator);
-                            PacketEvents.BeginRaiseEvent(packet.Type, packet, simulator);
-                        }
-
-                        #endregion FireCallbacks
-                    }
-                }
-            }
-        }
-
-        private void SetCurrentSim(Simulator simulator, string seedcaps)
-        {
-            if (simulator != CurrentSim)
-            {
-                Simulator oldSim = CurrentSim;
-                lock (Simulators) CurrentSim = simulator; // CurrentSim is synchronized against Simulators
-
-		        simulator.SetSeedCaps(seedcaps);
-
-                // If the current simulator changed fire the callback
-                if (OnCurrentSimChanged != null && simulator != oldSim)
-                {
-                    try { OnCurrentSimChanged(oldSim); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        #region Timers
-
-        private void DisconnectTimer_Elapsed(object obj)
-        {
-            if (!connected || CurrentSim == null)
-            {
-                if (DisconnectTimer != null) DisconnectTimer.Dispose();
-                connected = false;
-            }
-            else if (CurrentSim.DisconnectCandidate)
-            {
-                // The currently occupied simulator hasn't sent us any traffic in a while, shutdown
-                Client.Log("Network timeout for the current simulator (" +
-                    CurrentSim.ToString() + "), logging out", Helpers.LogLevel.Warning);
-
-                if (DisconnectTimer != null) DisconnectTimer.Dispose();
-                connected = false;
-
-                // Shutdown the network layer
-                Shutdown(DisconnectType.NetworkTimeout);
-            }
-            else
-            {
-                #region Check for timed out simulators
-
-                // Figure out which sims need to be disconnected, then fire
-                // all of the events to avoid calling DisconnectSim() inside
-                // the Simulators lock
-                List<Simulator> disconnectedSims = null;
-
-                // Check all of the connected sims for disconnects
-                lock (Simulators)
-                {
-                    for (int i = 0; i < Simulators.Count; i++)
-                    {
-                        if (Simulators[i].DisconnectCandidate)
-                        {
-                            // Avoid initializing a new List<> every time the timer
-                            // fires with this piece of code
-                            if (disconnectedSims == null)
-                                disconnectedSims = new List<Simulator>();
-
-                            disconnectedSims.Add(Simulators[i]);
-                        }
-                        else
-                        {
-                            Simulators[i].DisconnectCandidate = true;
-                        }
-                    }
-                }
-
-                // Actually disconnect each sim we detected as disconnected
-                if (disconnectedSims != null)
-                {
-                    for (int i = 0; i < disconnectedSims.Count; i++)
-                    {
-                        if (disconnectedSims[i] != null)
-                        {
-                            // This sim hasn't received any network traffic since the
-                            // timer last elapsed, consider it disconnected
-                            Client.Log("Network timeout for simulator " + disconnectedSims[i].ToString() +
-                                ", disconnecting", Helpers.LogLevel.Warning);
-
-                            DisconnectSim(disconnectedSims[i], true);
-                        }
-                    }
-                }
-
-                #endregion Check for timed out simulators
-            }
-        }
-
-        #endregion Timers
-
-        #region Packet Callbacks
-
-        /// <summary>
-        /// Called to deal with LogoutReply packet and fires off callback
-        /// </summary>
-        /// <param name="packet">Full packet of type LogoutReplyPacket</param>
-        /// <param name="simulator"></param>
-        private void LogoutReplyHandler(Packet packet, Simulator simulator)
-        {
-            LogoutReplyPacket logout = (LogoutReplyPacket)packet;
-
-            if ((logout.AgentData.SessionID == Client.Self.SessionID) && (logout.AgentData.AgentID == Client.Self.AgentID))
-            {
-                Client.DebugLog("Logout reply received");
-
-                // Deal with callbacks, if any
-                if (OnLogoutReply != null)
-                {
-                    List<LLUUID> itemIDs = new List<LLUUID>();
-
-                    foreach (LogoutReplyPacket.InventoryDataBlock InventoryData in logout.InventoryData)
-                    {
-                        itemIDs.Add(InventoryData.ItemID);
-                    }
-
-                    try { OnLogoutReply(itemIDs); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-
-                // If we are receiving a LogoutReply packet assume this is a client initiated shutdown
-                Shutdown(DisconnectType.ClientInitiated);
-            }
-            else
-            {
-                Client.Log("Invalid Session or Agent ID received in Logout Reply... ignoring", Helpers.LogLevel.Warning);
-            }
-        }
-
-        private void StartPingCheckHandler(Packet packet, Simulator simulator)
-        {
-            StartPingCheckPacket incomingPing = (StartPingCheckPacket)packet;
-            CompletePingCheckPacket ping = new CompletePingCheckPacket();
-            ping.PingID.PingID = incomingPing.PingID.PingID;
-            ping.Header.Reliable = false;
-            // TODO: We can use OldestUnacked to correct transmission errors
-            //   I don't think that's right.  As far as I can tell, the Viewer
-            //   only uses this to prune its duplicate-checking buffer. -bushing
-
-            SendPacket(ping, simulator);
-        }
-
-        private void PongHandler(Packet packet, Simulator simulator)
-        {
-            CompletePingCheckPacket pong = (CompletePingCheckPacket)packet;
-            String retval = "Pong2: " + (Environment.TickCount - simulator.Stats.LastPingSent);
-            if ((pong.PingID.PingID - simulator.Stats.LastPingID + 1) != 0)
-                retval += " (gap of " + (pong.PingID.PingID - simulator.Stats.LastPingID + 1) + ")";
-
-            simulator.Stats.LastLag = Environment.TickCount - simulator.Stats.LastPingSent;
-            simulator.Stats.ReceivedPongs++;
-            //			Client.Log(retval, Helpers.LogLevel.Info);
-        }
-
-		private void SimStatsHandler(Packet packet, Simulator simulator)
-		{
-			if ( ! Client.Settings.ENABLE_SIMSTATS ) {
-				return;
-			}
-			SimStatsPacket stats = (SimStatsPacket)packet;
-			for ( int i = 0 ; i < stats.Stat.Length ; i++ ) {
-				SimStatsPacket.StatBlock s = stats.Stat[i];
-				switch (s.StatID )
-				{
-					case 0:
-                        simulator.Stats.Dilation = s.StatValue;
-						break;
-					case 1:
-                        simulator.Stats.FPS = Convert.ToInt32(s.StatValue);
-						break;
-					case 2:
-                        simulator.Stats.PhysicsFPS = s.StatValue;
-						break;
-					case 3:
-                        simulator.Stats.AgentUpdates = s.StatValue;
-						break;
-					case 4:
-                        simulator.Stats.FrameTime = s.StatValue;
-						break;
-					case 5:
-                        simulator.Stats.NetTime = s.StatValue;
-						break;
-					case 7:
-                        simulator.Stats.PhysicsTime = s.StatValue;
-						break;
-					case 8:
-                        simulator.Stats.ImageTime = s.StatValue;
-						break;
-					case 9:
-                        simulator.Stats.ScriptTime = s.StatValue;
-						break;
-					case 10:
-                        simulator.Stats.OtherTime = s.StatValue;
-						break;
-					case 11:
-                        simulator.Stats.Objects = Convert.ToInt32(s.StatValue);
-						break;
-					case 12:
-                        simulator.Stats.ScriptedObjects = Convert.ToInt32(s.StatValue);
-						break;
-					case 13:
-                        simulator.Stats.Agents = Convert.ToInt32(s.StatValue);
-						break;
-					case 14:
-                        simulator.Stats.ChildAgents = Convert.ToInt32(s.StatValue);
-						break;
-					case 15:
-                        simulator.Stats.ActiveScripts = Convert.ToInt32(s.StatValue);
-						break;
-					case 16:
-                        simulator.Stats.LSLIPS = Convert.ToInt32(s.StatValue);
-						break;
-					case 17:
-                        simulator.Stats.INPPS = Convert.ToInt32(s.StatValue);
-						break;
-					case 18:
-                        simulator.Stats.OUTPPS = Convert.ToInt32(s.StatValue);
-						break;
-					case 19:
-                        simulator.Stats.PendingDownloads = Convert.ToInt32(s.StatValue);
-						break;
-					case 20:
-                        simulator.Stats.PendingUploads = Convert.ToInt32(s.StatValue);
-						break;
-					case 21:
-                        simulator.Stats.VirtualSize = Convert.ToInt32(s.StatValue);
-						break;
-					case 22:
-                        simulator.Stats.ResidentSize = Convert.ToInt32(s.StatValue);
-						break;
-					case 23:
-                        simulator.Stats.PendingLocalUploads = Convert.ToInt32(s.StatValue);
-						break;
-					case 24:
-                        simulator.Stats.UnackedBytes = Convert.ToInt32(s.StatValue);
-						break;
-				}
-			}
-		}
-
-        private void RegionHandshakeHandler(Packet packet, Simulator simulator)
-        {
-            RegionHandshakePacket handshake = (RegionHandshakePacket)packet;
-
-            simulator.ID = handshake.RegionInfo.CacheID;
-
-            simulator.IsEstateManager = handshake.RegionInfo.IsEstateManager;
-            simulator.Name = Helpers.FieldToUTF8String(handshake.RegionInfo.SimName);
-            simulator.SimOwner = handshake.RegionInfo.SimOwner;
-            simulator.TerrainBase0 = handshake.RegionInfo.TerrainBase0;
-            simulator.TerrainBase1 = handshake.RegionInfo.TerrainBase1;
-            simulator.TerrainBase2 = handshake.RegionInfo.TerrainBase2;
-            simulator.TerrainBase3 = handshake.RegionInfo.TerrainBase3;
-            simulator.TerrainDetail0 = handshake.RegionInfo.TerrainDetail0;
-            simulator.TerrainDetail1 = handshake.RegionInfo.TerrainDetail1;
-            simulator.TerrainDetail2 = handshake.RegionInfo.TerrainDetail2;
-            simulator.TerrainDetail3 = handshake.RegionInfo.TerrainDetail3;
-            simulator.TerrainHeightRange00 = handshake.RegionInfo.TerrainHeightRange00;
-            simulator.TerrainHeightRange01 = handshake.RegionInfo.TerrainHeightRange01;
-            simulator.TerrainHeightRange10 = handshake.RegionInfo.TerrainHeightRange10;
-            simulator.TerrainHeightRange11 = handshake.RegionInfo.TerrainHeightRange11;
-            simulator.TerrainStartHeight00 = handshake.RegionInfo.TerrainStartHeight00;
-            simulator.TerrainStartHeight01 = handshake.RegionInfo.TerrainStartHeight01;
-            simulator.TerrainStartHeight10 = handshake.RegionInfo.TerrainStartHeight10;
-            simulator.TerrainStartHeight11 = handshake.RegionInfo.TerrainStartHeight11;
-            simulator.WaterHeight = handshake.RegionInfo.WaterHeight;
-            simulator.Flags = (Simulator.RegionFlags)handshake.RegionInfo.RegionFlags;
-            simulator.BillableFactor = handshake.RegionInfo.BillableFactor;
-            simulator.Access = (Simulator.SimAccess)handshake.RegionInfo.SimAccess;
-
-            Client.Log("Received a region handshake for " + simulator.ToString(), Helpers.LogLevel.Info);
-
-            // Send a RegionHandshakeReply
-            RegionHandshakeReplyPacket reply = new RegionHandshakeReplyPacket();
-            reply.AgentData.AgentID = Client.Self.AgentID;
-            reply.AgentData.SessionID = Client.Self.SessionID;
-            reply.RegionInfo.Flags = 0;
-            SendPacket(reply, simulator);
-
-            // We're officially connected to this sim
-            simulator.connected = true;
-            simulator.ConnectedEvent.Set();
-        }
-
-        private void ParcelOverlayHandler(Packet packet, Simulator simulator)
-        {
-            ParcelOverlayPacket overlay = (ParcelOverlayPacket)packet;
-
-            if (overlay.ParcelData.SequenceID >= 0 && overlay.ParcelData.SequenceID <= 3)
-            {
-                Buffer.BlockCopy(overlay.ParcelData.Data, 0, simulator.ParcelOverlay,
-                    overlay.ParcelData.SequenceID * 1024, 1024);
-                simulator.ParcelOverlaysReceived++;
-
-                if (simulator.ParcelOverlaysReceived > 3)
-                {
-                    // TODO: ParcelOverlaysReceived should become internal, and reset to zero every
-                    // time it hits four. Also need a callback here
-                }
-            }
-            else
-            {
-                Client.Log("Parcel overlay with sequence ID of " + overlay.ParcelData.SequenceID +
-                    " received from " + simulator.ToString(), Helpers.LogLevel.Warning);
-            }
-        }
-
-        private void EnableSimulatorHandler(Packet packet, Simulator simulator)
-        {
-            if (!Client.Settings.MULTIPLE_SIMS) return;
-
-            EnableSimulatorPacket p = (EnableSimulatorPacket)packet;
-            IPEndPoint endPoint = new IPEndPoint(p.SimulatorInfo.IP, p.SimulatorInfo.Port);
-
-            // First, check to see if we've already started connecting to this sim
-            if (FindSimulator(endPoint) != null) return;
-
-            IPAddress address = new IPAddress(p.SimulatorInfo.IP);
-            if (Connect(address, p.SimulatorInfo.Port, p.SimulatorInfo.Handle, false, LoginSeedCapability) == null)
-            {
-                Client.Log("Unabled to connect to new sim " + address + ":" + p.SimulatorInfo.Port,
-                    Helpers.LogLevel.Error);
-                return;
-            }
-        }
-
-        private void DisableSimulatorHandler(Packet packet, Simulator simulator)
-        {
-            Client.DebugLog("Received a DisableSimulator packet from " + simulator + ", shutting it down");
-
-            DisconnectSim(simulator, false);
-        }
-
-        private void KickUserHandler(Packet packet, Simulator simulator)
-        {
-            string message = Helpers.FieldToUTF8String(((KickUserPacket)packet).UserInfo.Reason);
-
-            // Fire the callback to let client apps know we are shutting down
-            if (OnDisconnected != null)
-            {
-                try { OnDisconnected(DisconnectType.ServerInitiated, message); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-
-            // Shutdown the network layer
-            Shutdown(DisconnectType.ServerInitiated);
-        }
-
-        #endregion Packet Callbacks
-    }
-}
diff --git a/old/libsl1550/libsecondlife/ObjectManager.cs b/old/libsl1550/libsecondlife/ObjectManager.cs
deleted file mode 100644
index 0f36e9c..0000000
--- a/old/libsl1550/libsecondlife/ObjectManager.cs
+++ /dev/null
@@ -1,2461 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    #region Enums
-
-    /// <summary>
-    /// Identifier code for object types
-    /// </summary>
-    public enum PCode : byte
-    {
-        /// <summary></summary>
-        None = 0,
-        /// <summary></summary>
-        Prim = 9,
-        /// <summary></summary>
-        Avatar = 47,
-        /// <summary></summary>
-        Grass = 95,
-        /// <summary></summary>
-        NewTree = 111,
-        /// <summary></summary>
-        ParticleSystem = 143,
-        /// <summary></summary>
-        Tree = 255
-    }
-
-    /// <summary>
-    /// Attachment points for objects on avatar bodies
-    /// </summary>
-    public enum AttachmentPoint : byte
-    {
-        /// <summary></summary>
-        Default = 0,
-        /// <summary></summary>
-        Chest = 1,
-        /// <summary></summary>
-        Skull,
-        /// <summary></summary>
-        LeftShoulder,
-        /// <summary></summary>
-        RightShoulder,
-        /// <summary></summary>
-        LeftHand,
-        /// <summary></summary>
-        RightHand,
-        /// <summary></summary>
-        LeftFoot,
-        /// <summary></summary>
-        RightFoot,
-        /// <summary></summary>
-        Spine,
-        /// <summary></summary>
-        Pelvis,
-        /// <summary></summary>
-        Mouth,
-        /// <summary></summary>
-        Chin,
-        /// <summary></summary>
-        LeftEar,
-        /// <summary></summary>
-        RightEar,
-        /// <summary></summary>
-        LeftEyeball,
-        /// <summary></summary>
-        RightEyeball,
-        /// <summary></summary>
-        Nose,
-        /// <summary></summary>
-        RightUpperArm,
-        /// <summary></summary>
-        RightForearm,
-        /// <summary></summary>
-        LeftUpperArm,
-        /// <summary></summary>
-        LeftForearm,
-        /// <summary></summary>
-        RightHip,
-        /// <summary></summary>
-        RightUpperLeg,
-        /// <summary></summary>
-        RightLowerLeg,
-        /// <summary></summary>
-        LeftHip,
-        /// <summary></summary>
-        LeftUpperLeg,
-        /// <summary></summary>
-        LeftLowerLeg,
-        /// <summary></summary>
-        Stomach,
-        /// <summary></summary>
-        LeftPec,
-        /// <summary></summary>
-        RightPec,
-        /// <summary></summary>
-        HUDCenter2,
-        /// <summary></summary>
-        HUDTopRight,
-        /// <summary></summary>
-        HUDTop,
-        /// <summary></summary>
-        HUDTopLeft,
-        /// <summary></summary>
-        HUDCenter,
-        /// <summary></summary>
-        HUDBottomLeft,
-        /// <summary></summary>
-        HUDBottom,
-        /// <summary></summary>
-        HUDBottomRight
-    }
-
-    /// <summary>
-    /// Bitflag field for ObjectUpdateCompressed data blocks, describing
-    /// which options are present for each object
-    /// </summary>
-    [Flags]
-    public enum CompressedFlags : uint
-    {
-        /// <summary>Hasn't been spotted in the wild yet</summary>
-        ScratchPad = 0x01,
-        /// <summary>This may be incorrect</summary>
-        Tree = 0x02,
-        /// <summary>Whether the object has floating text ala llSetText</summary>
-        HasText = 0x04,
-        /// <summary>Whether the object has an active particle system</summary>
-        HasParticles = 0x08,
-        /// <summary>Whether the object has sound attached to it</summary>
-        HasSound = 0x10,
-        /// <summary>Whether the object is attached to a root object or not</summary>
-        HasParent = 0x20,
-        /// <summary>Whether the object has texture animation settings</summary>
-        TextureAnimation = 0x40,
-        /// <summary>Whether the object has an angular velocity</summary>
-        HasAngularVelocity = 0x80,
-        /// <summary>Whether the object has a name value pairs string</summary>
-        HasNameValues = 0x100,
-        /// <summary>Whether the object has a Media URL set</summary>
-        MediaURL = 0x200
-    }
-
-    /// <summary>
-    /// Tree foliage types
-    /// </summary>
-    public enum Tree : byte
-    {
-        /// <summary></summary>
-        Pine1 = 0,
-        /// <summary></summary>
-        Oak,
-        /// <summary></summary>
-        TropicalBush1,
-        /// <summary></summary>
-        Palm1,
-        /// <summary></summary>
-        Dogwood,
-        /// <summary></summary>
-        TropicalBush2,
-        /// <summary></summary>
-        Palm2,
-        /// <summary></summary>
-        Cypress1,
-        /// <summary></summary>
-        Cypress2,
-        /// <summary></summary>
-        Pine2,
-        /// <summary></summary>
-        Plumeria,
-        /// <summary></summary>
-        WinterPine1,
-        /// <summary></summary>
-        WinterAspen,
-        /// <summary></summary>
-        WinterPine2,
-        /// <summary></summary>
-        Eucalyptus,
-        /// <summary></summary>
-        Fern,
-        /// <summary></summary>
-        Eelgrass,
-        /// <summary></summary>
-        SeaSword,
-        /// <summary></summary>
-        Kelp1,
-        /// <summary></summary>
-        BeachGrass1,
-        /// <summary></summary>
-        Kelp2
-    }
-
-    /// <summary>
-    /// Grass foliage types
-    /// </summary>
-    public enum Grass : byte
-    {
-        /// <summary></summary>
-        Grass0 = 0,
-        /// <summary></summary>
-        Grass1,
-        /// <summary></summary>
-        Grass2,
-        /// <summary></summary>
-        Grass3,
-        /// <summary></summary>
-        Grass4,
-        /// <summary></summary>
-        Undergrowth1
-    }
-
-    /// <summary>
-    /// Action associated with clicking on an object
-    /// </summary>
-    public enum ClickAction : byte
-    {
-        /// <summary></summary>
-        Touch = 0,
-        /// <summary></summary>
-        Sit = 1,
-        /// <summary></summary>
-        Buy = 2
-    }
-
-    #endregion Enums
-
-    #region Structs
-
-    /// <summary>
-    /// Contains the variables sent in an object update packet for objects.
-    /// Used to track position and movement of prims and avatars
-    /// </summary>
-    public struct ObjectUpdate
-    {
-        /// <summary></summary>
-        public bool Avatar;
-        /// <summary></summary>
-        public LLVector4 CollisionPlane;
-        /// <summary></summary>
-        public byte State;
-        /// <summary></summary>
-        public uint LocalID;
-        /// <summary></summary>
-        public LLVector3 Position;
-        /// <summary></summary>
-        public LLVector3 Velocity;
-        /// <summary></summary>
-        public LLVector3 Acceleration;
-        /// <summary></summary>
-        public LLQuaternion Rotation;
-        /// <summary></summary>
-        public LLVector3 AngularVelocity;
-        /// <summary></summary>
-        public LLObject.TextureEntry Textures;
-    }
-
-    #endregion Structs
-
-    /// <summary>
-    /// Handles all network traffic related to prims and avatar positions and
-    /// movement.
-    /// </summary>
-    public class ObjectManager
-    {
-        public const float HAVOK_TIMESTEP = 1.0f / 45.0f;
-
-        #region Delegates
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="prim"></param>
-        /// <param name="regionHandle"></param>
-        /// <param name="timeDilation"></param>
-        public delegate void NewPrimCallback(Simulator simulator, Primitive prim, ulong regionHandle,
-            ushort timeDilation);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="prim"></param>
-        /// <param name="regionHandle"></param>
-        /// <param name="timeDilation"></param>
-        public delegate void NewAttachmentCallback(Simulator simulator, Primitive prim, ulong regionHandle,
-            ushort timeDilation);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="properties"></param>
-        public delegate void ObjectPropertiesCallback(Simulator simulator, LLObject.ObjectProperties properties);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="properties"></param>
-        public delegate void ObjectPropertiesFamilyCallback(Simulator simulator,
-            LLObject.ObjectPropertiesFamily properties);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="avatar"></param>
-        /// <param name="regionHandle"></param>
-        /// <param name="timeDilation"></param>
-        public delegate void NewAvatarCallback(Simulator simulator, Avatar avatar, ulong regionHandle,
-            ushort timeDilation);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="foliage"></param>
-        /// <param name="regionHandle"></param>
-        /// <param name="timeDilation"></param>
-        public delegate void NewFoliageCallback(Simulator simulator, Primitive foliage, ulong regionHandle,
-            ushort timeDilation);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="update"></param>
-        /// <param name="regionHandle"></param>
-        /// <param name="timeDilation"></param>
-        public delegate void ObjectUpdatedCallback(Simulator simulator, ObjectUpdate update, ulong regionHandle,
-            ushort timeDilation);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="objectID"></param>
-        public delegate void KillObjectCallback(Simulator simulator, uint objectID);
-        /// <summary>
-        /// Called whenever the client avatar sits down or stands up
-        /// </summary>
-        /// <param name="simulator">Simulator the packet was received from</param>
-        /// <param name="sittingOn">The local ID of the object that is being sat
-        /// on. If this is zero the avatar is not sitting on an object</param>
-        public delegate void AvatarSitChanged(Simulator simulator, Avatar avatar, uint sittingOn, uint oldSeat);
-
-        #endregion Delegates
-
-        #region Events
-
-        /// <summary>
-        /// This event will be raised for every ObjectUpdate block that
-        /// contains a prim that isn't attached to an avatar.
-        /// </summary>
-        /// <remarks>Depending on the circumstances a client could
-        /// receive two or more of these events for the same object, if you
-        /// or the object left the current sim and returned for example. Client
-        /// applications are responsible for tracking and storing objects.
-        /// </remarks>
-        public event NewPrimCallback OnNewPrim;
-        /// <summary>
-        /// This event will be raised for every ObjectUpdate block that
-        /// contains an avatar attachment.
-        /// </summary>
-        /// <remarks>Depending on the circumstances a client could
-        /// receive two or more of these events for the same object, if you
-        /// or the object left the current sim and returned for example. Client
-        /// applications are responsible for tracking and storing objects.
-        /// </remarks>
-        public event NewAttachmentCallback OnNewAttachment;
-        /// <summary>
-        /// This event will be raised for every ObjectUpdate block that
-        /// contains a new avatar.
-        /// </summary>
-        /// <remarks>Depending on the circumstances a client
-        /// could receive two or more of these events for the same avatar, if
-        /// you or the other avatar left the current sim and returned for
-        /// example. Client applications are responsible for tracking and
-        /// storing objects.
-        /// </remarks>
-        public event NewAvatarCallback OnNewAvatar;
-        /// <summary>
-        /// This event will be raised for every ObjectUpdate block that
-        /// contains a new tree or grass patch.
-        /// </summary>
-        /// <remarks>Depending on the circumstances a client could
-        /// receive two or more of these events for the same object, if you
-        /// or the object left the current sim and returned for example. Client
-        /// applications are responsible for tracking and storing objects.
-        /// </remarks>
-        public event NewFoliageCallback OnNewFoliage;
-        /// <summary>
-        /// This event will be raised when a terse object update packet is
-        /// received, containing the updated position, rotation, and
-        /// movement-related vectors
-        /// </summary>
-        public event ObjectUpdatedCallback OnObjectUpdated;
-        /// <summary>
-        /// This event will be raised when an avatar sits on an object
-        /// or stands up, with a local ID of the current seat or zero.
-        /// </summary>
-        public event AvatarSitChanged OnAvatarSitChanged;
-        /// <summary>
-        /// This event will be raised when an object is removed from a
-        /// simulator.
-        /// </summary>
-        public event KillObjectCallback OnObjectKilled;
-        /// <summary>
-        /// This event will be raised when an objects properties are received
-        /// from the simulator
-        /// </summary>
-        public event ObjectPropertiesCallback OnObjectProperties;
-        /// <summary>
-        /// Thie event will be raised when an objects properties family
-        /// information is recieved from the simulator. ObjectPropertiesFamily
-        /// is a subset of the fields found in ObjectProperties
-        /// </summary>
-        public event ObjectPropertiesFamilyCallback OnObjectPropertiesFamily;
-
-        #endregion
-
-        /// <summary>Reference to the SecondLife client</summary>
-        protected SecondLife Client;
-        /// <summary>Does periodic dead reckoning calculation to convert
-        /// velocity and acceleration to new positions for objects</summary>
-        private Timer InterpolationTimer;
-
-        /// <summary>
-        /// Instantiates a new ObjectManager class. This class should only be accessed
-        /// through SecondLife.Objects, client applications should never create their own
-        /// </summary>
-        /// <param name="client">A reference to the client</param>
-        public ObjectManager(SecondLife client)
-        {
-            Client = client;
-            RegisterCallbacks();
-        }
-
-        /// <summary>
-        /// Instantiates a new ObjectManager class. This class should only be
-        /// accessed through SecondLife.Objects, client applications should
-        /// never create their own
-        /// </summary>
-        /// <param name="client">A reference to the client</param>
-        /// <param name="registerCallbacks">If false, the ObjectManager won't
-        /// register any packet callbacks and won't decode incoming object
-        /// packets</param>
-        protected ObjectManager(SecondLife client, bool registerCallbacks)
-        {
-            Client = client;
-
-            if (registerCallbacks)
-            {
-                RegisterCallbacks();
-            }
-        }
-
-        protected void RegisterCallbacks()
-        {
-            Client.Network.RegisterCallback(PacketType.ObjectUpdate, new NetworkManager.PacketCallback(UpdateHandler));
-            Client.Network.RegisterCallback(PacketType.ImprovedTerseObjectUpdate, new NetworkManager.PacketCallback(TerseUpdateHandler));
-            Client.Network.RegisterCallback(PacketType.ObjectUpdateCompressed, new NetworkManager.PacketCallback(CompressedUpdateHandler));
-            Client.Network.RegisterCallback(PacketType.ObjectUpdateCached, new NetworkManager.PacketCallback(CachedUpdateHandler));
-            Client.Network.RegisterCallback(PacketType.KillObject, new NetworkManager.PacketCallback(KillObjectHandler));
-            Client.Network.RegisterCallback(PacketType.ObjectPropertiesFamily, new NetworkManager.PacketCallback(ObjectPropertiesFamilyHandler));
-            Client.Network.RegisterCallback(PacketType.ObjectProperties, new NetworkManager.PacketCallback(ObjectPropertiesHandler));
-
-            // If the callbacks aren't registered there's not point in doing client-side path prediction,
-            // so we set it up here
-            InterpolationTimer = new Timer(new TimerCallback(InterpolationTimer_Elapsed), null, Settings.INTERPOLATION_INTERVAL,
-                Settings.INTERPOLATION_INTERVAL);
-        }
-
-        #region Action Methods
-
-        /// <summary>
-        /// Request object information from the sim, primarily used for stale
-        /// or missing cache entries
-        /// </summary>
-        /// <param name="simulator">The simulator containing the object you're
-        /// looking for</param>
-        /// <param name="localID">The local ID of the object</param>
-        public void RequestObject(Simulator simulator, uint localID)
-        {
-            RequestMultipleObjectsPacket request = new RequestMultipleObjectsPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.ObjectData = new RequestMultipleObjectsPacket.ObjectDataBlock[1];
-            request.ObjectData[0] = new RequestMultipleObjectsPacket.ObjectDataBlock();
-            request.ObjectData[0].ID = localID;
-            request.ObjectData[0].CacheMissType = 0;
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        /// Request object information for multiple objects all contained in
-        /// the same sim, primarily used for stale or missing cache entries
-        /// </summary>
-        /// <param name="simulator">The simulator containing the object you're
-        /// looking for</param>
-        /// <param name="localIDs">A list of local IDs of the objects</param>
-        public void RequestObjects(Simulator simulator, List<uint> localIDs)
-        {
-            int i = 0;
-
-            RequestMultipleObjectsPacket request = new RequestMultipleObjectsPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.ObjectData = new RequestMultipleObjectsPacket.ObjectDataBlock[localIDs.Count];
-
-            foreach (uint localID in localIDs)
-            {
-                request.ObjectData[i] = new RequestMultipleObjectsPacket.ObjectDataBlock();
-                request.ObjectData[i].ID = localID;
-                request.ObjectData[i].CacheMissType = 0;
-
-                i++;
-            }
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        /// Attempt to purchase an original object, a copy, or the contents of
-        /// an object
-        /// </summary>
-        /// <param name="simulator">Simulator where the object resides</param>
-        /// <param name="localID">Sim-local ID of the object</param>
-        /// <param name="saleType">Whether the original, a copy, or the object
-        /// contents are on sale. This is used for verification, if the this
-        /// sale type is not valid for the object the purchase will fail</param>
-        /// <param name="price">Price of the object. This is used for
-        /// verification, if it does not match the actual price the purchase
-        /// will fail</param>
-        /// <param name="groupID">Group ID that will be associated with the new
-        /// purchase</param>
-        /// <param name="categoryID">Inventory folder UUID where the purchase
-        /// should go</param>
-        /// <example>BuyObject(Client.Network.CurrentSim, 500, SaleType.Copy,
-        /// 100, LLUUID.Zero, Client.Self.InventoryRootFolderUUID);</example>
-        public void BuyObject(Simulator simulator, uint localID, SaleType saleType, int price, LLUUID groupID,
-            LLUUID categoryID)
-        {
-            ObjectBuyPacket buy = new ObjectBuyPacket();
-
-            buy.AgentData.AgentID = Client.Self.AgentID;
-            buy.AgentData.SessionID = Client.Self.SessionID;
-            buy.AgentData.GroupID = groupID;
-            buy.AgentData.CategoryID = categoryID;
-
-            buy.ObjectData = new ObjectBuyPacket.ObjectDataBlock[1];
-            buy.ObjectData[0] = new ObjectBuyPacket.ObjectDataBlock();
-            buy.ObjectData[0].ObjectLocalID = localID;
-            buy.ObjectData[0].SaleType = (byte)saleType;
-            buy.ObjectData[0].SalePrice = price;
-
-            Client.Network.SendPacket(buy, simulator);
-        }
-
-        /// <summary>
-        /// Select an object. This will trigger the simulator to send us back
-        /// an ObjectProperties packet so we can get the full information for
-        /// this object
-        /// </summary>
-        /// <param name="simulator">Simulator where the object resides</param>
-        /// <param name="localID">Sim-local ID of the object to select</param>
-        public void SelectObject(Simulator simulator, uint localID)
-        {
-            ObjectSelectPacket select = new ObjectSelectPacket();
-
-            select.AgentData.AgentID = Client.Self.AgentID;
-            select.AgentData.SessionID = Client.Self.SessionID;
-
-            select.ObjectData = new ObjectSelectPacket.ObjectDataBlock[1];
-            select.ObjectData[0] = new ObjectSelectPacket.ObjectDataBlock();
-            select.ObjectData[0].ObjectLocalID = localID;
-
-            Client.Network.SendPacket(select, simulator);
-        }
-
-        /// <summary>
-        /// Select multiple objects. This will trigger the simulator to send us
-        /// back ObjectProperties for each object
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localIDs"></param>
-        public void SelectObjects(Simulator simulator, uint[] localIDs)
-        {
-            ObjectSelectPacket select = new ObjectSelectPacket();
-
-            select.AgentData.AgentID = Client.Self.AgentID;
-            select.AgentData.SessionID = Client.Self.SessionID;
-
-            select.ObjectData = new ObjectSelectPacket.ObjectDataBlock[localIDs.Length];
-
-            for (int i = 0; i < localIDs.Length; i++)
-            {
-                select.ObjectData[i] = new ObjectSelectPacket.ObjectDataBlock();
-                select.ObjectData[i].ObjectLocalID = localIDs[i];
-            }
-
-            Client.Network.SendPacket(select, simulator);
-        }
-
-        public void DeselectObject(Simulator simulator, uint localID)
-        {
-            ObjectDeselectPacket deselect = new ObjectDeselectPacket();
-
-            deselect.AgentData.AgentID = Client.Self.AgentID;
-            deselect.AgentData.SessionID = Client.Self.SessionID;
-
-            deselect.ObjectData = new ObjectDeselectPacket.ObjectDataBlock[1];
-            deselect.ObjectData[0] = new ObjectDeselectPacket.ObjectDataBlock();
-            deselect.ObjectData[0].ObjectLocalID = localID;
-
-            Client.Network.SendPacket(deselect, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        public void ClickObject(Simulator simulator, uint localID)
-        {
-            ObjectGrabPacket grab = new ObjectGrabPacket();
-            grab.AgentData.AgentID = Client.Self.AgentID;
-            grab.AgentData.SessionID = Client.Self.SessionID;
-            grab.ObjectData.GrabOffset = LLVector3.Zero;
-            grab.ObjectData.LocalID = localID;
-
-            Client.Network.SendPacket(grab, simulator);
-
-            // TODO: If these hit the server out of order the click will fail
-            // and we'll be grabbing the object
-
-            ObjectDeGrabPacket degrab = new ObjectDeGrabPacket();
-            degrab.AgentData.AgentID = Client.Self.AgentID;
-            degrab.AgentData.SessionID = Client.Self.SessionID;
-            degrab.ObjectData.LocalID = localID;
-
-            Client.Network.SendPacket(degrab, simulator);
-        }
-
-        /// <summary>
-        /// Create, or "rez" a new prim object in a simulator
-        /// </summary>
-        /// <param name="simulator">The target simulator</param>
-        /// <param name="prim">Data describing the prim object to rez</param>
-        /// <param name="groupID">Group ID that this prim is set to, or LLUUID.Zero</param>
-        /// <param name="position">An approximation of the position at which to rez the prim</param>
-        /// <param name="scale">Scale vector to size this prim</param>
-        /// <param name="rotation">Rotation quaternion to rotate this prim</param>
-        /// <remarks>Due to the way client prim rezzing is done on the server,
-        /// the requested position for an object is only close to where the prim
-        /// actually ends up. If you desire exact placement you'll need to
-        /// follow up by moving the object after it has been created. This
-        /// function will not set textures, light and flexible data, or other
-        /// extended primitive properties</remarks>
-        public void AddPrim(Simulator simulator, LLObject.ObjectData prim, LLUUID groupID, LLVector3 position,
-            LLVector3 scale, LLQuaternion rotation)
-        {
-            ObjectAddPacket packet = new ObjectAddPacket();
-
-            packet.AgentData.AgentID = Client.Self.AgentID;
-            packet.AgentData.SessionID = Client.Self.SessionID;
-            packet.AgentData.GroupID = groupID;
-
-            packet.ObjectData.State = prim.State;
-            packet.ObjectData.AddFlags = (uint)LLObject.ObjectFlags.CreateSelected;
-            packet.ObjectData.PCode = (byte)PCode.Prim;
-
-            packet.ObjectData.Material = (byte)prim.Material;
-            packet.ObjectData.Scale = scale;
-            packet.ObjectData.Rotation = rotation;
-
-            packet.ObjectData.PathCurve = (byte)prim.PathCurve;
-            packet.ObjectData.PathBegin = LLObject.PackBeginCut(prim.PathBegin);
-            packet.ObjectData.PathEnd = LLObject.PackEndCut(prim.PathEnd);
-            packet.ObjectData.PathRadiusOffset = LLObject.PackPathTwist(prim.PathRadiusOffset);
-            packet.ObjectData.PathRevolutions = LLObject.PackPathRevolutions(prim.PathRevolutions);
-            packet.ObjectData.PathScaleX = LLObject.PackPathScale(prim.PathScaleX);
-            packet.ObjectData.PathScaleY = LLObject.PackPathScale(prim.PathScaleY);
-            packet.ObjectData.PathShearX = LLObject.PackPathShear(prim.PathShearX);
-            packet.ObjectData.PathShearY = LLObject.PackPathShear(prim.PathShearY);
-            packet.ObjectData.PathSkew = LLObject.PackPathTwist(prim.PathSkew);
-            packet.ObjectData.PathTaperX = LLObject.PackPathTaper(prim.PathTaperX);
-            packet.ObjectData.PathTaperY = LLObject.PackPathTaper(prim.PathTaperY);
-            packet.ObjectData.PathTwist = LLObject.PackPathTwist(prim.PathTwist);
-            packet.ObjectData.PathTwistBegin = LLObject.PackPathTwist(prim.PathTwistBegin);
-
-            packet.ObjectData.ProfileCurve = (byte)prim.ProfileCurve;
-            packet.ObjectData.ProfileBegin = LLObject.PackBeginCut(prim.ProfileBegin);
-            packet.ObjectData.ProfileEnd = LLObject.PackEndCut(prim.ProfileEnd);
-            packet.ObjectData.ProfileHollow = LLObject.PackProfileHollow(prim.ProfileHollow);
-
-            packet.ObjectData.RayStart = position;
-            packet.ObjectData.RayEnd = position;
-            packet.ObjectData.RayEndIsIntersection = 0;
-            packet.ObjectData.RayTargetID = LLUUID.Zero;
-            packet.ObjectData.BypassRaycast = 1;
-
-            Client.Network.SendPacket(packet, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="scale"></param>
-        /// <param name="rotation"></param>
-        /// <param name="position"></param>
-        /// <param name="treeType"></param>
-        /// <param name="groupOwner"></param>
-        /// <param name="newTree"></param>
-        public void AddTree(Simulator simulator, LLVector3 scale, LLQuaternion rotation, LLVector3 position,
-            Tree treeType, LLUUID groupOwner, bool newTree)
-        {
-            ObjectAddPacket add = new ObjectAddPacket();
-
-            add.AgentData.AgentID = Client.Self.AgentID;
-            add.AgentData.SessionID = Client.Self.SessionID;
-            add.AgentData.GroupID = groupOwner;
-            add.ObjectData.BypassRaycast = 1;
-            add.ObjectData.Material = 3;
-            add.ObjectData.PathCurve = 16;
-            add.ObjectData.PCode = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree;
-            add.ObjectData.RayEnd = position;
-            add.ObjectData.RayStart = position;
-            add.ObjectData.RayTargetID = LLUUID.Zero;
-            add.ObjectData.Rotation = rotation;
-            add.ObjectData.Scale = scale;
-            add.ObjectData.State = (byte)treeType;
-
-            Client.Network.SendPacket(add, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="scale"></param>
-        /// <param name="rotation"></param>
-        /// <param name="position"></param>
-        /// <param name="grassType"></param>
-        /// <param name="groupOwner"></param>
-        public void AddGrass(Simulator simulator, LLVector3 scale, LLQuaternion rotation, LLVector3 position,
-            Grass grassType, LLUUID groupOwner)
-        {
-            ObjectAddPacket add = new ObjectAddPacket();
-
-            add.AgentData.AgentID = Client.Self.AgentID;
-            add.AgentData.SessionID = Client.Self.SessionID;
-            add.AgentData.GroupID = groupOwner;
-            add.ObjectData.BypassRaycast = 1;
-            add.ObjectData.Material = 3;
-            add.ObjectData.PathCurve = 16;
-            add.ObjectData.PCode = (byte)PCode.Grass;
-            add.ObjectData.RayEnd = position;
-            add.ObjectData.RayStart = position;
-            add.ObjectData.RayTargetID = LLUUID.Zero;
-            add.ObjectData.Rotation = rotation;
-            add.ObjectData.Scale = scale;
-            add.ObjectData.State = (byte)grassType;
-
-            Client.Network.SendPacket(add, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="textures"></param>
-        public void SetTextures(Simulator simulator, uint localID, LLObject.TextureEntry textures)
-        {
-            SetTextures(simulator, localID, textures, String.Empty);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="textures"></param>
-        /// <param name="mediaUrl"></param>
-        public void SetTextures(Simulator simulator, uint localID, LLObject.TextureEntry textures, string mediaUrl)
-        {
-            ObjectImagePacket image = new ObjectImagePacket();
-
-            image.AgentData.AgentID = Client.Self.AgentID;
-            image.AgentData.SessionID = Client.Self.SessionID;
-            image.ObjectData = new ObjectImagePacket.ObjectDataBlock[1];
-            image.ObjectData[0] = new ObjectImagePacket.ObjectDataBlock();
-            image.ObjectData[0].ObjectLocalID = localID;
-            image.ObjectData[0].TextureEntry = textures.ToBytes();
-            image.ObjectData[0].MediaURL = Helpers.StringToField(mediaUrl);
-
-            Client.Network.SendPacket(image, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="light"></param>
-        public void SetLight(Simulator simulator, uint localID, Primitive.LightData light)
-        {
-            ObjectExtraParamsPacket extra = new ObjectExtraParamsPacket();
-
-            extra.AgentData.AgentID = Client.Self.AgentID;
-            extra.AgentData.SessionID = Client.Self.SessionID;
-            extra.ObjectData = new ObjectExtraParamsPacket.ObjectDataBlock[1];
-            extra.ObjectData[0] = new ObjectExtraParamsPacket.ObjectDataBlock();
-            extra.ObjectData[0].ObjectLocalID = localID;
-            extra.ObjectData[0].ParamType = (byte)Primitive.ExtraParamType.Light;
-            extra.ObjectData[0].ParamInUse = true;
-            extra.ObjectData[0].ParamData = light.GetBytes();
-            extra.ObjectData[0].ParamSize = (uint)extra.ObjectData[0].ParamData.Length;
-
-            Client.Network.SendPacket(extra, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="flexible"></param>
-        public void SetFlexible(Simulator simulator, uint localID, Primitive.FlexibleData flexible)
-        {
-            ObjectExtraParamsPacket extra = new ObjectExtraParamsPacket();
-
-            extra.AgentData.AgentID = Client.Self.AgentID;
-            extra.AgentData.SessionID = Client.Self.SessionID;
-            extra.ObjectData = new ObjectExtraParamsPacket.ObjectDataBlock[1];
-            extra.ObjectData[0] = new ObjectExtraParamsPacket.ObjectDataBlock();
-            extra.ObjectData[0].ObjectLocalID = localID;
-            extra.ObjectData[0].ParamType = (byte)Primitive.ExtraParamType.Flexible;
-            extra.ObjectData[0].ParamInUse = true;
-            extra.ObjectData[0].ParamData = flexible.GetBytes();
-            extra.ObjectData[0].ParamSize = (uint)extra.ObjectData[0].ParamData.Length;
-
-            Client.Network.SendPacket(extra, simulator);
-        }
-
-        public void SetSculpt(Simulator simulator, uint localID, Primitive.SculptData sculpt)
-        {
-            ObjectExtraParamsPacket extra = new ObjectExtraParamsPacket();
-
-            extra.AgentData.AgentID = Client.Self.AgentID;
-            extra.AgentData.SessionID = Client.Self.SessionID;
-
-            extra.ObjectData = new ObjectExtraParamsPacket.ObjectDataBlock[1];
-            extra.ObjectData[0] = new ObjectExtraParamsPacket.ObjectDataBlock();
-            extra.ObjectData[0].ObjectLocalID = localID;
-            extra.ObjectData[0].ParamType = (byte)Primitive.ExtraParamType.Sculpt;
-            extra.ObjectData[0].ParamInUse = true;
-            extra.ObjectData[0].ParamData = sculpt.GetBytes();
-            extra.ObjectData[0].ParamSize = (uint)extra.ObjectData[0].ParamData.Length;
-
-            Client.Network.SendPacket(extra, simulator);
-
-            // Not sure why, but if you don't send this the sculpted prim disappears
-            ObjectShapePacket shape = new ObjectShapePacket();
-
-            shape.AgentData.AgentID = Client.Self.AgentID;
-            shape.AgentData.SessionID = Client.Self.SessionID;
-
-            shape.ObjectData = new libsecondlife.Packets.ObjectShapePacket.ObjectDataBlock[1];
-            shape.ObjectData[0] = new libsecondlife.Packets.ObjectShapePacket.ObjectDataBlock();
-            shape.ObjectData[0].ObjectLocalID = localID;
-            shape.ObjectData[0].PathScaleX = 100;
-            shape.ObjectData[0].PathScaleY = 150;
-            shape.ObjectData[0].PathCurve = 32;
-
-            Client.Network.SendPacket(shape, simulator);
-        }
-
-        public void SetExtraParamOff(Simulator simulator, uint localID, Primitive.ExtraParamType type)
-        {
-            ObjectExtraParamsPacket extra = new ObjectExtraParamsPacket();
-
-            extra.AgentData.AgentID = Client.Self.AgentID;
-            extra.AgentData.SessionID = Client.Self.SessionID;
-            extra.ObjectData = new ObjectExtraParamsPacket.ObjectDataBlock[1];
-            extra.ObjectData[0] = new ObjectExtraParamsPacket.ObjectDataBlock();
-            extra.ObjectData[0].ObjectLocalID = localID;
-            extra.ObjectData[0].ParamType = (byte)type;
-            extra.ObjectData[0].ParamInUse = false;
-            extra.ObjectData[0].ParamData = new byte[0];
-            extra.ObjectData[0].ParamSize = 0;
-
-            Client.Network.SendPacket(extra, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localIDs"></param>
-        public void LinkPrims(Simulator simulator, List<uint> localIDs)
-        {
-            ObjectLinkPacket packet = new ObjectLinkPacket();
-
-            packet.AgentData.AgentID = Client.Self.AgentID;
-            packet.AgentData.SessionID = Client.Self.SessionID;
-
-            packet.ObjectData = new ObjectLinkPacket.ObjectDataBlock[localIDs.Count];
-
-            int i = 0;
-            foreach (uint localID in localIDs)
-            {
-                packet.ObjectData[i] = new ObjectLinkPacket.ObjectDataBlock();
-                packet.ObjectData[i].ObjectLocalID = localID;
-
-                i++;
-            }
-
-            Client.Network.SendPacket(packet, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="rotation"></param>
-        public void SetRotation(Simulator simulator, uint localID, LLQuaternion rotation)
-        {
-            ObjectRotationPacket objRotPacket = new ObjectRotationPacket();
-            objRotPacket.AgentData.AgentID = Client.Self.AgentID;
-            objRotPacket.AgentData.SessionID = Client.Self.SessionID;
-
-            objRotPacket.ObjectData = new ObjectRotationPacket.ObjectDataBlock[1];
-
-            objRotPacket.ObjectData[0] = new ObjectRotationPacket.ObjectDataBlock();
-            objRotPacket.ObjectData[0].ObjectLocalID = localID;
-            objRotPacket.ObjectData[0].Rotation = rotation;
-            Client.Network.SendPacket(objRotPacket, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="name"></param>
-        public void SetName(Simulator simulator, uint localID, string name)
-        {
-            SetNames(simulator, new uint[] { localID }, new string[] { name });
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localIDs"></param>
-        /// <param name="names"></param>
-        public void SetNames(Simulator simulator, uint[] localIDs, string[] names)
-        {
-            ObjectNamePacket namePacket = new ObjectNamePacket();
-            namePacket.AgentData.AgentID = Client.Self.AgentID;
-            namePacket.AgentData.SessionID = Client.Self.SessionID;
-
-            namePacket.ObjectData = new ObjectNamePacket.ObjectDataBlock[localIDs.Length];
-
-            for (int i = 0; i < localIDs.Length; ++i)
-            {
-                namePacket.ObjectData[i] = new ObjectNamePacket.ObjectDataBlock();
-                namePacket.ObjectData[i].LocalID = localIDs[i];
-                namePacket.ObjectData[i].Name = Helpers.StringToField(names[i]);
-            }
-
-            Client.Network.SendPacket(namePacket, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="description"></param>
-        public void SetDescription(Simulator simulator, uint localID, string description)
-        {
-            SetDescriptions(simulator, new uint[] { localID }, new string[] { description });
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localIDs"></param>
-        /// <param name="descriptions"></param>
-        public void SetDescriptions(Simulator simulator, uint[] localIDs, string[] descriptions)
-        {
-            ObjectDescriptionPacket descPacket = new ObjectDescriptionPacket();
-            descPacket.AgentData.AgentID = Client.Self.AgentID;
-            descPacket.AgentData.SessionID = Client.Self.SessionID;
-
-            descPacket.ObjectData = new ObjectDescriptionPacket.ObjectDataBlock[localIDs.Length];
-
-            for (int i = 0; i < localIDs.Length; ++i)
-            {
-                descPacket.ObjectData[i] = new ObjectDescriptionPacket.ObjectDataBlock();
-                descPacket.ObjectData[i].LocalID = localIDs[i];
-                descPacket.ObjectData[i].Description = Helpers.StringToField(descriptions[i]);
-            }
-
-            Client.Network.SendPacket(descPacket, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="attachPoint"></param>
-        /// <param name="rotation"></param>
-        public void AttachObject(Simulator simulator, uint localID, AttachmentPoint attachPoint, LLQuaternion rotation)
-        {
-            ObjectAttachPacket attach = new ObjectAttachPacket();
-            attach.AgentData.AgentID = Client.Self.AgentID;
-            attach.AgentData.SessionID = Client.Self.SessionID;
-            attach.AgentData.AttachmentPoint = (byte)attachPoint;
-
-            attach.ObjectData = new ObjectAttachPacket.ObjectDataBlock[1];
-            attach.ObjectData[0] = new ObjectAttachPacket.ObjectDataBlock();
-            attach.ObjectData[0].ObjectLocalID = localID;
-            attach.ObjectData[0].Rotation = rotation;
-
-            Client.Network.SendPacket(attach, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localIDs"></param>
-        public void DetachObjects(Simulator simulator, List<uint> localIDs)
-        {
-            ObjectDetachPacket detach = new ObjectDetachPacket();
-            detach.AgentData.AgentID = Client.Self.AgentID;
-            detach.AgentData.SessionID = Client.Self.SessionID;
-            detach.ObjectData = new ObjectDetachPacket.ObjectDataBlock[localIDs.Count];
-
-            int i = 0;
-            foreach (uint localid in localIDs)
-            {
-                detach.ObjectData[i] = new ObjectDetachPacket.ObjectDataBlock();
-                detach.ObjectData[i].ObjectLocalID = localid;
-                i++;
-            }
-
-            Client.Network.SendPacket(detach, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="position"></param>
-        public void SetPosition(Simulator simulator, uint localID, LLVector3 position)
-        {
-            ObjectPositionPacket objPosPacket = new ObjectPositionPacket();
-            objPosPacket.AgentData.AgentID = Client.Self.AgentID;
-            objPosPacket.AgentData.SessionID = Client.Self.SessionID;
-
-            objPosPacket.ObjectData = new ObjectPositionPacket.ObjectDataBlock[1];
-
-            objPosPacket.ObjectData[0] = new ObjectPositionPacket.ObjectDataBlock();
-            objPosPacket.ObjectData[0].ObjectLocalID = localID;
-            objPosPacket.ObjectData[0].Position = position;
-
-            Client.Network.SendPacket(objPosPacket, simulator);
-        }
-
-        /// <summary>
-        /// Deed an object (prim) to a group, Object must be shared with group which
-        /// can be accomplished with SetPermissions()
-        /// </summary>
-        /// <param name="simulator">Simulator containing object</param>
-        /// <param name="LocalID">LocalID of Object</param>
-        /// <param name="group">Group to deed object to</param>
-        public void DeedObject(Simulator simulator, uint localID, LLUUID group)
-        {
-            ObjectOwnerPacket objDeedPacket = new ObjectOwnerPacket();
-            objDeedPacket.AgentData.AgentID = Client.Self.AgentID;
-            objDeedPacket.AgentData.SessionID = Client.Self.SessionID;
-
-            // Can only be use in God mode
-            objDeedPacket.HeaderData.Override = false;
-            objDeedPacket.HeaderData.OwnerID = LLUUID.Zero;
-            objDeedPacket.HeaderData.GroupID = group;
-
-            objDeedPacket.ObjectData = new ObjectOwnerPacket.ObjectDataBlock[1];
-            objDeedPacket.ObjectData[0] = new ObjectOwnerPacket.ObjectDataBlock();
-
-            objDeedPacket.ObjectData[0].ObjectLocalID = localID;
-
-            Client.Network.SendPacket(objDeedPacket, simulator);
-        }
-
-        /// <summary>
-        /// Deed multiple objects (prims) to a group, Objects must be shared with group which
-        /// can be accomplished with SetPermissions()
-        /// </summary>
-        /// <param name="simulator">Simulator containing objects</param>
-        /// <param name="LocalIDs">List of LocalIDs</param>
-        /// <param name="group">Group to deed objects to.</param>
-        public void DeedObjects(Simulator simulator, List<uint> localIDs, LLUUID group)
-        {
-            ObjectOwnerPacket packet = new ObjectOwnerPacket();
-            packet.AgentData.AgentID = Client.Self.AgentID;
-            packet.AgentData.SessionID = Client.Self.SessionID;
-
-            // Can only be use in God mode
-            packet.HeaderData.Override = false;
-            packet.HeaderData.OwnerID = LLUUID.Zero;
-            packet.HeaderData.GroupID = group;
-
-            packet.ObjectData = new ObjectOwnerPacket.ObjectDataBlock[localIDs.Count];
-
-            for (int i = 0; i < localIDs.Count; i++)
-            {
-                packet.ObjectData[i] = new ObjectOwnerPacket.ObjectDataBlock();
-                packet.ObjectData[i].ObjectLocalID = localIDs[i];
-            }
-            Client.Network.SendPacket(packet, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localIDs"></param>
-        /// <param name="who"></param>
-        /// <param name="permissions"></param>
-        /// <param name="set"></param>
-        public void SetPermissions(Simulator simulator, List<uint> localIDs, PermissionWho who,
-            PermissionMask permissions, bool set)
-        {
-            ObjectPermissionsPacket packet = new ObjectPermissionsPacket();
-
-            packet.AgentData.AgentID = Client.Self.AgentID;
-            packet.AgentData.SessionID = Client.Self.SessionID;
-
-            // Override can only be used by gods
-            packet.HeaderData.Override = false;
-
-            packet.ObjectData = new ObjectPermissionsPacket.ObjectDataBlock[localIDs.Count];
-
-            for (int i = 0; i < localIDs.Count; i++)
-            {
-                packet.ObjectData[i] = new ObjectPermissionsPacket.ObjectDataBlock();
-
-                packet.ObjectData[i].ObjectLocalID = localIDs[i];
-                packet.ObjectData[i].Field = (byte)who;
-                packet.ObjectData[i].Mask = (uint)permissions;
-                packet.ObjectData[i].Set = Convert.ToByte(set);
-            }
-
-            Client.Network.SendPacket(packet, simulator);
-        }
-
-        /// <summary>
-        /// Request additional properties for an object
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="objectID"></param>
-        public void RequestObjectPropertiesFamily(Simulator simulator, LLUUID objectID)
-        {
-            RequestObjectPropertiesFamily(simulator, objectID, true);
-        }
-
-        /// <summary>
-        /// Request additional properties for an object
-        /// </summary>
-        /// <param name="simulator">Simulator containing the object</param>
-        /// <param name="objectID">Absolute UUID of the object</param>
-        /// <param name="reliable">Whether to require server acknowledgement of this request</param>
-        public void RequestObjectPropertiesFamily(Simulator simulator, LLUUID objectID, bool reliable)
-        {
-            RequestObjectPropertiesFamilyPacket properties = new RequestObjectPropertiesFamilyPacket();
-            properties.AgentData.AgentID = Client.Self.AgentID;
-            properties.AgentData.SessionID = Client.Self.SessionID;
-            properties.ObjectData.ObjectID = objectID;
-            // TODO: RequestFlags is typically only for bug report submissions, but we might be able to
-            // use it to pass an arbitrary uint back to the callback
-            properties.ObjectData.RequestFlags = 0;
-
-            properties.Header.Reliable = reliable;
-
-            Client.Network.SendPacket(properties, simulator);
-        }
-
-        #endregion
-
-        #region Packet Handlers
-
-        /// <summary>
-        /// Used for new prims, or significant changes to existing prims
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        protected void UpdateHandler(Packet packet, Simulator simulator)
-        {
-            ObjectUpdatePacket update = (ObjectUpdatePacket)packet;
-			UpdateDilation(simulator, update.RegionData.TimeDilation);
-
-            for (int b = 0; b < update.ObjectData.Length; b++)
-            {
-                ObjectUpdatePacket.ObjectDataBlock block = update.ObjectData[b];
-
-                LLVector4 collisionPlane = LLVector4.Zero;
-                LLVector3 position;
-                LLVector3 velocity;
-                LLVector3 acceleration;
-                LLQuaternion rotation;
-                LLVector3 angularVelocity;
-                NameValue[] nameValues;
-                bool attachment = false;
-                PCode pcode = (PCode)block.PCode;
-
-                #region Relevance check
-
-                // Check if we are interested in this object
-                if (!Client.Settings.ALWAYS_DECODE_OBJECTS)
-                {
-                    switch (pcode)
-                    {
-                        case PCode.Grass:
-                        case PCode.Tree:
-                        case PCode.NewTree:
-                            if (OnNewFoliage == null) continue;
-                            break;
-                        case PCode.Prim:
-                            if (OnNewPrim == null) continue;
-                            break;
-                        case PCode.Avatar:
-                            // Make an exception for updates about our own agent
-                            if (block.FullID != Client.Self.AgentID && OnNewAvatar == null) continue;
-                            break;
-                        case PCode.ParticleSystem:
-                            continue; // TODO: Do something with these
-                    }
-                }
-
-                #endregion Relevance check
-
-                #region NameValue parsing
-
-                string nameValue = Helpers.FieldToUTF8String(block.NameValue);
-                if (nameValue.Length > 0)
-                {
-                    string[] lines = nameValue.Split('\n');
-                    nameValues = new NameValue[lines.Length];
-
-                    for (int i = 0; i < lines.Length; i++)
-                    {
-                        if (!String.IsNullOrEmpty(lines[i]))
-                        {
-                            NameValue nv = new NameValue(lines[i]);
-                            if (nv.Name == "AttachItemID") attachment = true;
-                            nameValues[i] = nv;
-                        }
-                    }
-                }
-                else
-                {
-                    nameValues = new NameValue[0];
-                }
-
-                #endregion NameValue parsing
-
-                #region Decode Object (primitive) parameters
-                LLObject.ObjectData data = new LLObject.ObjectData();
-                data.State = block.State;
-                data.Material = (LLObject.MaterialType)block.Material;
-                data.PathCurve = (LLObject.PathCurve)block.PathCurve;
-                data.profileCurve = block.ProfileCurve;
-                data.PathBegin = LLObject.UnpackBeginCut(block.PathBegin);
-                data.PathEnd = LLObject.UnpackEndCut(block.PathEnd);
-                data.PathScaleX = LLObject.UnpackPathScale(block.PathScaleX);
-                data.PathScaleY = LLObject.UnpackPathScale(block.PathScaleY);
-                data.PathShearX = LLObject.UnpackPathShear(block.PathShearX);
-                data.PathShearY = LLObject.UnpackPathShear(block.PathShearY);
-                data.PathTwist = LLObject.UnpackPathTwist(block.PathTwist);
-                data.PathTwistBegin = LLObject.UnpackPathTwist(block.PathTwistBegin);
-                data.PathRadiusOffset = LLObject.UnpackPathTwist(block.PathRadiusOffset);
-                data.PathTaperX = LLObject.UnpackPathTaper(block.PathTaperX);
-                data.PathTaperY = LLObject.UnpackPathTaper(block.PathTaperY);
-                data.PathRevolutions = LLObject.UnpackPathRevolutions(block.PathRevolutions);
-                data.PathSkew = LLObject.UnpackPathTwist(block.PathSkew);
-                data.ProfileBegin = LLObject.UnpackBeginCut(block.ProfileBegin);
-                data.ProfileEnd = LLObject.UnpackEndCut(block.ProfileEnd);
-                data.ProfileHollow = LLObject.UnpackProfileHollow(block.ProfileHollow);
-                data.PCode = pcode;
-                #endregion
-
-                #region Decode Additional packed parameters in ObjectData
-                int pos = 0;
-                switch (block.ObjectData.Length)
-                {
-                    case 76:
-                        // Collision normal for avatar
-                        collisionPlane = new LLVector4(block.ObjectData, pos);
-                        pos += 16;
-
-                        goto case 60;
-                    case 60:
-                        // Position
-                        position = new LLVector3(block.ObjectData, pos);
-                        pos += 12;
-                        // Velocity
-                        velocity = new LLVector3(block.ObjectData, pos);
-                        pos += 12;
-                        // Acceleration
-                        acceleration = new LLVector3(block.ObjectData, pos);
-                        pos += 12;
-                        // Rotation (theta)
-                        rotation = new LLQuaternion(block.ObjectData, pos, true);
-                        pos += 12;
-                        // Angular velocity (omega)
-                        angularVelocity = new LLVector3(block.ObjectData, pos);
-                        pos += 12;
-
-                        break;
-                    case 48:
-                        // Collision normal for avatar
-                        collisionPlane = new LLVector4(block.ObjectData, pos);
-                        pos += 16;
-
-                        goto case 32;
-                    case 32:
-                        // The data is an array of unsigned shorts
-
-                        // Position
-                        position = new LLVector3(
-                            Helpers.UInt16ToFloat(block.ObjectData, pos, -0.5f * 256.0f, 1.5f * 256.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 2, -0.5f * 256.0f, 1.5f * 256.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 4, -256.0f, 3.0f * 256.0f));
-                        pos += 6;
-                        // Velocity
-                        velocity = new LLVector3(
-                            Helpers.UInt16ToFloat(block.ObjectData, pos, -256.0f, 256.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 2, -256.0f, 256.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 4, -256.0f, 256.0f));
-                        pos += 6;
-                        // Acceleration
-                        acceleration = new LLVector3(
-                            Helpers.UInt16ToFloat(block.ObjectData, pos, -256.0f, 256.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 2, -256.0f, 256.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 4, -256.0f, 256.0f));
-                        pos += 6;
-                        // Rotation (theta)
-                        rotation = new LLQuaternion(
-                            Helpers.UInt16ToFloat(block.ObjectData, pos, -1.0f, 1.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 2, -1.0f, 1.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 4, -1.0f, 1.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 6, -1.0f, 1.0f));
-                        pos += 8;
-                        // Angular velocity (omega)
-                        angularVelocity = new LLVector3(
-                            Helpers.UInt16ToFloat(block.ObjectData, pos, -256.0f, 256.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 2, -256.0f, 256.0f),
-                            Helpers.UInt16ToFloat(block.ObjectData, pos + 4, -256.0f, 256.0f));
-                        pos += 6;
-
-                        break;
-                    case 16:
-                        // The data is an array of single bytes (8-bit numbers)
-
-                        // Position
-                        position = new LLVector3(
-                            Helpers.ByteToFloat(block.ObjectData, pos, -256.0f, 256.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 1, -256.0f, 256.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 2, -256.0f, 256.0f));
-                        pos += 3;
-                        // Velocity
-                        velocity = new LLVector3(
-                            Helpers.ByteToFloat(block.ObjectData, pos, -256.0f, 256.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 1, -256.0f, 256.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 2, -256.0f, 256.0f));
-                        pos += 3;
-                        // Accleration
-                        acceleration = new LLVector3(
-                            Helpers.ByteToFloat(block.ObjectData, pos, -256.0f, 256.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 1, -256.0f, 256.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 2, -256.0f, 256.0f));
-                        pos += 3;
-                        // Rotation
-                        rotation = new LLQuaternion(
-                            Helpers.ByteToFloat(block.ObjectData, pos, -1.0f, 1.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 1, -1.0f, 1.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 2, -1.0f, 1.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 3, -1.0f, 1.0f));
-                        pos += 4;
-                        // Angular Velocity
-                        angularVelocity = new LLVector3(
-                            Helpers.ByteToFloat(block.ObjectData, pos, -256.0f, 256.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 1, -256.0f, 256.0f),
-                            Helpers.ByteToFloat(block.ObjectData, pos + 2, -256.0f, 256.0f));
-                        pos += 3;
-
-                        break;
-                    default:
-                        Client.Log("Got an ObjectUpdate block with ObjectUpdate field length of " +
-                            block.ObjectData.Length, Helpers.LogLevel.Warning);
-
-                        continue;
-                }
-                #endregion
-
-                // Determine the object type and create the appropriate class
-                switch (pcode)
-                {
-                    #region Prim and Foliage
-                    case PCode.Grass:
-                    case PCode.Tree:
-                    case PCode.NewTree:
-                    case PCode.Prim:
-                        Primitive prim = GetPrimitive(simulator, block.ID, block.FullID);
-
-                        #region Update Prim Info with decoded data
-                        prim.Flags = (LLObject.ObjectFlags)block.UpdateFlags;
-
-                        if ((prim.Flags & LLObject.ObjectFlags.ZlibCompressed) != 0)
-                        {
-                            Client.Log("Got a ZlibCompressed ObjectUpdate, implement me!",
-                                Helpers.LogLevel.Warning);
-                            continue;
-                        }
-
-                        prim.NameValues = nameValues;
-                        prim.LocalID = block.ID;
-                        prim.ID = block.FullID;
-                        prim.ParentID = block.ParentID;
-					    prim.RegionHandle = update.RegionData.RegionHandle;
-                        prim.Scale = block.Scale;
-                        prim.ClickAction = (ClickAction)block.ClickAction;
-                        prim.OwnerID = block.OwnerID;
-                        prim.MediaURL = Helpers.FieldToUTF8String(block.MediaURL);
-                        prim.Text = Helpers.FieldToUTF8String(block.Text);
-                        prim.TextColor = new LLColor(block.TextColor, 0, false);
-                        // Only alpha is inversed
-                        prim.TextColor.A = (byte)(255 - prim.TextColor.A);
-
-                        // Sound information
-                        prim.Sound = block.Sound;
-                        prim.SoundFlags = block.Flags;
-                        prim.SoundGain = block.Gain;
-                        prim.SoundRadius = block.Radius;
-
-                        // Joint information
-                        prim.Joint = (Primitive.JointType)block.JointType;
-                        prim.JointPivot = block.JointPivot;
-                        prim.JointAxisOrAnchor = block.JointAxisOrAnchor;
-
-                        // Object parameters
-                        prim.Data = data;
-
-                        // Textures, texture animations, particle system, and extra params
-                        prim.Textures = new LLObject.TextureEntry(block.TextureEntry, 0,
-                            block.TextureEntry.Length);
-
-                        prim.TextureAnim = new Primitive.TextureAnimation(block.TextureAnim, 0);
-                        prim.ParticleSys = new Primitive.ParticleSystem(block.PSBlock, 0);
-                        prim.SetExtraParamsFromBytes(block.ExtraParams, 0);
-
-                        // PCode-specific data
-                        prim.GenericData = block.Data;
-
-                        // Packed parameters
-                        prim.CollisionPlane = collisionPlane;
-                        prim.Position = position;
-                        prim.Velocity = velocity;
-                        prim.Acceleration = acceleration;
-                        prim.Rotation = rotation;
-                        prim.AngularVelocity = angularVelocity;
-                        #endregion
-
-                        if (attachment)
-                            FireOnNewAttachment(simulator, prim, update.RegionData.RegionHandle,
-                                update.RegionData.TimeDilation);
-                        else if (pcode == PCode.Prim)
-                            FireOnNewPrim(simulator, prim, update.RegionData.RegionHandle,
-                                update.RegionData.TimeDilation);
-                        else
-                            FireOnNewFoliage(simulator, prim, update.RegionData.RegionHandle,
-                                update.RegionData.TimeDilation);
-
-                        break;
-                    #endregion Prim and Foliage
-                    #region Avatar
-                    case PCode.Avatar:
-                        // Update some internals if this is our avatar
-                        if (block.FullID == Client.Self.AgentID)
-                        {
-                            #region Update Client.Self
-
-                            // We need the local ID to recognize terse updates for our agent
-                            Client.Self.localID = block.ID;
-
-                            // Packed parameters
-                            Client.Self.collisionPlane = collisionPlane;
-                            Client.Self.relativePosition = position;
-                            Client.Self.velocity = velocity;
-                            Client.Self.acceleration = acceleration;
-                            Client.Self.relativeRotation = rotation;
-                            Client.Self.angularVelocity = angularVelocity;
-
-                            #endregion
-                        }
-
-                        #region Create an Avatar from the decoded data
-
-                        Avatar avatar = GetAvatar(simulator, block.ID, block.FullID);
-                        uint oldSeatID = avatar.sittingOn;
-
-                        avatar.ID = block.FullID;
-                        avatar.LocalID = block.ID;
-                        avatar.CollisionPlane = collisionPlane;
-                        avatar.Position = position;
-                        avatar.Velocity = velocity;
-                        avatar.Acceleration = acceleration;
-                        avatar.Rotation = rotation;
-                        avatar.AngularVelocity = angularVelocity;
-                        avatar.NameValues = nameValues;
-                        avatar.Data = data;
-                        avatar.GenericData = block.Data;
-                        avatar.sittingOn = block.ParentID;
-
-                        SetAvatarSittingOn(simulator, avatar, block.ParentID, oldSeatID);
-
-                        // Set the current simulator for this avatar
-                        avatar.CurrentSim = simulator;
-
-                        // Textures
-                        avatar.Textures = new Primitive.TextureEntry(block.TextureEntry, 0,
-                            block.TextureEntry.Length);
-
-                        #endregion Create an Avatar from the decoded data
-
-                        FireOnNewAvatar(simulator, avatar, update.RegionData.RegionHandle,
-                            update.RegionData.TimeDilation);
-
-                        break;
-                    #endregion Avatar
-                    case PCode.ParticleSystem:
-                        DecodeParticleUpdate(block);
-                        // TODO: Create a callback for particle updates
-                        break;
-                    default:
-                        Client.DebugLog("Got an ObjectUpdate block with an unrecognized PCode " + pcode.ToString());
-                        break;
-                }
-            }
-        }
-
-        protected void DecodeParticleUpdate(ObjectUpdatePacket.ObjectDataBlock block)
-        {
-            // TODO: Handle ParticleSystem ObjectUpdate blocks
-
-            // float bounce_b
-            // LLVector4 scale_range
-            // LLVector4 alpha_range
-            // LLVector3 vel_offset
-            // float dist_begin_fadeout
-            // float dist_end_fadeout
-            // LLUUID image_uuid
-            // long flags
-            // byte createme
-            // LLVector3 diff_eq_alpha
-            // LLVector3 diff_eq_scale
-            // byte max_particles
-            // byte initial_particles
-            // float kill_plane_z
-            // LLVector3 kill_plane_normal
-            // float bounce_plane_z
-            // LLVector3 bounce_plane_normal
-            // float spawn_range
-            // float spawn_frequency
-            // float spawn_frequency_range
-            // LLVector3 spawn_direction
-            // float spawn_direction_range
-            // float spawn_velocity
-            // float spawn_velocity_range
-            // float speed_limit
-            // float wind_weight
-            // LLVector3 current_gravity
-            // float gravity_weight
-            // float global_lifetime
-            // float individual_lifetime
-            // float individual_lifetime_range
-            // float alpha_decay
-            // float scale_decay
-            // float distance_death
-            // float damp_motion_factor
-            // LLVector3 wind_diffusion_factor
-        }
-
-        /// <summary>
-        /// A terse object update, used when a transformation matrix or
-        /// velocity/acceleration for an object changes but nothing else
-        /// (scale/position/rotation/acceleration/velocity)
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        protected void TerseUpdateHandler(Packet packet, Simulator simulator)
-        {
-            ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)packet;
-			UpdateDilation(simulator, terse.RegionData.TimeDilation);
-
-            for (int i = 0; i < terse.ObjectData.Length; i++)
-            {
-                ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = terse.ObjectData[i];
-
-                try
-                {
-                    int pos = 4;
-                    uint localid = Helpers.BytesToUIntBig(block.Data, 0);
-
-                    // Check if we are interested in this update
-                    if (!Client.Settings.ALWAYS_DECODE_OBJECTS && localid != Client.Self.localID && OnObjectUpdated == null)
-                        continue;
-
-                    #region Decode update data
-
-                    ObjectUpdate update = new ObjectUpdate();
-
-                    // LocalID
-                    update.LocalID = localid;
-                    // State
-                    update.State = block.Data[pos++];
-                    // Avatar boolean
-                    update.Avatar = (block.Data[pos++] != 0);
-                    // Collision normal for avatar
-                    if (update.Avatar)
-                    {
-                        update.CollisionPlane = new LLVector4(block.Data, pos);
-                        pos += 16;
-                    }
-                    // Position
-                    update.Position = new LLVector3(block.Data, pos);
-                    pos += 12;
-                    // Velocity
-                    update.Velocity = new LLVector3(
-                        Helpers.UInt16ToFloat(block.Data, pos, -128.0f, 128.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 2, -128.0f, 128.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 4, -128.0f, 128.0f));
-                    pos += 6;
-                    // Acceleration
-                    update.Acceleration = new LLVector3(
-                        Helpers.UInt16ToFloat(block.Data, pos, -64.0f, 64.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 2, -64.0f, 64.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 4, -64.0f, 64.0f));
-                    pos += 6;
-                    // Rotation (theta)
-                    update.Rotation = new LLQuaternion(
-                        Helpers.UInt16ToFloat(block.Data, pos, -1.0f, 1.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 2, -1.0f, 1.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 4, -1.0f, 1.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 6, -1.0f, 1.0f));
-                    pos += 8;
-                    // Angular velocity
-                    update.AngularVelocity = new LLVector3(
-                        Helpers.UInt16ToFloat(block.Data, pos, -64.0f, 64.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 2, -64.0f, 64.0f),
-                        Helpers.UInt16ToFloat(block.Data, pos + 4, -64.0f, 64.0f));
-                    pos += 6;
-
-                    // Textures
-                    // FIXME: Why are we ignoring the first four bytes here?
-                    if (block.TextureEntry.Length != 0)
-                        update.Textures = new LLObject.TextureEntry(block.TextureEntry, 4, block.TextureEntry.Length - 4);
-
-                    #endregion Decode update data
-
-                    LLObject obj = (update.Avatar) ?
-                        (LLObject)GetAvatar(simulator, update.LocalID, null):
-                        (LLObject)GetPrimitive(simulator, update.LocalID, null);
-
-                    #region Update Client.Self
-                    if (update.LocalID == Client.Self.localID)
-                    {
-                        Client.Self.collisionPlane = update.CollisionPlane;
-                        Client.Self.relativePosition = update.Position;
-                        Client.Self.velocity = update.Velocity;
-                        Client.Self.acceleration = update.Acceleration;
-                        Client.Self.relativeRotation = update.Rotation;
-                        Client.Self.angularVelocity = update.AngularVelocity;
-                    }
-                    #endregion Update Client.Self
-
-                    obj.Acceleration = update.Acceleration;
-                    obj.AngularVelocity = update.AngularVelocity;
-                    obj.CollisionPlane = update.CollisionPlane;
-                    obj.Position = update.Position;
-                    obj.Rotation = update.Rotation;
-                    obj.Velocity = update.Velocity;
-                    if (update.Textures != null)
-                        obj.Textures = update.Textures;
-
-                    // Fire the callback
-                    FireOnObjectUpdated(simulator, update, terse.RegionData.RegionHandle, terse.RegionData.TimeDilation);
-                }
-                catch (Exception e)
-                {
-                    Client.Log(e.ToString(), Helpers.LogLevel.Warning);
-                }
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        protected void CompressedUpdateHandler(Packet packet, Simulator simulator)
-        {
-            ObjectUpdateCompressedPacket update = (ObjectUpdateCompressedPacket)packet;
-
-            for (int b = 0; b < update.ObjectData.Length; b++)
-            {
-                ObjectUpdateCompressedPacket.ObjectDataBlock block = update.ObjectData[b];
-                int i = 0;
-
-                try
-                {
-                    // UUID
-                    LLUUID FullID = new LLUUID(block.Data, 0);
-                    i += 16;
-                    // Local ID
-                    uint LocalID = (uint)(block.Data[i++] + (block.Data[i++] << 8) +
-                        (block.Data[i++] << 16) + (block.Data[i++] << 24));
-                    // PCode
-                    PCode pcode = (PCode)block.Data[i++];
-
-                    #region Relevance check
-                    if (!Client.Settings.ALWAYS_DECODE_OBJECTS)
-                    {
-                        switch (pcode)
-                        {
-                            case PCode.Grass:
-                            case PCode.Tree:
-                            case PCode.NewTree:
-                                if (OnNewFoliage == null) continue;
-                                break;
-                            case PCode.Prim:
-                                if (OnNewPrim == null) continue;
-                                break;
-                        }
-                    }
-                    #endregion Relevance check
-
-                    Primitive prim = GetPrimitive(simulator, LocalID, FullID);
-
-                    prim.LocalID = LocalID;
-                    prim.ID = FullID;
-                    prim.Flags = (LLObject.ObjectFlags)block.UpdateFlags;
-                    prim.Data.PCode = pcode;
-
-                    switch (pcode)
-                    {
-                        case PCode.Grass:
-                        case PCode.Tree:
-                        case PCode.NewTree:
-                            #region Foliage Decoding
-
-                            // State
-                            prim.Data.State = block.Data[i++];
-                            // CRC
-                            i += 4;
-                            // Material
-                            prim.Data.Material = (LLObject.MaterialType)block.Data[i++];
-                            // Click action
-                            prim.ClickAction = (ClickAction)block.Data[i++];
-                            // Scale
-                            prim.Scale = new LLVector3(block.Data, i);
-                            i += 12;
-                            // Position
-                            prim.Position = new LLVector3(block.Data, i);
-                            i += 12;
-                            // Rotation
-                            prim.Rotation = new LLQuaternion(block.Data, i, true);
-                            i += 12;
-
-                            #endregion Foliage Decoding
-
-                            // FIXME: We are leaving a lot of data left undecoded here, including the
-                            // tree species. Need to understand what is going on with these packets
-                            // and fix it soon!
-
-                            FireOnNewFoliage(simulator, prim, update.RegionData.RegionHandle, update.RegionData.TimeDilation);
-
-                            break;
-                        case PCode.Prim:
-                            #region Decode block and update Prim
-                            // State
-                            prim.Data.State = block.Data[i++];
-                            // CRC
-                            i += 4;
-                            // Material
-                            prim.Data.Material = (LLObject.MaterialType)block.Data[i++];
-                            // Click action
-                            prim.ClickAction = (ClickAction)block.Data[i++];
-                            // Scale
-                            prim.Scale = new LLVector3(block.Data, i);
-                            i += 12;
-                            // Position
-                            prim.Position = new LLVector3(block.Data, i);
-                            i += 12;
-                            // Rotation
-                            prim.Rotation = new LLQuaternion(block.Data, i, true);
-                            i += 12;
-                            // Compressed flags
-                            CompressedFlags flags = (CompressedFlags)Helpers.BytesToUIntBig(block.Data, i);
-                            i += 4;
-
-                            prim.OwnerID = new LLUUID(block.Data, i);
-                            i += 16;
-
-
-                            // Angular velocity
-                            if ((flags & CompressedFlags.HasAngularVelocity) != 0)
-                            {
-                                prim.AngularVelocity = new LLVector3(block.Data, i);
-                                i += 12;
-                            }
-
-                            // Parent ID
-                            if ((flags & CompressedFlags.HasParent) != 0)
-                            {
-                                prim.ParentID = (uint)(block.Data[i++] + (block.Data[i++] << 8) +
-                                (block.Data[i++] << 16) + (block.Data[i++] << 24));
-                            }
-                            else
-                            {
-                                prim.ParentID = 0;
-                            }
-
-                            // Tree data
-                            if ((flags & CompressedFlags.Tree) != 0)
-                            {
-                                prim.GenericData = new byte[1];
-                                prim.GenericData[0] = block.Data[i++];
-                            }
-                            // Scratch pad
-                            else if ((flags & CompressedFlags.ScratchPad) != 0)
-                            {
-                                int size = block.Data[i++];
-                                prim.GenericData = new byte[size];
-                                Buffer.BlockCopy(block.Data, i, prim.GenericData, 0, size);
-                                i += size;
-                            }
-
-                            // Floating text
-                            if ((flags & CompressedFlags.HasText) != 0)
-                            {
-                                string text = String.Empty;
-                                while (block.Data[i] != 0)
-                                {
-                                    text += (char)block.Data[i];
-                                    i++;
-                                }
-                                i++;
-
-                                // Floating text
-                                prim.Text = text;
-
-                                // Text color
-                                prim.TextColor = new LLColor(block.Data, i, false);
-                                // FIXME: Is alpha inversed here as well?
-                                i += 4;
-                            }
-                            else
-                            {
-                                prim.Text = String.Empty;
-                            }
-
-                            // Media URL
-                            if ((flags & CompressedFlags.MediaURL) != 0)
-                            {
-                                string text = String.Empty;
-                                while (block.Data[i] != 0)
-                                {
-                                    text += (char)block.Data[i];
-                                    i++;
-                                }
-                                i++;
-
-                                prim.MediaURL = text;
-                            }
-
-                            // Particle system
-                            if ((flags & CompressedFlags.HasParticles) != 0)
-                            {
-                                prim.ParticleSys = new Primitive.ParticleSystem(block.Data, i);
-                                i += 86;
-                            }
-
-                            // Extra parameters
-                            i += prim.SetExtraParamsFromBytes(block.Data, i);
-
-                            //Sound data
-                            if ((flags & CompressedFlags.HasSound) != 0)
-                            {
-                                prim.Sound = new LLUUID(block.Data, i);
-                                i += 16;
-
-                                if (!BitConverter.IsLittleEndian)
-                                {
-                                    Array.Reverse(block.Data, i, 4);
-                                    Array.Reverse(block.Data, i + 5, 4);
-                                }
-
-                                prim.SoundGain = BitConverter.ToSingle(block.Data, i);
-                                i += 4;
-                                prim.SoundFlags = block.Data[i++];
-                                prim.SoundRadius = BitConverter.ToSingle(block.Data, i);
-                                i += 4;
-                            }
-
-                            // Name values
-                            if ((flags & CompressedFlags.HasNameValues) != 0)
-                            {
-                                string text = String.Empty;
-                                while (block.Data[i] != 0)
-                                {
-                                    text += (char)block.Data[i];
-                                    i++;
-                                }
-                                i++;
-
-                                // Parse the name values
-                                if (text.Length > 0)
-                                {
-                                    string[] lines = text.Split('\n');
-                                    prim.NameValues = new NameValue[lines.Length];
-
-                                    for (int j = 0; j < lines.Length; j++)
-                                    {
-                                        if (!String.IsNullOrEmpty(lines[j]))
-                                        {
-                                            NameValue nv = new NameValue(lines[j]);
-                                            prim.NameValues[j] = nv;
-                                        }
-                                    }
-                                }
-                            }
-
-                            prim.Data.PathCurve = (LLObject.PathCurve)block.Data[i++];
-                            ushort pathBegin = Helpers.BytesToUInt16(block.Data, i); i += 2;
-                            prim.Data.PathBegin = LLObject.UnpackBeginCut(pathBegin);
-                            ushort pathEnd = Helpers.BytesToUInt16(block.Data, i); i += 2;
-                            prim.Data.PathEnd = LLObject.UnpackEndCut(pathEnd);
-                            prim.Data.PathScaleX = LLObject.UnpackPathScale(block.Data[i++]);
-                            prim.Data.PathScaleY = LLObject.UnpackPathScale(block.Data[i++]);
-                            prim.Data.PathShearX = LLObject.UnpackPathShear(block.Data[i++]);
-                            prim.Data.PathShearY = LLObject.UnpackPathShear(block.Data[i++]);
-                            prim.Data.PathTwist = LLObject.UnpackPathTwist((sbyte)block.Data[i++]);
-                            prim.Data.PathTwistBegin = LLObject.UnpackPathTwist((sbyte)block.Data[i++]);
-                            prim.Data.PathRadiusOffset = LLObject.UnpackPathTwist((sbyte)block.Data[i++]);
-                            prim.Data.PathTaperX = LLObject.UnpackPathTaper((sbyte)block.Data[i++]);
-                            prim.Data.PathTaperY = LLObject.UnpackPathTaper((sbyte)block.Data[i++]);
-                            prim.Data.PathRevolutions = LLObject.UnpackPathRevolutions(block.Data[i++]);
-                            prim.Data.PathSkew = LLObject.UnpackPathTwist((sbyte)block.Data[i++]);
-
-                            prim.Data.profileCurve = block.Data[i++];
-                            ushort profileBegin = Helpers.BytesToUInt16(block.Data, i); i += 2;
-                            prim.Data.ProfileBegin = LLObject.UnpackBeginCut(profileBegin);
-                            ushort profileEnd = Helpers.BytesToUInt16(block.Data, i); i += 2;
-                            prim.Data.ProfileEnd = LLObject.UnpackEndCut(profileEnd);
-                            ushort profileHollow = Helpers.BytesToUInt16(block.Data, i); i += 2;
-                            prim.Data.ProfileHollow = LLObject.UnpackProfileHollow(profileHollow);
-
-                            // TextureEntry
-                            int textureEntryLength = (int)Helpers.BytesToUIntBig(block.Data, i);
-                            i += 4;
-                            prim.Textures = new LLObject.TextureEntry(block.Data, i, textureEntryLength);
-                            i += textureEntryLength;
-
-                            // Texture animation
-                            if ((flags & CompressedFlags.TextureAnimation) != 0)
-                            {
-                                //int textureAnimLength = (int)Helpers.BytesToUIntBig(block.Data, i);
-                                i += 4;
-                                prim.TextureAnim = new Primitive.TextureAnimation(block.Data, i);
-                            }
-
-                            #endregion
-
-                            #region Fire Events
-
-                            // Fire the appropriate callback
-                            if ((flags & CompressedFlags.HasNameValues) != 0 && prim.ParentID != 0)
-                                FireOnNewAttachment(simulator, prim, update.RegionData.RegionHandle,
-                                    update.RegionData.TimeDilation);
-                            else if ((flags & CompressedFlags.Tree) != 0)
-                                FireOnNewFoliage(simulator, prim, update.RegionData.RegionHandle,
-                                    update.RegionData.TimeDilation);
-                            else
-                                FireOnNewPrim(simulator, prim, update.RegionData.RegionHandle,
-                                    update.RegionData.TimeDilation);
-
-                            #endregion
-
-                            break;
-                        default:
-                            Client.DebugLog("Got an ObjectUpdateCompressed for PCode " + pcode.ToString() +
-                                ", implement this!");
-                            break;
-                    }
-                }
-                catch (IndexOutOfRangeException e)
-                {
-                    Client.Log("Had a problem decoding an ObjectUpdateCompressed packet: " +
-                        e.ToString(), Helpers.LogLevel.Warning);
-                    Client.Log(block.ToString(), Helpers.LogLevel.Warning);
-                }
-            }
-        }
-
-        protected void CachedUpdateHandler(Packet packet, Simulator simulator)
-        {
-            if (Client.Settings.ALWAYS_REQUEST_OBJECTS)
-            {
-                ObjectUpdateCachedPacket update = (ObjectUpdateCachedPacket)packet;
-                List<uint> ids = new List<uint>(update.ObjectData.Length);
-
-                // No object caching implemented yet, so request updates for all of these objects
-                for (int i = 0; i < update.ObjectData.Length; i++)
-                {
-                    ids.Add(update.ObjectData[i].ID);
-                }
-
-                RequestObjects(simulator, ids);
-            }
-        }
-
-        protected void KillObjectHandler(Packet packet, Simulator simulator)
-        {
-            KillObjectPacket kill = (KillObjectPacket)packet;
-
-            if (Client.Settings.OBJECT_TRACKING)
-            {
-                for (int i = 0; i < kill.ObjectData.Length; i++)
-                {
-                    uint localID = kill.ObjectData[i].ID;
-
-                    if (simulator.Objects.Prims.ContainsKey(localID))
-                    {
-                        lock (simulator.Objects.Prims)
-                            simulator.Objects.Prims.Remove(localID);
-                    }
-                    if (simulator.Objects.Avatars.ContainsKey(localID))
-                    {
-                        lock (simulator.Objects.Avatars)
-                            simulator.Objects.Avatars.Remove(localID);
-                    }
-
-                    FireOnObjectKilled(simulator, localID);
-                }
-            }
-            else
-            {
-                for (int i = 0; i < kill.ObjectData.Length; i++)
-                    FireOnObjectKilled(simulator, kill.ObjectData[i].ID);
-            }
-        }
-
-        protected void ObjectPropertiesHandler(Packet p, Simulator sim)
-        {
-            ObjectPropertiesPacket op = (ObjectPropertiesPacket)p;
-            ObjectPropertiesPacket.ObjectDataBlock[] datablocks = op.ObjectData;
-
-            for (int i = 0; i < datablocks.Length; ++i)
-            {
-                ObjectPropertiesPacket.ObjectDataBlock objectData = datablocks[i];
-                LLObject.ObjectProperties props = new LLObject.ObjectProperties();
-
-                props.AggregatePerms = objectData.AggregatePerms;
-                props.AggregatePermTextures = objectData.AggregatePermTextures;
-                props.AggregatePermTexturesOwner = objectData.AggregatePermTexturesOwner;
-                props.Permissions = new Permissions(objectData.BaseMask, objectData.EveryoneMask, objectData.GroupMask,
-                    objectData.NextOwnerMask, objectData.OwnerMask);
-                props.Category = objectData.Category;
-                props.CreationDate = objectData.CreationDate;
-                props.CreatorID = objectData.CreatorID;
-                props.Description = Helpers.FieldToUTF8String(objectData.Description);
-                props.FolderID = objectData.FolderID;
-                props.FromTaskID = objectData.FromTaskID;
-                props.GroupID = objectData.GroupID;
-                props.InventorySerial = objectData.InventorySerial;
-                props.ItemID = objectData.ItemID;
-                props.LastOwnerID = objectData.LastOwnerID;
-                props.Name = Helpers.FieldToUTF8String(objectData.Name);
-                props.ObjectID = objectData.ObjectID;
-                props.OwnerID = objectData.OwnerID;
-                props.OwnershipCost = objectData.OwnershipCost;
-                props.SalePrice = objectData.SalePrice;
-                props.SaleType = objectData.SaleType;
-                props.SitName = Helpers.FieldToUTF8String(objectData.SitName);
-                props.TouchName = Helpers.FieldToUTF8String(objectData.TouchName);
-
-                int numTextures = objectData.TextureID.Length / 16;
-                props.TextureIDs = new LLUUID[numTextures];
-                for (int j = 0; j < numTextures; ++j)
-                    props.TextureIDs[j] = new LLUUID(objectData.TextureID, j * 16);
-
-                if (Client.Settings.OBJECT_TRACKING)
-                {
-                    Primitive findPrim = sim.Objects.Find(
-                        delegate(Primitive prim) { return prim.ID == props.ObjectID; });
-
-                    if (findPrim != null)
-                    {
-                        lock (sim.Objects.Prims)
-                        {
-                            if (sim.Objects.Prims.ContainsKey(findPrim.LocalID))
-                                sim.Objects.Prims[findPrim.LocalID].Properties = props;
-                        }
-                    }
-                }
-
-                FireOnObjectProperties(sim, props);
-            }
-        }
-
-        protected void ObjectPropertiesFamilyHandler(Packet p, Simulator sim)
-        {
-            ObjectPropertiesFamilyPacket op = (ObjectPropertiesFamilyPacket)p;
-            LLObject.ObjectPropertiesFamily props = new LLObject.ObjectPropertiesFamily();
-
-            props.RequestFlags = (LLObject.ObjectPropertiesFamily.RequestFlagsType)op.ObjectData.RequestFlags;
-            props.Category = op.ObjectData.Category;
-            props.Description = Helpers.FieldToUTF8String(op.ObjectData.Description);
-            props.GroupID = op.ObjectData.GroupID;
-            props.LastOwnerID = op.ObjectData.LastOwnerID;
-            props.Name = Helpers.FieldToUTF8String(op.ObjectData.Name);
-            props.ObjectID = op.ObjectData.ObjectID;
-            props.OwnerID = op.ObjectData.OwnerID;
-            props.OwnershipCost = op.ObjectData.OwnershipCost;
-            props.SalePrice = op.ObjectData.SalePrice;
-            props.SaleType = op.ObjectData.SaleType;
-            props.Permissions.BaseMask = (PermissionMask)op.ObjectData.BaseMask;
-            props.Permissions.EveryoneMask = (PermissionMask)op.ObjectData.EveryoneMask;
-            props.Permissions.GroupMask = (PermissionMask)op.ObjectData.GroupMask;
-            props.Permissions.NextOwnerMask = (PermissionMask)op.ObjectData.NextOwnerMask;
-            props.Permissions.OwnerMask = (PermissionMask)op.ObjectData.OwnerMask;
-
-            if (Client.Settings.OBJECT_TRACKING)
-            {
-                Primitive findPrim = sim.Objects.Find(
-                        delegate(Primitive prim) { return prim.ID == props.ObjectID; });
-
-                if (findPrim != null)
-                {
-                    lock (sim.Objects.Prims)
-                    {
-                        if (sim.Objects.Prims.ContainsKey(findPrim.LocalID))
-                            sim.Objects.Prims[findPrim.LocalID].PropertiesFamily = props;
-                    }
-                }
-            }
-
-            FireOnObjectPropertiesFamily(sim, props);
-        }
-
-        #endregion Packet Handlers
-
-        #region Utility Functions
-
-        /// <summary>
-        /// Setup the ObjectData parameters for a basic wooden cube prim
-        /// </summary>
-        /// <returns>ObjectData struct representing a basic wooden cube prim</returns>
-        public static LLObject.ObjectData BuildCube()
-        {
-            LLObject.ObjectData prim = new LLObject.ObjectData();
-
-            prim.PCode = PCode.Prim;
-            prim.Material = LLObject.MaterialType.Wood;
-            prim.ProfileCurve = LLObject.ProfileCurve.Square;
-            prim.PathCurve = LLObject.PathCurve.Line;
-            prim.ProfileEnd = 1f;
-            prim.PathEnd = 1f;
-            prim.PathScaleX = 1f;
-            prim.PathScaleY = 1f;
-            prim.PathRevolutions = 1f;
-
-            return prim;
-        }
-
-        protected void SetAvatarSittingOn(Simulator sim, Avatar av, uint localid, uint oldSeatID)
-        {
-            if (av.LocalID == Client.Self.localID) Client.Self.sittingOn = localid;
-            av.sittingOn = localid;
-
-
-            if (OnAvatarSitChanged != null && oldSeatID != localid)
-            {
-                try { OnAvatarSitChanged(sim, av, localid, oldSeatID); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-		protected void UpdateDilation(Simulator s, uint dilation)
-		{
-            s.Stats.Dilation = (float)dilation / 65535.0f;
-        }
-
-        #endregion Utility Functions
-
-        #region Event Notification
-
-        protected void FireOnObjectProperties(Simulator sim, LLObject.ObjectProperties props)
-        {
-            if (OnObjectProperties != null)
-            {
-                try { OnObjectProperties(sim, props); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnObjectPropertiesFamily(Simulator sim, LLObject.ObjectPropertiesFamily props)
-        {
-            if (OnObjectPropertiesFamily != null)
-            {
-                try { OnObjectPropertiesFamily(sim, props); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnObjectKilled(Simulator simulator, uint localid)
-        {
-            if (OnObjectKilled != null)
-            {
-                try { OnObjectKilled(simulator, localid); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnNewPrim(Simulator simulator, Primitive prim, ulong RegionHandle, ushort TimeDilation)
-        {
-            if (OnNewPrim != null)
-            {
-                try { OnNewPrim(simulator, prim, RegionHandle, TimeDilation); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnNewFoliage(Simulator simulator, Primitive prim, ulong RegionHandle, ushort TimeDilation)
-        {
-            if (OnNewFoliage != null)
-            {
-                try { OnNewFoliage(simulator, prim, RegionHandle, TimeDilation); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnNewAttachment(Simulator simulator, Primitive prim, ulong RegionHandle, ushort TimeDilation)
-        {
-            if (OnNewAttachment != null)
-            {
-                try { OnNewAttachment(simulator, prim, RegionHandle, TimeDilation); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnNewAvatar(Simulator simulator, Avatar avatar, ulong RegionHandle, ushort TimeDilation)
-        {
-            if (OnNewAvatar != null)
-            {
-                try { OnNewAvatar(simulator, avatar, RegionHandle, TimeDilation); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnObjectUpdated(Simulator simulator, ObjectUpdate update, ulong RegionHandle, ushort TimeDilation)
-        {
-            if (OnObjectUpdated != null)
-            {
-                try { OnObjectUpdated(simulator, update, RegionHandle, TimeDilation); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        #endregion
-
-        #region Object Tracking Link
-
-        protected Primitive GetPrimitive(Simulator simulator, uint localID, LLUUID fullID)
-        {
-            if (Client.Settings.OBJECT_TRACKING)
-            {
-                Primitive prim;
-
-                if (simulator.Objects.Prims.TryGetValue(localID, out prim))
-                {
-                    return prim;
-                }
-                else
-                {
-                    prim = new Primitive();
-                    prim.LocalID = localID;
-                    prim.ID = fullID;
-                    lock (simulator.Objects.Prims)
-                        simulator.Objects.Prims[localID] = prim;
-
-                    return prim;
-                }
-            }
-            else
-            {
-                return new Primitive();
-            }
-        }
-
-        protected Avatar GetAvatar(Simulator simulator, uint localID, LLUUID fullID)
-        {
-            if (Client.Settings.OBJECT_TRACKING)
-            {
-                Avatar avatar;
-
-                if (simulator.Objects.Avatars.TryGetValue(localID, out avatar))
-                {
-                    return avatar;
-                }
-                else
-                {
-                    avatar = new Avatar();
-                    avatar.LocalID = localID;
-                    avatar.ID = fullID;
-                    lock (simulator.Objects.Avatars)
-                        simulator.Objects.Avatars[localID] = avatar;
-
-                    return avatar;
-                }
-            }
-            else
-            {
-                return new Avatar();
-            }
-        }
-
-        #endregion Object Tracking Link
-
-        protected void InterpolationTimer_Elapsed(object obj)
-        {
-            if (Client.Network.Connected)
-            {
-                int interval = Environment.TickCount - Client.Self.lastInterpolation;
-                float seconds = (float)interval / 1000f;
-
-                // Iterate through all of the simulators
-                lock (Client.Network.Simulators)
-                {
-                    for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                    {
-                        float adjSeconds = seconds * Client.Network.Simulators[i].Stats.Dilation;
-
-                        // Iterate through all of this sims avatars
-                        lock (Client.Network.Simulators[i].Objects.Avatars)
-                        {
-                            foreach (Avatar avatar in Client.Network.Simulators[i].Objects.Avatars.Values)
-                            {
-                                #region Linear Motion
-                                // Only do movement interpolation (extrapolation) when there is a non-zero velocity but
-                                // no acceleration
-                                if (avatar.Acceleration != LLVector3.Zero && avatar.Velocity == LLVector3.Zero)
-                                {
-                                    avatar.Position += (avatar.Velocity + (0.5f * (adjSeconds - HAVOK_TIMESTEP)) *
-                                        avatar.Acceleration) * adjSeconds;
-                                    avatar.Velocity = avatar.Velocity + avatar.Acceleration * adjSeconds;
-                                }
-                                #endregion Linear Motion
-                            }
-                        }
-
-                        // Iterate through all of this sims primitives
-                        lock (Client.Network.Simulators[i].Objects.Prims)
-                        {
-                            foreach (Primitive prim in Client.Network.Simulators[i].Objects.Prims.Values)
-                            {
-                                if (prim.Joint == Primitive.JointType.Invalid)
-                                {
-                                    #region Angular Velocity
-                                    LLVector3 angVel = prim.AngularVelocity;
-                                    float omega = LLVector3.MagSquared(angVel);
-
-                                    if (omega > 0.00001f)
-                                    {
-                                        omega = (float)Math.Sqrt(omega);
-                                        float angle = omega * adjSeconds;
-                                        angVel *= 1.0f / omega;
-                                        LLQuaternion dQ = new LLQuaternion(angle, angVel);
-
-                                        prim.Rotation *= dQ;
-                                    }
-                                    #endregion Angular Velocity
-
-                                    #region Linear Motion
-                                    // Only do movement interpolation (extrapolation) when there is a non-zero velocity but
-                                    // no acceleration
-                                    if (prim.Acceleration != LLVector3.Zero && prim.Velocity == LLVector3.Zero)
-                                    {
-                                        prim.Position += (prim.Velocity + (0.5f * (adjSeconds - HAVOK_TIMESTEP)) *
-                                        prim.Acceleration) * adjSeconds;
-                                        prim.Velocity = prim.Velocity + prim.Acceleration * adjSeconds;
-                                    }
-                                    #endregion Linear Motion
-                                }
-                                else if (prim.Joint == Primitive.JointType.Hinge)
-                                {
-                                    //FIXME: Hinge movement extrapolation
-                                }
-                                else if (prim.Joint == Primitive.JointType.Point)
-                                {
-                                    //FIXME: Point movement extrapolation
-                                }
-                                else
-                                {
-                                    Client.Log("Unhandled joint type " + prim.Joint, Helpers.LogLevel.Warning);
-                                }
-                            }
-                        }
-                    }
-                }
-
-                // Make sure the last interpolated time is always updated
-                Client.Self.lastInterpolation = Environment.TickCount;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/ObjectPoolBase.cs b/old/libsl1550/libsecondlife/ObjectPoolBase.cs
deleted file mode 100644
index f38b5d9..0000000
--- a/old/libsl1550/libsecondlife/ObjectPoolBase.cs
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-
-namespace libsecondlife
-{
-    public sealed class WrappedObject<T> : IDisposable where T : class
-    {
-        private T _instance;
-        internal readonly ObjectPoolSegment<T> _owningSegment;
-        internal readonly ObjectPoolBase<T> _owningObjectPool;
-        private bool _disposed = false;
-
-        internal WrappedObject(ObjectPoolBase<T> owningPool, ObjectPoolSegment<T> ownerSegment, T activeInstance)
-        {
-            _owningObjectPool = owningPool;
-            _owningSegment = ownerSegment;
-            _instance = activeInstance;
-        }
-
-        ~WrappedObject()
-        {
-#if !PocketPC
-            // If the AppDomain is being unloaded, or the CLR is
-            // shutting down, just exit gracefully
-            if (Environment.HasShutdownStarted)
-                return;
-#endif
-
-            // Object Resurrection in Action!
-            GC.ReRegisterForFinalize(this);
-
-            // Return this instance back to the owning queue
-            _owningObjectPool.CheckIn(_owningSegment, _instance);
-        }
-
-        /// <summary>
-        /// Returns an instance of the class that has been checked out of the Object Pool.
-        /// </summary>
-        public T Instance
-        {
-            get
-            {
-                if (_disposed)
-                    throw new ObjectDisposedException("WrappedObject");
-                return _instance;
-            }
-        }
-
-        /// <summary>
-        /// Checks the instance back into the object pool
-        /// </summary>
-        public void Dispose()
-        {
-            if (_disposed)
-                return;
-
-            _disposed = true;
-            _owningObjectPool.CheckIn(_owningSegment, _instance);
-            GC.SuppressFinalize(this);
-        }
-    }
-
-    public abstract class ObjectPoolBase<T> : IDisposable where T : class
-    {
-        private int _itemsPerSegment = 32;
-        private int _minimumSegmentCount = 1;
-
-        // A segment won't be eligible for cleanup unless it's at least this old...
-        private TimeSpan _minimumAgeToCleanup = new TimeSpan(0, 5, 0);
-
-        // ever increasing segment counter
-        private int _activeSegment = 0;
-
-        private bool _gc = true;
-
-        private volatile bool _disposed = false;
-
-        private Dictionary<int, ObjectPoolSegment<T>> _segments = new Dictionary<int, ObjectPoolSegment<T>>();
-        private object _syncRoot = new object();
-        private object _timerLock = new object();
-
-        // create a timer that starts in 5 minutes, and gets called every 5 minutes.
-        System.Threading.Timer _timer;
-        int _cleanupFrequency;
-
-        /// <summary>
-        /// Creates a new instance of the ObjectPoolBase class. Initialize MUST be called
-        /// after using this constructor.
-        /// </summary>
-        protected ObjectPoolBase()
-        {
-        }
-
-        /// <summary>
-        /// Creates a new instance of the ObjectPool Base class.
-        /// </summary>
-        /// <param name="itemsPerSegment">The object pool is composed of segments, which
-        /// are allocated whenever the size of the pool is exceeded. The number of items
-        /// in a segment should be large enough that allocating a new segmeng is a rare
-        /// thing. For example, on a server that will have 10k people logged in at once,
-        /// the receive buffer object pool should have segment sizes of at least 1000
-        /// byte arrays per segment.
-        /// </param>
-        /// <param name="minimumSegmentCount">The minimun number of segments that may exist.</param>
-        /// <param name="gcOnPoolGrowth">Perform a full GC.Collect whenever a segment is allocated, and then again after allocation to compact the heap.</param>
-        /// <param name="cleanupFrequenceMS">The frequency which segments are checked to see if they're eligible for cleanup.</param>
-        protected ObjectPoolBase(int itemsPerSegment, int minimumSegmentCount, bool gcOnPoolGrowth, int cleanupFrequenceMS)
-        {
-            Initialize(itemsPerSegment, minimumSegmentCount, gcOnPoolGrowth, cleanupFrequenceMS);
-        }
-
-        protected void Initialize(int itemsPerSegment, int minimumSegmentCount, bool gcOnPoolGrowth, int cleanupFrequenceMS)
-        {
-            _itemsPerSegment = itemsPerSegment;
-            _minimumSegmentCount = minimumSegmentCount;
-            _gc = gcOnPoolGrowth;
-
-            // force garbage collection to make sure these new long lived objects
-            // cause as little fragmentation as possible
-            if (_gc)
-                System.GC.Collect();
-
-            lock (_syncRoot)
-            {
-                while (_segments.Count < this.MinimumSegmentCount)
-                {
-                    ObjectPoolSegment<T> segment = CreateSegment(false);
-                    _segments.Add(segment.SegmentNumber, segment);
-                }
-            }
-
-            // This forces a compact, to make sure our objects fill in any holes in the heap.
-            if (_gc)
-            {
-                System.GC.Collect();
-            }
-
-            _timer = new Timer(CleanupThreadCallback, null, cleanupFrequenceMS, cleanupFrequenceMS);
-        }
-
-        /// <summary>
-        /// Forces the segment cleanup algorithm to be run. This method is intended
-        /// primarly for use from the Unit Test libraries.
-        /// </summary>
-        internal void ForceCleanup()
-        {
-            CleanupThreadCallback(null);
-        }
-
-        private void CleanupThreadCallback(object state)
-        {
-            if (_disposed)
-                return;
-
-            if (Monitor.TryEnter(_timerLock) == false)
-                return;
-
-            try
-            {
-                lock (_syncRoot)
-                {
-                    // If we're below, or at, or minimum segment count threshold,
-                    // there's no point in going any further.
-                    if (_segments.Count <= _minimumSegmentCount)
-                        return;
-
-                    for (int i = _activeSegment; i > 0; i--)
-                    {
-                        ObjectPoolSegment<T> segment;
-                        if (_segments.TryGetValue(i, out segment) == true)
-                        {
-                            // For the "old" segments that were allocated at startup, this will
-                            // always be false, as their expiration dates are set at infinity.
-                            if (segment.CanBeCleanedUp())
-                            {
-                                _segments.Remove(i);
-                                segment.Dispose();
-                            }
-                        }
-                    }
-                }
-            }
-            finally
-            {
-                Monitor.Exit(_timerLock);
-            }
-        }
-
-        /// <summary>
-        /// Responsible for allocate 1 instance of an object that will be stored in a segment.
-        /// </summary>
-        /// <returns>An instance of whatever objec the pool is pooling.</returns>
-        protected abstract T GetObjectInstance();
-
-
-        private ObjectPoolSegment<T> CreateSegment(bool allowSegmentToBeCleanedUp)
-        {
-            if (_disposed)
-                throw new ObjectDisposedException("ObjectPoolBase");
-
-
-            // This method is called inside a lock, so no interlocked stuff required.
-            int segmentToAdd = _activeSegment;
-            _activeSegment++;
-
-            Queue<T> buffers = new Queue<T>();
-            for (int i = 1; i <= this._itemsPerSegment; i++)
-            {
-                T obj = GetObjectInstance();
-                buffers.Enqueue(obj);
-            }
-
-            // certain segments we don't want to ever be cleaned up (the initial segments)
-            DateTime cleanupTime = (allowSegmentToBeCleanedUp) ? DateTime.Now.Add(this._minimumAgeToCleanup) : DateTime.MaxValue;
-            ObjectPoolSegment<T> segment = new ObjectPoolSegment<T>(segmentToAdd, buffers, cleanupTime);
-
-            return segment;
-        }
-
-
-        /// <summary>
-        /// Checks in an instance of T owned by the object pool. This method is only intended to be called
-        /// by the <c>WrappedObject</c> class.
-        /// </summary>
-        /// <param name="owningSegment">The segment from which the instance is checked out.</param>
-        /// <param name="instance">The instance of <c>T</c> to check back into the segment.</param>
-        internal void CheckIn(ObjectPoolSegment<T> owningSegment, T instance)
-        {
-            lock (_syncRoot)
-            {
-                owningSegment.CheckInObject(instance);
-            }
-        }
-
-        /// <summary>
-        /// Checks an instance of <c>T</c> from the pool. If the pool is not sufficient to
-        /// allow the checkout, a new segment is created.
-        /// </summary>
-        /// <returns>A <c>WrappedObject</c> around the instance of <c>T</c>. To check
-        /// the instance back into the segment, be sureto dispose the WrappedObject
-        /// when finished. </returns>
-        public WrappedObject<T> CheckOut()
-        {
-            if (_disposed)
-                throw new ObjectDisposedException("ObjectPoolBase");
-
-            // It's key that this CheckOut always, always, uses a pooled object
-            // from the oldest available segment. This will help keep the "newer"
-            // segments from being used - which in turn, makes them eligible
-            // for deletion.
-
-
-            lock (_syncRoot)
-            {
-                ObjectPoolSegment<T> targetSegment = null;
-
-                // find the oldest segment that has items available for checkout
-                for (int i = 0; i < _activeSegment; i++)
-                {
-                    ObjectPoolSegment<T> segment;
-                    if (_segments.TryGetValue(i, out segment) == true)
-                    {
-                        if (segment.AvailableItems > 0)
-                        {
-                            targetSegment = segment;
-                            break;
-                        }
-                    }
-                }
-
-                if (targetSegment == null)
-                {
-                    // We couldn't find a sigment that had any available space in it,
-                    // so it's time to create a new segment.
-
-                    // Before creating the segment, do a GC to make sure the heap
-                    // is compacted.
-                    if (_gc) GC.Collect();
-
-                    targetSegment = CreateSegment(true);
-
-                    if (_gc) GC.Collect();
-
-                    _segments.Add(targetSegment.SegmentNumber, targetSegment);
-                }
-
-                WrappedObject<T> obj = new WrappedObject<T>(this, targetSegment, targetSegment.CheckOutObject());
-                return obj;
-            }
-        }
-
-        /// <summary>
-        /// The total number of segments created. Intended to be used by the Unit Tests.
-        /// </summary>
-        public int TotalSegments
-        {
-            get
-            {
-                if (_disposed)
-                    throw new ObjectDisposedException("ObjectPoolBase");
-
-                lock (_syncRoot)
-                {
-                    return _segments.Count;
-                }
-            }
-        }
-
-        /// <summary>
-        /// The number of items that are in a segment. Items in a segment
-        /// are all allocated at the same time, and are hopefully close to
-        /// each other in the managed heap.
-        /// </summary>
-        public int ItemsPerSegment
-        {
-            get
-            {
-                if (_disposed)
-                    throw new ObjectDisposedException("ObjectPoolBase");
-
-                return _itemsPerSegment;
-            }
-        }
-
-        /// <summary>
-        /// The minimum number of segments. When segments are reclaimed,
-        /// this number of segments will always be left alone. These
-        /// segments are allocated at startup.
-        /// </summary>
-        public int MinimumSegmentCount
-        {
-            get
-            {
-                if (_disposed)
-                    throw new ObjectDisposedException("ObjectPoolBase");
-
-                return _minimumSegmentCount;
-            }
-        }
-
-        /// <summary>
-        /// The age a segment must be before it's eligible for cleanup.
-        /// This  is used to prevent thrash, and typical values are in
-        /// the 5 minute range.
-        /// </summary>
-        public TimeSpan MinimumSegmentAgePriorToCleanup
-        {
-            get
-            {
-                if (_disposed)
-                    throw new ObjectDisposedException("ObjectPoolBase");
-
-                return _minimumAgeToCleanup;
-            }
-            set
-            {
-                if (_disposed)
-                    throw new ObjectDisposedException("ObjectPoolBase");
-
-                _minimumAgeToCleanup = value;
-            }
-        }
-
-        /// <summary>
-        /// The frequence which the cleanup thread runs. This is typically
-        /// expected to be in the 5 minute range.
-        /// </summary>
-        public int CleanupFrequencyMilliseconds
-        {
-            get
-            {
-                if (_disposed)
-                    throw new ObjectDisposedException("ObjectPoolBase");
-
-                return _cleanupFrequency;
-            }
-            set
-            {
-                if (_disposed)
-                    throw new ObjectDisposedException("ObjectPoolBase");
-
-                Interlocked.Exchange(ref _cleanupFrequency, value);
-
-                _timer.Change(_cleanupFrequency, _cleanupFrequency);
-            }
-        }
-
-        #region IDisposable Members
-
-        public void Dispose()
-        {
-            if (_disposed)
-                return;
-
-            Dispose(true);
-
-            GC.SuppressFinalize(this);
-        }
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (disposing)
-            {
-                lock (_syncRoot)
-                {
-                    if (_disposed)
-                        return;
-
-                    _timer.Dispose();
-                    _disposed = true;
-
-                    foreach (KeyValuePair<int, ObjectPoolSegment<T>> kvp in _segments)
-                    {
-                        try
-                        {
-                            kvp.Value.Dispose();
-                        }
-                        catch (Exception) { }
-                    }
-
-                    _segments.Clear();
-                }
-            }
-        }
-
-        #endregion
-    }
-
-    internal class ObjectPoolSegment<T> : IDisposable where T : class
-    {
-        private Queue<T> _liveInstances = new Queue<T>();
-        private int _segmentNumber;
-        private int _originalCount;
-        private bool _isDisposed = false;
-        private DateTime _eligibleForDeletionAt;
-
-        public int SegmentNumber { get { return _segmentNumber; } }
-        public int AvailableItems { get { return _liveInstances.Count; } }
-        public DateTime DateEligibleForDeletion { get { return _eligibleForDeletionAt; } }
-
-        public ObjectPoolSegment(int segmentNumber, Queue<T> liveInstances, DateTime eligibleForDeletionAt)
-        {
-            _segmentNumber = segmentNumber;
-            _liveInstances = liveInstances;
-            _originalCount = liveInstances.Count;
-            _eligibleForDeletionAt = eligibleForDeletionAt;
-        }
-
-        public bool CanBeCleanedUp()
-        {
-            if (_isDisposed == true)
-                throw new ObjectDisposedException("ObjectPoolSegment");
-
-            return ((_originalCount == _liveInstances.Count) && (DateTime.Now > _eligibleForDeletionAt));
-        }
-
-        public void Dispose()
-        {
-            if (_isDisposed)
-                return;
-
-            _isDisposed = true;
-
-            bool shouldDispose = (typeof(T) is IDisposable);
-            while (_liveInstances.Count != 0)
-            {
-                T instance = _liveInstances.Dequeue();
-                if (shouldDispose)
-                {
-                    try
-                    {
-                        (instance as IDisposable).Dispose();
-                    }
-                    catch (Exception) { }
-                }
-            }
-        }
-
-        internal void CheckInObject(T o)
-        {
-            if (_isDisposed == true)
-                throw new ObjectDisposedException("ObjectPoolSegment");
-
-            _liveInstances.Enqueue(o);
-        }
-
-        internal T CheckOutObject()
-        {
-            if (_isDisposed == true)
-                throw new ObjectDisposedException("ObjectPoolSegment");
-
-            if (0 == _liveInstances.Count)
-                throw new InvalidOperationException("No Objects Available for Checkout");
-
-            T o = _liveInstances.Dequeue();
-            return o;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/ObjectTracker.cs b/old/libsl1550/libsecondlife/ObjectTracker.cs
deleted file mode 100644
index 71a8618..0000000
--- a/old/libsl1550/libsecondlife/ObjectTracker.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-namespace libsecondlife
-{
-    public class ObjectTracker
-    {
-        internal Dictionary<uint, Avatar> Avatars = new Dictionary<uint, Avatar>();
-        internal Dictionary<uint, Primitive> Prims = new Dictionary<uint, Primitive>();
-
-        #region Properties
-
-        public int AvatarCount
-        {
-            get { return Avatars.Count; }
-        }
-
-        public int PrimCount
-        {
-            get { return Prims.Count; }
-        }
-
-        #endregion Properties
-
-        public bool TryGetValue(uint objectLocalID, out LLObject obj)
-        {
-            Avatar avatar;
-            Primitive prim;
-
-            if (Avatars.TryGetValue(objectLocalID, out avatar))
-            {
-                obj = avatar;
-                return true;
-            }
-
-            if (Prims.TryGetValue(objectLocalID, out prim))
-            {
-                obj = prim;
-                return true;
-            }
-
-            obj = null;
-            return false;
-        }
-
-        public bool TryGetAvatar(uint avatarLocalID, out Avatar avatar)
-        {
-            return Avatars.TryGetValue(avatarLocalID, out avatar);
-        }
-
-        public bool TryGetPrimitive(uint primLocalID, out Primitive prim)
-        {
-            return Prims.TryGetValue(primLocalID, out prim);
-        }
-
-        public List<Primitive> FindAll(Predicate<Primitive> match)
-        {
-            List<Primitive> found = new List<Primitive>();
-            lock (Prims)
-            {
-                foreach (KeyValuePair<uint, Primitive> kvp in Prims)
-                {
-                    if (match(kvp.Value))
-                        found.Add(kvp.Value);
-                }
-            }
-            return found;
-        }
-
-        public List<Avatar> FindAll(Predicate<Avatar> match)
-        {
-            List<Avatar> found = new List<Avatar>();
-            lock (Avatars)
-            {
-                foreach (KeyValuePair<uint, Avatar> kvp in Avatars)
-                {
-                    if (match(kvp.Value))
-                        found.Add(kvp.Value);
-                }
-            }
-            return found;
-        }
-
-        public Primitive Find(Predicate<Primitive> match)
-        {
-            lock (Prims)
-            {
-                foreach (Primitive prim in Prims.Values)
-                {
-                    if (match(prim))
-                        return prim;
-                }
-            }
-            return null;
-        }
-
-        public Avatar Find(Predicate<Avatar> match)
-        {
-            lock (Avatars)
-            {
-                foreach (Avatar avatar in Avatars.Values)
-                {
-                    if (match(avatar))
-                        return avatar;
-                }
-            }
-            return null;
-        }
-
-        public void ForEach(Action<Primitive> action)
-        {
-            lock (Prims)
-            {
-                foreach (Primitive prim in Prims.Values)
-                {
-                    action(prim);
-                }
-            }
-        }
-
-        public void ForEach(Action<Avatar> action)
-        {
-            lock (Avatars)
-            {
-                foreach (Avatar avatar in Avatars.Values)
-                {
-                    action(avatar);
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/OpenJPEG.cs b/old/libsl1550/libsecondlife/OpenJPEG.cs
deleted file mode 100644
index 0937110..0000000
--- a/old/libsl1550/libsecondlife/OpenJPEG.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-using System;
-using System.IO;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Runtime.InteropServices;
-using libsecondlife;
-
-namespace OpenJPEGNet
-{
-#if !NO_UNSAFE
-
-    public class OpenJPEG
-    {
-        // This structure is used to marchal both encoded and decoded images
-        // MUST MATCH THE STRUCT IN libsl.h!
-        [StructLayout(LayoutKind.Sequential, Pack = 4)]
-        private struct MarshalledImage
-        {
-            public IntPtr encoded;             // encoded image data
-            public int length;                 // encoded image length
-            public int dummy; // padding for 64-bit alignment
-
-            public IntPtr decoded;             // decoded image, contiguous components
-            public int width;                  // width of decoded image
-            public int height;                 // height of decoded image
-            public int components;             // component count
-        }
-
-        // allocate encoded buffer based on length field
-        [DllImport("openjpeg-libsl.dll", CallingConvention = CallingConvention.Cdecl)]
-        private static extern bool LibslAllocEncoded(ref MarshalledImage image);
-
-        // allocate decoded buffer based on width and height fields
-        [DllImport("openjpeg-libsl.dll", CallingConvention = CallingConvention.Cdecl)]
-        private static extern bool LibslAllocDecoded(ref MarshalledImage image);
-
-        // free buffers
-        [DllImport("openjpeg-libsl.dll", CallingConvention = CallingConvention.Cdecl)]
-        private static extern bool LibslFree(ref MarshalledImage image);
-
-        // encode raw to jpeg2000
-        [DllImport("openjpeg-libsl.dll", CallingConvention = CallingConvention.Cdecl)]
-        private static extern bool LibslEncode(ref MarshalledImage image, bool lossless);
-
-        // decode jpeg2000 to raw
-        [DllImport("openjpeg-libsl.dll", CallingConvention = CallingConvention.Cdecl)]
-        private static extern bool LibslDecode(ref MarshalledImage image);
-
-        // encode
-        public static byte[] Encode(libsecondlife.Image image, bool lossless)
-        {
-            if (
-                (image.Channels & ImageChannels.Color) == 0 ||
-                ((image.Channels & ImageChannels.Bump) != 0 && (image.Channels & ImageChannels.Alpha) == 0))
-                throw new ArgumentException("JPEG2000 encoding is not supported for this channel combination");
-
-            MarshalledImage marshalled = new MarshalledImage();
-
-            // allocate and copy to input buffer
-            marshalled.width = image.Width;
-            marshalled.height = image.Height;
-            marshalled.components = 3;
-            if ((image.Channels & ImageChannels.Alpha) != 0) marshalled.components++;
-            if ((image.Channels & ImageChannels.Bump) != 0) marshalled.components++;
-
-            if (!LibslAllocDecoded(ref marshalled))
-                throw new Exception("LibslAllocDecoded failed");
-
-            int n = image.Width * image.Height;
-
-            if ((image.Channels & ImageChannels.Color) != 0)
-            {
-                Marshal.Copy(image.Red, 0, marshalled.decoded, n);
-                Marshal.Copy(image.Green, 0, (IntPtr)(marshalled.decoded.ToInt64() + n), n);
-                Marshal.Copy(image.Blue, 0, (IntPtr)(marshalled.decoded.ToInt64() + n * 2), n);
-            }
-
-            if ((image.Channels & ImageChannels.Alpha) != 0) Marshal.Copy(image.Alpha, 0, (IntPtr)(marshalled.decoded.ToInt64() + n * 3), n);
-            if ((image.Channels & ImageChannels.Bump) != 0) Marshal.Copy(image.Bump, 0, (IntPtr)(marshalled.decoded.ToInt64() + n * 4), n);
-
-            // codec will allocate output buffer
-            if (!LibslEncode(ref marshalled, lossless))
-                throw new Exception("LibslEncode failed");
-
-            // copy output buffer
-            byte[] encoded = new byte[marshalled.length];
-            Marshal.Copy(marshalled.encoded, encoded, 0, marshalled.length);
-
-            // free buffers
-            LibslFree(ref marshalled);
-
-            return encoded;
-        }
-
-        public static byte[] Encode(libsecondlife.Image image)
-        {
-            return Encode(image, false);
-        }
-
-        public static libsecondlife.Image Decode(byte[] encoded)
-        {
-            MarshalledImage marshalled = new MarshalledImage();
-
-            // allocate and copy to input buffer
-            marshalled.length = encoded.Length;
-            LibslAllocEncoded(ref marshalled);
-            Marshal.Copy(encoded, 0, marshalled.encoded, encoded.Length);
-
-            // codec will allocate output buffer
-            LibslDecode(ref marshalled);
-
-            libsecondlife.Image image;
-            int n = marshalled.width * marshalled.height;
-
-            switch (marshalled.components)
-            {
-                case 1: // grayscale
-                    image = new libsecondlife.Image(marshalled.width, marshalled.height, ImageChannels.Color);
-                    Marshal.Copy(marshalled.decoded, image.Red, 0, n);
-                    Array.Copy(image.Red, image.Green, n);
-                    Array.Copy(image.Red, image.Blue, n);
-                    break;
-
-                case 2: // grayscale + alpha
-                    image = new libsecondlife.Image(marshalled.width, marshalled.height, ImageChannels.Color | ImageChannels.Alpha);
-                    Marshal.Copy(marshalled.decoded, image.Red, 0, n);
-                    Array.Copy(image.Red, image.Green, n);
-                    Array.Copy(image.Red, image.Blue, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n), image.Alpha, 0, n);
-                    break;
-
-                case 3: // RGB
-                    image = new libsecondlife.Image(marshalled.width, marshalled.height, ImageChannels.Color);
-                    Marshal.Copy(marshalled.decoded, image.Red, 0, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n), image.Green, 0, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n * 2), image.Blue, 0, n);
-                    break;
-
-                case 4: // RGBA
-                    image = new libsecondlife.Image(marshalled.width, marshalled.height, ImageChannels.Color | ImageChannels.Alpha);
-                    Marshal.Copy(marshalled.decoded, image.Red, 0, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n), image.Green, 0, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n * 2), image.Blue, 0, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n * 3), image.Alpha, 0, n);
-                    break;
-
-                case 5: // RGBBA
-                    image = new libsecondlife.Image(marshalled.width, marshalled.height, ImageChannels.Color | ImageChannels.Alpha | ImageChannels.Bump);
-                    Marshal.Copy(marshalled.decoded, image.Red, 0, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n), image.Green, 0, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n * 2), image.Blue, 0, n);
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n * 3), image.Bump, 0, n); // bump comes before alpha in 5 channel encode
-                    Marshal.Copy((IntPtr)(marshalled.decoded.ToInt64() + n * 4), image.Alpha, 0, n);
-                    break;
-
-                default:
-                    throw new Exception("Decoded image with unhandled number of components (" + marshalled.components + ")");
-            }
-
-            // free buffers
-            LibslFree(ref marshalled);
-
-            return image;
-        }
-
-        public const int TGA_HEADER_SIZE = 32;
-
-        public static byte[] DecodeToTGA(byte[] encoded)
-        {
-            return Decode(encoded).ExportTGA();
-        }
-
-        public static System.Drawing.Image DecodeToImage(byte[] encoded)
-        {
-            return LoadTGAClass.LoadTGA(new MemoryStream(DecodeToTGA(encoded)));
-        }
-
-        public unsafe static byte[] EncodeFromImage(Bitmap bitmap, bool lossless)
-        {
-            BitmapData bd;
-            libsecondlife.Image decoded;
-
-            int bitmapWidth = bitmap.Width;
-            int bitmapHeight = bitmap.Height;
-            int pixelCount = bitmapWidth * bitmapHeight;
-            int i;
-
-            if ((bitmap.PixelFormat & PixelFormat.Alpha) != 0 || (bitmap.PixelFormat & PixelFormat.PAlpha) != 0)
-            {
-                // four layers, RGBA
-                decoded = new libsecondlife.Image(bitmapWidth, bitmapHeight, ImageChannels.Color | ImageChannels.Alpha);
-                bd = bitmap.LockBits(new Rectangle(0, 0, bitmapWidth, bitmapHeight), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
-                byte* pixel = (byte*)bd.Scan0;
-
-                for (i = 0; i < pixelCount; i++)
-                {
-                    // GDI+ gives us BGRA and we need to turn that in to RGBA
-                    decoded.Blue[i] = *(pixel++);
-                    decoded.Green[i] = *(pixel++);
-                    decoded.Red[i] = *(pixel++);
-                    decoded.Alpha[i] = *(pixel++);
-                }
-            }
-            else if (bitmap.PixelFormat == PixelFormat.Format16bppGrayScale)
-            {
-                // one layer
-                decoded = new libsecondlife.Image(bitmapWidth, bitmapHeight, ImageChannels.Color);
-                bd = bitmap.LockBits(new Rectangle(0, 0, bitmapWidth, bitmapHeight), ImageLockMode.ReadOnly, PixelFormat.Format16bppGrayScale);
-                byte* pixel = (byte*)bd.Scan0;
-
-                for (i = 0; i < pixelCount; i++)
-                {
-                    // turn 16 bit data in to 8 bit data (TODO: Does this work?)
-                    decoded.Red[i] = *(pixel);
-                    decoded.Green[i] = *(pixel);
-                    decoded.Blue[i] = *(pixel);
-                    pixel += 2;
-                }
-            }
-            else
-            {
-                // three layers, RGB
-                decoded = new libsecondlife.Image(bitmapWidth, bitmapHeight, ImageChannels.Color);
-                bd = bitmap.LockBits(new Rectangle(0, 0, bitmapWidth, bitmapHeight), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
-                byte* pixel = (byte*)bd.Scan0;
-
-                for (i = 0; i < pixelCount; i++)
-                {
-                    decoded.Blue[i] = *(pixel++);
-                    decoded.Green[i] = *(pixel++);
-                    decoded.Red[i] = *(pixel++);
-                }
-            }
-
-            bitmap.UnlockBits(bd);
-            byte[] encoded = Encode(decoded, lossless);
-            return encoded;
-        }
-    }
-
-#endif
-}
diff --git a/old/libsl1550/libsecondlife/ParcelManager.cs b/old/libsl1550/libsecondlife/ParcelManager.cs
deleted file mode 100644
index 1b52d74..0000000
--- a/old/libsl1550/libsecondlife/ParcelManager.cs
+++ /dev/null
@@ -1,1154 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    #region Structs
-
-    /// <summary>
-    /// Some information about a parcel of land
-    /// </summary>
-    public struct ParcelInfo
-    {
-        /// <summary></summary>
-        public LLUUID ID;
-        /// <summary></summary>
-        public LLUUID OwnerID;
-        /// <summary></summary>
-        public string Name;
-        /// <summary></summary>
-        public string Description;
-        /// <summary></summary>
-        public int ActualArea;
-        /// <summary></summary>
-        public int BillableArea;
-        /// <summary></summary>
-        public bool Mature;
-        /// <summary></summary>
-        public float GlobalX;
-        /// <summary></summary>
-        public float GlobalY;
-        /// <summary></summary>
-        public float GlobalZ;
-        /// <summary></summary>
-        public string SimName;
-        /// <summary></summary>
-        public LLUUID SnapshotID;
-        /// <summary></summary>
-        public float Dwell;
-        /// <summary></summary>
-        public int SalePrice;
-        /// <summary></summary>
-        public int AuctionID;
-    }
-
-    #endregion Structs
-
-    #region Parcel Class
-
-    /// <summary>
-    /// Parcel of land, a portion of virtual real estate in a simulator
-    /// </summary>
-    public struct Parcel
-    {
-        #region Enums
-
-        /// <summary>
-        /// Various parcel properties
-        /// </summary>
-        [Flags]
-        public enum ParcelFlags : uint
-        {
-            /// <summary>No flags set</summary>
-            None = 0,
-            /// <summary>Allow avatars to fly (a client-side only restriction)</summary>
-            AllowFly = 1 << 0,
-            /// <summary>Allow foreign scripts to run</summary>
-            AllowOtherScripts = 1 << 1,
-            /// <summary>This parcel is for sale</summary>
-            ForSale = 1 << 2,
-            /// <summary>Allow avatars to create a landmark on this parcel</summary>
-            AllowLandmark = 1 << 3,
-            /// <summary>Allows all avatars to edit the terrain on this parcel</summary>
-            AllowTerraform = 1 << 4,
-            /// <summary>Avatars have health and can take damage on this parcel.
-            /// If set, avatars can be killed and sent home here</summary>
-            AllowDamage = 1 << 5,
-            /// <summary>Foreign avatars can create objects here</summary>
-            CreateObjects = 1 << 6,
-            /// <summary>All objects on this parcel can be purchased</summary>
-            ForSaleObjects = 1 << 7,
-            /// <summary>Access is restricted to a group</summary>
-            UseAccessGroup = 1 << 8,
-            /// <summary>Access is restricted to a whitelist</summary>
-            UseAccessList = 1 << 9,
-            /// <summary>Ban blacklist is enabled</summary>
-            UseBanList = 1 << 10,
-            /// <summary>Unknown</summary>
-            UsePassList = 1 << 11,
-            /// <summary>List this parcel in the search directory</summary>
-            ShowDirectory = 1 << 12,
-            /// <summary>Unknown</summary>
-            AllowDeedToGroup = 1 << 13,
-            /// <summary>Unknown</summary>
-            ContributeWithDeed = 1 << 14,
-            /// <summary>Restrict sounds originating on this parcel to the
-            /// parcel boundaries</summary>
-            SoundLocal = 1 << 15,
-            /// <summary>Objects on this parcel are sold when the land is
-            /// purchsaed</summary>
-            SellParcelObjects = 1 << 16,
-            /// <summary>Allow this parcel to be published on the web</summary>
-            AllowPublish = 1 << 17,
-            /// <summary>The information for this parcel is mature content</summary>
-            MaturePublish = 1 << 18,
-            /// <summary>The media URL is an HTML page</summary>
-            UrlWebPage = 1 << 19,
-            /// <summary>The media URL is a raw HTML string</summary>
-            UrlRawHtml = 1 << 20,
-            /// <summary>Restrict foreign object pushes</summary>
-            RestrictPushObject = 1 << 21,
-            /// <summary>Ban all non identified/transacted avatars</summary>
-            DenyAnonymous = 1 << 22,
-            /// <summary>Ban all identified avatars</summary>
-            DenyIdentified = 1 << 23,
-            /// <summary>Ban all transacted avatars</summary>
-            DenyTransacted = 1 << 24,
-            /// <summary>Allow group-owned scripts to run</summary>
-            AllowGroupScripts = 1 << 25,
-            /// <summary>Allow object creation by group members or group
-            /// objects</summary>
-            CreateGroupObjects = 1 << 26,
-            /// <summary>Allow all objects to enter this parcel</summary>
-            AllowAllObjectEntry = 1 << 27,
-            /// <summary>Only allow group and owner objects to enter this parcel</summary>
-            AllowGroupObjectEntry = 1 << 28,
-            /// <summary>Voice Enabled on this parcel</summary>
-            AllowVoiceChat = 1 << 29,
-            /// <summary>Use Estate Voice channel for Voice on this parcel</summary>
-            UseEstateVoiceChan = 1 << 30
-        }
-
-        /// <summary>
-        /// Parcel ownership status
-        /// </summary>
-        public enum ParcelStatus : sbyte
-        {
-            /// <summary></summary>
-            None = -1,
-            /// <summary></summary>
-            Leased = 0,
-            /// <summary></summary>
-            LeasePending = 1,
-            /// <summary></summary>
-            Abandoned = 2
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum ParcelCategory : sbyte
-        {
-            /// <summary>No assigned category</summary>
-            None = 0,
-            /// <summary></summary>
-            Linden,
-            /// <summary></summary>
-            Adult,
-            /// <summary></summary>
-            Arts,
-            /// <summary></summary>
-            Business,
-            /// <summary></summary>
-            Educational,
-            /// <summary></summary>
-            Gaming,
-            /// <summary></summary>
-            Hangout,
-            /// <summary></summary>
-            Newcomer,
-            /// <summary></summary>
-            Park,
-            /// <summary></summary>
-            Residential,
-            /// <summary></summary>
-            Shopping,
-            /// <summary></summary>
-            Stage,
-            /// <summary></summary>
-            Other,
-            /// <summary>Not an actual category, only used for queries</summary>
-            Any = -1
-        }
-
-        #endregion Enums
-
-        /// <summary></summary>
-        public int RequestResult;
-        /// <summary></summary>
-        public int SequenceID;
-        /// <summary></summary>
-        public bool SnapSelection;
-        /// <summary></summary>
-        public int SelfCount;
-        /// <summary></summary>
-        public int OtherCount;
-        /// <summary></summary>
-        public int PublicCount;
-        /// <summary>Simulator-local ID of this parcel</summary>
-        public int LocalID;
-        /// <summary>UUID of the owner of this parcel</summary>
-        public LLUUID OwnerID;
-        /// <summary>Whether the land is deeded to a group or not</summary>
-        public bool IsGroupOwned;
-        /// <summary></summary>
-        public uint AuctionID;
-        /// <summary>Date land was claimed</summary>
-        public DateTime ClaimDate;
-        /// <summary>Appears to always be zero</summary>
-        public int ClaimPrice;
-        /// <summary></summary>
-        public int RentPrice;
-        /// <summary>Minimum corner of the axis-aligned bounding box for this
-        /// parcel</summary>
-        public LLVector3 AABBMin;
-        /// <summary>Maximum corner of the axis-aligned bounding box for this
-        /// parcel</summary>
-        public LLVector3 AABBMax;
-        /// <summary>Bitmap describing land layout in 4x4m squares across the
-        /// entire region</summary>
-        public byte[] Bitmap;
-        /// <summary>Total parcel land area</summary>
-        public int Area;
-        /// <summary></summary>
-        public ParcelStatus Status;
-        /// <summary>Maximum primitives across the entire simulator</summary>
-        public int SimWideMaxPrims;
-        /// <summary>Total primitives across the entire simulator</summary>
-        public int SimWideTotalPrims;
-        /// <summary>Maximum number of primitives this parcel supports</summary>
-        public int MaxPrims;
-        /// <summary>Total number of primitives on this parcel</summary>
-        public int TotalPrims;
-        /// <summary>Total number of primitives owned by the parcel owner on
-        /// this parcel</summary>
-        public int OwnerPrims;
-        /// <summary>Total number of primitives owned by the parcel group on
-        /// this parcel</summary>
-        public int GroupPrims;
-        /// <summary>Total number of other primitives on this parcel</summary>
-        public int OtherPrims;
-        /// <summary>Total number of primitives you are currently selecting and
-        /// sitting on</summary>
-        public int SelectedPrims;
-        /// <summary></summary>
-        public float ParcelPrimBonus;
-        /// <summary>Autoreturn value in minutes for others' objects</summary>
-        public int OtherCleanTime;
-        /// <summary></summary>
-        public ParcelFlags Flags;
-        /// <summary>Sale price of the parcel, only useful if ForSale is set</summary>
-        /// <remarks>The SalePrice will remain the same after an ownership
-        /// transfer (sale), so it can be used to see the purchase price after
-        /// a sale if the new owner has not changed it</remarks>
-        public int SalePrice;
-        /// <summary>Parcel Name</summary>
-        public string Name;
-        /// <summary>Parcel Description</summary>
-        public string Desc;
-        /// <summary>URL For Music Stream</summary>
-        public string MusicURL;
-        /// <summary>URL For other Media</summary>
-        public string MediaURL;
-        /// <summary>Key to Picture for Media Placeholder</summary>
-        public LLUUID MediaID;
-        /// <summary></summary>
-        public byte MediaAutoScale;
-        /// <summary></summary>
-        public LLUUID GroupID;
-        /// <summary>Price for a temporary pass</summary>
-        public int PassPrice;
-        /// <summary>How long is pass valid for</summary>
-        public float PassHours;
-        /// <summary></summary>
-        public ParcelCategory Category;
-        /// <summary>Key of authorized buyer</summary>
-        public LLUUID AuthBuyerID;
-        /// <summary>Key of parcel snapshot</summary>
-        public LLUUID SnapshotID;
-        /// <summary></summary>
-        public LLVector3 UserLocation;
-        /// <summary></summary>
-        public LLVector3 UserLookAt;
-        /// <summary></summary>
-        public byte LandingType;
-        /// <summary></summary>
-        public float Dwell;
-        /// <summary></summary>
-        public bool RegionDenyAnonymous;
-        /// <summary></summary>
-        public bool RegionDenyIdentified;
-        /// <summary></summary>
-        public bool RegionDenyTransacted;
-        /// <summary></summary>
-        public bool RegionPushOverride;
-        /// <summary></summary>
-        public Simulator Simulator;
-        /// <summary>Access list of who is whitelisted or blacklisted on this
-        /// parcel</summary>
-        public List<ParcelManager.ParcelAccessEntry> AccessList;
-
-        /// <summary>
-        /// Defalt constructor
-        /// </summary>
-        /// <param name="simulator">Simulator this parcel resides in</param>
-        /// <param name="localID">Local ID of this parcel</param>
-        public Parcel(Simulator simulator, int localID)
-        {
-            Simulator = simulator;
-            LocalID = localID;
-
-            RequestResult = 0;
-            SequenceID = 0;
-            SnapSelection = false;
-            SelfCount = 0;
-            OtherCount = 0;
-            PublicCount = 0;
-            OwnerID = LLUUID.Zero;
-            IsGroupOwned = false;
-            AuctionID = 0;
-            ClaimDate = Helpers.Epoch;
-            ClaimPrice = 0;
-            RentPrice = 0;
-            AABBMin = LLVector3.Zero;
-            AABBMax = LLVector3.Zero;
-            Bitmap = new byte[0];
-            Area = 0;
-            Status = ParcelStatus.None;
-            SimWideMaxPrims = 0;
-            SimWideTotalPrims = 0;
-            MaxPrims = 0;
-            TotalPrims = 0;
-            OwnerPrims = 0;
-            GroupPrims = 0;
-            OtherPrims = 0;
-            SelectedPrims = 0;
-            ParcelPrimBonus = 0;
-            OtherCleanTime = 0;
-            Flags = ParcelFlags.None;
-            SalePrice = 0;
-            Name = String.Empty;
-            Desc = String.Empty;
-            MusicURL = String.Empty;
-            MediaURL = String.Empty;
-            MediaID = LLUUID.Zero;
-            MediaAutoScale = 0x0;
-            GroupID = LLUUID.Zero;
-            PassPrice = 0;
-            PassHours = 0;
-            Category = ParcelCategory.None;
-            AuthBuyerID = LLUUID.Zero;
-            SnapshotID = LLUUID.Zero;
-            UserLocation = LLVector3.Zero;
-            UserLookAt = LLVector3.Zero;
-            LandingType = 0x0;
-            Dwell = 0;
-            RegionDenyAnonymous = false;
-            RegionDenyIdentified = false;
-            RegionDenyTransacted = false;
-            RegionPushOverride = false;
-            AccessList = new List<ParcelManager.ParcelAccessEntry>(0);
-        }
-
-        /// <summary>
-        /// Update the simulator with any local changes to this Parcel object
-        /// </summary>
-        /// <param name="wantReply">Whether we want the simulator to confirm
-        /// the update with a reply packet or not</param>
-        public void Update(bool wantReply)
-        {
-            ParcelPropertiesUpdatePacket request = new ParcelPropertiesUpdatePacket();
-
-            request.AgentData.AgentID = Simulator.Client.Self.AgentID;
-            request.AgentData.SessionID = Simulator.Client.Self.SessionID;
-
-            request.ParcelData.LocalID = this.LocalID;
-
-            request.ParcelData.AuthBuyerID = this.AuthBuyerID;
-            request.ParcelData.Category = (byte)this.Category;
-            request.ParcelData.Desc = Helpers.StringToField(this.Desc);
-            request.ParcelData.GroupID = this.GroupID;
-            request.ParcelData.LandingType = this.LandingType;
-            request.ParcelData.MediaAutoScale = this.MediaAutoScale;
-            request.ParcelData.MediaID = this.MediaID;
-            request.ParcelData.MediaURL = Helpers.StringToField(this.MediaURL);
-            request.ParcelData.MusicURL = Helpers.StringToField(this.MusicURL);
-            request.ParcelData.Name = Helpers.StringToField(this.Name);
-            if (wantReply) request.ParcelData.Flags = 1;
-            request.ParcelData.ParcelFlags = (uint)this.Flags;
-            request.ParcelData.PassHours = this.PassHours;
-            request.ParcelData.PassPrice = this.PassPrice;
-            request.ParcelData.SalePrice = this.SalePrice;
-            request.ParcelData.SnapshotID = this.SnapshotID;
-            request.ParcelData.UserLocation = this.UserLocation;
-            request.ParcelData.UserLookAt = this.UserLookAt;
-
-            Simulator.Client.Network.SendPacket(request, Simulator);
-
-            UpdateOtherCleanTime();
-        }
-
-        public void UpdateOtherCleanTime()
-        {
-            ParcelSetOtherCleanTimePacket request = new ParcelSetOtherCleanTimePacket();
-            request.AgentData.AgentID = Simulator.Client.Self.AgentID;
-            request.AgentData.SessionID = Simulator.Client.Self.SessionID;
-            request.ParcelData.LocalID = this.LocalID;
-            request.ParcelData.OtherCleanTime = this.OtherCleanTime;
-
-            Simulator.Client.Network.SendPacket(request, Simulator);
-        }
-    }
-
-    #endregion Parcel Class
-
-    /// <summary>
-    /// Parcel (subdivided simulator lots) subsystem
-    /// </summary>
-    public class ParcelManager
-    {
-        #region Enums
-
-        /// <summary>
-        /// Type of return to use when returning objects from a parcel
-        /// </summary>
-        public enum ObjectReturnType : uint
-        {
-            /// <summary></summary>
-            None = 0,
-            /// <summary></summary>
-            Owner = 1 << 1,
-            /// <summary></summary>
-            Group = 1 << 2,
-            /// <summary></summary>
-            Other = 1 << 3,
-            /// <summary></summary>
-            List = 1 << 4,
-            /// <summary></summary>
-            Sell = 1 << 5
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum ParcelAccessFlags : uint
-        {
-            /// <summary></summary>
-            NoAccess = 0,
-            /// <summary></summary>
-            Access = 1
-        }
-
-        /// <summary>
-        /// The result of a request for parcel properties
-        /// </summary>
-        public enum ParcelResult : int
-        {
-            /// <summary>No matches were found for the request</summary>
-            NoData = -1,
-            /// <summary>Request matched a single parcel</summary>
-            Single = 0,
-            /// <summary>Request matched multiple parcels</summary>
-            Multiple = 1
-        }
-
-        /// <summary>
-        /// Flags used in the ParcelAccessListRequest packet to specify whether
-        /// we want the access list (whitelist), ban list (blacklist), or both
-        /// </summary>
-        [Flags]
-        public enum AccessList : uint
-        {
-            /// <summary>Request the access list</summary>
-            Access = 1 << 0,
-            /// <summary>Request the ban list</summary>
-            Ban = 1 << 1,
-            /// <summary>Request both the access list and ban list</summary>
-            Both = Access | Ban
-        }
-
-        /// <summary>
-        /// Simulator sent Sequence IDs for ParcelPropertiesReply packets
-        /// </summary>
-        public enum SequenceStatus : int
-        {
-            /// <summary>Parcel currently selected</summary>
-            ParcelSelected = -10000,
-            /// <summary>Parcel restricted to group avatar not member of</summary>
-            Collision_Not_In_Group = -20000,
-            /// <summary>Avatar banned from parcel</summary>
-            Collision_Banned = -30000,
-            /// <summary>Parcel restricted to access list in which avatar is not on.</summary>
-            Collision_Not_On_AccessList = -40000,
-            /// <summary>response to hovered over parcel</summary>
-            Hovered_Over_Parcel = -50000
-        }
-
-        #endregion Enums
-
-        #region Structs
-
-        /// <summary>
-        ///
-        /// </summary>
-        public struct ParcelAccessEntry
-        {
-            /// <summary></summary>
-            public LLUUID AgentID;
-            /// <summary></summary>
-            public DateTime Time;
-            /// <summary></summary>
-            public AccessList Flags;
-        }
-
-        public struct ParcelPrimOwners
-        {
-            public LLUUID OwnerID;
-            public bool IsGroupOwned;
-            public int Count;
-            public bool OnlineStatus;
-        }
-        #endregion Structs
-
-        #region Delegates
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="parcelID">UUID of the requested parcel</param>
-        /// <param name="localID">Simulator-local ID of the requested parcel</param>
-        /// <param name="dwell">Dwell value of the requested parcel</param>
-        public delegate void ParcelDwellCallback(LLUUID parcelID, int localID, float dwell);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="parcel"></param>
-        public delegate void ParcelInfoCallback(ParcelInfo parcel);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="parcel">Full properties for a single parcel. If result
-        /// is NoData this will be incomplete or incorrect data</param>
-        /// <param name="result">Success of the query</param>
-        /// <param name="sequenceID">User-assigned identifier for the query</param>
-        /// <param name="snapSelection">User-assigned boolean for the query</param>
-        public delegate void ParcelPropertiesCallback(Parcel parcel, ParcelResult result, int sequenceID, bool snapSelection);
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="sequenceID"></param>
-        /// <param name="localID"></param>
-        /// <param name="flags"></param>
-        /// <param name="accessEntries"></param>
-        public delegate void ParcelAccessListReplyCallback(Simulator simulator, int sequenceID, int localID, uint flags, List<ParcelAccessEntry> accessEntries);
-
-        /// <summary>
-        /// Responses to a request for prim owners on a parcel
-        /// </summary>
-        /// <param name="simulator">simulator parcel is in</param>
-        /// <param name="localID">LocalID of parcel</param>
-        /// <param name="primownersEntries">List containing details or prim ownership</param>
-        public delegate void ParcelObjectOwnersListReplyCallback(Simulator simulator,  List<ParcelPrimOwners> primOwners);
-
-        /// <summary>
-        /// Fired when all parcels are downloaded from simulator
-        /// </summary>
-        /// <param name="simulator">Simulator the parcel is in</param>
-        /// <param name="simParcels">Read-only dictionary containing parcel details for the simulator</param>
-        /// <param name="parcelMap">64,64 array containing sim position to localID mapping</param>
-        public delegate void SimParcelsDownloaded(Simulator simulator, SafeDictionary<int, Parcel> simParcels, int[,] parcelMap);
-
-        #endregion Delegates
-
-        #region Events
-
-        /// <summary></summary>
-        public event ParcelDwellCallback OnParcelDwell;
-        /// <summary></summary>
-        public event ParcelInfoCallback OnParcelInfo;
-        /// <summary></summary>
-        public event ParcelPropertiesCallback OnParcelProperties;
-        /// <summary></summary>
-        public event ParcelAccessListReplyCallback OnAccessListReply;
-        /// <summary></summary>
-        public event ParcelObjectOwnersListReplyCallback OnPrimOwnersListReply;
-        /// <summary></summary>
-        public event SimParcelsDownloaded OnSimParcelsDownloaded;
-
-        #endregion Events
-
-        private SecondLife Client;
-
-        #region Public Methods
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client">A reference to the SecondLife client</param>
-        public ParcelManager(SecondLife client)
-        {
-            Client = client;
-            // Setup the callbacks
-            Client.Network.RegisterCallback(PacketType.ParcelInfoReply, new NetworkManager.PacketCallback(ParcelInfoReplyHandler));
-            Client.Network.RegisterCallback(PacketType.ParcelProperties, new NetworkManager.PacketCallback(ParcelPropertiesHandler));
-            Client.Network.RegisterCallback(PacketType.ParcelDwellReply, new NetworkManager.PacketCallback(ParcelDwellReplyHandler));
-            Client.Network.RegisterCallback(PacketType.ParcelAccessListReply, new NetworkManager.PacketCallback(ParcelAccessListReplyHandler));
-            Client.Network.RegisterCallback(PacketType.ParcelObjectOwnersReply, new NetworkManager.PacketCallback(ParcelObjectOwnersReplyHandler));
-        }
-
-        /// <summary>
-        /// Request basic information for a single parcel
-        /// </summary>
-        /// <param name="parcelID">Simulator-local ID of the parcel</param>
-        public void InfoRequest(LLUUID parcelID)
-        {
-            ParcelInfoRequestPacket request = new ParcelInfoRequestPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.Data.ParcelID = parcelID;
-
-            Client.Network.SendPacket(request);
-        }
-
-        /// <summary>
-        /// Request properties of a single parcel
-        /// </summary>
-        /// <param name="simulator">Simulator containing the parcel</param>
-        /// <param name="localID">Simulator-local ID of the parcel</param>
-        /// <param name="sequenceID">An arbitrary integer that will be returned
-        /// with the ParcelProperties reply, useful for distinguishing between
-        /// multiple simultaneous requests</param>
-        public void PropertiesRequest(Simulator simulator, int localID, int sequenceID)
-        {
-            ParcelPropertiesRequestByIDPacket request = new ParcelPropertiesRequestByIDPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-
-            request.ParcelData.LocalID = localID;
-            request.ParcelData.SequenceID = sequenceID;
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        /// Request the access list for a single parcel
-        /// </summary>
-        /// <param name="simulator">Simulator containing the parcel</param>
-        /// <param name="localID">Simulator-local ID of the parcel</param>
-        /// <param name="sequenceID">An arbitrary integer that will be returned
-        /// with the ParcelAccessList reply, useful for distinguishing between
-        /// multiple simultaneous requests</param>
-        public void AccessListRequest(Simulator simulator, int localID, AccessList flags, int sequenceID)
-        {
-            ParcelAccessListRequestPacket request = new ParcelAccessListRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.Data.LocalID = localID;
-            request.Data.Flags = (uint)flags;
-            request.Data.SequenceID = sequenceID;
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        /// Request properties of parcels using a bounding box selection
-        /// </summary>
-        /// <param name="simulator">Simulator containing the parcel</param>
-        /// <param name="north">Northern boundary of the parcel selection</param>
-        /// <param name="east">Eastern boundary of the parcel selection</param>
-        /// <param name="south">Southern boundary of the parcel selection</param>
-        /// <param name="west">Western boundary of the parcel selection</param>
-        /// <param name="sequenceID">An arbitrary integer that will be returned
-        /// with the ParcelProperties reply, useful for distinguishing between
-        /// different types of parcel property requests</param>
-        /// <param name="snapSelection">A boolean that is returned with the
-        /// ParcelProperties reply, useful for snapping focus to a single
-        /// parcel</param>
-        public void PropertiesRequest(Simulator simulator, float north, float east, float south, float west,
-            int sequenceID, bool snapSelection)
-        {
-            ParcelPropertiesRequestPacket request = new ParcelPropertiesRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.ParcelData.North = north;
-            request.ParcelData.East = east;
-            request.ParcelData.South = south;
-            request.ParcelData.West = west;
-            request.ParcelData.SequenceID = sequenceID;
-            request.ParcelData.SnapSelection = snapSelection;
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        /// Request all simulator parcel properties (used for populating the <code>Simulator.Parcels</code>
-        /// dictionary)
-        /// </summary>
-        /// <param name="simulator">Simulator to request parcels from (must be connected)</param>
-        public void RequestAllSimParcels(Simulator simulator)
-        {
-            Thread th = new Thread(delegate()
-            {
-                int y, x;
-                for (y = 0; y < 64; y++)
-                {
-                    for (x = 0; x < 64; x++)
-                    {
-                        if (simulator.ParcelMap[y, x] == 0)
-                        {
-                            Client.Parcels.PropertiesRequest(simulator,
-                                                             (y + 1) * 4.0f, (x + 1) * 4.0f,
-                                                             y * 4.0f, x * 4.0f, 0, false);
-                            // Pause for 50 ms after every request to avoid flooding the sim
-                            System.Threading.Thread.Sleep(50);
-                        }
-                    }
-                }
-            });
-            th.Start();
-        }
-
-        /// <summary>
-        /// Request the dwell value for a parcel
-        /// </summary>
-        /// <param name="simulator">Simulator containing the parcel</param>
-        /// <param name="localID">Simulator-local ID of the parcel</param>
-        public void DwellRequest(Simulator simulator, int localID)
-        {
-            ParcelDwellRequestPacket request = new ParcelDwellRequestPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-            request.Data.LocalID = localID;
-            request.Data.ParcelID = LLUUID.Zero; // Not used by clients
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="forGroup"></param>
-        /// <param name="groupID"></param>
-        /// <param name="removeContribution"></param>
-        /// <returns></returns>
-        public void Buy(Simulator simulator, int localID, bool forGroup, LLUUID groupID,
-            bool removeContribution, int parcelArea, int parcelPrice)
-        {
-            ParcelBuyPacket request = new ParcelBuyPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-
-            request.Data.Final = true;
-            request.Data.GroupID = groupID;
-            request.Data.LocalID = localID;
-            request.Data.IsGroupOwned = forGroup;
-            request.Data.RemoveContribution = removeContribution;
-
-            request.ParcelData.Area = parcelArea;
-            request.ParcelData.Price = parcelPrice;
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        public void Reclaim(Simulator simulator, int localID)
-        {
-            ParcelReclaimPacket request = new ParcelReclaimPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-
-            request.Data.LocalID = localID;
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="groupID"></param>
-        public void DeedToGroup(Simulator simulator, int localID, LLUUID groupID)
-        {
-            ParcelDeedToGroupPacket request = new ParcelDeedToGroupPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-
-            request.Data.LocalID = localID;
-            request.Data.GroupID = groupID;
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        /// Request prim owners of a parcel of land.
-        /// </summary>
-        /// <param name="simulator">Simulator parcel is in</param>
-        /// <param name="localID">local ID # of parcel</param>
-        public void ObjectOwnersRequest(Simulator simulator, int localID)
-        {
-            ParcelObjectOwnersRequestPacket request = new ParcelObjectOwnersRequestPacket();
-
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-
-            request.ParcelData.LocalID = localID;
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="localID"></param>
-        /// <param name="type"></param>
-        /// <param name="ownerIDs"></param>
-        public void ReturnObjects(Simulator simulator, int localID, ObjectReturnType type, List<LLUUID> ownerIDs)
-        {
-            ParcelReturnObjectsPacket request = new ParcelReturnObjectsPacket();
-            request.AgentData.AgentID = Client.Self.AgentID;
-            request.AgentData.SessionID = Client.Self.SessionID;
-
-            request.ParcelData.LocalID = localID;
-            request.ParcelData.ReturnType = (uint)type;
-
-            // A single null TaskID is (not) used for parcel object returns
-            request.TaskIDs = new ParcelReturnObjectsPacket.TaskIDsBlock[1];
-            request.TaskIDs[0] = new ParcelReturnObjectsPacket.TaskIDsBlock();
-            request.TaskIDs[0].TaskID = LLUUID.Zero;
-
-            // Convert the list of owner UUIDs to packet blocks if a list is given
-            if (ownerIDs != null)
-            {
-                request.OwnerIDs = new ParcelReturnObjectsPacket.OwnerIDsBlock[ownerIDs.Count];
-
-                for (int i = 0; i < ownerIDs.Count; i++)
-                {
-                    request.OwnerIDs[i] = new ParcelReturnObjectsPacket.OwnerIDsBlock();
-                    request.OwnerIDs[i].OwnerID = ownerIDs[i];
-                }
-            }
-            else
-            {
-                request.OwnerIDs = new ParcelReturnObjectsPacket.OwnerIDsBlock[0];
-            }
-
-            Client.Network.SendPacket(request, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="west"></param>
-        /// <param name="south"></param>
-        /// <param name="east"></param>
-        /// <param name="north"></param>
-        public void ParcelSubdivide(Simulator simulator, float west, float south, float east, float north)
-        {
-            ParcelDividePacket divide = new ParcelDividePacket();
-            divide.AgentData.AgentID = Client.Self.AgentID;
-            divide.AgentData.SessionID = Client.Self.SessionID;
-            divide.ParcelData.East = east;
-            divide.ParcelData.North = north;
-            divide.ParcelData.South = south;
-            divide.ParcelData.West = west;
-
-            Client.Network.SendPacket(divide, simulator);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="west"></param>
-        /// <param name="south"></param>
-        /// <param name="east"></param>
-        /// <param name="north"></param>
-        public void ParcelJoin(Simulator simulator, float west, float south, float east, float north)
-        {
-            ParcelJoinPacket join = new ParcelJoinPacket();
-            join.AgentData.AgentID = Client.Self.AgentID;
-            join.AgentData.SessionID = Client.Self.SessionID;
-            join.ParcelData.East = east;
-            join.ParcelData.North = north;
-            join.ParcelData.South = south;
-            join.ParcelData.West = west;
-
-            Client.Network.SendPacket(join, simulator);
-        }
-
-        /// <summary>
-        /// Gets a parcel LocalID
-        /// </summary>
-        /// <param name="simulator">Simulator parcel is in</param>
-        /// <param name="position">llVector3 position in simulator (Z not used)</param>
-        /// <returns>0 on failure, or parcel LocalID on success.</returns>
-        /// <remarks>A call to <code>Parcels.RequestAllSimParcels</code> is required to populate map &
-        /// dictionary.</remarks>
-        public int GetParcelLocalID(Simulator simulator, LLVector3 position)
-        {
-            return simulator.ParcelMap[(byte)position.Y / 4, (byte)position.X / 4];
-        }
-
-        #endregion Public Methods
-
-        #region Packet Handlers
-
-        private void ParcelDwellReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnParcelDwell != null)
-            {
-                ParcelDwellReplyPacket dwell = (ParcelDwellReplyPacket)packet;
-
-                lock (simulator.Parcels.Dictionary)
-                {
-                    if (simulator.Parcels.Dictionary.ContainsKey(dwell.Data.LocalID))
-                    {
-                        Parcel parcel = simulator.Parcels.Dictionary[dwell.Data.LocalID];
-                        parcel.Dwell = dwell.Data.Dwell;
-                        simulator.Parcels.Dictionary[dwell.Data.LocalID] = parcel;
-                    }
-                }
-
-                try { OnParcelDwell(dwell.Data.ParcelID, dwell.Data.LocalID, dwell.Data.Dwell); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void ParcelInfoReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnParcelInfo != null)
-            {
-                ParcelInfoReplyPacket info = (ParcelInfoReplyPacket)packet;
-
-                ParcelInfo parcelInfo = new ParcelInfo();
-
-                parcelInfo.ActualArea = info.Data.ActualArea;
-                parcelInfo.AuctionID = info.Data.AuctionID;
-                parcelInfo.BillableArea = info.Data.BillableArea;
-                parcelInfo.Description = Helpers.FieldToUTF8String(info.Data.Desc);
-                parcelInfo.Dwell = info.Data.Dwell;
-                parcelInfo.GlobalX = info.Data.GlobalX;
-                parcelInfo.GlobalY = info.Data.GlobalY;
-                parcelInfo.GlobalZ = info.Data.GlobalZ;
-                parcelInfo.ID = info.Data.ParcelID;
-                parcelInfo.Mature = ((info.Data.Flags & 1) != 0) ? true : false;
-                parcelInfo.Name = Helpers.FieldToUTF8String(info.Data.Name);
-                parcelInfo.OwnerID = info.Data.OwnerID;
-                parcelInfo.SalePrice = info.Data.SalePrice;
-                parcelInfo.SimName = Helpers.FieldToUTF8String(info.Data.SimName);
-                parcelInfo.SnapshotID = info.Data.SnapshotID;
-
-                try { OnParcelInfo(parcelInfo); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void ParcelPropertiesHandler(Packet packet, Simulator simulator)
-        {
-            if (OnParcelProperties != null || Client.Settings.PARCEL_TRACKING == true)
-            {
-                ParcelPropertiesPacket properties = (ParcelPropertiesPacket)packet;
-
-                Parcel parcel = new Parcel(simulator, properties.ParcelData.LocalID);
-
-                parcel.AABBMax = properties.ParcelData.AABBMax;
-                parcel.AABBMin = properties.ParcelData.AABBMin;
-                parcel.Area = properties.ParcelData.Area;
-                parcel.AuctionID = properties.ParcelData.AuctionID;
-                parcel.AuthBuyerID = properties.ParcelData.AuthBuyerID;
-                parcel.Bitmap = properties.ParcelData.Bitmap;
-                parcel.Category = (Parcel.ParcelCategory)(sbyte)properties.ParcelData.Category;
-                parcel.ClaimDate = Helpers.UnixTimeToDateTime((uint)properties.ParcelData.ClaimDate);
-                // ClaimPrice seems to always be zero?
-                parcel.ClaimPrice = properties.ParcelData.ClaimPrice;
-                parcel.Desc = Helpers.FieldToUTF8String(properties.ParcelData.Desc);
-                parcel.GroupID = properties.ParcelData.GroupID;
-                parcel.GroupPrims = properties.ParcelData.GroupPrims;
-                parcel.IsGroupOwned = properties.ParcelData.IsGroupOwned;
-                parcel.LandingType = properties.ParcelData.LandingType;
-                parcel.MaxPrims = properties.ParcelData.MaxPrims;
-                parcel.MediaAutoScale = properties.ParcelData.MediaAutoScale;
-                parcel.MediaID = properties.ParcelData.MediaID;
-                parcel.MediaURL = Helpers.FieldToUTF8String(properties.ParcelData.MediaURL);
-                parcel.MusicURL = Helpers.FieldToUTF8String(properties.ParcelData.MusicURL);
-                parcel.Name = Helpers.FieldToUTF8String(properties.ParcelData.Name);
-                parcel.OtherCleanTime = properties.ParcelData.OtherCleanTime;
-                parcel.OtherCount = properties.ParcelData.OtherCount;
-                parcel.OtherPrims = properties.ParcelData.OtherPrims;
-                parcel.OwnerID = properties.ParcelData.OwnerID;
-                parcel.OwnerPrims = properties.ParcelData.OwnerPrims;
-                parcel.Flags = (Parcel.ParcelFlags)properties.ParcelData.ParcelFlags;
-                parcel.ParcelPrimBonus = properties.ParcelData.ParcelPrimBonus;
-                parcel.PassHours = properties.ParcelData.PassHours;
-                parcel.PassPrice = properties.ParcelData.PassPrice;
-                parcel.PublicCount = properties.ParcelData.PublicCount;
-                parcel.RegionDenyAnonymous = properties.ParcelData.RegionDenyAnonymous;
-                parcel.RegionDenyIdentified = properties.ParcelData.RegionDenyIdentified;
-                parcel.RegionDenyTransacted = properties.ParcelData.RegionDenyTransacted;
-                parcel.RegionPushOverride = properties.ParcelData.RegionPushOverride;
-                parcel.RentPrice = properties.ParcelData.RentPrice;
-                parcel.SalePrice = properties.ParcelData.SalePrice;
-                parcel.SelectedPrims = properties.ParcelData.SelectedPrims;
-                parcel.SelfCount = properties.ParcelData.SelfCount;
-                parcel.SimWideMaxPrims = properties.ParcelData.SimWideMaxPrims;
-                parcel.SimWideTotalPrims = properties.ParcelData.SimWideTotalPrims;
-                parcel.SnapshotID = properties.ParcelData.SnapshotID;
-                parcel.Status = (Parcel.ParcelStatus)(sbyte)properties.ParcelData.Status;
-                parcel.TotalPrims = properties.ParcelData.TotalPrims;
-                parcel.UserLocation = properties.ParcelData.UserLocation;
-                parcel.UserLookAt = properties.ParcelData.UserLookAt;
-
-                // store parcel in dictionary
-                if (Client.Settings.PARCEL_TRACKING)
-                {
-                    lock (simulator.Parcels.Dictionary)
-                        simulator.Parcels.Dictionary[parcel.LocalID] = parcel;
-
-                    int y, x, index, bit;
-                    for (y = 0; y < simulator.ParcelMap.GetLength(0); y++)
-                    {
-                        for (x = 0; x < simulator.ParcelMap.GetLength(1); x++)
-                        {
-                            if (simulator.ParcelMap[y, x] == 0)
-                            {
-                                index = (y * 64) + x;
-                                bit = index % 8;
-                                index >>= 3;
-
-                                if ((parcel.Bitmap[index] & (1 << bit)) != 0)
-                                    simulator.ParcelMap[y, x] = parcel.LocalID;
-                            }
-                        }
-
-                    }
-                }
-
-                // Fire the callback for parcel properties being received
-                if (OnParcelProperties != null)
-                {
-                    try
-                    {
-                        OnParcelProperties(parcel, (ParcelResult)properties.ParcelData.RequestResult,
-                            properties.ParcelData.SequenceID, properties.ParcelData.SnapSelection);
-                    }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-
-                // Check if all of the simulator parcels have been retrieved, if so fire another callback
-                if (OnSimParcelsDownloaded != null && simulator.IsParcelMapFull())
-                {
-                    try { OnSimParcelsDownloaded(simulator, simulator.Parcels, simulator.ParcelMap); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        protected void ParcelAccessListReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnAccessListReply != null)
-            {
-                ParcelAccessListReplyPacket reply = (ParcelAccessListReplyPacket)packet;
-                List<ParcelAccessEntry> accessList = new List<ParcelAccessEntry>(reply.List.Length);
-
-                for (int i = 0; i < reply.List.Length; i++)
-                {
-                    ParcelAccessEntry pae = new ParcelAccessEntry();
-                    pae.AgentID = reply.List[i].ID;
-                    pae.Flags = (AccessList)reply.List[i].Flags;
-                    pae.Time = Helpers.UnixTimeToDateTime((uint)reply.List[i].Time);
-
-                    accessList.Add(pae);
-                }
-
-                lock (simulator.Parcels.Dictionary)
-                {
-                    if (simulator.Parcels.Dictionary.ContainsKey(reply.Data.LocalID))
-                    {
-                        Parcel parcel = simulator.Parcels.Dictionary[reply.Data.LocalID];
-                        parcel.AccessList = accessList;
-                        simulator.Parcels.Dictionary[reply.Data.LocalID] = parcel;
-                    }
-                }
-
-                try { OnAccessListReply(simulator, reply.Data.SequenceID, reply.Data.LocalID, reply.Data.Flags,
-                    accessList); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        private void ParcelObjectOwnersReplyHandler(Packet packet, Simulator simulator)
-        {
-            if (OnPrimOwnersListReply != null)
-            {
-                ParcelObjectOwnersReplyPacket reply = (ParcelObjectOwnersReplyPacket)packet;
-                List<ParcelPrimOwners> primOwners = new List<ParcelPrimOwners>();
-
-                for (int i = 0; i < reply.Data.Length; i++)
-                {
-                    ParcelPrimOwners poe = new ParcelPrimOwners();
-
-                    poe.OwnerID = reply.Data[i].OwnerID;
-                    poe.IsGroupOwned = reply.Data[i].IsGroupOwned;
-                    poe.Count = reply.Data[i].Count;
-                    poe.OnlineStatus = reply.Data[i].OnlineStatus;
-                    primOwners.Add(poe);
-                }
-                try { OnPrimOwnersListReply(simulator, primOwners); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-
-        }
-
-        #endregion Packet Handlers
-    }
-}
diff --git a/old/libsl1550/libsecondlife/ParticleSystem.cs b/old/libsl1550/libsecondlife/ParticleSystem.cs
deleted file mode 100644
index db01f35..0000000
--- a/old/libsl1550/libsecondlife/ParticleSystem.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-
-namespace libsecondlife
-{
-    public partial class Primitive
-    {
-        /// <summary>
-        ///
-        /// </summary>
-        public struct ParticleSystem
-        {
-            /// <summary>
-            ///
-            /// </summary>
-            public enum SourcePattern : byte
-            {
-                /// <summary></summary>
-                None = 0,
-                /// <summary></summary>
-                Drop = 0x01,
-                /// <summary></summary>
-                Explode = 0x02,
-                /// <summary></summary>
-                Angle = 0x04,
-                /// <summary></summary>
-                AngleCone = 0x08,
-                /// <summary></summary>
-                AngleConeEmpty = 0x10
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            [Flags]
-            public enum ParticleDataFlags : uint
-            {
-                /// <summary></summary>
-                None = 0,
-                /// <summary></summary>
-                InterpColor = 0x001,
-                /// <summary></summary>
-                InterpScale = 0x002,
-                /// <summary></summary>
-                Bounce = 0x004,
-                /// <summary></summary>
-                Wind = 0x008,
-                /// <summary></summary>
-                FollowSrc = 0x010,
-                /// <summary></summary>
-                FollowVelocity = 0x020,
-                /// <summary></summary>
-                TargetPos = 0x040,
-                /// <summary></summary>
-                TargetLinear = 0x080,
-                /// <summary></summary>
-                Emissive = 0x100,
-                /// <summary></summary>
-                Beam = 0x200
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            [Flags]
-            public enum ParticleFlags : uint
-            {
-                /// <summary></summary>
-                None = 0,
-                /// <summary>Acceleration and velocity for particles are
-                /// relative to the object rotation</summary>
-                ObjectRelative = 0x01,
-                /// <summary>Particles use new 'correct' angle parameters</summary>
-                UseNewAngle = 0x02
-            }
-
-
-            public uint CRC;
-            /// <summary></summary>
-            /// <remarks>There appears to be more data packed in to this area
-            /// for many particle systems. It doesn't appear to be flag values
-            /// and serialization breaks unless there is a flag for every
-            /// possible bit so it is left as an unsigned integer</remarks>
-            public uint PartFlags;
-            public SourcePattern Pattern;
-            public float MaxAge;
-            public float StartAge;
-            public float InnerAngle;
-            public float OuterAngle;
-            public float BurstRate;
-            public float BurstRadius;
-            public float BurstSpeedMin;
-            public float BurstSpeedMax;
-            public byte BurstPartCount;
-            public LLVector3 AngularVelocity;
-            public LLVector3 PartAcceleration;
-            public LLUUID Texture;
-            public LLUUID Target;
-            public ParticleDataFlags PartDataFlags;
-            public float PartMaxAge;
-            public LLColor PartStartColor;
-            public LLColor PartEndColor;
-            public float PartStartScaleX;
-            public float PartStartScaleY;
-            public float PartEndScaleX;
-            public float PartEndScaleY;
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <param name="data"></param>
-            /// <param name="pos"></param>
-            public ParticleSystem(byte[] data, int pos)
-            {
-                // TODO: Not sure exactly how many bytes we need here, so partial
-                // (truncated) data will cause an exception to be thrown
-                if (data.Length > 0)
-                {
-                    BitPack pack = new BitPack(data, pos);
-
-                    CRC = pack.UnpackUBits(32);
-                    PartFlags = pack.UnpackUBits(32);
-                    Pattern = (SourcePattern)pack.UnpackByte();
-                    MaxAge = pack.UnpackFixed(false, 8, 8);
-                    StartAge = pack.UnpackFixed(false, 8, 8);
-                    InnerAngle = pack.UnpackFixed(false, 3, 5);
-                    OuterAngle = pack.UnpackFixed(false, 3, 5);
-                    BurstRate = pack.UnpackFixed(false, 8, 8);
-                    BurstRadius = pack.UnpackFixed(false, 8, 8);
-                    BurstSpeedMin = pack.UnpackFixed(false, 8, 8);
-                    BurstSpeedMax = pack.UnpackFixed(false, 8, 8);
-                    BurstPartCount = pack.UnpackByte();
-                    float x = pack.UnpackFixed(true, 8, 7);
-                    float y = pack.UnpackFixed(true, 8, 7);
-                    float z = pack.UnpackFixed(true, 8, 7);
-                    AngularVelocity = new LLVector3(x, y, z);
-                    x = pack.UnpackFixed(true, 8, 7);
-                    y = pack.UnpackFixed(true, 8, 7);
-                    z = pack.UnpackFixed(true, 8, 7);
-                    PartAcceleration = new LLVector3(x, y, z);
-                    Texture = pack.UnpackUUID();
-                    Target = pack.UnpackUUID();
-
-                    PartDataFlags = (ParticleDataFlags)pack.UnpackUBits(32);
-                    PartMaxAge = pack.UnpackFixed(false, 8, 8);
-                    byte r = pack.UnpackByte();
-                    byte g = pack.UnpackByte();
-                    byte b = pack.UnpackByte();
-                    byte a = pack.UnpackByte();
-                    PartStartColor = new LLColor(r, g, b, a);
-                    r = pack.UnpackByte();
-                    g = pack.UnpackByte();
-                    b = pack.UnpackByte();
-                    a = pack.UnpackByte();
-                    PartEndColor = new LLColor(r, g, b, a);
-                    PartStartScaleX = pack.UnpackFixed(false, 3, 5);
-                    PartStartScaleY = pack.UnpackFixed(false, 3, 5);
-                    PartEndScaleX = pack.UnpackFixed(false, 3, 5);
-                    PartEndScaleY = pack.UnpackFixed(false, 3, 5);
-                }
-                else
-                {
-                    CRC = PartFlags = 0;
-                    Pattern = SourcePattern.None;
-                    MaxAge = StartAge = InnerAngle = OuterAngle = BurstRate = BurstRadius = BurstSpeedMin =
-                        BurstSpeedMax = 0.0f;
-                    BurstPartCount = 0;
-                    AngularVelocity = PartAcceleration = LLVector3.Zero;
-                    Texture = Target = LLUUID.Zero;
-                    PartDataFlags = ParticleDataFlags.None;
-                    PartMaxAge = 0.0f;
-                    PartStartColor = PartEndColor = LLColor.Black;
-                    PartStartScaleX = PartStartScaleY = PartEndScaleX = PartEndScaleY = 0.0f;
-                }
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public byte[] GetBytes()
-            {
-                byte[] bytes = new byte[86];
-                BitPack pack = new BitPack(bytes, 0);
-
-                pack.PackBits(CRC, 32);
-                pack.PackBits((uint)PartFlags, 32);
-                pack.PackBits((uint)Pattern, 8);
-                pack.PackFixed(MaxAge, false, 8, 8);
-                pack.PackFixed(StartAge, false, 8, 8);
-                pack.PackFixed(InnerAngle, false, 3, 5);
-                pack.PackFixed(OuterAngle, false, 3, 5);
-                pack.PackFixed(BurstRate, false, 8, 8);
-                pack.PackFixed(BurstRadius, false, 8, 8);
-                pack.PackFixed(BurstSpeedMin, false, 8, 8);
-                pack.PackFixed(BurstSpeedMax, false, 8, 8);
-                pack.PackBits(BurstPartCount, 8);
-                pack.PackFixed(AngularVelocity.X, true, 8, 7);
-                pack.PackFixed(AngularVelocity.Y, true, 8, 7);
-                pack.PackFixed(AngularVelocity.Z, true, 8, 7);
-                pack.PackFixed(PartAcceleration.X, true, 8, 7);
-                pack.PackFixed(PartAcceleration.Y, true, 8, 7);
-                pack.PackFixed(PartAcceleration.Z, true, 8, 7);
-                pack.PackUUID(Texture);
-                pack.PackUUID(Target);
-
-                pack.PackBits((uint)PartDataFlags, 32);
-                pack.PackFixed(PartMaxAge, false, 8, 8);
-                pack.PackColor(PartStartColor);
-                pack.PackColor(PartEndColor);
-                pack.PackFixed(PartStartScaleX, false, 3, 5);
-                pack.PackFixed(PartStartScaleY, false, 3, 5);
-                pack.PackFixed(PartEndScaleX, false, 3, 5);
-                pack.PackFixed(PartEndScaleY, false, 3, 5);
-
-                return bytes;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Permissions.cs b/old/libsl1550/libsecondlife/Permissions.cs
deleted file mode 100644
index 2d7ea65..0000000
--- a/old/libsl1550/libsecondlife/Permissions.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-namespace libsecondlife
-{
-    /// <summary>
-    ///
-    /// </summary>
-    [Flags]
-    public enum PermissionMask : uint
-    {
-        None        = 0,
-        Transfer    = 1 << 13,
-        Modify      = 1 << 14,
-        Copy        = 1 << 15,
-        [Obsolete]
-        EnterParcel = 1 << 16,
-        [Obsolete]
-        Terraform   = 1 << 17,
-        [Obsolete]
-        OwnerDebit  = 1 << 18,
-        Move        = 1 << 19,
-        Damage      = 1 << 20,
-        All         = 0x7FFFFFFF
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    [Flags]
-    public enum PermissionWho : byte
-    {
-        /// <summary></summary>
-        Base = 0x01,
-        /// <summary></summary>
-        Owner = 0x02,
-        /// <summary></summary>
-        Group = 0x04,
-        /// <summary></summary>
-        Everyone = 0x08,
-        /// <summary></summary>
-        NextOwner = 0x10,
-        /// <summary></summary>
-        All = 0x1F
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public struct Permissions
-    {
-        public PermissionMask BaseMask;
-        public PermissionMask EveryoneMask;
-        public PermissionMask GroupMask;
-        public PermissionMask NextOwnerMask;
-        public PermissionMask OwnerMask;
-
-        public Permissions(uint baseMask, uint everyoneMask, uint groupMask, uint nextOwnerMask, uint ownerMask)
-        {
-            BaseMask = (PermissionMask)baseMask;
-            EveryoneMask = (PermissionMask)everyoneMask;
-            GroupMask = (PermissionMask)groupMask;
-            NextOwnerMask = (PermissionMask)nextOwnerMask;
-            OwnerMask = (PermissionMask)ownerMask;
-        }
-
-        public override string ToString()
-        {
-            return String.Format("Base: {0}, Everyone: {1}, Group: {2}, NextOwner: {3}, Owner: {4}",
-                BaseMask, EveryoneMask, GroupMask, NextOwnerMask, OwnerMask);
-        }
-
-        public static Permissions NoPermissions = new Permissions();
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Prims.cs b/old/libsl1550/libsecondlife/Prims.cs
deleted file mode 100644
index 06c659d..0000000
--- a/old/libsl1550/libsecondlife/Prims.cs
+++ /dev/null
@@ -1,663 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife
-{
-    public partial class Primitive : LLObject
-    {
-        #region Enums
-
-        /// <summary>
-        /// Extra parameters for primitives, these flags are for features that have
-        /// been added after the original ObjectFlags that has all eight bits
-        /// reserved already
-        /// </summary>
-        [Flags]
-        public enum ExtraParamType : ushort
-        {
-            /// <summary>Whether this object has flexible parameters</summary>
-            Flexible = 0x10,
-            /// <summary>Whether this object has light parameters</summary>
-            Light = 0x20,
-            /// <summary>Whether this object is a sculpted prim</summary>
-            Sculpt = 0x30
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum JointType : byte
-        {
-            /// <summary></summary>
-            Invalid = 0,
-            /// <summary></summary>
-            Hinge = 1,
-            /// <summary></summary>
-            Point = 2,
-            /// <summary></summary>
-            [Obsolete]
-            LPoint = 3,
-            /// <summary></summary>
-            [Obsolete]
-            Wheel = 4
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum SculptType : byte
-        {
-            /// <summary></summary>
-            None = 0,
-            /// <summary></summary>
-            Sphere = 1,
-            /// <summary></summary>
-            Torus = 2,
-            /// <summary></summary>
-            Plane = 3,
-            /// <summary></summary>
-            Cylinder = 4
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum FaceType : ushort
-        {
-            /// <summary></summary>
-            PathBegin = 0x1 << 0,
-            /// <summary></summary>
-            PathEnd = 0x1 << 1,
-            /// <summary></summary>
-            InnerSide = 0x1 << 2,
-            /// <summary></summary>
-            ProfileBegin = 0x1 << 3,
-            /// <summary></summary>
-            ProfileEnd = 0x1 << 4,
-            /// <summary></summary>
-            OuterSide0 = 0x1 << 5,
-            /// <summary></summary>
-            OuterSide1 = 0x1 << 6,
-            /// <summary></summary>
-            OuterSide2 = 0x1 << 7,
-            /// <summary></summary>
-            OuterSide3 = 0x1 << 8
-        }
-
-        #endregion Enums
-
-        #region Subclasses
-
-        /// <summary>
-        /// Controls the texture animation of a particular prim
-        /// </summary>
-        public struct TextureAnimation
-        {
-            /// <summary></summary>
-            public uint Flags;
-            /// <summary></summary>
-            public uint Face;
-            /// <summary></summary>
-            public uint SizeX;
-            /// <summary></summary>
-            public uint SizeY;
-            /// <summary></summary>
-            public float Start;
-            /// <summary></summary>
-            public float Length;
-            /// <summary></summary>
-            public float Rate;
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <param name="data"></param>
-            /// <param name="pos"></param>
-            public TextureAnimation(byte[] data, int pos)
-            {
-                if (data.Length >= 16)
-                {
-                    Flags = (uint)data[pos++];
-                    Face = (uint)data[pos++];
-                    SizeX = (uint)data[pos++];
-                    SizeY = (uint)data[pos++];
-
-                    Start = Helpers.BytesToFloat(data, pos);
-                    Length = Helpers.BytesToFloat(data, pos + 4);
-                    Rate = Helpers.BytesToFloat(data, pos + 8);
-                }
-                else
-                {
-                    Flags = 0;
-                    Face = 0;
-                    SizeX = 0;
-                    SizeY = 0;
-
-                    Start = 0.0f;
-                    Length = 0.0f;
-                    Rate = 0.0f;
-                }
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public byte[] GetBytes()
-            {
-                byte[] data = new byte[16];
-                int pos = 0;
-
-                data[0] = (byte)Flags;
-                data[1] = (byte)Face;
-                data[2] = (byte)SizeX;
-                data[3] = (byte)SizeY;
-
-                Helpers.FloatToBytes(Start).CopyTo(data, pos + 4);
-                Helpers.FloatToBytes(Length).CopyTo(data, pos + 8);
-                Helpers.FloatToBytes(Rate).CopyTo(data, pos + 12);
-
-
-                return data;
-            }
-        }
-
-        /// <summary>
-        /// Information on the flexible properties of a primitive
-        /// </summary>
-        public struct FlexibleData
-        {
-            /// <summary></summary>
-            public int Softness;
-            /// <summary></summary>
-            public float Gravity;
-            /// <summary></summary>
-            public float Drag;
-            /// <summary></summary>
-            public float Wind;
-            /// <summary></summary>
-            public float Tension;
-            /// <summary></summary>
-            public LLVector3 Force;
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <param name="data"></param>
-            /// <param name="pos"></param>
-            public FlexibleData(byte[] data, int pos)
-            {
-                if (data.Length >= 5)
-                {
-                    Softness = ((data[pos] & 0x80) >> 6) | ((data[pos + 1] & 0x80) >> 7);
-
-                    Tension = (float)(data[pos++] & 0x7F) / 10.0f;
-                    Drag = (float)(data[pos++] & 0x7F) / 10.0f;
-                    Gravity = (float)(data[pos++] / 10.0f) - 10.0f;
-                    Wind = (float)data[pos++] / 10.0f;
-                    Force = new LLVector3(data, pos);
-                }
-                else
-                {
-                    Softness = 0;
-
-                    Tension = 0.0f;
-                    Drag = 0.0f;
-                    Gravity = 0.0f;
-                    Wind = 0.0f;
-                    Force = LLVector3.Zero;
-                }
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public byte[] GetBytes()
-            {
-                byte[] data = new byte[16];
-                int i = 0;
-
-                // Softness is packed in the upper bits of tension and drag
-                data[i] = (byte)((Softness & 2) << 6);
-                data[i + 1] = (byte)((Softness & 1) << 7);
-
-                data[i++] |= (byte)((byte)(Tension * 10.01f) & 0x7F);
-                data[i++] |= (byte)((byte)(Drag * 10.01f) & 0x7F);
-                data[i++] = (byte)((Gravity + 10.0f) * 10.01f);
-                data[i++] = (byte)(Wind * 10.01f);
-
-                Force.GetBytes().CopyTo(data, i);
-
-                return data;
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public LLSD ToLLSD()
-            {
-                LLSDMap map = new LLSDMap();
-
-                map["simulate_lod"] = LLSD.FromInteger(Softness);
-                map["gravity"] = LLSD.FromReal(Gravity);
-                map["air_friction"] = LLSD.FromReal(Drag);
-                map["wind_sensitivity"] = LLSD.FromReal(Wind);
-                map["tension"] = LLSD.FromReal(Tension);
-                map["user_force"] = Force.ToLLSD();
-
-                return map;
-            }
-
-            public static FlexibleData FromLLSD(LLSD llsd)
-            {
-                FlexibleData flex = new FlexibleData();
-
-                if (llsd.Type == LLSDType.Map)
-                {
-                    LLSDMap map = (LLSDMap)llsd;
-
-                    flex.Softness = map["simulate_lod"].AsInteger();
-                    flex.Gravity = (float)map["gravity"].AsReal();
-                    flex.Drag = (float)map["air_friction"].AsReal();
-                    flex.Wind = (float)map["wind_sensitivity"].AsReal();
-                    flex.Tension = (float)map["tension"].AsReal();
-                    flex.Force = LLVector3.FromLLSD(map["user_force"]);
-                }
-
-                return flex;
-            }
-        }
-
-        /// <summary>
-        /// Information on the light properties of a primitive
-        /// </summary>
-        public struct LightData
-        {
-            /// <summary></summary>
-            public LLColor Color;
-            /// <summary></summary>
-            public float Intensity;
-            /// <summary></summary>
-            public float Radius;
-            /// <summary></summary>
-            public float Cutoff;
-            /// <summary></summary>
-            public float Falloff;
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <param name="data"></param>
-            /// <param name="pos"></param>
-            public LightData(byte[] data, int pos)
-            {
-                if (data.Length - pos >= 16)
-                {
-                    Color = new LLColor(data, pos, false);
-                    Radius = Helpers.BytesToFloat(data, pos + 4);
-                    Cutoff = Helpers.BytesToFloat(data, pos + 8);
-                    Falloff = Helpers.BytesToFloat(data, pos + 12);
-
-                    // Alpha in color is actually intensity
-                    Intensity = Color.A;
-                    Color.A = 1f;
-                }
-                else
-                {
-                    Color = LLColor.Black;
-                    Radius = 0f;
-                    Cutoff = 0f;
-                    Falloff = 0f;
-                    Intensity = 0f;
-                }
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public byte[] GetBytes()
-            {
-                byte[] data = new byte[16];
-
-                // Alpha channel in color is intensity
-                LLColor tmpColor = Color;
-                tmpColor.A = Intensity;
-                tmpColor.GetBytes().CopyTo(data, 0);
-                Helpers.FloatToBytes(Radius).CopyTo(data, 4);
-                Helpers.FloatToBytes(Cutoff).CopyTo(data, 8);
-                Helpers.FloatToBytes(Falloff).CopyTo(data, 12);
-
-                return data;
-            }
-
-            public LLSD ToLLSD()
-            {
-                LLSDMap map = new LLSDMap();
-
-                map["color"] = Color.ToLLSD();
-                map["intensity"] = LLSD.FromReal(Intensity);
-                map["radius"] = LLSD.FromReal(Radius);
-                map["cutoff"] = LLSD.FromReal(Cutoff);
-                map["falloff"] = LLSD.FromReal(Falloff);
-
-                return map;
-            }
-
-            public static LightData FromLLSD(LLSD llsd)
-            {
-                LightData light = new LightData();
-
-                if (llsd.Type == LLSDType.Map)
-                {
-                    LLSDMap map = (LLSDMap)llsd;
-
-                    light.Color = LLColor.FromLLSD(map["color"]);
-                    light.Intensity = (float)map["intensity"].AsReal();
-                    light.Radius = (float)map["radius"].AsReal();
-                    light.Cutoff = (float)map["cutoff"].AsReal();
-                    light.Falloff = (float)map["falloff"].AsReal();
-                }
-
-                return light;
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public override string ToString()
-            {
-                return String.Format("Color: {0} Intensity: {1} Radius: {2} Cutoff: {3} Falloff: {4}",
-                    Color, Intensity, Radius, Cutoff, Falloff);
-            }
-        }
-
-        /// <summary>
-        /// Information on the sculpt properties of a sculpted primitive
-        /// </summary>
-        public struct SculptData
-        {
-            public LLUUID SculptTexture;
-            public SculptType Type;
-
-            public SculptData(byte[] data, int pos)
-            {
-                if (data.Length >= 17)
-                {
-                    SculptTexture = new LLUUID(data, pos);
-                    Type = (SculptType)data[pos + 16];
-                }
-                else
-                {
-                    SculptTexture = LLUUID.Zero;
-                    Type = SculptType.None;
-                }
-            }
-
-            public byte[] GetBytes()
-            {
-                byte[] data = new byte[17];
-
-                SculptTexture.GetBytes().CopyTo(data, 0);
-                data[16] = (byte)Type;
-
-                return data;
-            }
-
-            public LLSD ToLLSD()
-            {
-                LLSDMap map = new LLSDMap();
-
-                map["texture"] = LLSD.FromUUID(SculptTexture);
-                map["type"] = LLSD.FromInteger((int)Type);
-
-                return map;
-            }
-
-            public static SculptData FromLLSD(LLSD llsd)
-            {
-                SculptData sculpt = new SculptData();
-
-                if (llsd.Type == LLSDType.Map)
-                {
-                    LLSDMap map = (LLSDMap)llsd;
-
-                    sculpt.SculptTexture = map["texture"].AsUUID();
-                    sculpt.Type = (SculptType)map["type"].AsInteger();
-                }
-
-                return sculpt;
-            }
-        }
-
-        #endregion Subclasses
-
-        #region Public Members
-
-        /// <summary></summary>
-        public TextureAnimation TextureAnim;
-        /// <summary></summary>
-        public FlexibleData Flexible;
-        /// <summary></summary>
-        public LightData Light;
-        /// <summary></summary>
-        public SculptData Sculpt;
-        /// <summary></summary>
-        public ParticleSystem ParticleSys;
-        /// <summary></summary>
-        public ClickAction ClickAction;
-        /// <summary></summary>
-        public LLUUID Sound;
-        /// <summary>Identifies the owner of the audio or particle system</summary>
-        public LLUUID OwnerID;
-        /// <summary></summary>
-        public byte SoundFlags;
-        /// <summary></summary>
-        public float SoundGain;
-        /// <summary></summary>
-        public float SoundRadius;
-        /// <summary></summary>
-        public string Text;
-        /// <summary></summary>
-        public LLColor TextColor;
-        /// <summary></summary>
-        public string MediaURL;
-        /// <summary></summary>
-        public JointType Joint;
-        /// <summary></summary>
-        public LLVector3 JointPivot;
-        /// <summary></summary>
-        public LLVector3 JointAxisOrAnchor;
-
-        #endregion Public Members
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        public Primitive()
-        {
-        }
-
-        public override string ToString()
-        {
-            return String.Format("ID: {0}, GroupID: {1}, ParentID: {2}, LocalID: {3}, Flags: {4}, " +
-                "State: {5}, PCode: {6}, Material: {7}", ID, GroupID, ParentID, LocalID, Flags, Data.State,
-                Data.PCode, Data.Material);
-        }
-
-        public LLSD ToLLSD()
-        {
-            LLSDMap path = new LLSDMap(14);
-            path["begin"] = LLSD.FromReal(Data.PathBegin);
-            path["curve"] = LLSD.FromInteger((int)Data.PathCurve);
-            path["end"] = LLSD.FromReal(Data.PathEnd);
-            path["radius_offset"] = LLSD.FromReal(Data.PathRadiusOffset);
-            path["revolutions"] = LLSD.FromReal(Data.PathRevolutions);
-            path["scale_x"] = LLSD.FromReal(Data.PathScaleX);
-            path["scale_y"] = LLSD.FromReal(Data.PathScaleY);
-            path["shear_x"] = LLSD.FromReal(Data.PathShearX);
-            path["shear_y"] = LLSD.FromReal(Data.PathShearY);
-            path["skew"] = LLSD.FromReal(Data.PathSkew);
-            path["taper_x"] = LLSD.FromReal(Data.PathTaperX);
-            path["taper_y"] = LLSD.FromReal(Data.PathTaperY);
-            path["twist"] = LLSD.FromReal(Data.PathTwist);
-            path["twist_begin"] = LLSD.FromReal(Data.PathTwistBegin);
-
-            LLSDMap profile = new LLSDMap(4);
-            profile["begin"] = LLSD.FromReal(Data.ProfileBegin);
-            profile["curve"] = LLSD.FromInteger((int)Data.ProfileCurve);
-            profile["hole"] = LLSD.FromInteger((int)Data.ProfileHole);
-            profile["end"] = LLSD.FromReal(Data.ProfileEnd);
-            profile["hollow"] = LLSD.FromReal(Data.ProfileHollow);
-
-            LLSDMap volume = new LLSDMap(2);
-            volume["path"] = path;
-            volume["profile"] = profile;
-
-            LLSDMap prim = new LLSDMap(9);
-            prim["phantom"] = LLSD.FromBoolean(((Flags & ObjectFlags.Phantom) != 0));
-            prim["physical"] = LLSD.FromBoolean(((Flags & ObjectFlags.Physics) != 0));
-            prim["position"] = Position.ToLLSD();
-            prim["rotation"] = Rotation.ToLLSD();
-            prim["scale"] = Scale.ToLLSD();
-            prim["shadows"] = LLSD.FromBoolean(((Flags & ObjectFlags.CastShadows) != 0));
-            prim["textures"] = Textures.ToLLSD();
-            prim["volume"] = volume;
-            if (ParentID != 0)
-                prim["parentid"] = LLSD.FromInteger(ParentID);
-
-            prim["light"] = Light.ToLLSD();
-            prim["flex"] = Flexible.ToLLSD();
-            prim["sculpt"] = Sculpt.ToLLSD();
-
-            return prim;
-        }
-
-        public static Primitive FromLLSD(LLSD llsd)
-        {
-            Primitive prim = new Primitive();
-            LLObject.ObjectData data = new ObjectData();
-
-            LLSDMap map = (LLSDMap)llsd;
-            LLSDMap volume = (LLSDMap)map["volume"];
-            LLSDMap path = (LLSDMap)volume["path"];
-            LLSDMap profile = (LLSDMap)volume["profile"];
-
-            #region Path/Profile
-
-            data.PathBegin = (float)path["begin"].AsReal();
-            data.PathCurve = (PathCurve)path["curve"].AsInteger();
-            data.PathEnd = (float)path["end"].AsReal();
-            data.PathRadiusOffset = (float)path["radius_offset"].AsReal();
-            data.PathRevolutions = (float)path["revolutions"].AsReal();
-            data.PathScaleX = (float)path["scale_x"].AsReal();
-            data.PathScaleY = (float)path["scale_y"].AsReal();
-            data.PathShearX = (float)path["shear_x"].AsReal();
-            data.PathShearY = (float)path["shear_y"].AsReal();
-            data.PathSkew = (float)path["skew"].AsReal();
-            data.PathTaperX = (float)path["taper_x"].AsReal();
-            data.PathTaperY = (float)path["taper_y"].AsReal();
-            data.PathTwist = path["twist"].AsInteger();
-            data.PathTwistBegin = path["twist_begin"].AsInteger();
-
-            data.ProfileBegin = (float)profile["begin"].AsReal();
-            data.ProfileCurve = (ProfileCurve)profile["curve"].AsInteger();
-            data.ProfileHole = (HoleType)profile["hole"].AsInteger();
-            data.ProfileEnd = (float)profile["end"].AsReal();
-            data.ProfileHollow = (float)profile["hollow"].AsReal();
-
-            #endregion Path/Profile
-
-            prim.Data = data;
-
-            if (map["phantom"].AsBoolean())
-                prim.Flags |= ObjectFlags.Phantom;
-
-            if (map["physical"].AsBoolean())
-                prim.Flags |= ObjectFlags.Physics;
-
-            if (map["shadows"].AsBoolean())
-                prim.Flags |= ObjectFlags.CastShadows;
-
-            prim.ParentID = (uint)map["parentid"].AsInteger();
-            prim.Position = LLVector3.FromLLSD(map["position"]);
-            prim.Rotation = LLQuaternion.FromLLSD(map["rotation"]);
-            prim.Scale = LLVector3.FromLLSD(map["scale"]);
-            prim.Flexible = FlexibleData.FromLLSD(map["flexible"]);
-            prim.Light = LightData.FromLLSD(map["light"]);
-            prim.Sculpt = SculptData.FromLLSD(map["sculpt"]);
-            prim.Textures = TextureEntry.FromLLSD(map["textures"]);
-
-            return prim;
-        }
-
-        internal int SetExtraParamsFromBytes(byte[] data, int pos)
-        {
-            int i = pos;
-            int totalLength = 1;
-
-            if (data.Length == 0 || pos >= data.Length)
-                return 0;
-
-            try
-            {
-                byte extraParamCount = data[i++];
-
-                for (int k = 0; k < extraParamCount; k++)
-                {
-                    ExtraParamType type = (ExtraParamType)Helpers.BytesToUInt16(data, i);
-                    i += 2;
-
-                    uint paramLength = Helpers.BytesToUIntBig(data, i);
-                    i += 4;
-
-                    if (type == ExtraParamType.Flexible)
-                        Flexible = new FlexibleData(data, i);
-                    else if (type == ExtraParamType.Light)
-                        Light = new LightData(data, i);
-                    else if (type == ExtraParamType.Sculpt)
-                        Sculpt = new SculptData(data, i);
-
-                    i += (int)paramLength;
-                    totalLength += (int)paramLength + 6;
-                }
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine(e.ToString());
-            }
-
-            return totalLength;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/ProtocolManager.cs b/old/libsl1550/libsecondlife/ProtocolManager.cs
deleted file mode 100644
index f8bb8c6..0000000
--- a/old/libsl1550/libsecondlife/ProtocolManager.cs
+++ /dev/null
@@ -1,692 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace libsecondlife
-{
-    /// <summary>
-    ///
-    /// </summary>
-	public enum PacketFrequency
-	{
-        /// <summary></summary>
-		Low,
-        /// <summary></summary>
-		Medium,
-        /// <summary></summary>
-		High
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public enum FieldType
-	{
-        /// <summary></summary>
-		U8,
-        /// <summary></summary>
-		U16,
-        /// <summary></summary>
-		U32,
-        /// <summary></summary>
-		U64,
-        /// <summary></summary>
-		S8,
-        /// <summary></summary>
-		S16,
-        /// <summary></summary>
-		S32,
-        /// <summary></summary>
-		F32,
-        /// <summary></summary>
-		F64,
-        /// <summary></summary>
-		LLUUID,
-        /// <summary></summary>
-		BOOL,
-        /// <summary></summary>
-		LLVector3,
-        /// <summary></summary>
-		LLVector3d,
-        /// <summary></summary>
-		LLVector4,
-        /// <summary></summary>
-		LLQuaternion,
-        /// <summary></summary>
-		IPADDR,
-        /// <summary></summary>
-		IPPORT,
-        /// <summary></summary>
-		Variable,
-        /// <summary></summary>
-		Fixed,
-        /// <summary></summary>
-		Single,
-        /// <summary></summary>
-		Multiple
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public class MapField : IComparable
-	{
-        /// <summary></summary>
-		public int KeywordPosition;
-        /// <summary></summary>
-		public string Name;
-        /// <summary></summary>
-		public FieldType Type;
-        /// <summary></summary>
-		public int Count;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-		public int CompareTo(object obj)
-		{
-			MapField temp = (MapField)obj;
-
-			if (this.KeywordPosition > temp.KeywordPosition)
-			{
-				return 1;
-			}
-			else
-			{
-				if(temp.KeywordPosition == this.KeywordPosition)
-				{
-					return 0;
-				}
-				else
-				{
-					return -1;
-				}
-			}
-		}
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public class MapBlock : IComparable
-	{
-        /// <summary></summary>
-		public int KeywordPosition;
-        /// <summary></summary>
-		public string Name;
-        /// <summary></summary>
-		public int Count;
-        /// <summary></summary>
-		public List<MapField> Fields;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-		public int CompareTo(object obj)
-		{
-			MapBlock temp = (MapBlock)obj;
-
-			if (this.KeywordPosition > temp.KeywordPosition)
-			{
-				return 1;
-			}
-			else
-			{
-				if(temp.KeywordPosition == this.KeywordPosition)
-				{
-					return 0;
-				}
-				else
-				{
-					return -1;
-				}
-			}
-		}
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public class MapPacket
-	{
-        /// <summary></summary>
-		public ushort ID;
-        /// <summary></summary>
-		public string Name;
-        /// <summary></summary>
-		public PacketFrequency Frequency;
-        /// <summary></summary>
-		public bool Trusted;
-        /// <summary></summary>
-		public bool Encoded;
-        /// <summary></summary>
-		public List<MapBlock> Blocks;
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public class ProtocolManager
-	{
-        /// <summary></summary>
-		public Dictionary<FieldType, int> TypeSizes;
-        /// <summary></summary>
-		public Dictionary<string, int> KeywordPositions;
-        /// <summary></summary>
-		public MapPacket[] LowMaps;
-        /// <summary></summary>
-		public MapPacket[] MediumMaps;
-        /// <summary></summary>
-		public MapPacket[] HighMaps;
-
-        private SecondLife Client;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="mapFile"></param>
-        /// <param name="client"></param>
-		public ProtocolManager(string mapFile, SecondLife client)
-		{
-            Client = client;
-
-			// Initialize the map arrays
-			LowMaps = new MapPacket[65536];
-			MediumMaps = new MapPacket[256];
-			HighMaps = new MapPacket[256];
-
-			// Build the type size hash table
-			TypeSizes = new Dictionary<FieldType,int>();
-			TypeSizes.Add(FieldType.U8, 1);
-			TypeSizes.Add(FieldType.U16, 2);
-			TypeSizes.Add(FieldType.U32, 4);
-			TypeSizes.Add(FieldType.U64, 8);
-			TypeSizes.Add(FieldType.S8, 1);
-			TypeSizes.Add(FieldType.S16, 2);
-			TypeSizes.Add(FieldType.S32, 4);
-			TypeSizes.Add(FieldType.F32, 4);
-			TypeSizes.Add(FieldType.F64, 8);
-			TypeSizes.Add(FieldType.LLUUID, 16);
-			TypeSizes.Add(FieldType.BOOL, 1);
-			TypeSizes.Add(FieldType.LLVector3, 12);
-			TypeSizes.Add(FieldType.LLVector3d, 24);
-			TypeSizes.Add(FieldType.LLVector4, 16);
-			TypeSizes.Add(FieldType.LLQuaternion, 16);
-			TypeSizes.Add(FieldType.IPADDR, 4);
-			TypeSizes.Add(FieldType.IPPORT, 2);
-			TypeSizes.Add(FieldType.Variable, -1);
-			TypeSizes.Add(FieldType.Fixed, -2);
-
-            KeywordPositions = new Dictionary<string, int>();
-			LoadMapFile(mapFile);
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="command"></param>
-        /// <returns></returns>
-		public MapPacket Command(string command)
-		{
-			foreach (MapPacket map in HighMaps)
-			{
-				if (map != null)
-				{
-					if (command == map.Name)
-					{
-						return map;
-					}
-				}
-			}
-
-			foreach (MapPacket map in MediumMaps)
-			{
-				if (map != null)
-				{
-					if (command == map.Name)
-					{
-						return map;
-					}
-				}
-			}
-
-			foreach (MapPacket map in LowMaps)
-			{
-				if (map != null)
-				{
-					if (command == map.Name)
-					{
-						return map;
-					}
-				}
-			}
-
-			throw new Exception("Cannot find map for command \"" + command + "\"");
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="data"></param>
-        /// <returns></returns>
-		public MapPacket Command(byte[] data)
-		{
-			ushort command;
-
-			if (data.Length < 5)
-			{
-				return null;
-			}
-
-			if (data[4] == 0xFF)
-			{
-				if ((byte)data[5] == 0xFF)
-				{
-					// Low frequency
-					command = (ushort)(data[6] * 256 + data[7]);
-					return Command(command, PacketFrequency.Low);
-				}
-				else
-				{
-					// Medium frequency
-					command = (ushort)data[5];
-					return Command(command, PacketFrequency.Medium);
-				}
-			}
-			else
-			{
-				// High frequency
-				command = (ushort)data[4];
-				return Command(command, PacketFrequency.High);
-			}
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="command"></param>
-        /// <param name="frequency"></param>
-        /// <returns></returns>
-		public MapPacket Command(ushort command, PacketFrequency frequency)
-		{
-			switch (frequency)
-			{
-				case PacketFrequency.High:
-					return HighMaps[command];
-				case PacketFrequency.Medium:
-					return MediumMaps[command];
-				case PacketFrequency.Low:
-					return LowMaps[command];
-			}
-
-			throw new Exception("Cannot find map for command \"" + command + "\" with frequency \"" + frequency + "\"");
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-		public void PrintMap()
-		{
-			PrintOneMap(LowMaps,    "Low   ");
-			PrintOneMap(MediumMaps, "Medium");
-			PrintOneMap(HighMaps,   "High  ");
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="map"></param>
-        /// <param name="frequency"></param>
-		private void PrintOneMap(MapPacket[] map, string frequency) {
-			int i;
-
-			for (i = 0; i < map.Length; ++i)
-			{
-				if (map[i] != null)
-				{
-					Console.WriteLine("{0} {1,5} - {2} - {3} - {4}", frequency, i, map[i].Name,
-						map[i].Trusted ? "Trusted" : "Untrusted",
-						map[i].Encoded ? "Unencoded" : "Zerocoded");
-
-					foreach (MapBlock block in map[i].Blocks)
-					{
-						if (block.Count == -1)
-						{
-							Console.WriteLine("\t{0,4} {1} (Variable)", block.KeywordPosition, block.Name);
-						}
-						else
-						{
-							Console.WriteLine("\t{0,4} {1} ({2})", block.KeywordPosition, block.Name, block.Count);
-						}
-
-						foreach (MapField field in block.Fields)
-						{
-							Console.WriteLine("\t\t{0,4} {1} ({2} / {3})", field.KeywordPosition, field.Name,
-								field.Type, field.Count);
-						}
-					}
-				}
-			}
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="mapFile"></param>
-        /// <param name="outputFile"></param>
-		public static void DecodeMapFile(string mapFile, string outputFile)
-		{
-			byte magicKey = 0;
-			byte[] buffer = new byte[2048];
-			int nread;
-			BinaryReader map;
-			BinaryWriter output;
-
-			try
-			{
-				map = new BinaryReader(new FileStream(mapFile, FileMode.Open));
-			}
-			catch(Exception e)
-			{
-				throw new Exception("Map file error", e);
-			}
-
-			try
-			{
-				output = new BinaryWriter(new FileStream(outputFile, FileMode.CreateNew));
-			}
-			catch(Exception e)
-			{
-				throw new Exception("Map file error", e);
-			}
-
-			while ((nread = map.Read(buffer, 0, 2048)) != 0)
-			{
-				for (int i = 0; i < nread; ++i)
-				{
-					buffer[i] ^= magicKey;
-					magicKey += 43;
-				}
-
-				output.Write(buffer, 0, nread);
-			}
-
-			map.Close();
-			output.Close();
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="mapFile"></param>
-		private void LoadMapFile(string mapFile)
-		{
-			FileStream map;
-			ushort low = 1;
-			ushort medium = 1;
-			ushort high = 1;
-
-			// Load the protocol map file
-			try
-			{
-				map = new FileStream(mapFile, FileMode.Open, FileAccess.Read);
-			}
-			catch(Exception e)
-			{
-				throw new Exception("Map file loading error", e);
-			}
-
-			try
-			{
-				StreamReader r = new StreamReader(map);
-				r.BaseStream.Seek(0, SeekOrigin.Begin);
-				string newline;
-				string trimmedline;
-				bool inPacket = false;
-				bool inBlock = false;
-				MapPacket currentPacket = null;
-				MapBlock currentBlock = null;
-				char[] trimArray = new char[] {' ', '\t'};
-
-				// While not at the end of the file
-				while (r.Peek() > -1)
-				{
-					#region ParseMap
-
-					newline = r.ReadLine();
-					trimmedline = System.Text.RegularExpressions.Regex.Replace(newline, @"\s+", " ");
-					trimmedline = trimmedline.Trim(trimArray);
-
-					if (!inPacket)
-					{
-						// Outside of all packet blocks
-
-						if (trimmedline == "{")
-						{
-							inPacket = true;
-						}
-					}
-					else
-					{
-						// Inside of a packet block
-
-						if (!inBlock)
-						{
-							// Inside a packet block, outside of the blocks
-
-							if (trimmedline == "{")
-							{
-								inBlock = true;
-							}
-							else if (trimmedline == "}")
-							{
-								// Reached the end of the packet
-								currentPacket.Blocks.Sort();
-								inPacket = false;
-							}
-							else
-							{
-								// The packet header
-								#region ParsePacketHeader
-
-								// Splice the string in to tokens
-								string[] tokens = trimmedline.Split(new char[] {' ', '\t'});
-
-								if (tokens.Length > 3)
-								{
-                                    //Hash packet name to insure correct keyword ordering
-                                    KeywordPosition(tokens[0]);
-
-									if (tokens[1] == "Fixed")
-									{
-										// Remove the leading "0x"
-										if (tokens[2].Substring(0, 2) == "0x")
-										{
-											tokens[2] = tokens[2].Substring(2, tokens[2].Length - 2);
-										}
-
-										uint fixedID = UInt32.Parse(tokens[2], System.Globalization.NumberStyles.HexNumber);
-										// Truncate the id to a short
-										fixedID ^= 0xFFFF0000;
-										LowMaps[fixedID] = new MapPacket();
-										LowMaps[fixedID].ID = (ushort)fixedID;
-										LowMaps[fixedID].Frequency = PacketFrequency.Low;
-										LowMaps[fixedID].Name = tokens[0];
-										LowMaps[fixedID].Trusted = (tokens[3] == "Trusted");
-										LowMaps[fixedID].Encoded = (tokens[4] == "Zerocoded");
-										LowMaps[fixedID].Blocks = new List<MapBlock>();
-
-										currentPacket = LowMaps[fixedID];
-									}
-									else if (tokens[1] == "Low")
-									{
-										LowMaps[low] = new MapPacket();
-										LowMaps[low].ID = low;
-										LowMaps[low].Frequency = PacketFrequency.Low;
-										LowMaps[low].Name = tokens[0];
-										LowMaps[low].Trusted = (tokens[2] == "Trusted");
-										LowMaps[low].Encoded = (tokens[3] == "Zerocoded");
-										LowMaps[low].Blocks = new List<MapBlock>();
-
-										currentPacket = LowMaps[low];
-
-										low++;
-									}
-									else if (tokens[1] == "Medium")
-									{
-										MediumMaps[medium] = new MapPacket();
-										MediumMaps[medium].ID = medium;
-										MediumMaps[medium].Frequency = PacketFrequency.Medium;
-										MediumMaps[medium].Name = tokens[0];
-										MediumMaps[medium].Trusted = (tokens[2] == "Trusted");
-										MediumMaps[medium].Encoded = (tokens[3] == "Zerocoded");
-										MediumMaps[medium].Blocks = new List<MapBlock>();
-
-										currentPacket = MediumMaps[medium];
-
-										medium++;
-									}
-									else if (tokens[1] == "High")
-									{
-										HighMaps[high] = new MapPacket();
-										HighMaps[high].ID = high;
-										HighMaps[high].Frequency = PacketFrequency.High;
-										HighMaps[high].Name = tokens[0];
-										HighMaps[high].Trusted = (tokens[2] == "Trusted");
-										HighMaps[high].Encoded = (tokens[3] == "Zerocoded");
-										HighMaps[high].Blocks = new List<MapBlock>();
-
-										currentPacket = HighMaps[high];
-
-										high++;
-									}
-									else
-									{
-										Client.Log("Unknown packet frequency", Helpers.LogLevel.Error);
-									}
-								}
-
-								#endregion
-							}
-						}
-						else
-						{
-							if (trimmedline.Length > 0 && trimmedline.Substring(0, 1) == "{")
-							{
-								// A field
-								#region ParseField
-
-								MapField field = new MapField();
-
-								// Splice the string in to tokens
-								string[] tokens = trimmedline.Split(new char[] {' ', '\t'});
-
-								field.Name = tokens[1];
-								field.KeywordPosition = KeywordPosition(field.Name);
-								field.Type = (FieldType)Enum.Parse(typeof(FieldType), tokens[2], true);
-
-								if (tokens[3] != "}")
-								{
-									field.Count = Int32.Parse(tokens[3]);
-								}
-								else
-								{
-									field.Count = 1;
-								}
-
-								// Save this field to the current block
-								currentBlock.Fields.Add(field);
-
-								#endregion
-							}
-							else if (trimmedline == "}")
-							{
-								currentBlock.Fields.Sort();
-								inBlock = false;
-							}
-							else if (trimmedline.Length != 0 && trimmedline.Substring(0, 2) != "//")
-							{
-								// The block header
-								#region ParseBlockHeader
-
-								currentBlock = new MapBlock();
-
-								// Splice the string in to tokens
-								string[] tokens = trimmedline.Split(new char[] {' ', '\t'});
-
-								currentBlock.Name = tokens[0];
-								currentBlock.KeywordPosition = KeywordPosition(currentBlock.Name);
-								currentBlock.Fields = new List<MapField>();
-								currentPacket.Blocks.Add(currentBlock);
-
-								if (tokens[1] == "Single")
-								{
-									currentBlock.Count = 1;
-								}
-								else if (tokens[1] == "Multiple")
-								{
-									currentBlock.Count = Int32.Parse(tokens[2]);
-								}
-								else if (tokens[1] == "Variable")
-								{
-									currentBlock.Count = -1;
-								}
-								else
-								{
-									Client.Log("Unknown block frequency", Helpers.LogLevel.Error);
-								}
-
-								#endregion
-							}
-						}
-					}
-
-					#endregion
-				}
-
-				r.Close();
-				map.Close();
-			}
-			catch (Exception e)
-			{
-                throw new Exception("Map file parsing error", e); ;
-			}
-		}
-
-		private int KeywordPosition(string keyword)
-		{
-            if (KeywordPositions.ContainsKey(keyword))
-            {
-                return KeywordPositions[keyword];
-            }
-
-            int hash = 0;
-            for (int i = 1; i < keyword.Length; i++)
-            {
-                hash = (hash + (int)(keyword[i])) * 2;
-            }
-            hash *= 2;
-            hash &= 0x1FFF;
-
-            int startHash = hash;
-
-            while (KeywordPositions.ContainsValue(hash))
-            {
-                hash++;
-                hash &= 0x1FFF;
-                if (hash == startHash)
-                {
-                    //Give up looking, went through all values and they were all taken.
-                    throw new Exception("All hash values are taken. Failed to add keyword: " + keyword);
-                }
-            }
-
-            KeywordPositions[keyword] = hash;
-            return hash;
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/ReaderWriterLock.cs b/old/libsl1550/libsecondlife/ReaderWriterLock.cs
deleted file mode 100644
index ae478cd..0000000
--- a/old/libsl1550/libsecondlife/ReaderWriterLock.cs
+++ /dev/null
@@ -1,276 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-
-#if PocketPC
-
-// FIXME: This class was very likely broken when converting things to Auto/Manual ResetEvents
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// A reader-writer lock implementation that is intended to be simple, yet very
-    /// efficient.  In particular only 1 interlocked operation is taken for any lock
-    /// operation (we use spin locks to achieve this).  The spin lock is never held
-    /// for more than a few instructions (in particular, we never call event APIs
-    /// or in fact any non-trivial API while holding the spin lock).
-    ///
-    /// Currently this ReaderWriterLock does not support recurision, however it is
-    /// not hard to add
-    /// </summary>
-    public class ReaderWriterLock
-    {
-        // Lock specifiation for myLock:  This lock protects exactly the local fields associted
-        // instance of MyReaderWriterLock.  It does NOT protect the memory associted with the
-        // the events that hang off this lock (eg writeEvent, readEvent upgradeEvent).
-        int myLock;
-
-        // Who owns the lock owners > 0 => readers
-        // owners = -1 means there is one writer.  Owners must be >= -1.
-        int owners;
-
-        // These variables allow use to avoid Setting events (which is expensive) if we don't have to.
-        uint numWriteWaiters;        // maximum number of threads that can be doing a WaitOne on the writeEvent
-        uint numReadWaiters;         // maximum number of threads that can be doing a WaitOne on the readEvent
-        uint numUpgradeWaiters;      // maximum number of threads that can be doing a WaitOne on the upgradeEvent (at most 1).
-
-        // conditions we wait on.
-        WaitHandle writeEvent;    // threads waiting to aquire a write lock go here.
-        WaitHandle readEvent;     // threads waiting to aquire a read lock go here (will be released in bulk)
-        WaitHandle upgradeEvent;  // thread waiting to upgrade a read lock to a write lock go here (at most one)
-
-        public ReaderWriterLock()
-        {
-            // All state can start out zeroed.
-        }
-
-        public void AcquireReaderLock(int millisecondsTimeout)
-        {
-            EnterMyLock();
-            for (; ; )
-            {
-                // We can enter a read lock if there are only read-locks have been given out
-                // and a writer is not trying to get in.
-                if (owners >= 0 && numWriteWaiters == 0)
-                {
-                    // Good case, there is no contention, we are basically done
-                    owners++;       // Indicate we have another reader
-                    break;
-                }
-
-                // Drat, we need to wait.  Mark that we have waiters and wait.
-                if (readEvent == null)      // Create the needed event
-                {
-                    LazyCreateEvent(ref readEvent, false);
-                    continue;   // since we left the lock, start over.
-                }
-
-                WaitOnEvent(readEvent, ref numReadWaiters, millisecondsTimeout);
-            }
-            ExitMyLock();
-        }
-
-        public void AcquireWriterLock(int millisecondsTimeout)
-        {
-            EnterMyLock();
-            for (; ; )
-            {
-                if (owners == 0)
-                {
-                    // Good case, there is no contention, we are basically done
-                    owners = -1;    // indicate we have a writer.
-                    break;
-                }
-
-                // Drat, we need to wait.  Mark that we have waiters and wait.
-                if (writeEvent == null)     // create the needed event.
-                {
-                    LazyCreateEvent(ref writeEvent, true);
-                    continue;   // since we left the lock, start over.
-                }
-
-                WaitOnEvent(writeEvent, ref numWriteWaiters, millisecondsTimeout);
-            }
-            ExitMyLock();
-        }
-
-        public void UpgradeToWriterLock(int millisecondsTimeout)
-        {
-            EnterMyLock();
-            for (; ; )
-            {
-                Debug.Assert(owners > 0, "Upgrading when no reader lock held");
-                if (owners == 1)
-                {
-                    // Good case, there is no contention, we are basically done
-                    owners = -1;    // inidicate we have a writer.
-                    break;
-                }
-
-                // Drat, we need to wait.  Mark that we have waiters and wait.
-                if (upgradeEvent == null)   // Create the needed event
-                {
-                    LazyCreateEvent(ref upgradeEvent, false);
-                    continue;   // since we left the lock, start over.
-                }
-
-                if (numUpgradeWaiters > 0)
-                {
-                    ExitMyLock();
-                    throw new ApplicationException("UpgradeToWriterLock already in process.  Deadlock!");
-                }
-
-                WaitOnEvent(upgradeEvent, ref numUpgradeWaiters, millisecondsTimeout);
-            }
-            ExitMyLock();
-        }
-
-        public void ReleaseReaderLock()
-        {
-            EnterMyLock();
-            Debug.Assert(owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken");
-            --owners;
-            ExitAndWakeUpAppropriateWaiters();
-        }
-
-        public void ReleaseWriterLock()
-        {
-            EnterMyLock();
-            Debug.Assert(owners == -1, "Calling ReleaseWriterLock when no write lock is held");
-            Debug.Assert(numUpgradeWaiters > 0);
-            owners++;
-            ExitAndWakeUpAppropriateWaiters();
-        }
-
-        public void DowngradeToReaderLock()
-        {
-            EnterMyLock();
-            Debug.Assert(owners == -1, "Downgrading when no writer lock held");
-            owners = 1;
-            ExitAndWakeUpAppropriateWaiters();
-        }
-
-        /// <summary>
-        /// A routine for lazily creating a event outside the lock (so if errors
-        /// happen they are outside the lock and that we don't do much work
-        /// while holding a spin lock).  If all goes well, reenter the lock and
-        /// set 'waitEvent'
-        /// </summary>
-        private void LazyCreateEvent(ref WaitHandle waitEvent, bool makeAutoResetEvent)
-        {
-            Debug.Assert(MyLockHeld);
-            Debug.Assert(waitEvent == null);
-
-            ExitMyLock();
-            WaitHandle newEvent;
-            if (makeAutoResetEvent)
-                newEvent = new AutoResetEvent(false);
-            else
-                newEvent = new ManualResetEvent(false);
-            EnterMyLock();
-            if (waitEvent == null)          // maybe someone snuck in.
-                waitEvent = newEvent;
-        }
-
-        /// <summary>
-        /// Waits on 'waitEvent' with a timeout of 'millisceondsTimeout.
-        /// Before the wait 'numWaiters' is incremented and is restored before leaving this routine.
-        /// </summary>
-        private void WaitOnEvent(WaitHandle waitEvent, ref uint numWaiters, int millisecondsTimeout)
-        {
-            Debug.Assert(MyLockHeld);
-
-            if (waitEvent is AutoResetEvent)
-                ((AutoResetEvent)waitEvent).Reset();
-            else
-                ((ManualResetEvent)waitEvent).Reset();
-
-            numWaiters++;
-
-            bool waitSuccessful = false;
-            ExitMyLock();      // Do the wait outside of any lock
-            try
-            {
-                if (!waitEvent.WaitOne(millisecondsTimeout, false))
-                    throw new ApplicationException("ReaderWriterLock timeout expired");
-                waitSuccessful = true;
-            }
-            finally
-            {
-                EnterMyLock();
-                --numWaiters;
-                if (!waitSuccessful)        // We are going to throw for some reason.  Exit myLock.
-                    ExitMyLock();
-            }
-        }
-
-        /// <summary>
-        /// Determines the appropriate events to set, leaves the locks, and sets the events.
-        /// </summary>
-        private void ExitAndWakeUpAppropriateWaiters()
-        {
-            Debug.Assert(MyLockHeld);
-
-            if (owners == 0 && numWriteWaiters > 0)
-            {
-                ExitMyLock();      // Exit before signaling to improve efficiency (wakee will need the lock)
-
-                // release one writer
-                if (writeEvent is AutoResetEvent)
-                    ((AutoResetEvent)writeEvent).Set();
-                else
-                    ((ManualResetEvent)writeEvent).Set();
-            }
-            else if (owners == 1 && numUpgradeWaiters != 0)
-            {
-                ExitMyLock();          // Exit before signaling to improve efficiency (wakee will need the lock)
-
-                // release all upgraders (however there can be at most one).
-                // two threads upgrading is a guarenteed deadlock, so we throw in that case
-                if (upgradeEvent is AutoResetEvent)
-                    ((AutoResetEvent)upgradeEvent).Set();
-                else
-                    ((ManualResetEvent)upgradeEvent).Set();
-            }
-            else if (owners >= 0 && numReadWaiters != 0)
-            {
-                ExitMyLock();    // Exit before signaling to improve efficiency (wakee will need the lock)
-                // release all readers
-                if (readEvent is AutoResetEvent)
-                    ((AutoResetEvent)readEvent).Set();
-                else
-                    ((ManualResetEvent)readEvent).Set();
-            }
-            else
-                ExitMyLock();
-        }
-
-        private void EnterMyLock()
-        {
-            if (Interlocked.CompareExchange(ref myLock, 1, 0) != 0)
-                EnterMyLockSpin();
-        }
-
-        private void EnterMyLockSpin()
-        {
-            for (int i = 0; ; i++)
-            {
-                Thread.Sleep(0);        // Give up my quantum.
-
-                if (Interlocked.CompareExchange(ref myLock, 1, 0) == 0)
-                    return;
-            }
-        }
-        private void ExitMyLock()
-        {
-            Debug.Assert(myLock != 0, "Exiting spin lock that is not held");
-            myLock = 0;
-        }
-
-        private bool MyLockHeld { get { return myLock != 0; } }
-
-    };
-}
-
-#endif
diff --git a/old/libsl1550/libsecondlife/Resources/avatar_lad.xml b/old/libsl1550/libsecondlife/Resources/avatar_lad.xml
deleted file mode 100644
index 3b81fa2..0000000
--- a/old/libsl1550/libsecondlife/Resources/avatar_lad.xml
+++ /dev/null
@@ -1,11223 +0,0 @@
-<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
-<linden_avatar
- version="1.0"
- wearable_definition_version="22">
- <!-- The wearable_definition_version is checked during asset upload. -->
- <!-- If you increment it, check indra/lib/python/indra/assetutil.py.  -->
-   <skeleton
-    file_name="avatar_skeleton.xml">
-      <attachment_point
-       id="1"
-       group="6"
-       pie_slice="2"
-       name="Chest"
-       joint="mChest"
-       position="0.15 0 -0.1"
-       rotation="0 90 90"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="2"
-       group="2"
-       pie_slice="2"
-       name="Skull"
-       joint="mHead"
-       position="0 0 0.15"
-       rotation="0 0 90"
-       visible_in_first_person="false" />
-
-      <attachment_point
-       id="3"
-       group="3"
-       pie_slice="3"
-       name="Left Shoulder"
-       joint="mCollarLeft"
-       position="0 0 0.08"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="4"
-       group="1"
-       pie_slice="1"
-       name="Right Shoulder"
-       joint="mCollarRight"
-       position="0 0 0.08"
-       rotation="0 0 0"
-	   visible_in_first_person="true"/>
-
-      <attachment_point
-       id="5"
-       group="4"
-       name="Left Hand"
-       joint="mWristLeft"
-       position="0 0.08 -0.02"
-       rotation="0 0 0"
-       visible_in_first_person="true"
-       max_attachment_offset="1.5" />
-
-      <attachment_point
-       id="6"
-       group="0"
-       name="Right Hand"
-       joint="mWristRight"
-       position="0 -0.08 -0.02"
-       rotation="0 0 0"
-       visible_in_first_person="true"
-       max_attachment_offset="1.5" />
-
-      <attachment_point
-       id="7"
-       group="5"
-       pie_slice="6"
-       name="Left Foot"
-       joint="mFootLeft"
-       position="0 0.0 0.0"
-       rotation="0 0 0"
-	   visible_in_first_person="true"/>
-
-      <attachment_point
-       id="8"
-       group="7"
-       pie_slice="6"
-       name="Right Foot"
-       joint="mFootRight"
-       position="0 0.0 0.0"
-       rotation="0 0 0"
-	   visible_in_first_person="true"/>
-
-      <attachment_point
-       id="9"
-       group="6"
-       pie_slice="7"
-       name="Spine"
-       joint="mChest"
-       position="-0.15 0 -0.1"
-       rotation="0 -90 90"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="10"
-       group="6"
-       pie_slice="6"
-       name="Pelvis"
-       joint="mPelvis"
-       position="0 0 -0.15"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="11"
-       group="2"
-       pie_slice="6"
-       name="Mouth"
-       joint="mHead"
-       position="0.12 0 0.001"
-       rotation="0 0 0"
-	   visible_in_first_person="false"/>
-
-      <attachment_point
-       id="12"
-       group="2"
-       pie_slice="7"
-       name="Chin"
-       joint="mHead"
-       position="0.12 0 -0.04"
-       rotation="0 0 0"
-	   visible_in_first_person="false" />
-
-      <attachment_point
-       id="13"
-       group="2"
-       pie_slice="4"
-       name="Left Ear"
-       joint="mHead"
-       position="0.015 0.08 0.017"
-       rotation="0 0 0"
-	   visible_in_first_person="false" />
-
-      <attachment_point
-       id="14"
-       group="2"
-       pie_slice="0"
-       name="Right Ear"
-       joint="mHead"
-       position="0.015 -0.08 0.017"
-       rotation="0 0 0"
-	   visible_in_first_person="false" />
-
-      <attachment_point
-       id="15"
-       group="2"
-       pie_slice="3"
-       name="Left Eyeball"
-       joint="mEyeLeft"
-       position="0 0 0"
-       rotation="0 0 0"
-	   visible_in_first_person="false"/>
-
-      <attachment_point
-       id="16"
-       group="2"
-       pie_slice="1"
-       name="Right Eyeball"
-       joint="mEyeRight"
-       position="0 0 0"
-       rotation="0 0 0"
-	   visible_in_first_person="false" />
-
-      <attachment_point
-       id="17"
-       group="2"
-       pie_slice="5"
-       name="Nose"
-       joint="mHead"
-       position="0.1 0 0.05"
-       rotation="0 0 0"
-	   visible_in_first_person="false"/>
-
-      <attachment_point
-       id="18"
-       group="1"
-       pie_slice="0"
-       name="R Upper Arm"
-       joint="mShoulderRight"
-       position="0.01 -0.13 0.01"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="19"
-       group="1"
-       pie_slice="7"
-       name="R Forearm"
-       joint="mElbowRight"
-       position="0 -0.12 0"
-       rotation="0 0 0"
-	   visible_in_first_person="true"/>
-
-      <attachment_point
-       id="20"
-       group="3"
-       pie_slice="4"
-       name="L Upper Arm"
-       joint="mShoulderLeft"
-       position="0.01 0.15 -0.01"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="21"
-       group="3"
-       pie_slice="5"
-       name="L Forearm"
-       joint="mElbowLeft"
-       position="0 0.113 0"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="22"
-       group="7"
-       pie_slice="1"
-       name="Right Hip"
-       joint="mHipRight"
-       position="0 0 0"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="23"
-       group="7"
-       pie_slice="0"
-       name="R Upper Leg"
-       joint="mHipRight"
-       position="-0.017 0.041 -0.310"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="24"
-       group="7"
-       pie_slice="7"
-       name="R Lower Leg"
-       joint="mKneeRight"
-       position="-0.044 -0.007 -0.262"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="25"
-       group="5"
-       pie_slice="3"
-       name="Left Hip"
-       joint="mHipLeft"
-       position="0 0 0"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="26"
-       group="5"
-       pie_slice="4"
-       name="L Upper Leg"
-       joint="mHipLeft"
-       position="-0.019 -0.034 -0.310"
-       rotation="0 0 0"
-	   visible_in_first_person="true"/>
-
-      <attachment_point
-       id="27"
-       group="5"
-       pie_slice="5"
-       name="L Lower Leg"
-       joint="mKneeLeft"
-       position="-0.044 -0.007 -0.261"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="28"
-       group="6"
-       pie_slice="5"
-       name="Stomach"
-       joint="mPelvis"
-       position="0.092 0.0 0.088"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="29"
-       group="6"
-       pie_slice="3"
-       name="Left Pec"
-       joint="mTorso"
-       position="0.104 0.082 0.247"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-      <attachment_point
-       id="30"
-       group="6"
-       pie_slice="1"
-       name="Right Pec"
-       joint="mTorso"
-       position="0.104 -0.082 0.247"
-       rotation="0 0 0"
-	   visible_in_first_person="true" />
-
-    <attachment_point
-       id="31"
-       group="8"
-       name="Center 2"
-       joint="mScreen"
-       position="0 0 0"
-       rotation="0 0 0"
-       hud="true"
-       max_attachment_offset="2.0"
-       visible_in_first_person="true" />
-
-    <attachment_point
-       id="32"
-       group="8"
-       name="Top Right"
-       joint="mScreen"
-       position="0 -0.5 0.5"
-       rotation="0 0 0"
-       hud="true"
-       max_attachment_offset="2.0"
-       visible_in_first_person="true" />
-
-    <attachment_point
-       id="33"
-       group="8"
-       name="Top"
-       joint="mScreen"
-       position="0 0 0.5"
-       rotation="0 0 0"
-       hud="true"
-       max_attachment_offset="2.0"
-       visible_in_first_person="true" />
-
-    <attachment_point
-       id="34"
-       group="8"
-       name="Top Left"
-       joint="mScreen"
-       position="0 0.5 0.5"
-       rotation="0 0 0"
-       hud="true"
-       max_attachment_offset="2.0"
-       visible_in_first_person="true" />
-
-    <attachment_point
-       id="35"
-       group="8"
-       name="Center"
-       joint="mScreen"
-       position="0 0 0"
-       rotation="0 0 0"
-       hud="true"
-       max_attachment_offset="2.0"
-       visible_in_first_person="true" />
-
-    <attachment_point
-       id="36"
-       group="8"
-       name="Bottom Left"
-       joint="mScreen"
-       position="0 0.5 -0.5"
-       rotation="0 0 0"
-       hud="true"
-       max_attachment_offset="2.0"
-       visible_in_first_person="true" />
-
-    <attachment_point
-       id="37"
-       group="8"
-       name="Bottom"
-       joint="mScreen"
-       position="0 0 -0.5"
-       rotation="0 0 0"
-       hud="true"
-       max_attachment_offset="2.0"
-       visible_in_first_person="true" />
-
-    <attachment_point
-       id="38"
-       group="8"
-       name="Bottom Right"
-       joint="mScreen"
-       position="0 -0.5 -0.5"
-       rotation="0 0 0"
-       hud="true"
-       max_attachment_offset="2.0"
-       visible_in_first_person="true" />
-
-    <param
-       id="32"
-       group="1"
-       wearable="shape"
-       name="Male_Skeleton"
-       label_min="Female"
-       label_max="Male"
-       value_min="0"
-       value_max="1">
-         <param_skeleton>
-            <bone
-             name="mNeck"
-             scale="0 0 .2" />
-
-            <bone
-             name="mCollarLeft"
-             scale="0 .4 0" />
-
-            <bone
-             name="mCollarRight"
-             scale="0 .4 0" />
-
-            <bone
-             name="mShoulderLeft"
-             scale="0 .35 0" />
-
-            <bone
-             name="mShoulderRight"
-             scale="0 .35 0" />
-
-            <bone
-             name="mElbowLeft"
-             scale="0 .1 0" />
-
-            <bone
-             name="mElbowRight"
-             scale="0 .1 0" />
-
-            <bone
-             name="mChest"
-             scale=".05 .05 .05" />
-
-            <bone
-             name="mTorso"
-             scale="0 0 .05" />
-
-            <bone
-             name="mPelvis"
-             scale="0 0 0" />
-
-            <bone
-             name="mHipLeft"
-             scale=".05 .05 0" />
-
-            <bone
-             name="mHipRight"
-             scale=".05 .05 0" />
-
-            <bone
-             name="mKneeLeft"
-             scale=".05 .05 .1" />
-
-            <bone
-             name="mKneeRight"
-             scale=".05 .05 .1" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="33"
-       group="0"
-       name="Height"
-       label="Height"
-       wearable="shape"
-       edit_group="shape_body"
-       edit_group_order="1"
-       label_min="Short"
-       label_max="Tall"
-       show_simple="true"
-       value_min="-2.3"
-       value_max="2"
-       camera_distance="2.2">
-         <param_skeleton>
-            <bone
-             name="mNeck"
-             scale="0 0 .02" />
-
-            <bone
-             name="mCollarLeft"
-             scale="0 0 0" />
-
-            <bone
-             name="mCollarRight"
-             scale="0 0 0" />
-
-            <bone
-             name="mShoulderLeft"
-             scale="0 0.08 0" />
-
-            <bone
-             name="mShoulderRight"
-             scale="0 0.08 0" />
-
-            <bone
-             name="mElbowLeft"
-             scale="0 0.06 0" />
-
-            <bone
-             name="mElbowRight"
-             scale="0 0.06 0" />
-
-            <bone
-             name="mChest"
-             scale="0 0 0.05" />
-
-            <bone
-             name="mTorso"
-             scale="0 0 0.05" />
-
-            <bone
-             name="mPelvis"
-             scale="0 0 0" />
-
-            <bone
-             name="mHipLeft"
-             scale="0 0 0.1" />
-
-            <bone
-             name="mHipRight"
-             scale="0 0 0.1" />
-
-            <bone
-             name="mKneeLeft"
-             scale="0 0 0.1" />
-
-            <bone
-             name="mKneeRight"
-             scale="0 0 0.1" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="34"
-       group="0"
-       name="Thickness"
-       label="Body Thickness"
-       wearable="shape"
-       edit_group="shape_body"
-       edit_group_order="2"
-       label_min="Body Thin"
-       label_max="Body Thick"
-       show_simple="true"
-       value_min="-0.7"
-       value_max="1.5"
-       camera_distance="1.8">
-         <param_skeleton>
-            <bone
-             name="mNeck"
-             scale="0.1 0.1 0" />
-
-            <bone
-             name="mCollarLeft"
-             scale="0 0.2 0" />
-
-            <bone
-             name="mCollarRight"
-             scale="0 0.2 0" />
-
-            <bone
-             name="mShoulderLeft"
-             scale="0.1 0 0.1" />
-
-            <bone
-             name="mShoulderRight"
-             scale="0.1 0 0.1" />
-
-            <bone
-             name="mElbowLeft"
-             scale="0.1 0 0.1" />
-
-            <bone
-             name="mElbowRight"
-             scale="0.1 0 0.1" />
-
-            <bone
-             name="mChest"
-             scale="0.1 0.1 0" />
-
-            <bone
-             name="mTorso"
-             scale="0.1 0.1 0" />
-
-            <bone
-             name="mPelvis"
-             scale="0.1 0.1 0" />
-
-            <bone
-             name="mHipLeft"
-             scale="0.13 0.13 0" />
-
-            <bone
-             name="mHipRight"
-             scale="0.13 0.13 0" />
-
-            <bone
-             name="mKneeLeft"
-             scale="0.12 0.12 0" />
-
-            <bone
-             name="mKneeRight"
-             scale="0.12 0.12 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="36"
-       group="0"
-       name="Shoulders"
-	   label="Shoulders"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="4"
-       label_min="Narrow"
-       label_max="Broad"
-       show_simple="true"
-       value_min="-1.8"
-       value_max="1.4"
-       value_default="-0.5"
-       camera_elevation=".1"
-       camera_distance="1.2"
-       camera_angle="0">
-         <param_skeleton>
-            <bone
-             name="mNeck"
-             scale="0.01 0.03 0" />
-
-            <bone
-             name="mCollarLeft"
-             scale="0 0 0"
-             offset="0 .02 0" />
-
-            <bone
-             name="mCollarRight"
-             scale="0 0 0"
-             offset="0 -.02 0" />
-
-            <bone
-             name="mChest"
-             scale="0.02 0.08 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="37"
-       group="0"
-       name="Hip Width"
-	   label="Hip Width"
-       wearable="shape"
-       edit_group="shape_legs"
-       edit_group_order="3"
-       label_min="Narrow"
-       label_max="Wide"
-       show_simple="true"
-       value_min="-3.2"
-       value_max="2.8"
-       camera_distance="1.8">
-         <param_skeleton>
-            <bone
-             name="mPelvis"
-             scale="0 0.1 0" />
-
-            <bone
-             name="mHipLeft"
-             scale="0 0 0"
-             offset="0 .004 0" />
-
-            <bone
-             name="mHipRight"
-             scale="0 0 0"
-             offset="0 -.004 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="842"
-       group="0"
-       name="Hip Length"
-       wearable="shape"
-       edit_group="shape_legs"
-       edit_group_order="3.2"
-       label_min="Short hips"
-       label_max="Long Hips"
-       value_min="-1"
-       value_max="1"
-       camera_distance="1.8">
-         <param_skeleton>
-            <bone
-             name="mPelvis"
-             scale="0 0 0.3" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="38"
-       group="0"
-       name="Torso Length"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="11"
-       label_min="Short Torso"
-       label_max="Long Torso"
-       value_min="-1"
-       value_max="1"
-       camera_distance="1.8">
-         <param_skeleton>
-            <bone
-             name="mTorso"
-             scale="0 0 .3" />
-
-            <bone
-             name="mPelvis"
-             scale="0 0 .1" />
-
-            <bone
-             name="mHipLeft"
-             scale="0 0 -.1" />
-
-            <bone
-             name="mHipRight"
-             scale="0 0 -.1" />
-
-            <bone
-             name="mKneeRight"
-             scale="0 0 -.05" />
-
-            <bone
-             name="mKneeLeft"
-             scale="0 0 -.05" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="195"
-       group="1"
-       name="EyeBone_Spread"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Eyes Together"
-       label_max="Eyes Spread"
-       value_min="-1"
-       value_max="1">
-         <param_skeleton>
-            <bone
-             name="mEyeLeft"
-             scale="0 0 0"
-             offset="0 .009 0" />
-
-            <bone
-             name="mEyeRight"
-             scale="0 0 0"
-             offset="0 -.009 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="661"
-       group="1"
-       name="EyeBone_Head_Shear"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Eyes Shear Left Up"
-       label_max="Eyes Shear Right Up"
-       value_min="-2"
-       value_max="2">
-         <param_skeleton>
-            <bone
-             name="mEyeLeft"
-             scale="0 0 0"
-             offset="0 0 .004" />
-
-            <bone
-             name="mEyeRight"
-             scale="0 0 0"
-             offset="0 0 -.004" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="772"
-       group="1"
-       name="EyeBone_Head_Elongate"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Eyes Short Head"
-       label_max="Eyes Long Head"
-       value_min="-1"
-       value_max="1">
-         <param_skeleton>
-            <bone
-             name="mEyeLeft"
-             scale="0 0 0"
-             offset=".016 0 0" />
-
-            <bone
-             name="mEyeRight"
-             scale="0 0 0"
-             offset=".016 0 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="768"
-       group="1"
-       name="EyeBone_Bug"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Eyes Sunken"
-       label_max="Eyes Bugged"
-       value_min="-2"
-       value_max="2">
-         <param_skeleton>
-            <bone
-             name="mEyeLeft"
-             scale="0 0 0"
-             offset=".005 0 0" />
-
-            <bone
-             name="mEyeRight"
-             scale="0 0 0"
-             offset=".005 0 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="655"
-       group="1"
-       name="Head Size"
-	   label="Head Size"
-       wearable="shape"
-       edit_group="shape_head"
-       label_min="Small Head"
-       label_max="Big Head"
-       show_simple="true"
-       value_min="-.25"
-       value_max=".10">
-         <param_skeleton>
-            <bone
-             name="mSkull"
-             scale="1 1 1"
-             offset="0 0 0.1" />
-
-            <bone
-             name="mHead"
-             scale="1 1 1"
-             offset="0 0 0" />
-
-            <bone
-             name="mEyeLeft"
-             scale="1 1 1"
-             offset="0 0 0" />
-
-            <bone
-             name="mEyeRight"
-             scale="1 1 1"
-             offset="0 0 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="197"
-       group="1"
-       wearable="shoes"
-       name="Shoe_Heels"
-       edit_group="shoes"
-       label_min="No Heels"
-       label_max="High Heels"
-       value_min="0"
-       value_max="1">
-         <param_skeleton>
-            <bone
-             name="mFootRight"
-             scale="0 0 0"
-             offset="0 0 -.08" />
-
-            <bone
-             name="mFootLeft"
-             scale="0 0 0"
-             offset="0 0 -.08" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="502"
-       group="1"
-       wearable="shoes"
-       name="Shoe_Platform"
-       edit_group="shoes"
-       label_min="No Heels"
-       label_max="High Heels"
-       value_min="0"
-       value_max="1">
-         <param_skeleton>
-            <bone
-             name="mFootRight"
-             scale="0 0 0"
-             offset="0 0 -.07" />
-
-            <bone
-             name="mFootLeft"
-             scale="0 0 0"
-             offset="0 0 -.07" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="675"
-       group="0"
-       name="Hand Size"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="10"
-       label_min="Small Hands"
-       label_max="Large Hands"
-       value_min="-.3"
-       value_max=".3"
-       camera_elevation=".1"
-       camera_distance="1.4"
-       camera_angle="0">
-         <param_skeleton>
-            <bone
-             name="mWristRight"
-             scale="1 1 1"
-             offset="0 0 0" />
-
-            <bone
-             name="mWristLeft"
-             scale="1 1 1"
-             offset="0 0 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="683"
-       group="0"
-       name="Neck Thickness"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="2"
-       label_min="Skinny Neck"
-       label_max="Thick Neck"
-       value_min="-.4"
-       value_max=".2"
-       value_default="-.15"
-       camera_elevation=".3"
-       camera_distance=".8"
-       camera_angle="15">
-         <param_skeleton>
-            <bone
-             name="mNeck"
-             scale="1 1 0"
-             offset="0 0 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="689"
-       group="1"
-       wearable="shape"
-       name="EyeBone_Big_Eyes"
-       edit_group="shape_eyes"
-       label_min="Eyes Back"
-       label_max="Eyes Forward"
-       value_min="-1"
-       value_max="1">
-         <param_skeleton>
-            <bone
-             name="mEyeLeft"
-             scale="0 0 0"
-             offset="-.005 0 0" />
-
-            <bone
-             name="mEyeRight"
-             scale="0 0 0"
-             offset="-.005 0 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="692"
-       group="0"
-       name="Leg Length"
-       wearable="shape"
-       edit_group="shape_legs"
-       edit_group_order="2"
-       label_min="Short Legs"
-       label_max="Long Legs"
-       value_min="-1"
-       value_max="1"
-       camera_distance="2.5">
-         <param_skeleton>
-            <bone
-             name="mHipLeft"
-             scale="0 0 .2" />
-
-            <bone
-             name="mHipRight"
-             scale="0 0 .2" />
-
-            <bone
-             name="mKneeRight"
-             scale="0 0 .2" />
-
-            <bone
-             name="mKneeLeft"
-             scale="0 0 .2" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="693"
-       group="0"
-       name="Arm Length"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="9"
-       label_min="Short Arms"
-       label_max="Long arms"
-       value_min="-1"
-       value_max="1"
-       value_default=".6"
-       camera_distance="1.5">
-         <param_skeleton>
-            <bone
-             name="mShoulderLeft"
-             scale="0 .2 0" />
-
-            <bone
-             name="mShoulderRight"
-             scale="0 .2 0" />
-
-            <bone
-             name="mElbowRight"
-             scale="0 .3 0" />
-
-            <bone
-             name="mElbowLeft"
-             scale="0 .3 0" />
-         </param_skeleton>
-      </param>
-
-      <param
-       id="756"
-       group="0"
-       name="Neck Length"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="3"
-       label_min="Short Neck"
-       label_max="Long Neck"
-       value_min="-1"
-       value_max="1"
-       value_default="0"
-       camera_elevation=".3"
-       camera_distance=".8"
-       camera_angle="15">
-         <param_skeleton>
-            <bone
-             name="mNeck"
-             scale="0 0 .5" />
-         </param_skeleton>
-      </param>
-   </skeleton>
-
-   <mesh
-    type="hairMesh"
-	lod="0"
-    file_name="avatar_hair.llm"
-    min_pixel_width="320">
-<!-- begin morph targets -->
-      <param
-       id="180"
-       group="1"
-       name="Hair_Volume"
-       label="Hair Volume"
-	   show_simple="true"
-       wearable="hair"
-       clothing_morph="true"
-       edit_group="hair_style"
-       label_min="Less"
-       label_max="More"
-       value_min="0"
-       value_max="1.3"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="761"
-       group="1"
-       name="Hair_Volume_Small"
-       label="Hair Volume"
-	   show_simple="true"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Less"
-       label_max="More"
-       value_min="0"
-       value_max="1.3"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="181"
-       group="0"
-       name="Hair_Big_Front"
-       label="Big Hair Front"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="5"
-       label_min="Less"
-       label_max="More"
-       value_min="-1"
-       value_max="1"
-       value_default="0.14"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="90">
-         <param_morph />
-      </param>
-
-      <param
-       id="182"
-       group="0"
-       name="Hair_Big_Top"
-       label="Big Hair Top"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="6"
-       label_min="Less"
-       label_max="More"
-       value_min="-1"
-       value_max="1"
-       value_default=".7"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="90">
-         <param_morph />
-      </param>
-
-      <param
-       id="183"
-       group="0"
-       name="Hair_Big_Back"
-       clothing_morph="true"
-       label="Big Hair Back"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="7"
-       label_min="Less"
-       label_max="More"
-       value_min="-1"
-       value_max="1"
-       value_default="0.05"
-       camera_elevation=".1"
-       camera_distance=".7"
-       camera_angle="90">
-         <param_morph />
-      </param>
-
-      <param
-       id="184"
-       group="0"
-       name="Hair_Spiked"
-       label="Spiked Hair"
-	   show_simple="true"
-       wearable="hair"
-       clothing_morph="true"
-       edit_group="hair_style"
-       edit_group_order="15"
-       label_min="No Spikes"
-       label_max="Big Spikes"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="140"
-       group="0"
-       name="Hair_Part_Middle"
-       label="Middle Part"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="17"
-       label_min="No Part"
-       label_max="Part"
-       value_min="0"
-       value_max="2"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="141"
-       group="0"
-       name="Hair_Part_Right"
-       label="Right Part"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="18"
-       label_min="No Part"
-       label_max="Part"
-       value_min="0"
-       value_max="2"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="142"
-       group="0"
-       name="Hair_Part_Left"
-       label="Left Part"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="19"
-       label_min="No Part"
-       label_max="Part"
-       value_min="0"
-       value_max="2"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="143"
-       group="0"
-       name="Hair_Sides_Full"
-       label="Full Hair Sides"
-	   show_simple="true"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="11"
-       label_min="Mowhawk"
-       label_max="Full Sides"
-       value_min="-4"
-       value_max="1.5"
-       value_default="0.125"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="144"
-       group="1"
-       name="Bangs_Front_Up"
-       label="Front Bangs Up"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Bangs"
-       label_max="Bangs Up"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="145"
-       group="1"
-       clothing_morph="true"
-       name="Bangs_Front_Down"
-       label="Front Bangs Down"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Bangs"
-       label_max="Bangs Down"
-       value_min="0"
-       value_max="5"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="146"
-       group="1"
-       name="Bangs_Sides_Up"
-       label="Side Bangs Up"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Side Bangs"
-       label_max="Side Bangs Up"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="147"
-       group="1"
-       clothing_morph="true"
-       name="Bangs_Sides_Down"
-       label="Side Bangs Down"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Side Bangs"
-       label_max="Side Bangs Down"
-       value_min="0"
-       value_max="2"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="148"
-       group="1"
-       name="Bangs_Back_Up"
-       label="Back Bangs Up"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Back Bangs"
-       label_max="Back Bangs Up"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="150">
-         <param_morph />
-      </param>
-
-      <param
-       id="149"
-       group="1"
-       name="Bangs_Back_Down"
-       label="Back Bangs Down"
-       clothing_morph="true"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Back Bangs"
-       label_max="Back Bangs Down"
-       value_min="0"
-       value_max="2"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="150">
-         <param_morph />
-      </param>
-
-      <param
-       id="171"
-       group="1"
-       name="Hair_Front_Down"
-       label="Front Hair Down"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Front Hair"
-       label_max="Front Hair Down"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="172"
-       group="1"
-       name="Hair_Front_Up"
-       label="Front Hair Up"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Front Hair"
-       label_max="Front Hair Up"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="173"
-       group="1"
-       name="Hair_Sides_Down"
-       label="Sides Hair Down"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Sides Hair"
-       label_max="Sides Hair Down"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="174"
-       group="1"
-       name="Hair_Sides_Up"
-       label="Sides Hair Up"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Sides Hair"
-       label_max="Sides Hair Up"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="175"
-       group="1"
-       name="Hair_Back_Down"
-       label="Back Hair Down"
-       clothing_morph="true"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Back Hair"
-       label_max="Back Hair Down"
-       value_min="0"
-       value_max="3"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="150">
-         <param_morph />
-      </param>
-
-      <param
-       id="176"
-       group="1"
-       name="Hair_Back_Up"
-       label="Back Hair Up"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Back Hair"
-       label_max="Back Hair Up"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="150">
-         <param_morph />
-      </param>
-
-      <param
-       id="177"
-       group="0"
-       name="Hair_Rumpled"
-       label="Rumpled Hair"
-	   show_simple="true"
-       wearable="hair"
-       clothing_morph="true"
-       edit_group="hair_style"
-       edit_group_order="14.5"
-       label_min="Smooth Hair"
-       label_max="Rumpled Hair"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="178"
-       group="1"
-       name="Hair_Swept_Back"
-       label="Swept Back Hair"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="NotHair"
-       label_max="Swept Back"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="90">
-         <param_morph />
-      </param>
-
-      <param
-       id="179"
-       group="1"
-       name="Hair_Swept_Forward"
-       label="Swept Forward Hair"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Hair"
-       label_max="Swept Forward"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="90">
-         <param_morph />
-      </param>
-
-      <param
-       id="190"
-       group="1"
-       name="Hair_Tilt_Right"
-       label="Hair Tilted Right"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Hair"
-       label_max="Tilt Right"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="191"
-       group="1"
-       name="Hair_Tilt_Left"
-       label="Hair Tilted Left"
-       wearable="hair"
-       edit_group="hair_style"
-       label_min="Hair"
-       label_max="Tilt Left"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="192"
-       group="0"
-       name="Bangs_Part_Middle"
-       label="Part Bangs"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="20"
-       label_min="No Part"
-       label_max="Part Bangs"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="640"
-       group="1"
-       name="Hair_Egg_Head"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="-1.3"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="641"
-       group="1"
-       name="Hair_Squash_Stretch_Head"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="-.5"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="642"
-       group="1"
-       name="Hair_Square_Head"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="643"
-       group="1"
-       name="Hair_Round_Head"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="644"
-       group="1"
-       name="Hair_Forehead_Round"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="645"
-       group="1"
-       name="Hair_Forehead_Slant"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="774"
-       group="1"
-       name="Shear_Head_Hair"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="-2"
-       value_max="2">
-         <param_morph />
-      </param>
-
-      <param
-       id="771"
-       group="1"
-       name="Elongate_Head_Hair"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="-1"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="674"
-       group="0"
-       name="Hair_Shear_Back"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="12"
-       label="Shear Back"
-       label_min="Full Back"
-       label_max="Sheared Back"
-       value_min="-1"
-       value_max="2"
-       value_default="-0.3"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="100">
-         <param_morph />
-      </param>
-
-      <param
-       id="762"
-       group="0"
-       name="Hair_Shear_Front"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="11.8"
-       label="Shear Front"
-	   show_simple="true"
-       label_min="Full Front"
-       label_max="Sheared Front"
-       value_min="0"
-       value_max="3"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="30">
-         <param_morph />
-      </param>
-
-      <param
-       id="754"
-       group="0"
-       name="Hair_Taper_Back"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="14"
-       label="Taper Back"
-       label_min="Wide Back"
-       label_max="Narrow Back"
-       value_min="-1"
-       value_max="2"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="160">
-         <param_morph />
-      </param>
-
-      <param
-       id="755"
-       group="0"
-       name="Hair_Taper_Front"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="13"
-       label="Taper Front"
-       label_min="Wide Front"
-       label_max="Narrow Front"
-       value_min="-1.5"
-       value_max="1.5"
-       value_default="0.05"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="782"
-       group="1"
-       clothing_morph="true"
-       name="Hair_Pigtails_Short"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="783"
-       group="1"
-       clothing_morph="true"
-       name="Hair_Pigtails_Med"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="790"
-       group="1"
-       clothing_morph="true"
-       name="Hair_Pigtails_Medlong"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="784"
-       group="1"
-       clothing_morph="true"
-       name="Hair_Pigtails_Long"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="786"
-       group="1"
-       name="Hair_Ponytail_Short"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="787"
-       group="1"
-       name="Hair_Ponytail_Med"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="788"
-       group="1"
-       name="Hair_Ponytail_Long"
-       clothing_morph="true"
-       wearable="hair"
-       edit_group="hair_style"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!-- #end morph targets -->
-   </mesh>
-
-   <mesh
-    type="hairMesh"
-	lod="1"
-    file_name="avatar_hair_1.llm"
-    min_pixel_width="160"
-    reference="avatar_hair.llm">
-   </mesh>
-
-   <mesh
-    type="hairMesh"
-	lod="2"
-    file_name="avatar_hair_2.llm"
-    min_pixel_width="80"
-    reference="avatar_hair.llm">
-   </mesh>
-
-   <mesh
-    type="hairMesh"
-	lod="3"
-    file_name="avatar_hair_3.llm"
-    min_pixel_width="40"
-    reference="avatar_hair.llm">
-   </mesh>
-
-   <mesh
-    type="hairMesh"
-	lod="4"
-    file_name="avatar_hair_4.llm"
-	min_pixel_width="20"
-    reference="avatar_hair.llm">
-   </mesh>
-
-   <mesh
-    type="hairMesh"
-	lod="5"
-    file_name="avatar_hair_5.llm"
-	min_pixel_width="0"
-    reference="avatar_hair.llm">
-   </mesh>
-
-   <mesh
-    type="headMesh"
-	lod="0"
-    file_name="avatar_head.llm"
-    min_pixel_width="320">
-<!--
-            begin morph targets
-            #############
-            tweakable morphs
-            #############
-  -->
-      <param
-       id="1"
-       group="0"
-       name="Big_Brow"
-       label="Brow Size"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="7"
-       label_min="Small"
-       label_max="Large"
-       value_min="-.3"
-       value_max="2"
-       camera_elevation=".1"
-       camera_distance=".4"
-       camera_angle="45">
-         <param_morph />
-      </param>
-
-      <param
-       id="2"
-       group="0"
-       name="Nose_Big_Out"
-       label="Nose Size"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="1"
-       label_min="Small"
-       label_max="Large"
-       show_simple="true"
-       value_min="-0.8"
-       value_max="2.5"
-       camera_elevation=".1"
-       camera_distance=".35"
-       camera_angle="50">
-         <param_morph />
-      </param>
-
-      <param
-       id="4"
-       group="0"
-       name="Broad_Nostrils"
-       label="Nostril Width"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="3"
-       label_min="Narrow"
-       label_max="Broad"
-       value_min="-.5"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="759"
-       group="0"
-       name="Low_Septum_Nose"
-       label="Nostril Division"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="3.5"
-       label_min="High"
-       label_max="Low"
-       value_min="-1"
-       value_max="1.5"
-       value_default="0.5"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="517"
-       group="0"
-       name="Wide_Nose"
-       label="Nose Width"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="2"
-       label_min="Narrow"
-       label_max="Wide"
-       show_simple="true"
-       value_min="-.5"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="5"
-       group="0"
-       name="Cleft_Chin"
-       label="Chin Cleft"
-       wearable="shape"
-       edit_group="shape_chin"
-       edit_group_order="6"
-       label_min="Round"
-       label_max="Cleft"
-       value_min="-.1"
-       value_max="1"
-       camera_elevation="0"
-       camera_distance=".28"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="6"
-       group="0"
-       name="Bulbous_Nose_Tip"
-       label="Nose Tip Shape"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="8"
-       label_min="Pointy"
-       label_max="Bulbous"
-       value_min="-.3"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".35"
-       camera_angle="15">
-         <param_morph />
-      </param>
-
-      <param
-       id="7"
-       group="0"
-       name="Weak_Chin"
-       label="Chin Angle"
-       wearable="shape"
-       edit_group="shape_chin"
-       edit_group_order="1"
-       label_min="Chin Out"
-       label_max="Chin In"
-       value_min="-.5"
-       value_max=".5"
-       camera_elevation=".1"
-       camera_distance=".4"
-       camera_angle="45">
-         <param_morph />
-      </param>
-
-      <param
-       id="8"
-       group="0"
-       name="Double_Chin"
-       label="Chin-Neck"
-       wearable="shape"
-       edit_group="shape_chin"
-       edit_group_order="8"
-       label_min="Tight Chin"
-       label_max="Double Chin"
-       value_min="-.5"
-       value_max="1.5"
-       camera_elevation="-.1"
-       camera_distance=".3"
-       camera_angle="60">
-         <param_morph />
-      </param>
-
-      <param
-       id="10"
-       group="0"
-       name="Sunken_Cheeks"
-       label="Lower Cheeks"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="9"
-       label_min="Well-Fed"
-       label_max="Sunken"
-       show_simple="true"
-       value_min="-1.5"
-       value_max="3"
-       camera_elevation=".1"
-       camera_distance=".4"
-       camera_angle="5">
-         <param_morph />
-      </param>
-
-      <param
-       id="11"
-       group="0"
-       name="Noble_Nose_Bridge"
-       label="Upper Bridge"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="5"
-       label_min="Low"
-       label_max="High"
-       value_min="-.5"
-       value_max="1.5"
-       camera_elevation=".1"
-       camera_distance=".35"
-       camera_angle="70">
-         <param_morph />
-      </param>
-
-      <param
-       id="758"
-       group="0"
-       name="Lower_Bridge_Nose"
-       label="Lower Bridge"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="5.5"
-       label_min="Low"
-       label_max="High"
-       value_min="-1.5"
-       value_max="1.5"
-       camera_elevation=".1"
-       camera_distance=".35"
-       camera_angle="70">
-         <param_morph />
-      </param>
-
-      <param
-       id="12"
-       group="0"
-       name="Jowls"
-       wearable="shape"
-       edit_group="shape_chin"
-       edit_group_order="5"
-       label_min="Less"
-       label_max="More"
-       value_min="-.5"
-       value_max="2.5"
-       camera_elevation=".1"
-       camera_distance=".4"
-       camera_angle="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="13"
-       group="0"
-       name="Cleft_Chin_Upper"
-       label="Upper Chin Cleft"
-       wearable="shape"
-       edit_group="shape_chin"
-       edit_group_order="7"
-       label_min="Round"
-       label_max="Cleft"
-       value_min="0"
-       value_max="1.5"
-       camera_elevation="0"
-       camera_distance=".28"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="14"
-       group="0"
-       name="High_Cheek_Bones"
-       label="Cheek Bones"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="10"
-       label_min="Low"
-       label_max="High"
-       value_min="-.5"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="15"
-       group="0"
-       name="Ears_Out"
-       label="Ear Angle"
-       wearable="shape"
-       edit_group="shape_ears"
-       edit_group_order="2"
-       label_min="In"
-       label_max="Out"
-       value_min="-.5"
-       value_max="1.5"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-<!--Pointy eyebrows became a driver/driven param with new max value for backwards compatibility between 1.0 and 1.1-->
-      <param
-       id="870"
-       group="1"
-       name="Pointy_Eyebrows"
-       label="Eyebrow Points"
-       wearable="hair"
-       edit_group="hair_eyebrows"
-       edit_group_order="4"
-       label_min="Smooth"
-       label_max="Pointy"
-       value_min="-.5"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_morph />
-      </param>
-
-      <param
-       id="17"
-       group="0"
-       name="Square_Jaw"
-       label="Jaw Shape"
-       wearable="shape"
-       edit_group="shape_chin"
-       edit_group_order="2"
-       label_min="Pointy"
-       label_max="Square"
-       value_min="-.5"
-       value_max="1"
-       camera_distance=".3"
-       camera_elevation=".04"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="18"
-       group="0"
-       name="Puffy_Upper_Cheeks"
-       label="Upper Cheeks"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="8"
-       label_min="Thin"
-       label_max="Puffy"
-       value_min="-1.5"
-       value_max="2.5"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="19"
-       group="0"
-       name="Upturned_Nose_Tip"
-       label="Nose Tip Angle"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="7"
-       label_min="Downturned"
-       label_max="Upturned"
-       value_min="-1.5"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".35"
-       camera_angle="15">
-         <param_morph />
-      </param>
-
-      <param
-       id="20"
-       group="0"
-       name="Bulbous_Nose"
-       label="Nose Thickness"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="4"
-       label_min="Thin Nose"
-       label_max="Bulbous Nose"
-       show_simple="true"
-       value_min="-.5"
-       value_max="1.5"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_morph />
-      </param>
-
-      <param
-       id="21"
-       group="0"
-       name="Upper_Eyelid_Fold"
-       label="Upper Eyelid Fold"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="5"
-       label_min="Uncreased"
-       label_max="Creased"
-       value_min="-0.2"
-       value_max="1.3"
-       camera_elevation=".1"
-       camera_distance=".35">
-         <param_morph />
-      </param>
-
-      <param
-       id="22"
-       group="0"
-       name="Attached_Earlobes"
-       label="Attached Earlobes"
-       wearable="shape"
-       edit_group="shape_ears"
-       edit_group_order="3"
-       label_min="Unattached"
-       label_max="Attached"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="45">
-         <param_morph />
-      </param>
-
-      <param
-       id="23"
-       group="0"
-       name="Baggy_Eyes"
-       label="Eye Bags"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="6"
-       label_min="Smooth"
-       label_max="Baggy"
-       value_min="-.5"
-       value_max="1.5"
-       camera_elevation=".1"
-       camera_distance=".35">
-         <param_morph />
-      </param>
-
-      <param
-       id="765"
-       group="0"
-       name="Puffy_Lower_Lids"
-       label="Puffy Eyelids"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="6.1"
-       label_min="Flat"
-       label_max="Puffy"
-       value_min="-.3"
-       value_max="2.5"
-       camera_elevation=".1"
-       camera_distance=".35">
-         <param_morph />
-      </param>
-
-      <param
-       id="24"
-       group="0"
-       name="Wide_Eyes"
-       label="Eye Opening"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="1.1"
-       label_min="Narrow"
-       label_max="Wide"
-       value_min="-1.5"
-       value_max="2"
-	   show_simple="true"
-       camera_elevation=".1"
-       camera_distance=".35">
-         <param_morph />
-      </param>
-
-      <param
-       id="25"
-       group="0"
-       name="Wide_Lip_Cleft"
-       label="Lip Cleft"
-       wearable="shape"
-       edit_group="shape_mouth"
-       edit_group_order="6"
-       label_min="Narrow"
-       label_max="Wide"
-       value_min="-.8"
-       value_max="1.5"
-       camera_elevation="0"
-       camera_distance=".28">
-         <param_morph />
-      </param>
-
-      <param
-       id="764"
-       group="0"
-       name="Lip_Cleft_Deep"
-       label="Lip Cleft Depth"
-       wearable="shape"
-       edit_group="shape_mouth"
-       edit_group_order="5.8"
-       label_min="Shallow"
-       label_max="Deep"
-       value_min="-.5"
-       value_max="1.2"
-       camera_elevation="0"
-       camera_distance=".28">
-         <param_morph />
-      </param>
-
-      <param
-       id="26"
-       group="1"
-       wearable="shape"
-       name="Lips_Thin"
-       edit_group="driven"
-       value_min="0"
-       value_max=".7">
-         <param_morph />
-      </param>
-
-      <param
-       id="27"
-       group="0"
-       name="Wide_Nose_Bridge"
-       label="Bridge Width"
-       wearable="shape"
-       edit_group="shape_nose"
-       edit_group_order="6"
-       label_min="Narrow"
-       label_max="Wide"
-       value_min="-1.3"
-       value_max="1.2"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="28"
-       group="1"
-       name="Lips_Fat"
-       wearable="shape"
-       edit_group="driven"
-       value_min="0"
-       value_max="2">
-         <param_morph />
-      </param>
-
-      <param
-       id="29"
-       group="1"
-       name="Wide_Upper_Lip"
-       wearable="shape"
-       edit_group="driven"
-       value_min="-.7"
-       value_max="1.3">
-         <param_morph />
-      </param>
-
-      <param
-       id="30"
-       group="1"
-       name="Wide_Lower_Lip"
-       wearable="shape"
-       edit_group="driven"
-       value_min="-.7"
-       value_max="1.3">
-         <param_morph />
-      </param>
-
-<!--Arced eyebrows became a driver/driven param with new max value for backwards compatibility between 1.0 and 1.1-->
-      <param
-       id="872"
-       group="1"
-       name="Arced_Eyebrows"
-       label="Eyebrow Arc"
-       wearable="hair"
-       edit_group="hair_eyebrows"
-       edit_group_order="3"
-       label_min="Flat"
-       label_max="Arced"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!--Lower eyebrows became a driver/driven param with new min value for backwards compatibility between 1.0 and 1.1-->
-      <param
-       id="871"
-       group="1"
-       name="Lower_Eyebrows"
-       label="Eyebrow Height"
-	   show_simple="true"
-       wearable="hair"
-       edit_group="hair_eyebrows"
-       edit_group_order="2.5"
-       label_min="Higher"
-       label_max="Lower"
-       value_min="-2"
-       value_max="2">
-         <param_morph />
-      </param>
-
-      <param
-       id="35"
-       group="0"
-       name="Big_Ears"
-       label="Ear Size"
-       wearable="shape"
-       edit_group="shape_ears"
-       edit_group_order="1"
-       label_min="Small"
-       label_max="Large"
-       value_min="-1"
-       value_max="2"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="45">
-         <param_morph />
-      </param>
-
-      <param
-       id="796"
-       group="0"
-       name="Pointy_Ears"
-       label="Ear Tips"
-       wearable="shape"
-       edit_group="shape_ears"
-       edit_group_order="4"
-       label_min="Flat"
-       label_max="Pointy"
-       value_min="-.4"
-       value_max="3"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="45">
-         <param_morph />
-      </param>
-
-      <param
-       id="185"
-       group="0"
-       name="Deep_Chin"
-       label="Chin Depth"
-       wearable="shape"
-       edit_group="shape_chin"
-       edit_group_order="3"
-       label_min="Shallow"
-       label_max="Deep"
-       value_min="-1"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".4"
-       camera_angle="30">
-         <param_morph />
-      </param>
-
-      <param
-       id="186"
-       group="1"
-       name="Egg_Head"
-       label="Egg Head"
-       wearable="shape"
-       edit_group="shape_head"
-       label_min="Chin Heavy"
-       label_max="Forehead Heavy"
-       value_min="-1.3"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="187"
-       group="1"
-       name="Squash_Stretch_Head"
-       label="Squash/Stretch Head"
-       wearable="shape"
-       edit_group="shape_head"
-       label_min="Squash Head"
-       label_max="Stretch Head"
-       value_min="-.5"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph>
-			<volume_morph
-				name="HEAD"
-				scale="-0.008 -0.006 0.015"/>
-		 </param_morph>
-      </param>
-
-      <param
-       id="188"
-       group="1"
-       name="Square_Head"
-       wearable="shape"
-       label_min="Less Square"
-       label_max="More Square"
-       value_min="0"
-       value_max=".7"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="189"
-       group="1"
-       wearable="shape"
-       name="Round_Head"
-       label_min="Less Round"
-       label_max="More Round"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       id="194"
-       group="1"
-       name="Eye_Spread"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Eyes Together"
-       label_max="Eyes Spread"
-       value_min="-2"
-       value_max="2">
-         <param_morph />
-      </param>
-
-      <param
-       id="400"
-       sex="male"
-       group="1"
-       name="Displace_Hair_Facial"
-       label="Hair Thickess"
-       wearable="hair"
-       edit_group="hair_facial"
-       label_min="Cropped Hair"
-       label_max="Bushy Hair"
-       value_min="0"
-       value_max="2">
-         <param_morph />
-      </param>
-
-      <param
-       id="506"
-       group="0"
-       name="Mouth_Height"
-       wearable="shape"
-       label="Mouth Position"
-	   show_simple="true"
-       edit_group="shape_mouth"
-       edit_group_order="4"
-       label_min="High"
-       label_max="Low"
-       value_min="-2"
-       value_max="2"
-       camera_distance=".3"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       id="633"
-       group="1"
-       name="Fat_Head"
-       label="Fat Head"
-       wearable="shape"
-       edit_group="shape_body"
-       label_min="Skinny"
-       label_max="Fat"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".3">
-         <param_morph/>
-      </param>
-
-      <param
-       id="630"
-       group="1"
-       name="Forehead_Round"
-       label="Round Forehead"
-       wearable="shape"
-       label_min="Less"
-       label_max="More"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="631"
-       group="1"
-       name="Forehead_Slant"
-       label="Slanted Forehead"
-       wearable="shape"
-       label_min="Less"
-       label_max="More"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="650"
-       group="0"
-       name="Eyelid_Corner_Up"
-       label="Outer Eye Corner"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="4"
-       label_min="Corner Down"
-       label_max="Corner Up"
-       value_min="-1.3"
-       value_max="1.2"
-       camera_elevation=".1"
-       camera_distance=".30">
-         <param_morph />
-      </param>
-
-	  <param
-       id="880"
-       group="0"
-       name="Eyelid_Inner_Corner_Up"
-       label="Inner Eye Corner"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="4.2"
-       label_min="Corner Down"
-       label_max="Corner Up"
-       value_min="-1.3"
-       value_max="1.2"
-       camera_elevation=".1"
-       camera_distance=".30">
-         <param_morph />
-      </param>
-
-      <param
-       id="653"
-       group="0"
-       name="Tall_Lips"
-       wearable="shape"
-       label="Lip Fullness"
-	   show_simple="true"
-       edit_group="shape_mouth"
-       edit_group_order="2"
-       label_min="Less Full"
-       label_max="More Full"
-       value_min="-1"
-       value_max="2"
-       camera_distance=".3"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       id="656"
-       group="0"
-       name="Crooked_Nose"
-       wearable="shape"
-       label="Crooked Nose"
-       edit_group="shape_nose"
-       edit_group_order="9"
-       label_min="Nose Left"
-       label_max="Nose Right"
-       value_min="-2"
-       value_max="2"
-       camera_distance=".3"
-       camera_elevation=".04"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="657"
-       group="1"
-       name="Smile_Mouth"
-       wearable="shape"
-       label="Mouth Corner"
-       edit_group="shape_mouth"
-       label_min="Corner Normal"
-       label_max="Corner Up"
-       value_min="0"
-       value_max="1.4"
-       camera_distance=".3"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       id="658"
-       group="1"
-       name="Frown_Mouth"
-       wearable="shape"
-       label="Mouth Corner"
-       edit_group="shape_mouth"
-       label_min="Corner Normal"
-       label_max="Corner Down"
-       value_min="0"
-       value_max="1.2"
-       camera_distance=".3"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       id="797"
-       group="1"
-       name="Fat_Upper_Lip"
-       wearable="shape"
-       label="Fat Upper Lip"
-       edit_group="shape_mouth"
-       label_min="Normal Upper"
-       label_max="Fat Upper"
-       value_min="0"
-       value_max="1.5"
-       camera_distance=".3"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       id="798"
-       group="1"
-       name="Fat_Lower_Lip"
-       wearable="shape"
-       label="Fat Lower Lip"
-       edit_group="shape_mouth"
-       label_min="Normal Lower"
-       label_max="Fat Lower"
-       value_min="0"
-       value_max="1.5"
-       camera_distance=".3"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       id="660"
-       group="1"
-       name="Shear_Head"
-       wearable="shape"
-       label="Shear Face"
-       edit_group="shape_head"
-       label_min="Shear Left"
-       label_max="Shear Right"
-       value_min="-2"
-       value_max="2"
-       value_default="0"
-       camera_distance=".5"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       id="770"
-       group="1"
-       name="Elongate_Head"
-       wearable="shape"
-       label="Shear Face"
-       edit_group="shape_head"
-       label_min="Flat Head"
-       label_max="Long Head"
-       value_min="-1"
-       value_max="1"
-       value_default="0"
-       camera_distance=".5"
-       camera_elevation=".04">
-         <param_morph>
-			<volume_morph
-				name="HEAD"
-				scale="0.02 0.0 0.0"/>
-		 </param_morph>
-      </param>
-
-      <param
-       id="663"
-       group="0"
-       name="Shift_Mouth"
-       wearable="shape"
-       label="Shift Mouth"
-       edit_group="shape_mouth"
-       edit_group_order="7"
-       label_min="Shift Left"
-       label_max="Shift Right"
-       value_min="-2"
-       value_max="2"
-       value_default="0"
-       camera_distance=".35"
-       camera_elevation=".04"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       id="664"
-       group="0"
-       name="Pop_Eye"
-       wearable="shape"
-       label="Eye Pop"
-       edit_group="shape_eyes"
-       edit_group_order="8"
-       label_min="Pop Right Eye"
-       label_max="Pop Left Eye"
-       value_min="-1.3"
-       value_max="1.3"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".35">
-         <param_morph />
-      </param>
-
-      <param
-       id="760"
-       group="0"
-       name="Jaw_Angle"
-       wearable="shape"
-       label="Jaw Angle"
-       edit_group="shape_chin"
-       edit_group_order="3.5"
-       label_min="Low Jaw"
-       label_max="High Jaw"
-       value_min="-1.2"
-       value_max="2"
-       value_default="0"
-       camera_distance=".5"
-       camera_elevation=".04"
-       camera_angle="70">
-         <param_morph />
-      </param>
-
-      <param
-       id="665"
-       group="0"
-       name="Jaw_Jut"
-       wearable="shape"
-       label="Jaw Jut"
-       edit_group="shape_chin"
-       edit_group_order="4"
-       label_min="Overbite"
-       label_max="Underbite"
-       value_min="-2"
-       value_max="2"
-       value_default="0"
-       camera_distance=".5"
-       camera_elevation=".04"
-       camera_angle="70">
-         <param_morph />
-      </param>
-
-      <param
-       id="686"
-       group="1"
-       name="Head_Eyes_Big"
-       wearable="shape"
-       label="Eye Size"
-       edit_group="shape_eyes"
-       label_min="Beady Eyes"
-       label_max="Anime Eyes"
-       show_simple="true"
-       value_min="-2"
-       value_max="2"
-       value_default="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="767"
-       group="1"
-       name="Bug_Eyed_Head"
-       wearable="shape"
-       label="Eye Depth"
-       edit_group="shape_eyes"
-       edit_group_order="4.5"
-       label_min="Sunken Eyes"
-       label_max="Bug Eyes"
-       value_min="-2"
-       value_max="2"
-       value_default="0">
-         <param_morph />
-      </param>
-
-<!--
-         #Fat_Lips = Fat_Lips 34 1 0 1
-         #Wide_Lips = Wide_Lips 35 1 0 1
-         #Wide_Nose = Wide_Nose 36 1 0 1
-   -->
-<!--
-        ##############
-        # Facial Expression morphs
-        ##############
-        -->
-      <param
-       id="300"
-       group="1"
-       name="Express_Closed_Mouth"
-       value_default="1"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="301"
-       group="1"
-       name="Express_Tongue_Out"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="302"
-       group="1"
-       name="Express_Surprise_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="303"
-       group="1"
-       name="Express_Wink_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="304"
-       group="1"
-       name="Express_Embarrassed_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="305"
-       group="1"
-       name="Express_Shrug_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="306"
-       group="1"
-       name="Express_Kiss"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="307"
-       group="1"
-       name="Express_Bored_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="308"
-       group="1"
-       name="Express_Repulsed_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="309"
-       group="1"
-       name="Express_Disdain"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="310"
-       group="1"
-       name="Express_Afraid_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="311"
-       group="1"
-       name="Express_Worry_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="312"
-       group="1"
-       name="Express_Cry_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="313"
-       group="1"
-       name="Express_Sad_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="314"
-       group="1"
-       name="Express_Anger_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="315"
-       group="1"
-       name="Express_Frown"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="316"
-       group="1"
-       name="Express_Laugh_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="317"
-       group="1"
-       name="Express_Toothsmile"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="318"
-       group="1"
-       name="Express_Smile"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="632"
-       group="1"
-       name="Express_Open_Mouth"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!--
-        ##############
-        # other morphs (not user controlled)
-        ##############
-        -->
-      <param
-       id="40"
-       group="1"
-       name="Male_Head"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="41"
-       group="1"
-       name="Old"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!--
-        ##############
-        # animatable morphs
-        ##############
-         -->
-      <param
-       id="51"
-       group="1"
-       name="Furrowed_Eyebrows"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="53"
-       group="1"
-       name="Surprised_Eyebrows"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="54"
-       group="1"
-       name="Worried_Eyebrows"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="55"
-       group="1"
-       name="Frown_Mouth"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="57"
-       group="1"
-       name="Smile_Mouth"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="58"
-       group="1"
-       name="Blink_Left"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="59"
-       group="1"
-       name="Blink_Right"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!--
-        #end morph targets
-         -->
-   </mesh>
-
-   <mesh
-    type="headMesh"
-	lod="1"
-    file_name="avatar_head_1.llm"
-    min_pixel_width="160"
-    reference="avatar_head.llm">
-   </mesh>
-
-   <mesh
-    type="headMesh"
-	lod="2"
-    file_name="avatar_head_2.llm"
-    min_pixel_width="80"
-    reference="avatar_head.llm">
-   </mesh>
-
-   <mesh
-    type="headMesh"
-	lod="3"
-    file_name="avatar_head_3.llm"
-    min_pixel_width="40"
-    reference="avatar_head.llm">
-   </mesh>
-
-   <mesh
-    type="headMesh"
-	lod="4"
-    file_name="avatar_head_4.llm"
-	min_pixel_width="0"
-    reference="avatar_head.llm">
-   </mesh>
-
-   <mesh
-    type="eyelashMesh"
-	lod="0"
-    file_name="avatar_eyelashes.llm"
-    min_pixel_width="320">
-      <param
-       shared="1"
-       id="660"
-       group="1"
-       name="Shear_Head"
-       wearable="shape"
-       label="Shear Face"
-       edit_group="shape_head"
-       label_min="Shear Left"
-       label_max="Shear Right"
-       value_min="-2"
-       value_max="2"
-       value_default="0"
-       camera_distance=".5"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="770"
-       group="1"
-       name="Elongate_Head"
-       wearable="shape"
-       label="Shear Face"
-       edit_group="shape_head"
-       label_min="Flat Head"
-       label_max="Long Head"
-       value_min="-1"
-       value_max="1"
-       value_default="0"
-       camera_distance=".5"
-       camera_elevation=".04">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="664"
-       group="0"
-       name="Pop_Eye"
-       wearable="shape"
-       label="Eye Pop"
-       edit_group="shape_eyes"
-       edit_group_order="8"
-       label_min="Pop Right Eye"
-       label_max="Pop Left Eye"
-       value_min="-2"
-       value_max="2"
-       value_default="0"
-       camera_distance=".5"
-       camera_elevation=".04"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="21"
-       group="0"
-       name="Upper_Eyelid_Fold"
-       label="Upper Eyelid Fold"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Uncreased"
-       label_max="Creased"
-       value_min="-0.2"
-       value_max="1.3"
-       camera_elevation=".1"
-       camera_distance=".35">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="24"
-       group="0"
-       name="Wide_Eyes"
-       label="Eye Opening"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Narrow"
-       label_max="Wide"
-       show_simple="true"
-       value_min="-1.5"
-       value_max="2"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="186"
-       group="1"
-       name="Egg_Head"
-       label="Egg Head"
-       wearable="shape"
-       edit_group="shape_head"
-       label_min="Chin Heavy"
-       label_max="Forehead Heavy"
-       value_min="-1.3"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="187"
-       group="1"
-       name="Squash_Stretch_Head"
-       label="Squash/Stretch Head"
-       wearable="shape"
-       edit_group="shape_head"
-       label_min="Squash Head"
-       label_max="Stretch Head"
-       value_min="-.5"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="194"
-       group="1"
-       name="Eye_Spread"
-       edit_group="shape_eyes"
-       label_min="Eyes Together"
-       label_max="Eyes Spread"
-       value_min="-2"
-       value_max="2">
-         <param_morph />
-      </param>
-
-      <param
-       id="518"
-       group="0"
-       name="Eyelashes_Long"
-       wearable="shape"
-       label="Eyelash Length"
-       edit_group="shape_eyes"
-       edit_group_order="7"
-       label_min="Short"
-       label_max="Long"
-       value_min="-.3"
-       value_max="1.5"
-       camera_elevation=".1"
-       camera_distance=".30"
-       camera_angle="-20">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="650"
-       group="0"
-       name="Eyelid_Corner_Up"
-       label="Outer Eye Corner"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Corner Down"
-       label_max="Corner Up"
-       value_min="-1.3"
-       value_max="1.2"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="880"
-       group="0"
-       name="Eyelid_Inner_Corner_Up"
-       label="Inner Eye Corner"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="Corner Down"
-       label_max="Corner Up"
-       value_min="-1.3"
-       value_max="1.2"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="686"
-       group="1"
-       name="Head_Eyes_Big"
-       wearable="shape"
-       label="Eye Size"
-       edit_group="shape_eyes"
-       label_min="Beady Eyes"
-       label_max="Anime Eyes"
-       value_min="-2"
-       value_max="2"
-	   show_simple="true"
-       value_default="0">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="767"
-       group="1"
-       name="Bug_Eyed_Head"
-       wearable="shape"
-       label="Eye Depth"
-       edit_group="shape_eyes"
-       edit_group_order="4.5"
-       label_min="Sunken Eyes"
-       label_max="Bug Eyes"
-       value_min="-2"
-       value_max="2"
-       value_default="0">
-         <param_morph />
-      </param>
-
-<!--
-        ##############
-        # Facial Expression morphs
-        ##############
-        -->
-      <param
-       shared="1"
-       id="301"
-       group="1"
-       name="Express_Tongue_Out"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="302"
-       group="1"
-       name="Express_Surprise_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="303"
-       group="1"
-       name="Express_Wink_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="304"
-       group="1"
-       name="Express_Embarrassed_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="305"
-       group="1"
-       name="Express_Shrug_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="306"
-       group="1"
-       name="Express_Kiss"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="307"
-       group="1"
-       name="Express_Bored_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="308"
-       group="1"
-       name="Express_Repulsed_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="309"
-       group="1"
-       name="Express_Disdain"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="310"
-       group="1"
-       name="Express_Afraid_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="312"
-       group="1"
-       name="Express_Cry_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="313"
-       group="1"
-       name="Express_Sad_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="314"
-       group="1"
-       name="Express_Anger_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="315"
-       group="1"
-       name="Express_Frown"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="316"
-       group="1"
-       name="Express_Laugh_Emote"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="317"
-       group="1"
-       name="Express_Toothsmile"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="318"
-       group="1"
-       name="Express_Smile"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!--
-        ##############
-        # other morphs (not user controlled)
-        ##############
-        -->
-      <param
-       shared="1"
-       id="41"
-       group="1"
-       name="Old"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!--
-        ##############
-        # animatable morphs
-        ##############
-         -->
-      <param
-       shared="1"
-       id="58"
-       group="1"
-       name="Blink_Left"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       shared="1"
-       id="59"
-       group="1"
-       name="Blink_Right"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-   </mesh>
-
-<!--
-    #headMesh2 =
-    #headMesh3 =
-    -->
-   <mesh
-    type="upperBodyMesh"
-	lod="0"
-    file_name="avatar_upper_body.llm"
-    min_pixel_width="320">
-<!--
-        #begin morph targets
-        #############
-        # tweakable morphs
-        #############
-        -->
-      <param
-       id="104"
-       group="1"
-       name="Big_Belly_Torso"
-       value_min="0"
-       value_max="1">
-         <param_morph>
-		 	<volume_morph
-				name="BELLY"
-				scale="0.075 0.04 0.03"
-				pos="0.07 0 -0.07"/>
-		</param_morph>
-      </param>
-
-      <param
-       id="626"
-       sex="female"
-       group="1"
-       name="Big_Chest"
-       label="Chest Size"
-       wearable="shape"
-       edit_group="shape_torso"
-       label_min="Small"
-       label_max="Large"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance="1"
-       camera_angle="15">
-         <param_morph />
-      </param>
-
-      <param
-       id="627"
-       sex="female"
-       group="1"
-       name="Small_Chest"
-       label="Chest Size"
-       wearable="shape"
-       edit_group="shape_torso"
-       label_min="Large"
-       label_max="Small"
-       value_min="0"
-       value_max="1"
-       camera_elevation="0"
-       camera_distance=".28">
-         <param_morph />
-      </param>
-
-      <param
-       id="843"
-       sex="female"
-       group="1"
-       name="No_Chest"
-       label="Chest Size"
-       wearable="shape"
-       edit_group="shape_torso"
-       label_min="Some"
-       label_max="None"
-       value_min="0"
-       value_max="1"
-       camera_elevation="0"
-       camera_distance=".28">
-         <param_morph />
-      </param>
-
-      <param
-       id="106"
-       group="1"
-       name="Muscular_Torso"
-       label="Torso Muscles"
-	   show_simple="true"
-       wearable="shape"
-       edit_group="shape_torso"
-       label_min="Regular"
-       label_max="Muscular"
-       value_min="0"
-       value_max="1.4"
-       camera_elevation=".3"
-       camera_distance="1.2">
-         <param_morph>
-		 	<volume_morph
-				name="L_CLAVICLE"
-				scale="0.02 0.0 0.005"
-				pos="0.0 0 0.005"/>
-		 	<volume_morph
-				name="L_UPPER_ARM"
-				scale="0.015 0.0 0.005"
-				pos="0.015 0 0"/>
-		 	<volume_morph
-				name="L_LOWER_ARM"
-				scale="0.005 0.0 0.005"
-				pos="0.005 0 0"/>
-		 	<volume_morph
-				name="R_CLAVICLE"
-				scale="0.02 0.0 0.005"
-				pos="0.0 0 0.005"/>
-		 	<volume_morph
-				name="R_UPPER_ARM"
-				scale="0.015 0.0 0.005"
-				pos="0.015 0 0"/>
-		 	<volume_morph
-				name="R_LOWER_ARM"
-				scale="0.005 0.0 0.005"
-				pos="0.005 0 0"/>
-		 </param_morph>
-      </param>
-
-      <param
-       id="648"
-       group="1"
-       sex="female"
-       name="Scrawny_Torso"
-       label="Torso Muscles"
-	   show_simple="true"
-       wearable="shape"
-       edit_group="shape_torso"
-       label_min="Regular"
-       label_max="Scrawny"
-       value_min="0"
-       value_max="1.3"
-       camera_elevation=".3"
-       camera_distance="1.2">
-		<param_morph>
-		 	<volume_morph
-				name="BELLY"
-				scale="0.0 -0.01 0.0"
-				pos="0.0 0.0 0"/>
-		 	<volume_morph
-				name="CHEST"
-				scale="-0.01 -0.01 0.0"
-				pos="0.01 0.0 0"/>
-		 	<volume_morph
-				name="L_CLAVICLE"
-				scale="0.0 -0.03 -0.005"
-				pos="0.0 0 -0.005"/>
-		 	<volume_morph
-				name="L_UPPER_ARM"
-				scale="-0.01 -0.01 -0.02"
-				pos="0 0 0"/>
-		 	<volume_morph
-				name="L_LOWER_ARM"
-				scale="-0.005 0.0 -0.01"
-				pos="-0.005 0 0"/>
-		 	<volume_morph
-				name="R_CLAVICLE"
-				scale="0.0 -0.03 -0.005"
-				pos="0.0 0 -0.005"/>
-		 	<volume_morph
-				name="R_UPPER_ARM"
-				scale="-0.01 -0.01 -0.02"
-				pos="0 0 0"/>
-		 	<volume_morph
-				name="R_LOWER_ARM"
-				scale="-0.005 0.0 -0.01"
-				pos="-0.005 0 0"/>
-		</param_morph>
-	  </param>
-
-      <param
-       id="677"
-       group="1"
-       sex="male"
-       name="Scrawny_Torso_Male"
-       label="Torso Scrawny"
-       wearable="shape"
-       edit_group="shape_torso"
-       label_min="Regular"
-       label_max="Scrawny"
-       value_min="0"
-       value_max="1.3"
-       camera_elevation=".3"
-       camera_distance="1.2">
-		<param_morph>
-		 	<volume_morph
-				name="BELLY"
-				scale="-0.01 -0.01 0.0"
-				pos="0.01 0.0 0"/>
-		 	<volume_morph
-				name="CHEST"
-				scale="-0.02 -0.02 0.0"
-				pos="0.01 0.0 0"/>
-		 	<volume_morph
-				name="L_CLAVICLE"
-				scale="0.0 -0.03 -0.005"
-				pos="0.0 0 -0.005"/>
-		 	<volume_morph
-				name="L_UPPER_ARM"
-				scale="-0.01 -0.01 -0.02"
-				pos="0 0 0"/>
-		 	<volume_morph
-				name="L_LOWER_ARM"
-				scale="-0.005 0.0 -0.01"
-				pos="-0.005 0 0"/>
-		 	<volume_morph
-				name="R_CLAVICLE"
-				scale="0.0 -0.03 -0.005"
-				pos="0.0 0 -0.005"/>
-		 	<volume_morph
-				name="R_UPPER_ARM"
-				scale="-0.01 -0.01 -0.02"
-				pos="0 0 0"/>
-		 	<volume_morph
-				name="R_LOWER_ARM"
-				scale="-0.005 0.0 -0.01"
-				pos="-0.005 0 0"/>
-		</param_morph>
-	  </param>
-
-      <param
-       id="634"
-       group="1"
-       name="Fat_Torso"
-       label="Fat Torso"
-       wearable="shape"
-       edit_group="shape_body"
-       label_min="skinny"
-       label_max="fat"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".3">
-         <param_morph>
-			<volume_morph
-				name="CHEST"
-				scale="0.02 0.03 0.03"
-				pos="0 0 -0.03"/>
-			<volume_morph
-				name="BELLY"
-				scale="0.09 0.08 0.07"
-				pos="0 0 -0.05"/>
-			<volume_morph
-				name="L_CLAVICLE"
-				scale="0.0 0.0 0.015"/>
-			<volume_morph
-				name="L_UPPER_ARM"
-				scale="0.02 0.0 0.02"
-				pos="0.0 0.0 -0.02"/>
-			<volume_morph
-				name="L_LOWER_ARM"
-				scale="0.01 0.0 0.01"
-				pos="0.0 0.0 -0.01"/>
-			<volume_morph
-				name="R_CLAVICLE"
-				scale="0.0 0.0 0.015"/>
-			<volume_morph
-				name="R_UPPER_ARM"
-				scale="0.02 0.0 0.02"
-				pos="0.0 0.0 -0.02"/>
-			<volume_morph
-				name="R_LOWER_ARM"
-				scale="0.01 0.0 0.01"
-				pos="0.0 0.0 -0.01"/>
-			<volume_morph
-				name="NECK"
-				scale="0.015 0.01 0.0"/>
-			<volume_morph
-				name="HEAD"
-				scale="0.0 0.0 0.01"
-				pos="0 0 -0.01"/>
-		 </param_morph>
-
-      </param>
-
-      <param
-       id="507"
-       group="0"
-       sex="female"
-       name="Breast_Gravity"
-       label="Breast Buoyancy"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="7"
-       label_min="Less Gravity"
-       label_max="More Gravity"
-       value_default="0"
-       value_min="-1.5"
-       value_max="2"
-       camera_elevation=".3"
-       camera_distance=".8">
-         <param_morph />
-      </param>
-
-      <param
-       id="628"
-       group="1"
-       name="Displace_Loose_Upperbody"
-       label="Shirt Fit"
-       wearable="shirt"
-       edit_group="driven"
-       clothing_morph="true"
-       value_min="0"
-       value_max="1"
-       value_default="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="840"
-       group="0"
-       name="Shirtsleeve_flair"
-       label="Sleeve Looseness"
-	   show_simple="true"
-       wearable="shirt"
-       edit_group="shirt"
-       edit_group_order="6"
-       clothing_morph="true"
-       label_min="Tight Sleeves"
-       label_max="Loose Sleeves"
-       value_min="0"
-       value_max="1.5"
-       camera_distance="1.8"
-       camera_angle="30"
-       camera_elevation="-.3">
-         <param_morph />
-      </param>
-
-      <param
-       id="855"
-       group="1"
-       name="Love_Handles"
-       value_default="0"
-       value_min="-1"
-       value_max="2">
-         <param_morph>
-		 	<volume_morph
-				name="BELLY"
-				scale="0.0 0.02 0.0"/>
-		</param_morph>
-      </param>
-
-      <param
-       id="684"
-       group="0"
-       sex="female"
-       name="Breast_Female_Cleavage"
-       label="Breast Cleavage"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="8"
-       label_min="Separate"
-       label_max="Join"
-       value_default="0"
-       value_min="-.3"
-       value_max="1.3"
-       camera_elevation=".3"
-       camera_distance=".8">
-         <param_morph />
-      </param>
-
-      <param
-       id="685"
-       group="0"
-       sex="male"
-       name="Chest_Male_No_Pecs"
-       label="Pectorals"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="5"
-       label_min="Big Pectorals"
-       label_max="Sunken Chest"
-       value_default="0"
-       value_min="-.5"
-       value_max="1.1"
-       camera_elevation=".3"
-       camera_distance="1.2">
-         <param_morph />
-      </param>
-
-<!-- ############# #
-  other morphs (not user controlled)
-  ############# -->
-      <param
-       id="100"
-       group="1"
-       name="Male_Torso"
-       label_min="Male_Torso"
-       value_min="0"
-       value_max="1">
-        <param_morph>
-			<volume_morph
-				name="CHEST"
-				scale="0.03 0.04 0.02"
-				pos="-0.03 0 -0.01"/>
-			<volume_morph
-				name="BELLY"
-				scale="0.03 0.03 0.0"
-				pos="-0.03 0 0.02"/>
-			<volume_morph
-				name="L_CLAVICLE"
-				scale="0.02 0.0 0.01"
-				pos="-0.02 0 0"/>
-			<volume_morph
-				name="L_UPPER_ARM"
-				scale="0.01 0.0 0.01"
-				pos="0.0 0.0 -0.01"/>
-			<volume_morph
-				name="L_LOWER_ARM"
-				scale="0.005 0.0 0.005"
-				pos="0.0 0.0 -0.005"/>
-			<volume_morph
-				name="R_CLAVICLE"
-				scale="0.02 0.0 0.01"
-				pos="-0.02 0 0"/>
-			<volume_morph
-				name="R_UPPER_ARM"
-				scale="0.01 0.0 0.01"
-				pos="0.0 0.0 -0.01"/>
-			<volume_morph
-				name="R_LOWER_ARM"
-				scale="0.005 0.0 0.005"
-				pos="0.0 0.0 -0.005"/>
-			<volume_morph
-				name="NECK"
-				scale="0.015 0.01 0.0"/>
-			<volume_morph
-				name="HEAD"
-				scale="0.0 0.0 0.01"
-				pos="0 0 -0.01"/>
-		 </param_morph>
-	</param>
-
-<!--
-        ##############
-        # animatable morphs
-        ##############
-        -->
-      <param
-       id="101"
-       group="1"
-       name="Hands_Relaxed"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="102"
-       group="1"
-       name="Hands_Point"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="103"
-       group="1"
-       name="Hands_Fist"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="666"
-       group="1"
-       name="Hands_Relaxed_L"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="667"
-       group="1"
-       name="Hands_Point_L"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="668"
-       group="1"
-       name="Hands_Fist_L"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="669"
-       group="1"
-       name="Hands_Relaxed_R"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="670"
-       group="1"
-       name="Hands_Point_R"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="671"
-       group="1"
-       name="Hands_Fist_R"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="672"
-       group="1"
-       name="Hands_Typing"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="766"
-       group="1"
-       name="Hands_Salute_R"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="791"
-       group="1"
-       name="Hands_Peace_R"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="792"
-       group="1"
-       name="Hands_Spread_R"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!--
-     #end morph targets
-      -->
-   </mesh>
-
-   <mesh
-    type="upperBodyMesh"
-	lod="1"
-    file_name="avatar_upper_body_1.llm"
-    min_pixel_width="160"
-    reference="avatar_upper_body.llm">
-   </mesh>
-
-   <mesh
-    type="upperBodyMesh"
-	lod="2"
-    file_name="avatar_upper_body_2.llm"
-    min_pixel_width="80"
-    reference="avatar_upper_body.llm">
-   </mesh>
-
-   <mesh
-    type="upperBodyMesh"
-	lod="3"
-    file_name="avatar_upper_body_3.llm"
-    min_pixel_width="40"
-    reference="avatar_upper_body.llm">
-   </mesh>
-
-   <mesh
-    type="upperBodyMesh"
-	lod="4"
-    file_name="avatar_upper_body_4.llm"
-	min_pixel_width="0"
-    reference="avatar_upper_body.llm">
-   </mesh>
-
-<!--
-    #upperBodyMesh2 =
-    #upperBodyMesh3 =
-    -->
-   <mesh
-    type="lowerBodyMesh"
-	lod="0"
-    file_name="avatar_lower_body.llm"
-    min_pixel_width="320">
-<!--
-        #begin morph targets
-        #############
-        # tweakable morphs
-        #############
-        -->
-      <param
-       id="156"
-       group="1"
-       name="Big_Belly_Legs"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="151"
-       group="1"
-       name="Big_Butt_Legs"
-       label="Butt Size"
-       wearable="shape"
-       edit_group="shape_legs"
-       label_min="Regular"
-       label_max="Large"
-       value_min="0"
-       value_max="1">
-         <param_morph>
-		 	<volume_morph
-				name="PELVIS"
-				scale="0.03 0.0 0.02"
-				pos="-0.03 0 -0.025"/>
-		 </param_morph>
-      </param>
-
-      <param
-       id="794"
-       group="1"
-       name="Small_Butt"
-       label="Butt Size"
-       wearable="shape"
-       edit_group="shape_legs"
-       label_min="Regular"
-       label_max="Small"
-       value_min="0"
-       value_max="1">
-         <param_morph>
- 		 	<volume_morph
-				name="PELVIS"
-				scale="-0.01 0.0 0.0"
-				pos="0.01 0 0.0"/>
-		 </param_morph>
-      </param>
-
-      <param
-       id="152"
-       group="1"
-       name="Muscular_Legs"
-       label="Leg Muscles"
-	   show_simple="true"
-       wearable="shape"
-       edit_group="shape_legs"
-       label_min="Regular Muscles"
-       label_max="More Muscles"
-       value_min="0"
-       value_max="1.5"
-       camera_distance="1.3"
-       camera_elevation="-.5">
-         <param_morph>
-		 	<volume_morph
-				name="L_UPPER_LEG"
-				scale="0.015 0.015 0.0"
-				pos="0.0 0 0.0"/>
-		 	<volume_morph
-				name="L_LOWER_LEG"
-				scale="0.01 0.01 0.0"
-				pos="0.0 0 0.0"/>
-		 	<volume_morph
-				name="R_UPPER_LEG"
-				scale="0.015 0.015 0.0"
-				pos="0.0 0 0.0"/>
-		 	<volume_morph
-				name="R_LOWER_LEG"
-				scale="0.01 0.01 0.0"
-				pos="0.0 0 0.0"/>
-		 </param_morph>
-      </param>
-
-      <param
-       id="651"
-       group="1"
-       name="Scrawny_Legs"
-       label="Scrawny Leg"
-       wearable="shape"
-       edit_group="shape_legs"
-       label_min="Regular Muscles"
-       label_max="Less Muscles"
-       value_min="0"
-       value_max="1.5"
-       camera_distance="1.3"
-       camera_elevation="-.5">
-         <param_morph>
-		 	<volume_morph
-				name="L_UPPER_LEG"
-				scale="-0.03 -0.03 0.0"
-				pos="0.0 0 0.0"/>
-		 	<volume_morph
-				name="L_LOWER_LEG"
-				scale="-0.015 -0.015 0.0"
-				pos="0.0 0 0.0"/>
-		 	<volume_morph
-				name="R_UPPER_LEG"
-				scale="-0.03 -0.03 0.0"
-				pos="0.0 0 0.0"/>
-		 	<volume_morph
-				name="R_LOWER_LEG"
-				scale="-0.015 -0.015 0.0"
-				pos="0.0 0 0.0"/>
-		 </param_morph>
-		</param>
-
-      <param
-       id="853"
-       group="1"
-       name="Bowed_Legs"
-       label="Knee Angle"
-       wearable="shape"
-       value_min="-1"
-       value_max="1">
-         <param_morph>
-		 	<volume_morph
-				name="L_UPPER_LEG"
-				pos="0.0 0.03 0.0"/>
-		 	<volume_morph
-				name="L_LOWER_LEG"
-				pos="0.0 0.03 0.0"/>
-		 	<volume_morph
-				name="R_UPPER_LEG"
-				pos="0.0 -0.03 0.0"/>
-		 	<volume_morph
-				name="R_LOWER_LEG"
-				pos="0.0 -0.03 0.0"/>
-		 </param_morph>
-      </param>
-
-      <param
-       id="500"
-       group="1"
-       name="Shoe_Heel_Height"
-       label="Heel Height"
-       wearable="shoes"
-       edit_group="shoes"
-       label_min="Low Heels"
-       label_max="High Heels"
-       value_min="0"
-       value_max="1"
-       camera_distance="1.5"
-       camera_elevation="-.5">
-         <param_morph />
-      </param>
-
-      <param
-       id="501"
-       group="1"
-       name="Shoe_Platform_Height"
-       label="Platform Height"
-       wearable="shoes"
-       edit_group="shoes"
-       label_min="Low Platforms"
-       label_max="High Platforms"
-       value_min="0"
-       value_max="1"
-       camera_distance="1.5"
-       camera_elevation="-.5">
-         <param_morph />
-      </param>
-
-      <param
-       id="508"
-       group="0"
-       name="Shoe_Platform_Width"
-       label="Platform Width"
-       wearable="shoes"
-       edit_group="shoes"
-       edit_group_order="7"
-       label_min="Narrow"
-       label_max="Wide"
-       value_min="-1"
-       value_max="2"
-       camera_angle="15"
-       camera_distance="1.5"
-       camera_elevation="-1">
-         <param_morph />
-      </param>
-
-      <param
-       id="509"
-       group="1"
-       name="Shoe_Heel_Point"
-       label="Heel Shape"
-       wearable="shoes"
-       edit_group="shoes"
-       label_min="Default Heels"
-       label_max="Pointy Heels"
-       value_min="0"
-       value_max="1"
-       camera_distance="1.3"
-       camera_elevation="-.5">
-         <param_morph />
-      </param>
-
-      <param
-       id="510"
-       group="1"
-       name="Shoe_Heel_Thick"
-       label="Heel Shape"
-       wearable="shoes"
-       edit_group="shoes"
-       label_min="default Heels"
-       label_max="Thick Heels"
-       value_min="0"
-       value_max="1"
-       camera_distance="1.3"
-       camera_elevation="-.5">
-         <param_morph />
-      </param>
-
-      <param
-       id="511"
-       group="1"
-       name="Shoe_Toe_Point"
-       label="Toe Shape"
-       wearable="shoes"
-       edit_group="shoes"
-       label_min="Default Toe"
-       label_max="Pointy Toe"
-       value_min="0"
-       value_max="1"
-       camera_distance="1.3"
-       camera_elevation="-.5">
-         <param_morph />
-      </param>
-
-      <param
-       id="512"
-       group="1"
-       name="Shoe_Toe_Square"
-       label="Toe Shape"
-       wearable="shoes"
-       edit_group="shoes"
-       label_min="Default Toe"
-       label_max="Square Toe"
-       value_min="0"
-       value_max="1"
-       camera_distance="1.5"
-       camera_elevation="-.5">
-         <param_morph />
-      </param>
-
-      <param
-       id="654"
-       group="0"
-       name="Shoe_Toe_Thick"
-       label="Toe Thickness"
-       wearable="shoes"
-       edit_group="shoes"
-       edit_group_order="5"
-       label_min="Flat Toe"
-       label_max="Thick Toe"
-       value_min="0"
-       value_max="2"
-       camera_angle="15"
-       camera_distance="1.5"
-       camera_elevation="-1">
-         <param_morph />
-      </param>
-
-      <param
-       id="515"
-       group="0"
-       name="Foot_Size"
-       label="Foot Size"
-       wearable="shape"
-       edit_group="shape_legs"
-       edit_group_order="6"
-       label_min="Small"
-       label_max="Big"
-       value_min="-1"
-       value_max="3"
-       camera_angle="45"
-       camera_distance="1.1"
-       camera_elevation="-1">
-         <param_morph>
-		 	<volume_morph
-				name="L_FOOT"
-				scale="0.02 0.01 0.0"
-				pos="0.01 0 0"/>
-		 	<volume_morph
-				name="R_FOOT"
-				scale="0.02 0.01 0.0"
-				pos="0.01 0 0"/>
-		</param_morph>
-	  </param>
-
-      <param
-       id="516"
-       group="1"
-       name="Displace_Loose_Lowerbody"
-       label="Pants Fit"
-       wearable="pants"
-       edit_group="driven"
-       clothing_morph="true"
-       value_min="0"
-       value_max="1"
-       value_default="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="625"
-       group="0"
-       name="Leg_Pantflair"
-       label="Cuff Flare"
-	   show_simple="true"
-       wearable="pants"
-       edit_group="pants"
-       edit_group_order="3"
-       clothing_morph="true"
-       label_min="Tight Cuffs"
-       label_max="Flared Cuffs"
-       value_min="0"
-       value_max="1.5"
-       camera_distance="1.8"
-       camera_angle="30"
-       camera_elevation="-.3">
-         <param_morph />
-      </param>
-
-      <param
-       id="793"
-       group="1"
-       name="Leg_Longcuffs"
-       label="Longcuffs"
-       wearable="pants"
-       edit_group="driven"
-       clothing_morph="true"
-       value_min="0"
-       value_max="3"
-       value_default="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="638"
-       group="0"
-       name="Low_Crotch"
-       label="Pants Crotch"
-       wearable="pants"
-       clothing_morph="true"
-       edit_group="pants"
-       edit_group_order="4"
-       label_min="High and Tight"
-       label_max="Low and Loose"
-       value_min="0"
-       value_max="1.3"
-       camera_distance="1.2"
-       camera_angle="-20"
-       camera_elevation="-.3">
-         <param_morph />
-      </param>
-
-      <param
-       id="635"
-       group="1"
-       name="Fat_Legs"
-       label="Fat Torso"
-       wearable="shape"
-       edit_group="shape_body"
-       label_min="skinny"
-       label_max="fat"
-       value_min="0"
-       value_max="1">
-         <param_morph>
-			<volume_morph
-				name="PELVIS"
-				scale="0.03 0.06 0.0"/>
-		 	<volume_morph
-				name="R_UPPER_LEG"
-				scale="0.02 0.02 0.0"
-				pos="0.0 -0.02 0.0"/>
-			<volume_morph
-				name="R_LOWER_LEG"
-				scale="0.01 0.01 0.0"/>
-		 	<volume_morph
-				name="L_UPPER_LEG"
-				scale="0.02 0.02 0.0"
-				pos="0.0 0.02 0.0"/>
-			<volume_morph
-				name="L_LOWER_LEG"
-				scale="0.01 0.01 0.0"/>
-		</param_morph>
-      </param>
-
-      <param
-       id="854"
-       group="1"
-       name="Saddlebags"
-       value_min="-.5"
-       value_max="3">
-        <param_morph>
-		 	<volume_morph
-				name="PELVIS"
-				scale="0.0 0.025 0.0"/>
-		</param_morph>
-
-      </param>
-
-      <param
-       id="879"
-       group="0"
-       sex="male"
-       name="Male_Package"
-       label="Package"
-       wearable="shape"
-       edit_group="shape_legs"
-       edit_group_order="4.6"
-       label_min="Coin Purse"
-       label_max="Duffle Bag"
-       value_default="0"
-       value_min="-.5"
-       value_max="2"
-       camera_angle="60"
-       camera_distance=".6">
-         <param_morph />
-      </param>
-
-<!--
-        #############
-        # other morphs (not user controlled)
-        #############
-        -->
-      <param
-       id="153"
-       group="1"
-       name="Male_Legs"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-<!--
-        #end morph targets
-        -->
-   </mesh>
-
-   <mesh
-    type="lowerBodyMesh"
-	lod="1"
-    file_name="avatar_lower_body_1.llm"
-    min_pixel_width="160"
-    reference="avatar_lower_body.llm">
-   </mesh>
-
-   <mesh
-    type="lowerBodyMesh"
-	lod="2"
-    file_name="avatar_lower_body_2.llm"
-    min_pixel_width="80"
-    reference="avatar_lower_body.llm">
-   </mesh>
-
-   <mesh
-    type="lowerBodyMesh"
-	lod="3"
-    file_name="avatar_lower_body_3.llm"
-    min_pixel_width="40"
-    reference="avatar_lower_body.llm">
-   </mesh>
-
-   <mesh
-    type="lowerBodyMesh"
-	lod="4"
-    file_name="avatar_lower_body_4.llm"
-	min_pixel_width="0"
-    reference="avatar_lower_body.llm">
-   </mesh>
-
-<!--
-    #lowerBodyMesh2 =
-    #lowerBodyMesh3 =
-    -->
-<!--
-    #eyeLidLeftMesh =
-    -->
-   <mesh
-    type="eyeBallLeftMesh"
-	lod="0"
-    file_name="avatar_eye.llm"
-    min_pixel_width="320">
-<!-- begin morph_params -->
-      <param
-       id="679"
-       group="1"
-       name="Eyeball_Size"
-       label="Eyeball Size"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="small eye"
-       label_max="big eye"
-       value_min="-.25"
-       value_max=".10">
-         <param_morph />
-      </param>
-
-      <param
-       id="687"
-       group="1"
-       name="Eyeball_Size"
-       label="Big Eyeball"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="small eye"
-       label_max="big eye"
-       value_min="-.25"
-       value_max=".25">
-         <param_morph />
-      </param>
-   </mesh>
-
-   <mesh
-    type="eyeBallLeftMesh"
-	lod="1"
-    file_name="avatar_eye_1.llm"
-    min_pixel_width="80">
-<!-- begin morph_params -->
-      <param
-       id="694"
-       group="1"
-       name="Eyeball_Size"
-       label="Eyeball Size"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="small eye"
-       label_max="big eye"
-       value_min="-.25"
-       value_max=".10">
-         <param_morph />
-      </param>
-
-      <param
-       id="695"
-       group="1"
-       name="Eyeball_Size"
-       label="Big Eyeball"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="small eye"
-       label_max="big eye"
-       value_min="-.25"
-       value_max=".25">
-         <param_morph />
-      </param>
-   </mesh>
-
-<!--
-    #eyeLidRightMesh =
-    -->
-   <mesh
-    type="eyeBallRightMesh"
-	lod="0"
-    file_name="avatar_eye.llm"
-    min_pixel_width="320">
-<!-- begin morph_params -->
-      <param
-       id="680"
-       group="1"
-       name="Eyeball_Size"
-       label="Eyeball Size"
-       wearable="shape"
-       label_min="small eye"
-       label_max="big eye"
-       value_min="-.25"
-       value_max=".10">
-         <param_morph />
-      </param>
-
-      <param
-       id="688"
-       group="1"
-       name="Eyeball_Size"
-       label="Big Eyeball"
-       wearable="shape"
-       label_min="small eye"
-       label_max="big eye"
-       value_min="-.25"
-       value_max=".25">
-         <param_morph />
-      </param>
-   </mesh>
-
-   <mesh
-    type="eyeBallRightMesh"
-	lod="1"
-    file_name="avatar_eye_1.llm"
-    min_pixel_width="80">
-<!-- begin morph_params -->
-      <param
-       id="681"
-       group="1"
-       name="Eyeball_Size"
-       label="Eyeball Size"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="small eye"
-       label_max="big eye"
-       value_min="-.25"
-       value_max=".10">
-         <param_morph />
-      </param>
-
-      <param
-       id="691"
-       group="1"
-       name="Eyeball_Size"
-       label="Big Eyeball"
-       wearable="shape"
-       edit_group="shape_eyes"
-       label_min="small eye"
-       label_max="big eye"
-       value_min="-.25"
-       value_max=".25">
-         <param_morph />
-      </param>
-   </mesh>
-
-   <mesh
-    type="skirtMesh"
-	lod="0"
-    file_name="avatar_skirt.llm"
-    min_pixel_width="320">
-      <param
-       id="845"
-       group="1"
-       name="skirt_poofy"
-       label="poofy skirt"
-       clothing_morph="true"
-       wearable="skirt"
-       edit_group="skirt"
-       label_min="less poofy"
-       label_max="more poofy"
-       value_min="0"
-       value_max="1.5">
-         <param_morph />
-      </param>
-
-      <param
-       id="846"
-       group="1"
-       name="skirt_loose"
-       label="loose skirt"
-       clothing_morph="true"
-       wearable="skirt"
-       edit_group="skirt"
-       label_min="form fitting"
-       label_max="loose"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="866"
-       group="1"
-       name="skirt_tight"
-       label="tight skirt"
-       clothing_morph="true"
-       wearable="skirt"
-       edit_group="skirt"
-       label_min="form fitting"
-       label_max="loose"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="867"
-       group="1"
-       name="skirt_smallbutt"
-       label="tight skirt"
-       clothing_morph="false"
-       wearable="skirt"
-       edit_group="skirt"
-       label_min="form fitting"
-       label_max="loose"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="848"
-       group="0"
-       name="skirt_bustle"
-       label="bustle skirt"
-       clothing_morph="true"
-       wearable="skirt"
-       edit_group_order="3"
-       edit_group="skirt"
-       label_min="no bustle"
-       label_max="more bustle"
-       value_min="0"
-       value_max="2"
-       value_default=".2"
-       camera_angle="100"
-       camera_distance="1.3"
-       camera_elevation="-.5">
-         <param_morph />
-      </param>
-
-      <param
-       id="847"
-       group="1"
-       name="skirt_bowlegs"
-       label="legs skirt"
-       wearable="skirt"
-       value_min="-1"
-       value_max="1"
-       value_default="0">
-	     <param_morph />
-	  </param>
-
-      <param
-       id="852"
-       group="1"
-       name="skirt_bigbutt"
-       label="bigbutt skirt"
-       label_min="less"
-       label_max="more"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="849"
-       group="1"
-       name="skirt_belly"
-       label="big belly skirt"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-
-      <param
-       id="850"
-       group="1"
-       name="skirt_saddlebags"
-       value_min="-.5"
-       value_max="3">
-         <param_morph />
-      </param>
-
-      <param
-       id="851"
-       group="1"
-       name="skirt_chubby"
-       label_min="less"
-       label_max="more"
-       value_min="0"
-       value_max="1"
-       value_default="0">
-         <param_morph />
-      </param>
-
-      <param
-       id="856"
-       group="1"
-       name="skirt_lovehandles"
-       label_min="less"
-       label_max="more"
-       value_min="-1"
-       value_max="2"
-       value_default="0">
-         <param_morph />
-      </param>
-
-<!--
-        #############
-        # other morphs (not user controlled)
-        #############
-        -->
-      <param
-       id="857"
-       group="1"
-       name="skirt_male"
-       value_min="0"
-       value_max="1">
-         <param_morph />
-      </param>
-   </mesh>
-
-   <mesh
-    type="skirtMesh"
-	lod="1"
-    file_name="avatar_skirt_1.llm"
-    min_pixel_width="160"
-    reference="avatar_skirt.llm">
-   </mesh>
-
-   <mesh
-    type="skirtMesh"
-	lod="2"
-    file_name="avatar_skirt_2.llm"
-    min_pixel_width="80"
-    reference="avatar_skirt.llm">
-   </mesh>
-
-   <mesh
-    type="skirtMesh"
-	lod="3"
-    file_name="avatar_skirt_3.llm"
-    min_pixel_width="40"
-    reference="avatar_skirt.llm">
-   </mesh>
-
-   <mesh
-    type="skirtMesh"
-	lod="4"
-    file_name="avatar_skirt_4.llm"
-	min_pixel_width="0"
-    reference="avatar_skirt.llm">
-   </mesh>
-
-<!-- =========================================================== -->
-   <global_color
-    name="skin_color">
-      <param
-       id="111"
-       group="0"
-       wearable="skin"
-       edit_group="skin_color"
-       edit_group_order="1"
-       name="Pigment"
-	   show_simple="true"
-       label_min="Light"
-       label_max="Dark"
-       value_min="0"
-       value_max="1"
-       value_default=".5">
-         <param_color>
-            <value
-             color="252, 215, 200, 255" />
-
-            <value
-             color="240, 177, 112, 255" />
-
-            <value
-             color="90, 40, 16, 255" />
-
-            <value
-             color="29, 9, 6, 255" />
-         </param_color>
-      </param>
-
-      <param
-       id="110"
-       group="0"
-       wearable="skin"
-       edit_group="skin_color"
-       edit_group_order="2"
-       name="Red Skin"
-       label="Ruddiness"
-       label_min="Pale"
-       label_max="Ruddy"
-       value_min="0"
-       value_max="0.1">
-         <param_color
-          operation="blend">
-            <value
-             color="218, 41, 37, 255" />
-         </param_color>
-      </param>
-
-      <param
-       id="108"
-       group="0"
-       wearable="skin"
-       edit_group="skin_color"
-       edit_group_order="3"
-       name="Rainbow Color"
-	   show_simple="true"
-       label_min="None"
-       label_max="Wild"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5">
-         <param_color>
-            <value
-             color=" 0, 0, 0, 255" />
-
-            <value
-             color="255, 0, 255, 255" />
-
-            <value
-             color="255, 0, 0, 255" />
-
-            <value
-             color="255, 255, 0, 255" />
-
-            <value
-             color=" 0, 255, 0, 255" />
-
-            <value
-             color=" 0, 255, 255, 255" />
-
-            <value
-             color=" 0, 0, 255, 255" />
-
-            <value
-             color="255, 0, 255, 255" />
-         </param_color>
-      </param>
-   </global_color>
-
-<!-- =========================================================== -->
-   <global_color
-    name="hair_color">
-      <param
-       id="114"
-       group="0"
-       wearable="hair"
-       edit_group="hair_color"
-       edit_group_order="3"
-       name="Blonde Hair"
-	   show_simple="true"
-       label_min="Black"
-       label_max="Blonde"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5">
-         <param_color>
-            <value
-             color="0, 0, 0, 255" />
-
-            <value
-             color="22, 6, 6, 255" />
-
-            <value
-             color="29, 9, 6, 255" />
-
-            <value
-             color="45, 21, 11, 255" />
-
-            <value
-             color="78, 39, 11, 255" />
-
-            <value
-             color="90, 53, 16, 255" />
-
-            <value
-             color="136, 92, 21, 255" />
-
-            <value
-             color="150, 106, 33, 255" />
-
-            <value
-             color="198, 156, 74, 255" />
-
-            <value
-             color="233, 192, 103, 255" />
-
-            <value
-             color="238, 205, 136, 255" />
-         </param_color>
-      </param>
-
-      <param
-       id="113"
-       group="0"
-       wearable="hair"
-       edit_group="hair_color"
-       edit_group_order="4"
-       name="Red Hair"
-	   show_simple="true"
-       label_min="No Red"
-       label_max="Very Red"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5">
-         <param_color>
-            <value
-             color="0, 0, 0, 255" />
-
-            <value
-             color="118, 47, 19, 255" />
-         </param_color>
-      </param>
-
-      <param
-       id="115"
-       group="0"
-       wearable="hair"
-       edit_group="hair_color"
-       edit_group_order="1"
-       name="White Hair"
-	   show_simple="true"
-       label_min="No White"
-       label_max="All White"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5">
-         <param_color>
-            <value
-             color="0, 0, 0, 255" />
-
-            <value
-             color="255, 255, 255, 255" />
-         </param_color>
-      </param>
-
-      <param
-       id="112"
-       group="0"
-       wearable="hair"
-       edit_group="hair_color"
-       edit_group_order="2"
-       name="Rainbow Color"
-	   show_simple="true"
-       label_min="None"
-       label_max="Wild"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".5">
-         <param_color>
-            <value
-             color=" 0, 0, 0, 255" />
-
-            <value
-             color="255, 0, 255, 255" />
-
-            <value
-             color="255, 0, 0, 255" />
-
-            <value
-             color="255, 255, 0, 255" />
-
-            <value
-             color=" 0, 255, 0, 255" />
-
-            <value
-             color=" 0, 255, 255, 255" />
-
-            <value
-             color=" 0, 0, 255, 255" />
-
-            <value
-             color="255, 0, 255, 255" />
-         </param_color>
-      </param>
-   </global_color>
-
-<!-- =========================================================== -->
-   <global_color
-    name="eye_color">
-      <param
-       id="99"
-       group="0"
-       wearable="eyes"
-       edit_group="eyes"
-       edit_group_order="1"
-       name="Eye Color"
-	   show_simple="true"
-       label_min="Natural"
-       label_max="Unnatural"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".3">
-<!-- default to natural brown eyes-->
-         <param_color>
-            <value
-             color="50, 25, 5, 255" />
-
-<!-- natural dark brown eyes-->
-            <value
-             color="109, 55, 15, 255" />
-
-<!-- natural brown eyes-->
-            <value
-             color="150, 93, 49, 255" />
-
-<!-- natural light brown eyes-->
-            <value
-             color="152, 118, 25, 255" />
-
-<!--natural hazel eyes-->
-            <value
-             color="95, 179, 107, 255" />
-
-<!--natural green eyes-->
-            <value
-             color="87, 192, 191, 255" />
-
-<!--natural aqua eyes-->
-            <value
-             color="95, 172, 179, 255" />
-
-<!--natural blue eyes-->
-            <value
-             color="128, 128, 128, 255" />
-
-<!--natural grey eyes-->
-            <value
-             color="0, 0, 0, 255" />
-
-<!--black eyes-->
-            <value
-             color="255, 255, 0, 255" />
-
-<!--bright yellow eyes-->
-            <value
-             color=" 0, 255, 0, 255" />
-
-<!-- bright green eyes-->
-            <value
-             color=" 0, 255, 255, 255" />
-
-<!-- bright cyan eyes-->
-            <value
-             color=" 0, 0, 255, 255" />
-
-<!--bright blue eyes-->
-            <value
-             color="255, 0, 255, 255" />
-
-<!-- bright violet eyes-->
-            <value
-             color="255, 0, 0, 255" />
-
-<!--bright red eyes-->
-         </param_color>
-      </param>
-
-      <param
-       id="98"
-       group="0"
-       wearable="eyes"
-       edit_group="eyes"
-       edit_group_order="2"
-       name="Eye Lightness"
-	   show_simple="true"
-       label_min="Darker"
-       label_max="Lighter"
-       value_min="0"
-       value_max="1"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_color>
-            <value
-             color="0, 0, 0, 0" />
-
-            <value
-             color="255, 255, 255, 255" />
-         </param_color>
-      </param>
-   </global_color>
-
-<!-- =========================================================== -->
-   <layer_set
-    body_region="head"
-    width="512"
-    height="512"
-	clear_alpha="false"
-    alpha_tga_file="head_alpha.tga">
-		<layer
-		   name="head bump base"
-		   fixed_color = "128,128,128,255"
-		   render_pass="bump">
-		</layer>
-
-      <layer
-       name="head bump definition"
-       render_pass="bump">
-
-		 <texture
-          tga_file="bump_head_base.tga"
-		  file_is_mask="FALSE"/>
-
-         <param
-          id="873"
-          group="1"
-          wearable="skin"
-          edit_group="driven"
-          edit_group_order="12"
-          name="Bump base"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             domain="0" />
-         </param>
-      </layer>
-
-      <layer
-       name="base"
-       global_color="skin_color">
-         <texture
-          tga_file="head_skingrain.tga" />
-      </layer>
-
-      <layer
-       name="headcolor">
-         <texture
-          tga_file="head_color.tga" />
-      </layer>
-
-      <layer
-       name="shadow">
-         <texture
-          tga_file="head_shading_alpha.tga"
-          file_is_mask="TRUE" />
-
-         <param
-          id="158"
-          group="1"
-          wearable="skin"
-          name="Shading"
-          value_min="0"
-          value_max="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 0" />
-
-               <value
-                color="0, 0, 0, 128" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="highlight">
-         <texture
-          tga_file="head_highlights_alpha.tga"
-          file_is_mask="TRUE" />
-
-         <param
-          id="159"
-          group="1"
-          name="Shading"
-          wearable="skin"
-          value_min="0"
-          value_max="1">
-            <param_color>
-               <value
-                color="255, 255, 255, 0" />
-
-               <value
-                color="255, 255, 255, 64" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="rosyface">
-         <texture
-          tga_file="rosyface_alpha.tga"
-          file_is_mask="true" />
-
-         <param
-          id="116"
-          group="0"
-          wearable="skin"
-          edit_group="skin_facedetail"
-          edit_group_order="4"
-          name="Rosy Complexion"
-          label_min="Less Rosy"
-          label_max="More Rosy"
-          value_min="0"
-          value_max="1"
-          camera_distance=".3"
-          camera_elevation=".07">
-            <param_color>
-               <value
-                color="198, 71, 71, 0" />
-
-               <value
-                color="198, 71, 71, 255" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="lips">
-         <texture
-          tga_file="lips_mask.tga"
-          file_is_mask="true" />
-
-         <param
-          id="117"
-          group="0"
-          wearable="skin"
-          edit_group="skin_facedetail"
-          edit_group_order="5"
-          name="Lip Pinkness"
-          label_min="Darker"
-          label_max="Pinker"
-          value_min="0"
-          value_max="1"
-          camera_distance=".25">
-            <param_color>
-               <value
-                color="220, 115, 115, 0" />
-
-               <value
-                color="220, 115, 115, 128" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="wrinkles_shading"
-       render_pass="bump"
-       fixed_color="0,0,0,100">
-         <param
-          id="118"
-          group="1"
-          wearable="skin"
-          name="Wrinkles"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="bump_face_wrinkles.tga"
-             skip_if_zero="true"
-             domain="0.3" />
-         </param>
-      </layer>
-
-<!--<layer
-       name="wrinkles_highlights"
-       fixed_color="255,255,255,64">
-         <param
-          id="128"
-          group="1"
-          name="Wrinkles"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="head_wrinkles_highlights_alpha.tga"
-             skip_if_zero="true"
-             domain="0.3" />
-         </param>
-      </layer>-->
-      <layer
-       name="freckles"
-       fixed_color="120,47,20,128">
-         <param
-          id="165"
-          group="0"
-          wearable="skin"
-          edit_group="skin_facedetail"
-          edit_group_order="2"
-          name="Freckles"
-          label_min="Less"
-          label_max="More"
-          value_min="0"
-          value_max="1"
-          camera_distance=".3"
-          camera_elevation=".07">
-            <param_alpha
-             tga_file="freckles_alpha.tga"
-             skip_if_zero="true"
-             domain="0.5" />
-         </param>
-      </layer>
-
-      <layer
-       name="eyebrowsbump"
-       render_pass="bump">
-         <texture
-          tga_file="head_hair.tga"
-          file_is_mask="false" />
-
-         <param
-          id="1000"
-          group="1"
-          wearable="hair"
-          edit_group="driven"
-          name="Eyebrow Size Bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="eyebrows_alpha.tga"
-             domain="0.1" />
-         </param>
-
-         <param
-          id="1002"
-          group="1"
-          wearable="hair"
-          edit_group="driven"
-          name="Eyebrow Density Bump"
-          value_min="0"
-          value_max="1">
-            <param_color>
-               <value
-                color="255,255,255,0" />
-
-               <value
-                color="255,255,255,255" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="eyebrows"
-       global_color="hair_color">
-         <texture
-          tga_file="head_hair.tga"
-          file_is_mask="false" />
-
-         <param
-          id="1001"
-          group="1"
-          wearable="hair"
-          edit_group="hair_eyebrows"
-          name="Eyebrow Size"
-		  show_simple="true"
-          value_min="0"
-          value_max="1"
-          value_default="0.5">
-            <param_alpha
-             tga_file="eyebrows_alpha.tga"
-             domain="0.1" />
-         </param>
-
-         <param
-          id="1003"
-          group="1"
-          edit_group="driven"
-          name="Eyebrow Density"
-          value_min="0"
-          value_max="1">
-            <param_color
-             operation="multiply">
-               <value
-                color="255,255,255,0" />
-
-               <value
-                color="255,255,255,255" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="lipstick">
-         <param
-          id="700"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="2"
-          name="Lipstick Color"
-          label_min="Pink"
-          label_max="Black"
-          value_min="0"
-          value_max="1"
-          value_default=".25"
-          camera_distance=".25">
-            <param_color>
-               <value
-                color="245,161,177,200" />
-
-               <value
-                color="216,37,67,200" />
-
-               <value
-                color="178,48,76,200" />
-
-               <value
-                color="68,0,11,200" />
-
-               <value
-                color="252,207,184,200" />
-
-               <value
-                color="241,136,106,200" />
-
-               <value
-                color="208,110,85,200" />
-
-               <value
-                color="106,28,18,200" />
-
-               <value
-                color="58,26,49,200" />
-
-               <value
-                color="14,14,14,200" />
-            </param_color>
-         </param>
-
-         <param
-          id="701"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="1"
-          name="Lipstick"
-          label_min="No Lipstick"
-          label_max="More Lipstick"
-          value_min="0"
-          value_max=".9"
-          value_default="0.0"
-          camera_distance=".25">
-            <param_alpha
-             tga_file="lipstick_alpha.tga"
-             skip_if_zero="true"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="lipgloss"
-       fixed_color="255,255,255,190">
-         <param
-          id="702"
-          name="Lipgloss"
-          label_min="No Lipgloss"
-          label_max="Glossy"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="3"
-          group="0"
-          value_min="0"
-          value_max="1"
-          camera_distance=".25">
-            <param_alpha
-             tga_file="lipgloss_alpha.tga"
-             skip_if_zero="true"
-             domain="0.2" />
-         </param>
-      </layer>
-
-      <layer
-       name="blush">
-         <param
-          id="704"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="4"
-          name="Blush"
-          label_min="No Blush"
-          label_max="More Blush"
-          value_min="0"
-          value_max=".9"
-          value_default="0"
-          camera_distance=".3"
-          camera_elevation=".07"
-          camera_angle="20">
-            <param_alpha
-             tga_file="blush_alpha.tga"
-             skip_if_zero="true"
-             domain="0.3" />
-         </param>
-
-         <param
-          id="705"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="5"
-          name="Blush Color"
-          label_min="Pink"
-          label_max="Orange"
-          value_min="0"
-          value_max="1"
-          value_default=".5"
-          camera_distance=".3"
-          camera_elevation=".07"
-          camera_angle="20">
-            <param_color>
-               <value
-                color="253,162,193,200" />
-
-               <value
-                color="247,131,152,200" />
-
-               <value
-                color="213,122,140,200" />
-
-               <value
-                color="253,152,144,200" />
-
-               <value
-                color="236,138,103,200" />
-
-               <value
-                color="195,128,122,200" />
-
-               <value
-                color="148,103,100,200" />
-
-               <value
-                color="168,95,62,200" />
-            </param_color>
-         </param>
-
-         <param
-          id="711"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="6"
-          name="Blush Opacity"
-          label_min="Clear"
-          label_max="Opaque"
-          value_min="0"
-          value_max="1"
-          value_default=".5"
-          camera_distance=".3"
-          camera_elevation=".07"
-          camera_angle="20">
-            <param_color
-             operation="multiply">
-               <value
-                color="255,255,255,0" />
-
-               <value
-                color="255,255,255,255" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="Outer Eye Shadow">
-         <param
-          id="708"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="11"
-          name="Out Shdw Color"
-          label_min="Light"
-          label_max="Dark"
-          value_min="0"
-          value_max="1"
-          camera_distance=".3"
-          camera_elevation=".14">
-            <param_color>
-               <value
-                color="252,247,246,255" />
-
-               <value
-                color="255,206,206,255" />
-
-               <value
-                color="233,135,149,255" />
-
-               <value
-                color="220,168,192,255" />
-
-               <value
-                color="228,203,232,255" />
-
-               <value
-                color="255,234,195,255" />
-
-               <value
-                color="230,157,101,255" />
-
-               <value
-                color="255,147,86,255" />
-
-               <value
-                color="228,110,89,255" />
-
-               <value
-                color="228,150,120,255" />
-
-               <value
-                color="223,227,213,255" />
-
-               <value
-                color="96,116,87,255" />
-
-               <value
-                color="88,143,107,255" />
-
-               <value
-                color="194,231,223,255" />
-
-               <value
-                color="207,227,234,255" />
-
-               <value
-                color="41,171,212,255" />
-
-               <value
-                color="180,137,130,255" />
-
-               <value
-                color="173,125,105,255" />
-
-               <value
-                color="144,95,98,255" />
-
-               <value
-                color="115,70,77,255" />
-
-               <value
-                color="155,78,47,255" />
-
-               <value
-                color="239,239,239,255" />
-
-               <value
-                color="194,194,194,255" />
-
-               <value
-                color="120,120,120,255" />
-
-               <value
-                color="10,10,10,255" />
-            </param_color>
-         </param>
-
-         <param
-          id="706"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="12"
-          name="Out Shdw Opacity"
-          label_min="Clear"
-          label_max="Opaque"
-          value_min=".2"
-          value_max="1"
-          value_default=".6"
-          camera_distance=".3"
-          camera_elevation=".14">
-            <param_color
-             operation="multiply">
-               <value
-                color="255,255,255,0" />
-
-               <value
-                color="255,255,255,255" />
-            </param_color>
-         </param>
-
-         <param
-          id="707"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="10"
-          name="Outer Shadow"
-          label_min="No Eyeshadow"
-          label_max="More Eyeshadow"
-          value_min="0"
-          value_max=".7"
-          camera_distance=".3"
-          camera_elevation=".14">
-            <param_alpha
-             tga_file="eyeshadow_outer_alpha.tga"
-             skip_if_zero="true"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="Inner Eye Shadow">
-         <param
-          id="712"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="8"
-          name="In Shdw Color"
-          label_min="Light"
-          label_max="Dark"
-          value_min="0"
-          value_max="1"
-          camera_distance=".3"
-          camera_elevation=".14">
-            <param_color>
-               <value
-                color="252,247,246,255" />
-
-               <value
-                color="255,206,206,255" />
-
-               <value
-                color="233,135,149,255" />
-
-               <value
-                color="220,168,192,255" />
-
-               <value
-                color="228,203,232,255" />
-
-               <value
-                color="255,234,195,255" />
-
-               <value
-                color="230,157,101,255" />
-
-               <value
-                color="255,147,86,255" />
-
-               <value
-                color="228,110,89,255" />
-
-               <value
-                color="228,150,120,255" />
-
-               <value
-                color="223,227,213,255" />
-
-               <value
-                color="96,116,87,255" />
-
-               <value
-                color="88,143,107,255" />
-
-               <value
-                color="194,231,223,255" />
-
-               <value
-                color="207,227,234,255" />
-
-               <value
-                color="41,171,212,255" />
-
-               <value
-                color="180,137,130,255" />
-
-               <value
-                color="173,125,105,255" />
-
-               <value
-                color="144,95,98,255" />
-
-               <value
-                color="115,70,77,255" />
-
-               <value
-                color="155,78,47,255" />
-
-               <value
-                color="239,239,239,255" />
-
-               <value
-                color="194,194,194,255" />
-
-               <value
-                color="120,120,120,255" />
-
-               <value
-                color="10,10,10,255" />
-            </param_color>
-         </param>
-
-         <param
-          id="713"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="9"
-          name="In Shdw Opacity"
-          label_min="Clear"
-          label_max="Opaque"
-          value_min=".2"
-          value_max="1"
-          value_default=".7"
-          camera_distance=".3"
-          camera_elevation=".14">
-            <param_color
-             operation="multiply">
-               <value
-                color="255,255,255,0" />
-
-               <value
-                color="255,255,255,255" />
-            </param_color>
-         </param>
-
-         <param
-          id="709"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="7"
-          name="Inner Shadow"
-          label_min="No Eyeshadow"
-          label_max="More Eyeshadow"
-          value_min="0"
-          value_max="1"
-          value_default="0"
-          camera_distance=".3"
-          camera_elevation=".14">
-            <param_alpha
-             tga_file="eyeshadow_inner_alpha.tga"
-             skip_if_zero="true"
-             domain="0.2" />
-         </param>
-      </layer>
-
-      <layer
-       name="eyeliner"
-       fixed_color="0,0,0,200">
-         <param
-          id="703"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="13"
-          name="Eyeliner"
-          label_min="No Eyeliner"
-          label_max="Full Eyeliner"
-          value_min="0"
-          value_max="1"
-          value_default="0.0"
-          camera_distance=".3"
-          camera_elevation=".14">
-            <param_alpha
-             tga_file="eyeliner_alpha.tga"
-             skip_if_zero="true"
-             domain="0.1" />
-         </param>
-
-         <param
-          id="714"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="14"
-          name="Eyeliner Color"
-          label_min="Dark Green"
-          label_max="Black"
-          value_min="0"
-          value_max="1"
-          camera_distance=".3"
-          camera_elevation=".14">
-            <param_color>
-               <value
-                color="24,98,40,250" />
-
-<!-- dark green -->
-               <value
-                color="9,100,127,250" />
-
-<!-- lt.aqua  blue -->
-               <value
-                color="61,93,134,250" />
-
-<!-- aqua  -->
-               <value
-                color="70,29,27,250" />
-
-<!--    dark brown -->
-               <value
-                color="115,75,65,250" />
-
-<!-- lt. brown  blue -->
-               <value
-                color="100,100,100,250" />
-
-<!-- grey -->
-               <value
-                color="91,80,74,250" />
-
-<!-- grey/brown  -->
-               <value
-                color="112,42,76,250" />
-
-<!-- plum -->
-               <value
-                color="14,14,14,250" />
-
-<!-- black -->
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="facialhair bump"
-       render_pass="bump">
-         <texture
-          tga_file="head_hair.tga"
-          file_is_mask="false" />
-
-         <param
-          id="1004"
-          sex="male"
-          group="1"
-          wearable="hair"
-          edit_group="driven"
-          name="Sideburns bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="facehair_sideburns_alpha.tga"
-             skip_if_zero="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1006"
-          sex="male"
-          group="1"
-          wearable="hair"
-          edit_group="driven"
-          name="Moustache bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="facehair_moustache_alpha.tga"
-             skip_if_zero="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1008"
-          sex="male"
-          group="1"
-          wearable="hair"
-          edit_group="driven"
-          name="Soulpatch bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="facehair_soulpatch_alpha.tga"
-             skip_if_zero="true"
-             domain="0.1" />
-         </param>
-
-         <param
-          id="1010"
-          sex="male"
-          group="1"
-          edit_group="driven"
-          wearable="hair"
-          name="Chin Curtains bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="facehair_chincurtains_alpha.tga"
-             skip_if_zero="true"
-             domain="0.03" />
-         </param>
-
-         <param
-          id="1012"
-          group="1"
-          sex="male"
-          wearable="hair"
-          edit_group="driven"
-          name="5 O'Clock Shadow bump"
-          value_min="0"
-          value_max="1">
-            <param_color>
-               <value
-                color="255,255,255,255" />
-
-               <value
-                color="255,255,255,0" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="facialhair"
-       global_color="hair_color">
-         <morph_mask
-          morph_name="Displace_Hair_Facial" />
-
-         <texture
-          tga_file="head_hair.tga"
-          file_is_mask="false" />
-
-         <param
-          id="1005"
-          sex="male"
-          group="1"
-          edit_group="driven"
-          name="Sideburns"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="facehair_sideburns_alpha.tga"
-             skip_if_zero="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1007"
-          sex="male"
-          group="1"
-          edit_group="driven"
-          name="Moustache"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="facehair_moustache_alpha.tga"
-             skip_if_zero="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1009"
-          sex="male"
-          group="1"
-          edit_group="driven"
-          name="Soulpatch"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="facehair_soulpatch_alpha.tga"
-             skip_if_zero="true"
-             domain="0.1" />
-         </param>
-
-         <param
-          id="1011"
-          sex="male"
-          group="1"
-          edit_group="driven"
-          name="Chin Curtains"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="facehair_chincurtains_alpha.tga"
-             skip_if_zero="true"
-             domain="0.03" />
-         </param>
-
-         <param
-          id="751"
-          group="1"
-          wearable="hair"
-          sex="male"
-          edit_group="hair_facial"
-          name="5 O'Clock Shadow"
-          label_min="Dense hair"
-          label_max="Shadow hair"
-          value_min="0"
-          value_max="1"
-          value_default="0.7"
-          camera_elevation=".1"
-          camera_distance=".3">
-            <param_color
-             operation="multiply">
-               <value
-                color="255,255,255,255" />
-
-               <value
-                color="255,255,255,30" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="head_bodypaint">
-         <texture
-          local_texture="head_bodypaint" />
-      </layer>
-   </layer_set>
-
-<!-- =========================================================== -->
-   <layer_set
-    body_region="upper_body"
-    width="512"
-    height="512">
-      <layer
-       name="base_upperbody bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-      </layer>
-      <layer
-       name="upperbody bump definition"
-       render_pass="bump">
-   		 <texture
-          tga_file="bump_upperbody_base.tga"
-		  file_is_mask="FALSE"/>
-
-         <param
-          id="874"
-          group="1"
-          wearable="skin"
-          edit_group="driven"
-          edit_group_order="20"
-          name="Bump upperdef"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             domain="0" />
-         </param>
-      </layer>
-
-      <layer
-       name="base"
-       global_color="skin_color">
-         <texture
-          tga_file="body_skingrain.tga" />
-      </layer>
-
-      <layer
-       name="nipples">
-         <texture
-          tga_file="upperbody_color.tga" />
-      </layer>
-
-      <layer
-       name="shadow">
-         <texture
-          tga_file="upperbody_shading_alpha.tga"
-          file_is_mask="TRUE" />
-
-         <param
-          id="125"
-          group="1"
-          name="Shading"
-          wearable="skin"
-          value_min="0"
-          value_max="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 0" />
-
-               <value
-                color="0, 0, 0, 128" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="highlight">
-         <texture
-          tga_file="upperbody_highlights_alpha.tga"
-          file_is_mask="TRUE" />
-
-         <param
-          id="126"
-          group="1"
-          wearable="skin"
-          name="Shading"
-          value_min="0"
-          value_max="1">
-            <param_color>
-               <value
-                color="255, 255, 255, 0" />
-
-               <value
-                color="255, 255, 255, 64" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="freckles upper"
-       fixed_color="120,47,20,128">
-         <param
-          id="776"
-          group="1"
-          name="freckles upper"
-          wearable="skin"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="bodyfreckles_alpha.tga"
-             skip_if_zero="true"
-             domain="0.6" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_bodypaint">
-         <texture
-          local_texture="upper_bodypaint" />
-      </layer>
-
-      <layer
-       name="upper_undershirt bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="upper_undershirt"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1043"
-          group="1"
-          wearable="undershirt"
-          edit_group="driven"
-          name="Sleeve Length bump"
-          value_min=".01"
-          value_max="1"
-          value_default=".4">
-            <param_alpha
-             tga_file="shirt_sleeve_alpha.tga"
-             multiply_blend="false"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1045"
-          group="1"
-          wearable="undershirt"
-          edit_group="undershirt"
-          edit_group_order="2"
-          name="Bottom bump"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="shirt_bottom_alpha.tga"
-             multiply_blend="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1047"
-          group="1"
-          wearable="undershirt"
-          edit_group="driven"
-          name="Collar Front bump"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="shirt_collar_alpha.tga"
-             multiply_blend="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1049"
-          group="1"
-          wearable="undershirt"
-          edit_group="driven"
-          name="Collar Back bump"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="shirt_collar_back_alpha.tga"
-             multiply_blend="true"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_undershirt">
-         <texture
-          local_texture="upper_undershirt" />
-
-         <param
-          id="821"
-          group="0"
-          wearable="undershirt"
-          edit_group="colorpicker"
-          name="undershirt_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="822"
-          group="0"
-          wearable="undershirt"
-          edit_group="colorpicker"
-          name="undershirt_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="823"
-          group="0"
-          wearable="undershirt"
-          edit_group="colorpicker"
-          name="undershirt_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1042"
-          group="1"
-          wearable="undershirt"
-          edit_group="driven"
-          name="Sleeve Length"
-          value_min=".01"
-          value_max="1"
-          value_default=".4">
-            <param_alpha
-             tga_file="shirt_sleeve_alpha.tga"
-             multiply_blend="false"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1044"
-          group="1"
-          wearable="undershirt"
-          edit_group="driven"
-          name="Bottom"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="shirt_bottom_alpha.tga"
-             multiply_blend="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1046"
-          group="1"
-          wearable="undershirt"
-          edit_group="driven"
-          name="Collar Front"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="shirt_collar_alpha.tga"
-             multiply_blend="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1048"
-          group="1"
-          wearable="undershirt"
-          edit_group="driven"
-          name="Collar Back"
-          label_min="Low"
-          label_max="High"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="shirt_collar_back_alpha.tga"
-             multiply_blend="true"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="Nail Polish">
-         <param
-          id="710"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="15"
-          name="Nail Polish"
-          label_min="No Polish"
-          label_max="Painted Nails"
-          value_min="0"
-          value_max="1"
-          value_default="0.0"
-          camera_distance="1.6"
-          camera_elevation="-.4"
-          camera_angle="70">
-            <param_alpha
-             tga_file="nailpolish_alpha.tga"
-             skip_if_zero="true"
-             domain="0.1" />
-         </param>
-
-         <param
-          id="715"
-          group="0"
-          wearable="skin"
-          edit_group="skin_makeup"
-          edit_group_order="16"
-          name="Nail Polish Color"
-          label_min="Pink"
-          label_max="Black"
-          value_min="0"
-          value_max="1"
-          camera_distance="1.6"
-          camera_elevation="-.4"
-          camera_angle="70">
-            <param_color>
-               <value
-                color="255,187,200,255" />
-
-               <value
-                color="194,102,127,255" />
-
-               <value
-                color="227,34,99,255" />
-
-               <value
-                color="168,41,60,255" />
-
-               <value
-                color="97,28,59,255" />
-
-               <value
-                color="234,115,93,255" />
-
-               <value
-                color="142,58,47,255" />
-
-               <value
-                color="114,30,46,255" />
-
-               <value
-                color="14,14,14,255" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="upper_gloves bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="upper_gloves"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1059"
-          group="1"
-          wearable="gloves"
-          edit_group="driven"
-          name="Glove Length bump"
-          value_min=".01"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="glove_length_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1061"
-          group="1"
-          wearable="gloves"
-          edit_group="driven"
-          name="Glove Fingers bump"
-          value_min=".01"
-          value_max="1"
-          value_default="1">
-            <param_alpha
-             tga_file="gloves_fingers_alpha.tga"
-             multiply_blend="true"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_gloves">
-         <texture
-          local_texture="upper_gloves" />
-
-         <param
-          id="827"
-          group="0"
-          wearable="gloves"
-          edit_group="colorpicker"
-          name="gloves_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="829"
-          group="0"
-          wearable="gloves"
-          edit_group="colorpicker"
-          name="gloves_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="830"
-          group="0"
-          wearable="gloves"
-          edit_group="colorpicker"
-          name="gloves_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1058"
-          group="1"
-          wearable="gloves"
-          edit_group="driven"
-          name="Glove Length"
-          value_min=".01"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="glove_length_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1060"
-          group="1"
-          wearable="gloves"
-          edit_group="driven"
-          name="Glove Fingers"
-          value_min=".01"
-          value_max="1"
-          value_default="1">
-            <param_alpha
-             tga_file="gloves_fingers_alpha.tga"
-             multiply_blend="true"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_clothes_shadow">
-         <texture
-          local_texture="upper_shirt" />
-
-         <param
-          id="899"
-          group="1"
-          edit_group="driven"
-          wearable="shirt"
-          name="Upper Clothes Shading"
-          value_min="0"
-          value_max="1"
-          value_default="0">
-            <param_color>
-               <value
-                color="0, 0, 0, 0" />
-
-               <value
-                color="0, 0, 0, 80" />
-            </param_color>
-         </param>
-
-         <param
-          id="900"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Sleeve Length Shadow"
-          value_min="0.02"
-          value_max=".87"
-          value_default="0.02">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="shirt_sleeve_alpha.tga"
-             skip_if_zero="true"
-             domain="0.03" />
-         </param>
-
-         <param
-          id="901"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Shirt Shadow Bottom"
-          value_min="0.02"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_bottom_alpha.tga"
-             skip_if_zero="true"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="902"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Collar Front Shadow Height"
-          value_min="0.02"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_alpha.tga"
-             skip_if_zero="true"
-             domain="0.02" />
-         </param>
-
-         <param
-          id="903"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Collar Back Shadow Height"
-          value_min="0.02"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_back_alpha.tga"
-             skip_if_zero="true"
-             domain="0.02" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_shirt base bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="upper_shirt"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1029"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Sleeve Length Cloth"
-          value_min="0"
-          value_max="0.85">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="shirt_sleeve_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1030"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Shirt Bottom Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_bottom_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1031"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Collar Front Height Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1032"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Collar Back Height Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_back_alpha.tga"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_clothes bump"
-       render_pass="bump">
-         <texture
-          tga_file="bump_shirt_wrinkles.tga" />
-
-         <texture
-          local_texture="upper_shirt"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="868"
-          group="0"
-          wearable="shirt"
-          edit_group="shirt"
-          edit_group_order="8"
-          name="Shirt Wrinkles"
-          value_min="0"
-          value_max="1"
-          value_default="0">
-            <param_color>
-               <value
-                color="255, 255, 255, 0" />
-
-               <value
-                color="255, 255, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1013"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Sleeve Length Cloth"
-          value_min="0"
-          value_max="0.85">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="shirt_sleeve_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1014"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Shirt Bottom Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_bottom_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1015"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Collar Front Height Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1016"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Collar Back Height Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_back_alpha.tga"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_clothes">
-         <texture
-          local_texture="upper_shirt" />
-
-         <morph_mask
-          morph_name="Displace_Loose_Upperbody" />
-
-         <morph_mask
-          morph_name="Shirtsleeve_flair" />
-
-         <param
-          id="803"
-          group="0"
-          wearable="shirt"
-          edit_group="colorpicker"
-          name="shirt_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="804"
-          group="0"
-          wearable="shirt"
-          edit_group="colorpicker"
-          name="shirt_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="805"
-          group="0"
-          wearable="shirt"
-          edit_group="colorpicker"
-          name="shirt_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="600"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Sleeve Length Cloth"
-          value_min="0"
-          value_max="0.85"
-          value_default=".7">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="shirt_sleeve_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="601"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Shirt Bottom Cloth"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_bottom_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="602"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Collar Front Height Cloth"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="778"
-          group="1"
-          wearable="shirt"
-          edit_group="driven"
-          name="Collar Back Height Cloth"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_back_alpha.tga"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_jacket base bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="upper_jacket"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1039"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          edit_group_order="1"
-          name="Jacket Sleeve Length bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="shirt_sleeve_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1040"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="Jacket Collar Front bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1041"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          edit_group_order="3.5"
-          name="Jacket Collar Back bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_back_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1037"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="jacket bottom length upper bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_length_upper_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1038"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="jacket open upper bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_open_upper_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_jacket bump"
-       render_pass="bump">
-         <texture
-          tga_file="bump_shirt_wrinkles.tga" />
-
-         <texture
-          local_texture="upper_jacket"
-          local_texture_alpha_only="true" />
-
-          <param
-          id="875"
-          group="1"
-          wearable="jacket"
-          name="jacket upper Wrinkles"
-          value_min="0"
-          value_max="1"
-          value_default="0">
-            <param_color>
-               <value
-                color="255, 255, 255, 0" />
-
-               <value
-                color="255, 255, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1019"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          edit_group_order="1"
-          name="Jacket Sleeve Length bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="shirt_sleeve_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1021"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="Jacket Collar Front bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1023"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          edit_group_order="3.5"
-          name="Jacket Collar Back bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_back_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1025"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="jacket bottom length upper bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_length_upper_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1026"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="jacket open upper bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_open_upper_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="upper_jacket">
-         <texture
-          local_texture="upper_jacket" />
-
-         <param
-          id="831"
-          group="1"
-          edit_group="colorpicker_driven"
-          wearable="jacket"
-          name="upper_jacket_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="832"
-          group="1"
-          edit_group="colorpicker_driven"
-          wearable="jacket"
-          name="upper_jacket_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="833"
-          group="1"
-          edit_group="colorpicker_driven"
-          wearable="jacket"
-          name="upper_jacket_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1020"
-          group="1"
-          edit_group="driven"
-          name="jacket Sleeve Length"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="shirt_sleeve_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1022"
-          group="1"
-          edit_group="driven"
-          name="jacket Collar Front"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1024"
-          group="1"
-          edit_group="driven"
-          edit_group_order="3.5"
-          name="jacket Collar Back"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="shirt_collar_back_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="620"
-          group="1"
-          wearable="jacket"
-          edit_group="jacket"
-          name="bottom length upper"
-          label_min="hi cut"
-          label_max="low cut"
-          value_min="0"
-          value_max="1"
-          value_default=".8"
-          camera_distance="1.2"
-          camera_angle="30"
-          camera_elevation=".2">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_length_upper_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="622"
-          group="1"
-          wearable="jacket"
-          edit_group="jacket"
-          name="open upper"
-          label_min="closed"
-          label_max="open"
-          value_min="0"
-          value_max="1"
-          value_default=".8"
-          camera_distance="1.2"
-          camera_angle="30"
-          camera_elevation=".2">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_open_upper_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-   </layer_set>
-
-<!-- =========================================================== -->
-   <layer_set
-    body_region="lower_body"
-    width="512"
-    height="512">
-		<layer
-		   name="lower body bump base"
-		   fixed_color = "128,128,128,255"
-		   render_pass="bump">
-		</layer>
-      <layer
-       name="base_lowerbody bump"
-       render_pass="bump">
-         <texture
-          tga_file="bump_lowerbody_base.tga"
-		  file_is_mask="FALSE" />
-
-         <param
-          id="878"
-          group="1"
-          wearable="skin"
-          edit_group="driven"
-          edit_group_order="20"
-          name="Bump upperdef"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             domain="0" />
-         </param>
-      </layer>
-
-      <layer
-       name="base"
-       global_color="skin_color">
-         <texture
-          tga_file="body_skingrain.tga" />
-      </layer>
-
-      <layer
-       name="toenails">
-         <texture
-          tga_file="lowerbody_color.tga" />
-      </layer>
-
-      <layer
-       name="lower_bodypaint">
-         <texture
-          local_texture="lower_bodypaint" />
-      </layer>
-
-      <layer
-       name="shadow">
-         <texture
-          tga_file="lowerbody_shading_alpha.tga"
-          file_is_mask="TRUE" />
-
-         <param
-          id="160"
-          group="1"
-          name="Shading"
-          wearable="pants"
-          value_min="0"
-          value_max="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 0" />
-
-               <value
-                color="0, 0, 0, 128" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="highlight">
-         <texture
-          tga_file="lowerbody_highlights_alpha.tga"
-          file_is_mask="TRUE" />
-
-         <param
-          id="161"
-          group="1"
-          name="Shading"
-          wearable="skin"
-          value_min="0"
-          value_max="1">
-            <param_color>
-               <value
-                color="255, 255, 255, 0" />
-
-               <value
-                color="255, 255, 255, 64" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="freckles lower"
-       fixed_color="120,47,20,128">
-         <param
-          id="777"
-          group="1"
-          name="freckles lower"
-          wearable="skin"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="bodyfreckles_alpha.tga"
-             skip_if_zero="true"
-             domain="0.6" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_underpants bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="lower_underpants"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1055"
-          group="1"
-          wearable="underpants"
-          edit_group="underpants"
-          name="Pants Length"
-          value_min="0"
-          value_max="1"
-          value_default=".3">
-            <param_alpha
-             tga_file="pants_length_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1057"
-          group="1"
-          wearable="underpants"
-          edit_group="underpants"
-          name="Pants Waist"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="pants_waist_alpha.tga"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_underpants">
-         <texture
-          local_texture="lower_underpants" />
-
-         <param
-          id="824"
-          group="0"
-          wearable="underpants"
-          edit_group="colorpicker"
-          name="underpants_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="825"
-          group="0"
-          wearable="underpants"
-          edit_group="colorpicker"
-          name="underpants_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="826"
-          group="0"
-          wearable="underpants"
-          edit_group="colorpicker"
-          name="underpants_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1054"
-          group="1"
-          wearable="underpants"
-          edit_group="driven"
-          name="Pants Length"
-          value_min="0"
-          value_max="1"
-          value_default=".3"
-          camera_distance="1.2"
-          camera_angle="30"
-          camera_elevation="-.3">
-            <param_alpha
-             tga_file="pants_length_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1056"
-          group="1"
-          wearable="underpants"
-          edit_group="driven"
-          name="Pants Waist"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="pants_waist_alpha.tga"
-             domain="0.05" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_socks bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="lower_socks"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1051"
-          group="1"
-          wearable="socks"
-          edit_group="driven"
-          name="Socks Length bump"
-          value_min="0"
-          value_max="1"
-          value_default="0.35">
-            <param_alpha
-             tga_file="shoe_height_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_socks">
-         <texture
-          local_texture="lower_socks" />
-
-         <param
-          id="818"
-          group="0"
-          wearable="socks"
-          edit_group="colorpicker"
-          name="socks_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="819"
-          group="0"
-          wearable="socks"
-          edit_group="colorpicker"
-          name="socks_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="820"
-          group="0"
-          wearable="socks"
-          edit_group="colorpicker"
-          name="socks_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1050"
-          group="1"
-          wearable="socks"
-          edit_group="driven"
-          name="Socks Length bump"
-          value_min="0"
-          value_max="1"
-          value_default="0.35">
-            <param_alpha
-             tga_file="shoe_height_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_shoes bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="lower_shoes"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1053"
-          group="1"
-          wearable="shoes"
-          edit_group="driven"
-          name="Shoe Height bump"
-          value_min="0"
-          value_max="1"
-          value_default="0.1">
-            <param_alpha
-             tga_file="shoe_height_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_shoes">
-         <texture
-          local_texture="lower_shoes" />
-
-         <param
-          id="812"
-          group="0"
-          wearable="shoes"
-          edit_group="colorpicker"
-          name="shoes_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="813"
-          group="0"
-          wearable="shoes"
-          edit_group="colorpicker"
-          name="shoes_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="817"
-          group="0"
-          wearable="shoes"
-          edit_group="colorpicker"
-          name="shoes_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1052"
-          group="1"
-          wearable="shoes"
-          edit_group="driven"
-          name="Shoe Height"
-          value_min="0"
-          value_max="1"
-          value_default="0.1">
-            <param_alpha
-             tga_file="shoe_height_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_clothes_shadow">
-         <texture
-          local_texture="lower_pants" />
-
-         <param
-          id="913"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Lower Clothes Shading"
-          value_min="0"
-          value_max="1"
-          value_default="0">
-            <param_color>
-               <value
-                color="0, 0, 0, 0" />
-
-               <value
-                color="0, 0, 0, 80" />
-            </param_color>
-         </param>
-
-         <param
-          id="914"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Waist Height Shadow"
-          value_min="0.02"
-          value_max="1">
-            <param_alpha
-             tga_file="pants_waist_alpha.tga"
-             skip_if_zero="true"
-             domain="0.04" />
-         </param>
-
-         <param
-          id="915"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Pants Length Shadow"
-          value_min="0.02"
-          value_max="1">
-            <param_alpha
-             tga_file="pants_length_alpha.tga"
-             skip_if_zero="true"
-             domain="0.03" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_pants base bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="lower_pants"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1035"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Waist Height Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="pants_waist_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1036"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Pants Length Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="pants_length_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_pants bump"
-       render_pass="bump">
-         <texture
-          tga_file="bump_pants_wrinkles.tga" />
-
-         <texture
-          local_texture="lower_pants"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="869"
-          group="0"
-          wearable="pants"
-          edit_group="pants"
-          edit_group_order="6"
-          name="Pants Wrinkles"
-          value_min="0"
-          value_max="1"
-          value_default="0">
-            <param_color>
-               <value
-                color="255, 255, 255, 0" />
-
-               <value
-                color="255, 255, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1017"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Waist Height Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="pants_waist_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="1018"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Pants Length Cloth"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             tga_file="pants_length_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_pants">
-         <texture
-          local_texture="lower_pants" />
-
-         <morph_mask
-          morph_name="Displace_Loose_Lowerbody" />
-
-         <morph_mask
-          morph_name="Leg_Pantflair" />
-
-         <morph_mask
-          morph_name="Low_Crotch" />
-
-         <morph_mask
-          morph_name="Leg_Longcuffs" />
-
-         <param
-          id="806"
-          group="0"
-          wearable="pants"
-          edit_group="colorpicker"
-          name="pants_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="807"
-          group="0"
-          wearable="pants"
-          edit_group="colorpicker"
-          name="pants_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="808"
-          group="0"
-          wearable="pants"
-          edit_group="colorpicker"
-          name="pants_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="614"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Waist Height Cloth"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="pants_waist_alpha.tga"
-             domain="0.05" />
-         </param>
-
-         <param
-          id="615"
-          group="1"
-          edit_group="driven"
-          wearable="pants"
-          name="Pants Length Cloth"
-          value_min="0"
-          value_max="1"
-          value_default=".8">
-            <param_alpha
-             tga_file="pants_length_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_jacket base bump"
-       render_pass="bump"
-       fixed_color="128,128,128,255">
-         <texture
-          local_texture="lower_jacket"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="1033"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="jacket bottom length lower bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="jacket_length_lower_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1034"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="jacket open lower bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_open_lower_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_jacket bump"
-       render_pass="bump">
-         <texture
-          tga_file="bump_pants_wrinkles.tga" />
-
-         <texture
-          local_texture="lower_jacket"
-          local_texture_alpha_only="true" />
-
-         <param
-          id="876"
-          group="1"
-          wearable="jacket"
-          name="jacket upper Wrinkles"
-          value_min="0"
-          value_max="1"
-          value_default="0">
-            <param_color>
-               <value
-                color="255, 255, 255, 0" />
-
-               <value
-                color="255, 255, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="1027"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="jacket bottom length lower bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="jacket_length_lower_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="1028"
-          group="1"
-          wearable="jacket"
-          edit_group="driven"
-          name="jacket open lower bump"
-          value_min="0"
-          value_max="1">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_open_lower_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-
-      <layer
-       name="lower_jacket">
-         <texture
-          local_texture="lower_jacket" />
-
-         <param
-          id="809"
-          group="1"
-          edit_group="colorpicker_driven"
-          wearable="jacket"
-          name="lower_jacket_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="810"
-          group="1"
-          edit_group="colorpicker_driven"
-          wearable="jacket"
-          name="lower_jacket_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="811"
-          group="1"
-          edit_group="colorpicker_driven"
-          wearable="jacket"
-          name="lower_jacket_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="621"
-          group="1"
-          wearable="jacket"
-          edit_group="jacket"
-          name="bottom length lower"
-          label_min="hi cut"
-          label_max="low cut"
-          value_min="0"
-          value_max="1"
-          value_default=".8"
-          camera_distance="1.2"
-          camera_angle="30"
-          camera_elevation=".2">
-            <param_alpha
-             multiply_blend="false"
-             tga_file="jacket_length_lower_alpha.tga"
-             domain="0.01" />
-         </param>
-
-         <param
-          id="623"
-          group="1"
-          wearable="jacket"
-          edit_group="jacket"
-          name="open lower"
-          label_min="open"
-          label_max="closed"
-          value_min="0"
-          value_max="1"
-          value_default=".8"
-          camera_distance="1.2"
-          camera_angle="30"
-          camera_elevation=".2">
-            <param_alpha
-             multiply_blend="true"
-             tga_file="jacket_open_lower_alpha.tga"
-             domain="0.01" />
-         </param>
-      </layer>
-   </layer_set>
-
-<!-- =========================================================== -->
-   <layer_set
-    body_region="eyes"
-    width="128"
-    height="128">
-      <layer
-       name="whites">
-         <texture
-          tga_file="eyewhite.tga" />
-      </layer>
-
-      <layer
-       name="iris"
-       global_color="eye_color">
-         <texture
-          local_texture="eyes_iris" />
-      </layer>
-   </layer_set>
-
-<!-- =========================================================== -->
-   <layer_set
-    body_region="skirt"
-    width="512"
-    height="512"
-    clear_alpha="false">
-      <layer
-       name="skirt_fabric"
-       write_all_channels="true">
-         <texture
-          local_texture="skirt" />
-
-         <param
-          id="921"
-          group="0"
-          wearable="skirt"
-          edit_group="colorpicker"
-          name="skirt_red"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="255, 0, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="922"
-          group="0"
-          wearable="skirt"
-          edit_group="colorpicker"
-          name="skirt_green"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 255, 0, 255" />
-            </param_color>
-         </param>
-
-         <param
-          id="923"
-          group="0"
-          wearable="skirt"
-          edit_group="colorpicker"
-          name="skirt_blue"
-          value_min="0"
-          value_max="1"
-          value_default="1">
-            <param_color>
-               <value
-                color="0, 0, 0, 255" />
-
-               <value
-                color="0, 0, 255, 255" />
-            </param_color>
-         </param>
-      </layer>
-
-      <layer
-       name="skirt_fabric_alpha">
-         <param
-          id="858"
-          group="0"
-          wearable="skirt"
-          edit_group="skirt"
-          edit_group_order="1"
-          name="Skirt Length"
-		  show_simple="true"
-          label_min="Short"
-          label_max="Long"
-          value_min=".01"
-          value_max="1"
-          value_default=".4"
-		  simple_percent_min="40"
-		  simple_percent_max="100"
-          camera_distance="1.3"
-          camera_elevation="-.5"
-          camera_angle="30">
-            <param_alpha
-             tga_file="skirt_length_alpha.tga"
-             domain="0"
-             multiply_blend="true" />
-         </param>
-
-         <param
-          id="859"
-          group="0"
-          wearable="skirt"
-          edit_group="skirt"
-          edit_group_order="4"
-          name="Slit Front"
-          label_min="Open Front"
-          label_max="Closed Front"
-          value_min="0"
-          value_max="1"
-          value_default="1"
-          camera_distance="1.3"
-          camera_elevation="-.5"
-          camera_angle="30">
-            <param_alpha
-             tga_file="skirt_slit_front_alpha.tga"
-             multiply_blend="true"
-             domain="0" />
-         </param>
-
-         <param
-          id="860"
-          group="0"
-          wearable="skirt"
-          edit_group="skirt"
-          edit_group_order="5"
-          name="Slit Back"
-          label_min="Open Back"
-          label_max="Closed Back"
-          value_min="0"
-          value_max="1"
-          value_default="1"
-          camera_distance="1.3"
-          camera_elevation="-.5"
-          camera_angle="160">
-            <param_alpha
-             tga_file="skirt_slit_back_alpha.tga"
-             multiply_blend="true"
-             domain="0" />
-         </param>
-
-         <param
-          id="861"
-          group="0"
-          wearable="skirt"
-          edit_group="skirt"
-          edit_group_order="6"
-          name="Slit Left"
-          label_min="Open Left"
-          label_max="Closed Left"
-          value_min="0"
-          value_max="1"
-          value_default="1"
-          camera_distance="1.3"
-          camera_elevation="-.5"
-          camera_angle="30">
-            <param_alpha
-             tga_file="skirt_slit_left_alpha.tga"
-             multiply_blend="true"
-             domain="0" />
-         </param>
-
-         <param
-          id="862"
-          group="0"
-          wearable="skirt"
-          edit_group="skirt"
-          edit_group_order="7"
-          name="Slit Right"
-          label_min="Open Right"
-          label_max="Closed Right"
-          value_min="0"
-          value_max="1"
-          value_default="1"
-          camera_distance="1.3"
-          camera_elevation="-.5"
-          camera_angle="-30">
-            <param_alpha
-             tga_file="skirt_slit_right_alpha.tga"
-             multiply_blend="true"
-             domain="0" />
-         </param>
-      </layer>
-   </layer_set>
-
-<!-- =========================================================== -->
-   <driver_parameters>
-      <param
-       id="828"
-       group="0"
-       name="Loose Upper Clothing"
-       label="Shirt Fit"
-	   show_simple="true"
-       wearable="shirt"
-       edit_group="shirt"
-       edit_group_order="4"
-       label_min="Tight Shirt"
-       label_max="Loose Shirt"
-       value_min="0"
-       value_max="1"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="628" />
-
-            <driven
-             id="899"
-             min1="0.1"
-             max1="0.5"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="816"
-       group="0"
-       name="Loose Lower Clothing"
-       label="Pants Fit"
-	   show_simple="true"
-       wearable="pants"
-       edit_group="pants"
-       edit_group_order="2.5"
-       label_min="Tight Pants"
-       label_max="Loose Pants"
-       value_min="0"
-       value_max="1"
-       camera_distance="1.8"
-       camera_angle="30"
-       camera_elevation="-.3">
-         <param_driver>
-            <driven
-             id="516" />
-
-            <driven
-             id="913"
-             min1="0.1"
-             max1="0.5"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="814"
-       group="0"
-       wearable="pants"
-       edit_group="pants"
-       edit_group_order="2"
-       name="Waist Height"
-       label_min="Low"
-       label_max="High"
-       value_min="0"
-       value_max="1"
-       value_default="1"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation="-.3">
-         <param_driver>
-            <driven
-             id="614" />
-
-            <driven
-             id="1017" />
-
-            <driven
-             id="1033" />
-
-            <driven
-             id="914"
-             min1="0"
-             max1=".98"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="815"
-       group="0"
-       wearable="pants"
-       edit_group="pants"
-       edit_group_order="1"
-       name="Pants Length"
-	   show_simple="true"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".8"
-	   simple_percent_min="20"
-	   simple_percent_max="100"
-       camera_distance="1.8"
-       camera_angle="30"
-       camera_elevation="-.3">
-         <param_driver>
-            <driven
-             id="615"
-             min1="0"
-             max1=".9"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="1018"
-             min1="0"
-             max1=".9"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="1036"
-             min1="0"
-             max1=".9"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="793"
-             min1=".9"
-             max1="1"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="915"
-             min1="0"
-             max1=".882"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="800"
-       group="0"
-       wearable="shirt"
-       edit_group="shirt"
-       edit_group_order="1"
-       name="Sleeve Length"
-	   show_simple="true"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".89"
-	   simple_percent_min="15"
-	   simple_percent_max="100"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="600" />
-
-            <driven
-             id="1013" />
-
-            <driven
-             id="1029" />
-
-            <driven
-             id="900"
-             min1="0"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="801"
-       group="0"
-       wearable="shirt"
-       edit_group="shirt"
-       edit_group_order="2"
-       name="Shirt Bottom"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default="1"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="601" />
-
-            <driven
-             id="1014" />
-
-            <driven
-             id="1030" />
-
-            <driven
-             id="901"
-             min1="0"
-             max1=".98"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="802"
-       group="0"
-       wearable="shirt"
-       edit_group="shirt"
-       edit_group_order="3"
-       name="Collar Front"
-	   show_simple="true"
-       label_min="Low"
-       label_max="High"
-       value_min="0"
-       value_max="1"
-       value_default=".78"
-	   simple_percent_min="40"
-	   simple_percent_max="100"
-       camera_distance="1.2"
-       camera_angle="15"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="602" />
-
-            <driven
-             id="1015" />
-
-            <driven
-             id="1031" />
-
-            <driven
-             id="902"
-             min1="0"
-             max1=".98"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="781"
-       group="0"
-       wearable="shirt"
-       edit_group="shirt"
-       edit_group_order="3.1"
-       name="Collar Back"
-       label_min="Low"
-       label_max="High"
-       value_min="0"
-       value_max="1"
-       value_default=".78"
-       camera_distance="1.2"
-       camera_angle="195"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="778" />
-
-            <driven
-             id="1016" />
-
-            <driven
-             id="1032" />
-
-            <driven
-             id="903"
-             min1="0"
-             max1=".98"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="150"
-       group="0"
-       wearable="skin"
-       edit_group="skin_bodydetail"
-       name="Body Definition"
-       label_min="Less"
-       label_max="More"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_distance="1.4"
-       camera_elevation="-.2">
-         <param_driver>
-            <driven
-             id="125" />
-
-            <driven
-             id="126" />
-
-            <driven
-             id="160" />
-
-            <driven
-             id="161" />
-
-            <driven
-             id="874" />
-
-            <driven
-             id="878" />
-
-         </param_driver>
-      </param>
-
-      <param
-       id="775"
-       group="0"
-       wearable="skin"
-       edit_group="skin_bodydetail"
-       name="Body Freckles"
-       label_min="Less Freckles"
-       label_max="More Freckles"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_distance="1.4"
-       camera_elevation="-.2">
-         <param_driver>
-            <driven
-             id="776" />
-
-            <driven
-             id="777" />
-         </param_driver>
-      </param>
-
-      <param
-       id="162"
-       group="0"
-       wearable="skin"
-       edit_group="skin_facedetail"
-       edit_group_order="1"
-       name="Facial Definition"
-       label_min="Less"
-       label_max="More"
-       value_min="0"
-       value_max="1"
-       camera_distance=".3"
-       camera_elevation=".07"
-       value_default="0">
-         <param_driver>
-            <driven
-             id="158" />
-
-            <driven
-             id="159" />
-
-			<driven
-             id="873" />
-         </param_driver>
-      </param>
-
-      <param
-       id="163"
-       group="0"
-       wearable="skin"
-       edit_group="skin_facedetail"
-       edit_group_order="3"
-       name="wrinkles"
-       label_min="Less"
-       label_max="More"
-       value_min="0"
-       value_max="1"
-       camera_distance=".3"
-       camera_elevation=".07"
-       value_default="0">
-         <param_driver>
-<!--<driven
-             id="128" />-->
-            <driven
-             id="118" />
-         </param_driver>
-      </param>
-
-      <param
-       id="505"
-       group="0"
-       wearable="shape"
-       edit_group="shape_mouth"
-       edit_group_order="3"
-       name="Lip Thickness"
-       label_min="Thin Lips"
-       label_max="Fat Lips"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_distance=".3"
-       camera_elevation=".04"
-       camera_angle="20">
-         <param_driver>
-            <driven
-             id="26"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="28"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="799"
-       group="0"
-       wearable="shape"
-       edit_group="shape_mouth"
-       edit_group_order="3.2"
-       name="Lip Ratio"
-	   label="Lip Ratio"
-	   show_simple="true"
-       label_min="More Upper Lip"
-       label_max="More Lower Lip"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_distance=".3"
-       camera_elevation=".04"
-       camera_angle="20">
-         <param_driver>
-            <driven
-             id="797"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="798"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="155"
-       group="0"
-       wearable="shape"
-       edit_group="shape_mouth"
-       edit_group_order="1"
-       name="Lip Width"
-	   label="Lip Width"
-       label_min="Narrow Lips"
-       label_max="Wide Lips"
-       show_simple="true"
-       value_min="-0.9"
-       value_max="1.3"
-       camera_distance=".3"
-       camera_elevation=".04"
-       value_default="0">
-         <param_driver>
-            <driven
-             id="29" />
-
-            <driven
-             id="30" />
-         </param_driver>
-      </param>
-
-      <param
-       id="196"
-       group="0"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="2"
-       name="Eye Spacing"
-	   label="Eye Spacing"
-       label_min="Close Set Eyes"
-       label_max="Far Set Eyes"
-       show_simple="true"
-       value_min="-2"
-       value_max="1"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".35"
-       camera_angle="5">
-         <param_driver>
-            <driven
-             id="194" />
-
-            <driven
-             id="195" />
-         </param_driver>
-      </param>
-
-      <param
-       id="769"
-       group="0"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="4.5"
-       name="Eye Depth"
-       label_min="Sunken Eyes"
-       label_max="Bugged Eyes"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="75">
-         <param_driver>
-            <driven
-             id="767" />
-
-            <driven
-             id="768" />
-         </param_driver>
-      </param>
-
-      <param
-       id="198"
-       group="0"
-       wearable="shoes"
-       edit_group="shoes"
-       edit_group_order="2"
-       name="Heel Height"
-       label_min="Low Heels"
-       label_max="High Heels"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_angle="45"
-       camera_distance=".8"
-       camera_elevation="-1">
-         <param_driver>
-            <driven
-             id="197" />
-
-            <driven
-             id="500" />
-         </param_driver>
-      </param>
-
-      <param
-       id="513"
-       group="0"
-       wearable="shoes"
-       edit_group="shoes"
-       edit_group_order="3"
-       name="Heel Shape"
-       label_min="Pointy Heels"
-       label_max="Thick Heels"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_angle="45"
-       camera_distance="1.5"
-       camera_elevation="-1">
-         <param_driver>
-            <driven
-             id="509"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="510"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="514"
-       group="0"
-       wearable="shoes"
-       edit_group="shoes"
-       edit_group_order="4"
-       name="Toe Shape"
-       label_min="Pointy"
-       label_max="Square"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_angle="5"
-       camera_distance=".8"
-       camera_elevation="-.8">
-         <param_driver>
-            <driven
-             id="511"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="512"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="503"
-       group="0"
-       wearable="shoes"
-       edit_group="shoes"
-       edit_group_order="6"
-       name="Platform Height"
-       label_min="Low Platforms"
-       label_max="High Platforms"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_angle="45"
-       camera_distance=".5"
-       camera_elevation="-1">
-         <param_driver>
-            <driven
-             id="501" />
-
-            <driven
-             id="502" />
-         </param_driver>
-      </param>
-
-      <param
-       id="193"
-       group="0"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="3"
-       name="Head Shape"
-	   label="Head Shape"
-       label_min="More Square"
-       label_max="More Round"
-       show_simple="true"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_driver>
-            <driven
-             id="188"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="642"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="189"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="643"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="157"
-       group="0"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="13"
-       name="Belly Size"
-       label_min="Small"
-       label_max="Big"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_distance="1.4"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="104" />
-
-            <driven
-             id="156" />
-
-            <driven
-             id="849" />
-         </param_driver>
-      </param>
-
-      <param
-       id="637"
-       group="0"
-       wearable="shape"
-       edit_group="shape_body"
-       edit_group_order="3"
-       name="Body Fat"
-       label_min="Less Body Fat"
-       label_max="More Body Fat"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_distance="1.8">
-         <param_driver>
-            <driven
-             id="633" />
-
-            <driven
-             id="634" />
-
-            <driven
-             id="635" />
-
-            <driven
-             id="851" />
-         </param_driver>
-      </param>
-
-      <param
-       id="130"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="8"
-       name="Front Fringe"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".45"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_driver>
-            <driven
-             id="144"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="145"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="131"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="9"
-       name="Side Fringe"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="90">
-         <param_driver>
-            <driven
-             id="146"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="147"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="132"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="10"
-       name="Back Fringe"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".39"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="160">
-         <param_driver>
-            <driven
-             id="148"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="149"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="133"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="2"
-       name="Hair Front"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".25"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_driver>
-            <driven
-             id="172"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="171"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="134"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="3"
-       name="Hair Sides"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="90">
-         <param_driver>
-            <driven
-             id="174"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="173"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="135"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="4"
-       name="Hair Back"
-	   show_simple="true"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".55"
-       camera_elevation="-.1"
-       camera_distance=".8"
-       camera_angle="160">
-         <param_driver>
-            <driven
-             id="176"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="175"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="136"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="11.5"
-       name="Hair Sweep"
-       label_min="Sweep Forward"
-       label_max="Sweep Back"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="90">
-         <param_driver>
-            <driven
-             id="179"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="178"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="137"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="16"
-       name="Hair Tilt"
-       label_min="Left"
-       label_max="Right"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="0">
-         <param_driver>
-            <driven
-             id="190"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="191"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="608"
-       group="0"
-       wearable="jacket"
-       edit_group="jacket"
-       edit_group_order="2"
-       name="bottom length lower"
-       label="Jacket Length"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".8"
-       camera_distance="1.4"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="620" />
-
-            <driven
-             id="1025" />
-
-            <driven
-             id="1037" />
-
-            <driven
-             id="621" />
-
-            <driven
-             id="1027" />
-
-            <driven
-             id="1033" />
-         </param_driver>
-      </param>
-
-      <param
-       id="609"
-       group="0"
-       wearable="jacket"
-       edit_group="jacket"
-       edit_group_order="4"
-       name="open jacket"
-       label="Open Front"
-       label_min="Open"
-       label_max="Closed"
-       value_min="0"
-       value_max="1"
-       value_default=".2"
-       camera_distance="1.4"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="622" />
-
-            <driven
-             id="1026" />
-
-            <driven
-             id="1038" />
-
-            <driven
-             id="623" />
-
-            <driven
-             id="1028" />
-
-            <driven
-             id="1034" />
-         </param_driver>
-      </param>
-
-      <param
-       id="105"
-       group="0"
-       sex="female"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="6"
-       name="Breast Size"
-       label_min="Small"
-       label_max="Large"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".3"
-       camera_distance="1.2"
-       camera_angle="30">
-         <param_driver>
-            <driven
-             id="843"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".01" />
-
-            <driven
-             id="627"
-             min1="0"
-             max1="0.01"
-             max2="0.01"
-             min2=".5" />
-
-            <driven
-             id="626"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="629"
-       group="0"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="6"
-       name="Forehead Angle"
-       label_min="More Vertical"
-       label_max="More Sloped"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="70">
-         <param_driver>
-            <driven
-             id="630"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="644"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="631"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="645"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="646"
-       group="0"
-       name="Egg_Head"
-       label="Egg Head"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="4"
-       label_min="Chin Heavy"
-       label_max="Forehead Heavy"
-       show_simple="true"
-       value_min="-1.3"
-       value_max="1"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_driver>
-            <driven
-             id="640" />
-
-            <driven
-             id="186" />
-         </param_driver>
-      </param>
-
-      <param
-       id="647"
-       group="0"
-       name="Squash_Stretch_Head"
-       label="Head Stretch"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="2"
-       show_simple="true"
-       label_min="Squash Head"
-       label_max="Stretch Head"
-       value_min="-0.5"
-       value_max="1"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_driver>
-            <driven
-             id="641" />
-
-            <driven
-             id="187" />
-         </param_driver>
-      </param>
-
-      <param
-       id="649"
-       group="0"
-       sex="female"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="1.1"
-       name="Torso Muscles"
-	   label="Torso Muscles"
-	   show_simple="true"
-       label_min="Less Muscular"
-       label_max="More Muscular"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance="1"
-       camera_angle="15">
-         <param_driver>
-            <driven
-             id="648"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="106"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="678"
-       group="0"
-       sex="male"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="1"
-       name="Torso Muscles"
-       show_simple="true"
-	   label_min="Less Muscular"
-       label_max="More Muscular"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance="1.2"
-       camera_angle="0">
-         <param_driver>
-            <driven
-             id="677"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="106"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="652"
-       group="0"
-       wearable="shape"
-       edit_group="shape_legs"
-       edit_group_order="1"
-       name="Leg Muscles"
-       label_min="Less Muscular"
-       label_max="More Muscular"
-       show_simple="true"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_distance="1.3"
-       camera_elevation="-.5"
-       camera_angle="15">
-         <param_driver>
-            <driven
-             id="651"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="152"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="80"
-       name="male"
-       group="0"
-       edit_group="dummy"
-       wearable="shape"
-       value_min="0"
-       value_max="1">
-         <param_driver>
-            <driven
-             id="32" />
-
-            <driven
-             id="153" />
-
-            <driven
-             id="40" />
-
-            <driven
-             id="100" />
-
-            <driven
-             id="857" />
-         </param_driver>
-      </param>
-
-      <param
-       id="659"
-       group="0"
-       wearable="shape"
-       edit_group="shape_mouth"
-       edit_group_order="5"
-       name="Mouth Corner"
-       label_min="Corner Down"
-       label_max="Corner Up"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation="0"
-       camera_distance=".28">
-         <param_driver>
-            <driven
-             id="658"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="657"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="662"
-       group="0"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="5"
-       name="Face Shear"
-       label_min="Shear Right Up"
-       label_max="Shear Left Up"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5">
-         <param_driver>
-            <driven
-             id="660" />
-
-            <driven
-             id="661" />
-
-            <driven
-             id="774" />
-         </param_driver>
-      </param>
-
-      <param
-       id="773"
-       group="0"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="4.5"
-       name="Head Length"
-       label_min="Flat Head"
-       label_max="Long Head"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="75">
-         <param_driver>
-            <driven
-             id="770" />
-
-            <driven
-             id="771" />
-
-            <driven
-             id="772" />
-         </param_driver>
-      </param>
-
-      <param
-       id="682"
-       group="0"
-       wearable="shape"
-       edit_group="shape_head"
-       edit_group_order="1"
-       name="Head Size"
-	   label="Head Size"
-       label_min="Small Head"
-       label_max="Big Head"
-       show_simple="true"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".5">
-         <param_driver>
-            <driven
-             id="679" />
-
-            <driven
-             id="694" />
-
-            <driven
-             id="680" />
-
-            <driven
-             id="681" />
-
-            <driven
-             id="655" />
-         </param_driver>
-      </param>
-
-      <param
-       id="690"
-       group="0"
-       wearable="shape"
-       edit_group="shape_eyes"
-       edit_group_order="1"
-       name="Eye Size"
-	   label="Eye Size"
-       label_min="Beady Eyes"
-       label_max="Anime Eyes"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-	   show_simple="true"
-       camera_elevation=".1"
-       camera_distance=".35">
-         <param_driver>
-            <driven
-             id="686" />
-
-            <driven
-             id="687" />
-
-            <driven
-             id="695" />
-
-            <driven
-             id="688" />
-
-            <driven
-             id="691" />
-
-            <driven
-             id="689" />
-         </param_driver>
-      </param>
-
-      <param
-       id="752"
-       group="0"
-       sex="male"
-       wearable="hair"
-       edit_group="hair_facial"
-       edit_group_order="1"
-       name="Hair Thickness"
-       label_min="5 O'Clock Shadow"
-       label_max="Bushy Hair"
-       value_min="0"
-       value_max="1"
-       value_default=".5"
-       camera_elevation="0"
-       camera_distance=".28">
-         <param_driver>
-            <driven
-             id="751"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".2" />
-
-            <driven
-             id="1012"
-             min1="0"
-             max1="0"
-             max2=".2"
-             min2=".6" />
-
-            <driven
-             id="400"
-             min1=".2"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="763"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="1"
-       name="Hair Volume"
-	   show_simple="true"
-       label_min="Less Volume"
-       label_max="More Volume"
-       value_min="0"
-       value_max="1"
-       value_default=".55"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="20">
-         <param_driver>
-            <driven
-             id="761"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".5" />
-
-            <driven
-             id="180"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="834"
-       group="0"
-       wearable="jacket"
-       edit_group="colorpicker"
-       name="jacket_red"
-       value_min="0"
-       value_max="1"
-       value_default="1">
-         <param_driver>
-            <driven
-             id="809"
-             min1="0"
-             max1="1"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="831"
-             min1="0"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="835"
-       group="0"
-       wearable="jacket"
-       edit_group="colorpicker"
-       name="jacket_green"
-       value_min="0"
-       value_max="1"
-       value_default="1">
-         <param_driver>
-            <driven
-             id="810"
-             min1="0"
-             max1="1"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="832"
-             min1="0"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="836"
-       group="0"
-       wearable="jacket"
-       edit_group="colorpicker"
-       name="jacket_blue"
-       value_min="0"
-       value_max="1"
-       value_default="1">
-         <param_driver>
-            <driven
-             id="811"
-             min1="0"
-             max1="1"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="833"
-             min1="0"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="785"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="14.6"
-       name="Pigtails"
-	   show_simple="true"
-       label_min="Short Pigtails"
-       label_max="Long Pigtails"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="15">
-         <param_driver>
-            <driven
-             id="782"
-             min1="0"
-             max1=".10"
-             max2=".10"
-             min2=".5" />
-
-            <driven
-             id="783"
-             min1=".10"
-             max1=".5"
-             max2=".5"
-             min2=".75" />
-
-            <driven
-             id="790"
-             min1=".5"
-             max1=".75"
-             max2=".75"
-             min2="1" />
-
-            <driven
-             id="784"
-             min1=".75"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="789"
-       group="0"
-       wearable="hair"
-       edit_group="hair_style"
-       edit_group_order="14.7"
-       name="Ponytail"
-       label_min="Short Ponytail"
-       label_max="Long Ponytail"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".5"
-       camera_angle="180">
-         <param_driver>
-            <driven
-             id="786"
-             min1="0"
-             max1=".10"
-             max2=".10"
-             min2=".66" />
-
-            <driven
-             id="787"
-             min1=".10"
-             max1=".66"
-             max2=".66"
-             min2="1" />
-
-            <driven
-             id="788"
-             min1=".66"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="795"
-       group="0"
-       name="Butt Size"
-       label="Butt Size"
-       wearable="shape"
-       edit_group="shape_legs"
-       edit_group_order="4"
-       label_min="Flat Butt"
-       label_max="Big Butt"
-       value_min="0"
-       value_max="1"
-       value_default=".25"
-       camera_angle="180"
-       camera_distance=".6">
-         <param_driver>
-            <driven
-             id="867"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".3" />
-
-            <driven
-             id="794"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".3" />
-
-            <driven
-             id="151"
-             min1=".3"
-             max1="1"
-             max2="1"
-             min2="1" />
-
-            <driven
-             id="852"
-             min1=".3"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="841"
-       group="0"
-       name="Bowed_Legs"
-       label="Knee Angle"
-       wearable="shape"
-       edit_group_order="5.5"
-       edit_group="shape_legs"
-       label_min="Knock Kneed"
-       label_max="Bow Legged"
-       value_min="-1"
-       value_max="1"
-       value_default="0"
-       camera_distance="1.3"
-       camera_elevation="-.5">
-         <param_driver>
-            <driven
-             id="853" />
-
-            <driven
-             id="847" />
-         </param_driver>
-      </param>
-
-      <param
-       id="753"
-       group="0"
-       name="Saddlebags"
-       label="Saddle Bags"
-       wearable="shape"
-       edit_group="shape_legs"
-       edit_group_order="5"
-       label_min="Less Saddle"
-       label_max="More Saddle"
-       value_min="-0.5"
-       value_max="3"
-       value_default="0"
-       camera_angle="0"
-       camera_distance="1.2">
-         <param_driver>
-            <driven
-             id="850" />
-
-            <driven
-             id="854" />
-         </param_driver>
-      </param>
-
-      <param
-       id="676"
-       group="0"
-       name="Love_Handles"
-       label="Love Handles"
-       wearable="shape"
-       edit_group="shape_torso"
-       edit_group_order="12"
-       label_min="Less Love"
-       label_max="More Love"
-       value_min="-1"
-       value_max="2"
-       value_default="0"
-       camera_elevation=".3"
-       camera_distance=".9">
-         <param_driver>
-            <driven
-             id="855" />
-
-            <driven
-             id="856" />
-         </param_driver>
-      </param>
-
-      <param
-       id="863"
-       group="0"
-       name="skirt_looseness"
-       label="Skirt Fit"
-	   show_simple="true"
-       clothing_morph="true"
-       wearable="skirt"
-       edit_group_order="2"
-       edit_group="skirt"
-       label_min="Tight Skirt"
-       label_max="Poofy Skirt"
-       value_min="0"
-       value_max="1"
-       value_default=".333"
-       camera_distance="1.3"
-       camera_elevation="-.5">
-         <param_driver>
-            <driven
-             id="866"
-             min1="0"
-             max1="0"
-             max2="0"
-             min2=".2" />
-
-            <driven
-             id="846"
-             min1="0"
-             max1=".5"
-             max2=".5"
-             min2="1" />
-
-            <driven
-             id="845"
-             min1=".5"
-             max1="1"
-             max2="1"
-             min2="1" />
-         </param_driver>
-      </param>
-
-      <param
-       id="119"
-       group="0"
-       wearable="hair"
-       edit_group="hair_eyebrows"
-       edit_group_order="1"
-       name="Eyebrow Size"
-	   show_simple="true"
-       label_min="Thin Eyebrows"
-       label_max="Bushy Eyebrows"
-       value_min="0"
-       value_max="1"
-       value_default="0.5"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_driver>
-            <driven
-             id="1000" />
-
-            <driven
-             id="1001" />
-         </param_driver>
-      </param>
-
-      <param
-       id="750"
-       group="0"
-       wearable="hair"
-       edit_group="hair_eyebrows"
-       edit_group_order="2"
-       name="Eyebrow Density"
-       label_min="Sparse"
-       label_max="Dense"
-       value_min="0"
-       value_max="1"
-       value_default="0.7"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_driver>
-            <driven
-             id="1002" />
-
-            <driven
-             id="1003" />
-         </param_driver>
-      </param>
-
-      <param
-       id="166"
-       sex="male"
-       group="0"
-       wearable="hair"
-       edit_group="hair_facial"
-       edit_group_order="2"
-       name="Sideburns"
-	   show_simple="true"
-       label_min="Short Sideburns"
-       label_max="Mutton Chops"
-       value_min="0"
-       value_max="1"
-       value_default="0.0"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="30">
-         <param_driver>
-            <driven
-             id="1004" />
-
-            <driven
-             id="1005" />
-         </param_driver>
-      </param>
-
-      <param
-       id="167"
-       sex="male"
-       group="0"
-       wearable="hair"
-       edit_group="hair_facial"
-       edit_group_order="3"
-       name="Moustache"
-	   show_simple="true"
-       label_min="Chaplin"
-       label_max="Handlebars"
-       value_min="0"
-       value_max="1"
-       value_default="0.0"
-       camera_elevation=".1"
-       camera_distance=".3"
-       camera_angle="30">
-         <param_driver>
-            <driven
-             id="1006" />
-
-            <driven
-             id="1007" />
-         </param_driver>
-      </param>
-
-      <param
-       id="168"
-       sex="male"
-       group="0"
-       wearable="hair"
-       edit_group="hair_facial"
-       edit_group_order="5"
-       name="Soulpatch"
-	   show_simple="true"
-       label_min="Less soul"
-       label_max="More soul"
-       value_min="0"
-       value_max="1"
-       value_default="0.0"
-       camera_elevation="-.1"
-       camera_distance=".3"
-       camera_angle="0">
-         <param_driver>
-            <driven
-             id="1008" />
-
-            <driven
-             id="1009" />
-         </param_driver>
-      </param>
-
-      <param
-       id="169"
-       sex="male"
-       group="0"
-       wearable="hair"
-       edit_group="hair_facial"
-       edit_group_order="4"
-       name="Chin Curtains"
-	   show_simple="true"
-       label_min="Less Curtains"
-       label_max="More Curtains"
-       value_min="0"
-       value_max="1"
-       value_default="0.0"
-       camera_elevation="-.1"
-       camera_distance=".3"
-       camera_angle="45">
-         <param_driver>
-            <driven
-             id="1010" />
-
-            <driven
-             id="1011" />
-         </param_driver>
-      </param>
-
-      <param
-       id="606"
-       group="0"
-       wearable="jacket"
-       edit_group="jacket"
-       edit_group_order="1"
-       name="Sleeve Length"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".8"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1019" />
-
-            <driven
-             id="1039" />
-
-            <driven
-             id="1020" />
-         </param_driver>
-      </param>
-
-      <param
-       id="607"
-       group="0"
-       wearable="jacket"
-       edit_group="jacket"
-       edit_group_order="3"
-       name="Collar Front"
-       label_min="Low"
-       label_max="High"
-       value_min="0"
-       value_max="1"
-       value_default=".8"
-       camera_distance="1.2"
-       camera_angle="15"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1021" />
-
-            <driven
-             id="1040" />
-
-            <driven
-             id="1022" />
-         </param_driver>
-      </param>
-
-      <param
-       id="780"
-       group="0"
-       wearable="jacket"
-       edit_group="jacket"
-       edit_group_order="3.5"
-       name="Collar Back"
-       label_min="Low"
-       label_max="High"
-       value_min="0"
-       value_max="1"
-       value_default=".8"
-       camera_distance="1.2"
-       camera_angle="195"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1023" />
-
-            <driven
-             id="1041" />
-
-            <driven
-             id="1024" />
-         </param_driver>
-      </param>
-
-      <param
-       id="603"
-       group="0"
-       wearable="undershirt"
-       edit_group="undershirt"
-       edit_group_order="1"
-       name="Sleeve Length"
-       label_min="Short"
-       label_max="Long"
-       value_min=".01"
-       value_max="1"
-       value_default=".4"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1042" />
-
-            <driven
-             id="1043" />
-         </param_driver>
-      </param>
-
-      <param
-       id="604"
-       group="0"
-       wearable="undershirt"
-       edit_group="undershirt"
-       edit_group_order="2"
-       name="Bottom"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".85"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1044" />
-
-            <driven
-             id="1045" />
-         </param_driver>
-      </param>
-
-      <param
-       id="605"
-       group="0"
-       wearable="undershirt"
-       edit_group="undershirt"
-       edit_group_order="3"
-       name="Collar Front"
-       label_min="Low"
-       label_max="High"
-       value_min="0"
-       value_max="1"
-       value_default=".84"
-       camera_distance=".8"
-       camera_angle="15"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1046" />
-
-            <driven
-             id="1047" />
-         </param_driver>
-      </param>
-
-      <param
-       id="779"
-       group="0"
-       wearable="undershirt"
-       edit_group="undershirt"
-       edit_group_order="4"
-       name="Collar Back"
-       label_min="Low"
-       label_max="High"
-       value_min="0"
-       value_max="1"
-       value_default=".84"
-       camera_distance=".8"
-       camera_angle="195"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1048" />
-
-            <driven
-             id="1049" />
-         </param_driver>
-      </param>
-
-      <param
-       id="617"
-       group="0"
-       wearable="socks"
-       edit_group="socks"
-       name="Socks Length"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default="0.35"
-       camera_distance=".95"
-       camera_angle="30"
-       camera_elevation="-.75">
-         <param_driver>
-            <driven
-             id="1050" />
-
-            <driven
-             id="1051" />
-         </param_driver>
-      </param>
-
-      <param
-       id="616"
-       group="0"
-       wearable="shoes"
-       edit_group="shoes"
-       edit_group_order="1"
-       name="Shoe Height"
-       label_min="Short"
-       label_max="Tall"
-       value_min="0"
-       value_max="1"
-       value_default="0.1"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation="-.75">
-         <param_driver>
-            <driven
-             id="1052" />
-
-            <driven
-             id="1053" />
-         </param_driver>
-      </param>
-
-      <param
-       id="619"
-       group="0"
-       wearable="underpants"
-       edit_group="underpants"
-       name="Pants Length"
-       label_min="Short"
-       label_max="Long"
-       value_min="0"
-       value_max="1"
-       value_default=".3"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation="-.3">
-         <param_driver>
-            <driven
-             id="1054" />
-
-            <driven
-             id="1055" />
-         </param_driver>
-      </param>
-
-      <param
-       id="624"
-       group="0"
-       wearable="underpants"
-       edit_group="underpants"
-       name="Pants Waist"
-       label_min="Low"
-       label_max="High"
-       value_min="0"
-       value_max="1"
-       value_default=".8"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation="-.3">
-         <param_driver>
-            <driven
-             id="1056" />
-
-            <driven
-             id="1057" />
-         </param_driver>
-      </param>
-
-      <param
-       id="93"
-       group="0"
-       wearable="gloves"
-       edit_group="gloves"
-       name="Glove Length"
-       label_min="Short"
-       label_max="Long"
-       value_min=".01"
-       value_max="1"
-       value_default=".8"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1058" />
-
-            <driven
-             id="1059" />
-         </param_driver>
-      </param>
-
-      <param
-       id="844"
-       group="0"
-       wearable="gloves"
-       edit_group="gloves"
-       name="Glove Fingers"
-       label_min="Fingerless"
-       label_max="Fingers"
-       value_min=".01"
-       value_max="1"
-       value_default="1"
-       camera_distance="1.2"
-       camera_angle="30"
-       camera_elevation=".2">
-         <param_driver>
-            <driven
-             id="1060" />
-
-            <driven
-             id="1061" />
-         </param_driver>
-      </param>
-
-<!--Pointy eyebrows became a driver/driven param with new max value for backwards compatibility between 1.0 and 1.1-->
-      <param
-       id="16"
-       group="0"
-       name="Pointy_Eyebrows"
-       label="Eyebrow Points"
-       wearable="hair"
-       edit_group="hair_eyebrows"
-       edit_group_order="4"
-       label_min="Smooth"
-       label_max="Pointy"
-       value_min="-.5"
-       value_max="3"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_driver>
-            <driven
-             id="870" />
-         </param_driver>
-      </param>
-
-<!--Lower eyebrows became a driver/driven param with new min value for backwards compatibility between 1.0 and 1.1-->
-      <param
-       id="757"
-       group="0"
-       name="Lower_Eyebrows"
-       label="Eyebrow Height"
-	   show_simple="true"
-       wearable="hair"
-       edit_group="hair_eyebrows"
-       edit_group_order="2.5"
-       label_min="Higher"
-       label_max="Lower"
-       value_min="-4"
-       value_max="2"
-       value_default="-1"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_driver>
-            <driven
-             id="871" />
-         </param_driver>
-      </param>
-
-<!--Arced eyebrows became a driver/driven param with new max value for backwards compatibility between 1.0 and 1.1-->
-      <param
-       id="31"
-       group="0"
-       name="Arced_Eyebrows"
-       label="Eyebrow Arc"
-       wearable="hair"
-       edit_group="hair_eyebrows"
-       edit_group_order="3"
-       label_min="Flat"
-       label_max="Arced"
-       value_min="0"
-       value_max="2"
-       value_default=".5"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_driver>
-            <driven
-             id="872" />
-         </param_driver>
-      </param>
-
-      <param
-       id="877"
-       group="0"
-       name="Jacket Wrinkles"
-       label="Jacket Wrinkles"
-       wearable="jacket"
-       edit_group="jacket"
-       edit_group_order="20"
-       label_min="No Wrinkles"
-       label_max="Wrinkles"
-       value_min="0"
-       value_max="1"
-       value_default="0"
-       camera_elevation=".1"
-       camera_distance=".3">
-         <param_driver>
-            <driven
-             id="875" />
-
-             <driven
-             id="876" />
-         </param_driver>
-      </param>
-
-   </driver_parameters>
-</linden_avatar>
-
diff --git a/old/libsl1550/libsecondlife/Resources/blush_alpha.tga b/old/libsl1550/libsecondlife/Resources/blush_alpha.tga
deleted file mode 100644
index 05be7e7..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/blush_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/body_skingrain.tga b/old/libsl1550/libsecondlife/Resources/body_skingrain.tga
deleted file mode 100644
index 7264baa..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/body_skingrain.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/bodyfreckles_alpha.tga b/old/libsl1550/libsecondlife/Resources/bodyfreckles_alpha.tga
deleted file mode 100644
index d30ab3d..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/bodyfreckles_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/bump_face_wrinkles.tga b/old/libsl1550/libsecondlife/Resources/bump_face_wrinkles.tga
deleted file mode 100644
index 54bf7a5..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/bump_face_wrinkles.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/bump_head_base.tga b/old/libsl1550/libsecondlife/Resources/bump_head_base.tga
deleted file mode 100644
index fa35685..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/bump_head_base.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/bump_lowerbody_base.tga b/old/libsl1550/libsecondlife/Resources/bump_lowerbody_base.tga
deleted file mode 100644
index 498ea3c..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/bump_lowerbody_base.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/bump_pants_wrinkles.tga b/old/libsl1550/libsecondlife/Resources/bump_pants_wrinkles.tga
deleted file mode 100644
index cca7241..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/bump_pants_wrinkles.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/bump_shirt_wrinkles.tga b/old/libsl1550/libsecondlife/Resources/bump_shirt_wrinkles.tga
deleted file mode 100644
index 9e0d757..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/bump_shirt_wrinkles.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/bump_upperbody_base.tga b/old/libsl1550/libsecondlife/Resources/bump_upperbody_base.tga
deleted file mode 100644
index e57d635..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/bump_upperbody_base.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/eyebrows_alpha.tga b/old/libsl1550/libsecondlife/Resources/eyebrows_alpha.tga
deleted file mode 100644
index c363e48..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/eyebrows_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/eyeliner_alpha.tga b/old/libsl1550/libsecondlife/Resources/eyeliner_alpha.tga
deleted file mode 100644
index 1611eb3..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/eyeliner_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/eyeshadow_inner_alpha.tga b/old/libsl1550/libsecondlife/Resources/eyeshadow_inner_alpha.tga
deleted file mode 100644
index 37d7919..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/eyeshadow_inner_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/eyeshadow_outer_alpha.tga b/old/libsl1550/libsecondlife/Resources/eyeshadow_outer_alpha.tga
deleted file mode 100644
index 00eef9d..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/eyeshadow_outer_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/eyewhite.tga b/old/libsl1550/libsecondlife/Resources/eyewhite.tga
deleted file mode 100644
index a720496..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/eyewhite.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/facehair_chincurtains_alpha.tga b/old/libsl1550/libsecondlife/Resources/facehair_chincurtains_alpha.tga
deleted file mode 100644
index b103970..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/facehair_chincurtains_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/facehair_moustache_alpha.tga b/old/libsl1550/libsecondlife/Resources/facehair_moustache_alpha.tga
deleted file mode 100644
index 4068c4f..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/facehair_moustache_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/facehair_sideburns_alpha.tga b/old/libsl1550/libsecondlife/Resources/facehair_sideburns_alpha.tga
deleted file mode 100644
index acddc2d..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/facehair_sideburns_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/facehair_soulpatch_alpha.tga b/old/libsl1550/libsecondlife/Resources/facehair_soulpatch_alpha.tga
deleted file mode 100644
index 687091a..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/facehair_soulpatch_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/freckles_alpha.tga b/old/libsl1550/libsecondlife/Resources/freckles_alpha.tga
deleted file mode 100644
index a9a4ec0..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/freckles_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/glove_length_alpha.tga b/old/libsl1550/libsecondlife/Resources/glove_length_alpha.tga
deleted file mode 100644
index db89ad5..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/glove_length_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/gloves_fingers_alpha.tga b/old/libsl1550/libsecondlife/Resources/gloves_fingers_alpha.tga
deleted file mode 100644
index dba2eec..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/gloves_fingers_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/head_alpha.tga b/old/libsl1550/libsecondlife/Resources/head_alpha.tga
deleted file mode 100644
index 8164525..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/head_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/head_color.tga b/old/libsl1550/libsecondlife/Resources/head_color.tga
deleted file mode 100644
index 74b1b30..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/head_color.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/head_hair.tga b/old/libsl1550/libsecondlife/Resources/head_hair.tga
deleted file mode 100644
index 5321f35..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/head_hair.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/head_highlights_alpha.tga b/old/libsl1550/libsecondlife/Resources/head_highlights_alpha.tga
deleted file mode 100644
index 8dc5239..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/head_highlights_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/head_shading_alpha.tga b/old/libsl1550/libsecondlife/Resources/head_shading_alpha.tga
deleted file mode 100644
index e8ea490..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/head_shading_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/head_skingrain.tga b/old/libsl1550/libsecondlife/Resources/head_skingrain.tga
deleted file mode 100644
index b42dee0..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/head_skingrain.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/jacket_length_lower_alpha.tga b/old/libsl1550/libsecondlife/Resources/jacket_length_lower_alpha.tga
deleted file mode 100644
index 722bc19..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/jacket_length_lower_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/jacket_length_upper_alpha.tga b/old/libsl1550/libsecondlife/Resources/jacket_length_upper_alpha.tga
deleted file mode 100644
index e9db7e7..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/jacket_length_upper_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/jacket_open_lower_alpha.tga b/old/libsl1550/libsecondlife/Resources/jacket_open_lower_alpha.tga
deleted file mode 100644
index db0c2fb..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/jacket_open_lower_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/jacket_open_upper_alpha.tga b/old/libsl1550/libsecondlife/Resources/jacket_open_upper_alpha.tga
deleted file mode 100644
index 71b8a0b..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/jacket_open_upper_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/lipgloss_alpha.tga b/old/libsl1550/libsecondlife/Resources/lipgloss_alpha.tga
deleted file mode 100644
index 78ceeca..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/lipgloss_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/lips_mask.tga b/old/libsl1550/libsecondlife/Resources/lips_mask.tga
deleted file mode 100644
index ae1401c..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/lips_mask.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/lipstick_alpha.tga b/old/libsl1550/libsecondlife/Resources/lipstick_alpha.tga
deleted file mode 100644
index 2795f1b..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/lipstick_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/lowerbody_color.tga b/old/libsl1550/libsecondlife/Resources/lowerbody_color.tga
deleted file mode 100644
index a63aa12..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/lowerbody_color.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/lowerbody_highlights_alpha.tga b/old/libsl1550/libsecondlife/Resources/lowerbody_highlights_alpha.tga
deleted file mode 100644
index ae3413a..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/lowerbody_highlights_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/lowerbody_shading_alpha.tga b/old/libsl1550/libsecondlife/Resources/lowerbody_shading_alpha.tga
deleted file mode 100644
index 0242663..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/lowerbody_shading_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/nailpolish_alpha.tga b/old/libsl1550/libsecondlife/Resources/nailpolish_alpha.tga
deleted file mode 100644
index 91af762..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/nailpolish_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/pants_length_alpha.tga b/old/libsl1550/libsecondlife/Resources/pants_length_alpha.tga
deleted file mode 100644
index 3c4f21c..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/pants_length_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/pants_waist_alpha.tga b/old/libsl1550/libsecondlife/Resources/pants_waist_alpha.tga
deleted file mode 100644
index 35658c0..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/pants_waist_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/rosyface_alpha.tga b/old/libsl1550/libsecondlife/Resources/rosyface_alpha.tga
deleted file mode 100644
index a0c8513..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/rosyface_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/rouge_alpha.tga b/old/libsl1550/libsecondlife/Resources/rouge_alpha.tga
deleted file mode 100644
index a0c8513..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/rouge_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/shirt_bottom_alpha.tga b/old/libsl1550/libsecondlife/Resources/shirt_bottom_alpha.tga
deleted file mode 100644
index 7cce03d..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/shirt_bottom_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/shirt_collar_alpha.tga b/old/libsl1550/libsecondlife/Resources/shirt_collar_alpha.tga
deleted file mode 100644
index f55f635..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/shirt_collar_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/shirt_collar_back_alpha.tga b/old/libsl1550/libsecondlife/Resources/shirt_collar_back_alpha.tga
deleted file mode 100644
index 43a6453..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/shirt_collar_back_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/shirt_sleeve_alpha.tga b/old/libsl1550/libsecondlife/Resources/shirt_sleeve_alpha.tga
deleted file mode 100644
index e3b18f4..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/shirt_sleeve_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/shoe_height_alpha.tga b/old/libsl1550/libsecondlife/Resources/shoe_height_alpha.tga
deleted file mode 100644
index d08dd75..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/shoe_height_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/skirt_length_alpha.tga b/old/libsl1550/libsecondlife/Resources/skirt_length_alpha.tga
deleted file mode 100644
index c867994..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/skirt_length_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/skirt_slit_back_alpha.tga b/old/libsl1550/libsecondlife/Resources/skirt_slit_back_alpha.tga
deleted file mode 100644
index 0e49688..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/skirt_slit_back_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/skirt_slit_front_alpha.tga b/old/libsl1550/libsecondlife/Resources/skirt_slit_front_alpha.tga
deleted file mode 100644
index 888bbf7..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/skirt_slit_front_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/skirt_slit_left_alpha.tga b/old/libsl1550/libsecondlife/Resources/skirt_slit_left_alpha.tga
deleted file mode 100644
index 210feac..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/skirt_slit_left_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/skirt_slit_right_alpha.tga b/old/libsl1550/libsecondlife/Resources/skirt_slit_right_alpha.tga
deleted file mode 100644
index ce11c64..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/skirt_slit_right_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/underpants_trial_female.tga b/old/libsl1550/libsecondlife/Resources/underpants_trial_female.tga
deleted file mode 100644
index 96bf732..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/underpants_trial_female.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/underpants_trial_male.tga b/old/libsl1550/libsecondlife/Resources/underpants_trial_male.tga
deleted file mode 100644
index 095695c..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/underpants_trial_male.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/undershirt_trial_female.tga b/old/libsl1550/libsecondlife/Resources/undershirt_trial_female.tga
deleted file mode 100644
index e17a309..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/undershirt_trial_female.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/upperbody_color.tga b/old/libsl1550/libsecondlife/Resources/upperbody_color.tga
deleted file mode 100644
index 85fcc41..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/upperbody_color.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/upperbody_highlights_alpha.tga b/old/libsl1550/libsecondlife/Resources/upperbody_highlights_alpha.tga
deleted file mode 100644
index 2d8102b..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/upperbody_highlights_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/upperbody_shading_alpha.tga b/old/libsl1550/libsecondlife/Resources/upperbody_shading_alpha.tga
deleted file mode 100644
index b420506..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/upperbody_shading_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/Resources/upperbodyfreckles_alpha.tga b/old/libsl1550/libsecondlife/Resources/upperbodyfreckles_alpha.tga
deleted file mode 100644
index 76c7ce8..0000000
Binary files a/old/libsl1550/libsecondlife/Resources/upperbodyfreckles_alpha.tga and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/SafeDictionary.cs b/old/libsl1550/libsecondlife/SafeDictionary.cs
deleted file mode 100644
index 9770d78..0000000
--- a/old/libsl1550/libsecondlife/SafeDictionary.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-
-namespace libsecondlife
-{
-    public class SafeDictionary<TKey, TValue>
-    {
-        internal Dictionary<TKey, TValue> Dictionary;
-
-        public int Count { get { return Dictionary.Count; } }
-
-        public SafeDictionary()
-        {
-            Dictionary = new Dictionary<TKey, TValue>();
-        }
-
-        public SafeDictionary(IDictionary<TKey, TValue> dictionary)
-        {
-            Dictionary = new Dictionary<TKey, TValue>(dictionary);
-        }
-
-        public SafeDictionary(int capacity)
-        {
-            Dictionary = new Dictionary<TKey, TValue>(capacity);
-        }
-
-        public bool TryGetValue(TKey key, out TValue value)
-        {
-            return Dictionary.TryGetValue(key, out value);
-        }
-
-        public TValue Find(Predicate<TValue> match)
-        {
-            lock (Dictionary)
-            {
-                foreach (TValue value in Dictionary.Values)
-                {
-                    if (match(value))
-                        return value;
-                }
-            }
-            return default(TValue);
-        }
-
-        public List<TValue> FindAll(Predicate<TValue> match)
-        {
-            List<TValue> found = new List<TValue>();
-            lock (Dictionary)
-            {
-                foreach (KeyValuePair<TKey, TValue> kvp in Dictionary)
-                {
-                    if (match(kvp.Value))
-                        found.Add(kvp.Value);
-                }
-            }
-            return found;
-        }
-
-        public void ForEach(Action<TValue> action)
-        {
-            lock (Dictionary)
-            {
-                foreach (TValue value in Dictionary.Values)
-                {
-                    action(value);
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/SecondLife.cs b/old/libsl1550/libsecondlife/SecondLife.cs
deleted file mode 100644
index 92246be..0000000
--- a/old/libsl1550/libsecondlife/SecondLife.cs
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Main class to expose Second Life functionality to clients. All of the
-    /// classes needed for sending and receiving data are accessible through
-    /// this class.
-    /// </summary>
-    public class SecondLife
-    {
-        /// <summary>
-        /// Callback used for client apps to receive log messages from
-        /// libsecondlife
-        /// </summary>
-        /// <param name="message"></param>
-        /// <param name="level"></param>
-        public delegate void LogCallback(string message, Helpers.LogLevel level);
-
-
-        /// <summary>Networking subsystem</summary>
-        public NetworkManager Network;
-        /// <summary>Settings class including constant values and changeable
-        /// parameters for everything</summary>
-        public Settings Settings;
-        /// <summary>Parcel (subdivided simulator lots) subsystem</summary>
-        public ParcelManager Parcels;
-        /// <summary>Our own avatars subsystem</summary>
-        public AgentManager Self;
-        /// <summary>Other avatars subsystem</summary>
-        public AvatarManager Avatars;
-        /// <summary>Friends list subsystem</summary>
-        public FriendsManager Friends;
-        /// <summary>Grid (aka simulator group) subsystem</summary>
-        public GridManager Grid;
-        /// <summary>Object subsystem</summary>
-        public ObjectManager Objects;
-        /// <summary>Group subsystem</summary>
-        public GroupManager Groups;
-        /// <summary>Asset subsystem</summary>
-        public AssetManager Assets;
-        /// <summary>Appearance subsystem</summary>
-        public AppearanceManager Appearance;
-        /// <summary>Inventory subsystem</summary>
-        public InventoryManager Inventory;
-        /// <summary>Directory searches including classifieds, people, land
-        /// sales, etc</summary>
-        public DirectoryManager Directory;
-        /// <summary>Handles land, wind, and cloud heightmaps</summary>
-        public TerrainManager Terrain;
-        /// <summary>Handles sound-related networking</summary>
-        public SoundManager Sound;
-        /// <summary>Throttling total bandwidth usage, or allocating bandwidth
-        /// for specific data stream types</summary>
-        public AgentThrottle Throttle;
-
-
-        /// <summary>Triggered whenever a message is logged. If this is left
-        /// null, log messages will go to the console</summary>
-        public event LogCallback OnLogMessage;
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        public SecondLife()
-        {
-            // These are order-dependant
-            Network = new NetworkManager(this);
-            Settings = new Settings(this);
-            Parcels = new ParcelManager(this);
-            Self = new AgentManager(this);
-            Avatars = new AvatarManager(this);
-            Friends = new FriendsManager(this);
-            Grid = new GridManager(this);
-            Objects = new ObjectManager(this);
-            Groups = new GroupManager(this);
-            Assets = new AssetManager(this);
-            Appearance = new AppearanceManager(this, Assets);
-            Inventory = new InventoryManager(this);
-            Directory = new DirectoryManager(this);
-            Terrain = new TerrainManager(this);
-            Sound = new SoundManager(this);
-            Throttle = new AgentThrottle(this);
-        }
-
-        /// <summary>
-        /// Return the full name of this instance
-        /// </summary>
-        /// <returns>Client avatars full name</returns>
-        public override string ToString()
-        {
-            return Self.Name;
-        }
-
-        /// <summary>
-        /// Send a log message to the debugging output system
-        /// </summary>
-        /// <param name="message">The log message</param>
-        /// <param name="level">The severity of the log entry</param>
-        public void Log(string message, Helpers.LogLevel level)
-        {
-            if (level == Helpers.LogLevel.Debug && !Settings.DEBUG) return;
-
-            if (OnLogMessage != null)
-            {
-                try { OnLogMessage(message, level); }
-                catch (Exception e) { Console.WriteLine(e.ToString()); }
-            }
-            else
-            {
-                if (Settings.LOG_NAMES)
-                    Console.WriteLine("{0} [{1} {2}]: {3}", level.ToString().ToUpper(), Self.FirstName, Self.LastName, message);
-                else
-                    Console.WriteLine("{0}: {1}", level.ToString().ToUpper(), message);
-            }
-        }
-
-        /// <summary>
-        /// If the library is compiled with DEBUG defined, and SecondLife.Debug
-        /// is true, either an event will be fired for the debug message or
-        /// it will be written to the console
-        /// </summary>
-        /// <param name="message">The debug message</param>
-        [System.Diagnostics.Conditional("DEBUG")]
-        public void DebugLog(string message)
-        {
-            if (Settings.DEBUG)
-            {
-                if (OnLogMessage != null)
-                {
-                    try { OnLogMessage(message, Helpers.LogLevel.Debug); }
-                    catch (Exception e) { Console.WriteLine(e.ToString()); }
-                }
-                else
-                {
-                    if (Settings.LOG_NAMES)
-                        Console.WriteLine("DEBUG [{0} {1}]: {2}", Self.FirstName, Self.LastName, message);
-                    else
-                        Console.WriteLine("DEBUG: {0}", message);
-                }
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="message"></param>
-        /// <param name="level"></param>
-        public static void LogStatic(string message, Helpers.LogLevel level)
-        {
-            Console.WriteLine("{0}: {1}", level.ToString().ToUpper(), message);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="message"></param>
-        /// <param name="level"></param>
-        /// <param name="exception"></param>
-        public static void LogStatic(string message, Helpers.LogLevel level, Exception exception)
-        {
-            Console.WriteLine("{0} [libsecondlife]: {1} ({2})", level.ToString().ToUpper(), message, exception);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="message"></param>
-        [System.Diagnostics.Conditional("DEBUG")]
-        public static void DebugLogStatic(string message)
-        {
-            Console.WriteLine("DEBUG [libsecondlife]: {0}", message);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Settings.cs b/old/libsl1550/libsecondlife/Settings.cs
deleted file mode 100644
index c94fd95..0000000
--- a/old/libsl1550/libsecondlife/Settings.cs
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// Class for controlling various system settings.
-    /// </summary>
-    /// <remarks>Some values are readonly because they affect things that
-    /// happen when the SecondLife object is initialized, so changing them at
-    /// runtime won't do any good. Non-readonly values may affect things that
-    /// happen at login or dynamically</remarks>
-    public class Settings
-    {
-        /// <summary>Main grid login server</summary>
-        public const string AGNI_LOGIN_SERVER = "https://login.agni.lindenlab.com/cgi-bin/login.cgi";
-        /// <summary>Beta grid login server</summary>
-        public const string ADITI_LOGIN_SERVER = "https://login.aditi.lindenlab.com/cgi-bin/login-llsd.cgi";
-        /// <summary>The relative directory where external resources are kept</summary>
-        public const string RESOURCE_DIR = "libsl_data";
-
-        /// <summary>Login server to connect to</summary>
-        public string LOGIN_SERVER = AGNI_LOGIN_SERVER;
-
-	    // Timeouts and Intervals
-
-        /// <summary>Number of milliseconds before an asset transfer will time
-        /// out</summary>
-        public const int TRANSFER_TIMEOUT = 30 * 1000;
-        /// <summary>Number of milliseconds before a teleport attempt will time
-        /// out</summary>
-        public int TELEPORT_TIMEOUT = 40 * 1000;
-        /// <summary>Number of milliseconds before NetworkManager.Logout() will
-        /// time out</summary>
-        public int LOGOUT_TIMEOUT = 5 * 1000;
-        /// <summary>Number of milliseconds before a CAPS call will time out
-        /// and try again</summary>
-        /// <remarks>Setting this too low will cause web requests to repeatedly
-        /// time out and retry</remarks>
-        public int CAPS_TIMEOUT = 60 * 1000;
-        /// <summary>Number of milliseconds for xml-rpc to timeout</summary>
-        public int LOGIN_TIMEOUT = 60 * 1000;
-        /// <summary>Milliseconds before a packet is assumed lost and resent</summary>
-        public int RESEND_TIMEOUT = 4000;
-        /// <summary>Milliseconds without receiving a packet before the
-        /// connection to a simulator is assumed lost</summary>
-        public int SIMULATOR_TIMEOUT = 30 * 1000;
-        /// <summary>Milliseconds to wait for a simulator info request through
-        /// the grid interface</summary>
-        public int MAP_REQUEST_TIMEOUT = 5 * 1000;
-
-        /// <summary>Number of milliseconds between sending pings to each sim</summary>
-        public const int PING_INTERVAL = 2200;
-        /// <summary>Number of milliseconds between sending camera updates</summary>
-        public const int DEFAULT_AGENT_UPDATE_INTERVAL = 500;
-        /// <summary>Number of milliseconds between updating the current
-        /// positions of moving, non-accelerating and non-colliding objects</summary>
-        public const int INTERPOLATION_INTERVAL = 250;
-        /// <summary>Millisecond interval between ticks, where all ACKs are
-        /// sent out and the age of unACKed packets is checked</summary>
-        public const int NETWORK_TICK_INTERVAL = 500;
-
-	    // Sizes
-
-        /// <summary>The initial size of the packet inbox, where packets are
-        /// stored before processing</summary>
-        public const int PACKET_INBOX_SIZE = 100;
-        /// <summary>Maximum size of packet that we want to send over the wire</summary>
-        public const int MAX_PACKET_SIZE = 1200;
-        /// <summary>The maximum value of a packet sequence number before it
-        /// rolls over back to one</summary>
-        public const int MAX_SEQUENCE = 0xFFFFFF;
-        /// <summary>The maximum size of the sequence number archive, used to
-        /// check for resent and/or duplicate packets</summary>
-        public const int PACKET_ARCHIVE_SIZE = 200;
-        /// <summary>Maximum number of queued ACKs to be sent before SendAcks()
-        /// is forced</summary>
-        public int MAX_PENDING_ACKS = 10;
-        /// <summary>Maximum number of ACKs to append to a packet</summary>
-        public int MAX_APPENDED_ACKS = 10;
-        /// <summary>Network stats queue length (seconds)</summary>
-        public int STATS_QUEUE_SIZE = 5;
-
-	    // Configuration options (mostly booleans)
-
-        /// <summary>Enable to process packets synchronously, where all of the
-        /// callbacks for each packet must return before the next packet is
-        /// processed</summary>
-        /// <remarks>This is an experimental feature and is not completely
-        /// reliable yet. Ideally it would reduce context switches and thread
-        /// overhead, but several calls currently block for a long time and
-        /// would need to be rewritten as asynchronous code before this is
-        /// feasible</remarks>
-        public bool SYNC_PACKETCALLBACKS = false;
-        /// <summary>Enable/disable debugging log messages</summary>
-        public bool DEBUG = true;
-        /// <summary>Attach avatar names to log messages</summary>
-        public bool LOG_NAMES = true;
-	    /// <summary>Log packet retransmission info</summary>
-	    public bool LOG_RESENDS = true;
-        /// <summary>Enable/disable storing terrain heightmaps in the
-        /// TerrainManager</summary>
-        public bool STORE_LAND_PATCHES = false;
-        /// <summary>Enable/disable sending periodic camera updates</summary>
-        public bool SEND_AGENT_UPDATES = true;
-        /// <summary>Enable/disable libsecondlife automatically setting the
-        /// bandwidth throttle after connecting to each simulator</summary>
-        /// <remarks>The default libsecondlife throttle uses the equivalent of
-        /// the maximum bandwidth setting in the official client. If you do not
-        /// set a throttle your connection will by default be throttled well
-        /// below the minimum values and you may experience connection problems</remarks>
-        public bool SEND_AGENT_THROTTLE = true;
-        /// <summary>Enable/disable the sending of pings to monitor lag and
-        /// packet loss</summary>
-        public bool SEND_PINGS = false;
-        /// <summary>Should we connect to multiple sims? This will allow
-        /// viewing in to neighboring simulators and sim crossings
-        /// (Experimental)</summary>
-        public bool MULTIPLE_SIMS = true;
-        /// <summary>If true, all object update packets will be decoded in to
-        /// native objects. If false, only updates for our own agent will be
-        /// decoded. Registering an event handler will force objects for that
-        /// type to always be decoded. If this is disabled the object tracking
-        /// will have missing or partial prim and avatar information</summary>
-        public bool ALWAYS_DECODE_OBJECTS = true;
-        /// <summary>If true, when a cached object check is received from the
-        /// server the full object info will automatically be requested</summary>
-        public bool ALWAYS_REQUEST_OBJECTS = false;
-        /// <summary>Whether to establish connections to HTTP capabilities
-        /// servers for simulators</summary>
-        public bool ENABLE_CAPS = true;
-	    /// <summary>Whether to decode sim stats</summary>
-	    public bool ENABLE_SIMSTATS = true;
-        /// <summary>The capabilities servers are currently designed to
-        /// periodically return a 502 error which signals for the client to
-        /// re-establish a connection. Set this to true to log those 502 errors</summary>
-        public bool LOG_ALL_CAPS_ERRORS = false;
-        /// <summary>If true, any reference received for a folder or item
-        /// libsecondlife is not aware of will automatically be fetched.</summary>
-        public bool FETCH_MISSING_INVENTORY = true;
-        /// <summary>If true, and <code>SEND_AGENT_UPDATES</code> is true,
-        /// AgentUpdate packets will continuously be sent out to give the bot
-        /// smoother movement and autopiloting</summary>
-        public bool CONTINUOUS_AGENT_UPDATES = true;
-        /// <summary>If true, currently visible primitives and avatars will be
-        /// stored in dictionaries inside <code>Simulator.Objects</code>. If
-        /// false, a new Avatar or Primitive object will be created each time
-        /// an object update packet is received</summary>
-        public bool OBJECT_TRACKING = true;
-        /// <summary>If true, parcel details will be stored in the
-        /// <code>Simulator.Parcels</code> dictionary as they are received</summary>
-        public bool PARCEL_TRACKING = true;
-
-        // Misc
-
-        /// <summary>Default color used for viewer particle effects</summary>
-        public LLColor DEFAULT_EFFECT_COLOR = new LLColor(255, 0, 0, 255);
-
-        /// <summary>Cost of uploading an asset</summary>
-        /// <remarks>Read-only since this value is dynamically fetched at login</remarks>
-        public int UPLOAD_COST { get { return priceUpload; } }
-
-        private SecondLife Client;
-        private int priceUpload = 0;
-
-        /// <summary>Constructor</summary>
-        /// <param name="client">Reference to a SecondLife client object</param>
-        public Settings(SecondLife client)
-        {
-            Client = client;
-            Client.Network.RegisterCallback(Packets.PacketType.EconomyData, new NetworkManager.PacketCallback(EconomyDataHandler));
-        }
-
-        /// <summary>
-        /// Gets the cost of uploading an asset to the grid
-        /// </summary>
-        /// <param name="packet"></param>
-        /// <param name="simulator"></param>
-        private void EconomyDataHandler(Packet packet, Simulator simulator)
-        {
-            EconomyDataPacket econ = (EconomyDataPacket)packet;
-
-            priceUpload = econ.Info.PriceUpload;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Simulator.cs b/old/libsl1550/libsecondlife/Simulator.cs
deleted file mode 100644
index 5b6dc1f..0000000
--- a/old/libsl1550/libsecondlife/Simulator.cs
+++ /dev/null
@@ -1,934 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Net;
-using System.Net.Sockets;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    /// <summary>
-    ///
-    /// </summary>
-    public class Simulator : UDPBase, IDisposable
-    {
-        #region Enums
-
-        /// <summary>
-        /// Simulator (region) properties
-        /// </summary>
-        [Flags]
-        public enum RegionFlags
-        {
-            /// <summary>No flags set</summary>
-            None = 0,
-            /// <summary>Agents can take damage and be killed</summary>
-            AllowDamage = 1 << 0,
-            /// <summary>Landmarks can be created here</summary>
-            AllowLandmark = 1 << 1,
-            /// <summary>Home position can be set in this sim</summary>
-            AllowSetHome = 1 << 2,
-            /// <summary>Home position is reset when an agent teleports away</summary>
-            ResetHomeOnTeleport = 1 << 3,
-            /// <summary>Sun does not move</summary>
-            SunFixed = 1 << 4,
-            /// <summary>No object, land, etc. taxes</summary>
-            TaxFree = 1 << 5,
-            /// <summary>Disable heightmap alterations (agents can still plant
-            /// foliage)</summary>
-            BlockTerraform = 1 << 6,
-            /// <summary>Land cannot be released, sold, or purchased</summary>
-            BlockLandResell = 1 << 7,
-            /// <summary>All content is wiped nightly</summary>
-            Sandbox = 1 << 8,
-            /// <summary></summary>
-            NullLayer = 1 << 9,
-            /// <summary></summary>
-            SkipAgentAction = 1 << 10,
-            /// <summary></summary>
-            SkipUpdateInterestList = 1 << 11,
-            /// <summary>No collision detection for non-agent objects</summary>
-            SkipCollisions = 1 << 12,
-            /// <summary>No scripts are ran</summary>
-            SkipScripts = 1 << 13,
-            /// <summary>All physics processing is turned off</summary>
-            SkipPhysics = 1 << 14,
-            /// <summary></summary>
-            ExternallyVisible = 1 << 15,
-            /// <summary></summary>
-            MainlandVisible = 1 << 16,
-            /// <summary></summary>
-            PublicAllowed = 1 << 17,
-            /// <summary></summary>
-            BlockDwell = 1 << 18,
-            /// <summary>Flight is disabled (not currently enforced by the sim)</summary>
-            NoFly = 1 << 19,
-            /// <summary>Allow direct (p2p) teleporting</summary>
-            AllowDirectTeleport = 1 << 20,
-            /// <summary>Estate owner has temporarily disabled scripting</summary>
-            EstateSkipScripts = 1 << 21,
-            /// <summary></summary>
-            RestrictPushObject = 1 << 22,
-            /// <summary>Deny agents with no payment info on file</summary>
-            DenyAnonymous = 1 << 23,
-            /// <summary>Deny agents with payment info on file</summary>
-            DenyIdentified = 1 << 24,
-            /// <summary>Deny agents who have made a monetary transaction</summary>
-            DenyTransacted = 1 << 25,
-            /// <summary></summary>
-            AllowParcelChanges = 1 << 26,
-            /// <summary></summary>
-            AbuseEmailToEstateOwner = 1 << 27,
-            /// <summary>Region is Voice Enabled</summary>
-            AllowVoice = 1 << 28
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public enum SimAccess : byte
-        {
-            /// <summary></summary>
-            Min = 0,
-            /// <summary></summary>
-            Trial = 7,
-            /// <summary></summary>
-            PG = 13,
-            /// <summary></summary>
-            Mature = 21,
-            /// <summary></summary>
-            Down = 254,
-            /// <summary></summary>
-            NonExistent = 255
-        }
-
-        #endregion Enums
-
-        #region Structs
-
-        public struct SimStats
-        {
-            /// <summary></summary>
-            public ulong SentPackets;
-            /// <summary></summary>
-            public ulong RecvPackets;
-            /// <summary></summary>
-            public ulong SentBytes;
-            /// <summary></summary>
-            public ulong RecvBytes;
-            /// <summary></summary>
-            public int ConnectTime;
-            /// <summary></summary>
-            public int ResentPackets;
-            /// <summary></summary>
-            public int ReceivedResends;
-            /// <summary></summary>
-            public int SentPings;
-            /// <summary></summary>
-            public int ReceivedPongs;
-            /// <summary>
-            /// Incoming bytes per second
-            /// </summary>
-            /// <remarks>It would be nice to have this claculated on the fly, but
-            /// this is far, far easier</remarks>
-            public int IncomingBPS;
-            /// <summary>
-            /// Outgoing bytes per second
-            /// </summary>
-            /// <remarks>It would be nice to have this claculated on the fly, but
-            /// this is far, far easier</remarks>
-            public int OutgoingBPS;
-            /// <summary></summary>
-            public int LastPingSent;
-            /// <summary></summary>
-            public byte LastPingID;
-            /// <summary></summary>
-            public int LastLag;
-            /// <summary></summary>
-            public int MissedPings;
-            /// <summary>Current time dilation of this simulator</summary>
-            public float Dilation;
-            public int FPS;
-            public float PhysicsFPS;
-            public float AgentUpdates;
-            public float FrameTime;
-            public float NetTime;
-            public float PhysicsTime;
-            public float ImageTime;
-            public float ScriptTime;
-            public float OtherTime;
-            public int Objects;
-            public int ScriptedObjects;
-            public int Agents;
-            public int ChildAgents;
-            public int ActiveScripts;
-            public int LSLIPS;
-            public int INPPS;
-            public int OUTPPS;
-            public int PendingDownloads;
-            public int PendingUploads;
-            public int VirtualSize;
-            public int ResidentSize;
-            public int PendingLocalUploads;
-            public int UnackedBytes;
-        }
-
-        #endregion Structs
-
-        #region Public Members
-
-        /// <summary>A public reference to the client that this Simulator object
-        /// is attached to</summary>
-        public SecondLife Client;
-        /// <summary></summary>
-        public LLUUID ID = LLUUID.Zero;
-        /// <summary>The capabilities for this simulator</summary>
-        public Caps Caps = null;
-        /// <summary></summary>
-        public ulong Handle;
-        /// <summary></summary>
-        public string Name = String.Empty;
-        /// <summary></summary>
-        public byte[] ParcelOverlay = new byte[4096];
-        /// <summary></summary>
-        public int ParcelOverlaysReceived;
-        /// <summary></summary>
-        public float TerrainHeightRange00;
-        /// <summary></summary>
-        public float TerrainHeightRange01;
-        /// <summary></summary>
-        public float TerrainHeightRange10;
-        /// <summary></summary>
-        public float TerrainHeightRange11;
-        /// <summary></summary>
-        public float TerrainStartHeight00;
-        /// <summary></summary>
-        public float TerrainStartHeight01;
-        /// <summary></summary>
-        public float TerrainStartHeight10;
-        /// <summary></summary>
-        public float TerrainStartHeight11;
-        /// <summary></summary>
-        public float WaterHeight;
-        /// <summary></summary>
-        public LLUUID SimOwner = LLUUID.Zero;
-        /// <summary></summary>
-        public LLUUID TerrainBase0 = LLUUID.Zero;
-        /// <summary></summary>
-        public LLUUID TerrainBase1 = LLUUID.Zero;
-        /// <summary></summary>
-        public LLUUID TerrainBase2 = LLUUID.Zero;
-        /// <summary></summary>
-        public LLUUID TerrainBase3 = LLUUID.Zero;
-        /// <summary></summary>
-        public LLUUID TerrainDetail0 = LLUUID.Zero;
-        /// <summary></summary>
-        public LLUUID TerrainDetail1 = LLUUID.Zero;
-        /// <summary></summary>
-        public LLUUID TerrainDetail2 = LLUUID.Zero;
-        /// <summary></summary>
-        public LLUUID TerrainDetail3 = LLUUID.Zero;
-        /// <summary></summary>
-        public bool IsEstateManager;
-        /// <summary></summary>
-        public EstateTools Estate;
-        /// <summary></summary>
-        public RegionFlags Flags;
-        /// <summary></summary>
-        public SimAccess Access;
-        /// <summary></summary>
-        public float BillableFactor;
-        /// <summary>Statistics information for this simulator and the
-        /// connection to the simulator, calculated by the simulator itself
-        /// and libsecondlife</summary>
-        public SimStats Stats;
-
-        /// <summary>Provides access to two thread-safe dictionaries containing
-        /// avatars and primitives found in this simulator</summary>
-        public ObjectTracker Objects = new ObjectTracker();
-
-        /// <summary>Used to obtain a lock on the sequence number for packets
-        /// sent to this simulator. Only useful for applications manipulating
-        /// sequence numbers</summary>
-        public object SequenceLock = new object();
-        /// <summary>The current sequence number for packets sent to this
-        /// simulator. Must be locked with SequenceLock before modifying. Only
-        /// useful for applications manipulating sequence numbers</summary>
-        public volatile uint Sequence;
-
-        /// <summary>
-        /// Provides access to an internal thread-safe dictionary containing parcel
-        /// information found in this simulator
-        /// </summary>
-        public SafeDictionary<int, Parcel> Parcels = new SafeDictionary<int, Parcel>();
-
-        /// <summary>
-        /// Provides access to an internal thread-safe multidimensional array containing a x,y grid mapped
-        /// each 64x64 parcel's LocalID.
-        /// </summary>
-        public int[,] ParcelMap
-        {
-            get {
-                lock (this)
-                    return _ParcelMap;
-            }
-            set { lock (this)
-                _ParcelMap = value;
-            }
-        }
-
-        /// <summary>
-        /// Checks simulator parcel map to make sure its downloaded all data successfully
-        /// </summary>
-        /// <param name="sim"></param>
-        /// <returns></returns>
-        public bool IsParcelMapFull()
-        {
-            int i = 0;
-            int j = 0;
-
-            while (i < this.ParcelMap.GetLength(0))
-            {
-                while (j < this.ParcelMap.GetLength(1))
-                {
-                    if (this.ParcelMap[i, j] == 0)
-                        return false;
-
-                    j++;
-                }
-
-                i++;
-            }
-
-            return true;
-        }
-
-        #endregion Public Members
-
-        #region Properties
-
-        /// <summary>The IP address and port of the server</summary>
-        public IPEndPoint IPEndPoint { get { return ipEndPoint; } }
-        /// <summary>Whether there is a working connection to the simulator or
-        /// not</summary>
-        public bool Connected { get { return connected; } }
-        /// <summary>Coarse locations of avatars in this simulator</summary>
-        public List<LLVector3> AvatarPositions { get { return avatarPositions; } }
-        /// <summary>AvatarPositions index representing your avatar</summary>
-        public int PositionIndexYou { get { return positionIndexYou; } }
-        /// <summary>AvatarPositions index representing TrackAgent target</summary>
-        public int PositionIndexPrey { get { return positionIndexPrey; } }
-
-        #endregion Properties
-
-        #region Internal/Private Members
-        /// <summary>Used internally to track sim disconnections</summary>
-        internal bool DisconnectCandidate = false;
-        /// <summary>Event that is triggered when the simulator successfully
-        /// establishes a connection</summary>
-        internal AutoResetEvent ConnectedEvent = new AutoResetEvent(false);
-        /// <summary>Whether this sim is currently connected or not. Hooked up
-        /// to the property Connected</summary>
-        internal bool connected;
-        /// <summary>Coarse locations of avatars in this simulator</summary>
-        internal List<LLVector3> avatarPositions = new List<LLVector3>();
-        /// <summary>AvatarPositions index representing your avatar</summary>
-        internal int positionIndexYou = -1;
-        /// <summary>AvatarPositions index representing TrackAgent target</summary>
-        internal int positionIndexPrey = -1;
-        /// <summary>Sequence numbers of packets we've received
-        /// (for duplicate checking)</summary>
-        internal Queue<uint> PacketArchive;
-        /// <summary>Packets we sent out that need ACKs from the simulator</summary>
-        internal Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>();
-
-        private NetworkManager Network;
-        private Queue<ulong> InBytes, OutBytes;
-        // ACKs that are queued up to be sent to the simulator
-        private SortedList<uint, uint> PendingAcks = new SortedList<uint, uint>();
-        private IPEndPoint ipEndPoint;
-        private Timer AckTimer;
-        private Timer PingTimer;
-        private Timer StatsTimer;
-        // simulator <> parcel LocalID Map
-        private int[,] _ParcelMap = new int[64, 64];
-        #endregion Internal/Private Members
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="client">Reference to the SecondLife client</param>
-        /// <param name="port"></param>
-        public Simulator(SecondLife client, IPEndPoint address, ulong handle)
-            : base(address)
-        {
-            Client = client;
-
-            ipEndPoint = address;
-            Handle = handle;
-            Estate = new EstateTools(Client);
-            Network = Client.Network;
-            PacketArchive = new Queue<uint>(Settings.PACKET_ARCHIVE_SIZE);
-            InBytes = new Queue<ulong>(Client.Settings.STATS_QUEUE_SIZE);
-            OutBytes = new Queue<ulong>(Client.Settings.STATS_QUEUE_SIZE);
-        }
-
-        /// <summary>
-        /// Called when this Simulator object is being destroyed
-        /// </summary>
-        public void Dispose()
-        {
-            // Force all the CAPS connections closed for this simulator
-            if (Caps != null)
-            {
-                Caps.Disconnect(true);
-            }
-        }
-
-        /// <summary>
-        /// Attempt to connect to this simulator
-        /// </summary>
-        /// <param name="moveToSim">Whether to move our agent in to this sim or not</param>
-        /// <returns>True if the connection succeeded or connection status is
-        /// unknown, false if there was a failure</returns>
-        public bool Connect(bool moveToSim)
-        {
-            if (connected)
-            {
-                Client.Self.CompleteAgentMovement(this);
-                return true;
-            }
-
-            #region Start Timers
-
-            // Destroy the timers
-            if (AckTimer != null) AckTimer.Dispose();
-            if (StatsTimer != null) StatsTimer.Dispose();
-            if (PingTimer != null) PingTimer.Dispose();
-
-            // Timer for sending out queued packet acknowledgements
-            AckTimer = new Timer(new TimerCallback(AckTimer_Elapsed), null, Settings.NETWORK_TICK_INTERVAL,
-                Settings.NETWORK_TICK_INTERVAL);
-            // Timer for recording simulator connection statistics
-            StatsTimer = new Timer(new TimerCallback(StatsTimer_Elapsed), null, 1000, 1000);
-            // Timer for periodically pinging the simulator
-            if (Client.Settings.SEND_PINGS)
-                PingTimer = new Timer(new TimerCallback(PingTimer_Elapsed), null, Settings.PING_INTERVAL,
-                    Settings.PING_INTERVAL);
-
-            #endregion Start Timers
-
-            Client.Log("Connecting to " + this.ToString(), Helpers.LogLevel.Info);
-
-            try
-            {
-                // Create the UDP connection
-                Start();
-
-                // Mark ourselves as connected before firing everything else up
-                connected = true;
-
-                // Send the UseCircuitCode packet to initiate the connection
-                UseCircuitCodePacket use = new UseCircuitCodePacket();
-                use.CircuitCode.Code = Network.CircuitCode;
-                use.CircuitCode.ID = Client.Self.AgentID;
-                use.CircuitCode.SessionID = Client.Self.SessionID;
-
-                // Send the initial packet out
-                SendPacket(use, true);
-
-                Stats.ConnectTime = Environment.TickCount;
-
-                // Move our agent in to the sim to complete the connection
-                if (moveToSim) Client.Self.CompleteAgentMovement(this);
-
-                if (Client.Settings.SEND_AGENT_UPDATES)
-                    Client.Self.Movement.SendUpdate(true, this);
-
-                if (!ConnectedEvent.WaitOne(Client.Settings.SIMULATOR_TIMEOUT, false))
-                {
-                    Client.Log("Giving up on waiting for RegionHandshake for " + this.ToString(),
-                        Helpers.LogLevel.Warning);
-                }
-
-                return true;
-            }
-            catch (Exception e)
-            {
-                Client.Log(e.ToString(), Helpers.LogLevel.Error);
-            }
-
-            return false;
-        }
-
-        public void SetSeedCaps(string seedcaps)
-        {
-            if (Caps != null)
-            {
-                if (Caps._SeedCapsURI == seedcaps) return;
-
-                Client.Log("Unexpected change of seed capability", Helpers.LogLevel.Warning);
-                Caps.Disconnect(true);
-                Caps = null;
-            }
-
-            if (Client.Settings.ENABLE_CAPS)
-            {
-                // Connect to the new CAPS system
-                if (!String.IsNullOrEmpty(seedcaps))
-                    Caps = new Caps(this, seedcaps);
-                else
-                    Client.Log("Setting up a sim without a valid capabilities server!", Helpers.LogLevel.Error);
-            }
-
-        }
-
-        /// <summary>
-        /// Disconnect from this simulator
-        /// </summary>
-        public void Disconnect(bool sendCloseCircuit)
-        {
-            if (connected)
-            {
-                connected = false;
-
-                // Destroy the timers
-                if (AckTimer != null) AckTimer.Dispose();
-                if (StatsTimer != null) StatsTimer.Dispose();
-                if (PingTimer != null) PingTimer.Dispose();
-
-                // Kill the current CAPS system
-                if (Caps != null)
-                {
-                    Caps.Disconnect(true);
-                    Caps = null;
-                }
-
-                if (sendCloseCircuit)
-                {
-                    // Try to send the CloseCircuit notice
-                    CloseCircuitPacket close = new CloseCircuitPacket();
-                    UDPPacketBuffer buf = new UDPPacketBuffer(ipEndPoint, false);
-                    buf.Data = close.ToBytes();
-                    buf.DataLength = buf.Data.Length;
-
-                    AsyncBeginSend(buf);
-                }
-
-                // Shut the socket communication down
-                Stop();
-            }
-        }
-
-        /// <summary>
-        /// Sends a packet
-        /// </summary>
-        /// <param name="packet">Packet to be sent</param>
-        /// <param name="incrementSequence">Increment sequence number?</param>
-        public void SendPacket(Packet packet, bool incrementSequence)
-        {
-            byte[] buffer;
-            int bytes;
-
-            // Keep track of when this packet was sent out
-            packet.TickCount = Environment.TickCount;
-
-            if (incrementSequence)
-            {
-                // Set the sequence number
-                lock (SequenceLock)
-                {
-                    if (Sequence > Settings.MAX_SEQUENCE)
-                        Sequence = 1;
-                    else
-                        Sequence++;
-
-                    packet.Header.Sequence = Sequence;
-                }
-
-                // Scrub any appended ACKs since all of the ACK handling is done here
-                if (packet.Header.AckList.Length > 0)
-                    packet.Header.AckList = new uint[0];
-                packet.Header.AppendedAcks = false;
-
-                if (packet.Header.Reliable)
-                {
-                    lock (NeedAck)
-                    {
-                        if (!NeedAck.ContainsKey(packet.Header.Sequence))
-                            NeedAck.Add(packet.Header.Sequence, packet);
-                        else
-                            Client.Log("Attempted to add a duplicate sequence number (" +
-                                packet.Header.Sequence + ") to the NeedAck dictionary for packet type " +
-                                packet.Type.ToString(), Helpers.LogLevel.Warning);
-                    }
-
-                    // Don't append ACKs to resent packets, in case that's what was causing the
-                    // delivery to fail
-                    if (!packet.Header.Resent)
-                    {
-                        // Append any ACKs that need to be sent out to this packet
-                        lock (PendingAcks)
-                        {
-                            if (PendingAcks.Count > 0 && PendingAcks.Count < Client.Settings.MAX_APPENDED_ACKS &&
-                                packet.Type != PacketType.PacketAck &&
-                                packet.Type != PacketType.LogoutRequest)
-                            {
-                                packet.Header.AckList = new uint[PendingAcks.Count];
-
-                                for (int i = 0; i < PendingAcks.Count; i++)
-                                    packet.Header.AckList[i] = PendingAcks.Values[i];
-
-                                PendingAcks.Clear();
-                                packet.Header.AppendedAcks = true;
-                            }
-                        }
-                    }
-                }
-            }
-
-            // Serialize the packet
-            buffer = packet.ToBytes();
-            bytes = buffer.Length;
-            Stats.SentBytes += (ulong)bytes;
-            Stats.SentPackets++;
-
-            UDPPacketBuffer buf;
-
-            // Zerocode if needed
-            if (packet.Header.Zerocoded)
-            {
-                buf = new UDPPacketBuffer(ipEndPoint, true, false);
-
-                bytes = Helpers.ZeroEncode(buffer, bytes, buf.Data);
-                buf.DataLength = bytes;
-            }
-            else
-            {
-                buf = new UDPPacketBuffer(ipEndPoint, false, false);
-
-                buf.Data = buffer;
-                buf.DataLength = bytes;
-            }
-
-            AsyncBeginSend(buf);
-        }
-
-        /// <summary>
-        /// Send a raw byte array payload as a packet
-        /// </summary>
-        /// <param name="payload">The packet payload</param>
-        /// <param name="setSequence">Whether the second, third, and fourth bytes
-        /// should be modified to the current stream sequence number</param>
-        public void SendPacket(byte[] payload, bool setSequence)
-        {
-            try
-            {
-                if (setSequence && payload.Length > 3)
-                {
-                    lock (SequenceLock)
-                    {
-                        payload[1] = (byte)(Sequence >> 16);
-                        payload[2] = (byte)(Sequence >> 8);
-                        payload[3] = (byte)(Sequence % 256);
-                        Sequence++;
-                    }
-                }
-
-                Stats.SentBytes += (ulong)payload.Length;
-                Stats.SentPackets++;
-
-                UDPPacketBuffer buf = new UDPPacketBuffer(ipEndPoint, false);
-                buf.Data = payload;
-                buf.DataLength = payload.Length;
-
-                AsyncBeginSend(buf);
-            }
-            catch (SocketException)
-            {
-                Client.Log("Tried to send a " + payload.Length +
-                    " byte payload on a closed socket, shutting down " + this.ToString(),
-                    Helpers.LogLevel.Info);
-
-                Network.DisconnectSim(this, false);
-                return;
-            }
-            catch (Exception e)
-            {
-                Client.Log(e.ToString(), Helpers.LogLevel.Error);
-            }
-        }
-
-        /// <summary>
-        /// Send a prepared <code>UDPPacketBuffer</code> object as a packet
-        /// </summary>
-        /// <param name="buffer">The prepared packet structure to be sent out</param>
-        public void SendPacket(UDPPacketBuffer buffer)
-        {
-            try { AsyncBeginSend(buffer); }
-            catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void SendPing()
-        {
-            StartPingCheckPacket ping = new StartPingCheckPacket();
-            ping.PingID.PingID = Stats.LastPingID++;
-            ping.PingID.OldestUnacked = 0; // FIXME
-            ping.Header.Reliable = false;
-            SendPacket(ping, true);
-            Stats.LastPingSent = Environment.TickCount;
-        }
-
-        /// <summary>
-        /// Returns Simulator Name as a String
-        /// </summary>
-        /// <returns></returns>
-        public override string ToString()
-        {
-            if (!String.IsNullOrEmpty(Name))
-                return String.Format("{0} ({1})", Name, ipEndPoint);
-            else
-                return String.Format("({0})", ipEndPoint);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override int GetHashCode()
-        {
-            return Handle.GetHashCode();
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-        public override bool Equals(object obj)
-        {
-            Simulator sim = obj as Simulator;
-            if (sim == null)
-                return false;
-            return (ipEndPoint.Equals(sim.ipEndPoint));
-        }
-
-        public static bool operator ==(Simulator lhs, Simulator rhs)
-        {
-            // If both are null, or both are same instance, return true
-            if (System.Object.ReferenceEquals(lhs, rhs))
-            {
-                return true;
-            }
-
-            // If one is null, but not both, return false.
-            if (((object)lhs == null) || ((object)rhs == null))
-            {
-                return false;
-            }
-
-            return lhs.ipEndPoint.Equals(rhs.ipEndPoint);
-        }
-
-        public static bool operator !=(Simulator lhs, Simulator rhs)
-        {
-            return !(lhs == rhs);
-        }
-
-        protected override void PacketReceived(UDPPacketBuffer buffer)
-        {
-            Packet packet = null;
-
-            // Check if this packet came from the server we expected it to come from
-            if (!ipEndPoint.Address.Equals(((IPEndPoint)buffer.RemoteEndPoint).Address))
-            {
-                Client.Log("Received " + buffer.DataLength + " bytes of data from unrecognized source " +
-                    ((IPEndPoint)buffer.RemoteEndPoint).ToString(), Helpers.LogLevel.Warning);
-                return;
-            }
-
-            // Update the disconnect flag so this sim doesn't time out
-            DisconnectCandidate = false;
-
-            #region Packet Decoding
-
-            int packetEnd = buffer.DataLength - 1;
-            packet = Packet.BuildPacket(buffer.Data, ref packetEnd, buffer.ZeroData);
-
-            // Fail-safe check
-            if (packet == null)
-            {
-                Client.Log("Couldn't build a message from the incoming data", Helpers.LogLevel.Warning);
-                return;
-            }
-
-            Stats.RecvBytes += (ulong)buffer.DataLength;
-            Stats.RecvPackets++;
-
-            #endregion Packet Decoding
-
-            #region Reliable Handling
-
-            if (packet.Header.Reliable)
-            {
-                // Add this packet to the list of ACKs that need to be sent out
-                lock (PendingAcks)
-                {
-                    uint sequence = (uint)packet.Header.Sequence;
-                    if (!PendingAcks.ContainsKey(sequence)) PendingAcks[sequence] = sequence;
-                }
-
-                // Send out ACKs if we have a lot of them
-                if (PendingAcks.Count >= Client.Settings.MAX_PENDING_ACKS)
-                    SendAcks();
-
-                if (packet.Header.Resent) ++Stats.ReceivedResends;
-            }
-
-            #endregion Reliable Handling
-
-            #region Inbox Insertion
-
-            NetworkManager.IncomingPacket incomingPacket;
-            incomingPacket.Simulator = this;
-            incomingPacket.Packet = packet;
-
-            // TODO: Prioritize the queue
-            Network.PacketInbox.Enqueue(incomingPacket);
-
-            #endregion Inbox Insertion
-        }
-
-        protected override void PacketSent(UDPPacketBuffer buffer, int bytesSent)
-        {
-        }
-
-        /// <summary>
-        /// Sends out pending acknowledgements
-        /// </summary>
-        private void SendAcks()
-        {
-            lock (PendingAcks)
-            {
-                if (PendingAcks.Count > 0)
-                {
-                    if (PendingAcks.Count > 250)
-                    {
-                        Client.Log("Too many ACKs queued up!", Helpers.LogLevel.Error);
-                        return;
-                    }
-
-                    PacketAckPacket acks = new PacketAckPacket();
-                    acks.Header.Reliable = false;
-                    acks.Packets = new PacketAckPacket.PacketsBlock[PendingAcks.Count];
-
-                    for (int i = 0; i < PendingAcks.Count; i++)
-                    {
-                        acks.Packets[i] = new PacketAckPacket.PacketsBlock();
-                        acks.Packets[i].ID = PendingAcks.Values[i];
-                    }
-
-                    SendPacket(acks, true);
-
-                    PendingAcks.Clear();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Resend unacknowledged packets
-        /// </summary>
-        private void ResendUnacked()
-        {
-            int now = Environment.TickCount;
-
-            lock (NeedAck)
-            {
-                foreach (Packet packet in NeedAck.Values)
-                {
-                    if (now - packet.TickCount > Client.Settings.RESEND_TIMEOUT)
-                    {
-                        try
-                        {
-                            if (Client.Settings.LOG_RESENDS)
-                                Client.DebugLog(String.Format("Resending packet #{0} ({1}), {2}ms have passed",
-                                    packet.Header.Sequence, packet.GetType(), now - packet.TickCount));
-
-                            packet.Header.Resent = true;
-                            packet.TickCount = now;
-                            ++Stats.ResentPackets;
-                            SendPacket(packet, false);
-                        }
-                        catch (Exception ex)
-                        {
-                            Client.DebugLog("Exception trying to resend packet: " + ex.ToString());
-                        }
-                    }
-                }
-            }
-        }
-
-        private void AckTimer_Elapsed(object obj)
-        {
-            SendAcks();
-            ResendUnacked();
-        }
-
-        private void StatsTimer_Elapsed(object obj)
-        {
-            ulong old_in = 0, old_out = 0;
-
-            if (InBytes.Count >= Client.Settings.STATS_QUEUE_SIZE)
-                old_in = InBytes.Dequeue();
-            if (OutBytes.Count >= Client.Settings.STATS_QUEUE_SIZE)
-                old_out = OutBytes.Dequeue();
-
-            InBytes.Enqueue(Stats.RecvBytes);
-            OutBytes.Enqueue(Stats.SentBytes);
-
-            if (old_in > 0 && old_out > 0)
-            {
-                Stats.IncomingBPS = (int)(Stats.RecvBytes - old_in) / Client.Settings.STATS_QUEUE_SIZE;
-                Stats.OutgoingBPS = (int)(Stats.SentBytes - old_out) / Client.Settings.STATS_QUEUE_SIZE;
-                //Client.Log("Incoming: " + IncomingBPS + " Out: " + OutgoingBPS +
-                //    " Lag: " + LastLag + " Pings: " + ReceivedPongs +
-                //    "/" + SentPings, Helpers.LogLevel.Debug);
-            }
-        }
-
-        private void PingTimer_Elapsed(object obj)
-        {
-            SendPing();
-            Stats.SentPings++;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/SoundManager.cs b/old/libsl1550/libsecondlife/SoundManager.cs
deleted file mode 100644
index feb9faf..0000000
--- a/old/libsl1550/libsecondlife/SoundManager.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    public class SoundManager
-    {
-        public SecondLife Client;
-
-        public SoundManager(SecondLife client)
-        {
-            Client = client;
-
-            Client.Network.RegisterCallback(PacketType.AttachedSound, new NetworkManager.PacketCallback(AttachedSoundHandler));
-            Client.Network.RegisterCallback(PacketType.AttachedSoundGainChange, new NetworkManager.PacketCallback(AttachedSoundGainChangeHandler));
-            Client.Network.RegisterCallback(PacketType.PreloadSound, new NetworkManager.PacketCallback(PreloadSoundHandler));
-	        Client.Network.RegisterCallback(PacketType.SoundTrigger, new NetworkManager.PacketCallback(SoundTriggerHandler));
-        }
-
-        protected void AttachedSoundHandler(Packet packet, Simulator simulator)
-        {
-            //FIXME
-        }
-
-        protected void AttachedSoundGainChangeHandler(Packet packet, Simulator simulator)
-        {
-            //FIXME
-        }
-
-        protected void PreloadSoundHandler(Packet packet, Simulator simulator)
-        {
-            //FIXME
-        }
-
-	protected void SoundTriggerHandler(Packet packet, Simulator simulator)
-	{
-	   //FIXME
-	}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/TGALoader.cs b/old/libsl1550/libsecondlife/TGALoader.cs
deleted file mode 100644
index cccf956..0000000
--- a/old/libsl1550/libsecondlife/TGALoader.cs
+++ /dev/null
@@ -1,588 +0,0 @@
-using System;
-
-namespace OpenJPEGNet
-{
-#if !NO_UNSAFE
-
-    /// <summary>
-    /// Capability to load TGAs to Bitmap
-    /// </summary>
-    public class LoadTGAClass
-    {
-        struct tgaColorMap
-        {
-            public ushort FirstEntryIndex;
-            public ushort Length;
-            public byte EntrySize;
-
-            public void Read(System.IO.BinaryReader br)
-            {
-                FirstEntryIndex = br.ReadUInt16();
-                Length = br.ReadUInt16();
-                EntrySize = br.ReadByte();
-            }
-        }
-
-        struct tgaImageSpec
-        {
-            public ushort XOrigin;
-            public ushort YOrigin;
-            public ushort Width;
-            public ushort Height;
-            public byte PixelDepth;
-            public byte Descriptor;
-
-            public void Read(System.IO.BinaryReader br)
-            {
-                XOrigin = br.ReadUInt16();
-                YOrigin = br.ReadUInt16();
-                Width = br.ReadUInt16();
-                Height = br.ReadUInt16();
-                PixelDepth = br.ReadByte();
-                Descriptor = br.ReadByte();
-            }
-
-            public byte AlphaBits
-            {
-                get
-                {
-                    return (byte)(Descriptor & 0xF);
-                }
-                set
-                {
-                    Descriptor = (byte)((Descriptor & ~0xF) | (value & 0xF));
-                }
-            }
-
-            public bool BottomUp
-            {
-                get
-                {
-                    return (Descriptor & 0x20) == 0x20;
-                }
-                set
-                {
-                    Descriptor = (byte)((Descriptor & ~0x20) | (value ? 0x20 : 0));
-                }
-            }
-        }
-
-        struct tgaHeader
-        {
-            public byte IdLength;
-            public byte ColorMapType;
-            public byte ImageType;
-
-            public tgaColorMap ColorMap;
-            public tgaImageSpec ImageSpec;
-
-            public void Read(System.IO.BinaryReader br)
-            {
-                this.IdLength = br.ReadByte();
-                this.ColorMapType = br.ReadByte();
-                this.ImageType = br.ReadByte();
-                this.ColorMap = new tgaColorMap();
-                this.ImageSpec = new tgaImageSpec();
-                this.ColorMap.Read(br);
-                this.ImageSpec.Read(br);
-            }
-
-            public bool RleEncoded
-            {
-                get
-                {
-                    return ImageType >= 9;
-                }
-            }
-        }
-
-        struct tgaCD
-        {
-            public uint RMask, GMask, BMask, AMask;
-            public byte RShift, GShift, BShift, AShift;
-            public uint FinalOr;
-            public bool NeedNoConvert;
-        }
-
-        static uint UnpackColor(
-            uint sourceColor, ref tgaCD cd)
-        {
-            if (cd.RMask == 0xFF && cd.GMask == 0xFF && cd.BMask == 0xFF)
-            {
-                // Special case to deal with 8-bit TGA files that we treat as alpha masks
-                return sourceColor << 24;
-            }
-            else
-            {
-                uint rpermute = (sourceColor << cd.RShift) | (sourceColor >> (32 - cd.RShift));
-                uint gpermute = (sourceColor << cd.GShift) | (sourceColor >> (32 - cd.GShift));
-                uint bpermute = (sourceColor << cd.BShift) | (sourceColor >> (32 - cd.BShift));
-                uint apermute = (sourceColor << cd.AShift) | (sourceColor >> (32 - cd.AShift));
-                uint result =
-                    (rpermute & cd.RMask) | (gpermute & cd.GMask)
-                    | (bpermute & cd.BMask) | (apermute & cd.AMask) | cd.FinalOr;
-
-                return result;
-            }
-        }
-
-        static unsafe void decodeLine(
-            System.Drawing.Imaging.BitmapData b,
-            int line,
-            int byp,
-            byte[] data,
-            ref tgaCD cd)
-        {
-            if (cd.NeedNoConvert)
-            {
-                // fast copy
-                uint* linep = (uint*)((byte*)b.Scan0.ToPointer() + line * b.Stride);
-                fixed (byte* ptr = data)
-                {
-                    uint* sptr = (uint*)ptr;
-                    for (int i = 0; i < b.Width; ++i)
-                    {
-                        linep[i] = sptr[i];
-                    }
-                }
-            }
-            else
-            {
-                byte* linep = (byte*)b.Scan0.ToPointer() + line * b.Stride;
-
-                uint* up = (uint*)linep;
-
-                int rdi = 0;
-
-                fixed (byte* ptr = data)
-                {
-                    for (int i = 0; i < b.Width; ++i)
-                    {
-                        uint x = 0;
-                        for (int j = 0; j < byp; ++j)
-                        {
-                            x |= ((uint)ptr[rdi]) << (j << 3);
-                            ++rdi;
-                        }
-                        up[i] = UnpackColor(x, ref cd);
-                    }
-                }
-            }
-        }
-
-        static void decodeRle(
-            System.Drawing.Imaging.BitmapData b,
-            int byp, tgaCD cd, System.IO.BinaryReader br, bool bottomUp)
-        {
-            try
-            {
-                int w = b.Width;
-                // make buffer larger, so in case of emergency I can decode
-                // over line ends.
-                byte[] linebuffer = new byte[(w + 128) * byp];
-                int maxindex = w * byp;
-                int index = 0;
-
-                for (int j = 0; j < b.Height; ++j)
-                {
-                    while (index < maxindex)
-                    {
-                        byte blocktype = br.ReadByte();
-
-                        int bytestoread;
-                        int bytestocopy;
-
-                        if (blocktype >= 0x80)
-                        {
-                            bytestoread = byp;
-                            bytestocopy = byp * (blocktype - 0x80);
-                        }
-                        else
-                        {
-                            bytestoread = byp * (blocktype + 1);
-                            bytestocopy = 0;
-                        }
-
-                        //if (index + bytestoread > maxindex)
-                        //	throw new System.ArgumentException ("Corrupt TGA");
-
-                        br.Read(linebuffer, index, bytestoread);
-                        index += bytestoread;
-
-                        for (int i = 0; i != bytestocopy; ++i)
-                        {
-                            linebuffer[index + i] = linebuffer[index + i - bytestoread];
-                        }
-                        index += bytestocopy;
-                    }
-                    if (!bottomUp)
-                        decodeLine(b, b.Height - j - 1, byp, linebuffer, ref cd);
-                    else
-                        decodeLine(b, j, byp, linebuffer, ref cd);
-
-                    if (index > maxindex)
-                    {
-                        Array.Copy(linebuffer, maxindex, linebuffer, 0, index - maxindex);
-                        index -= maxindex;
-                    }
-                    else
-                        index = 0;
-
-                }
-            }
-            catch (System.IO.EndOfStreamException)
-            {
-            }
-        }
-
-        static void decodePlain(
-            System.Drawing.Imaging.BitmapData b,
-            int byp, tgaCD cd, System.IO.BinaryReader br, bool bottomUp)
-        {
-            int w = b.Width;
-            byte[] linebuffer = new byte[w * byp];
-
-            for (int j = 0; j < b.Height; ++j)
-            {
-                br.Read(linebuffer, 0, w * byp);
-
-                if (!bottomUp)
-                    decodeLine(b, b.Height - j - 1, byp, linebuffer, ref cd);
-                else
-                    decodeLine(b, j, byp, linebuffer, ref cd);
-            }
-        }
-
-        static void decodeStandard8(
-            System.Drawing.Imaging.BitmapData b,
-            tgaHeader hdr,
-            System.IO.BinaryReader br)
-        {
-            tgaCD cd = new tgaCD();
-            cd.RMask = 0x000000ff;
-            cd.GMask = 0x000000ff;
-            cd.BMask = 0x000000ff;
-            cd.AMask = 0x000000ff;
-            cd.RShift = 0;
-            cd.GShift = 0;
-            cd.BShift = 0;
-            cd.AShift = 0;
-            cd.FinalOr = 0x00000000;
-            if (hdr.RleEncoded)
-                decodeRle(b, 1, cd, br, hdr.ImageSpec.BottomUp);
-            else
-                decodePlain(b, 1, cd, br, hdr.ImageSpec.BottomUp);
-        }
-
-        static void decodeSpecial16(
-            System.Drawing.Imaging.BitmapData b, tgaHeader hdr, System.IO.BinaryReader br)
-        {
-            // i must convert the input stream to a sequence of uint values
-            // which I then unpack.
-            tgaCD cd = new tgaCD();
-            cd.RMask = 0x00f00000;
-            cd.GMask = 0x0000f000;
-            cd.BMask = 0x000000f0;
-            cd.AMask = 0xf0000000;
-            cd.RShift = 12;
-            cd.GShift = 8;
-            cd.BShift = 4;
-            cd.AShift = 16;
-            cd.FinalOr = 0;
-
-            if (hdr.RleEncoded)
-                decodeRle(b, 2, cd, br, hdr.ImageSpec.BottomUp);
-            else
-                decodePlain(b, 2, cd, br, hdr.ImageSpec.BottomUp);
-        }
-
-        static void decodeStandard16(
-            System.Drawing.Imaging.BitmapData b,
-            tgaHeader hdr,
-            System.IO.BinaryReader br)
-        {
-            // i must convert the input stream to a sequence of uint values
-            // which I then unpack.
-            tgaCD cd = new tgaCD();
-            cd.RMask = 0x00f80000;	// from 0xF800
-            cd.GMask = 0x0000fc00;	// from 0x07E0
-            cd.BMask = 0x000000f8;  // from 0x001F
-            cd.AMask = 0x00000000;
-            cd.RShift = 8;
-            cd.GShift = 5;
-            cd.BShift = 3;
-            cd.AShift = 0;
-            cd.FinalOr = 0xff000000;
-
-            if (hdr.RleEncoded)
-                decodeRle(b, 2, cd, br, hdr.ImageSpec.BottomUp);
-            else
-                decodePlain(b, 2, cd, br, hdr.ImageSpec.BottomUp);
-        }
-
-
-        static void decodeSpecial24(System.Drawing.Imaging.BitmapData b,
-            tgaHeader hdr, System.IO.BinaryReader br)
-        {
-            // i must convert the input stream to a sequence of uint values
-            // which I then unpack.
-            tgaCD cd = new tgaCD();
-            cd.RMask = 0x00f80000;
-            cd.GMask = 0x0000fc00;
-            cd.BMask = 0x000000f8;
-            cd.AMask = 0xff000000;
-            cd.RShift = 8;
-            cd.GShift = 5;
-            cd.BShift = 3;
-            cd.AShift = 8;
-            cd.FinalOr = 0;
-
-            if (hdr.RleEncoded)
-                decodeRle(b, 3, cd, br, hdr.ImageSpec.BottomUp);
-            else
-                decodePlain(b, 3, cd, br, hdr.ImageSpec.BottomUp);
-        }
-
-        static void decodeStandard24(System.Drawing.Imaging.BitmapData b,
-            tgaHeader hdr, System.IO.BinaryReader br)
-        {
-            // i must convert the input stream to a sequence of uint values
-            // which I then unpack.
-            tgaCD cd = new tgaCD();
-            cd.RMask = 0x00ff0000;
-            cd.GMask = 0x0000ff00;
-            cd.BMask = 0x000000ff;
-            cd.AMask = 0x00000000;
-            cd.RShift = 0;
-            cd.GShift = 0;
-            cd.BShift = 0;
-            cd.AShift = 0;
-            cd.FinalOr = 0xff000000;
-
-            if (hdr.RleEncoded)
-                decodeRle(b, 3, cd, br, hdr.ImageSpec.BottomUp);
-            else
-                decodePlain(b, 3, cd, br, hdr.ImageSpec.BottomUp);
-        }
-
-        static void decodeStandard32(System.Drawing.Imaging.BitmapData b,
-            tgaHeader hdr, System.IO.BinaryReader br)
-        {
-            // i must convert the input stream to a sequence of uint values
-            // which I then unpack.
-            tgaCD cd = new tgaCD();
-            cd.RMask = 0x00ff0000;
-            cd.GMask = 0x0000ff00;
-            cd.BMask = 0x000000ff;
-            cd.AMask = 0xff000000;
-            cd.RShift = 0;
-            cd.GShift = 0;
-            cd.BShift = 0;
-            cd.AShift = 0;
-            cd.FinalOr = 0x00000000;
-            cd.NeedNoConvert = true;
-
-            if (hdr.RleEncoded)
-                decodeRle(b, 4, cd, br, hdr.ImageSpec.BottomUp);
-            else
-                decodePlain(b, 4, cd, br, hdr.ImageSpec.BottomUp);
-        }
-
-
-        public static System.Drawing.Size GetTGASize(string filename)
-        {
-            System.IO.FileStream f = System.IO.File.OpenRead(filename);
-
-            System.IO.BinaryReader br = new System.IO.BinaryReader(f);
-
-            tgaHeader header = new tgaHeader();
-            header.Read(br);
-            br.Close();
-
-            return new System.Drawing.Size(header.ImageSpec.Width, header.ImageSpec.Height);
-
-        }
-
-        public static System.Drawing.Bitmap LoadTGA(System.IO.Stream source)
-        {
-            byte[] buffer = new byte[source.Length];
-            source.Read(buffer, 0, buffer.Length);
-
-            System.IO.MemoryStream ms = new System.IO.MemoryStream(buffer);
-
-            System.IO.BinaryReader br = new System.IO.BinaryReader(ms);
-
-            tgaHeader header = new tgaHeader();
-            header.Read(br);
-
-            if (header.ImageSpec.PixelDepth != 8 &&
-                header.ImageSpec.PixelDepth != 16 &&
-                header.ImageSpec.PixelDepth != 24 &&
-                header.ImageSpec.PixelDepth != 32)
-                throw new ArgumentException("Not a supported tga file.");
-
-            if (header.ImageSpec.AlphaBits > 8)
-                throw new ArgumentException("Not a supported tga file.");
-
-            if (header.ImageSpec.Width > 4096 ||
-                header.ImageSpec.Height > 4096)
-                throw new ArgumentException("Image too large.");
-
-
-
-            System.Drawing.Bitmap b = new System.Drawing.Bitmap(
-                header.ImageSpec.Width, header.ImageSpec.Height);
-
-            System.Drawing.Imaging.BitmapData bd = b.LockBits(new System.Drawing.Rectangle(0, 0, b.Width, b.Height),
-                System.Drawing.Imaging.ImageLockMode.WriteOnly,
-                System.Drawing.Imaging.PixelFormat.Format32bppPArgb);
-            switch (header.ImageSpec.PixelDepth)
-            {
-                case 8:
-                    decodeStandard8(bd, header, br);
-                    break;
-                case 16:
-                    if (header.ImageSpec.AlphaBits > 0)
-                        decodeSpecial16(bd, header, br);
-                    else
-                        decodeStandard16(bd, header, br);
-                    break;
-                case 24:
-                    if (header.ImageSpec.AlphaBits > 0)
-                        decodeSpecial24(bd, header, br);
-                    else
-                        decodeStandard24(bd, header, br);
-                    break;
-                case 32:
-                    decodeStandard32(bd, header, br);
-                    break;
-                default:
-                    b.UnlockBits(bd);
-                    b.Dispose();
-                    return null;
-            }
-            b.UnlockBits(bd);
-            br.Close();
-            return b;
-        }
-
-        public static unsafe libsecondlife.Image LoadTGAImage(System.IO.Stream source)
-        {
-            return LoadTGAImage(source, false);
-        }
-
-        public static unsafe libsecondlife.Image LoadTGAImage(System.IO.Stream source, bool mask)
-        {
-            byte[] buffer = new byte[source.Length];
-            source.Read(buffer, 0, buffer.Length);
-
-            System.IO.MemoryStream ms = new System.IO.MemoryStream(buffer);
-
-            System.IO.BinaryReader br = new System.IO.BinaryReader(ms);
-
-            tgaHeader header = new tgaHeader();
-            header.Read(br);
-
-            if (header.ImageSpec.PixelDepth != 8 &&
-                header.ImageSpec.PixelDepth != 16 &&
-                header.ImageSpec.PixelDepth != 24 &&
-                header.ImageSpec.PixelDepth != 32)
-                throw new ArgumentException("Not a supported tga file.");
-
-            if (header.ImageSpec.AlphaBits > 8)
-                throw new ArgumentException("Not a supported tga file.");
-
-            if (header.ImageSpec.Width > 4096 ||
-                header.ImageSpec.Height > 4096)
-                throw new ArgumentException("Image too large.");
-
-            byte[] decoded = new byte[header.ImageSpec.Width * header.ImageSpec.Height * 4];
-            System.Drawing.Imaging.BitmapData bd = new System.Drawing.Imaging.BitmapData();
-
-            fixed (byte* pdecoded = &decoded[0])
-            {
-                bd.Width = header.ImageSpec.Width;
-                bd.Height = header.ImageSpec.Height;
-                bd.PixelFormat = System.Drawing.Imaging.PixelFormat.Format32bppPArgb;
-                bd.Stride = header.ImageSpec.Width * 4;
-                bd.Scan0 = (IntPtr)pdecoded;
-
-                switch (header.ImageSpec.PixelDepth)
-                {
-                    case 8:
-                        decodeStandard8(bd, header, br);
-                        break;
-                    case 16:
-                        if (header.ImageSpec.AlphaBits > 0)
-                            decodeSpecial16(bd, header, br);
-                        else
-                            decodeStandard16(bd, header, br);
-                        break;
-                    case 24:
-                        if (header.ImageSpec.AlphaBits > 0)
-                            decodeSpecial24(bd, header, br);
-                        else
-                            decodeStandard24(bd, header, br);
-                        break;
-                    case 32:
-                        decodeStandard32(bd, header, br);
-                        break;
-                    default:
-                        return null;
-                }
-            }
-
-            int n = header.ImageSpec.Width * header.ImageSpec.Height;
-            libsecondlife.Image image;
-
-            if (mask && header.ImageSpec.AlphaBits == 0 && header.ImageSpec.PixelDepth == 8)
-            {
-                image = new libsecondlife.Image(header.ImageSpec.Width, header.ImageSpec.Height, libsecondlife.ImageChannels.Alpha);
-                int p = 3;
-
-                for (int i = 0; i < n; i++)
-                {
-                    image.Alpha[i] = decoded[p];
-                    p += 4;
-                }
-            }
-            else
-            {
-                image = new libsecondlife.Image(header.ImageSpec.Width, header.ImageSpec.Height, libsecondlife.ImageChannels.Color | libsecondlife.ImageChannels.Alpha);
-                int p = 0;
-
-                for (int i = 0; i < n; i++)
-                {
-                    image.Blue[i] = decoded[p++];
-                    image.Green[i] = decoded[p++];
-                    image.Red[i] = decoded[p++];
-                    image.Alpha[i] = decoded[p++];
-                }
-            }
-
-            br.Close();
-            return image;
-        }
-
-        public static System.Drawing.Bitmap LoadTGA(string filename)
-        {
-            try
-            {
-                using (System.IO.FileStream f = System.IO.File.OpenRead(filename))
-                {
-                    return LoadTGA(f);
-                }
-            }
-            catch (System.IO.DirectoryNotFoundException)
-            {
-                return null;	// file not found
-            }
-            catch (System.IO.FileNotFoundException)
-            {
-                return null; // file not found
-            }
-        }
-    }
-
-#endif
-}
diff --git a/old/libsl1550/libsecondlife/TerrainManager.cs b/old/libsl1550/libsecondlife/TerrainManager.cs
deleted file mode 100644
index bd1a860..0000000
--- a/old/libsl1550/libsecondlife/TerrainManager.cs
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
-    public class TerrainManager
-    {
-        public enum LayerType : byte
-        {
-            Land = 0x4C,
-            Water = 0x57,
-            Wind = 0x37,
-            Cloud = 0x38
-        }
-
-        public struct GroupHeader
-        {
-            public int Stride;
-            public int PatchSize;
-            public LayerType Type;
-        }
-
-        public struct PatchHeader
-        {
-            public float DCOffset;
-            public int Range;
-            public int QuantWBits;
-            public int PatchIDs;
-            public uint WordBits;
-        }
-
-        public class Patch
-        {
-            public float[] Heightmap;
-        }
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="x"></param>
-        /// <param name="y"></param>
-        /// <param name="width"></param>
-        /// <param name="data"></param>
-        public delegate void LandPatchCallback(Simulator simulator, int x, int y, int width, float[] data);
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        public event LandPatchCallback OnLandPatch;
-
-        private const int PATCHES_PER_EDGE = 16;
-        private const float OO_SQRT2 = 0.7071067811865475244008443621049f;
-        private const int STRIDE = 264;
-
-        // Bit packing codes
-        private const int ZERO_CODE = 0x0;
-        private const int ZERO_EOB = 0x2;
-        private const int POSITIVE_VALUE = 0x6;
-        private const int NEGATIVE_VALUE = 0x7;
-        private const int END_OF_PATCHES = 97;
-
-        private SecondLife Client;
-        private Dictionary<ulong, Patch[]> SimPatches = new Dictionary<ulong, Patch[]>();
-        private float[] DequantizeTable16 = new float[16 * 16];
-        private float[] DequantizeTable32 = new float[32 * 32];
-        private float[] CosineTable16 = new float[16 * 16];
-        private float[] CosineTable32 = new float[32 * 32];
-        private int[] CopyMatrix16 = new int[16 * 16];
-        private int[] CopyMatrix32 = new int[32 * 32];
-
-        // Not used by clients
-        private float[] QuantizeTable16 = new float[16 * 16];
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="client"></param>
-        public TerrainManager(SecondLife client)
-        {
-            Client = client;
-
-            // Initialize the decompression tables
-            BuildDequantizeTable16();
-            BuildDequantizeTable32();
-            SetupCosines16();
-            SetupCosines32();
-            BuildCopyMatrix16();
-            BuildCopyMatrix32();
-
-            // Not used by clients
-            BuildQuantizeTable16();
-
-            Client.Network.RegisterCallback(PacketType.LayerData, new NetworkManager.PacketCallback(LayerDataHandler));
-        }
-
-        /// <summary>
-        /// Retrieve the terrain height at a given coordinate
-        /// </summary>
-        /// <param name="regionHandle">The region that the point of interest is in</param>
-        /// <param name="x">Sim X coordinate, valid range is from 0 to 255</param>
-        /// <param name="y">Sim Y coordinate, valid range is from 0 to 255</param>
-        /// <param name="height">The terrain height at the given point if the
-        /// lookup was successful, otherwise 0.0f</param>
-        /// <returns>True if the lookup was successful, otherwise false</returns>
-        public bool TerrainHeightAtPoint(ulong regionHandle, int x, int y, out float height)
-        {
-            if (x >= 0 && x < 256 && y >= 0 && y < 256)
-            {
-                lock (SimPatches)
-                {
-                    if (SimPatches.ContainsKey(regionHandle))
-                    {
-                        int patchX = x / 16;
-                        int patchY = y / 16;
-                        x = x % 16;
-                        y = y % 16;
-
-                        if (SimPatches[regionHandle][patchY * 16 + patchX] != null)
-                        {
-                            height = SimPatches[regionHandle][patchY * 16 + patchX].Heightmap[y * 16 + x];
-                            return true;
-                        }
-                    }
-                }
-            }
-
-            height = 0.0f;
-            return false;
-        }
-
-        /// <summary>
-        /// Creates a LayerData packet for compressed land data given a full
-        /// simulator heightmap and an array of indices of patches to compress
-        /// </summary>
-        /// <param name="heightmap">A 256 * 256 array of floating point values
-        /// specifying the height at each meter in the simulator</param>
-        /// <param name="patches">Array of indexes in the 16x16 grid of patches
-        /// for this simulator. For example if 1 and 17 are specified, patches
-        /// x=1,y=0 and x=1,y=1 are sent</param>
-        /// <returns></returns>
-        public LayerDataPacket CreateLandPacket(float[] heightmap, int[] patches)
-        {
-            LayerDataPacket layer = new LayerDataPacket();
-            layer.LayerID.Type = (byte)LayerType.Land;
-
-            GroupHeader header = new GroupHeader();
-            header.Stride = STRIDE;
-            header.PatchSize = 16;
-            header.Type = LayerType.Land;
-
-            byte[] data = new byte[1536];
-            BitPack bitpack = new BitPack(data, 0);
-            bitpack.PackBits(header.Stride, 16);
-            bitpack.PackBits(header.PatchSize, 8);
-            bitpack.PackBits((int)header.Type, 8);
-
-            for (int i = 0; i < patches.Length; i++)
-            {
-                CreatePatch(bitpack, heightmap, patches[i] % 16, (patches[i] - (patches[i] % 16)) / 16);
-            }
-
-            bitpack.PackBits(END_OF_PATCHES, 8);
-
-            layer.LayerData.Data = new byte[bitpack.BytePos + 1];
-            Buffer.BlockCopy(bitpack.Data, 0, layer.LayerData.Data, 0, bitpack.BytePos + 1);
-
-            return layer;
-        }
-
-        /// <summary>
-        /// Add a patch of terrain to a BitPacker
-        /// </summary>
-        /// <param name="output">BitPacker to write the patch to</param>
-        /// <param name="heightmap">Heightmap of the simulator, must be a 256 *
-        /// 256 float array</param>
-        /// <param name="x">X offset of the patch to create, valid values are
-        /// from 0 to 15</param>
-        /// <param name="y">Y offset of the patch to create, valid values are
-        /// from 0 to 15</param>
-        public void CreatePatch(BitPack output, float[] heightmap, int x, int y)
-        {
-            if (heightmap.Length != 256 * 256)
-            {
-                Client.Log("Invalid heightmap value of " + heightmap.Length + " passed to CreatePatch()",
-                    Helpers.LogLevel.Error);
-                return;
-            }
-
-            if (x < 0 || x > 15 || y < 0 || y > 15)
-            {
-                Client.Log("Invalid x or y patch offset passed to CreatePatch(), x=" + x + ", y=" + y,
-                    Helpers.LogLevel.Error);
-                return;
-            }
-
-            PatchHeader header = PrescanPatch(heightmap, x, y);
-            header.QuantWBits = 136;
-            header.PatchIDs = (y & 0x1F);
-            header.PatchIDs += (x << 5);
-
-            // TODO: What is prequant?
-            int[] patch = CompressPatch(heightmap, x, y, header, 10);
-            int wbits = EncodePatchHeader(output, header, patch);
-            // TODO: What is postquant?
-            EncodePatch(output, patch, 0, wbits);
-        }
-
-        private void BuildDequantizeTable16()
-        {
-            for (int j = 0; j < 16; j++)
-            {
-                for (int i = 0; i < 16; i++)
-                {
-                    DequantizeTable16[j * 16 + i] = 1.0f + 2.0f * (float)(i + j);
-                }
-            }
-        }
-
-        private void BuildDequantizeTable32()
-        {
-            for (int j = 0; j < 32; j++)
-            {
-                for (int i = 0; i < 32; i++)
-                {
-                    DequantizeTable32[j * 32 + i] = 1.0f + 2.0f * (float)(i + j);
-                }
-            }
-        }
-
-        private void BuildQuantizeTable16()
-        {
-            for (int j = 0; j < 16; j++)
-            {
-                for (int i = 0; i < 16; i++)
-                {
-                    QuantizeTable16[j * 16 + i] = 1.0f / (1.0f + 2.0f * ((float)i + (float)j));
-                }
-            }
-        }
-
-        private void SetupCosines16()
-        {
-            const float hposz = (float)Math.PI * 0.5f / 16.0f;
-
-            for (int u = 0; u < 16; u++)
-            {
-                for (int n = 0; n < 16; n++)
-                {
-                    CosineTable16[u * 16 + n] = (float)Math.Cos((2.0f * (float)n + 1.0f) * (float)u * hposz);
-                }
-            }
-        }
-
-        private void SetupCosines32()
-        {
-            const float hposz = (float)Math.PI * 0.5f / 32.0f;
-
-            for (int u = 0; u < 32; u++)
-            {
-                for (int n = 0; n < 32; n++)
-                {
-                    CosineTable32[u * 32 + n] = (float)Math.Cos((2.0f * (float)n + 1.0f) * (float)u * hposz);
-                }
-            }
-        }
-
-        private void BuildCopyMatrix16()
-        {
-            bool diag = false;
-            bool right = true;
-            int i = 0;
-            int j = 0;
-            int count = 0;
-
-            while (i < 16 && j < 16)
-            {
-                CopyMatrix16[j * 16 + i] = count++;
-
-                if (!diag)
-                {
-                    if (right)
-                    {
-                        if (i < 16 - 1) i++;
-                        else j++;
-
-                        right = false;
-                        diag = true;
-                    }
-                    else
-                    {
-                        if (j < 16 - 1) j++;
-                        else i++;
-
-                        right = true;
-                        diag = true;
-                    }
-                }
-                else
-                {
-                    if (right)
-                    {
-                        i++;
-                        j--;
-                        if (i == 16 - 1 || j == 0) diag = false;
-                    }
-                    else
-                    {
-                        i--;
-                        j++;
-                        if (j == 16 - 1 || i == 0) diag = false;
-                    }
-                }
-            }
-        }
-
-        private void BuildCopyMatrix32()
-        {
-            bool diag = false;
-            bool right = true;
-            int i = 0;
-            int j = 0;
-            int count = 0;
-
-            while (i < 32 && j < 32)
-            {
-                CopyMatrix32[j * 32 + i] = count++;
-
-                if (!diag)
-                {
-                    if (right)
-                    {
-                        if (i < 32 - 1) i++;
-                        else j++;
-
-                        right = false;
-                        diag = true;
-                    }
-                    else
-                    {
-                        if (j < 32 - 1) j++;
-                        else i++;
-
-                        right = true;
-                        diag = true;
-                    }
-                }
-                else
-                {
-                    if (right)
-                    {
-                        i++;
-                        j--;
-                        if (i == 32 - 1 || j == 0) diag = false;
-                    }
-                    else
-                    {
-                        i--;
-                        j++;
-                        if (j == 32 - 1 || i == 0) diag = false;
-                    }
-                }
-            }
-        }
-
-        private PatchHeader PrescanPatch(float[] heightmap, int patchX, int patchY)
-        {
-            PatchHeader header = new PatchHeader();
-            float zmax = -99999999.0f;
-            float zmin = 99999999.0f;
-
-            for (int j = patchY * 16; j < (patchY + 1) * 16; j++)
-            {
-                for (int i = patchX * 16; i < (patchX + 1) * 16; i++)
-                {
-                    if (heightmap[j * 256 + i] > zmax) zmax = heightmap[j * 256 + i];
-                    if (heightmap[j * 256 + i] < zmin) zmin = heightmap[j * 256 + i];
-                }
-            }
-
-            header.DCOffset = zmin;
-            header.Range = (int)((zmax - zmin) + 1.0f);
-
-            return header;
-        }
-
-        private PatchHeader DecodePatchHeader(BitPack bitpack)
-        {
-            PatchHeader header = new PatchHeader();
-
-            // Quantized word bits
-            header.QuantWBits = bitpack.UnpackBits(8);
-            if (header.QuantWBits == END_OF_PATCHES)
-                return header;
-
-            // DC offset
-            header.DCOffset = bitpack.UnpackFloat();
-
-            // Range
-            header.Range = bitpack.UnpackBits(16);
-
-            // Patch IDs (10 bits)
-            header.PatchIDs = bitpack.UnpackBits(10);
-
-            // Word bits
-            header.WordBits = (uint)((header.QuantWBits & 0x0f) + 2);
-
-            return header;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="output"></param>
-        /// <param name="header"></param>
-        /// <param name="patch"></param>
-        /// <returns>wbits</returns>
-        private int EncodePatchHeader(BitPack output, PatchHeader header, int[] patch)
-        {
-            int temp;
-            int wbits = (header.QuantWBits & 0x0f) + 2;
-            uint maxWbits = (uint)wbits + 5;
-            uint minWbits = ((uint)wbits >> 1);
-
-            wbits = (int)minWbits;
-
-            for (int i = 0; i < patch.Length; i++)
-            {
-                temp = patch[i];
-
-                if (temp != 0)
-                {
-                    // Get the absolute value
-                    if (temp < 0) temp *= -1;
-
-                    for (int j = (int)maxWbits; j > (int)minWbits; j--)
-                    {
-                        if ((temp & (1 << j)) != 0)
-                        {
-                            if (j > wbits) wbits = j;
-                            break;
-                        }
-                    }
-                }
-            }
-
-            wbits += 1;
-
-            header.QuantWBits &= 0xf0;
-
-            if (wbits > 17 || wbits < 2)
-            {
-                Client.Log("Bits needed per word in EncodePatchHeader() are outside the allowed range",
-                    Helpers.LogLevel.Error);
-            }
-
-            header.QuantWBits |= (wbits - 2);
-
-            output.PackBits(header.QuantWBits, 8);
-            output.PackFloat(header.DCOffset);
-            output.PackBits(header.Range, 16);
-            output.PackBits(header.PatchIDs, 10);
-
-            return wbits;
-        }
-
-        private void IDCTColumn16(float[] linein, float[] lineout, int column)
-        {
-            float total;
-            int usize;
-
-            for (int n = 0; n < 16; n++)
-            {
-                total = OO_SQRT2 * linein[column];
-
-                for (int u = 1; u < 16; u++)
-                {
-                    usize = u * 16;
-                    total += linein[usize + column] * CosineTable16[usize + n];
-                }
-
-                lineout[16 * n + column] = total;
-            }
-        }
-
-/*        private void IDCTColumn32(float[] linein, float[] lineout, int column)
-        {
-            float total;
-            int usize;
-
-            for (int n = 0; n < 32; n++)
-            {
-                total = OO_SQRT2 * linein[column];
-
-                for (int u = 1; u < 32; u++)
-                {
-                    usize = u * 32;
-                    total += linein[usize + column] * CosineTable32[usize + n];
-                }
-
-                lineout[32 * n + column] = total;
-            }
-        }
-*/
-        private void IDCTLine16(float[] linein, float[] lineout, int line)
-        {
-            const float oosob = 2.0f / 16.0f;
-            int lineSize = line * 16;
-            float total;
-
-            for (int n = 0; n < 16; n++)
-            {
-                total = OO_SQRT2 * linein[lineSize];
-
-                for (int u = 1; u < 16; u++)
-                {
-                    total += linein[lineSize + u] * CosineTable16[u * 16 + n];
-                }
-
-                lineout[lineSize + n] = total * oosob;
-            }
-        }
-
- /*       private void IDCTLine32(float[] linein, float[] lineout, int line)
-        {
-            const float oosob = 2.0f / 32.0f;
-            int lineSize = line * 32;
-            float total;
-
-            for (int n = 0; n < 32; n++)
-            {
-                total = OO_SQRT2 * linein[lineSize];
-
-                for (int u = 1; u < 32; u++)
-                {
-                    total += linein[lineSize + u] * CosineTable32[u * 32 + n];
-                }
-
-                lineout[lineSize + n] = total * oosob;
-            }
-        } */
-
-        private void DCTLine16(float[] linein, float[] lineout, int line)
-        {
-            float total = 0.0f;
-            int lineSize = line * 16;
-
-            for (int n = 0; n < 16; n++)
-            {
-                total += linein[lineSize + n];
-            }
-
-            lineout[lineSize] = OO_SQRT2 * total;
-
-            for (int u = 1; u < 16; u++)
-            {
-                total = 0.0f;
-
-                for (int n = 0; n < 16; n++)
-                {
-                    total += linein[lineSize + n] * CosineTable16[u * 16 + n];
-                }
-
-                lineout[lineSize + u] = total;
-            }
-        }
-
-        private void DCTColumn16(float[] linein, int[] lineout, int column)
-        {
-            float total = 0.0f;
-            const float oosob = 2.0f / 16.0f;
-
-            for (int n = 0; n < 16; n++)
-            {
-                total += linein[16 * n + column];
-            }
-
-            lineout[CopyMatrix16[column]] = (int)(OO_SQRT2 * total * oosob * QuantizeTable16[column]);
-
-            for (int u = 1; u < 16; u++)
-            {
-                total = 0.0f;
-
-                for (int n = 0; n < 16; n++)
-                {
-                    total += linein[16 * n + column] * CosineTable16[u * 16 + n];
-                }
-
-                lineout[CopyMatrix16[16 * u + column]] = (int)(total * oosob * QuantizeTable16[16 * u + column]);
-            }
-        }
-
-        private void DecodePatch(int[] patches, BitPack bitpack, PatchHeader header, int size)
-        {
-            int temp;
-            for (int n = 0; n < size * size; n++)
-            {
-                // ?
-                temp = bitpack.UnpackBits(1);
-                if (temp != 0)
-                {
-                    // Value or EOB
-                    temp = bitpack.UnpackBits(1);
-                    if (temp != 0)
-                    {
-                        // Value
-                        temp = bitpack.UnpackBits(1);
-                        if (temp != 0)
-                        {
-                            // Negative
-                            temp = bitpack.UnpackBits((int)header.WordBits);
-                            patches[n] = temp * -1;
-                        }
-                        else
-                        {
-                            // Positive
-                            temp = bitpack.UnpackBits((int)header.WordBits);
-                            patches[n] = temp;
-                        }
-                    }
-                    else
-                    {
-                        // Set the rest to zero
-                        // TODO: This might not be necessary
-                        for (int o = n; o < size * size; o++)
-                        {
-                            patches[o] = 0;
-                        }
-                        break;
-                    }
-                }
-                else
-                {
-                    patches[n] = 0;
-                }
-            }
-        }
-
-        private void EncodePatch(BitPack output, int[] patch, int postquant, int wbits)
-        {
-            int temp;
-            bool eob;
-
-            if (postquant > 16 * 16 || postquant < 0)
-            {
-                Client.Log("Postquant is outside the range of allowed values in EncodePatch()", Helpers.LogLevel.Error);
-                return;
-            }
-
-            if (postquant != 0) patch[16 * 16 - postquant] = 0;
-
-            for (int i = 0; i < 16 * 16; i++)
-            {
-                eob = false;
-                temp = patch[i];
-
-                if (temp == 0)
-                {
-                    eob = true;
-
-                    for (int j = i; j < 16 * 16 - postquant; j++)
-                    {
-                        if (patch[j] != 0)
-                        {
-                            eob = false;
-                            break;
-                        }
-                    }
-
-                    if (eob)
-                    {
-                        output.PackBits(ZERO_EOB, 2);
-                        return;
-                    }
-                    else
-                    {
-                        output.PackBits(ZERO_CODE, 1);
-                    }
-                }
-                else
-                {
-                    if (temp < 0)
-                    {
-                        temp *= -1;
-
-                        if (temp > (1 << wbits)) temp = (1 << wbits);
-
-                        output.PackBits(NEGATIVE_VALUE, 3);
-                        output.PackBits(temp, wbits);
-                    }
-                    else
-                    {
-                        if (temp > (1 << wbits)) temp = (1 << wbits);
-
-                        output.PackBits(POSITIVE_VALUE, 3);
-                        output.PackBits(temp, wbits);
-                    }
-                }
-            }
-        }
-
-        private float[] DecompressPatch(int[] patches, PatchHeader header, GroupHeader group)
-        {
-            float[] block = new float[group.PatchSize * group.PatchSize];
-            float[] output = new float[group.PatchSize * group.PatchSize];
-            int prequant = (header.QuantWBits >> 4) + 2;
-            int quantize = 1 << prequant;
-            float ooq = 1.0f / (float)quantize;
-            float mult = ooq * (float)header.Range;
-            float addval = mult * (float)(1 << (prequant - 1)) + header.DCOffset;
-
-            if (group.PatchSize == 16)
-            {
-                for (int n = 0; n < 16 * 16; n++)
-                {
-                    block[n] = patches[CopyMatrix16[n]] * DequantizeTable16[n];
-                }
-
-                float[] ftemp = new float[16 * 16];
-
-                for (int o = 0; o < 16; o++)
-                    IDCTColumn16(block, ftemp, o);
-                for (int o = 0; o < 16; o++)
-                    IDCTLine16(ftemp, block, o);
-            }
-            else
-            {
-                for (int n = 0; n < 32 * 32; n++)
-                {
-                    block[n] = patches[CopyMatrix32[n]] * DequantizeTable32[n];
-                }
-
-                Client.Log("Implement IDCTPatchLarge", Helpers.LogLevel.Error);
-            }
-
-            for (int j = 0; j < block.Length; j++)
-            {
-                output[j] = block[j] * mult + addval;
-            }
-
-            return output;
-        }
-
-        private int[] CompressPatch(float[] heightmap, int patchX, int patchY, PatchHeader header, int prequant)
-        {
-            float[] block = new float[16 * 16];
-            int wordsize = prequant;
-            float oozrange = 1.0f / (float)header.Range;
-            float range = (float)(1 << prequant);
-            float premult = oozrange * range;
-            float sub = (float)(1 << (prequant - 1)) + header.DCOffset * premult;
-
-            header.QuantWBits = wordsize - 2;
-            header.QuantWBits |= (prequant - 2) << 4;
-
-            int k = 0;
-            for (int j = patchY * 16; j < (patchY + 1) * 16; j++)
-            {
-                for (int i = patchX * 16; i < (patchX + 1) * 16; i++)
-                {
-                    block[k++] = heightmap[j * 256 + i] * premult - sub;
-                }
-            }
-
-            float[] ftemp = new float[16 * 16];
-            int[] itemp = new int[16 * 16];
-
-            for (int o = 0; o < 16; o++)
-                DCTLine16(block, ftemp, o);
-            for (int o = 0; o < 16; o++)
-                DCTColumn16(ftemp, itemp, o);
-
-            return itemp;
-        }
-
-        private void DecompressLand(Simulator simulator, BitPack bitpack, GroupHeader group)
-        {
-            int x;
-            int y;
-            int[] patches = new int[32 * 32];
-            int count = 0;
-
-            while (true)
-            {
-                PatchHeader header = DecodePatchHeader(bitpack);
-
-                if (header.QuantWBits == END_OF_PATCHES)
-                    break;
-
-                x = header.PatchIDs >> 5;
-                y = header.PatchIDs & 0x1F;
-
-                if (x >= PATCHES_PER_EDGE || y >= PATCHES_PER_EDGE)
-                {
-                    Client.Log("Invalid LayerData land packet, x = " + x + ", y = " + y + ", dc_offset = " +
-                        header.DCOffset + ", range = " + header.Range + ", quant_wbits = " + header.QuantWBits +
-                        ", patchids = " + header.PatchIDs + ", count = " + count, Helpers.LogLevel.Warning);
-                    return;
-                }
-
-                // Decode this patch
-                DecodePatch(patches, bitpack, header, group.PatchSize);
-
-                // Decompress this patch
-                float[] heightmap = DecompressPatch(patches, header, group);
-
-                count++;
-
-                if (OnLandPatch != null)
-                {
-                    try { OnLandPatch(simulator, x, y, group.PatchSize, heightmap); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-
-                if (Client.Settings.STORE_LAND_PATCHES)
-                {
-                    lock (SimPatches)
-                    {
-                        if (!SimPatches.ContainsKey(simulator.Handle))
-                            SimPatches.Add(simulator.Handle, new Patch[16 * 16]);
-
-                        SimPatches[simulator.Handle][y * 16 + x] = new Patch();
-                        SimPatches[simulator.Handle][y * 16 + x].Heightmap = heightmap;
-                    }
-                }
-            }
-        }
-
-        private void DecompressWind(Simulator simulator, BitPack bitpack, GroupHeader group)
-        {
-            ;
-        }
-
-        private void DecompressCloud(Simulator simulator, BitPack bitpack, GroupHeader group)
-        {
-            ;
-        }
-
-        private void LayerDataHandler(Packet packet, Simulator simulator)
-        {
-            LayerDataPacket layer = (LayerDataPacket)packet;
-            BitPack bitpack = new BitPack(layer.LayerData.Data, 0);
-            GroupHeader header = new GroupHeader();
-            LayerType type = (LayerType)layer.LayerID.Type;
-
-            // Stride
-            header.Stride = bitpack.UnpackBits(16);
-            // Patch size
-            header.PatchSize = bitpack.UnpackBits(8);
-            // Layer type
-            header.Type = (LayerType)bitpack.UnpackBits(8);
-
-            switch (type)
-            {
-                case LayerType.Land:
-                    if (OnLandPatch != null || Client.Settings.STORE_LAND_PATCHES)
-                        DecompressLand(simulator, bitpack, header);
-                    break;
-                case LayerType.Water:
-                    Client.Log("Got a Water LayerData packet, implement me!", Helpers.LogLevel.Error);
-                    break;
-                case LayerType.Wind:
-                    DecompressWind(simulator, bitpack, header);
-                    break;
-                case LayerType.Cloud:
-                    DecompressCloud(simulator, bitpack, header);
-                    break;
-                default:
-                    Client.Log("Unrecognized LayerData type " + type.ToString(), Helpers.LogLevel.Warning);
-                    break;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/TextureEntry.cs b/old/libsl1550/libsecondlife/TextureEntry.cs
deleted file mode 100644
index aa64d72..0000000
--- a/old/libsl1550/libsecondlife/TextureEntry.cs
+++ /dev/null
@@ -1,1102 +0,0 @@
-/*
- * Copyright (c) 2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife
-{
-        #region Enumerations
-
-        /// <summary>
-        /// The type of bump-mapping applied to a face
-        /// </summary>
-        public enum Bumpiness : byte
-        {
-            /// <summary></summary>
-            None = 0,
-            /// <summary></summary>
-            Brightness = 1,
-            /// <summary></summary>
-            Darkness = 2,
-            /// <summary></summary>
-            Woodgrain = 3,
-            /// <summary></summary>
-            Bark = 4,
-            /// <summary></summary>
-            Bricks = 5,
-            /// <summary></summary>
-            Checker = 6,
-            /// <summary></summary>
-            Concrete = 7,
-            /// <summary></summary>
-            Crustytile = 8,
-            /// <summary></summary>
-            Cutstone = 9,
-            /// <summary></summary>
-            Discs = 10,
-            /// <summary></summary>
-            Gravel = 11,
-            /// <summary></summary>
-            Petridish = 12,
-            /// <summary></summary>
-            Siding = 13,
-            /// <summary></summary>
-            Stonetile = 14,
-            /// <summary></summary>
-            Stucco = 15,
-            /// <summary></summary>
-            Suction = 16,
-            /// <summary></summary>
-            Weave = 17
-        }
-
-        /// <summary>
-        /// The level of shininess applied to a face
-        /// </summary>
-        public enum Shininess
-        {
-            /// <summary></summary>
-            None = 0,
-            /// <summary></summary>
-            Low = 0x40,
-            /// <summary></summary>
-            Medium = 0x80,
-            /// <summary></summary>
-            High = 0xC0
-        }
-
-        /// <summary>
-        /// The texture mapping style used for a face
-        /// </summary>
-        public enum MappingType
-        {
-            /// <summary></summary>
-            Default = 0,
-            /// <summary></summary>
-            Planar = 2
-        }
-
-        /// <summary>
-        /// Flags in the TextureEntry block that describe which properties are
-        /// set
-        /// </summary>
-        [Flags]
-        public enum TextureAttributes : uint
-        {
-            /// <summary></summary>
-            None = 0,
-            /// <summary></summary>
-            TextureID = 1 << 0,
-            /// <summary></summary>
-            RGBA = 1 << 1,
-            /// <summary></summary>
-            RepeatU = 1 << 2,
-            /// <summary></summary>
-            RepeatV = 1 << 3,
-            /// <summary></summary>
-            OffsetU = 1 << 4,
-            /// <summary></summary>
-            OffsetV = 1 << 5,
-            /// <summary></summary>
-            Rotation = 1 << 6,
-            /// <summary></summary>
-            Material = 1 << 7,
-            /// <summary></summary>
-            Media = 1 << 8,
-            /// <summary></summary>
-            Glow = 1 << 9,
-            /// <summary></summary>
-            All = 0xFFFFFFFF
-        }
-
-        #endregion Enumerations
-
-    public abstract partial class LLObject
-    {
-        /// <summary>
-        /// A single textured face. Don't instantiate this class yourself, use the
-        /// methods in TextureEntry
-        /// </summary>
-        public class TextureEntryFace
-        {
-            // +----------+ S = Shiny
-            // | SSFBBBBB | F = Fullbright
-            // | 76543210 | B = Bumpmap
-            // +----------+
-            private const byte BUMP_MASK = 0x1F;
-            private const byte FULLBRIGHT_MASK = 0x20;
-            private const byte SHINY_MASK = 0xC0;
-            // +----------+ M = Media Flags (web page)
-            // | .....TTM | T = Texture Mapping
-            // | 76543210 | . = Unused
-            // +----------+
-            private const byte MEDIA_MASK = 0x01;
-            private const byte TEX_MAP_MASK = 0x06;
-
-            private LLColor rgba;
-            private float repeatU;
-            private float repeatV;
-            private float offsetU;
-            private float offsetV;
-            private float rotation;
-            private float glow;
-            private TextureAttributes hasAttribute;
-            private LLUUID textureID;
-            private TextureEntryFace DefaultTexture;
-
-            internal byte material;
-            internal byte media;
-
-            #region Properties
-
-            /// <summary></summary>
-            public LLColor RGBA
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.RGBA) != 0)
-                        return rgba;
-                    else
-                        return DefaultTexture.rgba;
-                }
-                set
-                {
-                    rgba = value;
-                    hasAttribute |= TextureAttributes.RGBA;
-                }
-            }
-
-            /// <summary></summary>
-            public float RepeatU
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.RepeatU) != 0)
-                        return repeatU;
-                    else
-                        return DefaultTexture.repeatU;
-                }
-                set
-                {
-                    repeatU = value;
-                    hasAttribute |= TextureAttributes.RepeatU;
-                }
-            }
-
-            /// <summary></summary>
-            public float RepeatV
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.RepeatV) != 0)
-                        return repeatV;
-                    else
-                        return DefaultTexture.repeatV;
-                }
-                set
-                {
-                    repeatV = value;
-                    hasAttribute |= TextureAttributes.RepeatV;
-                }
-            }
-
-            /// <summary></summary>
-            public float OffsetU
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.OffsetU) != 0)
-                        return offsetU;
-                    else
-                        return DefaultTexture.offsetU;
-                }
-                set
-                {
-                    offsetU = value;
-                    hasAttribute |= TextureAttributes.OffsetU;
-                }
-            }
-
-            /// <summary></summary>
-            public float OffsetV
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.OffsetV) != 0)
-                        return offsetV;
-                    else
-                        return DefaultTexture.offsetV;
-                }
-                set
-                {
-                    offsetV = value;
-                    hasAttribute |= TextureAttributes.OffsetV;
-                }
-            }
-
-            /// <summary></summary>
-            public float Rotation
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.Rotation) != 0)
-                        return rotation;
-                    else
-                        return DefaultTexture.rotation;
-                }
-                set
-                {
-                    rotation = value;
-                    hasAttribute |= TextureAttributes.Rotation;
-                }
-            }
-
-            /// <summary></summary>
-            public float Glow
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.Glow) != 0)
-                        return glow;
-                    else
-                        return DefaultTexture.glow;
-                }
-                set
-                {
-                    glow = value;
-                    hasAttribute |= TextureAttributes.Glow;
-                }
-            }
-
-            /// <summary></summary>
-            public Bumpiness Bump
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.Material) != 0)
-                        return (Bumpiness)(material & BUMP_MASK);
-                    else
-                        return DefaultTexture.Bump;
-                }
-                set
-                {
-                    // Clear out the old material value
-                    material &= 0xE0;
-                    // Put the new bump value in the material byte
-                    material |= (byte)value;
-                    hasAttribute |= TextureAttributes.Material;
-                }
-            }
-
-            public Shininess Shiny
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.Material) != 0)
-                        return (Shininess)(material & SHINY_MASK);
-                    else
-                        return DefaultTexture.Shiny;
-                }
-                set
-                {
-                    // Clear out the old shiny value
-                    material &= 0x3F;
-                    // Put the new shiny value in the material byte
-                    material |= (byte)value;
-                    hasAttribute |= TextureAttributes.Material;
-                }
-            }
-
-            public bool Fullbright
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.Material) != 0)
-                        return (material & FULLBRIGHT_MASK) != 0;
-                    else
-                        return DefaultTexture.Fullbright;
-                }
-                set
-                {
-                    // Clear out the old fullbright value
-                    material &= 0xDF;
-                    if (value)
-                    {
-                        material |= 0x20;
-                        hasAttribute |= TextureAttributes.Material;
-                    }
-                }
-            }
-
-            /// <summary>In the future this will specify whether a webpage is
-            /// attached to this face</summary>
-            public bool MediaFlags
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.Media) != 0)
-                        return (media & MEDIA_MASK) != 0;
-                    else
-                        return DefaultTexture.MediaFlags;
-                }
-                set
-                {
-                    // Clear out the old mediaflags value
-                    media &= 0xFE;
-                    if (value)
-                    {
-                        media |= 0x01;
-                        hasAttribute |= TextureAttributes.Media;
-                    }
-                }
-            }
-
-            public MappingType TexMapType
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.Media) != 0)
-                        return (MappingType)(media & TEX_MAP_MASK);
-                    else
-                        return DefaultTexture.TexMapType;
-                }
-                set
-                {
-                    // Clear out the old texmap value
-                    media &= 0xF9;
-                    // Put the new texmap value in the media byte
-                    media |= (byte)value;
-                    hasAttribute |= TextureAttributes.Media;
-                }
-            }
-
-            /// <summary></summary>
-            public LLUUID TextureID
-            {
-                get
-                {
-                    if ((hasAttribute & TextureAttributes.TextureID) != 0)
-                        return textureID;
-                    else
-                        return DefaultTexture.textureID;
-                }
-                set
-                {
-                    textureID = value;
-                    hasAttribute |= TextureAttributes.TextureID;
-                }
-            }
-
-            #endregion Properties
-
-            /// <summary>
-            /// Contains the definition for individual faces
-            /// </summary>
-            /// <param name="defaultTexture"></param>
-            public TextureEntryFace(TextureEntryFace defaultTexture)
-            {
-                repeatU = 1.0f;
-                repeatV = 1.0f;
-
-                DefaultTexture = defaultTexture;
-                if (DefaultTexture == null)
-                    hasAttribute = TextureAttributes.All;
-                else
-                    hasAttribute = TextureAttributes.None;
-            }
-
-            public LLSD ToLLSD(int faceNumber)
-            {
-                LLSDMap tex = new LLSDMap(10);
-                if (faceNumber >= 0) tex["face_number"] = LLSD.FromInteger(faceNumber);
-                tex["colors"] = RGBA.ToLLSD();
-                tex["scales"] = LLSD.FromReal(RepeatU);
-                tex["scalet"] = LLSD.FromReal(RepeatV);
-                tex["offsets"] = LLSD.FromReal(OffsetU);
-                tex["offsett"] = LLSD.FromReal(OffsetV);
-                tex["imagerot"] = LLSD.FromReal(Rotation);
-                tex["bump"] = LLSD.FromInteger((int)Bump);
-                tex["shiny"] = LLSD.FromInteger((int)Shiny);
-                tex["fullbright"] = LLSD.FromBoolean(Fullbright);
-                tex["media_flags"] = LLSD.FromInteger(Convert.ToInt32(MediaFlags));
-                tex["mapping"] = LLSD.FromInteger((int)TexMapType);
-                tex["glow"] = LLSD.FromReal(Glow);
-                tex["imageid"] = LLSD.FromUUID(TextureID);
-
-                return tex;
-            }
-
-            public static TextureEntryFace FromLLSD(LLSD llsd, TextureEntryFace defaultFace, out int faceNumber)
-            {
-                LLSDMap map = (LLSDMap)llsd;
-
-                TextureEntryFace face = new TextureEntryFace(defaultFace);
-                faceNumber = (map.ContainsKey("face_number")) ? map["face_number"].AsInteger() : -1;
-                face.RGBA = LLColor.FromLLSD(map["colors"]);
-                face.RepeatU = (float)map["scales"].AsReal();
-                face.RepeatV = (float)map["scalet"].AsReal();
-                face.OffsetU = (float)map["offsets"].AsReal();
-                face.OffsetV = (float)map["offsett"].AsReal();
-                face.Rotation = (float)map["imagerot"].AsReal();
-                face.Bump = (Bumpiness)map["bump"].AsInteger();
-                face.Shiny = (Shininess)map["shiny"].AsInteger();
-                face.Fullbright = map["fullbright"].AsBoolean();
-                face.MediaFlags = map["media_flags"].AsBoolean();
-                face.TexMapType = (MappingType)map["mapping"].AsInteger();
-                face.Glow = (float)map["glow"].AsReal();
-                face.TextureID = map["imageid"].AsUUID();
-
-                return face;
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public override string ToString()
-            {
-                return String.Format("Color: {0} RepeatU: {1} RepeatV: {2} OffsetU: {3} OffsetV: {4} " +
-                    "Rotation: {5} Bump: {6} Shiny: {7} Fullbright: {8} Mapping: {9} Media: {10} Glow: {11} ID: {12}",
-                    RGBA, RepeatU, RepeatV, OffsetU, OffsetV, Rotation, Bump, Shiny, Fullbright, TexMapType,
-                    MediaFlags, Glow, TextureID);
-            }
-        }
-
-        /// <summary>
-        /// Represents all of the texturable faces for an object
-        /// </summary>
-        /// <remarks>Objects in Second Life have infinite faces, with each face
-        /// using the properties of the default face unless set otherwise. So if
-        /// you have a TextureEntry with a default texture uuid of X, and face 18
-        /// has a texture UUID of Y, every face would be textured with X except for
-        /// face 18 that uses Y. In practice however, primitives utilize a maximum
-        /// of nine faces</remarks>
-        public class TextureEntry
-        {
-            /// <summary></summary>
-            public TextureEntryFace DefaultTexture;
-            /// <summary></summary>
-            public TextureEntryFace[] FaceTextures = new TextureEntryFace[MAX_FACES];
-
-            public const int MAX_FACES = 32;
-
-            /// <summary>
-            /// Constructor that takes a default texture UUID
-            /// </summary>
-            /// <param name="defaultTextureID">Texture UUID to use as the default texture</param>
-            public TextureEntry(LLUUID defaultTextureID)
-            {
-                DefaultTexture = new TextureEntryFace(null);
-                DefaultTexture.TextureID = defaultTextureID;
-            }
-
-            /// <summary>
-            /// Constructor that takes a <code>TextureEntryFace</code> for the
-            /// default face
-            /// </summary>
-            /// <param name="defaultFace">Face to use as the default face</param>
-            public TextureEntry(TextureEntryFace defaultFace)
-            {
-                DefaultTexture = new TextureEntryFace(null);
-                DefaultTexture.Bump = defaultFace.Bump;
-                DefaultTexture.Fullbright = defaultFace.Fullbright;
-                DefaultTexture.MediaFlags = defaultFace.MediaFlags;
-                DefaultTexture.OffsetU = defaultFace.OffsetU;
-                DefaultTexture.OffsetV = defaultFace.OffsetV;
-                DefaultTexture.RepeatU = defaultFace.RepeatU;
-                DefaultTexture.RepeatV = defaultFace.RepeatV;
-                DefaultTexture.RGBA = defaultFace.RGBA;
-                DefaultTexture.Rotation = defaultFace.Rotation;
-                DefaultTexture.Glow = defaultFace.Glow;
-                DefaultTexture.Shiny = defaultFace.Shiny;
-                DefaultTexture.TexMapType = defaultFace.TexMapType;
-                DefaultTexture.TextureID = defaultFace.TextureID;
-            }
-
-            /// <summary>
-            /// Constructor that creates the TextureEntry class from a byte array
-            /// </summary>
-            /// <param name="data">Byte array containing the TextureEntry field</param>
-            /// <param name="pos">Starting position of the TextureEntry field in
-            /// the byte array</param>
-            /// <param name="length">Length of the TextureEntry field, in bytes</param>
-            public TextureEntry(byte[] data, int pos, int length)
-            {
-                FromBytes(data, pos, length);
-            }
-
-            /// <summary>
-            /// This will either create a new face if a custom face for the given
-            /// index is not defined, or return the custom face for that index if
-            /// it already exists
-            /// </summary>
-            /// <param name="index">The index number of the face to create or
-            /// retrieve</param>
-            /// <returns>A TextureEntryFace containing all the properties for that
-            /// face</returns>
-            public TextureEntryFace CreateFace(uint index)
-            {
-                if (index >= MAX_FACES) throw new Exception(index + " is outside the range of MAX_FACES");
-
-                if (FaceTextures[index] == null)
-                    FaceTextures[index] = new TextureEntryFace(this.DefaultTexture);
-
-                return FaceTextures[index];
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <param name="index"></param>
-            /// <returns></returns>
-            public TextureEntryFace GetFace(uint index)
-            {
-                if (index >= MAX_FACES) throw new Exception(index + " is outside the range of MAX_FACES");
-
-                if (FaceTextures[index] != null)
-                    return FaceTextures[index];
-                else
-                    return DefaultTexture;
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public LLSD ToLLSD()
-            {
-                LLSDArray array = new LLSDArray();
-
-                // Always add default texture
-                array.Add(DefaultTexture.ToLLSD(-1));
-
-                for (int i = 0; i < MAX_FACES; i++)
-                {
-                    if (FaceTextures[i] != null)
-                        array.Add(FaceTextures[i].ToLLSD(i));
-                }
-
-                return array;
-            }
-
-            public static TextureEntry FromLLSD(LLSD llsd)
-            {
-                LLSDArray array = (LLSDArray)llsd;
-                LLSDMap faceLLSD;
-
-                if (array.Count > 0)
-                {
-                    int faceNumber;
-                    faceLLSD = (LLSDMap)array[0];
-                    TextureEntryFace defaultFace = TextureEntryFace.FromLLSD(faceLLSD, null, out faceNumber);
-                    TextureEntry te = new TextureEntry(defaultFace);
-
-                    for (int i = 1; i < array.Count; i++)
-                    {
-                        TextureEntryFace tex = TextureEntryFace.FromLLSD(array[i], defaultFace, out faceNumber);
-                        if (faceNumber >= 0 && faceNumber < te.FaceTextures.Length)
-                            te.FaceTextures[faceNumber] = tex;
-                    }
-
-                    return te;
-                }
-                else
-                {
-                    throw new ArgumentException("LLSD contains no elements");
-                }
-            }
-
-            private void FromBytes(byte[] data, int pos, int length)
-            {
-                if (length <= 0)
-                {
-                    // No TextureEntry to process
-                    DefaultTexture = null;
-                    return;
-                }
-                else
-                {
-                    DefaultTexture = new TextureEntryFace(null);
-                }
-
-                uint bitfieldSize = 0;
-                uint faceBits = 0;
-                int i = pos;
-
-                #region Texture
-                DefaultTexture.TextureID = new LLUUID(data, i);
-                i += 16;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    LLUUID tmpUUID = new LLUUID(data, i);
-                    i += 16;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).TextureID = tmpUUID;
-                }
-                #endregion Texture
-
-                #region Color
-                DefaultTexture.RGBA = new LLColor(data[i], data[i + 1], data[i + 2], data[i + 3]);
-                i += 4;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    LLColor tmpColor = new LLColor(data[i], data[i + 1], data[i + 2], data[i + 3]);
-                    i += 4;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).RGBA = tmpColor;
-                }
-                #endregion Color
-
-                #region RepeatU
-                DefaultTexture.RepeatU = Helpers.BytesToFloat(data, i);
-                i += 4;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    float tmpFloat = Helpers.BytesToFloat(data, i);
-                    i += 4;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).RepeatU = tmpFloat;
-                }
-                #endregion RepeatU
-
-                #region RepeatV
-                DefaultTexture.RepeatV = Helpers.BytesToFloat(data, i);
-                i += 4;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    float tmpFloat = Helpers.BytesToFloat(data, i);
-                    i += 4;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).RepeatV = tmpFloat;
-                }
-                #endregion RepeatV
-
-                #region OffsetU
-                DefaultTexture.OffsetU = Helpers.TEOffsetFloat(data, i);
-                i += 2;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    float tmpFloat = Helpers.TEOffsetFloat(data, i);
-                    i += 2;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).OffsetU = tmpFloat;
-                }
-                #endregion OffsetU
-
-                #region OffsetV
-                DefaultTexture.OffsetV = Helpers.TEOffsetFloat(data, i);
-                i += 2;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    float tmpFloat = Helpers.TEOffsetFloat(data, i);
-                    i += 2;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).OffsetV = tmpFloat;
-                }
-                #endregion OffsetV
-
-                #region Rotation
-                DefaultTexture.Rotation = Helpers.TERotationFloat(data, i);
-                i += 2;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    float tmpFloat = Helpers.TERotationFloat(data, i);
-                    i += 2;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).Rotation = tmpFloat;
-                }
-                #endregion Rotation
-
-                #region Material
-                DefaultTexture.material = data[i];
-                i++;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    byte tmpByte = data[i];
-                    i++;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).material = tmpByte;
-                }
-                #endregion Material
-
-                #region Media
-                DefaultTexture.media = data[i];
-                i++;
-
-                while (i - pos < length && ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    byte tmpByte = data[i];
-                    i++;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).media = tmpByte;
-                }
-                #endregion Media
-
-                #region Glow
-                DefaultTexture.Glow = Helpers.TEGlowFloat(data, i);
-                i++;
-
-                while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
-                {
-                    float tmpFloat = Helpers.TEGlowFloat(data, i);
-                    i++;
-
-                    for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)
-                        if ((faceBits & bit) != 0)
-                            CreateFace(face).Glow = tmpFloat;
-                }
- 	  	        #endregion Glow
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public byte[] ToBytes()
-            {
-                if (DefaultTexture == null)
-                    return new byte[0];
-
-                MemoryStream memStream = new MemoryStream();
-                BinaryWriter binWriter = new BinaryWriter(memStream);
-
-                #region Bitfield Setup
-
-                uint[] textures = new uint[FaceTextures.Length];
-                InitializeArray(ref textures);
-                uint[] rgbas = new uint[FaceTextures.Length];
-                InitializeArray(ref rgbas);
-                uint[] repeatus = new uint[FaceTextures.Length];
-                InitializeArray(ref repeatus);
-                uint[] repeatvs = new uint[FaceTextures.Length];
-                InitializeArray(ref repeatvs);
-                uint[] offsetus = new uint[FaceTextures.Length];
-                InitializeArray(ref offsetus);
-                uint[] offsetvs = new uint[FaceTextures.Length];
-                InitializeArray(ref offsetvs);
-                uint[] rotations = new uint[FaceTextures.Length];
-                InitializeArray(ref rotations);
-                uint[] materials = new uint[FaceTextures.Length];
-                InitializeArray(ref materials);
-                uint[] medias = new uint[FaceTextures.Length];
-                InitializeArray(ref medias);
-                uint[] glows = new uint[FaceTextures.Length];
-                InitializeArray(ref glows);
-
-                for (int i = 0; i < FaceTextures.Length; i++)
-                {
-                    if (FaceTextures[i] == null) continue;
-
-                    if (FaceTextures[i].TextureID != DefaultTexture.TextureID)
-                    {
-                        if (textures[i] == UInt32.MaxValue) textures[i] = 0;
-                        textures[i] |= (uint)(1 << i);
-                    }
-                    if (FaceTextures[i].RGBA != DefaultTexture.RGBA)
-                    {
-                        if (rgbas[i] == UInt32.MaxValue) rgbas[i] = 0;
-                        rgbas[i] |= (uint)(1 << i);
-                    }
-                    if (FaceTextures[i].RepeatU != DefaultTexture.RepeatU)
-                    {
-                        if (repeatus[i] == UInt32.MaxValue) repeatus[i] = 0;
-                        repeatus[i] |= (uint)(1 << i);
-                    }
-                    if (FaceTextures[i].RepeatV != DefaultTexture.RepeatV)
-                    {
-                        if (repeatvs[i] == UInt32.MaxValue) repeatvs[i] = 0;
-                        repeatvs[i] |= (uint)(1 << i);
-                    }
-                    if (Helpers.TEOffsetShort(FaceTextures[i].OffsetU) != Helpers.TEOffsetShort(DefaultTexture.OffsetU))
-                    {
-                        if (offsetus[i] == UInt32.MaxValue) offsetus[i] = 0;
-                        offsetus[i] |= (uint)(1 << i);
-                    }
-                    if (Helpers.TEOffsetShort(FaceTextures[i].OffsetV) != Helpers.TEOffsetShort(DefaultTexture.OffsetV))
-                    {
-                        if (offsetvs[i] == UInt32.MaxValue) offsetvs[i] = 0;
-                        offsetvs[i] |= (uint)(1 << i);
-                    }
-                    if (Helpers.TERotationShort(FaceTextures[i].Rotation) != Helpers.TERotationShort(DefaultTexture.Rotation))
-                    {
-                        if (rotations[i] == UInt32.MaxValue) rotations[i] = 0;
-                        rotations[i] |= (uint)(1 << i);
-                    }
-                    if (FaceTextures[i].material != DefaultTexture.material)
-                    {
-                        if (materials[i] == UInt32.MaxValue) materials[i] = 0;
-                        materials[i] |= (uint)(1 << i);
-                    }
-                    if (FaceTextures[i].media != DefaultTexture.media)
-                    {
-                        if (medias[i] == UInt32.MaxValue) medias[i] = 0;
-                        medias[i] |= (uint)(1 << i);
-                    }
-                    if (Helpers.TEGlowByte(FaceTextures[i].Glow) != Helpers.TEGlowByte(DefaultTexture.Glow))
-                    {
-                        if (glows[i] == UInt32.MaxValue) glows[i] = 0;
-                        glows[i] |= (uint)(1 << i);
-                    }
-                }
-
-                #endregion Bitfield Setup
-
-                #region Texture
-                binWriter.Write(DefaultTexture.TextureID.GetBytes());
-                for (int i = 0; i < textures.Length; i++)
-                {
-                    if (textures[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(textures[i]));
-                        binWriter.Write(FaceTextures[i].TextureID.GetBytes());
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion Texture
-
-                #region Color
-                binWriter.Write(DefaultTexture.RGBA.GetBytes());
-                for (int i = 0; i < rgbas.Length; i++)
-                {
-                    if (rgbas[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(rgbas[i]));
-                        binWriter.Write(FaceTextures[i].RGBA.GetBytes());
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion Color
-
-                #region RepeatU
-                binWriter.Write(DefaultTexture.RepeatU);
-                for (int i = 0; i < repeatus.Length; i++)
-                {
-                    if (repeatus[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(repeatus[i]));
-                        binWriter.Write(FaceTextures[i].RepeatU);
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion RepeatU
-
-                #region RepeatV
-                binWriter.Write(DefaultTexture.RepeatV);
-                for (int i = 0; i < repeatvs.Length; i++)
-                {
-                    if (repeatvs[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(repeatvs[i]));
-                        binWriter.Write(FaceTextures[i].RepeatV);
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion RepeatV
-
-                #region OffsetU
-                binWriter.Write(Helpers.TEOffsetShort(DefaultTexture.OffsetU));
-                for (int i = 0; i < offsetus.Length; i++)
-                {
-                    if (offsetus[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(offsetus[i]));
-                        binWriter.Write(Helpers.TEOffsetShort(FaceTextures[i].OffsetU));
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion OffsetU
-
-                #region OffsetV
-                binWriter.Write(Helpers.TEOffsetShort(DefaultTexture.OffsetV));
-                for (int i = 0; i < offsetvs.Length; i++)
-                {
-                    if (offsetvs[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(offsetvs[i]));
-                        binWriter.Write(Helpers.TEOffsetShort(FaceTextures[i].OffsetV));
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion OffsetV
-
-                #region Rotation
-                binWriter.Write(Helpers.TERotationShort(DefaultTexture.Rotation));
-                for (int i = 0; i < rotations.Length; i++)
-                {
-                    if (rotations[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(rotations[i]));
-                        binWriter.Write(Helpers.TERotationShort(FaceTextures[i].Rotation));
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion Rotation
-
-                #region Material
-                binWriter.Write(DefaultTexture.material);
-                for (int i = 0; i < materials.Length; i++)
-                {
-                    if (materials[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(materials[i]));
-                        binWriter.Write(FaceTextures[i].material);
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion Material
-
-                #region Media
-                binWriter.Write(DefaultTexture.media);
-                for (int i = 0; i < medias.Length; i++)
-                {
-                    if (medias[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(medias[i]));
-                        binWriter.Write(FaceTextures[i].media);
-                    }
-                }
-                binWriter.Write((byte)0);
-                #endregion Media
-
-                #region Glow
-                binWriter.Write(Helpers.TEGlowByte(DefaultTexture.Glow));
-                for (int i = 0; i < glows.Length; i++)
-                {
-                    if (glows[i] != UInt32.MaxValue)
-                    {
-                        binWriter.Write(GetFaceBitfieldBytes(glows[i]));
-                        binWriter.Write(Helpers.TEGlowByte(FaceTextures[i].Glow));
-                    }
-                }
-                #endregion Glow
-
-                return memStream.ToArray();
-            }
-
-            /// <summary>
-            ///
-            /// </summary>
-            /// <returns></returns>
-            public override string ToString()
-            {
-                string output = String.Empty;
-
-                output += "Default Face: " + DefaultTexture.ToString() + Helpers.NewLine;
-
-                for (int i = 0; i < FaceTextures.Length; i++)
-                {
-                    if (FaceTextures[i] != null)
-                        output += "Face " + i + ": " + FaceTextures[i].ToString() + Helpers.NewLine;
-                }
-
-                return output;
-            }
-
-            #region Helpers
-
-            private void InitializeArray(ref uint[] array)
-            {
-                for (int i = 0; i < array.Length; i++)
-                    array[i] = UInt32.MaxValue;
-            }
-
-            private bool ReadFaceBitfield(byte[] data, ref int pos, ref uint faceBits, ref uint bitfieldSize)
-            {
-                faceBits = 0;
-                bitfieldSize = 0;
-
-                if (pos >= data.Length)
-                    return false;
-
-                byte b = 0;
-                do
-                {
-                    b = data[pos];
-                    faceBits = (faceBits << 7) | (uint)(b & 0x7F);
-                    bitfieldSize += 7;
-                    pos++;
-                }
-                while ((b & 0x80) != 0);
-
-                return (faceBits != 0);
-            }
-
-            private byte[] GetFaceBitfieldBytes(uint bitfield)
-            {
-                int byteLength = 0;
-                uint tmpBitfield = bitfield;
-                while (tmpBitfield != 0)
-                {
-                    tmpBitfield >>= 7;
-                    byteLength++;
-                }
-
-                if (byteLength == 0)
-                    return new byte[1] { 0 };
-
-                byte[] bytes = new byte[byteLength];
-                for (int i = 0; i < byteLength; i++)
-                {
-                    bytes[i] = (byte)((bitfield >> (7 * (byteLength - i - 1))) & 0x7F);
-                    if (i < byteLength - 1)
-                        bytes[i] |= 0x80;
-                }
-                return bytes;
-            }
-
-            #endregion Helpers
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/ThreadUtil.cs b/old/libsl1550/libsecondlife/ThreadUtil.cs
deleted file mode 100644
index e3937b4..0000000
--- a/old/libsl1550/libsecondlife/ThreadUtil.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// Written by Peter A. Bromberg, found at
-// http://www.eggheadcafe.com/articles/20060727.asp
-
-using System;
-using System.Threading;
-
-/// <summary>
-///
-/// </summary>
-public class ThreadUtil
-{
-    /// <summary>
-    /// Delegate to wrap another delegate and its arguments
-    /// </summary>
-    /// <param name="d"></param>
-    /// <param name="args"></param>
-    delegate void DelegateWrapper(Delegate d, object[] args);
-
-    /// <summary>
-    /// An instance of DelegateWrapper which calls InvokeWrappedDelegate,
-    /// which in turn calls the DynamicInvoke method of the wrapped
-    /// delegate
-    /// </summary>
-    static DelegateWrapper wrapperInstance = new DelegateWrapper(InvokeWrappedDelegate);
-
-    /// <summary>
-    /// Callback used to call EndInvoke on the asynchronously
-    /// invoked DelegateWrapper
-    /// </summary>
-    static AsyncCallback callback = new AsyncCallback(EndWrapperInvoke);
-
-    /// <summary>
-    /// Executes the specified delegate with the specified arguments
-    /// asynchronously on a thread pool thread
-    /// </summary>
-    /// <param name="d"></param>
-    /// <param name="args"></param>
-    public static void FireAndForget(Delegate d, params object[] args)
-    {
-        // Invoke the wrapper asynchronously, which will then
-        // execute the wrapped delegate synchronously (in the
-        // thread pool thread)
-        if (d != null) wrapperInstance.BeginInvoke(d, args, callback, null);
-    }
-
-    /// <summary>
-    /// Invokes the wrapped delegate synchronously
-    /// </summary>
-    /// <param name="d"></param>
-    /// <param name="args"></param>
-    static void InvokeWrappedDelegate(Delegate d, object[] args)
-    {
-        d.DynamicInvoke(args);
-    }
-
-    /// <summary>
-    /// Calls EndInvoke on the wrapper and Close on the resulting WaitHandle
-    /// to prevent resource leaks
-    /// </summary>
-    /// <param name="ar"></param>
-    static void EndWrapperInvoke(IAsyncResult ar)
-    {
-        wrapperInstance.EndInvoke(ar);
-        ar.AsyncWaitHandle.Close();
-    }
-}
diff --git a/old/libsl1550/libsecondlife/Types.cs b/old/libsl1550/libsecondlife/Types.cs
deleted file mode 100644
index 9e73dd5..0000000
--- a/old/libsl1550/libsecondlife/Types.cs
+++ /dev/null
@@ -1,2422 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// A 128-bit Universally Unique Identifier, used throughout the Second
-    /// Life networking protocol
-    /// </summary>
-    public struct LLUUID : IComparable
-    {
-        /// <summary>The System.Guid object this struct wraps around</summary>
-        public Guid UUID;
-
-        #region Properties
-
-        /// <summary>Get a byte array of the 16 raw bytes making up the UUID</summary>
-        public byte[] Data { get { return GetBytes(); } }
-
-        #endregion Properties
-
-        #region Constructors
-
-        /// <summary>
-        /// Constructor that takes a string UUID representation
-        /// </summary>
-        /// <param name="val">A string representation of a UUID, case
-        /// insensitive and can either be hyphenated or non-hyphenated</param>
-        /// <example>LLUUID("11f8aa9c-b071-4242-836b-13b7abe0d489")</example>
-        public LLUUID(string val)
-        {
-            if (val == null)
-                UUID = new Guid();
-            else
-                UUID = new Guid(val);
-        }
-
-        /// <summary>
-        /// Constructor that takes a System.Guid object
-        /// </summary>
-        /// <param name="val">A Guid object that contains the unique identifier
-        /// to be represented by this LLUUID</param>
-        public LLUUID(Guid val)
-        {
-            UUID = val;
-        }
-
-        /// <summary>
-        /// Constructor that takes a byte array containing a UUID
-        /// </summary>
-        /// <param name="source">Byte array containing a 16 byte UUID</param>
-        /// <param name="pos">Beginning offset in the array</param>
-        public LLUUID(byte[] source, int pos)
-        {
-            UUID = LLUUID.Zero.UUID;
-            FromBytes(source, pos);
-        }
-
-        /// <summary>
-        /// Constructor that takes an unsigned 64-bit unsigned integer to
-        /// convert to a UUID
-        /// </summary>
-        /// <param name="val">64-bit unsigned integer to convert to a UUID</param>
-        public LLUUID(ulong val)
-        {
-            UUID = new Guid(0, 0, 0, BitConverter.GetBytes(val));
-        }
-
-        #endregion Constructors
-
-        #region Public Methods
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="source"></param>
-        /// <param name="pos"></param>
-        public void FromBytes(byte[] source, int pos)
-        {
-            UUID = new Guid(
-                (source[pos + 0] << 24) | (source[pos + 1] << 16) | (source[pos + 2] << 8) | source[pos + 3],
-                (short)((source[pos + 4] << 8) | source[pos + 5]),
-                (short)((source[pos + 6] << 8) | source[pos + 7]),
-                source[pos + 8], source[pos + 9], source[pos + 10], source[pos + 11],
-                source[pos + 12], source[pos + 13], source[pos + 14], source[pos + 15]);
-        }
-
-        /// <summary>
-        /// IComparable.CompareTo implementation.
-        /// </summary>
-        public int CompareTo(object obj)
-        {
-            if (obj is LLUUID)
-            {
-                LLUUID ID = (LLUUID)obj;
-                return this.UUID.CompareTo(ID.UUID);
-            }
-
-            throw new ArgumentException("object is not a LLUUID");
-        }
-
-        /// <summary>
-        /// Returns the raw bytes for this UUID
-        /// </summary>
-        /// <returns>A 16 byte array containing this UUID</returns>
-        public byte[] GetBytes()
-        {
-            byte[] bytes = UUID.ToByteArray();
-
-            byte[] output = new byte[16];
-            output[0] = bytes[3];
-            output[1] = bytes[2];
-            output[2] = bytes[1];
-            output[3] = bytes[0];
-            output[4] = bytes[5];
-            output[5] = bytes[4];
-            output[6] = bytes[7];
-            output[7] = bytes[6];
-            Buffer.BlockCopy(bytes, 8, output, 8, 8);
-
-            return output;
-        }
-
-		/// <summary>
-		/// Calculate an LLCRC (cyclic redundancy check) for this LLUUID
-		/// </summary>
-		/// <returns>The CRC checksum for this LLUUID</returns>
-		public uint CRC()
-		{
-			uint retval = 0;
-            byte[] bytes = GetBytes();
-
-            retval += (uint)((bytes[ 3] << 24) + (bytes[ 2] << 16) + (bytes[ 1] << 8) + bytes[ 0]);
-            retval += (uint)((bytes[ 7] << 24) + (bytes[ 6] << 16) + (bytes[ 5] << 8) + bytes[ 4]);
-            retval += (uint)((bytes[11] << 24) + (bytes[10] << 16) + (bytes[ 9] << 8) + bytes[ 8]);
-            retval += (uint)((bytes[15] << 24) + (bytes[14] << 16) + (bytes[13] << 8) + bytes[12]);
-
-			return retval;
-		}
-
-        /// <summary>
-        /// Get a 64-bit integer representation of the first half of this UUID
-        /// </summary>
-        /// <returns>An integer created from the first eight bytes of this UUID</returns>
-        public ulong ToULong()
-        {
-            return Helpers.BytesToUInt64(UUID.ToByteArray());
-        }
-
-        #endregion Public Methods
-
-        #region Static Methods
-
-        /// <summary>
-        /// Generate a LLUUID from a string
-        /// </summary>
-        /// <param name="val">A string representation of a UUID, case
-        /// insensitive and can either be hyphenated or non-hyphenated</param>
-        /// <example>LLUUID.Parse("11f8aa9c-b071-4242-836b-13b7abe0d489")</example>
-        public static LLUUID Parse(string val)
-        {
-            return new LLUUID(val);
-        }
-
-        /// <summary>
-        /// Generate a LLUUID from a string
-        /// </summary>
-        /// <param name="val">A string representation of a UUID, case
-        /// insensitive and can either be hyphenated or non-hyphenated</param>
-        /// <param name="result">Will contain the parsed UUID if successful,
-        /// otherwise null</param>
-        /// <returns>True if the string was successfully parse, otherwise false</returns>
-        /// <example>LLUUID.TryParse("11f8aa9c-b071-4242-836b-13b7abe0d489", result)</example>
-        public static bool TryParse(string val, out LLUUID result)
-        {
-            try
-            {
-                result = Parse(val);
-                return true;
-            }
-            catch (Exception)
-            {
-                result = LLUUID.Zero;
-                return false;
-            }
-        }
-
-        /// <summary>
-        /// Combine two UUIDs together by taking the MD5 hash of a byte array
-        /// containing both UUIDs
-        /// </summary>
-        /// <param name="first">First LLUUID to combine</param>
-        /// <param name="second">Second LLUUID to combine</param>
-        /// <returns>The UUID product of the combination</returns>
-        public static LLUUID Combine(LLUUID first, LLUUID second)
-        {
-            // Construct the buffer that MD5ed
-            byte[] input = new byte[32];
-            Buffer.BlockCopy(first.GetBytes(), 0, input, 0, 16);
-            Buffer.BlockCopy(second.GetBytes(), 0, input, 16, 16);
-
-            return new LLUUID(Helpers.MD5Builder.ComputeHash(input), 0);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-		public static LLUUID Random()
-		{
-			return new LLUUID(Guid.NewGuid());
-        }
-
-        #endregion Static Methods
-
-        #region Overrides
-
-        /// <summary>
-        /// Return a hash code for this UUID, used by .NET for hash tables
-        /// </summary>
-        /// <returns>An integer composed of all the UUID bytes XORed together</returns>
-		public override int GetHashCode()
-		{
-            return UUID.GetHashCode();
-		}
-
-        /// <summary>
-        /// Comparison function
-        /// </summary>
-        /// <param name="o">An object to compare to this UUID</param>
-        /// <returns>False if the object is not an LLUUID, true if it is and
-        /// byte for byte identical to this</returns>
-		public override bool Equals(object o)
-		{
-			if (!(o is LLUUID)) return false;
-
-			LLUUID uuid = (LLUUID)o;
-            return UUID == uuid.UUID;
-        }
-
-        /// <summary>
-        /// Get a hyphenated string representation of this UUID
-        /// </summary>
-        /// <returns>A string representation of this UUID, lowercase and
-        /// with hyphens</returns>
-        /// <example>11f8aa9c-b071-4242-836b-13b7abe0d489</example>
-        public override string ToString()
-        {
-            return UUID.ToString();
-        }
-
-        #endregion Overrides
-
-        #region Operators
-
-        /// <summary>
-        /// Equals operator
-        /// </summary>
-        /// <param name="lhs">First LLUUID for comparison</param>
-        /// <param name="rhs">Second LLUUID for comparison</param>
-        /// <returns>True if the UUIDs are byte for byte equal, otherwise false</returns>
-		public static bool operator==(LLUUID lhs, LLUUID rhs)
-		{
-            return lhs.UUID == rhs.UUID;
-		}
-
-        /// <summary>
-        /// Not equals operator
-        /// </summary>
-        /// <param name="lhs">First LLUUID for comparison</param>
-        /// <param name="rhs">Second LLUUID for comparison</param>
-        /// <returns>True if the UUIDs are not equal, otherwise true</returns>
-		public static bool operator!=(LLUUID lhs, LLUUID rhs)
-		{
-			return !(lhs == rhs);
-		}
-
-        /// <summary>
-        /// XOR operator
-        /// </summary>
-        /// <param name="lhs">First LLUUID</param>
-        /// <param name="rhs">Second LLUUID</param>
-        /// <returns>A UUID that is a XOR combination of the two input UUIDs</returns>
-        public static LLUUID operator ^(LLUUID lhs, LLUUID rhs)
-        {
-            byte[] lhsbytes = lhs.GetBytes();
-            byte[] rhsbytes = rhs.GetBytes();
-            byte[] output = new byte[16];
-
-            for (int i = 0; i < 16; i++)
-            {
-                output[i] = (byte)(lhsbytes[i] ^ rhsbytes[i]);
-            }
-
-            return new LLUUID(output, 0);
-        }
-
-        /// <summary>
-        /// String typecasting operator
-        /// </summary>
-        /// <param name="val">A UUID in string form. Case insensitive,
-        /// hyphenated or non-hyphenated</param>
-        /// <returns>A UUID built from the string representation</returns>
-        public static implicit operator LLUUID(string val)
-		{
-			return new LLUUID(val);
-        }
-
-        #endregion Operators
-
-        /// <summary>An LLUUID with a value of all zeroes</summary>
-        public static readonly LLUUID Zero = new LLUUID();
-	}
-
-    /// <summary>
-    /// A two-dimensional vector with floating-point values
-    /// </summary>
-    public struct LLVector2
-    {
-        /// <summary>X value</summary>
-        public float X;
-        /// <summary>Y value</summary>
-        public float Y;
-
-        #region Constructors
-
-        /// <summary>
-        /// Constructor, copies a single-precision vector
-        /// </summary>
-        /// <param name="vector">Single-precision vector to copy</param>
-        public LLVector2(LLVector2 vector)
-        {
-            X = vector.X;
-            Y = vector.Y;
-        }
-
-        /// <summary>
-        /// Constructor, builds a vector for individual float values
-        /// </summary>
-        /// <param name="x">X value</param>
-        /// <param name="y">Y value</param>
-        /// <param name="z">Z value</param>
-		public LLVector2(float x, float y)
-		{
-			X = x;
-			Y = y;
-        }
-
-        #endregion Constructors
-
-        #region Overrides
-
-        /// <summary>
-        /// A hash of the vector, used by .NET for hash tables
-        /// </summary>
-        /// <returns>The hashes of the individual components XORed together</returns>
-        public override int GetHashCode()
-        {
-            return (X.GetHashCode() ^ Y.GetHashCode());
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="o"></param>
-        /// <returns></returns>
-        public override bool Equals(object o)
-        {
-            if (!(o is LLVector2)) return false;
-
-            LLVector2 vector = (LLVector2)o;
-
-            return (X == vector.X && Y == vector.Y);
-        }
-
-        /// <summary>
-        /// Get a formatted string representation of the vector
-        /// </summary>
-        /// <returns>A string representation of the vector, similar to the LSL
-        /// vector to string conversion in Second Life</returns>
-        public override string ToString()
-        {
-            return String.Format(Helpers.EnUsCulture, "<{0}, {1}>", X, Y);
-        }
-
-        #endregion Overrides
-
-        #region Operators
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator ==(LLVector2 lhs, LLVector2 rhs)
-        {
-            return (lhs.X == rhs.X && lhs.Y == rhs.Y);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator !=(LLVector2 lhs, LLVector2 rhs)
-        {
-            return !(lhs == rhs);
-        }
-
-        public static LLVector2 operator +(LLVector2 lhs, LLVector2 rhs)
-        {
-            return new LLVector2(lhs.X + rhs.X, lhs.Y + rhs.Y);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static LLVector2 operator -(LLVector2 lhs, LLVector2 rhs)
-        {
-            return new LLVector2(lhs.X - rhs.X, lhs.Y - rhs.Y);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="vec"></param>
-        /// <param name="val"></param>
-        /// <returns></returns>
-        public static LLVector2 operator *(LLVector2 vec, float val)
-        {
-            return new LLVector2(vec.X * val, vec.Y * val);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="val"></param>
-        /// <param name="vec"></param>
-        /// <returns></returns>
-        public static LLVector2 operator *(float val, LLVector2 vec)
-        {
-            return new LLVector2(vec.X * val, vec.Y * val);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static LLVector2 operator *(LLVector2 lhs, LLVector2 rhs)
-        {
-            return new LLVector2(lhs.X * rhs.X, lhs.Y * rhs.Y);
-        }
-
-        #endregion Operators
-
-        /// <summary>An LLVector2 with a value of 0,0,0</summary>
-        public readonly static LLVector2 Zero = new LLVector2();
-    }
-
-    /// <summary>
-    /// A three-dimensional vector with floating-point values
-    /// </summary>
-	public struct LLVector3
-	{
-        /// <summary>X value</summary>
-        public float X;
-		/// <summary>Y value</summary>
-        public float Y;
-        /// <summary>Z value</summary>
-        public float Z;
-
-        // Used for little to big endian conversion on big endian architectures
-        private byte[] conversionBuffer;
-
-        #region Constructors
-
-        /// <summary>
-        /// Constructor, copies a single-precision vector
-        /// </summary>
-        /// <param name="vector">Single-precision vector to copy</param>
-        public LLVector3(LLVector3 vector)
-        {
-            conversionBuffer = null;
-            X = vector.X;
-            Y = vector.Y;
-            Z = vector.Z;
-        }
-
-        /// <summary>
-        /// Constructor, builds a single-precision vector from a
-        /// double-precision one
-        /// </summary>
-        /// <param name="vector">A double-precision vector</param>
-		public LLVector3(LLVector3d vector)
-		{
-            conversionBuffer = null;
-			X = (float)vector.X;
-			Y = (float)vector.Y;
-			Z = (float)vector.Z;
-		}
-
-        /// <summary>
-        /// Constructor, builds a vector from a byte array
-        /// </summary>
-        /// <param name="byteArray">Byte array containing a 12 byte vector</param>
-        /// <param name="pos">Beginning position in the byte array</param>
-		public LLVector3(byte[] byteArray, int pos)
-		{
-            conversionBuffer = null;
-            X = Y = Z = 0;
-            FromBytes(byteArray, pos);
-        }
-
-        /// <summary>
-        /// Constructor, builds a vector for individual float values
-        /// </summary>
-        /// <param name="x">X value</param>
-        /// <param name="y">Y value</param>
-        /// <param name="z">Z value</param>
-		public LLVector3(float x, float y, float z)
-		{
-            conversionBuffer = null;
-			X = x;
-			Y = y;
-			Z = z;
-        }
-
-        #endregion Constructors
-
-        #region Public Methods
-
-        /// <summary>
-        /// Builds a vector from a byte array
-        /// </summary>
-        /// <param name="byteArray">Byte array containing a 12 byte vector</param>
-        /// <param name="pos">Beginning position in the byte array</param>
-        public void FromBytes(byte[] byteArray, int pos)
-        {
-            if (!BitConverter.IsLittleEndian)
-            {
-                // Big endian architecture
-                if (conversionBuffer == null)
-                    conversionBuffer = new byte[12];
-
-                Buffer.BlockCopy(byteArray, pos, conversionBuffer, 0, 12);
-
-                Array.Reverse(conversionBuffer, 0, 4);
-                Array.Reverse(conversionBuffer, 4, 4);
-                Array.Reverse(conversionBuffer, 8, 4);
-
-                X = BitConverter.ToSingle(conversionBuffer, 0);
-                Y = BitConverter.ToSingle(conversionBuffer, 4);
-                Z = BitConverter.ToSingle(conversionBuffer, 8);
-            }
-            else
-            {
-                // Little endian architecture
-                X = BitConverter.ToSingle(byteArray, pos);
-                Y = BitConverter.ToSingle(byteArray, pos + 4);
-                Z = BitConverter.ToSingle(byteArray, pos + 8);
-            }
-        }
-
-        /// <summary>
-        /// Test if this vector is composed of all finite numbers
-        /// </summary>
-        public bool IsFinite()
-        {
-            if (Helpers.IsFinite(X) && Helpers.IsFinite(Y) && Helpers.IsFinite(Z))
-                return true;
-            else
-                return false;
-        }
-
-        /// <summary>
-        /// Returns the raw bytes for this vector
-        /// </summary>
-        /// <returns>A 12 byte array containing X, Y, and Z</returns>
-		public byte[] GetBytes()
-		{
-			byte[] byteArray = new byte[12];
-
-            Buffer.BlockCopy(BitConverter.GetBytes(X), 0, byteArray, 0, 4);
-            Buffer.BlockCopy(BitConverter.GetBytes(Y), 0, byteArray, 4, 4);
-            Buffer.BlockCopy(BitConverter.GetBytes(Z), 0, byteArray, 8, 4);
-
-			if(!BitConverter.IsLittleEndian) {
-				Array.Reverse(byteArray, 0, 4);
-				Array.Reverse(byteArray, 4, 4);
-				Array.Reverse(byteArray, 8, 4);
-			}
-
-			return byteArray;
-        }
-
-        public LLSD ToLLSD()
-        {
-            LLSDArray array = new LLSDArray();
-            array.Add(LLSD.FromReal(X));
-            array.Add(LLSD.FromReal(Y));
-            array.Add(LLSD.FromReal(Z));
-            return array;
-        }
-
-        #endregion Public Methods
-
-        #region Static Methods
-
-        public static LLVector3 FromLLSD(LLSD llsd)
-        {
-            if (llsd.Type == LLSDType.Array)
-            {
-                LLSDArray array = (LLSDArray)llsd;
-
-                if (array.Count == 3)
-                {
-                    return new LLVector3((float)array[0].AsReal(), (float)array[1].AsReal(), (float)array[2].AsReal());
-                }
-            }
-
-            return LLVector3.Zero;
-        }
-
-        /// <summary>
-        /// Calculate the magnitude of the supplied vector
-        /// </summary>
-        public static float Mag(LLVector3 v)
-        {
-            return (float)Math.Sqrt(v.X * v.X + v.Y * v.Y + v.Z * v.Z);
-        }
-
-        /// <summary>
-        /// Calculate the squared magnitude of the supplied vector
-        /// </summary>
-        /// <param name="v"></param>
-        /// <returns></returns>
-        public static float MagSquared(LLVector3 v)
-        {
-            return v.X * v.X + v.Y * v.Y + v.Z * v.Z;
-        }
-
-        /// <summary>
-        /// Returns a normalized version of the supplied vector
-        /// </summary>
-        /// <param name="vector">The vector to normalize</param>
-        /// <returns>A normalized version of the vector</returns>
-        public static LLVector3 Norm(LLVector3 vector)
-        {
-            float mag = Mag(vector);
-            return new LLVector3(vector.X / mag, vector.Y / mag, vector.Z / mag);
-        }
-
-        /// <summary>
-        /// Return the cross product of two vectors
-        /// </summary>
-        /// <param name="v1">First vector</param>
-        /// <param name="v2">Second vector</param>
-        /// <returns>Cross product of first and second vector</returns>
-        public static LLVector3 Cross(LLVector3 v1, LLVector3 v2)
-        {
-            return new LLVector3
-            (
-                v1.Y * v2.Z - v1.Z * v2.Y,
-                v1.Z * v2.X - v1.X * v2.Z,
-                v1.X * v2.Y - v1.Y * v2.X
-            );
-        }
-
-        /// <summary>
-        /// Returns the dot product of two vectors
-        /// </summary>
-        public static float Dot(LLVector3 v1, LLVector3 v2)
-        {
-            return (v1.X * v2.X) + (v1.Y * v2.Y) + (v1.Z * v2.Z);
-        }
-
-        /// <summary>
-        /// Calculates the distance between two vectors
-        /// </summary>
-        public static float Dist(LLVector3 pointA, LLVector3 pointB)
-        {
-            float xd = pointB.X - pointA.X;
-            float yd = pointB.Y - pointA.Y;
-            float zd = pointB.Z - pointA.Z;
-            return (float)Math.Sqrt(xd * xd + yd * yd + zd * zd);
-        }
-
-        public static LLVector3 Rot(LLVector3 vector, LLQuaternion rotation)
-        {
-            return vector * rotation;
-        }
-
-        public static LLVector3 Rot(LLVector3 vector, LLMatrix3 rotation)
-        {
-            return vector * rotation;
-        }
-
-        /// <summary>
-        /// Calculate the rotation between two vectors
-        /// </summary>
-        /// <param name="a">Directional vector, such as 1,0,0 for the forward face</param>
-        /// <param name="b">Target vector - normalize first with VecNorm</param>
-        public static LLQuaternion RotBetween(LLVector3 a, LLVector3 b)
-        {
-            //A and B should both be normalized
-
-            float dotProduct = Dot(a, b);
-            LLVector3 crossProduct = Cross(a, b);
-            float magProduct = Mag(a) * Mag(b);
-            double angle = Math.Acos(dotProduct / magProduct);
-            LLVector3 axis = Norm(crossProduct);
-            float s = (float)Math.Sin(angle / 2);
-
-            LLQuaternion quat = new LLQuaternion();
-            quat.X = axis.X * s;
-            quat.Y = axis.Y * s;
-            quat.Z = axis.Z * s;
-            quat.W = (float)Math.Cos(angle / 2);
-
-            return quat;
-        }
-
-        /// <summary>
-        /// Converts a vector style rotation to a quaternion
-        /// </summary>
-        /// <param name="a">Axis rotation, such as 0,0,90 for 90 degrees to the right</param>
-        /// <returns>A quaternion representing the axes of the supplied vector</returns>
-        public static LLQuaternion Axis2Rot(LLVector3 a)
-        {
-            if (a.X > 180) a.X -= 360; if (a.Y > 180) a.Y -= 360; if (a.Z > 180) a.Z -= 360;
-            if (a.X < -180) a.X += 360; if (a.Y < -180) a.Y += 360; if (a.Z < -180) a.Z += 360;
-
-            LLQuaternion rot = LLQuaternion.Identity;
-            rot.X = (float)(a.X * Helpers.DEG_TO_RAD);
-            rot.Y = (float)(a.Y * Helpers.DEG_TO_RAD);
-            rot.Z = (float)(a.Z * Helpers.DEG_TO_RAD);
-            if (a.Z > 180) rot.W = 0;
-
-            return rot;
-        }
-
-        /// <summary>
-        /// Generate an LLVector3 from a string
-        /// </summary>
-        /// <param name="val">A string representation of a 3D vector, enclosed
-        /// in arrow brackets and separated by commas</param>
-        public static LLVector3 Parse(string val)
-        {
-            char[] splitChar = { ',', ' ' };
-            string[] split = val.Replace("<", String.Empty).Replace(">", String.Empty).Split(splitChar);
-            return new LLVector3(
-                float.Parse(split[0].Trim(), Helpers.EnUsCulture),
-                float.Parse(split[1].Trim(), Helpers.EnUsCulture),
-                float.Parse(split[2].Trim(), Helpers.EnUsCulture));
-        }
-
-        public static bool TryParse(string val, out LLVector3 result)
-        {
-            try
-            {
-                result = Parse(val);
-                return true;
-            }
-            catch (Exception)
-            {
-                result = new LLVector3();
-                return false;
-            }
-        }
-
-        #endregion Static Methods
-
-        #region Overrides
-
-        /// <summary>
-        /// A hash of the vector, used by .NET for hash tables
-        /// </summary>
-        /// <returns>The hashes of the individual components XORed together</returns>
-        public override int GetHashCode()
-        {
-            return (X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode());
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="o"></param>
-        /// <returns></returns>
-		public override bool Equals(object o)
-		{
-			if (!(o is LLVector3)) return false;
-
-			LLVector3 vector = (LLVector3)o;
-
-			return (X == vector.X && Y == vector.Y && Z == vector.Z);
-        }
-
-        /// <summary>
-        /// Get a formatted string representation of the vector
-        /// </summary>
-        /// <returns>A string representation of the vector, similar to the LSL
-        /// vector to string conversion in Second Life</returns>
-        public override string ToString()
-        {
-            return String.Format(Helpers.EnUsCulture, "<{0}, {1}, {2}>", X, Y, Z);
-        }
-
-        #endregion Overrides
-
-        #region Operators
-
-		public static bool operator==(LLVector3 lhs, LLVector3 rhs)
-		{
-			return (lhs.X == rhs.X && lhs.Y == rhs.Y && lhs.Z == rhs.Z);
-		}
-
-		public static bool operator!=(LLVector3 lhs, LLVector3 rhs)
-		{
-			return !(lhs == rhs);
-		}
-
-        public static LLVector3 operator +(LLVector3 lhs, LLVector3 rhs)
-        {
-            return new LLVector3(lhs.X + rhs.X, lhs.Y + rhs.Y, lhs.Z + rhs.Z);
-        }
-
-        public static LLVector3 operator -(LLVector3 lhs, LLVector3 rhs)
-        {
-            return new LLVector3(lhs.X - rhs.X,lhs.Y - rhs.Y, lhs.Z - rhs.Z);
-        }
-
-        public static LLVector3 operator *(LLVector3 vec, float val)
-        {
-            return new LLVector3(vec.X * val, vec.Y * val, vec.Z * val);
-        }
-
-        public static LLVector3 operator *(float val, LLVector3 vec)
-        {
-            return new LLVector3(vec.X * val, vec.Y * val, vec.Z * val);
-        }
-
-        public static LLVector3 operator *(LLVector3 lhs, LLVector3 rhs)
-        {
-            return new LLVector3(lhs.X * rhs.X, lhs.Y * rhs.Y, lhs.Z * rhs.Z);
-        }
-
-        public static LLVector3 operator *(LLVector3 vec, LLQuaternion rot)
-        {
-            float rw = -rot.X * vec.X - rot.Y * vec.Y - rot.Z * vec.Z;
-            float rx =  rot.W * vec.X + rot.Y * vec.Z - rot.Z * vec.Y;
-            float ry =  rot.W * vec.Y + rot.Z * vec.X - rot.X * vec.Z;
-            float rz =  rot.W * vec.Z + rot.X * vec.Y - rot.Y * vec.X;
-
-            float nx = -rw * rot.X + rx * rot.W - ry * rot.Z + rz * rot.Y;
-            float ny = -rw * rot.Y + ry * rot.W - rz * rot.X + rx * rot.Z;
-            float nz = -rw * rot.Z + rz * rot.W - rx * rot.Y + ry * rot.X;
-
-            return new LLVector3(nx, ny, nz);
-        }
-
-        #endregion Operators
-
-        /// <summary>An LLVector3 with a value of 0,0,0</summary>
-        public readonly static LLVector3 Zero = new LLVector3();
-	}
-
-    /// <summary>
-    /// A double-precision three-dimensional vector
-    /// </summary>
-	public struct LLVector3d
-	{
-        /// <summary>X value</summary>
-        public double X;
-        /// <summary>Y value</summary>
-        public double Y;
-        /// <summary>Z value</summary>
-        public double Z;
-
-        // Used for little to big endian conversion on big endian architectures
-        private byte[] conversionBuffer;
-
-        #region Constructors
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="x"></param>
-        /// <param name="y"></param>
-        /// <param name="z"></param>
-		public LLVector3d(double x, double y, double z)
-		{
-            conversionBuffer = null;
-			X = x;
-			Y = y;
-			Z = z;
-		}
-
-        /// <summary>
-        /// Create a double precision vector from a float vector
-        /// </summary>
-        /// <param name="llv3"></param>
-        public LLVector3d(LLVector3 llv3)
-        {
-            conversionBuffer = null;
-            X = llv3.X;
-            Y = llv3.Y;
-            Z = llv3.Z;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="byteArray"></param>
-        /// <param name="pos"></param>
-		public LLVector3d(byte[] byteArray, int pos)
-		{
-            conversionBuffer = null;
-            X = Y = Z = 0;
-            FromBytes(byteArray, pos);
-        }
-
-        #endregion Constructors
-
-        #region Public Methods
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="byteArray"></param>
-        /// <param name="pos"></param>
-        public void FromBytes(byte[] byteArray, int pos)
-        {
-            if (!BitConverter.IsLittleEndian)
-            {
-                // Big endian architecture
-                if (conversionBuffer == null)
-                    conversionBuffer = new byte[24];
-
-                Buffer.BlockCopy(byteArray, pos, conversionBuffer, 0, 24);
-
-                Array.Reverse(conversionBuffer, 0, 8);
-                Array.Reverse(conversionBuffer, 8, 8);
-                Array.Reverse(conversionBuffer, 16, 8);
-
-                X = BitConverter.ToDouble(conversionBuffer, 0);
-                Y = BitConverter.ToDouble(conversionBuffer, 8);
-                Z = BitConverter.ToDouble(conversionBuffer, 16);
-            }
-            else
-            {
-                // Little endian architecture
-                X = BitConverter.ToDouble(byteArray, pos);
-                Y = BitConverter.ToDouble(byteArray, pos + 8);
-                Z = BitConverter.ToDouble(byteArray, pos + 16);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public byte[] GetBytes()
-        {
-            byte[] byteArray = new byte[24];
-
-            Buffer.BlockCopy(BitConverter.GetBytes(X), 0, byteArray, 0, 8);
-            Buffer.BlockCopy(BitConverter.GetBytes(Y), 0, byteArray, 8, 8);
-            Buffer.BlockCopy(BitConverter.GetBytes(Z), 0, byteArray, 16, 8);
-
-            if (!BitConverter.IsLittleEndian)
-            {
-                Array.Reverse(byteArray, 0, 8);
-                Array.Reverse(byteArray, 8, 8);
-                Array.Reverse(byteArray, 16, 8);
-            }
-
-            return byteArray;
-        }
-
-        public LLSD ToLLSD()
-        {
-            LLSDArray array = new LLSDArray();
-            array.Add(LLSD.FromReal(X));
-            array.Add(LLSD.FromReal(Y));
-            array.Add(LLSD.FromReal(Z));
-            return array;
-        }
-
-        #endregion Public Methods
-
-        #region Static Methods
-
-        public static LLVector3d FromLLSD(LLSD llsd)
-        {
-            if (llsd.Type == LLSDType.Array)
-            {
-                LLSDArray array = (LLSDArray)llsd;
-
-                if (array.Count == 3)
-                {
-                    return new LLVector3d(array[0].AsReal(), array[1].AsReal(), array[2].AsReal());
-                }
-            }
-
-            return LLVector3d.Zero;
-        }
-
-        /// <summary>
-        /// Calculates the distance between two vectors
-        /// </summary>
-        public static double Dist(LLVector3d pointA, LLVector3d pointB)
-        {
-            double xd = pointB.X - pointA.X;
-            double yd = pointB.Y - pointA.Y;
-            double zd = pointB.Z - pointA.Z;
-            return Math.Sqrt(xd * xd + yd * yd + zd * zd);
-        }
-
-        #endregion Static Methods
-
-        #region Overrides
-
-        /// <summary>
-        /// A hash of the vector, used by .NET for hash tables
-        /// </summary>
-        /// <returns>The hashes of the individual components XORed together</returns>
-        public override int GetHashCode()
-        {
-            return (X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode());
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="o"></param>
-        /// <returns></returns>
-        public override bool Equals(object o)
-        {
-            if (!(o is LLVector3d)) return false;
-
-            LLVector3d vector = (LLVector3d)o;
-
-            return (X == vector.X && Y == vector.Y && Z == vector.Z);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override string ToString()
-        {
-            return String.Format("<{0}, {1}, {2}>", X, Y, Z);
-        }
-
-        #endregion Overrides
-
-        #region Operators
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator ==(LLVector3d lhs, LLVector3d rhs)
-        {
-            return (lhs.X == rhs.X && lhs.Y == rhs.Y && lhs.Z == rhs.Z);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator !=(LLVector3d lhs, LLVector3d rhs)
-        {
-            return !(lhs == rhs);
-        }
-
-        #endregion Operators
-
-        /// <summary>An LLVector3d with a value of 0,0,0</summary>
-        public static readonly LLVector3d Zero = new LLVector3d();
-	}
-
-    /// <summary>
-    /// A four-dimensional vector
-    /// </summary>
-	public struct LLVector4
-	{
-        /// <summary></summary>
-        public float X;
-        /// <summary></summary>
-        public float Y;
-        /// <summary></summary>
-        public float Z;
-        /// <summary></summary>
-        public float S;
-
-        // Used for little to big endian conversion on big endian architectures
-        private byte[] conversionBuffer;
-
-        #region Constructors
-
-        /// <summary>
-        /// Constructor, sets the vector members according to parameters
-        /// </summary>
-        /// <param name="x">X value</param>
-        /// <param name="y">Y value</param>
-        /// <param name="z">Z value</param>
-        /// <param name="s">S value</param>
-        public LLVector4(float x, float y, float z, float s)
-        {
-            conversionBuffer = null;
-            X = x;
-            Y = y;
-            Z = z;
-            S = s;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="byteArray"></param>
-        /// <param name="pos"></param>
-		public LLVector4(byte[] byteArray, int pos)
-		{
-            conversionBuffer = null;
-            X = Y = Z = S = 0;
-            FromBytes(byteArray, pos);
-        }
-
-        #endregion Constructors
-
-        #region Public Methods
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="byteArray"></param>
-        /// <param name="pos"></param>
-        public void FromBytes(byte[] byteArray, int pos)
-        {
-            if (!BitConverter.IsLittleEndian)
-            {
-                // Big endian architecture
-                if (conversionBuffer == null)
-                    conversionBuffer = new byte[16];
-
-                Buffer.BlockCopy(byteArray, pos, conversionBuffer, 0, 16);
-
-                Array.Reverse(conversionBuffer, 0, 4);
-                Array.Reverse(conversionBuffer, 4, 4);
-                Array.Reverse(conversionBuffer, 8, 4);
-                Array.Reverse(conversionBuffer, 12, 4);
-
-                X = BitConverter.ToSingle(conversionBuffer, 0);
-                Y = BitConverter.ToSingle(conversionBuffer, 4);
-                Z = BitConverter.ToSingle(conversionBuffer, 8);
-                S = BitConverter.ToSingle(conversionBuffer, 12);
-            }
-            else
-            {
-                // Little endian architecture
-                X = BitConverter.ToSingle(byteArray, pos);
-                Y = BitConverter.ToSingle(byteArray, pos + 4);
-                Z = BitConverter.ToSingle(byteArray, pos + 8);
-                S = BitConverter.ToSingle(byteArray, pos + 12);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-		public byte[] GetBytes()
-		{
-			byte[] byteArray = new byte[16];
-
-            Buffer.BlockCopy(BitConverter.GetBytes(X), 0, byteArray, 0, 4);
-            Buffer.BlockCopy(BitConverter.GetBytes(Y), 0, byteArray, 4, 4);
-            Buffer.BlockCopy(BitConverter.GetBytes(Z), 0, byteArray, 8, 4);
-            Buffer.BlockCopy(BitConverter.GetBytes(S), 0, byteArray, 12, 4);
-
-			if(!BitConverter.IsLittleEndian)
-            {
-				Array.Reverse(byteArray, 0, 4);
-				Array.Reverse(byteArray, 4, 4);
-				Array.Reverse(byteArray, 8, 4);
-				Array.Reverse(byteArray, 12, 4);
-			}
-
-			return byteArray;
-        }
-
-        public LLSD ToLLSD()
-        {
-            LLSDArray array = new LLSDArray();
-            array.Add(LLSD.FromReal(X));
-            array.Add(LLSD.FromReal(Y));
-            array.Add(LLSD.FromReal(Z));
-            array.Add(LLSD.FromReal(S));
-            return array;
-        }
-
-        #endregion Public Methods
-
-        #region Static Methods
-
-        public static LLVector4 FromLLSD(LLSD llsd)
-        {
-            if (llsd.Type == LLSDType.Array)
-            {
-                LLSDArray array = (LLSDArray)llsd;
-
-                if (array.Count == 4)
-                {
-                    return new LLVector4(
-                        (float)array[0].AsReal(),
-                        (float)array[1].AsReal(),
-                        (float)array[2].AsReal(),
-                        (float)array[3].AsReal());
-                }
-            }
-
-            return LLVector4.Zero;
-        }
-
-        #endregion Static Methods
-
-        #region Overrides
-
-        /// <summary>
-        /// A hash of the vector, used by .NET for hash tables
-        /// </summary>
-        /// <returns>The hashes of the individual components XORed together</returns>
-        public override int GetHashCode()
-        {
-            return (X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode() ^ S.GetHashCode());
-        }
-         /// <summary>
-         ///
-         /// </summary>
-         /// <param name="o"></param>
-         /// <returns></returns>
-        public override bool Equals(object o)
-        {
-            if (!(o is LLVector4)) return false;
-
-            LLVector4 vector = (LLVector4)o;
-            return (X == vector.X && Y == vector.Y && Z == vector.Z && S == vector.S);
-        }
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-		public override string ToString()
-		{
-            return String.Format("<{0}, {1}, {2}, {3}>", X, Y, Z, S);
-        }
-
-        #endregion Overrides
-
-        #region Operators
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator ==(LLVector4 lhs, LLVector4 rhs)
-        {
-            return (lhs.X == rhs.X && lhs.Y == rhs.Y && lhs.Z == rhs.Z && lhs.S == rhs.S);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator !=(LLVector4 lhs, LLVector4 rhs)
-        {
-            return !(lhs == rhs);
-        }
-
-        public static LLVector4 operator +(LLVector4 lhs, LLVector4 rhs)
-        {
-            return new LLVector4(lhs.X + rhs.X, lhs.Y + rhs.Y, lhs.Z + rhs.Z, lhs.S + rhs.S);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static LLVector4 operator -(LLVector4 lhs, LLVector4 rhs)
-        {
-            return new LLVector4(lhs.X - rhs.X, lhs.Y - rhs.Y, lhs.Z - rhs.Z, lhs.S - rhs.S);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="vec"></param>
-        /// <param name="val"></param>
-        /// <returns></returns>
-        public static LLVector4 operator *(LLVector4 vec, float val)
-        {
-            return new LLVector4(vec.X * val, vec.Y * val, vec.Z * val, vec.S * val);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="val"></param>
-        /// <param name="vec"></param>
-        /// <returns></returns>
-        public static LLVector4 operator *(float val, LLVector4 vec)
-        {
-            return new LLVector4(vec.X * val, vec.Y * val, vec.Z * val, vec.S * val);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static LLVector4 operator *(LLVector4 lhs, LLVector4 rhs)
-        {
-            return new LLVector4(lhs.X * rhs.X, lhs.Y * rhs.Y, lhs.Z * rhs.Z, lhs.S * rhs.S);
-        }
-
-        #endregion Operators
-
-        /// <summary>An LLVector4 with a value of 0,0,0,0</summary>
-        public readonly static LLVector4 Zero = new LLVector4();
-	}
-
-    /// <summary>
-    /// An 8-bit color structure including an alpha channel
-    /// </summary>
-    public struct LLColor
-    {
-        /// <summary>Red</summary>
-        public float R;
-        /// <summary>Green</summary>
-        public float G;
-        /// <summary>Blue</summary>
-        public float B;
-        /// <summary>Alpha</summary>
-        public float A;
-
-        #region Constructors
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="r"></param>
-        /// <param name="g"></param>
-        /// <param name="b"></param>
-        /// <param name="a"></param>
-        public LLColor(byte r, byte g, byte b, byte a)
-        {
-            float quanta = 1.0f / 255.0f;
-
-            R = (float)r * quanta;
-            G = (float)g * quanta;
-            B = (float)b * quanta;
-            A = (float)a * quanta;
-        }
-
-        public LLColor(float r, float g, float b, float a)
-        {
-            if (r > 1f || g > 1f || b > 1f || a > 1f)
-                SecondLife.LogStatic(
-                    String.Format("Attempting to initialize LLColor with out of range values <{0},{1},{2},{3}>",
-                    r, g, b, a), Helpers.LogLevel.Warning);
-
-            // Valid range is from 0.0 to 1.0
-            R = Helpers.Clamp(r, 0f, 1f);
-            G = Helpers.Clamp(g, 0f, 1f);
-            B = Helpers.Clamp(b, 0f, 1f);
-            A = Helpers.Clamp(a, 0f, 1f);
-        }
-
-        public LLColor(byte[] byteArray, int pos, bool inverted)
-        {
-            const float quanta = 1.0f / 255.0f;
-
-            if (inverted)
-            {
-                R = (float)(255 - byteArray[pos]) * quanta;
-                G = (float)(255 - byteArray[pos + 1]) * quanta;
-                B = (float)(255 - byteArray[pos + 2]) * quanta;
-                A = (float)(255 - byteArray[pos + 3]) * quanta;
-            }
-            else
-            {
-                R = (float)byteArray[pos] * quanta;
-                G = (float)byteArray[pos + 1] * quanta;
-                B = (float)byteArray[pos + 2] * quanta;
-                A = (float)byteArray[pos + 3] * quanta;
-            }
-        }
-
-        #endregion Constructors
-
-        #region Public Methods
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public byte[] GetBytes()
-        {
-            byte[] byteArray = new byte[4];
-
-            byteArray[0] = Helpers.FloatToByte(R, 0f, 1f);
-            byteArray[1] = Helpers.FloatToByte(G, 0f, 1f);
-            byteArray[2] = Helpers.FloatToByte(B, 0f, 1f);
-            byteArray[3] = Helpers.FloatToByte(A, 0f, 1f);
-
-            return byteArray;
-        }
-
-        public byte[] GetInvertedBytes()
-        {
-            byte[] byteArray = GetBytes();
-
-            byteArray[0] = (byte)(255 - byteArray[0]);
-            byteArray[1] = (byte)(255 - byteArray[1]);
-            byteArray[2] = (byte)(255 - byteArray[2]);
-            byteArray[3] = (byte)(255 - byteArray[3]);
-
-            return byteArray;
-        }
-
-        public byte[] GetFloatBytes()
-        {
-            byte[] bytes = new byte[16];
-            Buffer.BlockCopy(BitConverter.GetBytes(R), 0, bytes, 0, 4);
-            Buffer.BlockCopy(BitConverter.GetBytes(G), 0, bytes, 4, 4);
-            Buffer.BlockCopy(BitConverter.GetBytes(B), 0, bytes, 8, 4);
-            Buffer.BlockCopy(BitConverter.GetBytes(A), 0, bytes, 12, 4);
-            return bytes;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public string ToStringRGB()
-        {
-            return String.Format("<{0}, {1}, {2}>", R, G, B);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public LLSD ToLLSD()
-        {
-            LLSDArray array = new LLSDArray();
-            array.Add(LLSD.FromReal(R));
-            array.Add(LLSD.FromReal(G));
-            array.Add(LLSD.FromReal(B));
-            array.Add(LLSD.FromReal(A));
-            return array;
-        }
-
-        #endregion Public Methods
-
-        #region Static Methods
-
-        public static LLColor FromLLSD(LLSD llsd)
-        {
-            if (llsd.Type == LLSDType.Array)
-            {
-                LLSDArray array = (LLSDArray)llsd;
-
-                if (array.Count == 4)
-                {
-                    return new LLColor(
-                        (float)array[0].AsReal(),
-                        (float)array[1].AsReal(),
-                        (float)array[2].AsReal(),
-                        (float)array[3].AsReal());
-                }
-            }
-
-            return LLColor.Black;
-        }
-
-        #endregion Static Methods
-
-        #region Overrides
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override string ToString()
-        {
-            return String.Format("<{0}, {1}, {2}, {3}>", R, G, B, A);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-        public override bool Equals(object obj)
-        {
-            if (obj is LLColor)
-            {
-                LLColor c = (LLColor)obj;
-                return (R == c.R) && (G == c.G) && (B == c.B) && (A == c.A);
-            }
-            return false;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override int GetHashCode()
-        {
-            return R.GetHashCode() ^ G.GetHashCode() ^ B.GetHashCode() ^ A.GetHashCode();
-        }
-
-        #endregion Overrides
-
-        #region Operators
-
-        /// <summary>
-        /// Comparison operator
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator ==(LLColor lhs, LLColor rhs)
-        {
-            // Return true if the fields match:
-            return lhs.R == rhs.R && lhs.G == rhs.G && lhs.B == rhs.B && lhs.A == rhs.A;
-        }
-
-        /// <summary>
-        /// Not comparison operator
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator !=(LLColor lhs, LLColor rhs)
-        {
-            return !(lhs == rhs);
-        }
-
-        #endregion Operators
-
-        /// <summary>An LLColor with zero RGB values and full alpha</summary>
-        public readonly static LLColor Black = new LLColor(0f, 0f, 0f, 1f);
-    }
-
-    /// <summary>
-    /// A quaternion, used for rotations
-    /// </summary>
-	public struct LLQuaternion
-	{
-        /// <summary>X value</summary>
-        public float X;
-        /// <summary>Y value</summary>
-        public float Y;
-        /// <summary>Z value</summary>
-        public float Z;
-        /// <summary>W value</summary>
-        public float W;
-
-        // Used for little to big endian conversion on big endian architectures
-        private byte[] conversionBuffer;
-
-        #region Constructors
-
-        /// <summary>
-        /// Constructor, builds a quaternion object from a byte array
-        /// </summary>
-        /// <param name="byteArray">The source byte array</param>
-        /// <param name="pos">Offset in the byte array to start reading at</param>
-        /// <param name="normalized">Whether the source data is normalized or
-        /// not. If this is true 12 bytes will be read, otherwise 16 bytes will
-        /// be read.</param>
-        public LLQuaternion(byte[] byteArray, int pos, bool normalized)
-        {
-            conversionBuffer = null;
-            X = Y = Z = W = 0;
-            FromBytes(byteArray, pos, normalized);
-        }
-
-        /// <summary>
-        /// Build a quaternion from normalized float values
-        /// </summary>
-        /// <param name="x">X value from -1.0 to 1.0</param>
-        /// <param name="y">Y value from -1.0 to 1.0</param>
-        /// <param name="z">Z value from -1.0 to 1.0</param>
-        public LLQuaternion(float x, float y, float z)
-        {
-            conversionBuffer = null;
-            X = x;
-            Y = y;
-            Z = z;
-
-            float xyzsum = 1 - X * X - Y * Y - Z * Z;
-            W = (xyzsum > 0) ? (float)Math.Sqrt(xyzsum) : 0;
-        }
-
-        /// <summary>
-        /// Build a quaternion from individual float values
-        /// </summary>
-        /// <param name="x">X value</param>
-        /// <param name="y">Y value</param>
-        /// <param name="z">Z value</param>
-        /// <param name="w">W value</param>
-        public LLQuaternion(float x, float y, float z, float w)
-        {
-            conversionBuffer = null;
-            X = x;
-            Y = y;
-            Z = z;
-            W = w;
-        }
-
-        /// <summary>
-        /// Build a quaternion from an angle and a vector
-        /// </summary>
-        /// <param name="angle">Angle value</param>
-        /// <param name="vector">Vector value</param>
-        public LLQuaternion(float angle, LLVector3 vector)
-        {
-            conversionBuffer = null;
-
-            vector = LLVector3.Norm(vector);
-            angle *= 0.5f;
-
-            float c = (float)Math.Cos(angle);
-            float s = (float)Math.Sin(angle);
-
-            X = vector.X * s;
-            Y = vector.Y * s;
-            Z = vector.Z * s;
-            W = c;
-
-            this = Norm(this);
-        }
-
-        #endregion Constructors
-
-        #region Public Methods
-
-        /// <summary>
-        /// Builds a quaternion object from a byte array
-        /// </summary>
-        /// <param name="byteArray">The source byte array</param>
-        /// <param name="pos">Offset in the byte array to start reading at</param>
-        /// <param name="normalized">Whether the source data is normalized or
-        /// not. If this is true 12 bytes will be read, otherwise 16 bytes will
-        /// be read.</param>
-        public void FromBytes(byte[] byteArray, int pos, bool normalized)
-        {
-            if (!normalized)
-            {
-                if (!BitConverter.IsLittleEndian)
-                {
-                    // Big endian architecture
-                    if (conversionBuffer == null)
-                        conversionBuffer = new byte[16];
-
-                    Buffer.BlockCopy(byteArray, pos, conversionBuffer, 0, 16);
-
-                    Array.Reverse(conversionBuffer, 0, 4);
-                    Array.Reverse(conversionBuffer, 4, 4);
-                    Array.Reverse(conversionBuffer, 8, 4);
-                    Array.Reverse(conversionBuffer, 12, 4);
-
-                    X = BitConverter.ToSingle(conversionBuffer, 0);
-                    Y = BitConverter.ToSingle(conversionBuffer, 4);
-                    Z = BitConverter.ToSingle(conversionBuffer, 8);
-                    W = BitConverter.ToSingle(conversionBuffer, 12);
-                }
-                else
-                {
-                    // Little endian architecture
-                    X = BitConverter.ToSingle(byteArray, pos);
-                    Y = BitConverter.ToSingle(byteArray, pos + 4);
-                    Z = BitConverter.ToSingle(byteArray, pos + 8);
-                    W = BitConverter.ToSingle(byteArray, pos + 12);
-                }
-            }
-            else
-            {
-                if (!BitConverter.IsLittleEndian)
-                {
-                    // Big endian architecture
-                    if (conversionBuffer == null)
-                        conversionBuffer = new byte[16];
-
-                    Buffer.BlockCopy(byteArray, pos, conversionBuffer, 0, 12);
-
-                    Array.Reverse(conversionBuffer, 0, 4);
-                    Array.Reverse(conversionBuffer, 4, 4);
-                    Array.Reverse(conversionBuffer, 8, 4);
-
-                    X = BitConverter.ToSingle(conversionBuffer, 0);
-                    Y = BitConverter.ToSingle(conversionBuffer, 4);
-                    Z = BitConverter.ToSingle(conversionBuffer, 8);
-                }
-                else
-                {
-                    // Little endian architecture
-                    X = BitConverter.ToSingle(byteArray, pos);
-                    Y = BitConverter.ToSingle(byteArray, pos + 4);
-                    Z = BitConverter.ToSingle(byteArray, pos + 8);
-                }
-
-                float xyzsum = 1 - X * X - Y * Y - Z * Z;
-                W = (xyzsum > 0) ? (float)Math.Sqrt(xyzsum) : 0;
-            }
-        }
-
-        /// <summary>
-        /// Normalize this quaternion and serialize it to a byte array
-        /// </summary>
-        /// <returns>A 12 byte array containing normalized X, Y, and Z floating
-        /// point values in order using little endian byte ordering</returns>
-        public byte[] GetBytes()
-        {
-            byte[] bytes = new byte[12];
-            float norm;
-
-            norm = (float)Math.Sqrt(X * X + Y * Y + Z * Z + W * W);
-
-            if (norm != 0)
-            {
-                norm = 1 / norm;
-
-                float x, y, z;
-                if (W >= 0)
-                {
-                    x = X; y = Y; z = Z;
-                }
-                else
-                {
-                    x = -X; y = -Y; z = -Z;
-                }
-
-                Buffer.BlockCopy(BitConverter.GetBytes(norm * x), 0, bytes, 0, 4);
-                Buffer.BlockCopy(BitConverter.GetBytes(norm * y), 0, bytes, 4, 4);
-                Buffer.BlockCopy(BitConverter.GetBytes(norm * z), 0, bytes, 8, 4);
-
-                if (!BitConverter.IsLittleEndian)
-                {
-                    Array.Reverse(bytes, 0, 4);
-                    Array.Reverse(bytes, 4, 4);
-                    Array.Reverse(bytes, 8, 4);
-                }
-            }
-            else
-            {
-                throw new Exception("Quaternion " + this.ToString() + " normalized to zero");
-            }
-
-            return bytes;
-        }
-
-
-        public LLSD ToLLSD()
-        {
-            LLSDArray array = new LLSDArray();
-            array.Add(LLSD.FromReal(X));
-            array.Add(LLSD.FromReal(Y));
-            array.Add(LLSD.FromReal(Z));
-            array.Add(LLSD.FromReal(W));
-            return array;
-        }
-
-        #endregion Public Methods
-
-        #region Static Methods
-
-        public static LLQuaternion FromLLSD(LLSD llsd)
-        {
-            if (llsd.Type == LLSDType.Array)
-            {
-                LLSDArray array = (LLSDArray)llsd;
-
-                if (array.Count == 4)
-                {
-                    return new LLQuaternion(
-                        (float)array[0].AsReal(),
-                        (float)array[1].AsReal(),
-                        (float)array[2].AsReal(),
-                        (float)array[3].AsReal());
-                }
-            }
-
-            return LLQuaternion.Identity;
-        }
-
-        /// <summary>
-        /// Calculate the magnitude of the supplied quaternion
-        /// </summary>
-        public static float Mag(LLQuaternion q)
-        {
-            return (float)Math.Sqrt(q.W * q.W + q.X * q.X + q.Y * q.Y + q.Z * q.Z);
-        }
-
-        /// <summary>
-        /// Returns a normalized version of the supplied quaternion
-        /// </summary>
-        /// <param name="q">The quaternion to normalize</param>
-        /// <returns>A normalized version of the quaternion</returns>
-        public static LLQuaternion Norm(LLQuaternion q)
-        {
-            const float MAG_THRESHOLD = 0.0000001f;
-            float mag = (float)Math.Sqrt(q.X * q.X + q.Y * q.Y + q.Z * q.Z + q.W * q.W);
-
-            if (mag > MAG_THRESHOLD)
-            {
-                float oomag = 1.0f / mag;
-                q.X *= oomag;
-                q.Y *= oomag;
-                q.Z *= oomag;
-                q.W *= oomag;
-            }
-            else
-            {
-                q.X = 0.0f;
-                q.Y = 0.0f;
-                q.Z = 0.0f;
-                q.W = 1.0f;
-            }
-
-            return q;
-        }
-
-        /// <summary>
-        /// Returns the inverse matrix from a quaternion, or the correct
-        /// matrix if the quaternion is inverse
-        /// </summary>
-        /// <param name="q">Quaternion to convert to a matrix</param>
-        /// <returns>A matrix representation of the quaternion</returns>
-        public static LLMatrix3 GetMatrix(LLQuaternion q)
-        {
-            LLMatrix3 m;
-            float xx, xy, xz, xw, yy, yz, yw, zz, zw;
-
-            xx = q.X * q.X;
-            xy = q.X * q.Y;
-            xz = q.X * q.Z;
-            xw = q.X * q.W;
-
-            yy = q.Y * q.Y;
-            yz = q.Y * q.Z;
-            yw = q.Y * q.W;
-
-            zz = q.Z * q.Z;
-            zw = q.Z * q.W;
-
-            m.M11 = 1f - 2f * (yy + zz);
-            m.M12 = 2f * (xy + zw);
-            m.M13 = 2f * (xz - yw);
-
-            m.M21 = 2f * (xy - zw);
-            m.M22 = 1f - 2f * (xx + zz);
-            m.M23 = 2f * (yz + xw);
-
-            m.M31 = 2f * (xz + yw);
-            m.M32 = 2f * (yz - xw);
-            m.M33 = 1f - 2f * (xx + yy);
-
-            return m;
-        }
-
-        public static LLQuaternion SetQuaternion(float angle, float x, float y, float z)
-        {
-            LLVector3 vec = new LLVector3(x, y, z);
-            return SetQuaternion(angle, vec);
-        }
-
-        public static LLQuaternion SetQuaternion(float angle, LLVector3 vec)
-        {
-            LLQuaternion quat = new LLQuaternion();
-            vec = LLVector3.Norm(vec);
-
-            angle *= 0.5f;
-            float c = (float)Math.Cos(angle);
-            float s = (float)Math.Sin(angle);
-
-            quat.X = vec.X * s;
-            quat.Y = vec.Y * s;
-            quat.Z = vec.Z * s;
-            quat.W = c;
-
-            quat = LLQuaternion.Norm(quat);
-            return quat;
-        }
-
-        #endregion Static Methods
-
-        #region Overrides
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override int GetHashCode()
-        {
-            return (X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode());
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="o"></param>
-        /// <returns></returns>
-        public override bool Equals(object o)
-        {
-            if (!(o is LLQuaternion)) return false;
-
-            LLQuaternion quaternion = (LLQuaternion)o;
-
-            return X == quaternion.X && Y == quaternion.Y && Z == quaternion.Z && W == quaternion.W;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <returns></returns>
-        public override string ToString()
-        {
-            return "<" + X.ToString() + ", " + Y.ToString() + ", " + Z.ToString() + ", " + W.ToString() + ">";
-        }
-
-        #endregion Overrides
-
-        #region Operators
-
-        /// <summary>
-        /// Comparison operator
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator ==(LLQuaternion lhs, LLQuaternion rhs)
-        {
-            // Return true if the fields match:
-            return lhs.X == rhs.X && lhs.Y == rhs.Y && lhs.Z == rhs.Z && lhs.W == rhs.W;
-        }
-
-        /// <summary>
-        /// Not comparison operator
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static bool operator !=(LLQuaternion lhs, LLQuaternion rhs)
-        {
-            return !(lhs == rhs);
-        }
-
-        /// <summary>
-        /// Multiplication operator
-        /// </summary>
-        /// <param name="lhs"></param>
-        /// <param name="rhs"></param>
-        /// <returns></returns>
-        public static LLQuaternion operator *(LLQuaternion lhs, LLQuaternion rhs)
-        {
-            LLQuaternion ret = new LLQuaternion();
-            ret.W = lhs.W * rhs.W - lhs.X * rhs.X - lhs.Y * rhs.Y - lhs.Z * rhs.Z;
-            ret.X = lhs.W * rhs.X + lhs.X * rhs.W + lhs.Y * rhs.Z - lhs.Z * rhs.Y;
-            ret.Y = lhs.W * rhs.Y + lhs.Y * rhs.W + lhs.Z * rhs.X - lhs.X * rhs.Z;
-            ret.Z = lhs.W * rhs.Z + lhs.Z * rhs.W + lhs.X * rhs.Y - lhs.Y * rhs.X;
-            return ret;
-        }
-
-        #endregion Operators
-
-        /// <summary>An LLQuaternion with a value of 0,0,0,1</summary>
-        public readonly static LLQuaternion Identity = new LLQuaternion(0f, 0f, 0f, 1f);
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-    public struct LLMatrix3
-    {
-        public float M11, M12, M13;
-        public float M21, M22, M23;
-        public float M31, M32, M33;
-
-        #region Properties
-
-        public float Trace
-        {
-            get
-            {
-                return M11 + M22 + M33;
-            }
-        }
-
-        public float Determinant
-        {
-            get
-            {
-                return M11 * M22 * M33 + M12 * M23 * M31 + M13 * M21 * M32 -
-                       M13 * M22 * M31 - M11 * M23 * M32 - M12 * M21 * M33;
-            }
-        }
-
-        #endregion Properties
-
-        #region Constructors
-
-        public LLMatrix3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33)
-        {
-            M11 = m11;
-            M12 = m12;
-            M13 = m13;
-            M21 = m21;
-            M22 = m22;
-            M23 = m23;
-            M31 = m31;
-            M32 = m32;
-            M33 = m33;
-        }
-
-        public LLMatrix3(LLMatrix3 m)
-        {
-            M11 = m.M11;
-            M12 = m.M12;
-            M13 = m.M13;
-            M21 = m.M21;
-            M22 = m.M22;
-            M23 = m.M23;
-            M31 = m.M31;
-            M32 = m.M32;
-            M33 = m.M33;
-        }
-
-        public LLMatrix3(LLQuaternion q)
-        {
-            this = LLQuaternion.GetMatrix(q);
-        }
-
-        #endregion Constructors
-
-        #region Public Methods
-
-        /// <summary>
-        /// Transposes this matrix
-        /// </summary>
-        public void Transpose()
-        {
-            Helpers.Swap<float>(ref M12, ref M21);
-            Helpers.Swap<float>(ref M13, ref M31);
-            Helpers.Swap<float>(ref M23, ref M32);
-        }
-
-        public void Orthogonalize()
-        {
-            LLVector3 xAxis = this[0];
-            LLVector3 yAxis = this[1];
-            LLVector3 zAxis = this[2];
-
-            xAxis = LLVector3.Norm(xAxis);
-            yAxis -= xAxis * (xAxis * yAxis);
-            yAxis = LLVector3.Norm(yAxis);
-            zAxis = LLVector3.Cross(xAxis, yAxis);
-
-            this[0] = xAxis;
-            this[1] = yAxis;
-            this[2] = zAxis;
-        }
-
-        public void GetEulerAngles(out float roll, out float pitch, out float yaw)
-        {
-            // From the Matrix and Quaternion FAQ: http://www.j3d.org/matrix_faq/matrfaq_latest.html
-
-            double angleX, angleY, angleZ;
-            double cx, cy, cz; // cosines
-            double sx, sz; // sines
-
-            angleY = Math.Asin(Helpers.Clamp(M31, -1f, 1f));
-            cy = Math.Cos(angleY);
-
-            if (Math.Abs(cy) > 0.005f)
-            {
-                // No gimbal lock
-                cx = M33 / cy;
-                sx = (-M32) / cy;
-
-                angleX = (float)Math.Atan2(sx, cx);
-
-                cz = M11 / cy;
-                sz = (-M21) / cy;
-
-                angleZ = (float)Math.Atan2(sz, cz);
-            }
-            else
-            {
-                // Gimbal lock
-                angleX = 0;
-
-                cz = M22;
-                sz = M12;
-
-                angleZ = Math.Atan2(sz, cz);
-            }
-
-            roll = (float)angleX;
-            pitch = (float)angleY;
-            yaw = (float)angleZ;
-        }
-
-        #endregion Public Methods
-
-        #region Static Methods
-
-        public static LLMatrix3 Add(LLMatrix3 left, LLMatrix3 right)
-        {
-            return new LLMatrix3(
-                left.M11 + right.M11, left.M12 + right.M12, left.M13 + right.M13,
-                left.M21 + right.M21, left.M22 + right.M22, left.M23 + right.M23,
-                left.M31 + right.M31, left.M32 + right.M32, left.M33 + right.M33
-            );
-        }
-
-        public static LLMatrix3 Add(LLMatrix3 matrix, float scalar)
-        {
-            return new LLMatrix3(
-                matrix.M11 + scalar, matrix.M12 + scalar, matrix.M13 + scalar,
-                matrix.M21 + scalar, matrix.M22 + scalar, matrix.M23 + scalar,
-                matrix.M31 + scalar, matrix.M32 + scalar, matrix.M33 + scalar
-            );
-        }
-
-        public static LLMatrix3 Subtract(LLMatrix3 left, LLMatrix3 right)
-        {
-            return new LLMatrix3(
-                left.M11 - right.M11, left.M12 - right.M12, left.M13 - right.M13,
-                left.M21 - right.M21, left.M22 - right.M22, left.M23 - right.M23,
-                left.M31 - right.M31, left.M32 - right.M32, left.M33 - right.M33
-                );
-        }
-
-        public static LLMatrix3 Subtract(LLMatrix3 matrix, float scalar)
-        {
-            return new LLMatrix3(
-                matrix.M11 - scalar, matrix.M12 - scalar, matrix.M13 - scalar,
-                matrix.M21 - scalar, matrix.M22 - scalar, matrix.M23 - scalar,
-                matrix.M31 - scalar, matrix.M32 - scalar, matrix.M33 - scalar
-                );
-        }
-
-        public static LLMatrix3 Multiply(LLMatrix3 left, LLMatrix3 right)
-        {
-            return new LLMatrix3(
-                left.M11 * right.M11 + left.M12 * right.M21 + left.M13 * right.M31,
-                left.M11 * right.M12 + left.M12 * right.M22 + left.M13 * right.M32,
-                left.M11 * right.M13 + left.M12 * right.M23 + left.M13 * right.M33,
-
-                left.M21 * right.M11 + left.M22 * right.M21 + left.M23 * right.M31,
-                left.M21 * right.M12 + left.M22 * right.M22 + left.M23 * right.M32,
-                left.M21 * right.M13 + left.M22 * right.M23 + left.M23 * right.M33,
-
-                left.M31 * right.M11 + left.M32 * right.M21 + left.M33 * right.M31,
-                left.M31 * right.M12 + left.M32 * right.M22 + left.M33 * right.M32,
-                left.M31 * right.M13 + left.M32 * right.M23 + left.M33 * right.M33
-            );
-        }
-
-        public static LLVector3 Transform(LLVector3 vector, LLMatrix3 matrix)
-        {
-            // Operates "from the right" on row vector
-            return new LLVector3(
-                vector.X * matrix.M11 + vector.Y * matrix.M21 + vector.Z * matrix.M31,
-                vector.X * matrix.M12 + vector.Y * matrix.M22 + vector.Z * matrix.M32,
-                vector.X * matrix.M13 + vector.Y * matrix.M23 + vector.Z * matrix.M33
-            );
-        }
-
-        public static LLMatrix3 Transpose(LLMatrix3 m)
-        {
-            LLMatrix3 t = new LLMatrix3(m);
-            t.Transpose();
-            return t;
-        }
-
-        #endregion Static Methods
-
-        #region Overrides
-
-        public override int GetHashCode()
-        {
-            return
-                M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode() ^
-                M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode() ^
-                M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode();
-        }
-
-        public override bool Equals(object obj)
-        {
-            if (obj is LLMatrix3)
-            {
-                LLMatrix3 m = (LLMatrix3)obj;
-                return
-                    (M11 == m.M11) && (M12 == m.M12) && (M13 == m.M13) &&
-                    (M21 == m.M21) && (M22 == m.M22) && (M23 == m.M23) &&
-                    (M31 == m.M31) && (M32 == m.M32) && (M33 == m.M33);
-            }
-            return false;
-        }
-
-        public override string ToString()
-        {
-            return string.Format("[{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}]",
-                M11, M12, M13, M21, M22, M23, M31, M32, M33);
-        }
-
-        #endregion Overrides
-
-        #region Operators
-
-        public static bool operator ==(LLMatrix3 left, LLMatrix3 right)
-        {
-            return ValueType.Equals(left, right);
-        }
-
-        public static bool operator !=(LLMatrix3 left, LLMatrix3 right)
-        {
-            return !ValueType.Equals(left, right);
-        }
-
-        public static LLMatrix3 operator +(LLMatrix3 left, LLMatrix3 right)
-        {
-            return LLMatrix3.Add(left, right);
-        }
-
-        public static LLMatrix3 operator +(LLMatrix3 matrix, float scalar)
-        {
-            return LLMatrix3.Add(matrix, scalar);
-        }
-
-        public static LLMatrix3 operator +(float scalar, LLMatrix3 matrix)
-        {
-            return LLMatrix3.Add(matrix, scalar);
-        }
-
-        public static LLMatrix3 operator -(LLMatrix3 left, LLMatrix3 right)
-        {
-            return LLMatrix3.Subtract(left, right); ;
-        }
-
-        public static LLMatrix3 operator -(LLMatrix3 matrix, float scalar)
-        {
-            return LLMatrix3.Subtract(matrix, scalar);
-        }
-
-        public static LLMatrix3 operator *(LLMatrix3 left, LLMatrix3 right)
-        {
-            return LLMatrix3.Multiply(left, right); ;
-        }
-
-        public static LLVector3 operator *(LLVector3 vector, LLMatrix3 matrix)
-        {
-            return LLMatrix3.Transform(vector, matrix);
-        }
-
-        public LLVector3 this[int row]
-        {
-            get
-            {
-                switch (row)
-                {
-                    case 0:
-                        return new LLVector3(M11, M12, M13);
-                    case 1:
-                        return new LLVector3(M21, M22, M23);
-                    case 2:
-                        return new LLVector3(M31, M32, M33);
-                    default:
-                        throw new IndexOutOfRangeException("LLMatrix3 row index must be from 0-2");
-                }
-            }
-            set
-            {
-                switch (row)
-                {
-                    case 0:
-                        M11 = value.X;
-                        M12 = value.Y;
-                        M13 = value.Z;
-                        break;
-                    case 1:
-                        M21 = value.X;
-                        M22 = value.Y;
-                        M23 = value.Z;
-                        break;
-                    case 2:
-                        M31 = value.X;
-                        M32 = value.Y;
-                        M33 = value.Z;
-                        break;
-                    default:
-                        throw new IndexOutOfRangeException("LLMatrix3 row index must be from 0-2");
-                }
-            }
-        }
-
-        public float this[int row, int column]
-        {
-            get
-            {
-                switch (row)
-                {
-                    case 0:
-                        switch (column)
-                        {
-                            case 0:
-                                return M11;
-                            case 1:
-                                return M12;
-                            case 2:
-                                return M13;
-                            default:
-                                throw new IndexOutOfRangeException("LLMatrix3 row and column values must be from 0-2");
-                        }
-                    case 1:
-                        switch (column)
-                        {
-                            case 0:
-                                return M21;
-                            case 1:
-                                return M22;
-                            case 2:
-                                return M23;
-                            default:
-                                throw new IndexOutOfRangeException("LLMatrix3 row and column values must be from 0-2");
-                        }
-                    case 2:
-                        switch (column)
-                        {
-                            case 0:
-                                return M31;
-                            case 1:
-                                return M32;
-                            case 2:
-                                return M33;
-                            default:
-                                throw new IndexOutOfRangeException("LLMatrix3 row and column values must be from 0-2");
-                        }
-                    default:
-                        throw new IndexOutOfRangeException("LLMatrix3 row and column values must be from 0-2");
-                }
-            }
-            set
-            {
-                //FIXME:
-                throw new NotImplementedException();
-            }
-        }
-
-        #endregion Operators
-
-        /// <summary>A 3x3 matrix set to all zeroes</summary>
-        public static readonly LLMatrix3 Zero = new LLMatrix3();
-        /// <summary>A 3x3 identity matrix</summary>
-        public static readonly LLMatrix3 Identity = new LLMatrix3(
-            1f, 0f, 0f,
-            0f, 1f, 0f,
-            0f, 0f, 1f
-        );
-    }
-}
diff --git a/old/libsl1550/libsecondlife/UDPBase.cs b/old/libsl1550/libsecondlife/UDPBase.cs
deleted file mode 100644
index 7e76191..0000000
--- a/old/libsl1550/libsecondlife/UDPBase.cs
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * Copyright (c) 2006, Clutch, Inc.
- * Original Author: Jeff Cesnik
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-
-namespace libsecondlife
-{
-    // this class encapsulates a single packet that
-    // is either sent or received by a UDP socket
-    public class UDPPacketBuffer
-    {
-        // size of the buffer
-        public const int BUFFER_SIZE = 2048;
-        /// <summary>Size of the temporary buffer for zerodecoding and
-        /// zeroencoding this packet</summary>
-        public const int ZERO_BUFFER_SIZE = 4096;
-        // the buffer itself
-        public byte[] Data;
-        /// <summary>Temporary buffer used for zerodecoding and zeroencoding
-        /// this packet</summary>
-        public byte[] ZeroData;
-        // length of data to transmit
-        public int DataLength;
-        // the (IP)Endpoint of the remote host
-        // this will be filled in by the call to udpSocket.BeginReceiveFrom
-        public EndPoint RemoteEndPoint;
-
-        /// <summary>
-        /// Create an allocated UDP packet buffer for receiving a packet
-        /// </summary>
-        public UDPPacketBuffer()
-        {
-            Data = new byte[UDPPacketBuffer.BUFFER_SIZE];
-            ZeroData = new byte[UDPPacketBuffer.ZERO_BUFFER_SIZE];
-            // Will be modified later by BeginReceiveFrom()
-            RemoteEndPoint = (EndPoint)new IPEndPoint(IPAddress.Any, 0);
-        }
-
-        public UDPPacketBuffer(IPEndPoint endPoint, bool allocate)
-        {
-            if (allocate) Data = new byte[UDPPacketBuffer.BUFFER_SIZE];
-            ZeroData = new byte[UDPPacketBuffer.ZERO_BUFFER_SIZE];
-            RemoteEndPoint = (EndPoint)endPoint;
-        }
-
-        public UDPPacketBuffer(EndPoint endPoint, bool allocate, bool allocateZero)
-        {
-            if (allocate) Data = new byte[UDPPacketBuffer.BUFFER_SIZE];
-            if (allocateZero) ZeroData = new byte[UDPPacketBuffer.ZERO_BUFFER_SIZE];
-            RemoteEndPoint = endPoint;
-        }
-    }
-
-    public class PacketBufferPool : ObjectPoolBase<UDPPacketBuffer>
-    {
-        private IPEndPoint EndPoint;
-
-        /// <summary>
-        /// Initialize the object pool in client mode
-        /// </summary>
-        /// <param name="endPoint">Server to connect to</param>
-        /// <param name="itemsPerSegment"></param>
-        /// <param name="minSegments"></param>
-        public PacketBufferPool(IPEndPoint endPoint, int itemsPerSegment, int minSegments)
-            : base()
-        {
-            EndPoint = endPoint;
-            Initialize(itemsPerSegment, minSegments, true, 1000 * 60 * 5);
-        }
-
-        /// <summary>
-        /// Initialize the object pool in server mode
-        /// </summary>
-        /// <param name="port"></param>
-        /// <param name="itemsPerSegment"></param>
-        /// <param name="minSegments"></param>
-        public PacketBufferPool(int itemsPerSegment, int minSegments)
-            : base()
-        {
-            EndPoint = null;
-            Initialize(itemsPerSegment, minSegments, true, 1000 * 60 * 5);
-        }
-
-        protected override UDPPacketBuffer GetObjectInstance()
-        {
-            if (EndPoint != null)
-                return new UDPPacketBuffer(EndPoint, true);
-            else
-                return new UDPPacketBuffer();
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public abstract class UDPBase
-    {
-        // these abstract methods must be implemented in a derived class to actually do
-        // something with the packets that are sent and received.
-        protected abstract void PacketReceived(UDPPacketBuffer buffer);
-        protected abstract void PacketSent(UDPPacketBuffer buffer, int bytesSent);
-
-        // the port to listen on
-        internal int udpPort;
-
-        // the UDP socket
-        private Socket udpSocket;
-
-        private PacketBufferPool _bufferPool;
-
-        // the ReaderWriterLock is used solely for the purposes of shutdown (Stop()).
-        // since there are potentially many "reader" threads in the internal .NET IOCP
-        // thread pool, this is a cheaper synchronization primitive than using
-        // a Mutex object.  This allows many UDP socket "reads" concurrently - when
-        // Stop() is called, it attempts to obtain a writer lock which will then
-        // wait until all outstanding operations are completed before shutting down.
-        // this avoids the problem of closing the socket with outstanding operations
-        // and trying to catch the inevitable ObjectDisposedException.
-#if PocketPC
-        private libsecondlife.ReaderWriterLock rwLock = new libsecondlife.ReaderWriterLock();
-#else
-        private ReaderWriterLock rwLock = new ReaderWriterLock();
-#endif
-
-        // number of outstanding operations.  This is a reference count
-        // which we use to ensure that the threads exit cleanly. Note that
-        // we need this because the threads will potentially still need to process
-        // data even after the socket is closed.
-        private int rwOperationCount = 0;
-
-        // the all important shutdownFlag.  This is synchronized through the ReaderWriterLock.
-        private bool shutdownFlag = true;
-
-        //
-        private IPEndPoint remoteEndPoint = null;
-
-
-        /// <summary>
-        /// Initialize the UDP packet handler in server mode
-        /// </summary>
-        /// <param name="port">Port to listening for incoming UDP packets on</param>
-        public UDPBase(int port)
-        {
-            udpPort = port;
-            _bufferPool = new PacketBufferPool(new IPEndPoint(IPAddress.Any, udpPort), 64, 1);
-        }
-
-        /// <summary>
-        /// Initialize the UDP packet handler in client mode
-        /// </summary>
-        /// <param name="endPoint">Remote UDP server to connect to</param>
-        public UDPBase(IPEndPoint endPoint)
-        {
-            remoteEndPoint = endPoint;
-            udpPort = 0;
-            _bufferPool = new PacketBufferPool(endPoint, 64, 1);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void Start()
-        {
-            if (shutdownFlag)
-            {
-                if (remoteEndPoint == null)
-                {
-                    // Server mode
-
-                    // create and bind the socket
-                    IPEndPoint ipep = new IPEndPoint(IPAddress.Any, udpPort);
-                    udpSocket = new Socket(
-                        AddressFamily.InterNetwork,
-                        SocketType.Dgram,
-                        ProtocolType.Udp);
-                    udpSocket.Bind(ipep);
-                }
-                else
-                {
-                    // Client mode
-                    IPEndPoint ipep = new IPEndPoint(IPAddress.Any, udpPort);
-                    udpSocket = new Socket(
-                        AddressFamily.InterNetwork,
-                        SocketType.Dgram,
-                        ProtocolType.Udp);
-                    udpSocket.Bind(ipep);
-                    //udpSocket.Connect(remoteEndPoint);
-                }
-
-                // we're not shutting down, we're starting up
-                shutdownFlag = false;
-
-                // kick off an async receive.  The Start() method will return, the
-                // actual receives will occur asynchronously and will be caught in
-                // AsyncEndRecieve().
-                AsyncBeginReceive();
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void Stop()
-        {
-            if (!shutdownFlag)
-            {
-                // wait indefinitely for a writer lock.  Once this is called, the .NET runtime
-                // will deny any more reader locks, in effect blocking all other send/receive
-                // threads.  Once we have the lock, we set shutdownFlag to inform the other
-                // threads that the socket is closed.
-                rwLock.AcquireWriterLock(-1);
-                shutdownFlag = true;
-                udpSocket.Close();
-                rwLock.ReleaseWriterLock();
-
-                // wait for any pending operations to complete on other
-                // threads before exiting.
-                while (rwOperationCount > 0)
-                    Thread.Sleep(1);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public bool IsRunning
-        {
-            get { return !shutdownFlag; }
-        }
-
-        private void AsyncBeginReceive()
-        {
-            // this method actually kicks off the async read on the socket.
-            // we aquire a reader lock here to ensure that no other thread
-            // is trying to set shutdownFlag and close the socket.
-            rwLock.AcquireReaderLock(-1);
-
-            if (!shutdownFlag)
-            {
-                // increment the count of pending operations
-                Interlocked.Increment(ref rwOperationCount);
-
-                // allocate a packet buffer
-                WrappedObject<UDPPacketBuffer> buf = _bufferPool.CheckOut();
-                //UDPPacketBuffer buf = new UDPPacketBuffer();
-
-                try
-                {
-                    // kick off an async read
-                    udpSocket.BeginReceiveFrom(
-                        buf.Instance.Data,
-                        //buf.Data,
-                        0,
-                        UDPPacketBuffer.BUFFER_SIZE,
-                        SocketFlags.None,
-                        ref buf.Instance.RemoteEndPoint,
-                        new AsyncCallback(AsyncEndReceive),
-                        buf);
-                }
-                catch (SocketException)
-                {
-                    // something bad happened
-                    //SecondLife.LogStatic(
-                    //    "A SocketException occurred in UDPServer.AsyncBeginReceive()",
-                    //    Helpers.LogLevel.Error, se);
-
-                    // an error occurred, therefore the operation is void.  Decrement the reference count.
-                    Interlocked.Decrement(ref rwOperationCount);
-                }
-            }
-
-            // we're done with the socket for now, release the reader lock.
-            rwLock.ReleaseReaderLock();
-        }
-
-        private void AsyncEndReceive(IAsyncResult iar)
-        {
-            // Asynchronous receive operations will complete here through the call
-            // to AsyncBeginReceive
-
-            // aquire a reader lock
-            rwLock.AcquireReaderLock(-1);
-
-            if (!shutdownFlag)
-            {
-                // start another receive - this keeps the server going!
-                AsyncBeginReceive();
-
-                // get the buffer that was created in AsyncBeginReceive
-                // this is the received data
-                WrappedObject<UDPPacketBuffer> wrappedBuffer = (WrappedObject<UDPPacketBuffer>)iar.AsyncState;
-                UDPPacketBuffer buffer = wrappedBuffer.Instance;
-                //UDPPacketBuffer buffer = (UDPPacketBuffer)iar.AsyncState;
-
-                try
-                {
-                    // get the length of data actually read from the socket, store it with the
-                    // buffer
-                    buffer.DataLength = udpSocket.EndReceiveFrom(iar, ref buffer.RemoteEndPoint);
-
-                    // this operation is now complete, decrement the reference count
-                    Interlocked.Decrement(ref rwOperationCount);
-
-                    // we're done with the socket, release the reader lock
-                    rwLock.ReleaseReaderLock();
-
-                    // call the abstract method PacketReceived(), passing the buffer that
-                    // has just been filled from the socket read.
-                    PacketReceived(buffer);
-                }
-                catch (SocketException)
-                {
-                    // something bad happened
-                    //SecondLife.LogStatic(
-                    //    "A SocketException occurred in UDPServer.AsyncEndReceive()",
-                    //    Helpers.LogLevel.Error, se);
-
-                    // an error occurred, therefore the operation is void.  Decrement the reference count.
-                    Interlocked.Decrement(ref rwOperationCount);
-
-                    // we're done with the socket for now, release the reader lock.
-                    rwLock.ReleaseReaderLock();
-                }
-
-                wrappedBuffer.Dispose();
-            }
-            else
-            {
-                // nothing bad happened, but we are done with the operation
-                // decrement the reference count and release the reader lock
-                Interlocked.Decrement(ref rwOperationCount);
-                rwLock.ReleaseReaderLock();
-            }
-        }
-
-        public void AsyncBeginSend(UDPPacketBuffer buf)
-        {
-            rwLock.AcquireReaderLock(-1);
-
-            if (!shutdownFlag)
-            {
-                try
-                {
-                    Interlocked.Increment(ref rwOperationCount);
-                    udpSocket.BeginSendTo(
-                        buf.Data,
-                        0,
-                        buf.DataLength,
-                        SocketFlags.None,
-                        buf.RemoteEndPoint,
-                        new AsyncCallback(AsyncEndSend),
-                        buf);
-                }
-                catch (SocketException)
-                {
-                    //SecondLife.LogStatic(
-                    //    "A SocketException occurred in UDPServer.AsyncBeginSend()",
-                    //    Helpers.LogLevel.Error, se);
-                }
-            }
-
-            rwLock.ReleaseReaderLock();
-        }
-
-        private void AsyncEndSend(IAsyncResult iar)
-        {
-            rwLock.AcquireReaderLock(-1);
-
-            if (!shutdownFlag)
-            {
-                UDPPacketBuffer buffer = (UDPPacketBuffer)iar.AsyncState;
-
-                try
-                {
-                    int bytesSent = udpSocket.EndSendTo(iar);
-
-                    // note that call to the abstract PacketSent() method - we are passing the number
-                    // of bytes sent in a separate parameter, since we can't use buffer.DataLength which
-                    // is the number of bytes to send (or bytes received depending upon whether this
-                    // buffer was part of a send or a receive).
-                    PacketSent(buffer, bytesSent);
-                }
-                catch (SocketException)
-                {
-                    //SecondLife.LogStatic(
-                    //    "A SocketException occurred in UDPServer.AsyncEndSend()",
-                    //    Helpers.LogLevel.Error, se);
-                }
-            }
-
-            Interlocked.Decrement(ref rwOperationCount);
-            rwLock.ReleaseReaderLock();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/VisualParamGenerator/VisualParamGenerator.cs b/old/libsl1550/libsecondlife/VisualParamGenerator/VisualParamGenerator.cs
deleted file mode 100644
index e3f1479..0000000
--- a/old/libsl1550/libsecondlife/VisualParamGenerator/VisualParamGenerator.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace VisualParamGenerator
-{
-    class VisualParamGenerator
-    {
-        public static readonly System.Globalization.CultureInfo EnUsCulture =
-            new System.Globalization.CultureInfo("en-us");
-
-        static void Main(string[] args)
-        {
-            if (args.Length < 3)
-            {
-                Console.WriteLine("Usage: VisualParamGenerator.exe [avatar_lad.xml] [template.cs] [_VisualParams_.cs]");
-                return;
-            }
-            else if (!File.Exists(args[0]))
-            {
-                Console.WriteLine("Couldn't find file " + args[0]);
-                return;
-            }
-
-            XmlNodeList list;
-            TextWriter writer;
-
-            try
-            {
-                writer = new StreamWriter(args[2]);
-            }
-            catch (Exception)
-            {
-                Console.WriteLine("Couldn't open " + args[2] + " for writing");
-                return;
-            }
-
-            try
-            {
-                // Read in the template.cs file and write it to our output
-                TextReader reader = new StreamReader(args[1]);
-                writer.WriteLine(reader.ReadToEnd());
-                reader.Close();
-            }
-            catch (Exception)
-            {
-                Console.WriteLine("Couldn't read from file " + args[1]);
-                return;
-            }
-
-            try
-            {
-                XmlDocument doc = new XmlDocument();
-                doc.LoadXml(File.ReadAllText(args[0]));
-                list = doc.GetElementsByTagName("param");
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine(e.ToString());
-                return;
-            }
-
-            SortedList<int, string> IDs = new SortedList<int, string>();
-            StringWriter output = new StringWriter();
-
-            foreach (XmlNode node in list)
-            {
-                if ((node.Attributes["group"] == null) || !(node.Attributes["group"].Value.Equals("0")))
-                {
-                    // We're only interested in group 0 parameters
-                    continue;
-                }
-                if ((node.Attributes["shared"] != null) && (node.Attributes["shared"].Value.Equals("1")))
-                {
-                    // This param will have been already been defined
-                    continue;
-                }
-                if ((node.Attributes["edit_group"] != null) && (node.Attributes["edit_group"].Value.Equals("driven")))
-                {
-                    // This param is calculated by the client based on other params
-                    continue;
-                }
-
-                // Confirm this is a valid VisualParam
-                if (node.Attributes["id"] != null &&
-                    node.Attributes["name"] != null &&
-                    node.Attributes["wearable"] != null)
-                {
-                    try
-                    {
-                        int id = Int32.Parse(node.Attributes["id"].Value);
-
-                        // Check for duplicates
-                        if (IDs.ContainsKey(id))
-                            continue;
-
-                        string name = node.Attributes["name"].Value;
-                        int group = Int32.Parse(node.Attributes["group"].Value);
-                        string wearable = node.Attributes["wearable"].Value;
-
-                        string label = String.Empty;
-                        if (node.Attributes["label"] != null)
-                            label = node.Attributes["label"].Value;
-
-                        string label_min = String.Empty;
-                        if (node.Attributes["label_min"] != null)
-                            label_min = node.Attributes["label_min"].Value;
-
-                        string label_max = String.Empty;
-                        if (node.Attributes["label_max"] != null)
-                            label_max = node.Attributes["label_max"].Value;
-
-                        float min = Single.Parse(node.Attributes["value_min"].Value,
-                            System.Globalization.NumberStyles.Float, EnUsCulture.NumberFormat);
-                        float max = Single.Parse(node.Attributes["value_max"].Value,
-                            System.Globalization.NumberStyles.Float, EnUsCulture.NumberFormat);
-
-                        float def;
-                        if (node.Attributes["value_default"] != null)
-                            def = Single.Parse(node.Attributes["value_default"].Value,
-                                System.Globalization.NumberStyles.Float, EnUsCulture.NumberFormat);
-                        else
-                            def = min;
-
-                        IDs.Add(id, "            new VisualParam(" + id + ", \"" + name + "\", " + group +
-                            ", \"" + wearable + "\", \"" + label + "\", \"" + label_min + "\", \"" + label_max +
-                            "\", " + def + "f, " + min + "f, " + max + "f)," + Environment.NewLine);
-                    }
-                    catch (Exception e)
-                    {
-                        Console.WriteLine(e.ToString());
-                    }
-                }
-            }
-
-            // Now that we've collected all the entries and sorted them, add them to our output buffer
-            foreach (string line in IDs.Values)
-            {
-                output.Write(line);
-            }
-
-            output.Write("        };" + Environment.NewLine);
-            output.Write("    }" + Environment.NewLine);
-            output.Write("}" + Environment.NewLine);
-
-            try
-            {
-                writer.Write(output.ToString());
-                writer.Close();
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine(e.ToString());
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/VisualParamGenerator/VisualParamGenerator.csproj b/old/libsl1550/libsecondlife/VisualParamGenerator/VisualParamGenerator.csproj
deleted file mode 100644
index 2ba3cf4..0000000
--- a/old/libsl1550/libsecondlife/VisualParamGenerator/VisualParamGenerator.csproj
+++ /dev/null
@@ -1,45 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{D2A514C5-5590-4789-9032-6E5B4C297B80}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>VisualParamGenerator</RootNamespace>
-    <AssemblyName>VisualParamGenerator</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="VisualParamGenerator.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/VisualParamGenerator/template.cs b/old/libsl1550/libsecondlife/VisualParamGenerator/template.cs
deleted file mode 100644
index 59cff6c..0000000
--- a/old/libsl1550/libsecondlife/VisualParamGenerator/template.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// A single visual characteristic of an avatar mesh, such as eyebrow height
-    /// </summary>
-    public struct VisualParam
-    {
-        /// <summary>Index of this visual param</summary>
-        public int ParamID;
-        /// <summary>Internal name</summary>
-        public string Name;
-        /// <summary>Group ID this parameter belongs to</summary>
-        public int Group;
-        /// <summary>Name of the wearable this parameter belongs to</summary>
-        public string Wearable;
-        /// <summary>Displayable label of this characteristic</summary>
-        public string Label;
-        /// <summary>Displayable label for the minimum value of this characteristic</summary>
-        public string LabelMin;
-        /// <summary>Displayable label for the maximum value of this characteristic</summary>
-        public string LabelMax;
-        /// <summary>Default value</summary>
-        public float DefaultValue;
-        /// <summary>Minimum value</summary>
-        public float MinValue;
-        /// <summary>Maximum value</summary>
-        public float MaxValue;
-
-        /// <summary>
-        /// Set all the values through the constructor
-        /// </summary>
-        /// <param name="paramID">Index of this visual param</param>
-        /// <param name="name">Internal name</param>
-        /// <param name="group"></param>
-        /// <param name="wearable"></param>
-        /// <param name="label">Displayable label of this characteristic</param>
-        /// <param name="labelMin">Displayable label for the minimum value of this characteristic</param>
-        /// <param name="labelMax">Displayable label for the maximum value of this characteristic</param>
-        /// <param name="def">Default value</param>
-        /// <param name="min">Minimum value</param>
-        /// <param name="max">Maximum value</param>
-        public VisualParam(int paramID, string name, int group, string wearable, string label, string labelMin, string labelMax, float def, float min, float max)
-        {
-            ParamID = paramID;
-            Name = name;
-            Group = group;
-            Wearable = wearable;
-            Label = label;
-            LabelMin = labelMin;
-            LabelMax = labelMax;
-            DefaultValue = def;
-            MaxValue = max;
-            MinValue = min;
-        }
-    }
-
-    /// <summary>
-    /// Holds the Params array of all the avatar appearance parameters
-    /// </summary>
-    public static class VisualParams
-    {
-        public static VisualParam[] Params = new VisualParam[]
-        {
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/_Packets_.cs b/old/libsl1550/libsecondlife/_Packets_.cs
deleted file mode 100644
index 5f8516a..0000000
--- a/old/libsl1550/libsecondlife/_Packets_.cs
+++ /dev/null
@@ -1,82426 +0,0 @@
-/*
- * Copyright (c) 2006-2008, openmetaverse.org
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Text;
-using libsecondlife;
-
-namespace libsecondlife.Packets
-{
-    /// <summary>
-    /// Thrown when a packet could not be successfully deserialized
-    /// </summary>
-    public class MalformedDataException : ApplicationException
-    {
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        public MalformedDataException() { }
-
-        /// <summary>
-        /// Constructor that takes an additional error message
-        /// </summary>
-        /// <param name="Message">An error message to attach to this exception</param>
-        public MalformedDataException(string Message)
-            : base(Message)
-        {
-            this.Source = "Packet decoding";
-        }
-    }
-
-    /// <summary>
-    /// The header of a message template packet. Either 5, 6, or 8 bytes in
-    /// length at the beginning of the packet, and encapsulates any
-    /// appended ACKs at the end of the packet as well
-    /// </summary>
-    public abstract class Header
-    {
-        /// <summary>Raw header data, does not include appended ACKs</summary>
-        public byte[] Data;
-        /// <summary>Raw value of the flags byte</summary>
-        public byte Flags
-        {
-            get { return Data[0]; }
-            set { Data[0] = value; }
-        }
-        /// <summary>Reliable flag, whether this packet requires an ACK</summary>
-        public bool Reliable
-        {
-            get { return (Data[0] & Helpers.MSG_RELIABLE) != 0; }
-            set { if (value) { Data[0] |= (byte)Helpers.MSG_RELIABLE; } else { byte mask = (byte)Helpers.MSG_RELIABLE ^ 0xFF; Data[0] &= mask; } }
-        }
-        /// <summary>Resent flag, whether this same packet has already been
-        /// sent</summary>
-        public bool Resent
-        {
-            get { return (Data[0] & Helpers.MSG_RESENT) != 0; }
-            set { if (value) { Data[0] |= (byte)Helpers.MSG_RESENT; } else { byte mask = (byte)Helpers.MSG_RESENT ^ 0xFF; Data[0] &= mask; } }
-        }
-        /// <summary>Zerocoded flag, whether this packet is compressed with
-        /// zerocoding</summary>
-        public bool Zerocoded
-        {
-            get { return (Data[0] & Helpers.MSG_ZEROCODED) != 0; }
-            set { if (value) { Data[0] |= (byte)Helpers.MSG_ZEROCODED; } else { byte mask = (byte)Helpers.MSG_ZEROCODED ^ 0xFF; Data[0] &= mask; } }
-        }
-        /// <summary>Appended ACKs flag, whether this packet has ACKs appended
-        /// to the end</summary>
-        public bool AppendedAcks
-        {
-            get { return (Data[0] & Helpers.MSG_APPENDED_ACKS) != 0; }
-            set { if (value) { Data[0] |= (byte)Helpers.MSG_APPENDED_ACKS; } else { byte mask = (byte)Helpers.MSG_APPENDED_ACKS ^ 0xFF; Data[0] &= mask; } }
-        }
-        /// <summary>Packet sequence number</summary>
-        public uint Sequence
-        {
-            get { return (uint)((Data[1] << 24) + (Data[2] << 16) + (Data[3] << 8) + Data[4]); }
-            set
-            {
-			    Data[1] = (byte)(value >> 24); Data[2] = (byte)(value >> 16);
-			    Data[3] = (byte)(value >> 8);  Data[4] = (byte)(value % 256);
-		    }
-        }
-        /// <summary>Numeric ID number of this packet</summary>
-        public abstract ushort ID { get; set; }
-        /// <summary>Frequency classification of this packet, Low Medium or
-        /// High</summary>
-        public abstract PacketFrequency Frequency { get; }
-        /// <summary>Convert this header to a byte array, not including any
-        /// appended ACKs</summary>
-        public abstract void ToBytes(byte[] bytes, ref int i);
-        /// <summary>Array containing all the appended ACKs of this packet</summary>
-        public uint[] AckList;
-
-        public abstract void FromBytes(byte[] bytes, ref int pos, ref int packetEnd);
-
-        /// <summary>
-        /// Convert the AckList to a byte array, used for packet serializing
-        /// </summary>
-        /// <param name="bytes">Reference to the target byte array</param>
-        /// <param name="i">Beginning position to start writing to in the byte
-        /// array, will be updated with the ending position of the ACK list</param>
-        public void AcksToBytes(byte[] bytes, ref int i)
-        {
-            foreach (uint ack in AckList)
-            {
-                bytes[i++] = (byte)((ack >> 24) % 256);
-                bytes[i++] = (byte)((ack >> 16) % 256);
-                bytes[i++] = (byte)((ack >> 8) % 256);
-                bytes[i++] = (byte)(ack % 256);
-            }
-            if (AckList.Length > 0) { bytes[i++] = (byte)AckList.Length; }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="packetEnd"></param>
-        /// <returns></returns>
-        public static Header BuildHeader(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            if (bytes[6] == 0xFF)
-            {
-                if (bytes[7] == 0xFF)
-                {
-                    return new LowHeader(bytes, ref pos, ref packetEnd);
-                }
-                else
-                {
-                    return new MediumHeader(bytes, ref pos, ref packetEnd);
-                }
-            }
-            else
-            {
-                return new HighHeader(bytes, ref pos, ref packetEnd);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="packetEnd"></param>
-        protected void CreateAckList(byte[] bytes, ref int packetEnd)
-        {
-            if (AppendedAcks)
-            {
-                try
-                {
-                    int count = bytes[packetEnd--];
-                    AckList = new uint[count];
-
-                    for (int i = 0; i < count; i++)
-                    {
-                        AckList[i] = (uint)(
-                            (bytes[(packetEnd - i * 4) - 3] << 24) |
-                            (bytes[(packetEnd - i * 4) - 2] << 16) |
-                            (bytes[(packetEnd - i * 4) - 1] <<  8) |
-                            (bytes[(packetEnd - i * 4)    ]));
-                    }
-
-                    packetEnd -= (count * 4);
-                }
-                catch (Exception)
-                {
-                    AckList = new uint[0];
-                    throw new MalformedDataException();
-                }
-            }
-            else
-            {
-                AckList = new uint[0];
-            }
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class LowHeader : Header
-    {
-        /// <summary></summary>
-        public override ushort ID
-        {
-            get { return (ushort)((Data[8] << 8) + Data[9]); }
-            set { Data[8] = (byte)(value >> 8); Data[9] = (byte)(value % 256); }
-        }
-        /// <summary></summary>
-        public override PacketFrequency Frequency { get { return PacketFrequency.Low; } }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public LowHeader()
-        {
-            Data = new byte[10];
-            Data[6] = Data[7] = 0xFF;
-            AckList = new uint[0];
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="packetEnd"></param>
-        public LowHeader(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            FromBytes(bytes, ref pos, ref packetEnd);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            if (bytes.Length < 10) { throw new MalformedDataException(); }
-            Data = new byte[10];
-            Buffer.BlockCopy(bytes, 0, Data, 0, 10);
-
-            if ((bytes[0] & Helpers.MSG_ZEROCODED) != 0 && bytes[8] == 0)
-            {
-                if (bytes[9] == 1)
-                {
-                    Data[9] = bytes[10];
-                }
-                else
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            pos = 10;
-            CreateAckList(bytes, ref packetEnd);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="i"></param>
-        public override void ToBytes(byte[] bytes, ref int i)
-        {
-            Buffer.BlockCopy(Data, 0, bytes, i, 10);
-            i += 10;
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class MediumHeader : Header
-    {
-        /// <summary></summary>
-        public override ushort ID
-        {
-            get { return (ushort)Data[7]; }
-            set { Data[7] = (byte)value; }
-        }
-        /// <summary></summary>
-        public override PacketFrequency Frequency { get { return PacketFrequency.Medium; } }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public MediumHeader()
-        {
-            Data = new byte[8];
-            Data[6] = 0xFF;
-            AckList = new uint[0];
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="packetEnd"></param>
-        public MediumHeader(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            FromBytes(bytes, ref pos, ref packetEnd);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            if (bytes.Length < 8) { throw new MalformedDataException(); }
-            Data = new byte[8];
-            Buffer.BlockCopy(bytes, 0, Data, 0, 8);
-            pos = 8;
-            CreateAckList(bytes, ref packetEnd);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="i"></param>
-        public override void ToBytes(byte[] bytes, ref int i)
-        {
-            Buffer.BlockCopy(Data, 0, bytes, i, 8);
-            i += 8;
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class HighHeader : Header
-    {
-        /// <summary></summary>
-        public override ushort ID
-        {
-            get { return (ushort)Data[6]; }
-            set { Data[6] = (byte)value; }
-        }
-        /// <summary></summary>
-        public override PacketFrequency Frequency { get { return PacketFrequency.High; } }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public HighHeader()
-        {
-            Data = new byte[7];
-            AckList = new uint[0];
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="packetEnd"></param>
-        public HighHeader(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            FromBytes(bytes, ref pos, ref packetEnd);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            if (bytes.Length < 7) { throw new MalformedDataException(); }
-            Data = new byte[7];
-            Buffer.BlockCopy(bytes, 0, Data, 0, 7);
-            pos = 7;
-            CreateAckList(bytes, ref packetEnd);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="i"></param>
-        public override void ToBytes(byte[] bytes, ref int i)
-        {
-            Buffer.BlockCopy(Data, 0, bytes, i, 7);
-            i += 7;
-        }
-    }
-
-    public enum PacketType
-    {
-        /// <summary>A generic value, not an actual packet type</summary>
-        Default,
-        TestMessage = 65537,
-        UseCircuitCode = 65539,
-        TelehubInfo = 65546,
-        EconomyDataRequest = 65560,
-        EconomyData = 65561,
-        AvatarPickerRequest = 65562,
-        AvatarPickerReply = 65564,
-        PlacesQuery = 65565,
-        PlacesReply = 65566,
-        DirFindQuery = 65567,
-        DirPlacesQuery = 65569,
-        DirPlacesReply = 65571,
-        DirPeopleReply = 65572,
-        DirEventsReply = 65573,
-        DirGroupsReply = 65574,
-        DirClassifiedQuery = 65575,
-        DirClassifiedReply = 65577,
-        AvatarClassifiedReply = 65578,
-        ClassifiedInfoRequest = 65579,
-        ClassifiedInfoReply = 65580,
-        ClassifiedInfoUpdate = 65581,
-        ClassifiedDelete = 65582,
-        ClassifiedGodDelete = 65583,
-        DirLandQuery = 65584,
-        DirLandReply = 65586,
-        DirPopularQuery = 65587,
-        DirPopularReply = 65589,
-        ParcelInfoRequest = 65590,
-        ParcelInfoReply = 65591,
-        ParcelObjectOwnersRequest = 65592,
-        ParcelObjectOwnersReply = 65593,
-        GroupNoticesListRequest = 65594,
-        GroupNoticesListReply = 65595,
-        GroupNoticeRequest = 65596,
-        TeleportRequest = 65598,
-        TeleportLocationRequest = 65599,
-        TeleportLocal = 65600,
-        TeleportLandmarkRequest = 65601,
-        TeleportProgress = 65602,
-        TeleportFinish = 65605,
-        StartLure = 65606,
-        TeleportLureRequest = 65607,
-        TeleportCancel = 65608,
-        TeleportStart = 65609,
-        TeleportFailed = 65610,
-        Undo = 65611,
-        Redo = 65612,
-        UndoLand = 65613,
-        AgentPause = 65614,
-        AgentResume = 65615,
-        ChatFromViewer = 65616,
-        AgentThrottle = 65617,
-        AgentFOV = 65618,
-        AgentHeightWidth = 65619,
-        AgentSetAppearance = 65620,
-        AgentQuitCopy = 65621,
-        ImageNotInDatabase = 65622,
-        RebakeAvatarTextures = 65623,
-        SetAlwaysRun = 65624,
-        ObjectDelete = 65625,
-        ObjectDuplicate = 65626,
-        ObjectDuplicateOnRay = 65627,
-        ObjectScale = 65628,
-        ObjectRotation = 65629,
-        ObjectFlagUpdate = 65630,
-        ObjectClickAction = 65631,
-        ObjectImage = 65632,
-        ObjectMaterial = 65633,
-        ObjectShape = 65634,
-        ObjectExtraParams = 65635,
-        ObjectOwner = 65636,
-        ObjectGroup = 65637,
-        ObjectBuy = 65638,
-        BuyObjectInventory = 65639,
-        DerezContainer = 65640,
-        ObjectPermissions = 65641,
-        ObjectSaleInfo = 65642,
-        ObjectName = 65643,
-        ObjectDescription = 65644,
-        ObjectCategory = 65645,
-        ObjectSelect = 65646,
-        ObjectDeselect = 65647,
-        ObjectAttach = 65648,
-        ObjectDetach = 65649,
-        ObjectDrop = 65650,
-        ObjectLink = 65651,
-        ObjectDelink = 65652,
-        ObjectGrab = 65653,
-        ObjectGrabUpdate = 65654,
-        ObjectDeGrab = 65655,
-        ObjectSpinStart = 65656,
-        ObjectSpinUpdate = 65657,
-        ObjectSpinStop = 65658,
-        ObjectExportSelected = 65659,
-        ModifyLand = 65660,
-        VelocityInterpolateOn = 65661,
-        VelocityInterpolateOff = 65662,
-        StateSave = 65663,
-        ReportAutosaveCrash = 65664,
-        SimWideDeletes = 65665,
-        TrackAgent = 65666,
-        ViewerStats = 65667,
-        ScriptAnswerYes = 65668,
-        UserReport = 65669,
-        AlertMessage = 65670,
-        AgentAlertMessage = 65671,
-        MeanCollisionAlert = 65672,
-        ViewerFrozenMessage = 65673,
-        HealthMessage = 65674,
-        ChatFromSimulator = 65675,
-        SimStats = 65676,
-        RequestRegionInfo = 65677,
-        RegionInfo = 65678,
-        GodUpdateRegionInfo = 65679,
-        NearestLandingRegionUpdated = 65682,
-        RegionHandshake = 65684,
-        RegionHandshakeReply = 65685,
-        SimulatorViewerTimeMessage = 65686,
-        EnableSimulator = 65687,
-        DisableSimulator = 65688,
-        TransferRequest = 65689,
-        TransferInfo = 65690,
-        TransferAbort = 65691,
-        RequestXfer = 65692,
-        AbortXfer = 65693,
-        AvatarAppearance = 65694,
-        SetFollowCamProperties = 65695,
-        ClearFollowCamProperties = 65696,
-        RequestPayPrice = 65697,
-        PayPriceReply = 65698,
-        KickUser = 65699,
-        KickUserAck = 65700,
-        GodKickUser = 65701,
-        EjectUser = 65703,
-        FreezeUser = 65704,
-        AvatarPropertiesRequest = 65705,
-        AvatarPropertiesReply = 65707,
-        AvatarInterestsReply = 65708,
-        AvatarGroupsReply = 65709,
-        AvatarPropertiesUpdate = 65710,
-        AvatarInterestsUpdate = 65711,
-        AvatarNotesReply = 65712,
-        AvatarNotesUpdate = 65713,
-        AvatarPicksReply = 65714,
-        EventInfoRequest = 65715,
-        EventInfoReply = 65716,
-        EventNotificationAddRequest = 65717,
-        EventNotificationRemoveRequest = 65718,
-        EventGodDelete = 65719,
-        PickInfoReply = 65720,
-        PickInfoUpdate = 65721,
-        PickDelete = 65722,
-        PickGodDelete = 65723,
-        ScriptQuestion = 65724,
-        ScriptControlChange = 65725,
-        ScriptDialog = 65726,
-        ScriptDialogReply = 65727,
-        ForceScriptControlRelease = 65728,
-        RevokePermissions = 65729,
-        LoadURL = 65730,
-        ScriptTeleportRequest = 65731,
-        ParcelOverlay = 65732,
-        ParcelPropertiesRequestByID = 65733,
-        ParcelPropertiesUpdate = 65734,
-        ParcelReturnObjects = 65735,
-        ParcelSetOtherCleanTime = 65736,
-        ParcelDisableObjects = 65737,
-        ParcelSelectObjects = 65738,
-        EstateCovenantRequest = 65739,
-        EstateCovenantReply = 65740,
-        ForceObjectSelect = 65741,
-        ParcelBuyPass = 65742,
-        ParcelDeedToGroup = 65743,
-        ParcelReclaim = 65744,
-        ParcelClaim = 65745,
-        ParcelJoin = 65746,
-        ParcelDivide = 65747,
-        ParcelRelease = 65748,
-        ParcelBuy = 65749,
-        ParcelGodForceOwner = 65750,
-        ParcelAccessListRequest = 65751,
-        ParcelAccessListReply = 65752,
-        ParcelAccessListUpdate = 65753,
-        ParcelDwellRequest = 65754,
-        ParcelDwellReply = 65755,
-        ParcelGodMarkAsContent = 65763,
-        ViewerStartAuction = 65764,
-        UUIDNameRequest = 65771,
-        UUIDNameReply = 65772,
-        UUIDGroupNameRequest = 65773,
-        UUIDGroupNameReply = 65774,
-        ChildAgentDying = 65776,
-        ChildAgentUnknown = 65777,
-        GetScriptRunning = 65779,
-        ScriptRunningReply = 65780,
-        SetScriptRunning = 65781,
-        ScriptReset = 65782,
-        ScriptSensorRequest = 65783,
-        ScriptSensorReply = 65784,
-        CompleteAgentMovement = 65785,
-        AgentMovementComplete = 65786,
-        LogoutRequest = 65788,
-        LogoutReply = 65789,
-        ImprovedInstantMessage = 65790,
-        RetrieveInstantMessages = 65791,
-        FindAgent = 65792,
-        RequestGodlikePowers = 65793,
-        GrantGodlikePowers = 65794,
-        GodlikeMessage = 65795,
-        EstateOwnerMessage = 65796,
-        GenericMessage = 65797,
-        MuteListRequest = 65798,
-        UpdateMuteListEntry = 65799,
-        RemoveMuteListEntry = 65800,
-        CopyInventoryFromNotecard = 65801,
-        UpdateInventoryItem = 65802,
-        UpdateCreateInventoryItem = 65803,
-        MoveInventoryItem = 65804,
-        CopyInventoryItem = 65805,
-        RemoveInventoryItem = 65806,
-        ChangeInventoryItemFlags = 65807,
-        SaveAssetIntoInventory = 65808,
-        CreateInventoryFolder = 65809,
-        UpdateInventoryFolder = 65810,
-        MoveInventoryFolder = 65811,
-        RemoveInventoryFolder = 65812,
-        FetchInventoryDescendents = 65813,
-        InventoryDescendents = 65814,
-        FetchInventory = 65815,
-        FetchInventoryReply = 65816,
-        BulkUpdateInventory = 65817,
-        RequestInventoryAsset = 65818,
-        InventoryAssetResponse = 65819,
-        RemoveInventoryObjects = 65820,
-        PurgeInventoryDescendents = 65821,
-        UpdateTaskInventory = 65822,
-        RemoveTaskInventory = 65823,
-        MoveTaskInventory = 65824,
-        RequestTaskInventory = 65825,
-        ReplyTaskInventory = 65826,
-        DeRezObject = 65827,
-        DeRezAck = 65828,
-        RezObject = 65829,
-        RezObjectFromNotecard = 65830,
-        AcceptFriendship = 65833,
-        DeclineFriendship = 65834,
-        FormFriendship = 65835,
-        TerminateFriendship = 65836,
-        OfferCallingCard = 65837,
-        AcceptCallingCard = 65838,
-        DeclineCallingCard = 65839,
-        RezScript = 65840,
-        CreateInventoryItem = 65841,
-        CreateLandmarkForEvent = 65842,
-        RegionHandleRequest = 65845,
-        RegionIDAndHandleReply = 65846,
-        MoneyTransferRequest = 65847,
-        MoneyBalanceRequest = 65849,
-        MoneyBalanceReply = 65850,
-        RoutedMoneyBalanceReply = 65851,
-        ActivateGestures = 65852,
-        DeactivateGestures = 65853,
-        MuteListUpdate = 65854,
-        UseCachedMuteList = 65855,
-        GrantUserRights = 65856,
-        ChangeUserRights = 65857,
-        OnlineNotification = 65858,
-        OfflineNotification = 65859,
-        SetStartLocationRequest = 65860,
-        AssetUploadRequest = 65869,
-        AssetUploadComplete = 65870,
-        CreateGroupRequest = 65875,
-        CreateGroupReply = 65876,
-        UpdateGroupInfo = 65877,
-        GroupRoleChanges = 65878,
-        JoinGroupRequest = 65879,
-        JoinGroupReply = 65880,
-        EjectGroupMemberRequest = 65881,
-        EjectGroupMemberReply = 65882,
-        LeaveGroupRequest = 65883,
-        LeaveGroupReply = 65884,
-        InviteGroupRequest = 65885,
-        GroupProfileRequest = 65887,
-        GroupProfileReply = 65888,
-        GroupAccountSummaryRequest = 65889,
-        GroupAccountSummaryReply = 65890,
-        GroupAccountDetailsRequest = 65891,
-        GroupAccountDetailsReply = 65892,
-        GroupAccountTransactionsRequest = 65893,
-        GroupAccountTransactionsReply = 65894,
-        GroupActiveProposalsRequest = 65895,
-        GroupActiveProposalItemReply = 65896,
-        GroupVoteHistoryRequest = 65897,
-        GroupVoteHistoryItemReply = 65898,
-        StartGroupProposal = 65899,
-        GroupProposalBallot = 65900,
-        GroupMembersRequest = 65902,
-        GroupMembersReply = 65903,
-        ActivateGroup = 65904,
-        SetGroupContribution = 65905,
-        SetGroupAcceptNotices = 65906,
-        GroupRoleDataRequest = 65907,
-        GroupRoleDataReply = 65908,
-        GroupRoleMembersRequest = 65909,
-        GroupRoleMembersReply = 65910,
-        GroupTitlesRequest = 65911,
-        GroupTitlesReply = 65912,
-        GroupTitleUpdate = 65913,
-        GroupRoleUpdate = 65914,
-        LiveHelpGroupRequest = 65915,
-        LiveHelpGroupReply = 65916,
-        AgentWearablesRequest = 65917,
-        AgentWearablesUpdate = 65918,
-        AgentIsNowWearing = 65919,
-        AgentCachedTexture = 65920,
-        AgentCachedTextureResponse = 65921,
-        AgentDataUpdateRequest = 65922,
-        AgentDataUpdate = 65923,
-        GroupDataUpdate = 65924,
-        AgentGroupDataUpdate = 65925,
-        AgentDropGroup = 65926,
-        CreateTrustedCircuit = 65928,
-        DenyTrustedCircuit = 65929,
-        RequestTrustedCircuit = 65930,
-        RezSingleAttachmentFromInv = 65931,
-        RezMultipleAttachmentsFromInv = 65932,
-        DetachAttachmentIntoInv = 65933,
-        CreateNewOutfitAttachments = 65934,
-        UserInfoRequest = 65935,
-        UserInfoReply = 65936,
-        UpdateUserInfo = 65937,
-        InitiateDownload = 65939,
-        SystemMessage = 65940,
-        MapLayerRequest = 65941,
-        MapLayerReply = 65942,
-        MapBlockRequest = 65943,
-        MapNameRequest = 65944,
-        MapBlockReply = 65945,
-        MapItemRequest = 65946,
-        MapItemReply = 65947,
-        SendPostcard = 65948,
-        ParcelMediaCommandMessage = 65955,
-        ParcelMediaUpdate = 65956,
-        LandStatRequest = 65957,
-        LandStatReply = 65958,
-        Error = 65959,
-        ObjectIncludeInSearch = 65960,
-        PacketAck = 131067,
-        OpenCircuit = 131068,
-        CloseCircuit = 131069,
-        ObjectAdd = 131073,
-        MultipleObjectUpdate = 131074,
-        RequestMultipleObjects = 131075,
-        ObjectPosition = 131076,
-        RequestObjectPropertiesFamily = 131077,
-        CoarseLocationUpdate = 131078,
-        CrossedRegion = 131079,
-        ConfirmEnableSimulator = 131080,
-        ObjectProperties = 131081,
-        ObjectPropertiesFamily = 131082,
-        ParcelPropertiesRequest = 131083,
-        AttachedSound = 131085,
-        AttachedSoundGainChange = 131086,
-        PreloadSound = 131087,
-        ViewerEffect = 131089,
-        StartPingCheck = 196609,
-        CompletePingCheck = 196610,
-        AgentUpdate = 196612,
-        AgentAnimation = 196613,
-        AgentRequestSit = 196614,
-        AgentSit = 196615,
-        RequestImage = 196616,
-        ImageData = 196617,
-        ImagePacket = 196618,
-        LayerData = 196619,
-        ObjectUpdate = 196620,
-        ObjectUpdateCompressed = 196621,
-        ObjectUpdateCached = 196622,
-        ImprovedTerseObjectUpdate = 196623,
-        KillObject = 196624,
-        TransferPacket = 196625,
-        SendXferPacket = 196626,
-        ConfirmXferPacket = 196627,
-        AvatarAnimation = 196628,
-        AvatarSitResponse = 196629,
-        CameraConstraint = 196630,
-        ParcelProperties = 196631,
-        ChildAgentUpdate = 196633,
-        ChildAgentAlive = 196634,
-        ChildAgentPositionUpdate = 196635,
-        SoundTrigger = 196637,
-    }
-
-    public abstract partial class Packet
-    {
-        public abstract Header Header { get; set; }
-        public abstract PacketType Type { get; }
-        public abstract void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);
-        public abstract void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);
-        public int ResendCount;
-        public int TickCount;
-
-        public abstract byte[] ToBytes();
-        public static PacketType GetType(ushort id, PacketFrequency frequency)
-        {
-            switch (frequency)
-            {
-                case PacketFrequency.Low:
-                    switch (id)
-                    {
-                        case 1: return PacketType.TestMessage;
-                        case 3: return PacketType.UseCircuitCode;
-                        case 10: return PacketType.TelehubInfo;
-                        case 24: return PacketType.EconomyDataRequest;
-                        case 25: return PacketType.EconomyData;
-                        case 26: return PacketType.AvatarPickerRequest;
-                        case 28: return PacketType.AvatarPickerReply;
-                        case 29: return PacketType.PlacesQuery;
-                        case 30: return PacketType.PlacesReply;
-                        case 31: return PacketType.DirFindQuery;
-                        case 33: return PacketType.DirPlacesQuery;
-                        case 35: return PacketType.DirPlacesReply;
-                        case 36: return PacketType.DirPeopleReply;
-                        case 37: return PacketType.DirEventsReply;
-                        case 38: return PacketType.DirGroupsReply;
-                        case 39: return PacketType.DirClassifiedQuery;
-                        case 41: return PacketType.DirClassifiedReply;
-                        case 42: return PacketType.AvatarClassifiedReply;
-                        case 43: return PacketType.ClassifiedInfoRequest;
-                        case 44: return PacketType.ClassifiedInfoReply;
-                        case 45: return PacketType.ClassifiedInfoUpdate;
-                        case 46: return PacketType.ClassifiedDelete;
-                        case 47: return PacketType.ClassifiedGodDelete;
-                        case 48: return PacketType.DirLandQuery;
-                        case 50: return PacketType.DirLandReply;
-                        case 51: return PacketType.DirPopularQuery;
-                        case 53: return PacketType.DirPopularReply;
-                        case 54: return PacketType.ParcelInfoRequest;
-                        case 55: return PacketType.ParcelInfoReply;
-                        case 56: return PacketType.ParcelObjectOwnersRequest;
-                        case 57: return PacketType.ParcelObjectOwnersReply;
-                        case 58: return PacketType.GroupNoticesListRequest;
-                        case 59: return PacketType.GroupNoticesListReply;
-                        case 60: return PacketType.GroupNoticeRequest;
-                        case 62: return PacketType.TeleportRequest;
-                        case 63: return PacketType.TeleportLocationRequest;
-                        case 64: return PacketType.TeleportLocal;
-                        case 65: return PacketType.TeleportLandmarkRequest;
-                        case 66: return PacketType.TeleportProgress;
-                        case 69: return PacketType.TeleportFinish;
-                        case 70: return PacketType.StartLure;
-                        case 71: return PacketType.TeleportLureRequest;
-                        case 72: return PacketType.TeleportCancel;
-                        case 73: return PacketType.TeleportStart;
-                        case 74: return PacketType.TeleportFailed;
-                        case 75: return PacketType.Undo;
-                        case 76: return PacketType.Redo;
-                        case 77: return PacketType.UndoLand;
-                        case 78: return PacketType.AgentPause;
-                        case 79: return PacketType.AgentResume;
-                        case 80: return PacketType.ChatFromViewer;
-                        case 81: return PacketType.AgentThrottle;
-                        case 82: return PacketType.AgentFOV;
-                        case 83: return PacketType.AgentHeightWidth;
-                        case 84: return PacketType.AgentSetAppearance;
-                        case 85: return PacketType.AgentQuitCopy;
-                        case 86: return PacketType.ImageNotInDatabase;
-                        case 87: return PacketType.RebakeAvatarTextures;
-                        case 88: return PacketType.SetAlwaysRun;
-                        case 89: return PacketType.ObjectDelete;
-                        case 90: return PacketType.ObjectDuplicate;
-                        case 91: return PacketType.ObjectDuplicateOnRay;
-                        case 92: return PacketType.ObjectScale;
-                        case 93: return PacketType.ObjectRotation;
-                        case 94: return PacketType.ObjectFlagUpdate;
-                        case 95: return PacketType.ObjectClickAction;
-                        case 96: return PacketType.ObjectImage;
-                        case 97: return PacketType.ObjectMaterial;
-                        case 98: return PacketType.ObjectShape;
-                        case 99: return PacketType.ObjectExtraParams;
-                        case 100: return PacketType.ObjectOwner;
-                        case 101: return PacketType.ObjectGroup;
-                        case 102: return PacketType.ObjectBuy;
-                        case 103: return PacketType.BuyObjectInventory;
-                        case 104: return PacketType.DerezContainer;
-                        case 105: return PacketType.ObjectPermissions;
-                        case 106: return PacketType.ObjectSaleInfo;
-                        case 107: return PacketType.ObjectName;
-                        case 108: return PacketType.ObjectDescription;
-                        case 109: return PacketType.ObjectCategory;
-                        case 110: return PacketType.ObjectSelect;
-                        case 111: return PacketType.ObjectDeselect;
-                        case 112: return PacketType.ObjectAttach;
-                        case 113: return PacketType.ObjectDetach;
-                        case 114: return PacketType.ObjectDrop;
-                        case 115: return PacketType.ObjectLink;
-                        case 116: return PacketType.ObjectDelink;
-                        case 117: return PacketType.ObjectGrab;
-                        case 118: return PacketType.ObjectGrabUpdate;
-                        case 119: return PacketType.ObjectDeGrab;
-                        case 120: return PacketType.ObjectSpinStart;
-                        case 121: return PacketType.ObjectSpinUpdate;
-                        case 122: return PacketType.ObjectSpinStop;
-                        case 123: return PacketType.ObjectExportSelected;
-                        case 124: return PacketType.ModifyLand;
-                        case 125: return PacketType.VelocityInterpolateOn;
-                        case 126: return PacketType.VelocityInterpolateOff;
-                        case 127: return PacketType.StateSave;
-                        case 128: return PacketType.ReportAutosaveCrash;
-                        case 129: return PacketType.SimWideDeletes;
-                        case 130: return PacketType.TrackAgent;
-                        case 131: return PacketType.ViewerStats;
-                        case 132: return PacketType.ScriptAnswerYes;
-                        case 133: return PacketType.UserReport;
-                        case 134: return PacketType.AlertMessage;
-                        case 135: return PacketType.AgentAlertMessage;
-                        case 136: return PacketType.MeanCollisionAlert;
-                        case 137: return PacketType.ViewerFrozenMessage;
-                        case 138: return PacketType.HealthMessage;
-                        case 139: return PacketType.ChatFromSimulator;
-                        case 140: return PacketType.SimStats;
-                        case 141: return PacketType.RequestRegionInfo;
-                        case 142: return PacketType.RegionInfo;
-                        case 143: return PacketType.GodUpdateRegionInfo;
-                        case 146: return PacketType.NearestLandingRegionUpdated;
-                        case 148: return PacketType.RegionHandshake;
-                        case 149: return PacketType.RegionHandshakeReply;
-                        case 150: return PacketType.SimulatorViewerTimeMessage;
-                        case 151: return PacketType.EnableSimulator;
-                        case 152: return PacketType.DisableSimulator;
-                        case 153: return PacketType.TransferRequest;
-                        case 154: return PacketType.TransferInfo;
-                        case 155: return PacketType.TransferAbort;
-                        case 156: return PacketType.RequestXfer;
-                        case 157: return PacketType.AbortXfer;
-                        case 158: return PacketType.AvatarAppearance;
-                        case 159: return PacketType.SetFollowCamProperties;
-                        case 160: return PacketType.ClearFollowCamProperties;
-                        case 161: return PacketType.RequestPayPrice;
-                        case 162: return PacketType.PayPriceReply;
-                        case 163: return PacketType.KickUser;
-                        case 164: return PacketType.KickUserAck;
-                        case 165: return PacketType.GodKickUser;
-                        case 167: return PacketType.EjectUser;
-                        case 168: return PacketType.FreezeUser;
-                        case 169: return PacketType.AvatarPropertiesRequest;
-                        case 171: return PacketType.AvatarPropertiesReply;
-                        case 172: return PacketType.AvatarInterestsReply;
-                        case 173: return PacketType.AvatarGroupsReply;
-                        case 174: return PacketType.AvatarPropertiesUpdate;
-                        case 175: return PacketType.AvatarInterestsUpdate;
-                        case 176: return PacketType.AvatarNotesReply;
-                        case 177: return PacketType.AvatarNotesUpdate;
-                        case 178: return PacketType.AvatarPicksReply;
-                        case 179: return PacketType.EventInfoRequest;
-                        case 180: return PacketType.EventInfoReply;
-                        case 181: return PacketType.EventNotificationAddRequest;
-                        case 182: return PacketType.EventNotificationRemoveRequest;
-                        case 183: return PacketType.EventGodDelete;
-                        case 184: return PacketType.PickInfoReply;
-                        case 185: return PacketType.PickInfoUpdate;
-                        case 186: return PacketType.PickDelete;
-                        case 187: return PacketType.PickGodDelete;
-                        case 188: return PacketType.ScriptQuestion;
-                        case 189: return PacketType.ScriptControlChange;
-                        case 190: return PacketType.ScriptDialog;
-                        case 191: return PacketType.ScriptDialogReply;
-                        case 192: return PacketType.ForceScriptControlRelease;
-                        case 193: return PacketType.RevokePermissions;
-                        case 194: return PacketType.LoadURL;
-                        case 195: return PacketType.ScriptTeleportRequest;
-                        case 196: return PacketType.ParcelOverlay;
-                        case 197: return PacketType.ParcelPropertiesRequestByID;
-                        case 198: return PacketType.ParcelPropertiesUpdate;
-                        case 199: return PacketType.ParcelReturnObjects;
-                        case 200: return PacketType.ParcelSetOtherCleanTime;
-                        case 201: return PacketType.ParcelDisableObjects;
-                        case 202: return PacketType.ParcelSelectObjects;
-                        case 203: return PacketType.EstateCovenantRequest;
-                        case 204: return PacketType.EstateCovenantReply;
-                        case 205: return PacketType.ForceObjectSelect;
-                        case 206: return PacketType.ParcelBuyPass;
-                        case 207: return PacketType.ParcelDeedToGroup;
-                        case 208: return PacketType.ParcelReclaim;
-                        case 209: return PacketType.ParcelClaim;
-                        case 210: return PacketType.ParcelJoin;
-                        case 211: return PacketType.ParcelDivide;
-                        case 212: return PacketType.ParcelRelease;
-                        case 213: return PacketType.ParcelBuy;
-                        case 214: return PacketType.ParcelGodForceOwner;
-                        case 215: return PacketType.ParcelAccessListRequest;
-                        case 216: return PacketType.ParcelAccessListReply;
-                        case 217: return PacketType.ParcelAccessListUpdate;
-                        case 218: return PacketType.ParcelDwellRequest;
-                        case 219: return PacketType.ParcelDwellReply;
-                        case 227: return PacketType.ParcelGodMarkAsContent;
-                        case 228: return PacketType.ViewerStartAuction;
-                        case 235: return PacketType.UUIDNameRequest;
-                        case 236: return PacketType.UUIDNameReply;
-                        case 237: return PacketType.UUIDGroupNameRequest;
-                        case 238: return PacketType.UUIDGroupNameReply;
-                        case 240: return PacketType.ChildAgentDying;
-                        case 241: return PacketType.ChildAgentUnknown;
-                        case 243: return PacketType.GetScriptRunning;
-                        case 244: return PacketType.ScriptRunningReply;
-                        case 245: return PacketType.SetScriptRunning;
-                        case 246: return PacketType.ScriptReset;
-                        case 247: return PacketType.ScriptSensorRequest;
-                        case 248: return PacketType.ScriptSensorReply;
-                        case 249: return PacketType.CompleteAgentMovement;
-                        case 250: return PacketType.AgentMovementComplete;
-                        case 252: return PacketType.LogoutRequest;
-                        case 253: return PacketType.LogoutReply;
-                        case 254: return PacketType.ImprovedInstantMessage;
-                        case 255: return PacketType.RetrieveInstantMessages;
-                        case 256: return PacketType.FindAgent;
-                        case 257: return PacketType.RequestGodlikePowers;
-                        case 258: return PacketType.GrantGodlikePowers;
-                        case 259: return PacketType.GodlikeMessage;
-                        case 260: return PacketType.EstateOwnerMessage;
-                        case 261: return PacketType.GenericMessage;
-                        case 262: return PacketType.MuteListRequest;
-                        case 263: return PacketType.UpdateMuteListEntry;
-                        case 264: return PacketType.RemoveMuteListEntry;
-                        case 265: return PacketType.CopyInventoryFromNotecard;
-                        case 266: return PacketType.UpdateInventoryItem;
-                        case 267: return PacketType.UpdateCreateInventoryItem;
-                        case 268: return PacketType.MoveInventoryItem;
-                        case 269: return PacketType.CopyInventoryItem;
-                        case 270: return PacketType.RemoveInventoryItem;
-                        case 271: return PacketType.ChangeInventoryItemFlags;
-                        case 272: return PacketType.SaveAssetIntoInventory;
-                        case 273: return PacketType.CreateInventoryFolder;
-                        case 274: return PacketType.UpdateInventoryFolder;
-                        case 275: return PacketType.MoveInventoryFolder;
-                        case 276: return PacketType.RemoveInventoryFolder;
-                        case 277: return PacketType.FetchInventoryDescendents;
-                        case 278: return PacketType.InventoryDescendents;
-                        case 279: return PacketType.FetchInventory;
-                        case 280: return PacketType.FetchInventoryReply;
-                        case 281: return PacketType.BulkUpdateInventory;
-                        case 282: return PacketType.RequestInventoryAsset;
-                        case 283: return PacketType.InventoryAssetResponse;
-                        case 284: return PacketType.RemoveInventoryObjects;
-                        case 285: return PacketType.PurgeInventoryDescendents;
-                        case 286: return PacketType.UpdateTaskInventory;
-                        case 287: return PacketType.RemoveTaskInventory;
-                        case 288: return PacketType.MoveTaskInventory;
-                        case 289: return PacketType.RequestTaskInventory;
-                        case 290: return PacketType.ReplyTaskInventory;
-                        case 291: return PacketType.DeRezObject;
-                        case 292: return PacketType.DeRezAck;
-                        case 293: return PacketType.RezObject;
-                        case 294: return PacketType.RezObjectFromNotecard;
-                        case 297: return PacketType.AcceptFriendship;
-                        case 298: return PacketType.DeclineFriendship;
-                        case 299: return PacketType.FormFriendship;
-                        case 300: return PacketType.TerminateFriendship;
-                        case 301: return PacketType.OfferCallingCard;
-                        case 302: return PacketType.AcceptCallingCard;
-                        case 303: return PacketType.DeclineCallingCard;
-                        case 304: return PacketType.RezScript;
-                        case 305: return PacketType.CreateInventoryItem;
-                        case 306: return PacketType.CreateLandmarkForEvent;
-                        case 309: return PacketType.RegionHandleRequest;
-                        case 310: return PacketType.RegionIDAndHandleReply;
-                        case 311: return PacketType.MoneyTransferRequest;
-                        case 313: return PacketType.MoneyBalanceRequest;
-                        case 314: return PacketType.MoneyBalanceReply;
-                        case 315: return PacketType.RoutedMoneyBalanceReply;
-                        case 316: return PacketType.ActivateGestures;
-                        case 317: return PacketType.DeactivateGestures;
-                        case 318: return PacketType.MuteListUpdate;
-                        case 319: return PacketType.UseCachedMuteList;
-                        case 320: return PacketType.GrantUserRights;
-                        case 321: return PacketType.ChangeUserRights;
-                        case 322: return PacketType.OnlineNotification;
-                        case 323: return PacketType.OfflineNotification;
-                        case 324: return PacketType.SetStartLocationRequest;
-                        case 333: return PacketType.AssetUploadRequest;
-                        case 334: return PacketType.AssetUploadComplete;
-                        case 339: return PacketType.CreateGroupRequest;
-                        case 340: return PacketType.CreateGroupReply;
-                        case 341: return PacketType.UpdateGroupInfo;
-                        case 342: return PacketType.GroupRoleChanges;
-                        case 343: return PacketType.JoinGroupRequest;
-                        case 344: return PacketType.JoinGroupReply;
-                        case 345: return PacketType.EjectGroupMemberRequest;
-                        case 346: return PacketType.EjectGroupMemberReply;
-                        case 347: return PacketType.LeaveGroupRequest;
-                        case 348: return PacketType.LeaveGroupReply;
-                        case 349: return PacketType.InviteGroupRequest;
-                        case 351: return PacketType.GroupProfileRequest;
-                        case 352: return PacketType.GroupProfileReply;
-                        case 353: return PacketType.GroupAccountSummaryRequest;
-                        case 354: return PacketType.GroupAccountSummaryReply;
-                        case 355: return PacketType.GroupAccountDetailsRequest;
-                        case 356: return PacketType.GroupAccountDetailsReply;
-                        case 357: return PacketType.GroupAccountTransactionsRequest;
-                        case 358: return PacketType.GroupAccountTransactionsReply;
-                        case 359: return PacketType.GroupActiveProposalsRequest;
-                        case 360: return PacketType.GroupActiveProposalItemReply;
-                        case 361: return PacketType.GroupVoteHistoryRequest;
-                        case 362: return PacketType.GroupVoteHistoryItemReply;
-                        case 363: return PacketType.StartGroupProposal;
-                        case 364: return PacketType.GroupProposalBallot;
-                        case 366: return PacketType.GroupMembersRequest;
-                        case 367: return PacketType.GroupMembersReply;
-                        case 368: return PacketType.ActivateGroup;
-                        case 369: return PacketType.SetGroupContribution;
-                        case 370: return PacketType.SetGroupAcceptNotices;
-                        case 371: return PacketType.GroupRoleDataRequest;
-                        case 372: return PacketType.GroupRoleDataReply;
-                        case 373: return PacketType.GroupRoleMembersRequest;
-                        case 374: return PacketType.GroupRoleMembersReply;
-                        case 375: return PacketType.GroupTitlesRequest;
-                        case 376: return PacketType.GroupTitlesReply;
-                        case 377: return PacketType.GroupTitleUpdate;
-                        case 378: return PacketType.GroupRoleUpdate;
-                        case 379: return PacketType.LiveHelpGroupRequest;
-                        case 380: return PacketType.LiveHelpGroupReply;
-                        case 381: return PacketType.AgentWearablesRequest;
-                        case 382: return PacketType.AgentWearablesUpdate;
-                        case 383: return PacketType.AgentIsNowWearing;
-                        case 384: return PacketType.AgentCachedTexture;
-                        case 385: return PacketType.AgentCachedTextureResponse;
-                        case 386: return PacketType.AgentDataUpdateRequest;
-                        case 387: return PacketType.AgentDataUpdate;
-                        case 388: return PacketType.GroupDataUpdate;
-                        case 389: return PacketType.AgentGroupDataUpdate;
-                        case 390: return PacketType.AgentDropGroup;
-                        case 392: return PacketType.CreateTrustedCircuit;
-                        case 393: return PacketType.DenyTrustedCircuit;
-                        case 394: return PacketType.RequestTrustedCircuit;
-                        case 395: return PacketType.RezSingleAttachmentFromInv;
-                        case 396: return PacketType.RezMultipleAttachmentsFromInv;
-                        case 397: return PacketType.DetachAttachmentIntoInv;
-                        case 398: return PacketType.CreateNewOutfitAttachments;
-                        case 399: return PacketType.UserInfoRequest;
-                        case 400: return PacketType.UserInfoReply;
-                        case 401: return PacketType.UpdateUserInfo;
-                        case 403: return PacketType.InitiateDownload;
-                        case 404: return PacketType.SystemMessage;
-                        case 405: return PacketType.MapLayerRequest;
-                        case 406: return PacketType.MapLayerReply;
-                        case 407: return PacketType.MapBlockRequest;
-                        case 408: return PacketType.MapNameRequest;
-                        case 409: return PacketType.MapBlockReply;
-                        case 410: return PacketType.MapItemRequest;
-                        case 411: return PacketType.MapItemReply;
-                        case 412: return PacketType.SendPostcard;
-                        case 419: return PacketType.ParcelMediaCommandMessage;
-                        case 420: return PacketType.ParcelMediaUpdate;
-                        case 421: return PacketType.LandStatRequest;
-                        case 422: return PacketType.LandStatReply;
-                        case 423: return PacketType.Error;
-                        case 424: return PacketType.ObjectIncludeInSearch;
-                        case 65531: return PacketType.PacketAck;
-                        case 65532: return PacketType.OpenCircuit;
-                        case 65533: return PacketType.CloseCircuit;
-                    }
-                    break;
-                case PacketFrequency.Medium:
-                    switch (id)
-                    {
-                        case 1: return PacketType.ObjectAdd;
-                        case 2: return PacketType.MultipleObjectUpdate;
-                        case 3: return PacketType.RequestMultipleObjects;
-                        case 4: return PacketType.ObjectPosition;
-                        case 5: return PacketType.RequestObjectPropertiesFamily;
-                        case 6: return PacketType.CoarseLocationUpdate;
-                        case 7: return PacketType.CrossedRegion;
-                        case 8: return PacketType.ConfirmEnableSimulator;
-                        case 9: return PacketType.ObjectProperties;
-                        case 10: return PacketType.ObjectPropertiesFamily;
-                        case 11: return PacketType.ParcelPropertiesRequest;
-                        case 13: return PacketType.AttachedSound;
-                        case 14: return PacketType.AttachedSoundGainChange;
-                        case 15: return PacketType.PreloadSound;
-                        case 17: return PacketType.ViewerEffect;
-                    }
-                    break;
-                case PacketFrequency.High:
-                    switch (id)
-                    {
-                        case 1: return PacketType.StartPingCheck;
-                        case 2: return PacketType.CompletePingCheck;
-                        case 4: return PacketType.AgentUpdate;
-                        case 5: return PacketType.AgentAnimation;
-                        case 6: return PacketType.AgentRequestSit;
-                        case 7: return PacketType.AgentSit;
-                        case 8: return PacketType.RequestImage;
-                        case 9: return PacketType.ImageData;
-                        case 10: return PacketType.ImagePacket;
-                        case 11: return PacketType.LayerData;
-                        case 12: return PacketType.ObjectUpdate;
-                        case 13: return PacketType.ObjectUpdateCompressed;
-                        case 14: return PacketType.ObjectUpdateCached;
-                        case 15: return PacketType.ImprovedTerseObjectUpdate;
-                        case 16: return PacketType.KillObject;
-                        case 17: return PacketType.TransferPacket;
-                        case 18: return PacketType.SendXferPacket;
-                        case 19: return PacketType.ConfirmXferPacket;
-                        case 20: return PacketType.AvatarAnimation;
-                        case 21: return PacketType.AvatarSitResponse;
-                        case 22: return PacketType.CameraConstraint;
-                        case 23: return PacketType.ParcelProperties;
-                        case 25: return PacketType.ChildAgentUpdate;
-                        case 26: return PacketType.ChildAgentAlive;
-                        case 27: return PacketType.ChildAgentPositionUpdate;
-                        case 29: return PacketType.SoundTrigger;
-                    }
-                    break;
-            }
-
-            return PacketType.Default;
-        }
-
-        public static Packet BuildPacket(PacketType type)
-        {
-            if(type == PacketType.StartPingCheck) return new StartPingCheckPacket();
-            if(type == PacketType.CompletePingCheck) return new CompletePingCheckPacket();
-            if(type == PacketType.AgentUpdate) return new AgentUpdatePacket();
-            if(type == PacketType.AgentAnimation) return new AgentAnimationPacket();
-            if(type == PacketType.AgentRequestSit) return new AgentRequestSitPacket();
-            if(type == PacketType.AgentSit) return new AgentSitPacket();
-            if(type == PacketType.RequestImage) return new RequestImagePacket();
-            if(type == PacketType.ImageData) return new ImageDataPacket();
-            if(type == PacketType.ImagePacket) return new ImagePacketPacket();
-            if(type == PacketType.LayerData) return new LayerDataPacket();
-            if(type == PacketType.ObjectUpdate) return new ObjectUpdatePacket();
-            if(type == PacketType.ObjectUpdateCompressed) return new ObjectUpdateCompressedPacket();
-            if(type == PacketType.ObjectUpdateCached) return new ObjectUpdateCachedPacket();
-            if(type == PacketType.ImprovedTerseObjectUpdate) return new ImprovedTerseObjectUpdatePacket();
-            if(type == PacketType.KillObject) return new KillObjectPacket();
-            if(type == PacketType.TransferPacket) return new TransferPacketPacket();
-            if(type == PacketType.SendXferPacket) return new SendXferPacketPacket();
-            if(type == PacketType.ConfirmXferPacket) return new ConfirmXferPacketPacket();
-            if(type == PacketType.AvatarAnimation) return new AvatarAnimationPacket();
-            if(type == PacketType.AvatarSitResponse) return new AvatarSitResponsePacket();
-            if(type == PacketType.CameraConstraint) return new CameraConstraintPacket();
-            if(type == PacketType.ParcelProperties) return new ParcelPropertiesPacket();
-            if(type == PacketType.ChildAgentUpdate) return new ChildAgentUpdatePacket();
-            if(type == PacketType.ChildAgentAlive) return new ChildAgentAlivePacket();
-            if(type == PacketType.ChildAgentPositionUpdate) return new ChildAgentPositionUpdatePacket();
-            if(type == PacketType.SoundTrigger) return new SoundTriggerPacket();
-            if(type == PacketType.ObjectAdd) return new ObjectAddPacket();
-            if(type == PacketType.MultipleObjectUpdate) return new MultipleObjectUpdatePacket();
-            if(type == PacketType.RequestMultipleObjects) return new RequestMultipleObjectsPacket();
-            if(type == PacketType.ObjectPosition) return new ObjectPositionPacket();
-            if(type == PacketType.RequestObjectPropertiesFamily) return new RequestObjectPropertiesFamilyPacket();
-            if(type == PacketType.CoarseLocationUpdate) return new CoarseLocationUpdatePacket();
-            if(type == PacketType.CrossedRegion) return new CrossedRegionPacket();
-            if(type == PacketType.ConfirmEnableSimulator) return new ConfirmEnableSimulatorPacket();
-            if(type == PacketType.ObjectProperties) return new ObjectPropertiesPacket();
-            if(type == PacketType.ObjectPropertiesFamily) return new ObjectPropertiesFamilyPacket();
-            if(type == PacketType.ParcelPropertiesRequest) return new ParcelPropertiesRequestPacket();
-            if(type == PacketType.AttachedSound) return new AttachedSoundPacket();
-            if(type == PacketType.AttachedSoundGainChange) return new AttachedSoundGainChangePacket();
-            if(type == PacketType.PreloadSound) return new PreloadSoundPacket();
-            if(type == PacketType.ViewerEffect) return new ViewerEffectPacket();
-            if(type == PacketType.TestMessage) return new TestMessagePacket();
-            if(type == PacketType.UseCircuitCode) return new UseCircuitCodePacket();
-            if(type == PacketType.TelehubInfo) return new TelehubInfoPacket();
-            if(type == PacketType.EconomyDataRequest) return new EconomyDataRequestPacket();
-            if(type == PacketType.EconomyData) return new EconomyDataPacket();
-            if(type == PacketType.AvatarPickerRequest) return new AvatarPickerRequestPacket();
-            if(type == PacketType.AvatarPickerReply) return new AvatarPickerReplyPacket();
-            if(type == PacketType.PlacesQuery) return new PlacesQueryPacket();
-            if(type == PacketType.PlacesReply) return new PlacesReplyPacket();
-            if(type == PacketType.DirFindQuery) return new DirFindQueryPacket();
-            if(type == PacketType.DirPlacesQuery) return new DirPlacesQueryPacket();
-            if(type == PacketType.DirPlacesReply) return new DirPlacesReplyPacket();
-            if(type == PacketType.DirPeopleReply) return new DirPeopleReplyPacket();
-            if(type == PacketType.DirEventsReply) return new DirEventsReplyPacket();
-            if(type == PacketType.DirGroupsReply) return new DirGroupsReplyPacket();
-            if(type == PacketType.DirClassifiedQuery) return new DirClassifiedQueryPacket();
-            if(type == PacketType.DirClassifiedReply) return new DirClassifiedReplyPacket();
-            if(type == PacketType.AvatarClassifiedReply) return new AvatarClassifiedReplyPacket();
-            if(type == PacketType.ClassifiedInfoRequest) return new ClassifiedInfoRequestPacket();
-            if(type == PacketType.ClassifiedInfoReply) return new ClassifiedInfoReplyPacket();
-            if(type == PacketType.ClassifiedInfoUpdate) return new ClassifiedInfoUpdatePacket();
-            if(type == PacketType.ClassifiedDelete) return new ClassifiedDeletePacket();
-            if(type == PacketType.ClassifiedGodDelete) return new ClassifiedGodDeletePacket();
-            if(type == PacketType.DirLandQuery) return new DirLandQueryPacket();
-            if(type == PacketType.DirLandReply) return new DirLandReplyPacket();
-            if(type == PacketType.DirPopularQuery) return new DirPopularQueryPacket();
-            if(type == PacketType.DirPopularReply) return new DirPopularReplyPacket();
-            if(type == PacketType.ParcelInfoRequest) return new ParcelInfoRequestPacket();
-            if(type == PacketType.ParcelInfoReply) return new ParcelInfoReplyPacket();
-            if(type == PacketType.ParcelObjectOwnersRequest) return new ParcelObjectOwnersRequestPacket();
-            if(type == PacketType.ParcelObjectOwnersReply) return new ParcelObjectOwnersReplyPacket();
-            if(type == PacketType.GroupNoticesListRequest) return new GroupNoticesListRequestPacket();
-            if(type == PacketType.GroupNoticesListReply) return new GroupNoticesListReplyPacket();
-            if(type == PacketType.GroupNoticeRequest) return new GroupNoticeRequestPacket();
-            if(type == PacketType.TeleportRequest) return new TeleportRequestPacket();
-            if(type == PacketType.TeleportLocationRequest) return new TeleportLocationRequestPacket();
-            if(type == PacketType.TeleportLocal) return new TeleportLocalPacket();
-            if(type == PacketType.TeleportLandmarkRequest) return new TeleportLandmarkRequestPacket();
-            if(type == PacketType.TeleportProgress) return new TeleportProgressPacket();
-            if(type == PacketType.TeleportFinish) return new TeleportFinishPacket();
-            if(type == PacketType.StartLure) return new StartLurePacket();
-            if(type == PacketType.TeleportLureRequest) return new TeleportLureRequestPacket();
-            if(type == PacketType.TeleportCancel) return new TeleportCancelPacket();
-            if(type == PacketType.TeleportStart) return new TeleportStartPacket();
-            if(type == PacketType.TeleportFailed) return new TeleportFailedPacket();
-            if(type == PacketType.Undo) return new UndoPacket();
-            if(type == PacketType.Redo) return new RedoPacket();
-            if(type == PacketType.UndoLand) return new UndoLandPacket();
-            if(type == PacketType.AgentPause) return new AgentPausePacket();
-            if(type == PacketType.AgentResume) return new AgentResumePacket();
-            if(type == PacketType.ChatFromViewer) return new ChatFromViewerPacket();
-            if(type == PacketType.AgentThrottle) return new AgentThrottlePacket();
-            if(type == PacketType.AgentFOV) return new AgentFOVPacket();
-            if(type == PacketType.AgentHeightWidth) return new AgentHeightWidthPacket();
-            if(type == PacketType.AgentSetAppearance) return new AgentSetAppearancePacket();
-            if(type == PacketType.AgentQuitCopy) return new AgentQuitCopyPacket();
-            if(type == PacketType.ImageNotInDatabase) return new ImageNotInDatabasePacket();
-            if(type == PacketType.RebakeAvatarTextures) return new RebakeAvatarTexturesPacket();
-            if(type == PacketType.SetAlwaysRun) return new SetAlwaysRunPacket();
-            if(type == PacketType.ObjectDelete) return new ObjectDeletePacket();
-            if(type == PacketType.ObjectDuplicate) return new ObjectDuplicatePacket();
-            if(type == PacketType.ObjectDuplicateOnRay) return new ObjectDuplicateOnRayPacket();
-            if(type == PacketType.ObjectScale) return new ObjectScalePacket();
-            if(type == PacketType.ObjectRotation) return new ObjectRotationPacket();
-            if(type == PacketType.ObjectFlagUpdate) return new ObjectFlagUpdatePacket();
-            if(type == PacketType.ObjectClickAction) return new ObjectClickActionPacket();
-            if(type == PacketType.ObjectImage) return new ObjectImagePacket();
-            if(type == PacketType.ObjectMaterial) return new ObjectMaterialPacket();
-            if(type == PacketType.ObjectShape) return new ObjectShapePacket();
-            if(type == PacketType.ObjectExtraParams) return new ObjectExtraParamsPacket();
-            if(type == PacketType.ObjectOwner) return new ObjectOwnerPacket();
-            if(type == PacketType.ObjectGroup) return new ObjectGroupPacket();
-            if(type == PacketType.ObjectBuy) return new ObjectBuyPacket();
-            if(type == PacketType.BuyObjectInventory) return new BuyObjectInventoryPacket();
-            if(type == PacketType.DerezContainer) return new DerezContainerPacket();
-            if(type == PacketType.ObjectPermissions) return new ObjectPermissionsPacket();
-            if(type == PacketType.ObjectSaleInfo) return new ObjectSaleInfoPacket();
-            if(type == PacketType.ObjectName) return new ObjectNamePacket();
-            if(type == PacketType.ObjectDescription) return new ObjectDescriptionPacket();
-            if(type == PacketType.ObjectCategory) return new ObjectCategoryPacket();
-            if(type == PacketType.ObjectSelect) return new ObjectSelectPacket();
-            if(type == PacketType.ObjectDeselect) return new ObjectDeselectPacket();
-            if(type == PacketType.ObjectAttach) return new ObjectAttachPacket();
-            if(type == PacketType.ObjectDetach) return new ObjectDetachPacket();
-            if(type == PacketType.ObjectDrop) return new ObjectDropPacket();
-            if(type == PacketType.ObjectLink) return new ObjectLinkPacket();
-            if(type == PacketType.ObjectDelink) return new ObjectDelinkPacket();
-            if(type == PacketType.ObjectGrab) return new ObjectGrabPacket();
-            if(type == PacketType.ObjectGrabUpdate) return new ObjectGrabUpdatePacket();
-            if(type == PacketType.ObjectDeGrab) return new ObjectDeGrabPacket();
-            if(type == PacketType.ObjectSpinStart) return new ObjectSpinStartPacket();
-            if(type == PacketType.ObjectSpinUpdate) return new ObjectSpinUpdatePacket();
-            if(type == PacketType.ObjectSpinStop) return new ObjectSpinStopPacket();
-            if(type == PacketType.ObjectExportSelected) return new ObjectExportSelectedPacket();
-            if(type == PacketType.ModifyLand) return new ModifyLandPacket();
-            if(type == PacketType.VelocityInterpolateOn) return new VelocityInterpolateOnPacket();
-            if(type == PacketType.VelocityInterpolateOff) return new VelocityInterpolateOffPacket();
-            if(type == PacketType.StateSave) return new StateSavePacket();
-            if(type == PacketType.ReportAutosaveCrash) return new ReportAutosaveCrashPacket();
-            if(type == PacketType.SimWideDeletes) return new SimWideDeletesPacket();
-            if(type == PacketType.TrackAgent) return new TrackAgentPacket();
-            if(type == PacketType.ViewerStats) return new ViewerStatsPacket();
-            if(type == PacketType.ScriptAnswerYes) return new ScriptAnswerYesPacket();
-            if(type == PacketType.UserReport) return new UserReportPacket();
-            if(type == PacketType.AlertMessage) return new AlertMessagePacket();
-            if(type == PacketType.AgentAlertMessage) return new AgentAlertMessagePacket();
-            if(type == PacketType.MeanCollisionAlert) return new MeanCollisionAlertPacket();
-            if(type == PacketType.ViewerFrozenMessage) return new ViewerFrozenMessagePacket();
-            if(type == PacketType.HealthMessage) return new HealthMessagePacket();
-            if(type == PacketType.ChatFromSimulator) return new ChatFromSimulatorPacket();
-            if(type == PacketType.SimStats) return new SimStatsPacket();
-            if(type == PacketType.RequestRegionInfo) return new RequestRegionInfoPacket();
-            if(type == PacketType.RegionInfo) return new RegionInfoPacket();
-            if(type == PacketType.GodUpdateRegionInfo) return new GodUpdateRegionInfoPacket();
-            if(type == PacketType.NearestLandingRegionUpdated) return new NearestLandingRegionUpdatedPacket();
-            if(type == PacketType.RegionHandshake) return new RegionHandshakePacket();
-            if(type == PacketType.RegionHandshakeReply) return new RegionHandshakeReplyPacket();
-            if(type == PacketType.SimulatorViewerTimeMessage) return new SimulatorViewerTimeMessagePacket();
-            if(type == PacketType.EnableSimulator) return new EnableSimulatorPacket();
-            if(type == PacketType.DisableSimulator) return new DisableSimulatorPacket();
-            if(type == PacketType.TransferRequest) return new TransferRequestPacket();
-            if(type == PacketType.TransferInfo) return new TransferInfoPacket();
-            if(type == PacketType.TransferAbort) return new TransferAbortPacket();
-            if(type == PacketType.RequestXfer) return new RequestXferPacket();
-            if(type == PacketType.AbortXfer) return new AbortXferPacket();
-            if(type == PacketType.AvatarAppearance) return new AvatarAppearancePacket();
-            if(type == PacketType.SetFollowCamProperties) return new SetFollowCamPropertiesPacket();
-            if(type == PacketType.ClearFollowCamProperties) return new ClearFollowCamPropertiesPacket();
-            if(type == PacketType.RequestPayPrice) return new RequestPayPricePacket();
-            if(type == PacketType.PayPriceReply) return new PayPriceReplyPacket();
-            if(type == PacketType.KickUser) return new KickUserPacket();
-            if(type == PacketType.KickUserAck) return new KickUserAckPacket();
-            if(type == PacketType.GodKickUser) return new GodKickUserPacket();
-            if(type == PacketType.EjectUser) return new EjectUserPacket();
-            if(type == PacketType.FreezeUser) return new FreezeUserPacket();
-            if(type == PacketType.AvatarPropertiesRequest) return new AvatarPropertiesRequestPacket();
-            if(type == PacketType.AvatarPropertiesReply) return new AvatarPropertiesReplyPacket();
-            if(type == PacketType.AvatarInterestsReply) return new AvatarInterestsReplyPacket();
-            if(type == PacketType.AvatarGroupsReply) return new AvatarGroupsReplyPacket();
-            if(type == PacketType.AvatarPropertiesUpdate) return new AvatarPropertiesUpdatePacket();
-            if(type == PacketType.AvatarInterestsUpdate) return new AvatarInterestsUpdatePacket();
-            if(type == PacketType.AvatarNotesReply) return new AvatarNotesReplyPacket();
-            if(type == PacketType.AvatarNotesUpdate) return new AvatarNotesUpdatePacket();
-            if(type == PacketType.AvatarPicksReply) return new AvatarPicksReplyPacket();
-            if(type == PacketType.EventInfoRequest) return new EventInfoRequestPacket();
-            if(type == PacketType.EventInfoReply) return new EventInfoReplyPacket();
-            if(type == PacketType.EventNotificationAddRequest) return new EventNotificationAddRequestPacket();
-            if(type == PacketType.EventNotificationRemoveRequest) return new EventNotificationRemoveRequestPacket();
-            if(type == PacketType.EventGodDelete) return new EventGodDeletePacket();
-            if(type == PacketType.PickInfoReply) return new PickInfoReplyPacket();
-            if(type == PacketType.PickInfoUpdate) return new PickInfoUpdatePacket();
-            if(type == PacketType.PickDelete) return new PickDeletePacket();
-            if(type == PacketType.PickGodDelete) return new PickGodDeletePacket();
-            if(type == PacketType.ScriptQuestion) return new ScriptQuestionPacket();
-            if(type == PacketType.ScriptControlChange) return new ScriptControlChangePacket();
-            if(type == PacketType.ScriptDialog) return new ScriptDialogPacket();
-            if(type == PacketType.ScriptDialogReply) return new ScriptDialogReplyPacket();
-            if(type == PacketType.ForceScriptControlRelease) return new ForceScriptControlReleasePacket();
-            if(type == PacketType.RevokePermissions) return new RevokePermissionsPacket();
-            if(type == PacketType.LoadURL) return new LoadURLPacket();
-            if(type == PacketType.ScriptTeleportRequest) return new ScriptTeleportRequestPacket();
-            if(type == PacketType.ParcelOverlay) return new ParcelOverlayPacket();
-            if(type == PacketType.ParcelPropertiesRequestByID) return new ParcelPropertiesRequestByIDPacket();
-            if(type == PacketType.ParcelPropertiesUpdate) return new ParcelPropertiesUpdatePacket();
-            if(type == PacketType.ParcelReturnObjects) return new ParcelReturnObjectsPacket();
-            if(type == PacketType.ParcelSetOtherCleanTime) return new ParcelSetOtherCleanTimePacket();
-            if(type == PacketType.ParcelDisableObjects) return new ParcelDisableObjectsPacket();
-            if(type == PacketType.ParcelSelectObjects) return new ParcelSelectObjectsPacket();
-            if(type == PacketType.EstateCovenantRequest) return new EstateCovenantRequestPacket();
-            if(type == PacketType.EstateCovenantReply) return new EstateCovenantReplyPacket();
-            if(type == PacketType.ForceObjectSelect) return new ForceObjectSelectPacket();
-            if(type == PacketType.ParcelBuyPass) return new ParcelBuyPassPacket();
-            if(type == PacketType.ParcelDeedToGroup) return new ParcelDeedToGroupPacket();
-            if(type == PacketType.ParcelReclaim) return new ParcelReclaimPacket();
-            if(type == PacketType.ParcelClaim) return new ParcelClaimPacket();
-            if(type == PacketType.ParcelJoin) return new ParcelJoinPacket();
-            if(type == PacketType.ParcelDivide) return new ParcelDividePacket();
-            if(type == PacketType.ParcelRelease) return new ParcelReleasePacket();
-            if(type == PacketType.ParcelBuy) return new ParcelBuyPacket();
-            if(type == PacketType.ParcelGodForceOwner) return new ParcelGodForceOwnerPacket();
-            if(type == PacketType.ParcelAccessListRequest) return new ParcelAccessListRequestPacket();
-            if(type == PacketType.ParcelAccessListReply) return new ParcelAccessListReplyPacket();
-            if(type == PacketType.ParcelAccessListUpdate) return new ParcelAccessListUpdatePacket();
-            if(type == PacketType.ParcelDwellRequest) return new ParcelDwellRequestPacket();
-            if(type == PacketType.ParcelDwellReply) return new ParcelDwellReplyPacket();
-            if(type == PacketType.ParcelGodMarkAsContent) return new ParcelGodMarkAsContentPacket();
-            if(type == PacketType.ViewerStartAuction) return new ViewerStartAuctionPacket();
-            if(type == PacketType.UUIDNameRequest) return new UUIDNameRequestPacket();
-            if(type == PacketType.UUIDNameReply) return new UUIDNameReplyPacket();
-            if(type == PacketType.UUIDGroupNameRequest) return new UUIDGroupNameRequestPacket();
-            if(type == PacketType.UUIDGroupNameReply) return new UUIDGroupNameReplyPacket();
-            if(type == PacketType.ChildAgentDying) return new ChildAgentDyingPacket();
-            if(type == PacketType.ChildAgentUnknown) return new ChildAgentUnknownPacket();
-            if(type == PacketType.GetScriptRunning) return new GetScriptRunningPacket();
-            if(type == PacketType.ScriptRunningReply) return new ScriptRunningReplyPacket();
-            if(type == PacketType.SetScriptRunning) return new SetScriptRunningPacket();
-            if(type == PacketType.ScriptReset) return new ScriptResetPacket();
-            if(type == PacketType.ScriptSensorRequest) return new ScriptSensorRequestPacket();
-            if(type == PacketType.ScriptSensorReply) return new ScriptSensorReplyPacket();
-            if(type == PacketType.CompleteAgentMovement) return new CompleteAgentMovementPacket();
-            if(type == PacketType.AgentMovementComplete) return new AgentMovementCompletePacket();
-            if(type == PacketType.LogoutRequest) return new LogoutRequestPacket();
-            if(type == PacketType.LogoutReply) return new LogoutReplyPacket();
-            if(type == PacketType.ImprovedInstantMessage) return new ImprovedInstantMessagePacket();
-            if(type == PacketType.RetrieveInstantMessages) return new RetrieveInstantMessagesPacket();
-            if(type == PacketType.FindAgent) return new FindAgentPacket();
-            if(type == PacketType.RequestGodlikePowers) return new RequestGodlikePowersPacket();
-            if(type == PacketType.GrantGodlikePowers) return new GrantGodlikePowersPacket();
-            if(type == PacketType.GodlikeMessage) return new GodlikeMessagePacket();
-            if(type == PacketType.EstateOwnerMessage) return new EstateOwnerMessagePacket();
-            if(type == PacketType.GenericMessage) return new GenericMessagePacket();
-            if(type == PacketType.MuteListRequest) return new MuteListRequestPacket();
-            if(type == PacketType.UpdateMuteListEntry) return new UpdateMuteListEntryPacket();
-            if(type == PacketType.RemoveMuteListEntry) return new RemoveMuteListEntryPacket();
-            if(type == PacketType.CopyInventoryFromNotecard) return new CopyInventoryFromNotecardPacket();
-            if(type == PacketType.UpdateInventoryItem) return new UpdateInventoryItemPacket();
-            if(type == PacketType.UpdateCreateInventoryItem) return new UpdateCreateInventoryItemPacket();
-            if(type == PacketType.MoveInventoryItem) return new MoveInventoryItemPacket();
-            if(type == PacketType.CopyInventoryItem) return new CopyInventoryItemPacket();
-            if(type == PacketType.RemoveInventoryItem) return new RemoveInventoryItemPacket();
-            if(type == PacketType.ChangeInventoryItemFlags) return new ChangeInventoryItemFlagsPacket();
-            if(type == PacketType.SaveAssetIntoInventory) return new SaveAssetIntoInventoryPacket();
-            if(type == PacketType.CreateInventoryFolder) return new CreateInventoryFolderPacket();
-            if(type == PacketType.UpdateInventoryFolder) return new UpdateInventoryFolderPacket();
-            if(type == PacketType.MoveInventoryFolder) return new MoveInventoryFolderPacket();
-            if(type == PacketType.RemoveInventoryFolder) return new RemoveInventoryFolderPacket();
-            if(type == PacketType.FetchInventoryDescendents) return new FetchInventoryDescendentsPacket();
-            if(type == PacketType.InventoryDescendents) return new InventoryDescendentsPacket();
-            if(type == PacketType.FetchInventory) return new FetchInventoryPacket();
-            if(type == PacketType.FetchInventoryReply) return new FetchInventoryReplyPacket();
-            if(type == PacketType.BulkUpdateInventory) return new BulkUpdateInventoryPacket();
-            if(type == PacketType.RequestInventoryAsset) return new RequestInventoryAssetPacket();
-            if(type == PacketType.InventoryAssetResponse) return new InventoryAssetResponsePacket();
-            if(type == PacketType.RemoveInventoryObjects) return new RemoveInventoryObjectsPacket();
-            if(type == PacketType.PurgeInventoryDescendents) return new PurgeInventoryDescendentsPacket();
-            if(type == PacketType.UpdateTaskInventory) return new UpdateTaskInventoryPacket();
-            if(type == PacketType.RemoveTaskInventory) return new RemoveTaskInventoryPacket();
-            if(type == PacketType.MoveTaskInventory) return new MoveTaskInventoryPacket();
-            if(type == PacketType.RequestTaskInventory) return new RequestTaskInventoryPacket();
-            if(type == PacketType.ReplyTaskInventory) return new ReplyTaskInventoryPacket();
-            if(type == PacketType.DeRezObject) return new DeRezObjectPacket();
-            if(type == PacketType.DeRezAck) return new DeRezAckPacket();
-            if(type == PacketType.RezObject) return new RezObjectPacket();
-            if(type == PacketType.RezObjectFromNotecard) return new RezObjectFromNotecardPacket();
-            if(type == PacketType.AcceptFriendship) return new AcceptFriendshipPacket();
-            if(type == PacketType.DeclineFriendship) return new DeclineFriendshipPacket();
-            if(type == PacketType.FormFriendship) return new FormFriendshipPacket();
-            if(type == PacketType.TerminateFriendship) return new TerminateFriendshipPacket();
-            if(type == PacketType.OfferCallingCard) return new OfferCallingCardPacket();
-            if(type == PacketType.AcceptCallingCard) return new AcceptCallingCardPacket();
-            if(type == PacketType.DeclineCallingCard) return new DeclineCallingCardPacket();
-            if(type == PacketType.RezScript) return new RezScriptPacket();
-            if(type == PacketType.CreateInventoryItem) return new CreateInventoryItemPacket();
-            if(type == PacketType.CreateLandmarkForEvent) return new CreateLandmarkForEventPacket();
-            if(type == PacketType.RegionHandleRequest) return new RegionHandleRequestPacket();
-            if(type == PacketType.RegionIDAndHandleReply) return new RegionIDAndHandleReplyPacket();
-            if(type == PacketType.MoneyTransferRequest) return new MoneyTransferRequestPacket();
-            if(type == PacketType.MoneyBalanceRequest) return new MoneyBalanceRequestPacket();
-            if(type == PacketType.MoneyBalanceReply) return new MoneyBalanceReplyPacket();
-            if(type == PacketType.RoutedMoneyBalanceReply) return new RoutedMoneyBalanceReplyPacket();
-            if(type == PacketType.ActivateGestures) return new ActivateGesturesPacket();
-            if(type == PacketType.DeactivateGestures) return new DeactivateGesturesPacket();
-            if(type == PacketType.MuteListUpdate) return new MuteListUpdatePacket();
-            if(type == PacketType.UseCachedMuteList) return new UseCachedMuteListPacket();
-            if(type == PacketType.GrantUserRights) return new GrantUserRightsPacket();
-            if(type == PacketType.ChangeUserRights) return new ChangeUserRightsPacket();
-            if(type == PacketType.OnlineNotification) return new OnlineNotificationPacket();
-            if(type == PacketType.OfflineNotification) return new OfflineNotificationPacket();
-            if(type == PacketType.SetStartLocationRequest) return new SetStartLocationRequestPacket();
-            if(type == PacketType.AssetUploadRequest) return new AssetUploadRequestPacket();
-            if(type == PacketType.AssetUploadComplete) return new AssetUploadCompletePacket();
-            if(type == PacketType.CreateGroupRequest) return new CreateGroupRequestPacket();
-            if(type == PacketType.CreateGroupReply) return new CreateGroupReplyPacket();
-            if(type == PacketType.UpdateGroupInfo) return new UpdateGroupInfoPacket();
-            if(type == PacketType.GroupRoleChanges) return new GroupRoleChangesPacket();
-            if(type == PacketType.JoinGroupRequest) return new JoinGroupRequestPacket();
-            if(type == PacketType.JoinGroupReply) return new JoinGroupReplyPacket();
-            if(type == PacketType.EjectGroupMemberRequest) return new EjectGroupMemberRequestPacket();
-            if(type == PacketType.EjectGroupMemberReply) return new EjectGroupMemberReplyPacket();
-            if(type == PacketType.LeaveGroupRequest) return new LeaveGroupRequestPacket();
-            if(type == PacketType.LeaveGroupReply) return new LeaveGroupReplyPacket();
-            if(type == PacketType.InviteGroupRequest) return new InviteGroupRequestPacket();
-            if(type == PacketType.GroupProfileRequest) return new GroupProfileRequestPacket();
-            if(type == PacketType.GroupProfileReply) return new GroupProfileReplyPacket();
-            if(type == PacketType.GroupAccountSummaryRequest) return new GroupAccountSummaryRequestPacket();
-            if(type == PacketType.GroupAccountSummaryReply) return new GroupAccountSummaryReplyPacket();
-            if(type == PacketType.GroupAccountDetailsRequest) return new GroupAccountDetailsRequestPacket();
-            if(type == PacketType.GroupAccountDetailsReply) return new GroupAccountDetailsReplyPacket();
-            if(type == PacketType.GroupAccountTransactionsRequest) return new GroupAccountTransactionsRequestPacket();
-            if(type == PacketType.GroupAccountTransactionsReply) return new GroupAccountTransactionsReplyPacket();
-            if(type == PacketType.GroupActiveProposalsRequest) return new GroupActiveProposalsRequestPacket();
-            if(type == PacketType.GroupActiveProposalItemReply) return new GroupActiveProposalItemReplyPacket();
-            if(type == PacketType.GroupVoteHistoryRequest) return new GroupVoteHistoryRequestPacket();
-            if(type == PacketType.GroupVoteHistoryItemReply) return new GroupVoteHistoryItemReplyPacket();
-            if(type == PacketType.StartGroupProposal) return new StartGroupProposalPacket();
-            if(type == PacketType.GroupProposalBallot) return new GroupProposalBallotPacket();
-            if(type == PacketType.GroupMembersRequest) return new GroupMembersRequestPacket();
-            if(type == PacketType.GroupMembersReply) return new GroupMembersReplyPacket();
-            if(type == PacketType.ActivateGroup) return new ActivateGroupPacket();
-            if(type == PacketType.SetGroupContribution) return new SetGroupContributionPacket();
-            if(type == PacketType.SetGroupAcceptNotices) return new SetGroupAcceptNoticesPacket();
-            if(type == PacketType.GroupRoleDataRequest) return new GroupRoleDataRequestPacket();
-            if(type == PacketType.GroupRoleDataReply) return new GroupRoleDataReplyPacket();
-            if(type == PacketType.GroupRoleMembersRequest) return new GroupRoleMembersRequestPacket();
-            if(type == PacketType.GroupRoleMembersReply) return new GroupRoleMembersReplyPacket();
-            if(type == PacketType.GroupTitlesRequest) return new GroupTitlesRequestPacket();
-            if(type == PacketType.GroupTitlesReply) return new GroupTitlesReplyPacket();
-            if(type == PacketType.GroupTitleUpdate) return new GroupTitleUpdatePacket();
-            if(type == PacketType.GroupRoleUpdate) return new GroupRoleUpdatePacket();
-            if(type == PacketType.LiveHelpGroupRequest) return new LiveHelpGroupRequestPacket();
-            if(type == PacketType.LiveHelpGroupReply) return new LiveHelpGroupReplyPacket();
-            if(type == PacketType.AgentWearablesRequest) return new AgentWearablesRequestPacket();
-            if(type == PacketType.AgentWearablesUpdate) return new AgentWearablesUpdatePacket();
-            if(type == PacketType.AgentIsNowWearing) return new AgentIsNowWearingPacket();
-            if(type == PacketType.AgentCachedTexture) return new AgentCachedTexturePacket();
-            if(type == PacketType.AgentCachedTextureResponse) return new AgentCachedTextureResponsePacket();
-            if(type == PacketType.AgentDataUpdateRequest) return new AgentDataUpdateRequestPacket();
-            if(type == PacketType.AgentDataUpdate) return new AgentDataUpdatePacket();
-            if(type == PacketType.GroupDataUpdate) return new GroupDataUpdatePacket();
-            if(type == PacketType.AgentGroupDataUpdate) return new AgentGroupDataUpdatePacket();
-            if(type == PacketType.AgentDropGroup) return new AgentDropGroupPacket();
-            if(type == PacketType.CreateTrustedCircuit) return new CreateTrustedCircuitPacket();
-            if(type == PacketType.DenyTrustedCircuit) return new DenyTrustedCircuitPacket();
-            if(type == PacketType.RequestTrustedCircuit) return new RequestTrustedCircuitPacket();
-            if(type == PacketType.RezSingleAttachmentFromInv) return new RezSingleAttachmentFromInvPacket();
-            if(type == PacketType.RezMultipleAttachmentsFromInv) return new RezMultipleAttachmentsFromInvPacket();
-            if(type == PacketType.DetachAttachmentIntoInv) return new DetachAttachmentIntoInvPacket();
-            if(type == PacketType.CreateNewOutfitAttachments) return new CreateNewOutfitAttachmentsPacket();
-            if(type == PacketType.UserInfoRequest) return new UserInfoRequestPacket();
-            if(type == PacketType.UserInfoReply) return new UserInfoReplyPacket();
-            if(type == PacketType.UpdateUserInfo) return new UpdateUserInfoPacket();
-            if(type == PacketType.InitiateDownload) return new InitiateDownloadPacket();
-            if(type == PacketType.SystemMessage) return new SystemMessagePacket();
-            if(type == PacketType.MapLayerRequest) return new MapLayerRequestPacket();
-            if(type == PacketType.MapLayerReply) return new MapLayerReplyPacket();
-            if(type == PacketType.MapBlockRequest) return new MapBlockRequestPacket();
-            if(type == PacketType.MapNameRequest) return new MapNameRequestPacket();
-            if(type == PacketType.MapBlockReply) return new MapBlockReplyPacket();
-            if(type == PacketType.MapItemRequest) return new MapItemRequestPacket();
-            if(type == PacketType.MapItemReply) return new MapItemReplyPacket();
-            if(type == PacketType.SendPostcard) return new SendPostcardPacket();
-            if(type == PacketType.ParcelMediaCommandMessage) return new ParcelMediaCommandMessagePacket();
-            if(type == PacketType.ParcelMediaUpdate) return new ParcelMediaUpdatePacket();
-            if(type == PacketType.LandStatRequest) return new LandStatRequestPacket();
-            if(type == PacketType.LandStatReply) return new LandStatReplyPacket();
-            if(type == PacketType.Error) return new ErrorPacket();
-            if(type == PacketType.ObjectIncludeInSearch) return new ObjectIncludeInSearchPacket();
-            if(type == PacketType.PacketAck) return new PacketAckPacket();
-            if(type == PacketType.OpenCircuit) return new OpenCircuitPacket();
-            if(type == PacketType.CloseCircuit) return new CloseCircuitPacket();
-            return null;
-
-        }
-
-        public static Packet BuildPacket(byte[] packetBuffer, ref int packetEnd, byte[] zeroBuffer)
-        {
-            byte[] bytes; ushort id; PacketFrequency freq;
-            int i = 0;
-            Header header = Header.BuildHeader(packetBuffer, ref i, ref packetEnd);
-            if (header.Zerocoded)
-            {
-                packetEnd = Helpers.ZeroDecode(packetBuffer, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            else
-            {
-                bytes = packetBuffer;
-            }
-
-            if (bytes[6] == 0xFF)
-            {
-                if (bytes[7] == 0xFF)
-                {
-                    id = (ushort)((bytes[8] << 8) + bytes[9]); freq = PacketFrequency.Low;
-                    switch (id)
-                    {
-                        case 1: return new TestMessagePacket(header, bytes, ref i);
-                        case 3: return new UseCircuitCodePacket(header, bytes, ref i);
-                        case 10: return new TelehubInfoPacket(header, bytes, ref i);
-                        case 24: return new EconomyDataRequestPacket(header, bytes, ref i);
-                        case 25: return new EconomyDataPacket(header, bytes, ref i);
-                        case 26: return new AvatarPickerRequestPacket(header, bytes, ref i);
-                        case 28: return new AvatarPickerReplyPacket(header, bytes, ref i);
-                        case 29: return new PlacesQueryPacket(header, bytes, ref i);
-                        case 30: return new PlacesReplyPacket(header, bytes, ref i);
-                        case 31: return new DirFindQueryPacket(header, bytes, ref i);
-                        case 33: return new DirPlacesQueryPacket(header, bytes, ref i);
-                        case 35: return new DirPlacesReplyPacket(header, bytes, ref i);
-                        case 36: return new DirPeopleReplyPacket(header, bytes, ref i);
-                        case 37: return new DirEventsReplyPacket(header, bytes, ref i);
-                        case 38: return new DirGroupsReplyPacket(header, bytes, ref i);
-                        case 39: return new DirClassifiedQueryPacket(header, bytes, ref i);
-                        case 41: return new DirClassifiedReplyPacket(header, bytes, ref i);
-                        case 42: return new AvatarClassifiedReplyPacket(header, bytes, ref i);
-                        case 43: return new ClassifiedInfoRequestPacket(header, bytes, ref i);
-                        case 44: return new ClassifiedInfoReplyPacket(header, bytes, ref i);
-                        case 45: return new ClassifiedInfoUpdatePacket(header, bytes, ref i);
-                        case 46: return new ClassifiedDeletePacket(header, bytes, ref i);
-                        case 47: return new ClassifiedGodDeletePacket(header, bytes, ref i);
-                        case 48: return new DirLandQueryPacket(header, bytes, ref i);
-                        case 50: return new DirLandReplyPacket(header, bytes, ref i);
-                        case 51: return new DirPopularQueryPacket(header, bytes, ref i);
-                        case 53: return new DirPopularReplyPacket(header, bytes, ref i);
-                        case 54: return new ParcelInfoRequestPacket(header, bytes, ref i);
-                        case 55: return new ParcelInfoReplyPacket(header, bytes, ref i);
-                        case 56: return new ParcelObjectOwnersRequestPacket(header, bytes, ref i);
-                        case 57: return new ParcelObjectOwnersReplyPacket(header, bytes, ref i);
-                        case 58: return new GroupNoticesListRequestPacket(header, bytes, ref i);
-                        case 59: return new GroupNoticesListReplyPacket(header, bytes, ref i);
-                        case 60: return new GroupNoticeRequestPacket(header, bytes, ref i);
-                        case 62: return new TeleportRequestPacket(header, bytes, ref i);
-                        case 63: return new TeleportLocationRequestPacket(header, bytes, ref i);
-                        case 64: return new TeleportLocalPacket(header, bytes, ref i);
-                        case 65: return new TeleportLandmarkRequestPacket(header, bytes, ref i);
-                        case 66: return new TeleportProgressPacket(header, bytes, ref i);
-                        case 69: return new TeleportFinishPacket(header, bytes, ref i);
-                        case 70: return new StartLurePacket(header, bytes, ref i);
-                        case 71: return new TeleportLureRequestPacket(header, bytes, ref i);
-                        case 72: return new TeleportCancelPacket(header, bytes, ref i);
-                        case 73: return new TeleportStartPacket(header, bytes, ref i);
-                        case 74: return new TeleportFailedPacket(header, bytes, ref i);
-                        case 75: return new UndoPacket(header, bytes, ref i);
-                        case 76: return new RedoPacket(header, bytes, ref i);
-                        case 77: return new UndoLandPacket(header, bytes, ref i);
-                        case 78: return new AgentPausePacket(header, bytes, ref i);
-                        case 79: return new AgentResumePacket(header, bytes, ref i);
-                        case 80: return new ChatFromViewerPacket(header, bytes, ref i);
-                        case 81: return new AgentThrottlePacket(header, bytes, ref i);
-                        case 82: return new AgentFOVPacket(header, bytes, ref i);
-                        case 83: return new AgentHeightWidthPacket(header, bytes, ref i);
-                        case 84: return new AgentSetAppearancePacket(header, bytes, ref i);
-                        case 85: return new AgentQuitCopyPacket(header, bytes, ref i);
-                        case 86: return new ImageNotInDatabasePacket(header, bytes, ref i);
-                        case 87: return new RebakeAvatarTexturesPacket(header, bytes, ref i);
-                        case 88: return new SetAlwaysRunPacket(header, bytes, ref i);
-                        case 89: return new ObjectDeletePacket(header, bytes, ref i);
-                        case 90: return new ObjectDuplicatePacket(header, bytes, ref i);
-                        case 91: return new ObjectDuplicateOnRayPacket(header, bytes, ref i);
-                        case 92: return new ObjectScalePacket(header, bytes, ref i);
-                        case 93: return new ObjectRotationPacket(header, bytes, ref i);
-                        case 94: return new ObjectFlagUpdatePacket(header, bytes, ref i);
-                        case 95: return new ObjectClickActionPacket(header, bytes, ref i);
-                        case 96: return new ObjectImagePacket(header, bytes, ref i);
-                        case 97: return new ObjectMaterialPacket(header, bytes, ref i);
-                        case 98: return new ObjectShapePacket(header, bytes, ref i);
-                        case 99: return new ObjectExtraParamsPacket(header, bytes, ref i);
-                        case 100: return new ObjectOwnerPacket(header, bytes, ref i);
-                        case 101: return new ObjectGroupPacket(header, bytes, ref i);
-                        case 102: return new ObjectBuyPacket(header, bytes, ref i);
-                        case 103: return new BuyObjectInventoryPacket(header, bytes, ref i);
-                        case 104: return new DerezContainerPacket(header, bytes, ref i);
-                        case 105: return new ObjectPermissionsPacket(header, bytes, ref i);
-                        case 106: return new ObjectSaleInfoPacket(header, bytes, ref i);
-                        case 107: return new ObjectNamePacket(header, bytes, ref i);
-                        case 108: return new ObjectDescriptionPacket(header, bytes, ref i);
-                        case 109: return new ObjectCategoryPacket(header, bytes, ref i);
-                        case 110: return new ObjectSelectPacket(header, bytes, ref i);
-                        case 111: return new ObjectDeselectPacket(header, bytes, ref i);
-                        case 112: return new ObjectAttachPacket(header, bytes, ref i);
-                        case 113: return new ObjectDetachPacket(header, bytes, ref i);
-                        case 114: return new ObjectDropPacket(header, bytes, ref i);
-                        case 115: return new ObjectLinkPacket(header, bytes, ref i);
-                        case 116: return new ObjectDelinkPacket(header, bytes, ref i);
-                        case 117: return new ObjectGrabPacket(header, bytes, ref i);
-                        case 118: return new ObjectGrabUpdatePacket(header, bytes, ref i);
-                        case 119: return new ObjectDeGrabPacket(header, bytes, ref i);
-                        case 120: return new ObjectSpinStartPacket(header, bytes, ref i);
-                        case 121: return new ObjectSpinUpdatePacket(header, bytes, ref i);
-                        case 122: return new ObjectSpinStopPacket(header, bytes, ref i);
-                        case 123: return new ObjectExportSelectedPacket(header, bytes, ref i);
-                        case 124: return new ModifyLandPacket(header, bytes, ref i);
-                        case 125: return new VelocityInterpolateOnPacket(header, bytes, ref i);
-                        case 126: return new VelocityInterpolateOffPacket(header, bytes, ref i);
-                        case 127: return new StateSavePacket(header, bytes, ref i);
-                        case 128: return new ReportAutosaveCrashPacket(header, bytes, ref i);
-                        case 129: return new SimWideDeletesPacket(header, bytes, ref i);
-                        case 130: return new TrackAgentPacket(header, bytes, ref i);
-                        case 131: return new ViewerStatsPacket(header, bytes, ref i);
-                        case 132: return new ScriptAnswerYesPacket(header, bytes, ref i);
-                        case 133: return new UserReportPacket(header, bytes, ref i);
-                        case 134: return new AlertMessagePacket(header, bytes, ref i);
-                        case 135: return new AgentAlertMessagePacket(header, bytes, ref i);
-                        case 136: return new MeanCollisionAlertPacket(header, bytes, ref i);
-                        case 137: return new ViewerFrozenMessagePacket(header, bytes, ref i);
-                        case 138: return new HealthMessagePacket(header, bytes, ref i);
-                        case 139: return new ChatFromSimulatorPacket(header, bytes, ref i);
-                        case 140: return new SimStatsPacket(header, bytes, ref i);
-                        case 141: return new RequestRegionInfoPacket(header, bytes, ref i);
-                        case 142: return new RegionInfoPacket(header, bytes, ref i);
-                        case 143: return new GodUpdateRegionInfoPacket(header, bytes, ref i);
-                        case 146: return new NearestLandingRegionUpdatedPacket(header, bytes, ref i);
-                        case 148: return new RegionHandshakePacket(header, bytes, ref i);
-                        case 149: return new RegionHandshakeReplyPacket(header, bytes, ref i);
-                        case 150: return new SimulatorViewerTimeMessagePacket(header, bytes, ref i);
-                        case 151: return new EnableSimulatorPacket(header, bytes, ref i);
-                        case 152: return new DisableSimulatorPacket(header, bytes, ref i);
-                        case 153: return new TransferRequestPacket(header, bytes, ref i);
-                        case 154: return new TransferInfoPacket(header, bytes, ref i);
-                        case 155: return new TransferAbortPacket(header, bytes, ref i);
-                        case 156: return new RequestXferPacket(header, bytes, ref i);
-                        case 157: return new AbortXferPacket(header, bytes, ref i);
-                        case 158: return new AvatarAppearancePacket(header, bytes, ref i);
-                        case 159: return new SetFollowCamPropertiesPacket(header, bytes, ref i);
-                        case 160: return new ClearFollowCamPropertiesPacket(header, bytes, ref i);
-                        case 161: return new RequestPayPricePacket(header, bytes, ref i);
-                        case 162: return new PayPriceReplyPacket(header, bytes, ref i);
-                        case 163: return new KickUserPacket(header, bytes, ref i);
-                        case 164: return new KickUserAckPacket(header, bytes, ref i);
-                        case 165: return new GodKickUserPacket(header, bytes, ref i);
-                        case 167: return new EjectUserPacket(header, bytes, ref i);
-                        case 168: return new FreezeUserPacket(header, bytes, ref i);
-                        case 169: return new AvatarPropertiesRequestPacket(header, bytes, ref i);
-                        case 171: return new AvatarPropertiesReplyPacket(header, bytes, ref i);
-                        case 172: return new AvatarInterestsReplyPacket(header, bytes, ref i);
-                        case 173: return new AvatarGroupsReplyPacket(header, bytes, ref i);
-                        case 174: return new AvatarPropertiesUpdatePacket(header, bytes, ref i);
-                        case 175: return new AvatarInterestsUpdatePacket(header, bytes, ref i);
-                        case 176: return new AvatarNotesReplyPacket(header, bytes, ref i);
-                        case 177: return new AvatarNotesUpdatePacket(header, bytes, ref i);
-                        case 178: return new AvatarPicksReplyPacket(header, bytes, ref i);
-                        case 179: return new EventInfoRequestPacket(header, bytes, ref i);
-                        case 180: return new EventInfoReplyPacket(header, bytes, ref i);
-                        case 181: return new EventNotificationAddRequestPacket(header, bytes, ref i);
-                        case 182: return new EventNotificationRemoveRequestPacket(header, bytes, ref i);
-                        case 183: return new EventGodDeletePacket(header, bytes, ref i);
-                        case 184: return new PickInfoReplyPacket(header, bytes, ref i);
-                        case 185: return new PickInfoUpdatePacket(header, bytes, ref i);
-                        case 186: return new PickDeletePacket(header, bytes, ref i);
-                        case 187: return new PickGodDeletePacket(header, bytes, ref i);
-                        case 188: return new ScriptQuestionPacket(header, bytes, ref i);
-                        case 189: return new ScriptControlChangePacket(header, bytes, ref i);
-                        case 190: return new ScriptDialogPacket(header, bytes, ref i);
-                        case 191: return new ScriptDialogReplyPacket(header, bytes, ref i);
-                        case 192: return new ForceScriptControlReleasePacket(header, bytes, ref i);
-                        case 193: return new RevokePermissionsPacket(header, bytes, ref i);
-                        case 194: return new LoadURLPacket(header, bytes, ref i);
-                        case 195: return new ScriptTeleportRequestPacket(header, bytes, ref i);
-                        case 196: return new ParcelOverlayPacket(header, bytes, ref i);
-                        case 197: return new ParcelPropertiesRequestByIDPacket(header, bytes, ref i);
-                        case 198: return new ParcelPropertiesUpdatePacket(header, bytes, ref i);
-                        case 199: return new ParcelReturnObjectsPacket(header, bytes, ref i);
-                        case 200: return new ParcelSetOtherCleanTimePacket(header, bytes, ref i);
-                        case 201: return new ParcelDisableObjectsPacket(header, bytes, ref i);
-                        case 202: return new ParcelSelectObjectsPacket(header, bytes, ref i);
-                        case 203: return new EstateCovenantRequestPacket(header, bytes, ref i);
-                        case 204: return new EstateCovenantReplyPacket(header, bytes, ref i);
-                        case 205: return new ForceObjectSelectPacket(header, bytes, ref i);
-                        case 206: return new ParcelBuyPassPacket(header, bytes, ref i);
-                        case 207: return new ParcelDeedToGroupPacket(header, bytes, ref i);
-                        case 208: return new ParcelReclaimPacket(header, bytes, ref i);
-                        case 209: return new ParcelClaimPacket(header, bytes, ref i);
-                        case 210: return new ParcelJoinPacket(header, bytes, ref i);
-                        case 211: return new ParcelDividePacket(header, bytes, ref i);
-                        case 212: return new ParcelReleasePacket(header, bytes, ref i);
-                        case 213: return new ParcelBuyPacket(header, bytes, ref i);
-                        case 214: return new ParcelGodForceOwnerPacket(header, bytes, ref i);
-                        case 215: return new ParcelAccessListRequestPacket(header, bytes, ref i);
-                        case 216: return new ParcelAccessListReplyPacket(header, bytes, ref i);
-                        case 217: return new ParcelAccessListUpdatePacket(header, bytes, ref i);
-                        case 218: return new ParcelDwellRequestPacket(header, bytes, ref i);
-                        case 219: return new ParcelDwellReplyPacket(header, bytes, ref i);
-                        case 227: return new ParcelGodMarkAsContentPacket(header, bytes, ref i);
-                        case 228: return new ViewerStartAuctionPacket(header, bytes, ref i);
-                        case 235: return new UUIDNameRequestPacket(header, bytes, ref i);
-                        case 236: return new UUIDNameReplyPacket(header, bytes, ref i);
-                        case 237: return new UUIDGroupNameRequestPacket(header, bytes, ref i);
-                        case 238: return new UUIDGroupNameReplyPacket(header, bytes, ref i);
-                        case 240: return new ChildAgentDyingPacket(header, bytes, ref i);
-                        case 241: return new ChildAgentUnknownPacket(header, bytes, ref i);
-                        case 243: return new GetScriptRunningPacket(header, bytes, ref i);
-                        case 244: return new ScriptRunningReplyPacket(header, bytes, ref i);
-                        case 245: return new SetScriptRunningPacket(header, bytes, ref i);
-                        case 246: return new ScriptResetPacket(header, bytes, ref i);
-                        case 247: return new ScriptSensorRequestPacket(header, bytes, ref i);
-                        case 248: return new ScriptSensorReplyPacket(header, bytes, ref i);
-                        case 249: return new CompleteAgentMovementPacket(header, bytes, ref i);
-                        case 250: return new AgentMovementCompletePacket(header, bytes, ref i);
-                        case 252: return new LogoutRequestPacket(header, bytes, ref i);
-                        case 253: return new LogoutReplyPacket(header, bytes, ref i);
-                        case 254: return new ImprovedInstantMessagePacket(header, bytes, ref i);
-                        case 255: return new RetrieveInstantMessagesPacket(header, bytes, ref i);
-                        case 256: return new FindAgentPacket(header, bytes, ref i);
-                        case 257: return new RequestGodlikePowersPacket(header, bytes, ref i);
-                        case 258: return new GrantGodlikePowersPacket(header, bytes, ref i);
-                        case 259: return new GodlikeMessagePacket(header, bytes, ref i);
-                        case 260: return new EstateOwnerMessagePacket(header, bytes, ref i);
-                        case 261: return new GenericMessagePacket(header, bytes, ref i);
-                        case 262: return new MuteListRequestPacket(header, bytes, ref i);
-                        case 263: return new UpdateMuteListEntryPacket(header, bytes, ref i);
-                        case 264: return new RemoveMuteListEntryPacket(header, bytes, ref i);
-                        case 265: return new CopyInventoryFromNotecardPacket(header, bytes, ref i);
-                        case 266: return new UpdateInventoryItemPacket(header, bytes, ref i);
-                        case 267: return new UpdateCreateInventoryItemPacket(header, bytes, ref i);
-                        case 268: return new MoveInventoryItemPacket(header, bytes, ref i);
-                        case 269: return new CopyInventoryItemPacket(header, bytes, ref i);
-                        case 270: return new RemoveInventoryItemPacket(header, bytes, ref i);
-                        case 271: return new ChangeInventoryItemFlagsPacket(header, bytes, ref i);
-                        case 272: return new SaveAssetIntoInventoryPacket(header, bytes, ref i);
-                        case 273: return new CreateInventoryFolderPacket(header, bytes, ref i);
-                        case 274: return new UpdateInventoryFolderPacket(header, bytes, ref i);
-                        case 275: return new MoveInventoryFolderPacket(header, bytes, ref i);
-                        case 276: return new RemoveInventoryFolderPacket(header, bytes, ref i);
-                        case 277: return new FetchInventoryDescendentsPacket(header, bytes, ref i);
-                        case 278: return new InventoryDescendentsPacket(header, bytes, ref i);
-                        case 279: return new FetchInventoryPacket(header, bytes, ref i);
-                        case 280: return new FetchInventoryReplyPacket(header, bytes, ref i);
-                        case 281: return new BulkUpdateInventoryPacket(header, bytes, ref i);
-                        case 282: return new RequestInventoryAssetPacket(header, bytes, ref i);
-                        case 283: return new InventoryAssetResponsePacket(header, bytes, ref i);
-                        case 284: return new RemoveInventoryObjectsPacket(header, bytes, ref i);
-                        case 285: return new PurgeInventoryDescendentsPacket(header, bytes, ref i);
-                        case 286: return new UpdateTaskInventoryPacket(header, bytes, ref i);
-                        case 287: return new RemoveTaskInventoryPacket(header, bytes, ref i);
-                        case 288: return new MoveTaskInventoryPacket(header, bytes, ref i);
-                        case 289: return new RequestTaskInventoryPacket(header, bytes, ref i);
-                        case 290: return new ReplyTaskInventoryPacket(header, bytes, ref i);
-                        case 291: return new DeRezObjectPacket(header, bytes, ref i);
-                        case 292: return new DeRezAckPacket(header, bytes, ref i);
-                        case 293: return new RezObjectPacket(header, bytes, ref i);
-                        case 294: return new RezObjectFromNotecardPacket(header, bytes, ref i);
-                        case 297: return new AcceptFriendshipPacket(header, bytes, ref i);
-                        case 298: return new DeclineFriendshipPacket(header, bytes, ref i);
-                        case 299: return new FormFriendshipPacket(header, bytes, ref i);
-                        case 300: return new TerminateFriendshipPacket(header, bytes, ref i);
-                        case 301: return new OfferCallingCardPacket(header, bytes, ref i);
-                        case 302: return new AcceptCallingCardPacket(header, bytes, ref i);
-                        case 303: return new DeclineCallingCardPacket(header, bytes, ref i);
-                        case 304: return new RezScriptPacket(header, bytes, ref i);
-                        case 305: return new CreateInventoryItemPacket(header, bytes, ref i);
-                        case 306: return new CreateLandmarkForEventPacket(header, bytes, ref i);
-                        case 309: return new RegionHandleRequestPacket(header, bytes, ref i);
-                        case 310: return new RegionIDAndHandleReplyPacket(header, bytes, ref i);
-                        case 311: return new MoneyTransferRequestPacket(header, bytes, ref i);
-                        case 313: return new MoneyBalanceRequestPacket(header, bytes, ref i);
-                        case 314: return new MoneyBalanceReplyPacket(header, bytes, ref i);
-                        case 315: return new RoutedMoneyBalanceReplyPacket(header, bytes, ref i);
-                        case 316: return new ActivateGesturesPacket(header, bytes, ref i);
-                        case 317: return new DeactivateGesturesPacket(header, bytes, ref i);
-                        case 318: return new MuteListUpdatePacket(header, bytes, ref i);
-                        case 319: return new UseCachedMuteListPacket(header, bytes, ref i);
-                        case 320: return new GrantUserRightsPacket(header, bytes, ref i);
-                        case 321: return new ChangeUserRightsPacket(header, bytes, ref i);
-                        case 322: return new OnlineNotificationPacket(header, bytes, ref i);
-                        case 323: return new OfflineNotificationPacket(header, bytes, ref i);
-                        case 324: return new SetStartLocationRequestPacket(header, bytes, ref i);
-                        case 333: return new AssetUploadRequestPacket(header, bytes, ref i);
-                        case 334: return new AssetUploadCompletePacket(header, bytes, ref i);
-                        case 339: return new CreateGroupRequestPacket(header, bytes, ref i);
-                        case 340: return new CreateGroupReplyPacket(header, bytes, ref i);
-                        case 341: return new UpdateGroupInfoPacket(header, bytes, ref i);
-                        case 342: return new GroupRoleChangesPacket(header, bytes, ref i);
-                        case 343: return new JoinGroupRequestPacket(header, bytes, ref i);
-                        case 344: return new JoinGroupReplyPacket(header, bytes, ref i);
-                        case 345: return new EjectGroupMemberRequestPacket(header, bytes, ref i);
-                        case 346: return new EjectGroupMemberReplyPacket(header, bytes, ref i);
-                        case 347: return new LeaveGroupRequestPacket(header, bytes, ref i);
-                        case 348: return new LeaveGroupReplyPacket(header, bytes, ref i);
-                        case 349: return new InviteGroupRequestPacket(header, bytes, ref i);
-                        case 351: return new GroupProfileRequestPacket(header, bytes, ref i);
-                        case 352: return new GroupProfileReplyPacket(header, bytes, ref i);
-                        case 353: return new GroupAccountSummaryRequestPacket(header, bytes, ref i);
-                        case 354: return new GroupAccountSummaryReplyPacket(header, bytes, ref i);
-                        case 355: return new GroupAccountDetailsRequestPacket(header, bytes, ref i);
-                        case 356: return new GroupAccountDetailsReplyPacket(header, bytes, ref i);
-                        case 357: return new GroupAccountTransactionsRequestPacket(header, bytes, ref i);
-                        case 358: return new GroupAccountTransactionsReplyPacket(header, bytes, ref i);
-                        case 359: return new GroupActiveProposalsRequestPacket(header, bytes, ref i);
-                        case 360: return new GroupActiveProposalItemReplyPacket(header, bytes, ref i);
-                        case 361: return new GroupVoteHistoryRequestPacket(header, bytes, ref i);
-                        case 362: return new GroupVoteHistoryItemReplyPacket(header, bytes, ref i);
-                        case 363: return new StartGroupProposalPacket(header, bytes, ref i);
-                        case 364: return new GroupProposalBallotPacket(header, bytes, ref i);
-                        case 366: return new GroupMembersRequestPacket(header, bytes, ref i);
-                        case 367: return new GroupMembersReplyPacket(header, bytes, ref i);
-                        case 368: return new ActivateGroupPacket(header, bytes, ref i);
-                        case 369: return new SetGroupContributionPacket(header, bytes, ref i);
-                        case 370: return new SetGroupAcceptNoticesPacket(header, bytes, ref i);
-                        case 371: return new GroupRoleDataRequestPacket(header, bytes, ref i);
-                        case 372: return new GroupRoleDataReplyPacket(header, bytes, ref i);
-                        case 373: return new GroupRoleMembersRequestPacket(header, bytes, ref i);
-                        case 374: return new GroupRoleMembersReplyPacket(header, bytes, ref i);
-                        case 375: return new GroupTitlesRequestPacket(header, bytes, ref i);
-                        case 376: return new GroupTitlesReplyPacket(header, bytes, ref i);
-                        case 377: return new GroupTitleUpdatePacket(header, bytes, ref i);
-                        case 378: return new GroupRoleUpdatePacket(header, bytes, ref i);
-                        case 379: return new LiveHelpGroupRequestPacket(header, bytes, ref i);
-                        case 380: return new LiveHelpGroupReplyPacket(header, bytes, ref i);
-                        case 381: return new AgentWearablesRequestPacket(header, bytes, ref i);
-                        case 382: return new AgentWearablesUpdatePacket(header, bytes, ref i);
-                        case 383: return new AgentIsNowWearingPacket(header, bytes, ref i);
-                        case 384: return new AgentCachedTexturePacket(header, bytes, ref i);
-                        case 385: return new AgentCachedTextureResponsePacket(header, bytes, ref i);
-                        case 386: return new AgentDataUpdateRequestPacket(header, bytes, ref i);
-                        case 387: return new AgentDataUpdatePacket(header, bytes, ref i);
-                        case 388: return new GroupDataUpdatePacket(header, bytes, ref i);
-                        case 389: return new AgentGroupDataUpdatePacket(header, bytes, ref i);
-                        case 390: return new AgentDropGroupPacket(header, bytes, ref i);
-                        case 392: return new CreateTrustedCircuitPacket(header, bytes, ref i);
-                        case 393: return new DenyTrustedCircuitPacket(header, bytes, ref i);
-                        case 394: return new RequestTrustedCircuitPacket(header, bytes, ref i);
-                        case 395: return new RezSingleAttachmentFromInvPacket(header, bytes, ref i);
-                        case 396: return new RezMultipleAttachmentsFromInvPacket(header, bytes, ref i);
-                        case 397: return new DetachAttachmentIntoInvPacket(header, bytes, ref i);
-                        case 398: return new CreateNewOutfitAttachmentsPacket(header, bytes, ref i);
-                        case 399: return new UserInfoRequestPacket(header, bytes, ref i);
-                        case 400: return new UserInfoReplyPacket(header, bytes, ref i);
-                        case 401: return new UpdateUserInfoPacket(header, bytes, ref i);
-                        case 403: return new InitiateDownloadPacket(header, bytes, ref i);
-                        case 404: return new SystemMessagePacket(header, bytes, ref i);
-                        case 405: return new MapLayerRequestPacket(header, bytes, ref i);
-                        case 406: return new MapLayerReplyPacket(header, bytes, ref i);
-                        case 407: return new MapBlockRequestPacket(header, bytes, ref i);
-                        case 408: return new MapNameRequestPacket(header, bytes, ref i);
-                        case 409: return new MapBlockReplyPacket(header, bytes, ref i);
-                        case 410: return new MapItemRequestPacket(header, bytes, ref i);
-                        case 411: return new MapItemReplyPacket(header, bytes, ref i);
-                        case 412: return new SendPostcardPacket(header, bytes, ref i);
-                        case 419: return new ParcelMediaCommandMessagePacket(header, bytes, ref i);
-                        case 420: return new ParcelMediaUpdatePacket(header, bytes, ref i);
-                        case 421: return new LandStatRequestPacket(header, bytes, ref i);
-                        case 422: return new LandStatReplyPacket(header, bytes, ref i);
-                        case 423: return new ErrorPacket(header, bytes, ref i);
-                        case 424: return new ObjectIncludeInSearchPacket(header, bytes, ref i);
-                        case 65531: return new PacketAckPacket(header, bytes, ref i);
-                        case 65532: return new OpenCircuitPacket(header, bytes, ref i);
-                        case 65533: return new CloseCircuitPacket(header, bytes, ref i);
-                    }
-                }
-                else
-                {
-                    id = (ushort)bytes[7];  freq = PacketFrequency.Medium;
-                    switch (id)
-                    {
-                        case 1: return new ObjectAddPacket(header, bytes, ref i);
-                        case 2: return new MultipleObjectUpdatePacket(header, bytes, ref i);
-                        case 3: return new RequestMultipleObjectsPacket(header, bytes, ref i);
-                        case 4: return new ObjectPositionPacket(header, bytes, ref i);
-                        case 5: return new RequestObjectPropertiesFamilyPacket(header, bytes, ref i);
-                        case 6: return new CoarseLocationUpdatePacket(header, bytes, ref i);
-                        case 7: return new CrossedRegionPacket(header, bytes, ref i);
-                        case 8: return new ConfirmEnableSimulatorPacket(header, bytes, ref i);
-                        case 9: return new ObjectPropertiesPacket(header, bytes, ref i);
-                        case 10: return new ObjectPropertiesFamilyPacket(header, bytes, ref i);
-                        case 11: return new ParcelPropertiesRequestPacket(header, bytes, ref i);
-                        case 13: return new AttachedSoundPacket(header, bytes, ref i);
-                        case 14: return new AttachedSoundGainChangePacket(header, bytes, ref i);
-                        case 15: return new PreloadSoundPacket(header, bytes, ref i);
-                        case 17: return new ViewerEffectPacket(header, bytes, ref i);
-                    }
-                }
-            }
-            else
-            {
-                id = (ushort)bytes[6];  freq = PacketFrequency.High;
-                switch (id)
-                    {
-                        case 1: return new StartPingCheckPacket(header, bytes, ref i);
-                        case 2: return new CompletePingCheckPacket(header, bytes, ref i);
-                        case 4: return new AgentUpdatePacket(header, bytes, ref i);
-                        case 5: return new AgentAnimationPacket(header, bytes, ref i);
-                        case 6: return new AgentRequestSitPacket(header, bytes, ref i);
-                        case 7: return new AgentSitPacket(header, bytes, ref i);
-                        case 8: return new RequestImagePacket(header, bytes, ref i);
-                        case 9: return new ImageDataPacket(header, bytes, ref i);
-                        case 10: return new ImagePacketPacket(header, bytes, ref i);
-                        case 11: return new LayerDataPacket(header, bytes, ref i);
-                        case 12: return new ObjectUpdatePacket(header, bytes, ref i);
-                        case 13: return new ObjectUpdateCompressedPacket(header, bytes, ref i);
-                        case 14: return new ObjectUpdateCachedPacket(header, bytes, ref i);
-                        case 15: return new ImprovedTerseObjectUpdatePacket(header, bytes, ref i);
-                        case 16: return new KillObjectPacket(header, bytes, ref i);
-                        case 17: return new TransferPacketPacket(header, bytes, ref i);
-                        case 18: return new SendXferPacketPacket(header, bytes, ref i);
-                        case 19: return new ConfirmXferPacketPacket(header, bytes, ref i);
-                        case 20: return new AvatarAnimationPacket(header, bytes, ref i);
-                        case 21: return new AvatarSitResponsePacket(header, bytes, ref i);
-                        case 22: return new CameraConstraintPacket(header, bytes, ref i);
-                        case 23: return new ParcelPropertiesPacket(header, bytes, ref i);
-                        case 25: return new ChildAgentUpdatePacket(header, bytes, ref i);
-                        case 26: return new ChildAgentAlivePacket(header, bytes, ref i);
-                        case 27: return new ChildAgentPositionUpdatePacket(header, bytes, ref i);
-                        case 29: return new SoundTriggerPacket(header, bytes, ref i);
-                }
-            }
-
-            throw new MalformedDataException("Unknown packet ID "+freq+" "+id);
-        }
-    }
-
-    /// <exclude/>
-    public class TestMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class TestBlock1Block
-        {
-            public uint Test1;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public TestBlock1Block() { }
-            public TestBlock1Block(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Test1 = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Test1 % 256);
-                bytes[i++] = (byte)((Test1 >> 8) % 256);
-                bytes[i++] = (byte)((Test1 >> 16) % 256);
-                bytes[i++] = (byte)((Test1 >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TestBlock1 --");
-                output.Append(String.Format("Test1: {0}", Test1));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class NeighborBlockBlock
-        {
-            public uint Test0;
-            public uint Test1;
-            public uint Test2;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public NeighborBlockBlock() { }
-            public NeighborBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Test0 = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Test1 = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Test2 = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Test0 % 256);
-                bytes[i++] = (byte)((Test0 >> 8) % 256);
-                bytes[i++] = (byte)((Test0 >> 16) % 256);
-                bytes[i++] = (byte)((Test0 >> 24) % 256);
-                bytes[i++] = (byte)(Test1 % 256);
-                bytes[i++] = (byte)((Test1 >> 8) % 256);
-                bytes[i++] = (byte)((Test1 >> 16) % 256);
-                bytes[i++] = (byte)((Test1 >> 24) % 256);
-                bytes[i++] = (byte)(Test2 % 256);
-                bytes[i++] = (byte)((Test2 >> 8) % 256);
-                bytes[i++] = (byte)((Test2 >> 16) % 256);
-                bytes[i++] = (byte)((Test2 >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- NeighborBlock --");
-                output.AppendLine(String.Format("Test0: {0}", Test0));
-                output.AppendLine(String.Format("Test1: {0}", Test1));
-                output.Append(String.Format("Test2: {0}", Test2));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TestMessage; } }
-        public TestBlock1Block TestBlock1;
-        public NeighborBlockBlock[] NeighborBlock;
-
-        public TestMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 1;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            TestBlock1 = new TestBlock1Block();
-            NeighborBlock = new NeighborBlockBlock[4];
-        }
-
-        public TestMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TestBlock1.FromBytes(bytes, ref i);
-            if(NeighborBlock.Length < 4) {
-                NeighborBlock = new NeighborBlockBlock[4];
-                for(int j = 0; j < 4; j++) NeighborBlock[j] = new NeighborBlockBlock();
-            }
-            for (int j = 0; j < 4; j++)
-            { NeighborBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public TestMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TestBlock1.FromBytes(bytes, ref i);
-            if(NeighborBlock.Length < 4) {
-                NeighborBlock = new NeighborBlockBlock[4];
-                for(int j = 0; j < 4; j++) NeighborBlock[j] = new NeighborBlockBlock();
-            }
-            for (int j = 0; j < 4; j++)
-            { NeighborBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TestBlock1.Length;;
-            for (int j = 0; j < 4; j++) { length += NeighborBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TestBlock1.ToBytes(bytes, ref i);
-            for (int j = 0; j < 4; j++) { NeighborBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TestMessage ---" + Environment.NewLine;
-                output += TestBlock1.ToString() + Environment.NewLine;
-            for (int j = 0; j < 4; j++)
-            {
-                output += NeighborBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UseCircuitCodePacket : Packet
-    {
-        /// <exclude/>
-        public class CircuitCodeBlock
-        {
-            public uint Code;
-            public LLUUID SessionID;
-            public LLUUID ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public CircuitCodeBlock() { }
-            public CircuitCodeBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Code = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    ID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Code % 256);
-                bytes[i++] = (byte)((Code >> 8) % 256);
-                bytes[i++] = (byte)((Code >> 16) % 256);
-                bytes[i++] = (byte)((Code >> 24) % 256);
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- CircuitCode --");
-                output.AppendLine(String.Format("Code: {0}", Code));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UseCircuitCode; } }
-        public CircuitCodeBlock CircuitCode;
-
-        public UseCircuitCodePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 3;
-            Header.Reliable = true;
-            CircuitCode = new CircuitCodeBlock();
-        }
-
-        public UseCircuitCodePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            CircuitCode.FromBytes(bytes, ref i);
-        }
-
-        public UseCircuitCodePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            CircuitCode.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += CircuitCode.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            CircuitCode.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UseCircuitCode ---" + Environment.NewLine;
-                output += CircuitCode.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TelehubInfoPacket : Packet
-    {
-        /// <exclude/>
-        public class TelehubBlockBlock
-        {
-            public LLUUID ObjectID;
-            private byte[] _objectname;
-            public byte[] ObjectName
-            {
-                get { return _objectname; }
-                set
-                {
-                    if (value == null) { _objectname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _objectname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _objectname, 0, value.Length); }
-                }
-            }
-            public LLVector3 TelehubPos;
-            public LLQuaternion TelehubRot;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 40;
-                    if (ObjectName != null) { length += 1 + ObjectName.Length; }
-                    return length;
-                }
-            }
-
-            public TelehubBlockBlock() { }
-            public TelehubBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _objectname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _objectname, 0, length); i += length;
-                    TelehubPos.FromBytes(bytes, i); i += 12;
-                    TelehubRot.FromBytes(bytes, i, true); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(ObjectName == null) { Console.WriteLine("Warning: ObjectName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ObjectName.Length;
-                Buffer.BlockCopy(ObjectName, 0, bytes, i, ObjectName.Length); i += ObjectName.Length;
-                Buffer.BlockCopy(TelehubPos.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(TelehubRot.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TelehubBlock --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                Helpers.FieldToString(output, ObjectName, "ObjectName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("TelehubPos: {0}", TelehubPos));
-                output.Append(String.Format("TelehubRot: {0}", TelehubRot));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class SpawnPointBlockBlock
-        {
-            public LLVector3 SpawnPointPos;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public SpawnPointBlockBlock() { }
-            public SpawnPointBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SpawnPointPos.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(SpawnPointPos.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SpawnPointBlock --");
-                output.Append(String.Format("SpawnPointPos: {0}", SpawnPointPos));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TelehubInfo; } }
-        public TelehubBlockBlock TelehubBlock;
-        public SpawnPointBlockBlock[] SpawnPointBlock;
-
-        public TelehubInfoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 10;
-            Header.Reliable = true;
-            TelehubBlock = new TelehubBlockBlock();
-            SpawnPointBlock = new SpawnPointBlockBlock[0];
-        }
-
-        public TelehubInfoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TelehubBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(SpawnPointBlock.Length < count) {
-                SpawnPointBlock = new SpawnPointBlockBlock[count];
-                for(int j = 0; j < count; j++) SpawnPointBlock[j] = new SpawnPointBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { SpawnPointBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public TelehubInfoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TelehubBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(SpawnPointBlock.Length < count) {
-                SpawnPointBlock = new SpawnPointBlockBlock[count];
-                for(int j = 0; j < count; j++) SpawnPointBlock[j] = new SpawnPointBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { SpawnPointBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TelehubBlock.Length;;
-            length++;
-            for (int j = 0; j < SpawnPointBlock.Length; j++) { length += SpawnPointBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TelehubBlock.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)SpawnPointBlock.Length;
-            for (int j = 0; j < SpawnPointBlock.Length; j++) { SpawnPointBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TelehubInfo ---" + Environment.NewLine;
-                output += TelehubBlock.ToString() + Environment.NewLine;
-            for (int j = 0; j < SpawnPointBlock.Length; j++)
-            {
-                output += SpawnPointBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EconomyDataRequestPacket : Packet
-    {
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EconomyDataRequest; } }
-
-        public EconomyDataRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 24;
-            Header.Reliable = true;
-        }
-
-        public EconomyDataRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-        }
-
-        public EconomyDataRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EconomyDataRequest ---" + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EconomyDataPacket : Packet
-    {
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public int ObjectCapacity;
-            public int ObjectCount;
-            public int PriceEnergyUnit;
-            public int PriceObjectClaim;
-            public int PricePublicObjectDecay;
-            public int PricePublicObjectDelete;
-            public int PriceParcelClaim;
-            public float PriceParcelClaimFactor;
-            public int PriceUpload;
-            public int PriceRentLight;
-            public int TeleportMinPrice;
-            public float TeleportPriceExponent;
-            public float EnergyEfficiency;
-            public float PriceObjectRent;
-            public float PriceObjectScaleFactor;
-            public int PriceParcelRent;
-            public int PriceGroupCreate;
-
-            public int Length
-            {
-                get
-                {
-                    return 68;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectCapacity = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ObjectCount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PriceEnergyUnit = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PriceObjectClaim = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PricePublicObjectDecay = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PricePublicObjectDelete = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PriceParcelClaim = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    PriceParcelClaimFactor = BitConverter.ToSingle(bytes, i); i += 4;
-                    PriceUpload = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PriceRentLight = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TeleportMinPrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TeleportPriceExponent = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    EnergyEfficiency = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    PriceObjectRent = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    PriceObjectScaleFactor = BitConverter.ToSingle(bytes, i); i += 4;
-                    PriceParcelRent = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PriceGroupCreate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(ObjectCapacity % 256);
-                bytes[i++] = (byte)((ObjectCapacity >> 8) % 256);
-                bytes[i++] = (byte)((ObjectCapacity >> 16) % 256);
-                bytes[i++] = (byte)((ObjectCapacity >> 24) % 256);
-                bytes[i++] = (byte)(ObjectCount % 256);
-                bytes[i++] = (byte)((ObjectCount >> 8) % 256);
-                bytes[i++] = (byte)((ObjectCount >> 16) % 256);
-                bytes[i++] = (byte)((ObjectCount >> 24) % 256);
-                bytes[i++] = (byte)(PriceEnergyUnit % 256);
-                bytes[i++] = (byte)((PriceEnergyUnit >> 8) % 256);
-                bytes[i++] = (byte)((PriceEnergyUnit >> 16) % 256);
-                bytes[i++] = (byte)((PriceEnergyUnit >> 24) % 256);
-                bytes[i++] = (byte)(PriceObjectClaim % 256);
-                bytes[i++] = (byte)((PriceObjectClaim >> 8) % 256);
-                bytes[i++] = (byte)((PriceObjectClaim >> 16) % 256);
-                bytes[i++] = (byte)((PriceObjectClaim >> 24) % 256);
-                bytes[i++] = (byte)(PricePublicObjectDecay % 256);
-                bytes[i++] = (byte)((PricePublicObjectDecay >> 8) % 256);
-                bytes[i++] = (byte)((PricePublicObjectDecay >> 16) % 256);
-                bytes[i++] = (byte)((PricePublicObjectDecay >> 24) % 256);
-                bytes[i++] = (byte)(PricePublicObjectDelete % 256);
-                bytes[i++] = (byte)((PricePublicObjectDelete >> 8) % 256);
-                bytes[i++] = (byte)((PricePublicObjectDelete >> 16) % 256);
-                bytes[i++] = (byte)((PricePublicObjectDelete >> 24) % 256);
-                bytes[i++] = (byte)(PriceParcelClaim % 256);
-                bytes[i++] = (byte)((PriceParcelClaim >> 8) % 256);
-                bytes[i++] = (byte)((PriceParcelClaim >> 16) % 256);
-                bytes[i++] = (byte)((PriceParcelClaim >> 24) % 256);
-                ba = BitConverter.GetBytes(PriceParcelClaimFactor);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(PriceUpload % 256);
-                bytes[i++] = (byte)((PriceUpload >> 8) % 256);
-                bytes[i++] = (byte)((PriceUpload >> 16) % 256);
-                bytes[i++] = (byte)((PriceUpload >> 24) % 256);
-                bytes[i++] = (byte)(PriceRentLight % 256);
-                bytes[i++] = (byte)((PriceRentLight >> 8) % 256);
-                bytes[i++] = (byte)((PriceRentLight >> 16) % 256);
-                bytes[i++] = (byte)((PriceRentLight >> 24) % 256);
-                bytes[i++] = (byte)(TeleportMinPrice % 256);
-                bytes[i++] = (byte)((TeleportMinPrice >> 8) % 256);
-                bytes[i++] = (byte)((TeleportMinPrice >> 16) % 256);
-                bytes[i++] = (byte)((TeleportMinPrice >> 24) % 256);
-                ba = BitConverter.GetBytes(TeleportPriceExponent);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(EnergyEfficiency);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(PriceObjectRent);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(PriceObjectScaleFactor);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(PriceParcelRent % 256);
-                bytes[i++] = (byte)((PriceParcelRent >> 8) % 256);
-                bytes[i++] = (byte)((PriceParcelRent >> 16) % 256);
-                bytes[i++] = (byte)((PriceParcelRent >> 24) % 256);
-                bytes[i++] = (byte)(PriceGroupCreate % 256);
-                bytes[i++] = (byte)((PriceGroupCreate >> 8) % 256);
-                bytes[i++] = (byte)((PriceGroupCreate >> 16) % 256);
-                bytes[i++] = (byte)((PriceGroupCreate >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("ObjectCapacity: {0}", ObjectCapacity));
-                output.AppendLine(String.Format("ObjectCount: {0}", ObjectCount));
-                output.AppendLine(String.Format("PriceEnergyUnit: {0}", PriceEnergyUnit));
-                output.AppendLine(String.Format("PriceObjectClaim: {0}", PriceObjectClaim));
-                output.AppendLine(String.Format("PricePublicObjectDecay: {0}", PricePublicObjectDecay));
-                output.AppendLine(String.Format("PricePublicObjectDelete: {0}", PricePublicObjectDelete));
-                output.AppendLine(String.Format("PriceParcelClaim: {0}", PriceParcelClaim));
-                output.AppendLine(String.Format("PriceParcelClaimFactor: {0}", PriceParcelClaimFactor));
-                output.AppendLine(String.Format("PriceUpload: {0}", PriceUpload));
-                output.AppendLine(String.Format("PriceRentLight: {0}", PriceRentLight));
-                output.AppendLine(String.Format("TeleportMinPrice: {0}", TeleportMinPrice));
-                output.AppendLine(String.Format("TeleportPriceExponent: {0}", TeleportPriceExponent));
-                output.AppendLine(String.Format("EnergyEfficiency: {0}", EnergyEfficiency));
-                output.AppendLine(String.Format("PriceObjectRent: {0}", PriceObjectRent));
-                output.AppendLine(String.Format("PriceObjectScaleFactor: {0}", PriceObjectScaleFactor));
-                output.AppendLine(String.Format("PriceParcelRent: {0}", PriceParcelRent));
-                output.Append(String.Format("PriceGroupCreate: {0}", PriceGroupCreate));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EconomyData; } }
-        public InfoBlock Info;
-
-        public EconomyDataPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 25;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Info = new InfoBlock();
-        }
-
-        public EconomyDataPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public EconomyDataPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EconomyData ---" + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarPickerRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarPickerRequest; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public AvatarPickerRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 26;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public AvatarPickerRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public AvatarPickerRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarPickerRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarPickerReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID AvatarID;
-            private byte[] _firstname;
-            public byte[] FirstName
-            {
-                get { return _firstname; }
-                set
-                {
-                    if (value == null) { _firstname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _firstname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _firstname, 0, value.Length); }
-                }
-            }
-            private byte[] _lastname;
-            public byte[] LastName
-            {
-                get { return _lastname; }
-                set
-                {
-                    if (value == null) { _lastname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _lastname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _lastname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (FirstName != null) { length += 1 + FirstName.Length; }
-                    if (LastName != null) { length += 1 + LastName.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AvatarID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _firstname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _firstname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _lastname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _lastname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AvatarID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(FirstName == null) { Console.WriteLine("Warning: FirstName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FirstName.Length;
-                Buffer.BlockCopy(FirstName, 0, bytes, i, FirstName.Length); i += FirstName.Length;
-                if(LastName == null) { Console.WriteLine("Warning: LastName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)LastName.Length;
-                Buffer.BlockCopy(LastName, 0, bytes, i, LastName.Length); i += LastName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("AvatarID: {0}", AvatarID));
-                Helpers.FieldToString(output, FirstName, "FirstName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, LastName, "LastName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarPickerReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock[] Data;
-
-        public AvatarPickerReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 28;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock[0];
-        }
-
-        public AvatarPickerReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public AvatarPickerReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarPickerReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PlacesQueryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionDataBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TransactionDataBlock() { }
-            public TransactionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionData --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            private byte[] _querytext;
-            public byte[] QueryText
-            {
-                get { return _querytext; }
-                set
-                {
-                    if (value == null) { _querytext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _querytext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _querytext, 0, value.Length); }
-                }
-            }
-            public uint QueryFlags;
-            public sbyte Category;
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 5;
-                    if (QueryText != null) { length += 1 + QueryText.Length; }
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _querytext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _querytext, 0, length); i += length;
-                    QueryFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Category = (sbyte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(QueryText == null) { Console.WriteLine("Warning: QueryText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)QueryText.Length;
-                Buffer.BlockCopy(QueryText, 0, bytes, i, QueryText.Length); i += QueryText.Length;
-                bytes[i++] = (byte)(QueryFlags % 256);
-                bytes[i++] = (byte)((QueryFlags >> 8) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 16) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 24) % 256);
-                bytes[i++] = (byte)Category;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                Helpers.FieldToString(output, QueryText, "QueryText");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("QueryFlags: {0}", QueryFlags));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                Helpers.FieldToString(output, SimName, "SimName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PlacesQuery; } }
-        public AgentDataBlock AgentData;
-        public TransactionDataBlock TransactionData;
-        public QueryDataBlock QueryData;
-
-        public PlacesQueryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 29;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            TransactionData = new TransactionDataBlock();
-            QueryData = new QueryDataBlock();
-        }
-
-        public PlacesQueryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public PlacesQueryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TransactionData.Length;            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TransactionData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PlacesQuery ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TransactionData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PlacesReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionDataBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TransactionDataBlock() { }
-            public TransactionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionData --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID OwnerID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            public int ActualArea;
-            public int BillableArea;
-            public byte Flags;
-            public float GlobalX;
-            public float GlobalY;
-            public float GlobalZ;
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public LLUUID SnapshotID;
-            public float Dwell;
-            public int Price;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 61;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Desc != null) { length += 1 + Desc.Length; }
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    ActualArea = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    BillableArea = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Flags = (byte)bytes[i++];
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    GlobalX = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    GlobalY = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    GlobalZ = BitConverter.ToSingle(bytes, i); i += 4;
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Dwell = BitConverter.ToSingle(bytes, i); i += 4;
-                    Price = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Desc.Length;
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                bytes[i++] = (byte)(ActualArea % 256);
-                bytes[i++] = (byte)((ActualArea >> 8) % 256);
-                bytes[i++] = (byte)((ActualArea >> 16) % 256);
-                bytes[i++] = (byte)((ActualArea >> 24) % 256);
-                bytes[i++] = (byte)(BillableArea % 256);
-                bytes[i++] = (byte)((BillableArea >> 8) % 256);
-                bytes[i++] = (byte)((BillableArea >> 16) % 256);
-                bytes[i++] = (byte)((BillableArea >> 24) % 256);
-                bytes[i++] = Flags;
-                ba = BitConverter.GetBytes(GlobalX);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(GlobalY);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(GlobalZ);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                ba = BitConverter.GetBytes(Dwell);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(Price % 256);
-                bytes[i++] = (byte)((Price >> 8) % 256);
-                bytes[i++] = (byte)((Price >> 16) % 256);
-                bytes[i++] = (byte)((Price >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ActualArea: {0}", ActualArea));
-                output.AppendLine(String.Format("BillableArea: {0}", BillableArea));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("GlobalX: {0}", GlobalX));
-                output.AppendLine(String.Format("GlobalY: {0}", GlobalY));
-                output.AppendLine(String.Format("GlobalZ: {0}", GlobalZ));
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SnapshotID: {0}", SnapshotID));
-                output.AppendLine(String.Format("Dwell: {0}", Dwell));
-                output.Append(String.Format("Price: {0}", Price));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PlacesReply; } }
-        public AgentDataBlock AgentData;
-        public TransactionDataBlock TransactionData;
-        public QueryDataBlock[] QueryData;
-
-        public PlacesReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 30;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            TransactionData = new TransactionDataBlock();
-            QueryData = new QueryDataBlock[0];
-        }
-
-        public PlacesReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryData.Length < count) {
-                QueryData = new QueryDataBlock[count];
-                for(int j = 0; j < count; j++) QueryData[j] = new QueryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public PlacesReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryData.Length < count) {
-                QueryData = new QueryDataBlock[count];
-                for(int j = 0; j < count; j++) QueryData[j] = new QueryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TransactionData.Length;;
-            length++;
-            for (int j = 0; j < QueryData.Length; j++) { length += QueryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TransactionData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)QueryData.Length;
-            for (int j = 0; j < QueryData.Length; j++) { QueryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PlacesReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TransactionData.ToString() + Environment.NewLine;
-            for (int j = 0; j < QueryData.Length; j++)
-            {
-                output += QueryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirFindQueryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-            private byte[] _querytext;
-            public byte[] QueryText
-            {
-                get { return _querytext; }
-                set
-                {
-                    if (value == null) { _querytext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _querytext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _querytext, 0, value.Length); }
-                }
-            }
-            public uint QueryFlags;
-            public int QueryStart;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (QueryText != null) { length += 1 + QueryText.Length; }
-                    return length;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _querytext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _querytext, 0, length); i += length;
-                    QueryFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    QueryStart = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(QueryText == null) { Console.WriteLine("Warning: QueryText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)QueryText.Length;
-                Buffer.BlockCopy(QueryText, 0, bytes, i, QueryText.Length); i += QueryText.Length;
-                bytes[i++] = (byte)(QueryFlags % 256);
-                bytes[i++] = (byte)((QueryFlags >> 8) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 16) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 24) % 256);
-                bytes[i++] = (byte)(QueryStart % 256);
-                bytes[i++] = (byte)((QueryStart >> 8) % 256);
-                bytes[i++] = (byte)((QueryStart >> 16) % 256);
-                bytes[i++] = (byte)((QueryStart >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("QueryID: {0}", QueryID));
-                Helpers.FieldToString(output, QueryText, "QueryText");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("QueryFlags: {0}", QueryFlags));
-                output.Append(String.Format("QueryStart: {0}", QueryStart));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirFindQuery; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-
-        public DirFindQueryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 31;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-        }
-
-        public DirFindQueryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public DirFindQueryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirFindQuery ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirPlacesQueryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-            private byte[] _querytext;
-            public byte[] QueryText
-            {
-                get { return _querytext; }
-                set
-                {
-                    if (value == null) { _querytext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _querytext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _querytext, 0, value.Length); }
-                }
-            }
-            public uint QueryFlags;
-            public sbyte Category;
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public int QueryStart;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 25;
-                    if (QueryText != null) { length += 1 + QueryText.Length; }
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _querytext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _querytext, 0, length); i += length;
-                    QueryFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Category = (sbyte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    QueryStart = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(QueryText == null) { Console.WriteLine("Warning: QueryText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)QueryText.Length;
-                Buffer.BlockCopy(QueryText, 0, bytes, i, QueryText.Length); i += QueryText.Length;
-                bytes[i++] = (byte)(QueryFlags % 256);
-                bytes[i++] = (byte)((QueryFlags >> 8) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 16) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 24) % 256);
-                bytes[i++] = (byte)Category;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                bytes[i++] = (byte)(QueryStart % 256);
-                bytes[i++] = (byte)((QueryStart >> 8) % 256);
-                bytes[i++] = (byte)((QueryStart >> 16) % 256);
-                bytes[i++] = (byte)((QueryStart >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("QueryID: {0}", QueryID));
-                Helpers.FieldToString(output, QueryText, "QueryText");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("QueryFlags: {0}", QueryFlags));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("QueryStart: {0}", QueryStart));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirPlacesQuery; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-
-        public DirPlacesQueryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 33;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-        }
-
-        public DirPlacesQueryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public DirPlacesQueryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirPlacesQuery ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirPlacesReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryRepliesBlock
-        {
-            public LLUUID ParcelID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            public bool ForSale;
-            public bool Auction;
-            public float Dwell;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 22;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public QueryRepliesBlock() { }
-            public QueryRepliesBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    ForSale = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    Auction = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Dwell = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                bytes[i++] = (byte)((ForSale) ? 1 : 0);
-                bytes[i++] = (byte)((Auction) ? 1 : 0);
-                ba = BitConverter.GetBytes(Dwell);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryReplies --");
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ForSale: {0}", ForSale));
-                output.AppendLine(String.Format("Auction: {0}", Auction));
-                output.Append(String.Format("Dwell: {0}", Dwell));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirPlacesReply; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock[] QueryData;
-        public QueryRepliesBlock[] QueryReplies;
-
-        public DirPlacesReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 35;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock[0];
-            QueryReplies = new QueryRepliesBlock[0];
-        }
-
-        public DirPlacesReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryData.Length < count) {
-                QueryData = new QueryDataBlock[count];
-                for(int j = 0; j < count; j++) QueryData[j] = new QueryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public DirPlacesReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryData.Length < count) {
-                QueryData = new QueryDataBlock[count];
-                for(int j = 0; j < count; j++) QueryData[j] = new QueryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < QueryData.Length; j++) { length += QueryData[j].Length; }
-            length++;
-            for (int j = 0; j < QueryReplies.Length; j++) { length += QueryReplies[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)QueryData.Length;
-            for (int j = 0; j < QueryData.Length; j++) { QueryData[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)QueryReplies.Length;
-            for (int j = 0; j < QueryReplies.Length; j++) { QueryReplies[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirPlacesReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < QueryData.Length; j++)
-            {
-                output += QueryData[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < QueryReplies.Length; j++)
-            {
-                output += QueryReplies[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirPeopleReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryRepliesBlock
-        {
-            public LLUUID AgentID;
-            private byte[] _firstname;
-            public byte[] FirstName
-            {
-                get { return _firstname; }
-                set
-                {
-                    if (value == null) { _firstname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _firstname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _firstname, 0, value.Length); }
-                }
-            }
-            private byte[] _lastname;
-            public byte[] LastName
-            {
-                get { return _lastname; }
-                set
-                {
-                    if (value == null) { _lastname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _lastname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _lastname, 0, value.Length); }
-                }
-            }
-            private byte[] _group;
-            public byte[] Group
-            {
-                get { return _group; }
-                set
-                {
-                    if (value == null) { _group = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _group = new byte[value.Length]; Buffer.BlockCopy(value, 0, _group, 0, value.Length); }
-                }
-            }
-            public bool Online;
-            public int Reputation;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 21;
-                    if (FirstName != null) { length += 1 + FirstName.Length; }
-                    if (LastName != null) { length += 1 + LastName.Length; }
-                    if (Group != null) { length += 1 + Group.Length; }
-                    return length;
-                }
-            }
-
-            public QueryRepliesBlock() { }
-            public QueryRepliesBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _firstname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _firstname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _lastname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _lastname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _group = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _group, 0, length); i += length;
-                    Online = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    Reputation = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(FirstName == null) { Console.WriteLine("Warning: FirstName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FirstName.Length;
-                Buffer.BlockCopy(FirstName, 0, bytes, i, FirstName.Length); i += FirstName.Length;
-                if(LastName == null) { Console.WriteLine("Warning: LastName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)LastName.Length;
-                Buffer.BlockCopy(LastName, 0, bytes, i, LastName.Length); i += LastName.Length;
-                if(Group == null) { Console.WriteLine("Warning: Group is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Group.Length;
-                Buffer.BlockCopy(Group, 0, bytes, i, Group.Length); i += Group.Length;
-                bytes[i++] = (byte)((Online) ? 1 : 0);
-                bytes[i++] = (byte)(Reputation % 256);
-                bytes[i++] = (byte)((Reputation >> 8) % 256);
-                bytes[i++] = (byte)((Reputation >> 16) % 256);
-                bytes[i++] = (byte)((Reputation >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryReplies --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                Helpers.FieldToString(output, FirstName, "FirstName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, LastName, "LastName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Group, "Group");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Online: {0}", Online));
-                output.Append(String.Format("Reputation: {0}", Reputation));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirPeopleReply; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-        public QueryRepliesBlock[] QueryReplies;
-
-        public DirPeopleReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 36;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-            QueryReplies = new QueryRepliesBlock[0];
-        }
-
-        public DirPeopleReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public DirPeopleReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            length++;
-            for (int j = 0; j < QueryReplies.Length; j++) { length += QueryReplies[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)QueryReplies.Length;
-            for (int j = 0; j < QueryReplies.Length; j++) { QueryReplies[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirPeopleReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            for (int j = 0; j < QueryReplies.Length; j++)
-            {
-                output += QueryReplies[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirEventsReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryRepliesBlock
-        {
-            public LLUUID OwnerID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            public uint EventID;
-            private byte[] _date;
-            public byte[] Date
-            {
-                get { return _date; }
-                set
-                {
-                    if (value == null) { _date = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _date = new byte[value.Length]; Buffer.BlockCopy(value, 0, _date, 0, value.Length); }
-                }
-            }
-            public uint UnixTime;
-            public uint EventFlags;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 28;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Date != null) { length += 1 + Date.Length; }
-                    return length;
-                }
-            }
-
-            public QueryRepliesBlock() { }
-            public QueryRepliesBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    EventID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _date = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _date, 0, length); i += length;
-                    UnixTime = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EventFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                bytes[i++] = (byte)(EventID % 256);
-                bytes[i++] = (byte)((EventID >> 8) % 256);
-                bytes[i++] = (byte)((EventID >> 16) % 256);
-                bytes[i++] = (byte)((EventID >> 24) % 256);
-                if(Date == null) { Console.WriteLine("Warning: Date is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Date.Length;
-                Buffer.BlockCopy(Date, 0, bytes, i, Date.Length); i += Date.Length;
-                bytes[i++] = (byte)(UnixTime % 256);
-                bytes[i++] = (byte)((UnixTime >> 8) % 256);
-                bytes[i++] = (byte)((UnixTime >> 16) % 256);
-                bytes[i++] = (byte)((UnixTime >> 24) % 256);
-                bytes[i++] = (byte)(EventFlags % 256);
-                bytes[i++] = (byte)((EventFlags >> 8) % 256);
-                bytes[i++] = (byte)((EventFlags >> 16) % 256);
-                bytes[i++] = (byte)((EventFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryReplies --");
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("EventID: {0}", EventID));
-                Helpers.FieldToString(output, Date, "Date");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("UnixTime: {0}", UnixTime));
-                output.Append(String.Format("EventFlags: {0}", EventFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirEventsReply; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-        public QueryRepliesBlock[] QueryReplies;
-
-        public DirEventsReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 37;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-            QueryReplies = new QueryRepliesBlock[0];
-        }
-
-        public DirEventsReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public DirEventsReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            length++;
-            for (int j = 0; j < QueryReplies.Length; j++) { length += QueryReplies[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)QueryReplies.Length;
-            for (int j = 0; j < QueryReplies.Length; j++) { QueryReplies[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirEventsReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            for (int j = 0; j < QueryReplies.Length; j++)
-            {
-                output += QueryReplies[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirGroupsReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryRepliesBlock
-        {
-            public LLUUID GroupID;
-            private byte[] _groupname;
-            public byte[] GroupName
-            {
-                get { return _groupname; }
-                set
-                {
-                    if (value == null) { _groupname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _groupname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _groupname, 0, value.Length); }
-                }
-            }
-            public int Members;
-            public float SearchOrder;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (GroupName != null) { length += 1 + GroupName.Length; }
-                    return length;
-                }
-            }
-
-            public QueryRepliesBlock() { }
-            public QueryRepliesBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _groupname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _groupname, 0, length); i += length;
-                    Members = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    SearchOrder = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(GroupName == null) { Console.WriteLine("Warning: GroupName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)GroupName.Length;
-                Buffer.BlockCopy(GroupName, 0, bytes, i, GroupName.Length); i += GroupName.Length;
-                bytes[i++] = (byte)(Members % 256);
-                bytes[i++] = (byte)((Members >> 8) % 256);
-                bytes[i++] = (byte)((Members >> 16) % 256);
-                bytes[i++] = (byte)((Members >> 24) % 256);
-                ba = BitConverter.GetBytes(SearchOrder);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryReplies --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                Helpers.FieldToString(output, GroupName, "GroupName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Members: {0}", Members));
-                output.Append(String.Format("SearchOrder: {0}", SearchOrder));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirGroupsReply; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-        public QueryRepliesBlock[] QueryReplies;
-
-        public DirGroupsReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 38;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-            QueryReplies = new QueryRepliesBlock[0];
-        }
-
-        public DirGroupsReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public DirGroupsReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            length++;
-            for (int j = 0; j < QueryReplies.Length; j++) { length += QueryReplies[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)QueryReplies.Length;
-            for (int j = 0; j < QueryReplies.Length; j++) { QueryReplies[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirGroupsReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            for (int j = 0; j < QueryReplies.Length; j++)
-            {
-                output += QueryReplies[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirClassifiedQueryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-            private byte[] _querytext;
-            public byte[] QueryText
-            {
-                get { return _querytext; }
-                set
-                {
-                    if (value == null) { _querytext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _querytext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _querytext, 0, value.Length); }
-                }
-            }
-            public uint QueryFlags;
-            public uint Category;
-            public int QueryStart;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 28;
-                    if (QueryText != null) { length += 1 + QueryText.Length; }
-                    return length;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _querytext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _querytext, 0, length); i += length;
-                    QueryFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Category = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    QueryStart = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(QueryText == null) { Console.WriteLine("Warning: QueryText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)QueryText.Length;
-                Buffer.BlockCopy(QueryText, 0, bytes, i, QueryText.Length); i += QueryText.Length;
-                bytes[i++] = (byte)(QueryFlags % 256);
-                bytes[i++] = (byte)((QueryFlags >> 8) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 16) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 24) % 256);
-                bytes[i++] = (byte)(Category % 256);
-                bytes[i++] = (byte)((Category >> 8) % 256);
-                bytes[i++] = (byte)((Category >> 16) % 256);
-                bytes[i++] = (byte)((Category >> 24) % 256);
-                bytes[i++] = (byte)(QueryStart % 256);
-                bytes[i++] = (byte)((QueryStart >> 8) % 256);
-                bytes[i++] = (byte)((QueryStart >> 16) % 256);
-                bytes[i++] = (byte)((QueryStart >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("QueryID: {0}", QueryID));
-                Helpers.FieldToString(output, QueryText, "QueryText");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("QueryFlags: {0}", QueryFlags));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                output.Append(String.Format("QueryStart: {0}", QueryStart));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirClassifiedQuery; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-
-        public DirClassifiedQueryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 39;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-        }
-
-        public DirClassifiedQueryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public DirClassifiedQueryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirClassifiedQuery ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirClassifiedReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryRepliesBlock
-        {
-            public LLUUID ClassifiedID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            public byte ClassifiedFlags;
-            public uint CreationDate;
-            public uint ExpirationDate;
-            public int PriceForListing;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 29;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public QueryRepliesBlock() { }
-            public QueryRepliesBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ClassifiedID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    ClassifiedFlags = (byte)bytes[i++];
-                    CreationDate = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ExpirationDate = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PriceForListing = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ClassifiedID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                bytes[i++] = ClassifiedFlags;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(ExpirationDate % 256);
-                bytes[i++] = (byte)((ExpirationDate >> 8) % 256);
-                bytes[i++] = (byte)((ExpirationDate >> 16) % 256);
-                bytes[i++] = (byte)((ExpirationDate >> 24) % 256);
-                bytes[i++] = (byte)(PriceForListing % 256);
-                bytes[i++] = (byte)((PriceForListing >> 8) % 256);
-                bytes[i++] = (byte)((PriceForListing >> 16) % 256);
-                bytes[i++] = (byte)((PriceForListing >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryReplies --");
-                output.AppendLine(String.Format("ClassifiedID: {0}", ClassifiedID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ClassifiedFlags: {0}", ClassifiedFlags));
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.AppendLine(String.Format("ExpirationDate: {0}", ExpirationDate));
-                output.Append(String.Format("PriceForListing: {0}", PriceForListing));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirClassifiedReply; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-        public QueryRepliesBlock[] QueryReplies;
-
-        public DirClassifiedReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 41;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-            QueryReplies = new QueryRepliesBlock[0];
-        }
-
-        public DirClassifiedReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public DirClassifiedReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            length++;
-            for (int j = 0; j < QueryReplies.Length; j++) { length += QueryReplies[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)QueryReplies.Length;
-            for (int j = 0; j < QueryReplies.Length; j++) { QueryReplies[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirClassifiedReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            for (int j = 0; j < QueryReplies.Length; j++)
-            {
-                output += QueryReplies[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarClassifiedReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID TargetID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    TargetID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("TargetID: {0}", TargetID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ClassifiedID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ClassifiedID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ClassifiedID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ClassifiedID: {0}", ClassifiedID));
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarClassifiedReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock[] Data;
-
-        public AvatarClassifiedReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 42;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock[0];
-        }
-
-        public AvatarClassifiedReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public AvatarClassifiedReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarClassifiedReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ClassifiedInfoRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ClassifiedID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ClassifiedID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ClassifiedID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("ClassifiedID: {0}", ClassifiedID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ClassifiedInfoRequest; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ClassifiedInfoRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 43;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ClassifiedInfoRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ClassifiedInfoRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ClassifiedInfoRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ClassifiedInfoReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ClassifiedID;
-            public LLUUID CreatorID;
-            public uint CreationDate;
-            public uint ExpirationDate;
-            public uint Category;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            public LLUUID ParcelID;
-            public uint ParentEstate;
-            public LLUUID SnapshotID;
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public LLVector3d PosGlobal;
-            private byte[] _parcelname;
-            public byte[] ParcelName
-            {
-                get { return _parcelname; }
-                set
-                {
-                    if (value == null) { _parcelname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _parcelname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _parcelname, 0, value.Length); }
-                }
-            }
-            public byte ClassifiedFlags;
-            public int PriceForListing;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 109;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Desc != null) { length += 2 + Desc.Length; }
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    if (ParcelName != null) { length += 1 + ParcelName.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ClassifiedID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    CreationDate = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ExpirationDate = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Category = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    ParentEstate = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    PosGlobal.FromBytes(bytes, i); i += 24;
-                    length = (ushort)bytes[i++];
-                    _parcelname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _parcelname, 0, length); i += length;
-                    ClassifiedFlags = (byte)bytes[i++];
-                    PriceForListing = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ClassifiedID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(ExpirationDate % 256);
-                bytes[i++] = (byte)((ExpirationDate >> 8) % 256);
-                bytes[i++] = (byte)((ExpirationDate >> 16) % 256);
-                bytes[i++] = (byte)((ExpirationDate >> 24) % 256);
-                bytes[i++] = (byte)(Category % 256);
-                bytes[i++] = (byte)((Category >> 8) % 256);
-                bytes[i++] = (byte)((Category >> 16) % 256);
-                bytes[i++] = (byte)((Category >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Desc.Length % 256);
-                bytes[i++] = (byte)((Desc.Length >> 8) % 256);
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ParentEstate % 256);
-                bytes[i++] = (byte)((ParentEstate >> 8) % 256);
-                bytes[i++] = (byte)((ParentEstate >> 16) % 256);
-                bytes[i++] = (byte)((ParentEstate >> 24) % 256);
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                Buffer.BlockCopy(PosGlobal.GetBytes(), 0, bytes, i, 24); i += 24;
-                if(ParcelName == null) { Console.WriteLine("Warning: ParcelName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ParcelName.Length;
-                Buffer.BlockCopy(ParcelName, 0, bytes, i, ParcelName.Length); i += ParcelName.Length;
-                bytes[i++] = ClassifiedFlags;
-                bytes[i++] = (byte)(PriceForListing % 256);
-                bytes[i++] = (byte)((PriceForListing >> 8) % 256);
-                bytes[i++] = (byte)((PriceForListing >> 16) % 256);
-                bytes[i++] = (byte)((PriceForListing >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ClassifiedID: {0}", ClassifiedID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.AppendLine(String.Format("ExpirationDate: {0}", ExpirationDate));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                output.AppendLine(String.Format("ParentEstate: {0}", ParentEstate));
-                output.AppendLine(String.Format("SnapshotID: {0}", SnapshotID));
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("PosGlobal: {0}", PosGlobal));
-                Helpers.FieldToString(output, ParcelName, "ParcelName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ClassifiedFlags: {0}", ClassifiedFlags));
-                output.Append(String.Format("PriceForListing: {0}", PriceForListing));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ClassifiedInfoReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ClassifiedInfoReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 44;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ClassifiedInfoReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ClassifiedInfoReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ClassifiedInfoReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ClassifiedInfoUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ClassifiedID;
-            public uint Category;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            public LLUUID ParcelID;
-            public uint ParentEstate;
-            public LLUUID SnapshotID;
-            public LLVector3d PosGlobal;
-            public byte ClassifiedFlags;
-            public int PriceForListing;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 85;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Desc != null) { length += 2 + Desc.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ClassifiedID.FromBytes(bytes, i); i += 16;
-                    Category = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    ParentEstate = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                    PosGlobal.FromBytes(bytes, i); i += 24;
-                    ClassifiedFlags = (byte)bytes[i++];
-                    PriceForListing = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ClassifiedID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Category % 256);
-                bytes[i++] = (byte)((Category >> 8) % 256);
-                bytes[i++] = (byte)((Category >> 16) % 256);
-                bytes[i++] = (byte)((Category >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Desc.Length % 256);
-                bytes[i++] = (byte)((Desc.Length >> 8) % 256);
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ParentEstate % 256);
-                bytes[i++] = (byte)((ParentEstate >> 8) % 256);
-                bytes[i++] = (byte)((ParentEstate >> 16) % 256);
-                bytes[i++] = (byte)((ParentEstate >> 24) % 256);
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(PosGlobal.GetBytes(), 0, bytes, i, 24); i += 24;
-                bytes[i++] = ClassifiedFlags;
-                bytes[i++] = (byte)(PriceForListing % 256);
-                bytes[i++] = (byte)((PriceForListing >> 8) % 256);
-                bytes[i++] = (byte)((PriceForListing >> 16) % 256);
-                bytes[i++] = (byte)((PriceForListing >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ClassifiedID: {0}", ClassifiedID));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                output.AppendLine(String.Format("ParentEstate: {0}", ParentEstate));
-                output.AppendLine(String.Format("SnapshotID: {0}", SnapshotID));
-                output.AppendLine(String.Format("PosGlobal: {0}", PosGlobal));
-                output.AppendLine(String.Format("ClassifiedFlags: {0}", ClassifiedFlags));
-                output.Append(String.Format("PriceForListing: {0}", PriceForListing));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ClassifiedInfoUpdate; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ClassifiedInfoUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 45;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ClassifiedInfoUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ClassifiedInfoUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ClassifiedInfoUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ClassifiedDeletePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ClassifiedID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ClassifiedID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ClassifiedID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("ClassifiedID: {0}", ClassifiedID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ClassifiedDelete; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ClassifiedDeletePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 46;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ClassifiedDeletePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ClassifiedDeletePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ClassifiedDelete ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ClassifiedGodDeletePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ClassifiedID;
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ClassifiedID.FromBytes(bytes, i); i += 16;
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ClassifiedID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ClassifiedID: {0}", ClassifiedID));
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ClassifiedGodDelete; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ClassifiedGodDeletePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 47;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ClassifiedGodDeletePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ClassifiedGodDeletePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ClassifiedGodDelete ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirLandQueryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-            public uint QueryFlags;
-            public uint SearchType;
-            public int Price;
-            public int Area;
-            public int QueryStart;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                    QueryFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SearchType = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Price = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Area = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    QueryStart = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(QueryFlags % 256);
-                bytes[i++] = (byte)((QueryFlags >> 8) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 16) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 24) % 256);
-                bytes[i++] = (byte)(SearchType % 256);
-                bytes[i++] = (byte)((SearchType >> 8) % 256);
-                bytes[i++] = (byte)((SearchType >> 16) % 256);
-                bytes[i++] = (byte)((SearchType >> 24) % 256);
-                bytes[i++] = (byte)(Price % 256);
-                bytes[i++] = (byte)((Price >> 8) % 256);
-                bytes[i++] = (byte)((Price >> 16) % 256);
-                bytes[i++] = (byte)((Price >> 24) % 256);
-                bytes[i++] = (byte)(Area % 256);
-                bytes[i++] = (byte)((Area >> 8) % 256);
-                bytes[i++] = (byte)((Area >> 16) % 256);
-                bytes[i++] = (byte)((Area >> 24) % 256);
-                bytes[i++] = (byte)(QueryStart % 256);
-                bytes[i++] = (byte)((QueryStart >> 8) % 256);
-                bytes[i++] = (byte)((QueryStart >> 16) % 256);
-                bytes[i++] = (byte)((QueryStart >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("QueryID: {0}", QueryID));
-                output.AppendLine(String.Format("QueryFlags: {0}", QueryFlags));
-                output.AppendLine(String.Format("SearchType: {0}", SearchType));
-                output.AppendLine(String.Format("Price: {0}", Price));
-                output.AppendLine(String.Format("Area: {0}", Area));
-                output.Append(String.Format("QueryStart: {0}", QueryStart));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirLandQuery; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-
-        public DirLandQueryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 48;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-        }
-
-        public DirLandQueryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public DirLandQueryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirLandQuery ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirLandReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryRepliesBlock
-        {
-            public LLUUID ParcelID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            public bool Auction;
-            public bool ForSale;
-            public int SalePrice;
-            public int ActualArea;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 26;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public QueryRepliesBlock() { }
-            public QueryRepliesBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    Auction = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    ForSale = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ActualArea = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                bytes[i++] = (byte)((Auction) ? 1 : 0);
-                bytes[i++] = (byte)((ForSale) ? 1 : 0);
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                bytes[i++] = (byte)(ActualArea % 256);
-                bytes[i++] = (byte)((ActualArea >> 8) % 256);
-                bytes[i++] = (byte)((ActualArea >> 16) % 256);
-                bytes[i++] = (byte)((ActualArea >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryReplies --");
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Auction: {0}", Auction));
-                output.AppendLine(String.Format("ForSale: {0}", ForSale));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                output.Append(String.Format("ActualArea: {0}", ActualArea));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirLandReply; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-        public QueryRepliesBlock[] QueryReplies;
-
-        public DirLandReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 50;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-            QueryReplies = new QueryRepliesBlock[0];
-        }
-
-        public DirLandReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public DirLandReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            length++;
-            for (int j = 0; j < QueryReplies.Length; j++) { length += QueryReplies[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)QueryReplies.Length;
-            for (int j = 0; j < QueryReplies.Length; j++) { QueryReplies[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirLandReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            for (int j = 0; j < QueryReplies.Length; j++)
-            {
-                output += QueryReplies[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirPopularQueryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-            public uint QueryFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                    QueryFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(QueryFlags % 256);
-                bytes[i++] = (byte)((QueryFlags >> 8) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 16) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("QueryID: {0}", QueryID));
-                output.Append(String.Format("QueryFlags: {0}", QueryFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirPopularQuery; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-
-        public DirPopularQueryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 51;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-        }
-
-        public DirPopularQueryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public DirPopularQueryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirPopularQuery ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DirPopularReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryRepliesBlock
-        {
-            public LLUUID ParcelID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            public float Dwell;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 20;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public QueryRepliesBlock() { }
-            public QueryRepliesBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Dwell = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                ba = BitConverter.GetBytes(Dwell);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryReplies --");
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("Dwell: {0}", Dwell));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DirPopularReply; } }
-        public AgentDataBlock AgentData;
-        public QueryDataBlock QueryData;
-        public QueryRepliesBlock[] QueryReplies;
-
-        public DirPopularReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 53;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            QueryData = new QueryDataBlock();
-            QueryReplies = new QueryRepliesBlock[0];
-        }
-
-        public DirPopularReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public DirPopularReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(QueryReplies.Length < count) {
-                QueryReplies = new QueryRepliesBlock[count];
-                for(int j = 0; j < count; j++) QueryReplies[j] = new QueryRepliesBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { QueryReplies[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += QueryData.Length;;
-            length++;
-            for (int j = 0; j < QueryReplies.Length; j++) { length += QueryReplies[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)QueryReplies.Length;
-            for (int j = 0; j < QueryReplies.Length; j++) { QueryReplies[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DirPopularReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            for (int j = 0; j < QueryReplies.Length; j++)
-            {
-                output += QueryReplies[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelInfoRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ParcelID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("ParcelID: {0}", ParcelID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelInfoRequest; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelInfoRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 54;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelInfoRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelInfoRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelInfoRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelInfoReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ParcelID;
-            public LLUUID OwnerID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            public int ActualArea;
-            public int BillableArea;
-            public byte Flags;
-            public float GlobalX;
-            public float GlobalY;
-            public float GlobalZ;
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public LLUUID SnapshotID;
-            public float Dwell;
-            public int SalePrice;
-            public int AuctionID;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 81;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Desc != null) { length += 1 + Desc.Length; }
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    ActualArea = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    BillableArea = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Flags = (byte)bytes[i++];
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    GlobalX = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    GlobalY = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    GlobalZ = BitConverter.ToSingle(bytes, i); i += 4;
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Dwell = BitConverter.ToSingle(bytes, i); i += 4;
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    AuctionID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Desc.Length;
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                bytes[i++] = (byte)(ActualArea % 256);
-                bytes[i++] = (byte)((ActualArea >> 8) % 256);
-                bytes[i++] = (byte)((ActualArea >> 16) % 256);
-                bytes[i++] = (byte)((ActualArea >> 24) % 256);
-                bytes[i++] = (byte)(BillableArea % 256);
-                bytes[i++] = (byte)((BillableArea >> 8) % 256);
-                bytes[i++] = (byte)((BillableArea >> 16) % 256);
-                bytes[i++] = (byte)((BillableArea >> 24) % 256);
-                bytes[i++] = Flags;
-                ba = BitConverter.GetBytes(GlobalX);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(GlobalY);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(GlobalZ);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                ba = BitConverter.GetBytes(Dwell);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                bytes[i++] = (byte)(AuctionID % 256);
-                bytes[i++] = (byte)((AuctionID >> 8) % 256);
-                bytes[i++] = (byte)((AuctionID >> 16) % 256);
-                bytes[i++] = (byte)((AuctionID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ActualArea: {0}", ActualArea));
-                output.AppendLine(String.Format("BillableArea: {0}", BillableArea));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("GlobalX: {0}", GlobalX));
-                output.AppendLine(String.Format("GlobalY: {0}", GlobalY));
-                output.AppendLine(String.Format("GlobalZ: {0}", GlobalZ));
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SnapshotID: {0}", SnapshotID));
-                output.AppendLine(String.Format("Dwell: {0}", Dwell));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                output.Append(String.Format("AuctionID: {0}", AuctionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelInfoReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelInfoReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 55;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelInfoReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelInfoReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelInfoReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelObjectOwnersRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelObjectOwnersRequest; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelObjectOwnersRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 56;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelObjectOwnersRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelObjectOwnersRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelObjectOwnersRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelObjectOwnersReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID OwnerID;
-            public bool IsGroupOwned;
-            public int Count;
-            public bool OnlineStatus;
-
-            public int Length
-            {
-                get
-                {
-                    return 22;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    IsGroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    Count = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OnlineStatus = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((IsGroupOwned) ? 1 : 0);
-                bytes[i++] = (byte)(Count % 256);
-                bytes[i++] = (byte)((Count >> 8) % 256);
-                bytes[i++] = (byte)((Count >> 16) % 256);
-                bytes[i++] = (byte)((Count >> 24) % 256);
-                bytes[i++] = (byte)((OnlineStatus) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("IsGroupOwned: {0}", IsGroupOwned));
-                output.AppendLine(String.Format("Count: {0}", Count));
-                output.Append(String.Format("OnlineStatus: {0}", OnlineStatus));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelObjectOwnersReply; } }
-        public DataBlock[] Data;
-
-        public ParcelObjectOwnersReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 57;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Data = new DataBlock[0];
-        }
-
-        public ParcelObjectOwnersReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public ParcelObjectOwnersReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelObjectOwnersReply ---" + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupNoticesListRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupNoticesListRequest; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public GroupNoticesListRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 58;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public GroupNoticesListRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public GroupNoticesListRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupNoticesListRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupNoticesListReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID NoticeID;
-            public uint Timestamp;
-            private byte[] _fromname;
-            public byte[] FromName
-            {
-                get { return _fromname; }
-                set
-                {
-                    if (value == null) { _fromname = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _fromname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _fromname, 0, value.Length); }
-                }
-            }
-            private byte[] _subject;
-            public byte[] Subject
-            {
-                get { return _subject; }
-                set
-                {
-                    if (value == null) { _subject = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _subject = new byte[value.Length]; Buffer.BlockCopy(value, 0, _subject, 0, value.Length); }
-                }
-            }
-            public bool HasAttachment;
-            public byte AssetType;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 22;
-                    if (FromName != null) { length += 2 + FromName.Length; }
-                    if (Subject != null) { length += 2 + Subject.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    NoticeID.FromBytes(bytes, i); i += 16;
-                    Timestamp = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _fromname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _fromname, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _subject = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _subject, 0, length); i += length;
-                    HasAttachment = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    AssetType = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(NoticeID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Timestamp % 256);
-                bytes[i++] = (byte)((Timestamp >> 8) % 256);
-                bytes[i++] = (byte)((Timestamp >> 16) % 256);
-                bytes[i++] = (byte)((Timestamp >> 24) % 256);
-                if(FromName == null) { Console.WriteLine("Warning: FromName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(FromName.Length % 256);
-                bytes[i++] = (byte)((FromName.Length >> 8) % 256);
-                Buffer.BlockCopy(FromName, 0, bytes, i, FromName.Length); i += FromName.Length;
-                if(Subject == null) { Console.WriteLine("Warning: Subject is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Subject.Length % 256);
-                bytes[i++] = (byte)((Subject.Length >> 8) % 256);
-                Buffer.BlockCopy(Subject, 0, bytes, i, Subject.Length); i += Subject.Length;
-                bytes[i++] = (byte)((HasAttachment) ? 1 : 0);
-                bytes[i++] = AssetType;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("NoticeID: {0}", NoticeID));
-                output.AppendLine(String.Format("Timestamp: {0}", Timestamp));
-                Helpers.FieldToString(output, FromName, "FromName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Subject, "Subject");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("HasAttachment: {0}", HasAttachment));
-                output.Append(String.Format("AssetType: {0}", AssetType));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupNoticesListReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock[] Data;
-
-        public GroupNoticesListReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 59;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock[0];
-        }
-
-        public GroupNoticesListReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupNoticesListReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupNoticesListReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupNoticeRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID GroupNoticeID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupNoticeID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupNoticeID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("GroupNoticeID: {0}", GroupNoticeID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupNoticeRequest; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public GroupNoticeRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 60;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public GroupNoticeRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public GroupNoticeRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupNoticeRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public LLUUID RegionID;
-            public LLVector3 Position;
-            public LLVector3 LookAt;
-
-            public int Length
-            {
-                get
-                {
-                    return 40;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionID.FromBytes(bytes, i); i += 16;
-                    Position.FromBytes(bytes, i); i += 12;
-                    LookAt.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RegionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("RegionID: {0}", RegionID));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.Append(String.Format("LookAt: {0}", LookAt));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportRequest; } }
-        public AgentDataBlock AgentData;
-        public InfoBlock Info;
-
-        public TeleportRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 62;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Info = new InfoBlock();
-        }
-
-        public TeleportRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportLocationRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public ulong RegionHandle;
-            public LLVector3 Position;
-            public LLVector3 LookAt;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    Position.FromBytes(bytes, i); i += 12;
-                    LookAt.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.Append(String.Format("LookAt: {0}", LookAt));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportLocationRequest; } }
-        public AgentDataBlock AgentData;
-        public InfoBlock Info;
-
-        public TeleportLocationRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 63;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Info = new InfoBlock();
-        }
-
-        public TeleportLocationRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportLocationRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportLocationRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportLocalPacket : Packet
-    {
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public LLUUID AgentID;
-            public uint LocationID;
-            public LLVector3 Position;
-            public LLVector3 LookAt;
-            public uint TeleportFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    LocationID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Position.FromBytes(bytes, i); i += 12;
-                    LookAt.FromBytes(bytes, i); i += 12;
-                    TeleportFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(LocationID % 256);
-                bytes[i++] = (byte)((LocationID >> 8) % 256);
-                bytes[i++] = (byte)((LocationID >> 16) % 256);
-                bytes[i++] = (byte)((LocationID >> 24) % 256);
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)(TeleportFlags % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 8) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 16) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("LocationID: {0}", LocationID));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.AppendLine(String.Format("LookAt: {0}", LookAt));
-                output.Append(String.Format("TeleportFlags: {0}", TeleportFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportLocal; } }
-        public InfoBlock Info;
-
-        public TeleportLocalPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 64;
-            Header.Reliable = true;
-            Info = new InfoBlock();
-        }
-
-        public TeleportLocalPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportLocalPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportLocal ---" + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportLandmarkRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID LandmarkID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    LandmarkID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(LandmarkID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("LandmarkID: {0}", LandmarkID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportLandmarkRequest; } }
-        public InfoBlock Info;
-
-        public TeleportLandmarkRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 65;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Info = new InfoBlock();
-        }
-
-        public TeleportLandmarkRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportLandmarkRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportLandmarkRequest ---" + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportProgressPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public uint TeleportFlags;
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 4;
-                    if (Message != null) { length += 1 + Message.Length; }
-                    return length;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TeleportFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(TeleportFlags % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 8) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 16) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 24) % 256);
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Message.Length;
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("TeleportFlags: {0}", TeleportFlags));
-                Helpers.FieldToString(output, Message, "Message");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportProgress; } }
-        public AgentDataBlock AgentData;
-        public InfoBlock Info;
-
-        public TeleportProgressPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 66;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Info = new InfoBlock();
-        }
-
-        public TeleportProgressPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportProgressPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportProgress ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportFinishPacket : Packet
-    {
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public LLUUID AgentID;
-            public uint LocationID;
-            public uint SimIP;
-            public ushort SimPort;
-            public ulong RegionHandle;
-            private byte[] _seedcapability;
-            public byte[] SeedCapability
-            {
-                get { return _seedcapability; }
-                set
-                {
-                    if (value == null) { _seedcapability = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _seedcapability = new byte[value.Length]; Buffer.BlockCopy(value, 0, _seedcapability, 0, value.Length); }
-                }
-            }
-            public byte SimAccess;
-            public uint TeleportFlags;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 39;
-                    if (SeedCapability != null) { length += 2 + SeedCapability.Length; }
-                    return length;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    LocationID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SimIP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SimPort = (ushort)((bytes[i++] << 8) + bytes[i++]);
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _seedcapability = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _seedcapability, 0, length); i += length;
-                    SimAccess = (byte)bytes[i++];
-                    TeleportFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(LocationID % 256);
-                bytes[i++] = (byte)((LocationID >> 8) % 256);
-                bytes[i++] = (byte)((LocationID >> 16) % 256);
-                bytes[i++] = (byte)((LocationID >> 24) % 256);
-                bytes[i++] = (byte)(SimIP % 256);
-                bytes[i++] = (byte)((SimIP >> 8) % 256);
-                bytes[i++] = (byte)((SimIP >> 16) % 256);
-                bytes[i++] = (byte)((SimIP >> 24) % 256);
-                bytes[i++] = (byte)((SimPort >> 8) % 256);
-                bytes[i++] = (byte)(SimPort % 256);
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                if(SeedCapability == null) { Console.WriteLine("Warning: SeedCapability is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(SeedCapability.Length % 256);
-                bytes[i++] = (byte)((SeedCapability.Length >> 8) % 256);
-                Buffer.BlockCopy(SeedCapability, 0, bytes, i, SeedCapability.Length); i += SeedCapability.Length;
-                bytes[i++] = SimAccess;
-                bytes[i++] = (byte)(TeleportFlags % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 8) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 16) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("LocationID: {0}", LocationID));
-                output.AppendLine(String.Format("SimIP: {0}", SimIP));
-                output.AppendLine(String.Format("SimPort: {0}", SimPort));
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                Helpers.FieldToString(output, SeedCapability, "SeedCapability");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SimAccess: {0}", SimAccess));
-                output.Append(String.Format("TeleportFlags: {0}", TeleportFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportFinish; } }
-        public InfoBlock Info;
-
-        public TeleportFinishPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 69;
-            Header.Reliable = true;
-            Info = new InfoBlock();
-        }
-
-        public TeleportFinishPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportFinishPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportFinish ---" + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class StartLurePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public byte LureType;
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 1;
-                    if (Message != null) { length += 1 + Message.Length; }
-                    return length;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    LureType = (byte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = LureType;
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Message.Length;
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("LureType: {0}", LureType));
-                Helpers.FieldToString(output, Message, "Message");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TargetDataBlock
-        {
-            public LLUUID TargetID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TargetDataBlock() { }
-            public TargetDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TargetID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TargetData --");
-                output.Append(String.Format("TargetID: {0}", TargetID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.StartLure; } }
-        public AgentDataBlock AgentData;
-        public InfoBlock Info;
-        public TargetDataBlock[] TargetData;
-
-        public StartLurePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 70;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Info = new InfoBlock();
-            TargetData = new TargetDataBlock[0];
-        }
-
-        public StartLurePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(TargetData.Length < count) {
-                TargetData = new TargetDataBlock[count];
-                for(int j = 0; j < count; j++) TargetData[j] = new TargetDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { TargetData[j].FromBytes(bytes, ref i); }
-        }
-
-        public StartLurePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(TargetData.Length < count) {
-                TargetData = new TargetDataBlock[count];
-                for(int j = 0; j < count; j++) TargetData[j] = new TargetDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { TargetData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Info.Length;;
-            length++;
-            for (int j = 0; j < TargetData.Length; j++) { length += TargetData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)TargetData.Length;
-            for (int j = 0; j < TargetData.Length; j++) { TargetData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- StartLure ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            for (int j = 0; j < TargetData.Length; j++)
-            {
-                output += TargetData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportLureRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID LureID;
-            public uint TeleportFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 52;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    LureID.FromBytes(bytes, i); i += 16;
-                    TeleportFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(LureID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(TeleportFlags % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 8) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 16) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("LureID: {0}", LureID));
-                output.Append(String.Format("TeleportFlags: {0}", TeleportFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportLureRequest; } }
-        public InfoBlock Info;
-
-        public TeleportLureRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 71;
-            Header.Reliable = true;
-            Info = new InfoBlock();
-        }
-
-        public TeleportLureRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportLureRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportLureRequest ---" + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportCancelPacket : Packet
-    {
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportCancel; } }
-        public InfoBlock Info;
-
-        public TeleportCancelPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 72;
-            Header.Reliable = true;
-            Info = new InfoBlock();
-        }
-
-        public TeleportCancelPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportCancelPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportCancel ---" + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportStartPacket : Packet
-    {
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public uint TeleportFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TeleportFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(TeleportFlags % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 8) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 16) % 256);
-                bytes[i++] = (byte)((TeleportFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.Append(String.Format("TeleportFlags: {0}", TeleportFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportStart; } }
-        public InfoBlock Info;
-
-        public TeleportStartPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 73;
-            Header.Reliable = true;
-            Info = new InfoBlock();
-        }
-
-        public TeleportStartPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportStartPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportStart ---" + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TeleportFailedPacket : Packet
-    {
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public LLUUID AgentID;
-            private byte[] _reason;
-            public byte[] Reason
-            {
-                get { return _reason; }
-                set
-                {
-                    if (value == null) { _reason = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _reason = new byte[value.Length]; Buffer.BlockCopy(value, 0, _reason, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Reason != null) { length += 1 + Reason.Length; }
-                    return length;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _reason = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _reason, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Reason == null) { Console.WriteLine("Warning: Reason is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Reason.Length;
-                Buffer.BlockCopy(Reason, 0, bytes, i, Reason.Length); i += Reason.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                Helpers.FieldToString(output, Reason, "Reason");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TeleportFailed; } }
-        public InfoBlock Info;
-
-        public TeleportFailedPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 74;
-            Header.Reliable = true;
-            Info = new InfoBlock();
-        }
-
-        public TeleportFailedPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public TeleportFailedPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TeleportFailed ---" + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UndoPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.Undo; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public UndoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 75;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public UndoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public UndoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- Undo ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RedoPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.Redo; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public RedoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 76;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public RedoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public RedoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- Redo ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UndoLandPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UndoLand; } }
-        public AgentDataBlock AgentData;
-
-        public UndoLandPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 77;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public UndoLandPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public UndoLandPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UndoLand ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentPausePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint SerialNum;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    SerialNum = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SerialNum % 256);
-                bytes[i++] = (byte)((SerialNum >> 8) % 256);
-                bytes[i++] = (byte)((SerialNum >> 16) % 256);
-                bytes[i++] = (byte)((SerialNum >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("SerialNum: {0}", SerialNum));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentPause; } }
-        public AgentDataBlock AgentData;
-
-        public AgentPausePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 78;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AgentPausePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AgentPausePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentPause ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentResumePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint SerialNum;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    SerialNum = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SerialNum % 256);
-                bytes[i++] = (byte)((SerialNum >> 8) % 256);
-                bytes[i++] = (byte)((SerialNum >> 16) % 256);
-                bytes[i++] = (byte)((SerialNum >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("SerialNum: {0}", SerialNum));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentResume; } }
-        public AgentDataBlock AgentData;
-
-        public AgentResumePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 79;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AgentResumePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AgentResumePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentResume ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChatFromViewerPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ChatDataBlock
-        {
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-            public byte Type;
-            public int Channel;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 5;
-                    if (Message != null) { length += 2 + Message.Length; }
-                    return length;
-                }
-            }
-
-            public ChatDataBlock() { }
-            public ChatDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                    Type = (byte)bytes[i++];
-                    Channel = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Message.Length % 256);
-                bytes[i++] = (byte)((Message.Length >> 8) % 256);
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-                bytes[i++] = Type;
-                bytes[i++] = (byte)(Channel % 256);
-                bytes[i++] = (byte)((Channel >> 8) % 256);
-                bytes[i++] = (byte)((Channel >> 16) % 256);
-                bytes[i++] = (byte)((Channel >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ChatData --");
-                Helpers.FieldToString(output, Message, "Message");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.Append(String.Format("Channel: {0}", Channel));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChatFromViewer; } }
-        public AgentDataBlock AgentData;
-        public ChatDataBlock ChatData;
-
-        public ChatFromViewerPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 80;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ChatData = new ChatDataBlock();
-        }
-
-        public ChatFromViewerPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ChatData.FromBytes(bytes, ref i);
-        }
-
-        public ChatFromViewerPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ChatData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ChatData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ChatData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChatFromViewer ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ChatData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentThrottlePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint CircuitCode;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    CircuitCode = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CircuitCode % 256);
-                bytes[i++] = (byte)((CircuitCode >> 8) % 256);
-                bytes[i++] = (byte)((CircuitCode >> 16) % 256);
-                bytes[i++] = (byte)((CircuitCode >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("CircuitCode: {0}", CircuitCode));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ThrottleBlock
-        {
-            public uint GenCounter;
-            private byte[] _throttles;
-            public byte[] Throttles
-            {
-                get { return _throttles; }
-                set
-                {
-                    if (value == null) { _throttles = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _throttles = new byte[value.Length]; Buffer.BlockCopy(value, 0, _throttles, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 4;
-                    if (Throttles != null) { length += 1 + Throttles.Length; }
-                    return length;
-                }
-            }
-
-            public ThrottleBlock() { }
-            public ThrottleBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GenCounter = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _throttles = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _throttles, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(GenCounter % 256);
-                bytes[i++] = (byte)((GenCounter >> 8) % 256);
-                bytes[i++] = (byte)((GenCounter >> 16) % 256);
-                bytes[i++] = (byte)((GenCounter >> 24) % 256);
-                if(Throttles == null) { Console.WriteLine("Warning: Throttles is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Throttles.Length;
-                Buffer.BlockCopy(Throttles, 0, bytes, i, Throttles.Length); i += Throttles.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Throttle --");
-                output.AppendLine(String.Format("GenCounter: {0}", GenCounter));
-                Helpers.FieldToString(output, Throttles, "Throttles");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentThrottle; } }
-        public AgentDataBlock AgentData;
-        public ThrottleBlock Throttle;
-
-        public AgentThrottlePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 81;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Throttle = new ThrottleBlock();
-        }
-
-        public AgentThrottlePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Throttle.FromBytes(bytes, ref i);
-        }
-
-        public AgentThrottlePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Throttle.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Throttle.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Throttle.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentThrottle ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Throttle.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentFOVPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint CircuitCode;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    CircuitCode = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CircuitCode % 256);
-                bytes[i++] = (byte)((CircuitCode >> 8) % 256);
-                bytes[i++] = (byte)((CircuitCode >> 16) % 256);
-                bytes[i++] = (byte)((CircuitCode >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("CircuitCode: {0}", CircuitCode));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FOVBlockBlock
-        {
-            public uint GenCounter;
-            public float VerticalAngle;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public FOVBlockBlock() { }
-            public FOVBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GenCounter = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    VerticalAngle = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(GenCounter % 256);
-                bytes[i++] = (byte)((GenCounter >> 8) % 256);
-                bytes[i++] = (byte)((GenCounter >> 16) % 256);
-                bytes[i++] = (byte)((GenCounter >> 24) % 256);
-                ba = BitConverter.GetBytes(VerticalAngle);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FOVBlock --");
-                output.AppendLine(String.Format("GenCounter: {0}", GenCounter));
-                output.Append(String.Format("VerticalAngle: {0}", VerticalAngle));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentFOV; } }
-        public AgentDataBlock AgentData;
-        public FOVBlockBlock FOVBlock;
-
-        public AgentFOVPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 82;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            FOVBlock = new FOVBlockBlock();
-        }
-
-        public AgentFOVPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            FOVBlock.FromBytes(bytes, ref i);
-        }
-
-        public AgentFOVPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            FOVBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += FOVBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            FOVBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentFOV ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += FOVBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentHeightWidthPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint CircuitCode;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    CircuitCode = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CircuitCode % 256);
-                bytes[i++] = (byte)((CircuitCode >> 8) % 256);
-                bytes[i++] = (byte)((CircuitCode >> 16) % 256);
-                bytes[i++] = (byte)((CircuitCode >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("CircuitCode: {0}", CircuitCode));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class HeightWidthBlockBlock
-        {
-            public uint GenCounter;
-            public ushort Height;
-            public ushort Width;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public HeightWidthBlockBlock() { }
-            public HeightWidthBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GenCounter = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Height = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    Width = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(GenCounter % 256);
-                bytes[i++] = (byte)((GenCounter >> 8) % 256);
-                bytes[i++] = (byte)((GenCounter >> 16) % 256);
-                bytes[i++] = (byte)((GenCounter >> 24) % 256);
-                bytes[i++] = (byte)(Height % 256);
-                bytes[i++] = (byte)((Height >> 8) % 256);
-                bytes[i++] = (byte)(Width % 256);
-                bytes[i++] = (byte)((Width >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HeightWidthBlock --");
-                output.AppendLine(String.Format("GenCounter: {0}", GenCounter));
-                output.AppendLine(String.Format("Height: {0}", Height));
-                output.Append(String.Format("Width: {0}", Width));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentHeightWidth; } }
-        public AgentDataBlock AgentData;
-        public HeightWidthBlockBlock HeightWidthBlock;
-
-        public AgentHeightWidthPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 83;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            HeightWidthBlock = new HeightWidthBlockBlock();
-        }
-
-        public AgentHeightWidthPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeightWidthBlock.FromBytes(bytes, ref i);
-        }
-
-        public AgentHeightWidthPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeightWidthBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += HeightWidthBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            HeightWidthBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentHeightWidth ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += HeightWidthBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentSetAppearancePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint SerialNum;
-            public LLVector3 Size;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    SerialNum = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Size.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SerialNum % 256);
-                bytes[i++] = (byte)((SerialNum >> 8) % 256);
-                bytes[i++] = (byte)((SerialNum >> 16) % 256);
-                bytes[i++] = (byte)((SerialNum >> 24) % 256);
-                Buffer.BlockCopy(Size.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("SerialNum: {0}", SerialNum));
-                output.Append(String.Format("Size: {0}", Size));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class WearableDataBlock
-        {
-            public LLUUID CacheID;
-            public byte TextureIndex;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public WearableDataBlock() { }
-            public WearableDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    CacheID.FromBytes(bytes, i); i += 16;
-                    TextureIndex = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(CacheID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = TextureIndex;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- WearableData --");
-                output.AppendLine(String.Format("CacheID: {0}", CacheID));
-                output.Append(String.Format("TextureIndex: {0}", TextureIndex));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            private byte[] _textureentry;
-            public byte[] TextureEntry
-            {
-                get { return _textureentry; }
-                set
-                {
-                    if (value == null) { _textureentry = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _textureentry = new byte[value.Length]; Buffer.BlockCopy(value, 0, _textureentry, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (TextureEntry != null) { length += 2 + TextureEntry.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _textureentry = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _textureentry, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(TextureEntry == null) { Console.WriteLine("Warning: TextureEntry is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(TextureEntry.Length % 256);
-                bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256);
-                Buffer.BlockCopy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                Helpers.FieldToString(output, TextureEntry, "TextureEntry");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class VisualParamBlock
-        {
-            public byte ParamValue;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public VisualParamBlock() { }
-            public VisualParamBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ParamValue = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = ParamValue;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- VisualParam --");
-                output.Append(String.Format("ParamValue: {0}", ParamValue));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentSetAppearance; } }
-        public AgentDataBlock AgentData;
-        public WearableDataBlock[] WearableData;
-        public ObjectDataBlock ObjectData;
-        public VisualParamBlock[] VisualParam;
-
-        public AgentSetAppearancePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 84;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            WearableData = new WearableDataBlock[0];
-            ObjectData = new ObjectDataBlock();
-            VisualParam = new VisualParamBlock[0];
-        }
-
-        public AgentSetAppearancePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-            ObjectData.FromBytes(bytes, ref i);
-            count = (int)bytes[i++];
-            if(VisualParam.Length < count) {
-                VisualParam = new VisualParamBlock[count];
-                for(int j = 0; j < count; j++) VisualParam[j] = new VisualParamBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { VisualParam[j].FromBytes(bytes, ref i); }
-        }
-
-        public AgentSetAppearancePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-            ObjectData.FromBytes(bytes, ref i);
-            count = (int)bytes[i++];
-            if(VisualParam.Length < count) {
-                VisualParam = new VisualParamBlock[count];
-                for(int j = 0; j < count; j++) VisualParam[j] = new VisualParamBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { VisualParam[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            length++;
-            for (int j = 0; j < WearableData.Length; j++) { length += WearableData[j].Length; }
-            length++;
-            for (int j = 0; j < VisualParam.Length; j++) { length += VisualParam[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)WearableData.Length;
-            for (int j = 0; j < WearableData.Length; j++) { WearableData[j].ToBytes(bytes, ref i); }
-            ObjectData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)VisualParam.Length;
-            for (int j = 0; j < VisualParam.Length; j++) { VisualParam[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentSetAppearance ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < WearableData.Length; j++)
-            {
-                output += WearableData[j].ToString() + Environment.NewLine;
-            }
-                output += ObjectData.ToString() + Environment.NewLine;
-            for (int j = 0; j < VisualParam.Length; j++)
-            {
-                output += VisualParam[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentQuitCopyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FuseBlockBlock
-        {
-            public uint ViewerCircuitCode;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public FuseBlockBlock() { }
-            public FuseBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ViewerCircuitCode = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ViewerCircuitCode % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 8) % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 16) % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FuseBlock --");
-                output.Append(String.Format("ViewerCircuitCode: {0}", ViewerCircuitCode));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentQuitCopy; } }
-        public AgentDataBlock AgentData;
-        public FuseBlockBlock FuseBlock;
-
-        public AgentQuitCopyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 85;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            FuseBlock = new FuseBlockBlock();
-        }
-
-        public AgentQuitCopyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            FuseBlock.FromBytes(bytes, ref i);
-        }
-
-        public AgentQuitCopyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            FuseBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += FuseBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            FuseBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentQuitCopy ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += FuseBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ImageNotInDatabasePacket : Packet
-    {
-        /// <exclude/>
-        public class ImageIDBlock
-        {
-            public LLUUID ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ImageIDBlock() { }
-            public ImageIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ImageID --");
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ImageNotInDatabase; } }
-        public ImageIDBlock ImageID;
-
-        public ImageNotInDatabasePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 86;
-            Header.Reliable = true;
-            ImageID = new ImageIDBlock();
-        }
-
-        public ImageNotInDatabasePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ImageID.FromBytes(bytes, ref i);
-        }
-
-        public ImageNotInDatabasePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ImageID.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ImageID.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ImageID.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ImageNotInDatabase ---" + Environment.NewLine;
-                output += ImageID.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RebakeAvatarTexturesPacket : Packet
-    {
-        /// <exclude/>
-        public class TextureDataBlock
-        {
-            public LLUUID TextureID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TextureDataBlock() { }
-            public TextureDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TextureID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TextureID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TextureData --");
-                output.Append(String.Format("TextureID: {0}", TextureID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RebakeAvatarTextures; } }
-        public TextureDataBlock TextureData;
-
-        public RebakeAvatarTexturesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 87;
-            Header.Reliable = true;
-            TextureData = new TextureDataBlock();
-        }
-
-        public RebakeAvatarTexturesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TextureData.FromBytes(bytes, ref i);
-        }
-
-        public RebakeAvatarTexturesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TextureData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TextureData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TextureData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RebakeAvatarTextures ---" + Environment.NewLine;
-                output += TextureData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SetAlwaysRunPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public bool AlwaysRun;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    AlwaysRun = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((AlwaysRun) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("AlwaysRun: {0}", AlwaysRun));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SetAlwaysRun; } }
-        public AgentDataBlock AgentData;
-
-        public SetAlwaysRunPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 88;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public SetAlwaysRunPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public SetAlwaysRunPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SetAlwaysRun ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDeletePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public bool Force;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Force = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Force) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("Force: {0}", Force));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDelete; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectDeletePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 89;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectDeletePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectDeletePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDelete ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDuplicatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class SharedDataBlock
-        {
-            public LLVector3 Offset;
-            public uint DuplicateFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public SharedDataBlock() { }
-            public SharedDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Offset.FromBytes(bytes, i); i += 12;
-                    DuplicateFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(Offset.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)(DuplicateFlags % 256);
-                bytes[i++] = (byte)((DuplicateFlags >> 8) % 256);
-                bytes[i++] = (byte)((DuplicateFlags >> 16) % 256);
-                bytes[i++] = (byte)((DuplicateFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SharedData --");
-                output.AppendLine(String.Format("Offset: {0}", Offset));
-                output.Append(String.Format("DuplicateFlags: {0}", DuplicateFlags));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDuplicate; } }
-        public AgentDataBlock AgentData;
-        public SharedDataBlock SharedData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectDuplicatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 90;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            SharedData = new SharedDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectDuplicatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            SharedData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectDuplicatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            SharedData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += SharedData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            SharedData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDuplicate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += SharedData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDuplicateOnRayPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-            public LLVector3 RayStart;
-            public LLVector3 RayEnd;
-            public bool BypassRaycast;
-            public bool RayEndIsIntersection;
-            public bool CopyCenters;
-            public bool CopyRotates;
-            public LLUUID RayTargetID;
-            public uint DuplicateFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 96;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RayStart.FromBytes(bytes, i); i += 12;
-                    RayEnd.FromBytes(bytes, i); i += 12;
-                    BypassRaycast = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RayEndIsIntersection = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    CopyCenters = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    CopyRotates = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RayTargetID.FromBytes(bytes, i); i += 16;
-                    DuplicateFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RayStart.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(RayEnd.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)((BypassRaycast) ? 1 : 0);
-                bytes[i++] = (byte)((RayEndIsIntersection) ? 1 : 0);
-                bytes[i++] = (byte)((CopyCenters) ? 1 : 0);
-                bytes[i++] = (byte)((CopyRotates) ? 1 : 0);
-                Buffer.BlockCopy(RayTargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(DuplicateFlags % 256);
-                bytes[i++] = (byte)((DuplicateFlags >> 8) % 256);
-                bytes[i++] = (byte)((DuplicateFlags >> 16) % 256);
-                bytes[i++] = (byte)((DuplicateFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("RayStart: {0}", RayStart));
-                output.AppendLine(String.Format("RayEnd: {0}", RayEnd));
-                output.AppendLine(String.Format("BypassRaycast: {0}", BypassRaycast));
-                output.AppendLine(String.Format("RayEndIsIntersection: {0}", RayEndIsIntersection));
-                output.AppendLine(String.Format("CopyCenters: {0}", CopyCenters));
-                output.AppendLine(String.Format("CopyRotates: {0}", CopyRotates));
-                output.AppendLine(String.Format("RayTargetID: {0}", RayTargetID));
-                output.Append(String.Format("DuplicateFlags: {0}", DuplicateFlags));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDuplicateOnRay; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectDuplicateOnRayPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 91;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectDuplicateOnRayPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectDuplicateOnRayPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDuplicateOnRay ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectScalePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public LLVector3 Scale;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Scale.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                Buffer.BlockCopy(Scale.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.Append(String.Format("Scale: {0}", Scale));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectScale; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectScalePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 92;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectScalePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectScalePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectScale ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectRotationPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public LLQuaternion Rotation;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Rotation.FromBytes(bytes, i, true); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                Buffer.BlockCopy(Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.Append(String.Format("Rotation: {0}", Rotation));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectRotation; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectRotationPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 93;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectRotationPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectRotationPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectRotation ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectFlagUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint ObjectLocalID;
-            public bool UsePhysics;
-            public bool IsTemporary;
-            public bool IsPhantom;
-            public bool CastsShadows;
-
-            public int Length
-            {
-                get
-                {
-                    return 40;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    UsePhysics = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    IsTemporary = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    IsPhantom = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    CastsShadows = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = (byte)((UsePhysics) ? 1 : 0);
-                bytes[i++] = (byte)((IsTemporary) ? 1 : 0);
-                bytes[i++] = (byte)((IsPhantom) ? 1 : 0);
-                bytes[i++] = (byte)((CastsShadows) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.AppendLine(String.Format("UsePhysics: {0}", UsePhysics));
-                output.AppendLine(String.Format("IsTemporary: {0}", IsTemporary));
-                output.AppendLine(String.Format("IsPhantom: {0}", IsPhantom));
-                output.Append(String.Format("CastsShadows: {0}", CastsShadows));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectFlagUpdate; } }
-        public AgentDataBlock AgentData;
-
-        public ObjectFlagUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 94;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public ObjectFlagUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public ObjectFlagUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectFlagUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectClickActionPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public byte ClickAction;
-
-            public int Length
-            {
-                get
-                {
-                    return 5;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ClickAction = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = ClickAction;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.Append(String.Format("ClickAction: {0}", ClickAction));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectClickAction; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectClickActionPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 95;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectClickActionPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectClickActionPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectClickAction ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectImagePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            private byte[] _mediaurl;
-            public byte[] MediaURL
-            {
-                get { return _mediaurl; }
-                set
-                {
-                    if (value == null) { _mediaurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mediaurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediaurl, 0, value.Length); }
-                }
-            }
-            private byte[] _textureentry;
-            public byte[] TextureEntry
-            {
-                get { return _textureentry; }
-                set
-                {
-                    if (value == null) { _textureentry = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _textureentry = new byte[value.Length]; Buffer.BlockCopy(value, 0, _textureentry, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 4;
-                    if (MediaURL != null) { length += 1 + MediaURL.Length; }
-                    if (TextureEntry != null) { length += 2 + TextureEntry.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _mediaurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mediaurl, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _textureentry = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _textureentry, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                if(MediaURL == null) { Console.WriteLine("Warning: MediaURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MediaURL.Length;
-                Buffer.BlockCopy(MediaURL, 0, bytes, i, MediaURL.Length); i += MediaURL.Length;
-                if(TextureEntry == null) { Console.WriteLine("Warning: TextureEntry is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(TextureEntry.Length % 256);
-                bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256);
-                Buffer.BlockCopy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                Helpers.FieldToString(output, MediaURL, "MediaURL");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, TextureEntry, "TextureEntry");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectImage; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectImagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 96;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectImagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectImagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectImage ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectMaterialPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public byte Material;
-
-            public int Length
-            {
-                get
-                {
-                    return 5;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Material = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = Material;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.Append(String.Format("Material: {0}", Material));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectMaterial; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectMaterialPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 97;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectMaterialPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectMaterialPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectMaterial ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectShapePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public byte PathCurve;
-            public byte ProfileCurve;
-            public ushort PathBegin;
-            public ushort PathEnd;
-            public byte PathScaleX;
-            public byte PathScaleY;
-            public byte PathShearX;
-            public byte PathShearY;
-            public sbyte PathTwist;
-            public sbyte PathTwistBegin;
-            public sbyte PathRadiusOffset;
-            public sbyte PathTaperX;
-            public sbyte PathTaperY;
-            public byte PathRevolutions;
-            public sbyte PathSkew;
-            public ushort ProfileBegin;
-            public ushort ProfileEnd;
-            public ushort ProfileHollow;
-
-            public int Length
-            {
-                get
-                {
-                    return 27;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PathCurve = (byte)bytes[i++];
-                    ProfileCurve = (byte)bytes[i++];
-                    PathBegin = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    PathEnd = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    PathScaleX = (byte)bytes[i++];
-                    PathScaleY = (byte)bytes[i++];
-                    PathShearX = (byte)bytes[i++];
-                    PathShearY = (byte)bytes[i++];
-                    PathTwist = (sbyte)bytes[i++];
-                    PathTwistBegin = (sbyte)bytes[i++];
-                    PathRadiusOffset = (sbyte)bytes[i++];
-                    PathTaperX = (sbyte)bytes[i++];
-                    PathTaperY = (sbyte)bytes[i++];
-                    PathRevolutions = (byte)bytes[i++];
-                    PathSkew = (sbyte)bytes[i++];
-                    ProfileBegin = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    ProfileEnd = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    ProfileHollow = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = PathCurve;
-                bytes[i++] = ProfileCurve;
-                bytes[i++] = (byte)(PathBegin % 256);
-                bytes[i++] = (byte)((PathBegin >> 8) % 256);
-                bytes[i++] = (byte)(PathEnd % 256);
-                bytes[i++] = (byte)((PathEnd >> 8) % 256);
-                bytes[i++] = PathScaleX;
-                bytes[i++] = PathScaleY;
-                bytes[i++] = PathShearX;
-                bytes[i++] = PathShearY;
-                bytes[i++] = (byte)PathTwist;
-                bytes[i++] = (byte)PathTwistBegin;
-                bytes[i++] = (byte)PathRadiusOffset;
-                bytes[i++] = (byte)PathTaperX;
-                bytes[i++] = (byte)PathTaperY;
-                bytes[i++] = PathRevolutions;
-                bytes[i++] = (byte)PathSkew;
-                bytes[i++] = (byte)(ProfileBegin % 256);
-                bytes[i++] = (byte)((ProfileBegin >> 8) % 256);
-                bytes[i++] = (byte)(ProfileEnd % 256);
-                bytes[i++] = (byte)((ProfileEnd >> 8) % 256);
-                bytes[i++] = (byte)(ProfileHollow % 256);
-                bytes[i++] = (byte)((ProfileHollow >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.AppendLine(String.Format("PathCurve: {0}", PathCurve));
-                output.AppendLine(String.Format("ProfileCurve: {0}", ProfileCurve));
-                output.AppendLine(String.Format("PathBegin: {0}", PathBegin));
-                output.AppendLine(String.Format("PathEnd: {0}", PathEnd));
-                output.AppendLine(String.Format("PathScaleX: {0}", PathScaleX));
-                output.AppendLine(String.Format("PathScaleY: {0}", PathScaleY));
-                output.AppendLine(String.Format("PathShearX: {0}", PathShearX));
-                output.AppendLine(String.Format("PathShearY: {0}", PathShearY));
-                output.AppendLine(String.Format("PathTwist: {0}", PathTwist));
-                output.AppendLine(String.Format("PathTwistBegin: {0}", PathTwistBegin));
-                output.AppendLine(String.Format("PathRadiusOffset: {0}", PathRadiusOffset));
-                output.AppendLine(String.Format("PathTaperX: {0}", PathTaperX));
-                output.AppendLine(String.Format("PathTaperY: {0}", PathTaperY));
-                output.AppendLine(String.Format("PathRevolutions: {0}", PathRevolutions));
-                output.AppendLine(String.Format("PathSkew: {0}", PathSkew));
-                output.AppendLine(String.Format("ProfileBegin: {0}", ProfileBegin));
-                output.AppendLine(String.Format("ProfileEnd: {0}", ProfileEnd));
-                output.Append(String.Format("ProfileHollow: {0}", ProfileHollow));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectShape; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectShapePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 98;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectShapePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectShapePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectShape ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectExtraParamsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public ushort ParamType;
-            public bool ParamInUse;
-            public uint ParamSize;
-            private byte[] _paramdata;
-            public byte[] ParamData
-            {
-                get { return _paramdata; }
-                set
-                {
-                    if (value == null) { _paramdata = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _paramdata = new byte[value.Length]; Buffer.BlockCopy(value, 0, _paramdata, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 11;
-                    if (ParamData != null) { length += 1 + ParamData.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParamType = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    ParamInUse = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    ParamSize = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _paramdata = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _paramdata, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = (byte)(ParamType % 256);
-                bytes[i++] = (byte)((ParamType >> 8) % 256);
-                bytes[i++] = (byte)((ParamInUse) ? 1 : 0);
-                bytes[i++] = (byte)(ParamSize % 256);
-                bytes[i++] = (byte)((ParamSize >> 8) % 256);
-                bytes[i++] = (byte)((ParamSize >> 16) % 256);
-                bytes[i++] = (byte)((ParamSize >> 24) % 256);
-                if(ParamData == null) { Console.WriteLine("Warning: ParamData is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ParamData.Length;
-                Buffer.BlockCopy(ParamData, 0, bytes, i, ParamData.Length); i += ParamData.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.AppendLine(String.Format("ParamType: {0}", ParamType));
-                output.AppendLine(String.Format("ParamInUse: {0}", ParamInUse));
-                output.AppendLine(String.Format("ParamSize: {0}", ParamSize));
-                Helpers.FieldToString(output, ParamData, "ParamData");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectExtraParams; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectExtraParamsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 99;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectExtraParamsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectExtraParamsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectExtraParams ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectOwnerPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class HeaderDataBlock
-        {
-            public bool Override;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public HeaderDataBlock() { }
-            public HeaderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Override = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((Override) ? 1 : 0);
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HeaderData --");
-                output.AppendLine(String.Format("Override: {0}", Override));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectOwner; } }
-        public AgentDataBlock AgentData;
-        public HeaderDataBlock HeaderData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectOwnerPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 100;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            HeaderData = new HeaderDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectOwnerPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeaderData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectOwnerPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeaderData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += HeaderData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            HeaderData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectOwner ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += HeaderData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectGroupPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectGroup; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectGroupPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 101;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectGroupPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectGroupPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectGroup ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectBuyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-            public LLUUID CategoryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 64;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    CategoryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CategoryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("CategoryID: {0}", CategoryID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public byte SaleType;
-            public int SalePrice;
-
-            public int Length
-            {
-                get
-                {
-                    return 9;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.Append(String.Format("SalePrice: {0}", SalePrice));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectBuy; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectBuyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 102;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectBuyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectBuyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectBuy ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class BuyObjectInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ObjectID;
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("FolderID: {0}", FolderID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.BuyObjectInventory; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public BuyObjectInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 103;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public BuyObjectInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public BuyObjectInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- BuyObjectInventory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DerezContainerPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ObjectID;
-            public bool Delete;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    Delete = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Delete) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.Append(String.Format("Delete: {0}", Delete));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DerezContainer; } }
-        public DataBlock Data;
-
-        public DerezContainerPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 104;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Data = new DataBlock();
-        }
-
-        public DerezContainerPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public DerezContainerPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DerezContainer ---" + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectPermissionsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class HeaderDataBlock
-        {
-            public bool Override;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public HeaderDataBlock() { }
-            public HeaderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Override = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((Override) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HeaderData --");
-                output.Append(String.Format("Override: {0}", Override));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public byte Field;
-            public byte Set;
-            public uint Mask;
-
-            public int Length
-            {
-                get
-                {
-                    return 10;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Field = (byte)bytes[i++];
-                    Set = (byte)bytes[i++];
-                    Mask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = Field;
-                bytes[i++] = Set;
-                bytes[i++] = (byte)(Mask % 256);
-                bytes[i++] = (byte)((Mask >> 8) % 256);
-                bytes[i++] = (byte)((Mask >> 16) % 256);
-                bytes[i++] = (byte)((Mask >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.AppendLine(String.Format("Field: {0}", Field));
-                output.AppendLine(String.Format("Set: {0}", Set));
-                output.Append(String.Format("Mask: {0}", Mask));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectPermissions; } }
-        public AgentDataBlock AgentData;
-        public HeaderDataBlock HeaderData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectPermissionsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 105;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            HeaderData = new HeaderDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectPermissionsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeaderData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectPermissionsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeaderData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += HeaderData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            HeaderData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectPermissions ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += HeaderData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectSaleInfoPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint LocalID;
-            public byte SaleType;
-            public int SalePrice;
-
-            public int Length
-            {
-                get
-                {
-                    return 9;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.Append(String.Format("SalePrice: {0}", SalePrice));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectSaleInfo; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectSaleInfoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 106;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectSaleInfoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectSaleInfoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectSaleInfo ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectNamePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint LocalID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 4;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectName; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectNamePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 107;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectNamePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectNamePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectName ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDescriptionPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint LocalID;
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 4;
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                Helpers.FieldToString(output, Description, "Description");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDescription; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectDescriptionPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 108;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectDescriptionPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectDescriptionPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDescription ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectCategoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint LocalID;
-            public uint Category;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Category = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = (byte)(Category % 256);
-                bytes[i++] = (byte)((Category >> 8) % 256);
-                bytes[i++] = (byte)((Category >> 16) % 256);
-                bytes[i++] = (byte)((Category >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("Category: {0}", Category));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectCategory; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectCategoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 109;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectCategoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectCategoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectCategory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectSelectPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectSelect; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectSelectPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 110;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectSelectPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectSelectPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectSelect ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDeselectPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDeselect; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectDeselectPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 111;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectDeselectPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectDeselectPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDeselect ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectAttachPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public byte AttachmentPoint;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    AttachmentPoint = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = AttachmentPoint;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("AttachmentPoint: {0}", AttachmentPoint));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public LLQuaternion Rotation;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Rotation.FromBytes(bytes, i, true); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                Buffer.BlockCopy(Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.Append(String.Format("Rotation: {0}", Rotation));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectAttach; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectAttachPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 112;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectAttachPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectAttachPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectAttach ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDetachPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDetach; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectDetachPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 113;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectDetachPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectDetachPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDetach ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDropPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDrop; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectDropPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 114;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectDropPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectDropPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDrop ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectLinkPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectLink; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectLinkPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 115;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectLinkPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectLinkPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectLink ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDelinkPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDelink; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectDelinkPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 116;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectDelinkPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectDelinkPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDelink ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectGrabPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint LocalID;
-            public LLVector3 GrabOffset;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GrabOffset.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                Buffer.BlockCopy(GrabOffset.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("GrabOffset: {0}", GrabOffset));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class SurfaceInfoBlock
-        {
-            public LLVector3 UVCoord;
-            public LLVector3 STCoord;
-            public int FaceIndex;
-            public LLVector3 Position;
-            public LLVector3 Normal;
-            public LLVector3 Binormal;
-
-            public int Length
-            {
-                get
-                {
-                    return 64;
-                }
-            }
-
-            public SurfaceInfoBlock() { }
-            public SurfaceInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    UVCoord.FromBytes(bytes, i); i += 12;
-                    STCoord.FromBytes(bytes, i); i += 12;
-                    FaceIndex = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Position.FromBytes(bytes, i); i += 12;
-                    Normal.FromBytes(bytes, i); i += 12;
-                    Binormal.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(UVCoord.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(STCoord.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)(FaceIndex % 256);
-                bytes[i++] = (byte)((FaceIndex >> 8) % 256);
-                bytes[i++] = (byte)((FaceIndex >> 16) % 256);
-                bytes[i++] = (byte)((FaceIndex >> 24) % 256);
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Normal.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Binormal.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SurfaceInfo --");
-                output.AppendLine(String.Format("UVCoord: {0}", UVCoord));
-                output.AppendLine(String.Format("STCoord: {0}", STCoord));
-                output.AppendLine(String.Format("FaceIndex: {0}", FaceIndex));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.AppendLine(String.Format("Normal: {0}", Normal));
-                output.Append(String.Format("Binormal: {0}", Binormal));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectGrab; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-        public SurfaceInfoBlock[] SurfaceInfo;
-
-        public ObjectGrabPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 117;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-            SurfaceInfo = new SurfaceInfoBlock[0];
-        }
-
-        public ObjectGrabPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-            //if (i <= (bytes.Length - 65))
-            //{
-            //    int count = (int)bytes[i++];
-            //    if (SurfaceInfo.Length < count)
-            //    {
-            //        SurfaceInfo = new SurfaceInfoBlock[count];
-            //        for (int j = 0; j < count; j++) SurfaceInfo[j] = new SurfaceInfoBlock();
-            //    }
-            //    for (int j = 0; j < count; j++)
-            //    { SurfaceInfo[j].FromBytes(bytes, ref i); }
-            //}
-        }
-
-        public ObjectGrabPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-            //if (i <= (bytes.Length - 65))
-            //{
-            //    int count = (int)bytes[i++];
-            //    if (SurfaceInfo.Length < count)
-            //    {
-            //        SurfaceInfo = new SurfaceInfoBlock[count];
-            //        for (int j = 0; j < count; j++) SurfaceInfo[j] = new SurfaceInfoBlock();
-            //    }
-            //    for (int j = 0; j < count; j++)
-            //    { SurfaceInfo[j].FromBytes(bytes, ref i); }
-            //}
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            length++;
-            for (int j = 0; j < SurfaceInfo.Length; j++) { length += SurfaceInfo[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)SurfaceInfo.Length;
-            for (int j = 0; j < SurfaceInfo.Length; j++) { SurfaceInfo[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectGrab ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            for (int j = 0; j < SurfaceInfo.Length; j++)
-            {
-                output += SurfaceInfo[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectGrabUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-            public LLVector3 GrabOffsetInitial;
-            public LLVector3 GrabPosition;
-            public uint TimeSinceLast;
-
-            public int Length
-            {
-                get
-                {
-                    return 44;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    GrabOffsetInitial.FromBytes(bytes, i); i += 12;
-                    GrabPosition.FromBytes(bytes, i); i += 12;
-                    TimeSinceLast = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GrabOffsetInitial.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(GrabPosition.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)(TimeSinceLast % 256);
-                bytes[i++] = (byte)((TimeSinceLast >> 8) % 256);
-                bytes[i++] = (byte)((TimeSinceLast >> 16) % 256);
-                bytes[i++] = (byte)((TimeSinceLast >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("GrabOffsetInitial: {0}", GrabOffsetInitial));
-                output.AppendLine(String.Format("GrabPosition: {0}", GrabPosition));
-                output.Append(String.Format("TimeSinceLast: {0}", TimeSinceLast));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class SurfaceInfoBlock
-        {
-            public LLVector3 UVCoord;
-            public LLVector3 STCoord;
-            public int FaceIndex;
-            public LLVector3 Position;
-            public LLVector3 Normal;
-            public LLVector3 Binormal;
-
-            public int Length
-            {
-                get
-                {
-                    return 64;
-                }
-            }
-
-            public SurfaceInfoBlock() { }
-            public SurfaceInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    UVCoord.FromBytes(bytes, i); i += 12;
-                    STCoord.FromBytes(bytes, i); i += 12;
-                    FaceIndex = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Position.FromBytes(bytes, i); i += 12;
-                    Normal.FromBytes(bytes, i); i += 12;
-                    Binormal.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(UVCoord.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(STCoord.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)(FaceIndex % 256);
-                bytes[i++] = (byte)((FaceIndex >> 8) % 256);
-                bytes[i++] = (byte)((FaceIndex >> 16) % 256);
-                bytes[i++] = (byte)((FaceIndex >> 24) % 256);
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Normal.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Binormal.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SurfaceInfo --");
-                output.AppendLine(String.Format("UVCoord: {0}", UVCoord));
-                output.AppendLine(String.Format("STCoord: {0}", STCoord));
-                output.AppendLine(String.Format("FaceIndex: {0}", FaceIndex));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.AppendLine(String.Format("Normal: {0}", Normal));
-                output.Append(String.Format("Binormal: {0}", Binormal));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectGrabUpdate; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-        public SurfaceInfoBlock[] SurfaceInfo;
-
-        public ObjectGrabUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 118;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-            SurfaceInfo = new SurfaceInfoBlock[0];
-        }
-
-        public ObjectGrabUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-            //if (i <= (bytes.Length - 65))
-            //{
-            //    int count = (int)bytes[i++];
-            //    if (SurfaceInfo.Length < count)
-            //    {
-            //        SurfaceInfo = new SurfaceInfoBlock[count];
-            //        for (int j = 0; j < count; j++) SurfaceInfo[j] = new SurfaceInfoBlock();
-            //    }
-            //    for (int j = 0; j < count; j++)
-            //    { SurfaceInfo[j].FromBytes(bytes, ref i); }
-            //}
-        }
-
-        public ObjectGrabUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-            //if (i <= (bytes.Length - 65))
-            //{
-            //    int count = (int)bytes[i++];
-            //    if (SurfaceInfo.Length < count)
-            //    {
-            //        SurfaceInfo = new SurfaceInfoBlock[count];
-            //        for (int j = 0; j < count; j++) SurfaceInfo[j] = new SurfaceInfoBlock();
-            //    }
-            //    for (int j = 0; j < count; j++)
-            //    { SurfaceInfo[j].FromBytes(bytes, ref i); }
-            //}
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            length++;
-            for (int j = 0; j < SurfaceInfo.Length; j++) { length += SurfaceInfo[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)SurfaceInfo.Length;
-            for (int j = 0; j < SurfaceInfo.Length; j++) { SurfaceInfo[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectGrabUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            for (int j = 0; j < SurfaceInfo.Length; j++)
-            {
-                output += SurfaceInfo[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectDeGrabPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class SurfaceInfoBlock
-        {
-            public LLVector3 UVCoord;
-            public LLVector3 STCoord;
-            public int FaceIndex;
-            public LLVector3 Position;
-            public LLVector3 Normal;
-            public LLVector3 Binormal;
-
-            public int Length
-            {
-                get
-                {
-                    return 64;
-                }
-            }
-
-            public SurfaceInfoBlock() { }
-            public SurfaceInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    UVCoord.FromBytes(bytes, i); i += 12;
-                    STCoord.FromBytes(bytes, i); i += 12;
-                    FaceIndex = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Position.FromBytes(bytes, i); i += 12;
-                    Normal.FromBytes(bytes, i); i += 12;
-                    Binormal.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(UVCoord.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(STCoord.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)(FaceIndex % 256);
-                bytes[i++] = (byte)((FaceIndex >> 8) % 256);
-                bytes[i++] = (byte)((FaceIndex >> 16) % 256);
-                bytes[i++] = (byte)((FaceIndex >> 24) % 256);
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Normal.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Binormal.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SurfaceInfo --");
-                output.AppendLine(String.Format("UVCoord: {0}", UVCoord));
-                output.AppendLine(String.Format("STCoord: {0}", STCoord));
-                output.AppendLine(String.Format("FaceIndex: {0}", FaceIndex));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.AppendLine(String.Format("Normal: {0}", Normal));
-                output.Append(String.Format("Binormal: {0}", Binormal));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectDeGrab; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-        public SurfaceInfoBlock[] SurfaceInfo;
-
-        public ObjectDeGrabPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 119;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-            SurfaceInfo = new SurfaceInfoBlock[0];
-        }
-
-        public ObjectDeGrabPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-            //if (i <= (bytes.Length - 65))
-            //{
-            //    int count = (int)bytes[i++];
-            //    if (SurfaceInfo.Length < count)
-            //    {
-            //        SurfaceInfo = new SurfaceInfoBlock[count];
-            //        for (int j = 0; j < count; j++) SurfaceInfo[j] = new SurfaceInfoBlock();
-            //    }
-            //    for (int j = 0; j < count; j++)
-            //    { SurfaceInfo[j].FromBytes(bytes, ref i); }
-            //}
-        }
-
-        public ObjectDeGrabPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-            //if (i <= (bytes.Length - 65))
-            //{
-            //    int count = (int)bytes[i++];
-            //    if (SurfaceInfo.Length < count)
-            //    {
-            //        SurfaceInfo = new SurfaceInfoBlock[count];
-            //        for (int j = 0; j < count; j++) SurfaceInfo[j] = new SurfaceInfoBlock();
-            //    }
-            //    for (int j = 0; j < count; j++)
-            //    { SurfaceInfo[j].FromBytes(bytes, ref i); }
-            //}
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            length++;
-            for (int j = 0; j < SurfaceInfo.Length; j++) { length += SurfaceInfo[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)SurfaceInfo.Length;
-            for (int j = 0; j < SurfaceInfo.Length; j++) { SurfaceInfo[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectDeGrab ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            for (int j = 0; j < SurfaceInfo.Length; j++)
-            {
-                output += SurfaceInfo[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectSpinStartPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectSpinStart; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-
-        public ObjectSpinStartPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 120;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public ObjectSpinStartPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public ObjectSpinStartPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectSpinStart ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectSpinUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-            public LLQuaternion Rotation;
-
-            public int Length
-            {
-                get
-                {
-                    return 28;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    Rotation.FromBytes(bytes, i, true); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.Append(String.Format("Rotation: {0}", Rotation));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectSpinUpdate; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-
-        public ObjectSpinUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 121;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public ObjectSpinUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public ObjectSpinUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectSpinUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectSpinStopPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectSpinStop; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-
-        public ObjectSpinStopPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 122;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public ObjectSpinStopPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public ObjectSpinStopPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectSpinStop ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectExportSelectedPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID RequestID;
-            public short VolumeDetail;
-
-            public int Length
-            {
-                get
-                {
-                    return 34;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    VolumeDetail = (short)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(VolumeDetail % 256);
-                bytes[i++] = (byte)((VolumeDetail >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.Append(String.Format("VolumeDetail: {0}", VolumeDetail));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectExportSelected; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectExportSelectedPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 123;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectExportSelectedPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectExportSelectedPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectExportSelected ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ModifyLandPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ModifyBlockBlock
-        {
-            public byte Action;
-            public byte BrushSize;
-            public float Seconds;
-            public float Height;
-
-            public int Length
-            {
-                get
-                {
-                    return 10;
-                }
-            }
-
-            public ModifyBlockBlock() { }
-            public ModifyBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Action = (byte)bytes[i++];
-                    BrushSize = (byte)bytes[i++];
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Seconds = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Height = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = Action;
-                bytes[i++] = BrushSize;
-                ba = BitConverter.GetBytes(Seconds);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(Height);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ModifyBlock --");
-                output.AppendLine(String.Format("Action: {0}", Action));
-                output.AppendLine(String.Format("BrushSize: {0}", BrushSize));
-                output.AppendLine(String.Format("Seconds: {0}", Seconds));
-                output.Append(String.Format("Height: {0}", Height));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-            public float West;
-            public float South;
-            public float East;
-            public float North;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    West = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    South = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    East = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    North = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                ba = BitConverter.GetBytes(West);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(South);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(East);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(North);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.AppendLine(String.Format("West: {0}", West));
-                output.AppendLine(String.Format("South: {0}", South));
-                output.AppendLine(String.Format("East: {0}", East));
-                output.Append(String.Format("North: {0}", North));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ModifyLand; } }
-        public AgentDataBlock AgentData;
-        public ModifyBlockBlock ModifyBlock;
-        public ParcelDataBlock[] ParcelData;
-
-        public ModifyLandPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 124;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ModifyBlock = new ModifyBlockBlock();
-            ParcelData = new ParcelDataBlock[0];
-        }
-
-        public ModifyLandPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ModifyBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParcelData.Length < count) {
-                ParcelData = new ParcelDataBlock[count];
-                for(int j = 0; j < count; j++) ParcelData[j] = new ParcelDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParcelData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ModifyLandPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ModifyBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParcelData.Length < count) {
-                ParcelData = new ParcelDataBlock[count];
-                for(int j = 0; j < count; j++) ParcelData[j] = new ParcelDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParcelData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ModifyBlock.Length;;
-            length++;
-            for (int j = 0; j < ParcelData.Length; j++) { length += ParcelData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ModifyBlock.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ParcelData.Length;
-            for (int j = 0; j < ParcelData.Length; j++) { ParcelData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ModifyLand ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ModifyBlock.ToString() + Environment.NewLine;
-            for (int j = 0; j < ParcelData.Length; j++)
-            {
-                output += ParcelData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class VelocityInterpolateOnPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.VelocityInterpolateOn; } }
-        public AgentDataBlock AgentData;
-
-        public VelocityInterpolateOnPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 125;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public VelocityInterpolateOnPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public VelocityInterpolateOnPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- VelocityInterpolateOn ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class VelocityInterpolateOffPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.VelocityInterpolateOff; } }
-        public AgentDataBlock AgentData;
-
-        public VelocityInterpolateOffPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 126;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public VelocityInterpolateOffPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public VelocityInterpolateOffPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- VelocityInterpolateOff ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class StateSavePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlockBlock
-        {
-            private byte[] _filename;
-            public byte[] Filename
-            {
-                get { return _filename; }
-                set
-                {
-                    if (value == null) { _filename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _filename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _filename, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Filename != null) { length += 1 + Filename.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlockBlock() { }
-            public DataBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _filename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _filename, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Filename == null) { Console.WriteLine("Warning: Filename is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Filename.Length;
-                Buffer.BlockCopy(Filename, 0, bytes, i, Filename.Length); i += Filename.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlock --");
-                Helpers.FieldToString(output, Filename, "Filename");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.StateSave; } }
-        public AgentDataBlock AgentData;
-        public DataBlockBlock DataBlock;
-
-        public StateSavePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 127;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            DataBlock = new DataBlockBlock();
-        }
-
-        public StateSavePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public StateSavePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += DataBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            DataBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- StateSave ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += DataBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ReportAutosaveCrashPacket : Packet
-    {
-        /// <exclude/>
-        public class AutosaveDataBlock
-        {
-            public int PID;
-            public int Status;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public AutosaveDataBlock() { }
-            public AutosaveDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Status = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(PID % 256);
-                bytes[i++] = (byte)((PID >> 8) % 256);
-                bytes[i++] = (byte)((PID >> 16) % 256);
-                bytes[i++] = (byte)((PID >> 24) % 256);
-                bytes[i++] = (byte)(Status % 256);
-                bytes[i++] = (byte)((Status >> 8) % 256);
-                bytes[i++] = (byte)((Status >> 16) % 256);
-                bytes[i++] = (byte)((Status >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AutosaveData --");
-                output.AppendLine(String.Format("PID: {0}", PID));
-                output.Append(String.Format("Status: {0}", Status));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ReportAutosaveCrash; } }
-        public AutosaveDataBlock AutosaveData;
-
-        public ReportAutosaveCrashPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 128;
-            Header.Reliable = true;
-            AutosaveData = new AutosaveDataBlock();
-        }
-
-        public ReportAutosaveCrashPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AutosaveData.FromBytes(bytes, ref i);
-        }
-
-        public ReportAutosaveCrashPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AutosaveData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AutosaveData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AutosaveData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ReportAutosaveCrash ---" + Environment.NewLine;
-                output += AutosaveData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SimWideDeletesPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlockBlock
-        {
-            public LLUUID TargetID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlockBlock() { }
-            public DataBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TargetID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlock --");
-                output.AppendLine(String.Format("TargetID: {0}", TargetID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SimWideDeletes; } }
-        public AgentDataBlock AgentData;
-        public DataBlockBlock DataBlock;
-
-        public SimWideDeletesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 129;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            DataBlock = new DataBlockBlock();
-        }
-
-        public SimWideDeletesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public SimWideDeletesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += DataBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            DataBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SimWideDeletes ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += DataBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TrackAgentPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TargetDataBlock
-        {
-            public LLUUID PreyID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TargetDataBlock() { }
-            public TargetDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PreyID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(PreyID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TargetData --");
-                output.Append(String.Format("PreyID: {0}", PreyID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TrackAgent; } }
-        public AgentDataBlock AgentData;
-        public TargetDataBlock TargetData;
-
-        public TrackAgentPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 130;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            TargetData = new TargetDataBlock();
-        }
-
-        public TrackAgentPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TargetData.FromBytes(bytes, ref i);
-        }
-
-        public TrackAgentPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TargetData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TargetData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TargetData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TrackAgent ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TargetData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ViewerStatsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint IP;
-            public uint StartTime;
-            public float RunTime;
-            public float SimFPS;
-            public float FPS;
-            public byte AgentsInView;
-            public float Ping;
-            public double MetersTraveled;
-            public int RegionsVisited;
-            public uint SysRAM;
-            private byte[] _sysos;
-            public byte[] SysOS
-            {
-                get { return _sysos; }
-                set
-                {
-                    if (value == null) { _sysos = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _sysos = new byte[value.Length]; Buffer.BlockCopy(value, 0, _sysos, 0, value.Length); }
-                }
-            }
-            private byte[] _syscpu;
-            public byte[] SysCPU
-            {
-                get { return _syscpu; }
-                set
-                {
-                    if (value == null) { _syscpu = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _syscpu = new byte[value.Length]; Buffer.BlockCopy(value, 0, _syscpu, 0, value.Length); }
-                }
-            }
-            private byte[] _sysgpu;
-            public byte[] SysGPU
-            {
-                get { return _sysgpu; }
-                set
-                {
-                    if (value == null) { _sysgpu = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _sysgpu = new byte[value.Length]; Buffer.BlockCopy(value, 0, _sysgpu, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 73;
-                    if (SysOS != null) { length += 1 + SysOS.Length; }
-                    if (SysCPU != null) { length += 1 + SysCPU.Length; }
-                    if (SysGPU != null) { length += 1 + SysGPU.Length; }
-                    return length;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    IP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    StartTime = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    RunTime = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    SimFPS = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    FPS = BitConverter.ToSingle(bytes, i); i += 4;
-                    AgentsInView = (byte)bytes[i++];
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Ping = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 8);
-                    MetersTraveled = BitConverter.ToDouble(bytes, i); i += 8;
-                    RegionsVisited = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SysRAM = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _sysos = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _sysos, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _syscpu = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _syscpu, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _sysgpu = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _sysgpu, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(IP % 256);
-                bytes[i++] = (byte)((IP >> 8) % 256);
-                bytes[i++] = (byte)((IP >> 16) % 256);
-                bytes[i++] = (byte)((IP >> 24) % 256);
-                bytes[i++] = (byte)(StartTime % 256);
-                bytes[i++] = (byte)((StartTime >> 8) % 256);
-                bytes[i++] = (byte)((StartTime >> 16) % 256);
-                bytes[i++] = (byte)((StartTime >> 24) % 256);
-                ba = BitConverter.GetBytes(RunTime);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(SimFPS);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(FPS);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = AgentsInView;
-                ba = BitConverter.GetBytes(Ping);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(MetersTraveled);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 8); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 8); i += 8;
-                bytes[i++] = (byte)(RegionsVisited % 256);
-                bytes[i++] = (byte)((RegionsVisited >> 8) % 256);
-                bytes[i++] = (byte)((RegionsVisited >> 16) % 256);
-                bytes[i++] = (byte)((RegionsVisited >> 24) % 256);
-                bytes[i++] = (byte)(SysRAM % 256);
-                bytes[i++] = (byte)((SysRAM >> 8) % 256);
-                bytes[i++] = (byte)((SysRAM >> 16) % 256);
-                bytes[i++] = (byte)((SysRAM >> 24) % 256);
-                if(SysOS == null) { Console.WriteLine("Warning: SysOS is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SysOS.Length;
-                Buffer.BlockCopy(SysOS, 0, bytes, i, SysOS.Length); i += SysOS.Length;
-                if(SysCPU == null) { Console.WriteLine("Warning: SysCPU is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SysCPU.Length;
-                Buffer.BlockCopy(SysCPU, 0, bytes, i, SysCPU.Length); i += SysCPU.Length;
-                if(SysGPU == null) { Console.WriteLine("Warning: SysGPU is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SysGPU.Length;
-                Buffer.BlockCopy(SysGPU, 0, bytes, i, SysGPU.Length); i += SysGPU.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("IP: {0}", IP));
-                output.AppendLine(String.Format("StartTime: {0}", StartTime));
-                output.AppendLine(String.Format("RunTime: {0}", RunTime));
-                output.AppendLine(String.Format("SimFPS: {0}", SimFPS));
-                output.AppendLine(String.Format("FPS: {0}", FPS));
-                output.AppendLine(String.Format("AgentsInView: {0}", AgentsInView));
-                output.AppendLine(String.Format("Ping: {0}", Ping));
-                output.AppendLine(String.Format("MetersTraveled: {0}", MetersTraveled));
-                output.AppendLine(String.Format("RegionsVisited: {0}", RegionsVisited));
-                output.AppendLine(String.Format("SysRAM: {0}", SysRAM));
-                Helpers.FieldToString(output, SysOS, "SysOS");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, SysCPU, "SysCPU");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, SysGPU, "SysGPU");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DownloadTotalsBlock
-        {
-            public uint World;
-            public uint Objects;
-            public uint Textures;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public DownloadTotalsBlock() { }
-            public DownloadTotalsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    World = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Objects = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Textures = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(World % 256);
-                bytes[i++] = (byte)((World >> 8) % 256);
-                bytes[i++] = (byte)((World >> 16) % 256);
-                bytes[i++] = (byte)((World >> 24) % 256);
-                bytes[i++] = (byte)(Objects % 256);
-                bytes[i++] = (byte)((Objects >> 8) % 256);
-                bytes[i++] = (byte)((Objects >> 16) % 256);
-                bytes[i++] = (byte)((Objects >> 24) % 256);
-                bytes[i++] = (byte)(Textures % 256);
-                bytes[i++] = (byte)((Textures >> 8) % 256);
-                bytes[i++] = (byte)((Textures >> 16) % 256);
-                bytes[i++] = (byte)((Textures >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DownloadTotals --");
-                output.AppendLine(String.Format("World: {0}", World));
-                output.AppendLine(String.Format("Objects: {0}", Objects));
-                output.Append(String.Format("Textures: {0}", Textures));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class NetStatsBlock
-        {
-            public uint Bytes;
-            public uint Packets;
-            public uint Compressed;
-            public uint Savings;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public NetStatsBlock() { }
-            public NetStatsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Bytes = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Packets = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Compressed = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Savings = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Bytes % 256);
-                bytes[i++] = (byte)((Bytes >> 8) % 256);
-                bytes[i++] = (byte)((Bytes >> 16) % 256);
-                bytes[i++] = (byte)((Bytes >> 24) % 256);
-                bytes[i++] = (byte)(Packets % 256);
-                bytes[i++] = (byte)((Packets >> 8) % 256);
-                bytes[i++] = (byte)((Packets >> 16) % 256);
-                bytes[i++] = (byte)((Packets >> 24) % 256);
-                bytes[i++] = (byte)(Compressed % 256);
-                bytes[i++] = (byte)((Compressed >> 8) % 256);
-                bytes[i++] = (byte)((Compressed >> 16) % 256);
-                bytes[i++] = (byte)((Compressed >> 24) % 256);
-                bytes[i++] = (byte)(Savings % 256);
-                bytes[i++] = (byte)((Savings >> 8) % 256);
-                bytes[i++] = (byte)((Savings >> 16) % 256);
-                bytes[i++] = (byte)((Savings >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- NetStats --");
-                output.AppendLine(String.Format("Bytes: {0}", Bytes));
-                output.AppendLine(String.Format("Packets: {0}", Packets));
-                output.AppendLine(String.Format("Compressed: {0}", Compressed));
-                output.Append(String.Format("Savings: {0}", Savings));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FailStatsBlock
-        {
-            public uint SendPacket;
-            public uint Dropped;
-            public uint Resent;
-            public uint FailedResends;
-            public uint OffCircuit;
-            public uint Invalid;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public FailStatsBlock() { }
-            public FailStatsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SendPacket = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Dropped = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Resent = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    FailedResends = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OffCircuit = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Invalid = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(SendPacket % 256);
-                bytes[i++] = (byte)((SendPacket >> 8) % 256);
-                bytes[i++] = (byte)((SendPacket >> 16) % 256);
-                bytes[i++] = (byte)((SendPacket >> 24) % 256);
-                bytes[i++] = (byte)(Dropped % 256);
-                bytes[i++] = (byte)((Dropped >> 8) % 256);
-                bytes[i++] = (byte)((Dropped >> 16) % 256);
-                bytes[i++] = (byte)((Dropped >> 24) % 256);
-                bytes[i++] = (byte)(Resent % 256);
-                bytes[i++] = (byte)((Resent >> 8) % 256);
-                bytes[i++] = (byte)((Resent >> 16) % 256);
-                bytes[i++] = (byte)((Resent >> 24) % 256);
-                bytes[i++] = (byte)(FailedResends % 256);
-                bytes[i++] = (byte)((FailedResends >> 8) % 256);
-                bytes[i++] = (byte)((FailedResends >> 16) % 256);
-                bytes[i++] = (byte)((FailedResends >> 24) % 256);
-                bytes[i++] = (byte)(OffCircuit % 256);
-                bytes[i++] = (byte)((OffCircuit >> 8) % 256);
-                bytes[i++] = (byte)((OffCircuit >> 16) % 256);
-                bytes[i++] = (byte)((OffCircuit >> 24) % 256);
-                bytes[i++] = (byte)(Invalid % 256);
-                bytes[i++] = (byte)((Invalid >> 8) % 256);
-                bytes[i++] = (byte)((Invalid >> 16) % 256);
-                bytes[i++] = (byte)((Invalid >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FailStats --");
-                output.AppendLine(String.Format("SendPacket: {0}", SendPacket));
-                output.AppendLine(String.Format("Dropped: {0}", Dropped));
-                output.AppendLine(String.Format("Resent: {0}", Resent));
-                output.AppendLine(String.Format("FailedResends: {0}", FailedResends));
-                output.AppendLine(String.Format("OffCircuit: {0}", OffCircuit));
-                output.Append(String.Format("Invalid: {0}", Invalid));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MiscStatsBlock
-        {
-            public uint Type;
-            public double Value;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public MiscStatsBlock() { }
-            public MiscStatsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Type = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 8);
-                    Value = BitConverter.ToDouble(bytes, i); i += 8;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(Type % 256);
-                bytes[i++] = (byte)((Type >> 8) % 256);
-                bytes[i++] = (byte)((Type >> 16) % 256);
-                bytes[i++] = (byte)((Type >> 24) % 256);
-                ba = BitConverter.GetBytes(Value);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 8); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 8); i += 8;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MiscStats --");
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.Append(String.Format("Value: {0}", Value));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ViewerStats; } }
-        public AgentDataBlock AgentData;
-        public DownloadTotalsBlock DownloadTotals;
-        public NetStatsBlock[] NetStats;
-        public FailStatsBlock FailStats;
-        public MiscStatsBlock[] MiscStats;
-
-        public ViewerStatsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 131;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            DownloadTotals = new DownloadTotalsBlock();
-            NetStats = new NetStatsBlock[2];
-            FailStats = new FailStatsBlock();
-            MiscStats = new MiscStatsBlock[0];
-        }
-
-        public ViewerStatsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            DownloadTotals.FromBytes(bytes, ref i);
-            if(NetStats.Length < 2) {
-                NetStats = new NetStatsBlock[2];
-                for(int j = 0; j < 2; j++) NetStats[j] = new NetStatsBlock();
-            }
-            for (int j = 0; j < 2; j++)
-            { NetStats[j].FromBytes(bytes, ref i); }
-            FailStats.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(MiscStats.Length < count) {
-                MiscStats = new MiscStatsBlock[count];
-                for(int j = 0; j < count; j++) MiscStats[j] = new MiscStatsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { MiscStats[j].FromBytes(bytes, ref i); }
-        }
-
-        public ViewerStatsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            DownloadTotals.FromBytes(bytes, ref i);
-            if(NetStats.Length < 2) {
-                NetStats = new NetStatsBlock[2];
-                for(int j = 0; j < 2; j++) NetStats[j] = new NetStatsBlock();
-            }
-            for (int j = 0; j < 2; j++)
-            { NetStats[j].FromBytes(bytes, ref i); }
-            FailStats.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(MiscStats.Length < count) {
-                MiscStats = new MiscStatsBlock[count];
-                for(int j = 0; j < count; j++) MiscStats[j] = new MiscStatsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { MiscStats[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += DownloadTotals.Length;            length += FailStats.Length;;
-            for (int j = 0; j < 2; j++) { length += NetStats[j].Length; }
-            length++;
-            for (int j = 0; j < MiscStats.Length; j++) { length += MiscStats[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            DownloadTotals.ToBytes(bytes, ref i);
-            for (int j = 0; j < 2; j++) { NetStats[j].ToBytes(bytes, ref i); }
-            FailStats.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)MiscStats.Length;
-            for (int j = 0; j < MiscStats.Length; j++) { MiscStats[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ViewerStats ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += DownloadTotals.ToString() + Environment.NewLine;
-            for (int j = 0; j < 2; j++)
-            {
-                output += NetStats[j].ToString() + Environment.NewLine;
-            }
-                output += FailStats.ToString() + Environment.NewLine;
-            for (int j = 0; j < MiscStats.Length; j++)
-            {
-                output += MiscStats[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptAnswerYesPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID TaskID;
-            public LLUUID ItemID;
-            public int Questions;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TaskID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    Questions = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Questions % 256);
-                bytes[i++] = (byte)((Questions >> 8) % 256);
-                bytes[i++] = (byte)((Questions >> 16) % 256);
-                bytes[i++] = (byte)((Questions >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("TaskID: {0}", TaskID));
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("Questions: {0}", Questions));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptAnswerYes; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ScriptAnswerYesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 132;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ScriptAnswerYesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ScriptAnswerYesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptAnswerYes ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UserReportPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ReportDataBlock
-        {
-            public byte ReportType;
-            public byte Category;
-            public LLVector3 Position;
-            public byte CheckFlags;
-            public LLUUID ScreenshotID;
-            public LLUUID ObjectID;
-            public LLUUID AbuserID;
-            private byte[] _abuseregionname;
-            public byte[] AbuseRegionName
-            {
-                get { return _abuseregionname; }
-                set
-                {
-                    if (value == null) { _abuseregionname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _abuseregionname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _abuseregionname, 0, value.Length); }
-                }
-            }
-            public LLUUID AbuseRegionID;
-            private byte[] _summary;
-            public byte[] Summary
-            {
-                get { return _summary; }
-                set
-                {
-                    if (value == null) { _summary = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _summary = new byte[value.Length]; Buffer.BlockCopy(value, 0, _summary, 0, value.Length); }
-                }
-            }
-            private byte[] _details;
-            public byte[] Details
-            {
-                get { return _details; }
-                set
-                {
-                    if (value == null) { _details = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _details = new byte[value.Length]; Buffer.BlockCopy(value, 0, _details, 0, value.Length); }
-                }
-            }
-            private byte[] _versionstring;
-            public byte[] VersionString
-            {
-                get { return _versionstring; }
-                set
-                {
-                    if (value == null) { _versionstring = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _versionstring = new byte[value.Length]; Buffer.BlockCopy(value, 0, _versionstring, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 79;
-                    if (AbuseRegionName != null) { length += 1 + AbuseRegionName.Length; }
-                    if (Summary != null) { length += 1 + Summary.Length; }
-                    if (Details != null) { length += 2 + Details.Length; }
-                    if (VersionString != null) { length += 1 + VersionString.Length; }
-                    return length;
-                }
-            }
-
-            public ReportDataBlock() { }
-            public ReportDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ReportType = (byte)bytes[i++];
-                    Category = (byte)bytes[i++];
-                    Position.FromBytes(bytes, i); i += 12;
-                    CheckFlags = (byte)bytes[i++];
-                    ScreenshotID.FromBytes(bytes, i); i += 16;
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    AbuserID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _abuseregionname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _abuseregionname, 0, length); i += length;
-                    AbuseRegionID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _summary = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _summary, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _details = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _details, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _versionstring = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _versionstring, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = ReportType;
-                bytes[i++] = Category;
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = CheckFlags;
-                Buffer.BlockCopy(ScreenshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AbuserID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(AbuseRegionName == null) { Console.WriteLine("Warning: AbuseRegionName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)AbuseRegionName.Length;
-                Buffer.BlockCopy(AbuseRegionName, 0, bytes, i, AbuseRegionName.Length); i += AbuseRegionName.Length;
-                Buffer.BlockCopy(AbuseRegionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Summary == null) { Console.WriteLine("Warning: Summary is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Summary.Length;
-                Buffer.BlockCopy(Summary, 0, bytes, i, Summary.Length); i += Summary.Length;
-                if(Details == null) { Console.WriteLine("Warning: Details is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Details.Length % 256);
-                bytes[i++] = (byte)((Details.Length >> 8) % 256);
-                Buffer.BlockCopy(Details, 0, bytes, i, Details.Length); i += Details.Length;
-                if(VersionString == null) { Console.WriteLine("Warning: VersionString is null, in " + this.GetType()); }
-                bytes[i++] = (byte)VersionString.Length;
-                Buffer.BlockCopy(VersionString, 0, bytes, i, VersionString.Length); i += VersionString.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ReportData --");
-                output.AppendLine(String.Format("ReportType: {0}", ReportType));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.AppendLine(String.Format("CheckFlags: {0}", CheckFlags));
-                output.AppendLine(String.Format("ScreenshotID: {0}", ScreenshotID));
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("AbuserID: {0}", AbuserID));
-                Helpers.FieldToString(output, AbuseRegionName, "AbuseRegionName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("AbuseRegionID: {0}", AbuseRegionID));
-                Helpers.FieldToString(output, Summary, "Summary");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Details, "Details");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, VersionString, "VersionString");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UserReport; } }
-        public AgentDataBlock AgentData;
-        public ReportDataBlock ReportData;
-
-        public UserReportPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 133;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ReportData = new ReportDataBlock();
-        }
-
-        public UserReportPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ReportData.FromBytes(bytes, ref i);
-        }
-
-        public UserReportPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ReportData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ReportData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ReportData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UserReport ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ReportData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AlertMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class AlertDataBlock
-        {
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Message != null) { length += 1 + Message.Length; }
-                    return length;
-                }
-            }
-
-            public AlertDataBlock() { }
-            public AlertDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Message.Length;
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AlertData --");
-                Helpers.FieldToString(output, Message, "Message");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AlertMessage; } }
-        public AlertDataBlock AlertData;
-
-        public AlertMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 134;
-            Header.Reliable = true;
-            AlertData = new AlertDataBlock();
-        }
-
-        public AlertMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AlertData.FromBytes(bytes, ref i);
-        }
-
-        public AlertMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AlertData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AlertData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AlertData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AlertMessage ---" + Environment.NewLine;
-                output += AlertData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentAlertMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AlertDataBlock
-        {
-            public bool Modal;
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 1;
-                    if (Message != null) { length += 1 + Message.Length; }
-                    return length;
-                }
-            }
-
-            public AlertDataBlock() { }
-            public AlertDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    Modal = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((Modal) ? 1 : 0);
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Message.Length;
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AlertData --");
-                output.AppendLine(String.Format("Modal: {0}", Modal));
-                Helpers.FieldToString(output, Message, "Message");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentAlertMessage; } }
-        public AgentDataBlock AgentData;
-        public AlertDataBlock AlertData;
-
-        public AgentAlertMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 135;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            AlertData = new AlertDataBlock();
-        }
-
-        public AgentAlertMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            AlertData.FromBytes(bytes, ref i);
-        }
-
-        public AgentAlertMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            AlertData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += AlertData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            AlertData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentAlertMessage ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += AlertData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MeanCollisionAlertPacket : Packet
-    {
-        /// <exclude/>
-        public class MeanCollisionBlock
-        {
-            public LLUUID Victim;
-            public LLUUID Perp;
-            public uint Time;
-            public float Mag;
-            public byte Type;
-
-            public int Length
-            {
-                get
-                {
-                    return 41;
-                }
-            }
-
-            public MeanCollisionBlock() { }
-            public MeanCollisionBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Victim.FromBytes(bytes, i); i += 16;
-                    Perp.FromBytes(bytes, i); i += 16;
-                    Time = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Mag = BitConverter.ToSingle(bytes, i); i += 4;
-                    Type = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(Victim.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(Perp.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Time % 256);
-                bytes[i++] = (byte)((Time >> 8) % 256);
-                bytes[i++] = (byte)((Time >> 16) % 256);
-                bytes[i++] = (byte)((Time >> 24) % 256);
-                ba = BitConverter.GetBytes(Mag);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = Type;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MeanCollision --");
-                output.AppendLine(String.Format("Victim: {0}", Victim));
-                output.AppendLine(String.Format("Perp: {0}", Perp));
-                output.AppendLine(String.Format("Time: {0}", Time));
-                output.AppendLine(String.Format("Mag: {0}", Mag));
-                output.Append(String.Format("Type: {0}", Type));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MeanCollisionAlert; } }
-        public MeanCollisionBlock[] MeanCollision;
-
-        public MeanCollisionAlertPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 136;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            MeanCollision = new MeanCollisionBlock[0];
-        }
-
-        public MeanCollisionAlertPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(MeanCollision.Length < count) {
-                MeanCollision = new MeanCollisionBlock[count];
-                for(int j = 0; j < count; j++) MeanCollision[j] = new MeanCollisionBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { MeanCollision[j].FromBytes(bytes, ref i); }
-        }
-
-        public MeanCollisionAlertPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(MeanCollision.Length < count) {
-                MeanCollision = new MeanCollisionBlock[count];
-                for(int j = 0; j < count; j++) MeanCollision[j] = new MeanCollisionBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { MeanCollision[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < MeanCollision.Length; j++) { length += MeanCollision[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)MeanCollision.Length;
-            for (int j = 0; j < MeanCollision.Length; j++) { MeanCollision[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MeanCollisionAlert ---" + Environment.NewLine;
-            for (int j = 0; j < MeanCollision.Length; j++)
-            {
-                output += MeanCollision[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ViewerFrozenMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class FrozenDataBlock
-        {
-            public bool Data;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public FrozenDataBlock() { }
-            public FrozenDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Data = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((Data) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FrozenData --");
-                output.Append(String.Format("Data: {0}", Data));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ViewerFrozenMessage; } }
-        public FrozenDataBlock FrozenData;
-
-        public ViewerFrozenMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 137;
-            Header.Reliable = true;
-            FrozenData = new FrozenDataBlock();
-        }
-
-        public ViewerFrozenMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            FrozenData.FromBytes(bytes, ref i);
-        }
-
-        public ViewerFrozenMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            FrozenData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += FrozenData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            FrozenData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ViewerFrozenMessage ---" + Environment.NewLine;
-                output += FrozenData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class HealthMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class HealthDataBlock
-        {
-            public float Health;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public HealthDataBlock() { }
-            public HealthDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Health = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                ba = BitConverter.GetBytes(Health);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HealthData --");
-                output.Append(String.Format("Health: {0}", Health));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.HealthMessage; } }
-        public HealthDataBlock HealthData;
-
-        public HealthMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 138;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            HealthData = new HealthDataBlock();
-        }
-
-        public HealthMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            HealthData.FromBytes(bytes, ref i);
-        }
-
-        public HealthMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            HealthData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += HealthData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            HealthData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- HealthMessage ---" + Environment.NewLine;
-                output += HealthData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChatFromSimulatorPacket : Packet
-    {
-        /// <exclude/>
-        public class ChatDataBlock
-        {
-            private byte[] _fromname;
-            public byte[] FromName
-            {
-                get { return _fromname; }
-                set
-                {
-                    if (value == null) { _fromname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _fromname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _fromname, 0, value.Length); }
-                }
-            }
-            public LLUUID SourceID;
-            public LLUUID OwnerID;
-            public byte SourceType;
-            public byte ChatType;
-            public byte Audible;
-            public LLVector3 Position;
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 47;
-                    if (FromName != null) { length += 1 + FromName.Length; }
-                    if (Message != null) { length += 2 + Message.Length; }
-                    return length;
-                }
-            }
-
-            public ChatDataBlock() { }
-            public ChatDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _fromname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _fromname, 0, length); i += length;
-                    SourceID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    SourceType = (byte)bytes[i++];
-                    ChatType = (byte)bytes[i++];
-                    Audible = (byte)bytes[i++];
-                    Position.FromBytes(bytes, i); i += 12;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(FromName == null) { Console.WriteLine("Warning: FromName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FromName.Length;
-                Buffer.BlockCopy(FromName, 0, bytes, i, FromName.Length); i += FromName.Length;
-                Buffer.BlockCopy(SourceID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = SourceType;
-                bytes[i++] = ChatType;
-                bytes[i++] = Audible;
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Message.Length % 256);
-                bytes[i++] = (byte)((Message.Length >> 8) % 256);
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ChatData --");
-                Helpers.FieldToString(output, FromName, "FromName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SourceID: {0}", SourceID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("SourceType: {0}", SourceType));
-                output.AppendLine(String.Format("ChatType: {0}", ChatType));
-                output.AppendLine(String.Format("Audible: {0}", Audible));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                Helpers.FieldToString(output, Message, "Message");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChatFromSimulator; } }
-        public ChatDataBlock ChatData;
-
-        public ChatFromSimulatorPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 139;
-            Header.Reliable = true;
-            ChatData = new ChatDataBlock();
-        }
-
-        public ChatFromSimulatorPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ChatData.FromBytes(bytes, ref i);
-        }
-
-        public ChatFromSimulatorPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ChatData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ChatData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ChatData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChatFromSimulator ---" + Environment.NewLine;
-                output += ChatData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SimStatsPacket : Packet
-    {
-        /// <exclude/>
-        public class RegionBlock
-        {
-            public uint RegionX;
-            public uint RegionY;
-            public uint RegionFlags;
-            public uint ObjectCapacity;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public RegionBlock() { }
-            public RegionBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionX = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RegionY = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RegionFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ObjectCapacity = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionX % 256);
-                bytes[i++] = (byte)((RegionX >> 8) % 256);
-                bytes[i++] = (byte)((RegionX >> 16) % 256);
-                bytes[i++] = (byte)((RegionX >> 24) % 256);
-                bytes[i++] = (byte)(RegionY % 256);
-                bytes[i++] = (byte)((RegionY >> 8) % 256);
-                bytes[i++] = (byte)((RegionY >> 16) % 256);
-                bytes[i++] = (byte)((RegionY >> 24) % 256);
-                bytes[i++] = (byte)(RegionFlags % 256);
-                bytes[i++] = (byte)((RegionFlags >> 8) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 16) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 24) % 256);
-                bytes[i++] = (byte)(ObjectCapacity % 256);
-                bytes[i++] = (byte)((ObjectCapacity >> 8) % 256);
-                bytes[i++] = (byte)((ObjectCapacity >> 16) % 256);
-                bytes[i++] = (byte)((ObjectCapacity >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Region --");
-                output.AppendLine(String.Format("RegionX: {0}", RegionX));
-                output.AppendLine(String.Format("RegionY: {0}", RegionY));
-                output.AppendLine(String.Format("RegionFlags: {0}", RegionFlags));
-                output.Append(String.Format("ObjectCapacity: {0}", ObjectCapacity));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class StatBlock
-        {
-            public uint StatID;
-            public float StatValue;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public StatBlock() { }
-            public StatBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    StatID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    StatValue = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(StatID % 256);
-                bytes[i++] = (byte)((StatID >> 8) % 256);
-                bytes[i++] = (byte)((StatID >> 16) % 256);
-                bytes[i++] = (byte)((StatID >> 24) % 256);
-                ba = BitConverter.GetBytes(StatValue);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Stat --");
-                output.AppendLine(String.Format("StatID: {0}", StatID));
-                output.Append(String.Format("StatValue: {0}", StatValue));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class PidStatBlock
-        {
-            public int PID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public PidStatBlock() { }
-            public PidStatBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(PID % 256);
-                bytes[i++] = (byte)((PID >> 8) % 256);
-                bytes[i++] = (byte)((PID >> 16) % 256);
-                bytes[i++] = (byte)((PID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PidStat --");
-                output.Append(String.Format("PID: {0}", PID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SimStats; } }
-        public RegionBlock Region;
-        public StatBlock[] Stat;
-        public PidStatBlock PidStat;
-
-        public SimStatsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 140;
-            Header.Reliable = true;
-            Region = new RegionBlock();
-            Stat = new StatBlock[0];
-            PidStat = new PidStatBlock();
-        }
-
-        public SimStatsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Region.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Stat.Length < count) {
-                Stat = new StatBlock[count];
-                for(int j = 0; j < count; j++) Stat[j] = new StatBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Stat[j].FromBytes(bytes, ref i); }
-            PidStat.FromBytes(bytes, ref i);
-        }
-
-        public SimStatsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Region.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Stat.Length < count) {
-                Stat = new StatBlock[count];
-                for(int j = 0; j < count; j++) Stat[j] = new StatBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Stat[j].FromBytes(bytes, ref i); }
-            PidStat.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Region.Length;            length += PidStat.Length;;
-            length++;
-            for (int j = 0; j < Stat.Length; j++) { length += Stat[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Region.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Stat.Length;
-            for (int j = 0; j < Stat.Length; j++) { Stat[j].ToBytes(bytes, ref i); }
-            PidStat.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SimStats ---" + Environment.NewLine;
-                output += Region.ToString() + Environment.NewLine;
-            for (int j = 0; j < Stat.Length; j++)
-            {
-                output += Stat[j].ToString() + Environment.NewLine;
-            }
-                output += PidStat.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestRegionInfoPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestRegionInfo; } }
-        public AgentDataBlock AgentData;
-
-        public RequestRegionInfoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 141;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public RequestRegionInfoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public RequestRegionInfoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestRegionInfo ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RegionInfoPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RegionInfoBlock
-        {
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public uint EstateID;
-            public uint ParentEstateID;
-            public uint RegionFlags;
-            public byte SimAccess;
-            public byte MaxAgents;
-            public float BillableFactor;
-            public float ObjectBonusFactor;
-            public float WaterHeight;
-            public float TerrainRaiseLimit;
-            public float TerrainLowerLimit;
-            public int PricePerMeter;
-            public int RedirectGridX;
-            public int RedirectGridY;
-            public bool UseEstateSun;
-            public float SunHour;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 51;
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public RegionInfoBlock() { }
-            public RegionInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    EstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParentEstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RegionFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SimAccess = (byte)bytes[i++];
-                    MaxAgents = (byte)bytes[i++];
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    BillableFactor = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    ObjectBonusFactor = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    WaterHeight = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainRaiseLimit = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainLowerLimit = BitConverter.ToSingle(bytes, i); i += 4;
-                    PricePerMeter = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RedirectGridX = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RedirectGridY = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    UseEstateSun = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    SunHour = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                bytes[i++] = (byte)(EstateID % 256);
-                bytes[i++] = (byte)((EstateID >> 8) % 256);
-                bytes[i++] = (byte)((EstateID >> 16) % 256);
-                bytes[i++] = (byte)((EstateID >> 24) % 256);
-                bytes[i++] = (byte)(ParentEstateID % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 8) % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 16) % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 24) % 256);
-                bytes[i++] = (byte)(RegionFlags % 256);
-                bytes[i++] = (byte)((RegionFlags >> 8) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 16) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 24) % 256);
-                bytes[i++] = SimAccess;
-                bytes[i++] = MaxAgents;
-                ba = BitConverter.GetBytes(BillableFactor);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(ObjectBonusFactor);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(WaterHeight);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainRaiseLimit);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainLowerLimit);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(PricePerMeter % 256);
-                bytes[i++] = (byte)((PricePerMeter >> 8) % 256);
-                bytes[i++] = (byte)((PricePerMeter >> 16) % 256);
-                bytes[i++] = (byte)((PricePerMeter >> 24) % 256);
-                bytes[i++] = (byte)(RedirectGridX % 256);
-                bytes[i++] = (byte)((RedirectGridX >> 8) % 256);
-                bytes[i++] = (byte)((RedirectGridX >> 16) % 256);
-                bytes[i++] = (byte)((RedirectGridX >> 24) % 256);
-                bytes[i++] = (byte)(RedirectGridY % 256);
-                bytes[i++] = (byte)((RedirectGridY >> 8) % 256);
-                bytes[i++] = (byte)((RedirectGridY >> 16) % 256);
-                bytes[i++] = (byte)((RedirectGridY >> 24) % 256);
-                bytes[i++] = (byte)((UseEstateSun) ? 1 : 0);
-                ba = BitConverter.GetBytes(SunHour);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionInfo --");
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("EstateID: {0}", EstateID));
-                output.AppendLine(String.Format("ParentEstateID: {0}", ParentEstateID));
-                output.AppendLine(String.Format("RegionFlags: {0}", RegionFlags));
-                output.AppendLine(String.Format("SimAccess: {0}", SimAccess));
-                output.AppendLine(String.Format("MaxAgents: {0}", MaxAgents));
-                output.AppendLine(String.Format("BillableFactor: {0}", BillableFactor));
-                output.AppendLine(String.Format("ObjectBonusFactor: {0}", ObjectBonusFactor));
-                output.AppendLine(String.Format("WaterHeight: {0}", WaterHeight));
-                output.AppendLine(String.Format("TerrainRaiseLimit: {0}", TerrainRaiseLimit));
-                output.AppendLine(String.Format("TerrainLowerLimit: {0}", TerrainLowerLimit));
-                output.AppendLine(String.Format("PricePerMeter: {0}", PricePerMeter));
-                output.AppendLine(String.Format("RedirectGridX: {0}", RedirectGridX));
-                output.AppendLine(String.Format("RedirectGridY: {0}", RedirectGridY));
-                output.AppendLine(String.Format("UseEstateSun: {0}", UseEstateSun));
-                output.Append(String.Format("SunHour: {0}", SunHour));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RegionInfo; } }
-        public AgentDataBlock AgentData;
-        public RegionInfoBlock RegionInfo;
-
-        public RegionInfoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 142;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            RegionInfo = new RegionInfoBlock();
-        }
-
-        public RegionInfoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RegionInfo.FromBytes(bytes, ref i);
-        }
-
-        public RegionInfoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RegionInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RegionInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RegionInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RegionInfo ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RegionInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GodUpdateRegionInfoPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RegionInfoBlock
-        {
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public uint EstateID;
-            public uint ParentEstateID;
-            public uint RegionFlags;
-            public float BillableFactor;
-            public int PricePerMeter;
-            public int RedirectGridX;
-            public int RedirectGridY;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 28;
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public RegionInfoBlock() { }
-            public RegionInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    EstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParentEstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RegionFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    BillableFactor = BitConverter.ToSingle(bytes, i); i += 4;
-                    PricePerMeter = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RedirectGridX = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RedirectGridY = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                bytes[i++] = (byte)(EstateID % 256);
-                bytes[i++] = (byte)((EstateID >> 8) % 256);
-                bytes[i++] = (byte)((EstateID >> 16) % 256);
-                bytes[i++] = (byte)((EstateID >> 24) % 256);
-                bytes[i++] = (byte)(ParentEstateID % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 8) % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 16) % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 24) % 256);
-                bytes[i++] = (byte)(RegionFlags % 256);
-                bytes[i++] = (byte)((RegionFlags >> 8) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 16) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 24) % 256);
-                ba = BitConverter.GetBytes(BillableFactor);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(PricePerMeter % 256);
-                bytes[i++] = (byte)((PricePerMeter >> 8) % 256);
-                bytes[i++] = (byte)((PricePerMeter >> 16) % 256);
-                bytes[i++] = (byte)((PricePerMeter >> 24) % 256);
-                bytes[i++] = (byte)(RedirectGridX % 256);
-                bytes[i++] = (byte)((RedirectGridX >> 8) % 256);
-                bytes[i++] = (byte)((RedirectGridX >> 16) % 256);
-                bytes[i++] = (byte)((RedirectGridX >> 24) % 256);
-                bytes[i++] = (byte)(RedirectGridY % 256);
-                bytes[i++] = (byte)((RedirectGridY >> 8) % 256);
-                bytes[i++] = (byte)((RedirectGridY >> 16) % 256);
-                bytes[i++] = (byte)((RedirectGridY >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionInfo --");
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("EstateID: {0}", EstateID));
-                output.AppendLine(String.Format("ParentEstateID: {0}", ParentEstateID));
-                output.AppendLine(String.Format("RegionFlags: {0}", RegionFlags));
-                output.AppendLine(String.Format("BillableFactor: {0}", BillableFactor));
-                output.AppendLine(String.Format("PricePerMeter: {0}", PricePerMeter));
-                output.AppendLine(String.Format("RedirectGridX: {0}", RedirectGridX));
-                output.Append(String.Format("RedirectGridY: {0}", RedirectGridY));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GodUpdateRegionInfo; } }
-        public AgentDataBlock AgentData;
-        public RegionInfoBlock RegionInfo;
-
-        public GodUpdateRegionInfoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 143;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            RegionInfo = new RegionInfoBlock();
-        }
-
-        public GodUpdateRegionInfoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RegionInfo.FromBytes(bytes, ref i);
-        }
-
-        public GodUpdateRegionInfoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RegionInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RegionInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RegionInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GodUpdateRegionInfo ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RegionInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class NearestLandingRegionUpdatedPacket : Packet
-    {
-        /// <exclude/>
-        public class RegionDataBlock
-        {
-            public ulong RegionHandle;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public RegionDataBlock() { }
-            public RegionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionData --");
-                output.Append(String.Format("RegionHandle: {0}", RegionHandle));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.NearestLandingRegionUpdated; } }
-        public RegionDataBlock RegionData;
-
-        public NearestLandingRegionUpdatedPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 146;
-            Header.Reliable = true;
-            RegionData = new RegionDataBlock();
-        }
-
-        public NearestLandingRegionUpdatedPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-        }
-
-        public NearestLandingRegionUpdatedPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += RegionData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RegionData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- NearestLandingRegionUpdated ---" + Environment.NewLine;
-                output += RegionData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RegionHandshakePacket : Packet
-    {
-        /// <exclude/>
-        public class RegionInfoBlock
-        {
-            public uint RegionFlags;
-            public byte SimAccess;
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public LLUUID SimOwner;
-            public bool IsEstateManager;
-            public float WaterHeight;
-            public float BillableFactor;
-            public LLUUID CacheID;
-            public LLUUID TerrainBase0;
-            public LLUUID TerrainBase1;
-            public LLUUID TerrainBase2;
-            public LLUUID TerrainBase3;
-            public LLUUID TerrainDetail0;
-            public LLUUID TerrainDetail1;
-            public LLUUID TerrainDetail2;
-            public LLUUID TerrainDetail3;
-            public float TerrainStartHeight00;
-            public float TerrainStartHeight01;
-            public float TerrainStartHeight10;
-            public float TerrainStartHeight11;
-            public float TerrainHeightRange00;
-            public float TerrainHeightRange01;
-            public float TerrainHeightRange10;
-            public float TerrainHeightRange11;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 206;
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public RegionInfoBlock() { }
-            public RegionInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RegionFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SimAccess = (byte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    SimOwner.FromBytes(bytes, i); i += 16;
-                    IsEstateManager = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    WaterHeight = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    BillableFactor = BitConverter.ToSingle(bytes, i); i += 4;
-                    CacheID.FromBytes(bytes, i); i += 16;
-                    TerrainBase0.FromBytes(bytes, i); i += 16;
-                    TerrainBase1.FromBytes(bytes, i); i += 16;
-                    TerrainBase2.FromBytes(bytes, i); i += 16;
-                    TerrainBase3.FromBytes(bytes, i); i += 16;
-                    TerrainDetail0.FromBytes(bytes, i); i += 16;
-                    TerrainDetail1.FromBytes(bytes, i); i += 16;
-                    TerrainDetail2.FromBytes(bytes, i); i += 16;
-                    TerrainDetail3.FromBytes(bytes, i); i += 16;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainStartHeight00 = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainStartHeight01 = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainStartHeight10 = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainStartHeight11 = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainHeightRange00 = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainHeightRange01 = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainHeightRange10 = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    TerrainHeightRange11 = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(RegionFlags % 256);
-                bytes[i++] = (byte)((RegionFlags >> 8) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 16) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 24) % 256);
-                bytes[i++] = SimAccess;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                Buffer.BlockCopy(SimOwner.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((IsEstateManager) ? 1 : 0);
-                ba = BitConverter.GetBytes(WaterHeight);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(BillableFactor);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                Buffer.BlockCopy(CacheID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TerrainBase0.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TerrainBase1.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TerrainBase2.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TerrainBase3.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TerrainDetail0.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TerrainDetail1.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TerrainDetail2.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TerrainDetail3.GetBytes(), 0, bytes, i, 16); i += 16;
-                ba = BitConverter.GetBytes(TerrainStartHeight00);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainStartHeight01);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainStartHeight10);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainStartHeight11);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainHeightRange00);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainHeightRange01);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainHeightRange10);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(TerrainHeightRange11);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionInfo --");
-                output.AppendLine(String.Format("RegionFlags: {0}", RegionFlags));
-                output.AppendLine(String.Format("SimAccess: {0}", SimAccess));
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SimOwner: {0}", SimOwner));
-                output.AppendLine(String.Format("IsEstateManager: {0}", IsEstateManager));
-                output.AppendLine(String.Format("WaterHeight: {0}", WaterHeight));
-                output.AppendLine(String.Format("BillableFactor: {0}", BillableFactor));
-                output.AppendLine(String.Format("CacheID: {0}", CacheID));
-                output.AppendLine(String.Format("TerrainBase0: {0}", TerrainBase0));
-                output.AppendLine(String.Format("TerrainBase1: {0}", TerrainBase1));
-                output.AppendLine(String.Format("TerrainBase2: {0}", TerrainBase2));
-                output.AppendLine(String.Format("TerrainBase3: {0}", TerrainBase3));
-                output.AppendLine(String.Format("TerrainDetail0: {0}", TerrainDetail0));
-                output.AppendLine(String.Format("TerrainDetail1: {0}", TerrainDetail1));
-                output.AppendLine(String.Format("TerrainDetail2: {0}", TerrainDetail2));
-                output.AppendLine(String.Format("TerrainDetail3: {0}", TerrainDetail3));
-                output.AppendLine(String.Format("TerrainStartHeight00: {0}", TerrainStartHeight00));
-                output.AppendLine(String.Format("TerrainStartHeight01: {0}", TerrainStartHeight01));
-                output.AppendLine(String.Format("TerrainStartHeight10: {0}", TerrainStartHeight10));
-                output.AppendLine(String.Format("TerrainStartHeight11: {0}", TerrainStartHeight11));
-                output.AppendLine(String.Format("TerrainHeightRange00: {0}", TerrainHeightRange00));
-                output.AppendLine(String.Format("TerrainHeightRange01: {0}", TerrainHeightRange01));
-                output.AppendLine(String.Format("TerrainHeightRange10: {0}", TerrainHeightRange10));
-                output.Append(String.Format("TerrainHeightRange11: {0}", TerrainHeightRange11));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RegionInfo2Block
-        {
-            public LLUUID RegionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public RegionInfo2Block() { }
-            public RegionInfo2Block(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RegionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionInfo2 --");
-                output.Append(String.Format("RegionID: {0}", RegionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RegionHandshake; } }
-        public RegionInfoBlock RegionInfo;
-        public RegionInfo2Block RegionInfo2;
-
-        public RegionHandshakePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 148;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            RegionInfo = new RegionInfoBlock();
-            RegionInfo2 = new RegionInfo2Block();
-        }
-
-        public RegionHandshakePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionInfo.FromBytes(bytes, ref i);
-            RegionInfo2.FromBytes(bytes, ref i);
-        }
-
-        public RegionHandshakePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionInfo.FromBytes(bytes, ref i);
-            RegionInfo2.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += RegionInfo.Length;            length += RegionInfo2.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RegionInfo.ToBytes(bytes, ref i);
-            RegionInfo2.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RegionHandshake ---" + Environment.NewLine;
-                output += RegionInfo.ToString() + Environment.NewLine;
-                output += RegionInfo2.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RegionHandshakeReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RegionInfoBlock
-        {
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public RegionInfoBlock() { }
-            public RegionInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionInfo --");
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RegionHandshakeReply; } }
-        public AgentDataBlock AgentData;
-        public RegionInfoBlock RegionInfo;
-
-        public RegionHandshakeReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 149;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            RegionInfo = new RegionInfoBlock();
-        }
-
-        public RegionHandshakeReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RegionInfo.FromBytes(bytes, ref i);
-        }
-
-        public RegionHandshakeReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RegionInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RegionInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RegionInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RegionHandshakeReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RegionInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SimulatorViewerTimeMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class TimeInfoBlock
-        {
-            public ulong UsecSinceStart;
-            public uint SecPerDay;
-            public uint SecPerYear;
-            public LLVector3 SunDirection;
-            public float SunPhase;
-            public LLVector3 SunAngVelocity;
-
-            public int Length
-            {
-                get
-                {
-                    return 44;
-                }
-            }
-
-            public TimeInfoBlock() { }
-            public TimeInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    UsecSinceStart = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    SecPerDay = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SecPerYear = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SunDirection.FromBytes(bytes, i); i += 12;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    SunPhase = BitConverter.ToSingle(bytes, i); i += 4;
-                    SunAngVelocity.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(UsecSinceStart % 256);
-                bytes[i++] = (byte)((UsecSinceStart >> 8) % 256);
-                bytes[i++] = (byte)((UsecSinceStart >> 16) % 256);
-                bytes[i++] = (byte)((UsecSinceStart >> 24) % 256);
-                bytes[i++] = (byte)((UsecSinceStart >> 32) % 256);
-                bytes[i++] = (byte)((UsecSinceStart >> 40) % 256);
-                bytes[i++] = (byte)((UsecSinceStart >> 48) % 256);
-                bytes[i++] = (byte)((UsecSinceStart >> 56) % 256);
-                bytes[i++] = (byte)(SecPerDay % 256);
-                bytes[i++] = (byte)((SecPerDay >> 8) % 256);
-                bytes[i++] = (byte)((SecPerDay >> 16) % 256);
-                bytes[i++] = (byte)((SecPerDay >> 24) % 256);
-                bytes[i++] = (byte)(SecPerYear % 256);
-                bytes[i++] = (byte)((SecPerYear >> 8) % 256);
-                bytes[i++] = (byte)((SecPerYear >> 16) % 256);
-                bytes[i++] = (byte)((SecPerYear >> 24) % 256);
-                Buffer.BlockCopy(SunDirection.GetBytes(), 0, bytes, i, 12); i += 12;
-                ba = BitConverter.GetBytes(SunPhase);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                Buffer.BlockCopy(SunAngVelocity.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TimeInfo --");
-                output.AppendLine(String.Format("UsecSinceStart: {0}", UsecSinceStart));
-                output.AppendLine(String.Format("SecPerDay: {0}", SecPerDay));
-                output.AppendLine(String.Format("SecPerYear: {0}", SecPerYear));
-                output.AppendLine(String.Format("SunDirection: {0}", SunDirection));
-                output.AppendLine(String.Format("SunPhase: {0}", SunPhase));
-                output.Append(String.Format("SunAngVelocity: {0}", SunAngVelocity));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SimulatorViewerTimeMessage; } }
-        public TimeInfoBlock TimeInfo;
-
-        public SimulatorViewerTimeMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 150;
-            Header.Reliable = true;
-            TimeInfo = new TimeInfoBlock();
-        }
-
-        public SimulatorViewerTimeMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TimeInfo.FromBytes(bytes, ref i);
-        }
-
-        public SimulatorViewerTimeMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TimeInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TimeInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TimeInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SimulatorViewerTimeMessage ---" + Environment.NewLine;
-                output += TimeInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EnableSimulatorPacket : Packet
-    {
-        /// <exclude/>
-        public class SimulatorInfoBlock
-        {
-            public ulong Handle;
-            public uint IP;
-            public ushort Port;
-
-            public int Length
-            {
-                get
-                {
-                    return 14;
-                }
-            }
-
-            public SimulatorInfoBlock() { }
-            public SimulatorInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Handle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    IP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Port = (ushort)((bytes[i++] << 8) + bytes[i++]);
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Handle % 256);
-                bytes[i++] = (byte)((Handle >> 8) % 256);
-                bytes[i++] = (byte)((Handle >> 16) % 256);
-                bytes[i++] = (byte)((Handle >> 24) % 256);
-                bytes[i++] = (byte)((Handle >> 32) % 256);
-                bytes[i++] = (byte)((Handle >> 40) % 256);
-                bytes[i++] = (byte)((Handle >> 48) % 256);
-                bytes[i++] = (byte)((Handle >> 56) % 256);
-                bytes[i++] = (byte)(IP % 256);
-                bytes[i++] = (byte)((IP >> 8) % 256);
-                bytes[i++] = (byte)((IP >> 16) % 256);
-                bytes[i++] = (byte)((IP >> 24) % 256);
-                bytes[i++] = (byte)((Port >> 8) % 256);
-                bytes[i++] = (byte)(Port % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SimulatorInfo --");
-                output.AppendLine(String.Format("Handle: {0}", Handle));
-                output.AppendLine(String.Format("IP: {0}", IP));
-                output.Append(String.Format("Port: {0}", Port));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EnableSimulator; } }
-        public SimulatorInfoBlock SimulatorInfo;
-
-        public EnableSimulatorPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 151;
-            Header.Reliable = true;
-            SimulatorInfo = new SimulatorInfoBlock();
-        }
-
-        public EnableSimulatorPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            SimulatorInfo.FromBytes(bytes, ref i);
-        }
-
-        public EnableSimulatorPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            SimulatorInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += SimulatorInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            SimulatorInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EnableSimulator ---" + Environment.NewLine;
-                output += SimulatorInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DisableSimulatorPacket : Packet
-    {
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DisableSimulator; } }
-
-        public DisableSimulatorPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 152;
-            Header.Reliable = true;
-        }
-
-        public DisableSimulatorPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-        }
-
-        public DisableSimulatorPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DisableSimulator ---" + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TransferRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class TransferInfoBlock
-        {
-            public LLUUID TransferID;
-            public int ChannelType;
-            public int SourceType;
-            public float Priority;
-            private byte[] _params;
-            public byte[] Params
-            {
-                get { return _params; }
-                set
-                {
-                    if (value == null) { _params = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _params = new byte[value.Length]; Buffer.BlockCopy(value, 0, _params, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 28;
-                    if (Params != null) { length += 2 + Params.Length; }
-                    return length;
-                }
-            }
-
-            public TransferInfoBlock() { }
-            public TransferInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TransferID.FromBytes(bytes, i); i += 16;
-                    ChannelType = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SourceType = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Priority = BitConverter.ToSingle(bytes, i); i += 4;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _params = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _params, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(TransferID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ChannelType % 256);
-                bytes[i++] = (byte)((ChannelType >> 8) % 256);
-                bytes[i++] = (byte)((ChannelType >> 16) % 256);
-                bytes[i++] = (byte)((ChannelType >> 24) % 256);
-                bytes[i++] = (byte)(SourceType % 256);
-                bytes[i++] = (byte)((SourceType >> 8) % 256);
-                bytes[i++] = (byte)((SourceType >> 16) % 256);
-                bytes[i++] = (byte)((SourceType >> 24) % 256);
-                ba = BitConverter.GetBytes(Priority);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                if(Params == null) { Console.WriteLine("Warning: Params is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Params.Length % 256);
-                bytes[i++] = (byte)((Params.Length >> 8) % 256);
-                Buffer.BlockCopy(Params, 0, bytes, i, Params.Length); i += Params.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransferInfo --");
-                output.AppendLine(String.Format("TransferID: {0}", TransferID));
-                output.AppendLine(String.Format("ChannelType: {0}", ChannelType));
-                output.AppendLine(String.Format("SourceType: {0}", SourceType));
-                output.AppendLine(String.Format("Priority: {0}", Priority));
-                Helpers.FieldToString(output, Params, "Params");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TransferRequest; } }
-        public TransferInfoBlock TransferInfo;
-
-        public TransferRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 153;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            TransferInfo = new TransferInfoBlock();
-        }
-
-        public TransferRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransferInfo.FromBytes(bytes, ref i);
-        }
-
-        public TransferRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransferInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TransferInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TransferInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TransferRequest ---" + Environment.NewLine;
-                output += TransferInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TransferInfoPacket : Packet
-    {
-        /// <exclude/>
-        public class TransferInfoBlock
-        {
-            public LLUUID TransferID;
-            public int ChannelType;
-            public int TargetType;
-            public int Status;
-            public int Size;
-            private byte[] _params;
-            public byte[] Params
-            {
-                get { return _params; }
-                set
-                {
-                    if (value == null) { _params = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _params = new byte[value.Length]; Buffer.BlockCopy(value, 0, _params, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 32;
-                    if (Params != null) { length += 2 + Params.Length; }
-                    return length;
-                }
-            }
-
-            public TransferInfoBlock() { }
-            public TransferInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TransferID.FromBytes(bytes, i); i += 16;
-                    ChannelType = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TargetType = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Status = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Size = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _params = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _params, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransferID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ChannelType % 256);
-                bytes[i++] = (byte)((ChannelType >> 8) % 256);
-                bytes[i++] = (byte)((ChannelType >> 16) % 256);
-                bytes[i++] = (byte)((ChannelType >> 24) % 256);
-                bytes[i++] = (byte)(TargetType % 256);
-                bytes[i++] = (byte)((TargetType >> 8) % 256);
-                bytes[i++] = (byte)((TargetType >> 16) % 256);
-                bytes[i++] = (byte)((TargetType >> 24) % 256);
-                bytes[i++] = (byte)(Status % 256);
-                bytes[i++] = (byte)((Status >> 8) % 256);
-                bytes[i++] = (byte)((Status >> 16) % 256);
-                bytes[i++] = (byte)((Status >> 24) % 256);
-                bytes[i++] = (byte)(Size % 256);
-                bytes[i++] = (byte)((Size >> 8) % 256);
-                bytes[i++] = (byte)((Size >> 16) % 256);
-                bytes[i++] = (byte)((Size >> 24) % 256);
-                if(Params == null) { Console.WriteLine("Warning: Params is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Params.Length % 256);
-                bytes[i++] = (byte)((Params.Length >> 8) % 256);
-                Buffer.BlockCopy(Params, 0, bytes, i, Params.Length); i += Params.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransferInfo --");
-                output.AppendLine(String.Format("TransferID: {0}", TransferID));
-                output.AppendLine(String.Format("ChannelType: {0}", ChannelType));
-                output.AppendLine(String.Format("TargetType: {0}", TargetType));
-                output.AppendLine(String.Format("Status: {0}", Status));
-                output.AppendLine(String.Format("Size: {0}", Size));
-                Helpers.FieldToString(output, Params, "Params");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TransferInfo; } }
-        public TransferInfoBlock TransferInfo;
-
-        public TransferInfoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 154;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            TransferInfo = new TransferInfoBlock();
-        }
-
-        public TransferInfoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransferInfo.FromBytes(bytes, ref i);
-        }
-
-        public TransferInfoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransferInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TransferInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TransferInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TransferInfo ---" + Environment.NewLine;
-                output += TransferInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TransferAbortPacket : Packet
-    {
-        /// <exclude/>
-        public class TransferInfoBlock
-        {
-            public LLUUID TransferID;
-            public int ChannelType;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public TransferInfoBlock() { }
-            public TransferInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransferID.FromBytes(bytes, i); i += 16;
-                    ChannelType = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransferID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ChannelType % 256);
-                bytes[i++] = (byte)((ChannelType >> 8) % 256);
-                bytes[i++] = (byte)((ChannelType >> 16) % 256);
-                bytes[i++] = (byte)((ChannelType >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransferInfo --");
-                output.AppendLine(String.Format("TransferID: {0}", TransferID));
-                output.Append(String.Format("ChannelType: {0}", ChannelType));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TransferAbort; } }
-        public TransferInfoBlock TransferInfo;
-
-        public TransferAbortPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 155;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            TransferInfo = new TransferInfoBlock();
-        }
-
-        public TransferAbortPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransferInfo.FromBytes(bytes, ref i);
-        }
-
-        public TransferAbortPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransferInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TransferInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TransferInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TransferAbort ---" + Environment.NewLine;
-                output += TransferInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestXferPacket : Packet
-    {
-        /// <exclude/>
-        public class XferIDBlock
-        {
-            public ulong ID;
-            private byte[] _filename;
-            public byte[] Filename
-            {
-                get { return _filename; }
-                set
-                {
-                    if (value == null) { _filename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _filename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _filename, 0, value.Length); }
-                }
-            }
-            public byte FilePath;
-            public bool DeleteOnCompletion;
-            public bool UseBigPackets;
-            public LLUUID VFileID;
-            public short VFileType;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 29;
-                    if (Filename != null) { length += 1 + Filename.Length; }
-                    return length;
-                }
-            }
-
-            public XferIDBlock() { }
-            public XferIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ID = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    length = (ushort)bytes[i++];
-                    _filename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _filename, 0, length); i += length;
-                    FilePath = (byte)bytes[i++];
-                    DeleteOnCompletion = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    UseBigPackets = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    VFileID.FromBytes(bytes, i); i += 16;
-                    VFileType = (short)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-                bytes[i++] = (byte)((ID >> 32) % 256);
-                bytes[i++] = (byte)((ID >> 40) % 256);
-                bytes[i++] = (byte)((ID >> 48) % 256);
-                bytes[i++] = (byte)((ID >> 56) % 256);
-                if(Filename == null) { Console.WriteLine("Warning: Filename is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Filename.Length;
-                Buffer.BlockCopy(Filename, 0, bytes, i, Filename.Length); i += Filename.Length;
-                bytes[i++] = FilePath;
-                bytes[i++] = (byte)((DeleteOnCompletion) ? 1 : 0);
-                bytes[i++] = (byte)((UseBigPackets) ? 1 : 0);
-                Buffer.BlockCopy(VFileID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(VFileType % 256);
-                bytes[i++] = (byte)((VFileType >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- XferID --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                Helpers.FieldToString(output, Filename, "Filename");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("FilePath: {0}", FilePath));
-                output.AppendLine(String.Format("DeleteOnCompletion: {0}", DeleteOnCompletion));
-                output.AppendLine(String.Format("UseBigPackets: {0}", UseBigPackets));
-                output.AppendLine(String.Format("VFileID: {0}", VFileID));
-                output.Append(String.Format("VFileType: {0}", VFileType));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestXfer; } }
-        public XferIDBlock XferID;
-
-        public RequestXferPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 156;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            XferID = new XferIDBlock();
-        }
-
-        public RequestXferPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            XferID.FromBytes(bytes, ref i);
-        }
-
-        public RequestXferPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            XferID.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += XferID.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            XferID.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestXfer ---" + Environment.NewLine;
-                output += XferID.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AbortXferPacket : Packet
-    {
-        /// <exclude/>
-        public class XferIDBlock
-        {
-            public ulong ID;
-            public int Result;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public XferIDBlock() { }
-            public XferIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    Result = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-                bytes[i++] = (byte)((ID >> 32) % 256);
-                bytes[i++] = (byte)((ID >> 40) % 256);
-                bytes[i++] = (byte)((ID >> 48) % 256);
-                bytes[i++] = (byte)((ID >> 56) % 256);
-                bytes[i++] = (byte)(Result % 256);
-                bytes[i++] = (byte)((Result >> 8) % 256);
-                bytes[i++] = (byte)((Result >> 16) % 256);
-                bytes[i++] = (byte)((Result >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- XferID --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.Append(String.Format("Result: {0}", Result));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AbortXfer; } }
-        public XferIDBlock XferID;
-
-        public AbortXferPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 157;
-            Header.Reliable = true;
-            XferID = new XferIDBlock();
-        }
-
-        public AbortXferPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            XferID.FromBytes(bytes, ref i);
-        }
-
-        public AbortXferPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            XferID.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += XferID.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            XferID.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AbortXfer ---" + Environment.NewLine;
-                output += XferID.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarAppearancePacket : Packet
-    {
-        /// <exclude/>
-        public class SenderBlock
-        {
-            public LLUUID ID;
-            public bool IsTrial;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public SenderBlock() { }
-            public SenderBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    IsTrial = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((IsTrial) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Sender --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.Append(String.Format("IsTrial: {0}", IsTrial));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            private byte[] _textureentry;
-            public byte[] TextureEntry
-            {
-                get { return _textureentry; }
-                set
-                {
-                    if (value == null) { _textureentry = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _textureentry = new byte[value.Length]; Buffer.BlockCopy(value, 0, _textureentry, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (TextureEntry != null) { length += 2 + TextureEntry.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _textureentry = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _textureentry, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(TextureEntry == null) { Console.WriteLine("Warning: TextureEntry is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(TextureEntry.Length % 256);
-                bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256);
-                Buffer.BlockCopy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                Helpers.FieldToString(output, TextureEntry, "TextureEntry");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class VisualParamBlock
-        {
-            public byte ParamValue;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public VisualParamBlock() { }
-            public VisualParamBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ParamValue = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = ParamValue;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- VisualParam --");
-                output.Append(String.Format("ParamValue: {0}", ParamValue));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarAppearance; } }
-        public SenderBlock Sender;
-        public ObjectDataBlock ObjectData;
-        public VisualParamBlock[] VisualParam;
-
-        public AvatarAppearancePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 158;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Sender = new SenderBlock();
-            ObjectData = new ObjectDataBlock();
-            VisualParam = new VisualParamBlock[0];
-        }
-
-        public AvatarAppearancePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Sender.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(VisualParam.Length < count) {
-                VisualParam = new VisualParamBlock[count];
-                for(int j = 0; j < count; j++) VisualParam[j] = new VisualParamBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { VisualParam[j].FromBytes(bytes, ref i); }
-        }
-
-        public AvatarAppearancePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Sender.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(VisualParam.Length < count) {
-                VisualParam = new VisualParamBlock[count];
-                for(int j = 0; j < count; j++) VisualParam[j] = new VisualParamBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { VisualParam[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Sender.Length;            length += ObjectData.Length;;
-            length++;
-            for (int j = 0; j < VisualParam.Length; j++) { length += VisualParam[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Sender.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)VisualParam.Length;
-            for (int j = 0; j < VisualParam.Length; j++) { VisualParam[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarAppearance ---" + Environment.NewLine;
-                output += Sender.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            for (int j = 0; j < VisualParam.Length; j++)
-            {
-                output += VisualParam[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SetFollowCamPropertiesPacket : Packet
-    {
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class CameraPropertyBlock
-        {
-            public int Type;
-            public float Value;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public CameraPropertyBlock() { }
-            public CameraPropertyBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Type = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Value = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(Type % 256);
-                bytes[i++] = (byte)((Type >> 8) % 256);
-                bytes[i++] = (byte)((Type >> 16) % 256);
-                bytes[i++] = (byte)((Type >> 24) % 256);
-                ba = BitConverter.GetBytes(Value);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- CameraProperty --");
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.Append(String.Format("Value: {0}", Value));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SetFollowCamProperties; } }
-        public ObjectDataBlock ObjectData;
-        public CameraPropertyBlock[] CameraProperty;
-
-        public SetFollowCamPropertiesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 159;
-            Header.Reliable = true;
-            ObjectData = new ObjectDataBlock();
-            CameraProperty = new CameraPropertyBlock[0];
-        }
-
-        public SetFollowCamPropertiesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(CameraProperty.Length < count) {
-                CameraProperty = new CameraPropertyBlock[count];
-                for(int j = 0; j < count; j++) CameraProperty[j] = new CameraPropertyBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { CameraProperty[j].FromBytes(bytes, ref i); }
-        }
-
-        public SetFollowCamPropertiesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(CameraProperty.Length < count) {
-                CameraProperty = new CameraPropertyBlock[count];
-                for(int j = 0; j < count; j++) CameraProperty[j] = new CameraPropertyBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { CameraProperty[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ObjectData.Length;;
-            length++;
-            for (int j = 0; j < CameraProperty.Length; j++) { length += CameraProperty[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)CameraProperty.Length;
-            for (int j = 0; j < CameraProperty.Length; j++) { CameraProperty[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SetFollowCamProperties ---" + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            for (int j = 0; j < CameraProperty.Length; j++)
-            {
-                output += CameraProperty[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ClearFollowCamPropertiesPacket : Packet
-    {
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ClearFollowCamProperties; } }
-        public ObjectDataBlock ObjectData;
-
-        public ClearFollowCamPropertiesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 160;
-            Header.Reliable = true;
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public ClearFollowCamPropertiesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public ClearFollowCamPropertiesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ClearFollowCamProperties ---" + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestPayPricePacket : Packet
-    {
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestPayPrice; } }
-        public ObjectDataBlock ObjectData;
-
-        public RequestPayPricePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 161;
-            Header.Reliable = true;
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public RequestPayPricePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public RequestPayPricePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestPayPrice ---" + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PayPriceReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-            public int DefaultPayPrice;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    DefaultPayPrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(DefaultPayPrice % 256);
-                bytes[i++] = (byte)((DefaultPayPrice >> 8) % 256);
-                bytes[i++] = (byte)((DefaultPayPrice >> 16) % 256);
-                bytes[i++] = (byte)((DefaultPayPrice >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.Append(String.Format("DefaultPayPrice: {0}", DefaultPayPrice));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ButtonDataBlock
-        {
-            public int PayButton;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ButtonDataBlock() { }
-            public ButtonDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PayButton = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(PayButton % 256);
-                bytes[i++] = (byte)((PayButton >> 8) % 256);
-                bytes[i++] = (byte)((PayButton >> 16) % 256);
-                bytes[i++] = (byte)((PayButton >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ButtonData --");
-                output.Append(String.Format("PayButton: {0}", PayButton));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PayPriceReply; } }
-        public ObjectDataBlock ObjectData;
-        public ButtonDataBlock[] ButtonData;
-
-        public PayPriceReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 162;
-            Header.Reliable = true;
-            ObjectData = new ObjectDataBlock();
-            ButtonData = new ButtonDataBlock[0];
-        }
-
-        public PayPriceReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ButtonData.Length < count) {
-                ButtonData = new ButtonDataBlock[count];
-                for(int j = 0; j < count; j++) ButtonData[j] = new ButtonDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ButtonData[j].FromBytes(bytes, ref i); }
-        }
-
-        public PayPriceReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ButtonData.Length < count) {
-                ButtonData = new ButtonDataBlock[count];
-                for(int j = 0; j < count; j++) ButtonData[j] = new ButtonDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ButtonData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ObjectData.Length;;
-            length++;
-            for (int j = 0; j < ButtonData.Length; j++) { length += ButtonData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ButtonData.Length;
-            for (int j = 0; j < ButtonData.Length; j++) { ButtonData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PayPriceReply ---" + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ButtonData.Length; j++)
-            {
-                output += ButtonData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class KickUserPacket : Packet
-    {
-        /// <exclude/>
-        public class TargetBlockBlock
-        {
-            public uint TargetIP;
-            public ushort TargetPort;
-
-            public int Length
-            {
-                get
-                {
-                    return 6;
-                }
-            }
-
-            public TargetBlockBlock() { }
-            public TargetBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TargetIP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TargetPort = (ushort)((bytes[i++] << 8) + bytes[i++]);
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(TargetIP % 256);
-                bytes[i++] = (byte)((TargetIP >> 8) % 256);
-                bytes[i++] = (byte)((TargetIP >> 16) % 256);
-                bytes[i++] = (byte)((TargetIP >> 24) % 256);
-                bytes[i++] = (byte)((TargetPort >> 8) % 256);
-                bytes[i++] = (byte)(TargetPort % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TargetBlock --");
-                output.AppendLine(String.Format("TargetIP: {0}", TargetIP));
-                output.Append(String.Format("TargetPort: {0}", TargetPort));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class UserInfoBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            private byte[] _reason;
-            public byte[] Reason
-            {
-                get { return _reason; }
-                set
-                {
-                    if (value == null) { _reason = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _reason = new byte[value.Length]; Buffer.BlockCopy(value, 0, _reason, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 32;
-                    if (Reason != null) { length += 2 + Reason.Length; }
-                    return length;
-                }
-            }
-
-            public UserInfoBlock() { }
-            public UserInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _reason = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _reason, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Reason == null) { Console.WriteLine("Warning: Reason is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Reason.Length % 256);
-                bytes[i++] = (byte)((Reason.Length >> 8) % 256);
-                Buffer.BlockCopy(Reason, 0, bytes, i, Reason.Length); i += Reason.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UserInfo --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                Helpers.FieldToString(output, Reason, "Reason");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.KickUser; } }
-        public TargetBlockBlock TargetBlock;
-        public UserInfoBlock UserInfo;
-
-        public KickUserPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 163;
-            Header.Reliable = true;
-            TargetBlock = new TargetBlockBlock();
-            UserInfo = new UserInfoBlock();
-        }
-
-        public KickUserPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TargetBlock.FromBytes(bytes, ref i);
-            UserInfo.FromBytes(bytes, ref i);
-        }
-
-        public KickUserPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TargetBlock.FromBytes(bytes, ref i);
-            UserInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TargetBlock.Length;            length += UserInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TargetBlock.ToBytes(bytes, ref i);
-            UserInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- KickUser ---" + Environment.NewLine;
-                output += TargetBlock.ToString() + Environment.NewLine;
-                output += UserInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class KickUserAckPacket : Packet
-    {
-        /// <exclude/>
-        public class UserInfoBlock
-        {
-            public LLUUID SessionID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public UserInfoBlock() { }
-            public UserInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UserInfo --");
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.KickUserAck; } }
-        public UserInfoBlock UserInfo;
-
-        public KickUserAckPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 164;
-            Header.Reliable = true;
-            UserInfo = new UserInfoBlock();
-        }
-
-        public KickUserAckPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            UserInfo.FromBytes(bytes, ref i);
-        }
-
-        public KickUserAckPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            UserInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += UserInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            UserInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- KickUserAck ---" + Environment.NewLine;
-                output += UserInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GodKickUserPacket : Packet
-    {
-        /// <exclude/>
-        public class UserInfoBlock
-        {
-            public LLUUID GodID;
-            public LLUUID GodSessionID;
-            public LLUUID AgentID;
-            public uint KickFlags;
-            private byte[] _reason;
-            public byte[] Reason
-            {
-                get { return _reason; }
-                set
-                {
-                    if (value == null) { _reason = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _reason = new byte[value.Length]; Buffer.BlockCopy(value, 0, _reason, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 52;
-                    if (Reason != null) { length += 2 + Reason.Length; }
-                    return length;
-                }
-            }
-
-            public UserInfoBlock() { }
-            public UserInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GodID.FromBytes(bytes, i); i += 16;
-                    GodSessionID.FromBytes(bytes, i); i += 16;
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    KickFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _reason = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _reason, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GodID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GodSessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(KickFlags % 256);
-                bytes[i++] = (byte)((KickFlags >> 8) % 256);
-                bytes[i++] = (byte)((KickFlags >> 16) % 256);
-                bytes[i++] = (byte)((KickFlags >> 24) % 256);
-                if(Reason == null) { Console.WriteLine("Warning: Reason is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Reason.Length % 256);
-                bytes[i++] = (byte)((Reason.Length >> 8) % 256);
-                Buffer.BlockCopy(Reason, 0, bytes, i, Reason.Length); i += Reason.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UserInfo --");
-                output.AppendLine(String.Format("GodID: {0}", GodID));
-                output.AppendLine(String.Format("GodSessionID: {0}", GodSessionID));
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("KickFlags: {0}", KickFlags));
-                Helpers.FieldToString(output, Reason, "Reason");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GodKickUser; } }
-        public UserInfoBlock UserInfo;
-
-        public GodKickUserPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 165;
-            Header.Reliable = true;
-            UserInfo = new UserInfoBlock();
-        }
-
-        public GodKickUserPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            UserInfo.FromBytes(bytes, ref i);
-        }
-
-        public GodKickUserPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            UserInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += UserInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            UserInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GodKickUser ---" + Environment.NewLine;
-                output += UserInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EjectUserPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID TargetID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TargetID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("TargetID: {0}", TargetID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EjectUser; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public EjectUserPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 167;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public EjectUserPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public EjectUserPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EjectUser ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class FreezeUserPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID TargetID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TargetID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("TargetID: {0}", TargetID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.FreezeUser; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public FreezeUserPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 168;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public FreezeUserPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public FreezeUserPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- FreezeUser ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarPropertiesRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID AvatarID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    AvatarID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AvatarID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("AvatarID: {0}", AvatarID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarPropertiesRequest; } }
-        public AgentDataBlock AgentData;
-
-        public AvatarPropertiesRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 169;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AvatarPropertiesRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AvatarPropertiesRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarPropertiesRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarPropertiesReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID AvatarID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    AvatarID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AvatarID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("AvatarID: {0}", AvatarID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class PropertiesDataBlock
-        {
-            public LLUUID ImageID;
-            public LLUUID FLImageID;
-            public LLUUID PartnerID;
-            private byte[] _abouttext;
-            public byte[] AboutText
-            {
-                get { return _abouttext; }
-                set
-                {
-                    if (value == null) { _abouttext = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _abouttext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _abouttext, 0, value.Length); }
-                }
-            }
-            private byte[] _flabouttext;
-            public byte[] FLAboutText
-            {
-                get { return _flabouttext; }
-                set
-                {
-                    if (value == null) { _flabouttext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _flabouttext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _flabouttext, 0, value.Length); }
-                }
-            }
-            private byte[] _bornon;
-            public byte[] BornOn
-            {
-                get { return _bornon; }
-                set
-                {
-                    if (value == null) { _bornon = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _bornon = new byte[value.Length]; Buffer.BlockCopy(value, 0, _bornon, 0, value.Length); }
-                }
-            }
-            private byte[] _profileurl;
-            public byte[] ProfileURL
-            {
-                get { return _profileurl; }
-                set
-                {
-                    if (value == null) { _profileurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _profileurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _profileurl, 0, value.Length); }
-                }
-            }
-            private byte[] _chartermember;
-            public byte[] CharterMember
-            {
-                get { return _chartermember; }
-                set
-                {
-                    if (value == null) { _chartermember = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _chartermember = new byte[value.Length]; Buffer.BlockCopy(value, 0, _chartermember, 0, value.Length); }
-                }
-            }
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 52;
-                    if (AboutText != null) { length += 2 + AboutText.Length; }
-                    if (FLAboutText != null) { length += 1 + FLAboutText.Length; }
-                    if (BornOn != null) { length += 1 + BornOn.Length; }
-                    if (ProfileURL != null) { length += 1 + ProfileURL.Length; }
-                    if (CharterMember != null) { length += 1 + CharterMember.Length; }
-                    return length;
-                }
-            }
-
-            public PropertiesDataBlock() { }
-            public PropertiesDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ImageID.FromBytes(bytes, i); i += 16;
-                    FLImageID.FromBytes(bytes, i); i += 16;
-                    PartnerID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _abouttext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _abouttext, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _flabouttext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _flabouttext, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _bornon = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _bornon, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _profileurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _profileurl, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _chartermember = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _chartermember, 0, length); i += length;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ImageID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FLImageID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(PartnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(AboutText == null) { Console.WriteLine("Warning: AboutText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(AboutText.Length % 256);
-                bytes[i++] = (byte)((AboutText.Length >> 8) % 256);
-                Buffer.BlockCopy(AboutText, 0, bytes, i, AboutText.Length); i += AboutText.Length;
-                if(FLAboutText == null) { Console.WriteLine("Warning: FLAboutText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FLAboutText.Length;
-                Buffer.BlockCopy(FLAboutText, 0, bytes, i, FLAboutText.Length); i += FLAboutText.Length;
-                if(BornOn == null) { Console.WriteLine("Warning: BornOn is null, in " + this.GetType()); }
-                bytes[i++] = (byte)BornOn.Length;
-                Buffer.BlockCopy(BornOn, 0, bytes, i, BornOn.Length); i += BornOn.Length;
-                if(ProfileURL == null) { Console.WriteLine("Warning: ProfileURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ProfileURL.Length;
-                Buffer.BlockCopy(ProfileURL, 0, bytes, i, ProfileURL.Length); i += ProfileURL.Length;
-                if(CharterMember == null) { Console.WriteLine("Warning: CharterMember is null, in " + this.GetType()); }
-                bytes[i++] = (byte)CharterMember.Length;
-                Buffer.BlockCopy(CharterMember, 0, bytes, i, CharterMember.Length); i += CharterMember.Length;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PropertiesData --");
-                output.AppendLine(String.Format("ImageID: {0}", ImageID));
-                output.AppendLine(String.Format("FLImageID: {0}", FLImageID));
-                output.AppendLine(String.Format("PartnerID: {0}", PartnerID));
-                Helpers.FieldToString(output, AboutText, "AboutText");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, FLAboutText, "FLAboutText");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, BornOn, "BornOn");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, ProfileURL, "ProfileURL");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, CharterMember, "CharterMember");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarPropertiesReply; } }
-        public AgentDataBlock AgentData;
-        public PropertiesDataBlock PropertiesData;
-
-        public AvatarPropertiesReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 171;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            PropertiesData = new PropertiesDataBlock();
-        }
-
-        public AvatarPropertiesReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PropertiesData.FromBytes(bytes, ref i);
-        }
-
-        public AvatarPropertiesReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PropertiesData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += PropertiesData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            PropertiesData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarPropertiesReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += PropertiesData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarInterestsReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID AvatarID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    AvatarID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AvatarID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("AvatarID: {0}", AvatarID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class PropertiesDataBlock
-        {
-            public uint WantToMask;
-            private byte[] _wanttotext;
-            public byte[] WantToText
-            {
-                get { return _wanttotext; }
-                set
-                {
-                    if (value == null) { _wanttotext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _wanttotext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _wanttotext, 0, value.Length); }
-                }
-            }
-            public uint SkillsMask;
-            private byte[] _skillstext;
-            public byte[] SkillsText
-            {
-                get { return _skillstext; }
-                set
-                {
-                    if (value == null) { _skillstext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _skillstext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _skillstext, 0, value.Length); }
-                }
-            }
-            private byte[] _languagestext;
-            public byte[] LanguagesText
-            {
-                get { return _languagestext; }
-                set
-                {
-                    if (value == null) { _languagestext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _languagestext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _languagestext, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 8;
-                    if (WantToText != null) { length += 1 + WantToText.Length; }
-                    if (SkillsText != null) { length += 1 + SkillsText.Length; }
-                    if (LanguagesText != null) { length += 1 + LanguagesText.Length; }
-                    return length;
-                }
-            }
-
-            public PropertiesDataBlock() { }
-            public PropertiesDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    WantToMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _wanttotext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _wanttotext, 0, length); i += length;
-                    SkillsMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _skillstext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _skillstext, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _languagestext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _languagestext, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(WantToMask % 256);
-                bytes[i++] = (byte)((WantToMask >> 8) % 256);
-                bytes[i++] = (byte)((WantToMask >> 16) % 256);
-                bytes[i++] = (byte)((WantToMask >> 24) % 256);
-                if(WantToText == null) { Console.WriteLine("Warning: WantToText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)WantToText.Length;
-                Buffer.BlockCopy(WantToText, 0, bytes, i, WantToText.Length); i += WantToText.Length;
-                bytes[i++] = (byte)(SkillsMask % 256);
-                bytes[i++] = (byte)((SkillsMask >> 8) % 256);
-                bytes[i++] = (byte)((SkillsMask >> 16) % 256);
-                bytes[i++] = (byte)((SkillsMask >> 24) % 256);
-                if(SkillsText == null) { Console.WriteLine("Warning: SkillsText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SkillsText.Length;
-                Buffer.BlockCopy(SkillsText, 0, bytes, i, SkillsText.Length); i += SkillsText.Length;
-                if(LanguagesText == null) { Console.WriteLine("Warning: LanguagesText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)LanguagesText.Length;
-                Buffer.BlockCopy(LanguagesText, 0, bytes, i, LanguagesText.Length); i += LanguagesText.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PropertiesData --");
-                output.AppendLine(String.Format("WantToMask: {0}", WantToMask));
-                Helpers.FieldToString(output, WantToText, "WantToText");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SkillsMask: {0}", SkillsMask));
-                Helpers.FieldToString(output, SkillsText, "SkillsText");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, LanguagesText, "LanguagesText");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarInterestsReply; } }
-        public AgentDataBlock AgentData;
-        public PropertiesDataBlock PropertiesData;
-
-        public AvatarInterestsReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 172;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            PropertiesData = new PropertiesDataBlock();
-        }
-
-        public AvatarInterestsReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PropertiesData.FromBytes(bytes, ref i);
-        }
-
-        public AvatarInterestsReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PropertiesData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += PropertiesData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            PropertiesData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarInterestsReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += PropertiesData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarGroupsReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID AvatarID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    AvatarID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AvatarID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("AvatarID: {0}", AvatarID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public ulong GroupPowers;
-            public bool AcceptNotices;
-            private byte[] _grouptitle;
-            public byte[] GroupTitle
-            {
-                get { return _grouptitle; }
-                set
-                {
-                    if (value == null) { _grouptitle = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _grouptitle = new byte[value.Length]; Buffer.BlockCopy(value, 0, _grouptitle, 0, value.Length); }
-                }
-            }
-            public LLUUID GroupID;
-            private byte[] _groupname;
-            public byte[] GroupName
-            {
-                get { return _groupname; }
-                set
-                {
-                    if (value == null) { _groupname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _groupname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _groupname, 0, value.Length); }
-                }
-            }
-            public LLUUID GroupInsigniaID;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 41;
-                    if (GroupTitle != null) { length += 1 + GroupTitle.Length; }
-                    if (GroupName != null) { length += 1 + GroupName.Length; }
-                    return length;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GroupPowers = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    AcceptNotices = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _grouptitle = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _grouptitle, 0, length); i += length;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _groupname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _groupname, 0, length); i += length;
-                    GroupInsigniaID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(GroupPowers % 256);
-                bytes[i++] = (byte)((GroupPowers >> 8) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 16) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 24) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 32) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 40) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 48) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 56) % 256);
-                bytes[i++] = (byte)((AcceptNotices) ? 1 : 0);
-                if(GroupTitle == null) { Console.WriteLine("Warning: GroupTitle is null, in " + this.GetType()); }
-                bytes[i++] = (byte)GroupTitle.Length;
-                Buffer.BlockCopy(GroupTitle, 0, bytes, i, GroupTitle.Length); i += GroupTitle.Length;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(GroupName == null) { Console.WriteLine("Warning: GroupName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)GroupName.Length;
-                Buffer.BlockCopy(GroupName, 0, bytes, i, GroupName.Length); i += GroupName.Length;
-                Buffer.BlockCopy(GroupInsigniaID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupPowers: {0}", GroupPowers));
-                output.AppendLine(String.Format("AcceptNotices: {0}", AcceptNotices));
-                Helpers.FieldToString(output, GroupTitle, "GroupTitle");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                Helpers.FieldToString(output, GroupName, "GroupName");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("GroupInsigniaID: {0}", GroupInsigniaID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class NewGroupDataBlock
-        {
-            public bool ListInProfile;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public NewGroupDataBlock() { }
-            public NewGroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ListInProfile = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((ListInProfile) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- NewGroupData --");
-                output.Append(String.Format("ListInProfile: {0}", ListInProfile));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarGroupsReply; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock[] GroupData;
-        public NewGroupDataBlock NewGroupData;
-
-        public AvatarGroupsReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 173;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock[0];
-            NewGroupData = new NewGroupDataBlock();
-        }
-
-        public AvatarGroupsReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(GroupData.Length < count) {
-                GroupData = new GroupDataBlock[count];
-                for(int j = 0; j < count; j++) GroupData[j] = new GroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GroupData[j].FromBytes(bytes, ref i); }
-            NewGroupData.FromBytes(bytes, ref i);
-        }
-
-        public AvatarGroupsReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(GroupData.Length < count) {
-                GroupData = new GroupDataBlock[count];
-                for(int j = 0; j < count; j++) GroupData[j] = new GroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GroupData[j].FromBytes(bytes, ref i); }
-            NewGroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += NewGroupData.Length;;
-            length++;
-            for (int j = 0; j < GroupData.Length; j++) { length += GroupData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)GroupData.Length;
-            for (int j = 0; j < GroupData.Length; j++) { GroupData[j].ToBytes(bytes, ref i); }
-            NewGroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarGroupsReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < GroupData.Length; j++)
-            {
-                output += GroupData[j].ToString() + Environment.NewLine;
-            }
-                output += NewGroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarPropertiesUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class PropertiesDataBlock
-        {
-            public LLUUID ImageID;
-            public LLUUID FLImageID;
-            private byte[] _abouttext;
-            public byte[] AboutText
-            {
-                get { return _abouttext; }
-                set
-                {
-                    if (value == null) { _abouttext = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _abouttext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _abouttext, 0, value.Length); }
-                }
-            }
-            private byte[] _flabouttext;
-            public byte[] FLAboutText
-            {
-                get { return _flabouttext; }
-                set
-                {
-                    if (value == null) { _flabouttext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _flabouttext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _flabouttext, 0, value.Length); }
-                }
-            }
-            public bool AllowPublish;
-            public bool MaturePublish;
-            private byte[] _profileurl;
-            public byte[] ProfileURL
-            {
-                get { return _profileurl; }
-                set
-                {
-                    if (value == null) { _profileurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _profileurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _profileurl, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 34;
-                    if (AboutText != null) { length += 2 + AboutText.Length; }
-                    if (FLAboutText != null) { length += 1 + FLAboutText.Length; }
-                    if (ProfileURL != null) { length += 1 + ProfileURL.Length; }
-                    return length;
-                }
-            }
-
-            public PropertiesDataBlock() { }
-            public PropertiesDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ImageID.FromBytes(bytes, i); i += 16;
-                    FLImageID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _abouttext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _abouttext, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _flabouttext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _flabouttext, 0, length); i += length;
-                    AllowPublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    MaturePublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _profileurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _profileurl, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ImageID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FLImageID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(AboutText == null) { Console.WriteLine("Warning: AboutText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(AboutText.Length % 256);
-                bytes[i++] = (byte)((AboutText.Length >> 8) % 256);
-                Buffer.BlockCopy(AboutText, 0, bytes, i, AboutText.Length); i += AboutText.Length;
-                if(FLAboutText == null) { Console.WriteLine("Warning: FLAboutText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FLAboutText.Length;
-                Buffer.BlockCopy(FLAboutText, 0, bytes, i, FLAboutText.Length); i += FLAboutText.Length;
-                bytes[i++] = (byte)((AllowPublish) ? 1 : 0);
-                bytes[i++] = (byte)((MaturePublish) ? 1 : 0);
-                if(ProfileURL == null) { Console.WriteLine("Warning: ProfileURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ProfileURL.Length;
-                Buffer.BlockCopy(ProfileURL, 0, bytes, i, ProfileURL.Length); i += ProfileURL.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PropertiesData --");
-                output.AppendLine(String.Format("ImageID: {0}", ImageID));
-                output.AppendLine(String.Format("FLImageID: {0}", FLImageID));
-                Helpers.FieldToString(output, AboutText, "AboutText");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, FLAboutText, "FLAboutText");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("AllowPublish: {0}", AllowPublish));
-                output.AppendLine(String.Format("MaturePublish: {0}", MaturePublish));
-                Helpers.FieldToString(output, ProfileURL, "ProfileURL");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarPropertiesUpdate; } }
-        public AgentDataBlock AgentData;
-        public PropertiesDataBlock PropertiesData;
-
-        public AvatarPropertiesUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 174;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            PropertiesData = new PropertiesDataBlock();
-        }
-
-        public AvatarPropertiesUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PropertiesData.FromBytes(bytes, ref i);
-        }
-
-        public AvatarPropertiesUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PropertiesData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += PropertiesData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            PropertiesData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarPropertiesUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += PropertiesData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarInterestsUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class PropertiesDataBlock
-        {
-            public uint WantToMask;
-            private byte[] _wanttotext;
-            public byte[] WantToText
-            {
-                get { return _wanttotext; }
-                set
-                {
-                    if (value == null) { _wanttotext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _wanttotext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _wanttotext, 0, value.Length); }
-                }
-            }
-            public uint SkillsMask;
-            private byte[] _skillstext;
-            public byte[] SkillsText
-            {
-                get { return _skillstext; }
-                set
-                {
-                    if (value == null) { _skillstext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _skillstext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _skillstext, 0, value.Length); }
-                }
-            }
-            private byte[] _languagestext;
-            public byte[] LanguagesText
-            {
-                get { return _languagestext; }
-                set
-                {
-                    if (value == null) { _languagestext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _languagestext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _languagestext, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 8;
-                    if (WantToText != null) { length += 1 + WantToText.Length; }
-                    if (SkillsText != null) { length += 1 + SkillsText.Length; }
-                    if (LanguagesText != null) { length += 1 + LanguagesText.Length; }
-                    return length;
-                }
-            }
-
-            public PropertiesDataBlock() { }
-            public PropertiesDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    WantToMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _wanttotext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _wanttotext, 0, length); i += length;
-                    SkillsMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _skillstext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _skillstext, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _languagestext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _languagestext, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(WantToMask % 256);
-                bytes[i++] = (byte)((WantToMask >> 8) % 256);
-                bytes[i++] = (byte)((WantToMask >> 16) % 256);
-                bytes[i++] = (byte)((WantToMask >> 24) % 256);
-                if(WantToText == null) { Console.WriteLine("Warning: WantToText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)WantToText.Length;
-                Buffer.BlockCopy(WantToText, 0, bytes, i, WantToText.Length); i += WantToText.Length;
-                bytes[i++] = (byte)(SkillsMask % 256);
-                bytes[i++] = (byte)((SkillsMask >> 8) % 256);
-                bytes[i++] = (byte)((SkillsMask >> 16) % 256);
-                bytes[i++] = (byte)((SkillsMask >> 24) % 256);
-                if(SkillsText == null) { Console.WriteLine("Warning: SkillsText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SkillsText.Length;
-                Buffer.BlockCopy(SkillsText, 0, bytes, i, SkillsText.Length); i += SkillsText.Length;
-                if(LanguagesText == null) { Console.WriteLine("Warning: LanguagesText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)LanguagesText.Length;
-                Buffer.BlockCopy(LanguagesText, 0, bytes, i, LanguagesText.Length); i += LanguagesText.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PropertiesData --");
-                output.AppendLine(String.Format("WantToMask: {0}", WantToMask));
-                Helpers.FieldToString(output, WantToText, "WantToText");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SkillsMask: {0}", SkillsMask));
-                Helpers.FieldToString(output, SkillsText, "SkillsText");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, LanguagesText, "LanguagesText");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarInterestsUpdate; } }
-        public AgentDataBlock AgentData;
-        public PropertiesDataBlock PropertiesData;
-
-        public AvatarInterestsUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 175;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            PropertiesData = new PropertiesDataBlock();
-        }
-
-        public AvatarInterestsUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PropertiesData.FromBytes(bytes, ref i);
-        }
-
-        public AvatarInterestsUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PropertiesData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += PropertiesData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            PropertiesData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarInterestsUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += PropertiesData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarNotesReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID TargetID;
-            private byte[] _notes;
-            public byte[] Notes
-            {
-                get { return _notes; }
-                set
-                {
-                    if (value == null) { _notes = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _notes = new byte[value.Length]; Buffer.BlockCopy(value, 0, _notes, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Notes != null) { length += 2 + Notes.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TargetID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _notes = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _notes, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Notes == null) { Console.WriteLine("Warning: Notes is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Notes.Length % 256);
-                bytes[i++] = (byte)((Notes.Length >> 8) % 256);
-                Buffer.BlockCopy(Notes, 0, bytes, i, Notes.Length); i += Notes.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("TargetID: {0}", TargetID));
-                Helpers.FieldToString(output, Notes, "Notes");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarNotesReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public AvatarNotesReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 176;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public AvatarNotesReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public AvatarNotesReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarNotesReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarNotesUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID TargetID;
-            private byte[] _notes;
-            public byte[] Notes
-            {
-                get { return _notes; }
-                set
-                {
-                    if (value == null) { _notes = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _notes = new byte[value.Length]; Buffer.BlockCopy(value, 0, _notes, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Notes != null) { length += 2 + Notes.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TargetID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _notes = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _notes, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Notes == null) { Console.WriteLine("Warning: Notes is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Notes.Length % 256);
-                bytes[i++] = (byte)((Notes.Length >> 8) % 256);
-                Buffer.BlockCopy(Notes, 0, bytes, i, Notes.Length); i += Notes.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("TargetID: {0}", TargetID));
-                Helpers.FieldToString(output, Notes, "Notes");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarNotesUpdate; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public AvatarNotesUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 177;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public AvatarNotesUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public AvatarNotesUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarNotesUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarPicksReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID TargetID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    TargetID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("TargetID: {0}", TargetID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID PickID;
-            private byte[] _pickname;
-            public byte[] PickName
-            {
-                get { return _pickname; }
-                set
-                {
-                    if (value == null) { _pickname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _pickname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _pickname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (PickName != null) { length += 1 + PickName.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    PickID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _pickname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _pickname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(PickID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(PickName == null) { Console.WriteLine("Warning: PickName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)PickName.Length;
-                Buffer.BlockCopy(PickName, 0, bytes, i, PickName.Length); i += PickName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("PickID: {0}", PickID));
-                Helpers.FieldToString(output, PickName, "PickName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarPicksReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock[] Data;
-
-        public AvatarPicksReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 178;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock[0];
-        }
-
-        public AvatarPicksReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public AvatarPicksReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarPicksReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EventInfoRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EventDataBlock
-        {
-            public uint EventID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public EventDataBlock() { }
-            public EventDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    EventID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(EventID % 256);
-                bytes[i++] = (byte)((EventID >> 8) % 256);
-                bytes[i++] = (byte)((EventID >> 16) % 256);
-                bytes[i++] = (byte)((EventID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- EventData --");
-                output.Append(String.Format("EventID: {0}", EventID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EventInfoRequest; } }
-        public AgentDataBlock AgentData;
-        public EventDataBlock EventData;
-
-        public EventInfoRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 179;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            EventData = new EventDataBlock();
-        }
-
-        public EventInfoRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-        }
-
-        public EventInfoRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += EventData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            EventData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EventInfoRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += EventData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EventInfoReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EventDataBlock
-        {
-            public uint EventID;
-            private byte[] _creator;
-            public byte[] Creator
-            {
-                get { return _creator; }
-                set
-                {
-                    if (value == null) { _creator = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _creator = new byte[value.Length]; Buffer.BlockCopy(value, 0, _creator, 0, value.Length); }
-                }
-            }
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _category;
-            public byte[] Category
-            {
-                get { return _category; }
-                set
-                {
-                    if (value == null) { _category = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _category = new byte[value.Length]; Buffer.BlockCopy(value, 0, _category, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            private byte[] _date;
-            public byte[] Date
-            {
-                get { return _date; }
-                set
-                {
-                    if (value == null) { _date = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _date = new byte[value.Length]; Buffer.BlockCopy(value, 0, _date, 0, value.Length); }
-                }
-            }
-            public uint DateUTC;
-            public uint Duration;
-            public uint Cover;
-            public uint Amount;
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public LLVector3d GlobalPos;
-            public uint EventFlags;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 48;
-                    if (Creator != null) { length += 1 + Creator.Length; }
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Category != null) { length += 1 + Category.Length; }
-                    if (Desc != null) { length += 2 + Desc.Length; }
-                    if (Date != null) { length += 1 + Date.Length; }
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public EventDataBlock() { }
-            public EventDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    EventID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _creator = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _creator, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _category = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _category, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _date = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _date, 0, length); i += length;
-                    DateUTC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Duration = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Cover = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Amount = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    GlobalPos.FromBytes(bytes, i); i += 24;
-                    EventFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(EventID % 256);
-                bytes[i++] = (byte)((EventID >> 8) % 256);
-                bytes[i++] = (byte)((EventID >> 16) % 256);
-                bytes[i++] = (byte)((EventID >> 24) % 256);
-                if(Creator == null) { Console.WriteLine("Warning: Creator is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Creator.Length;
-                Buffer.BlockCopy(Creator, 0, bytes, i, Creator.Length); i += Creator.Length;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Category == null) { Console.WriteLine("Warning: Category is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Category.Length;
-                Buffer.BlockCopy(Category, 0, bytes, i, Category.Length); i += Category.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Desc.Length % 256);
-                bytes[i++] = (byte)((Desc.Length >> 8) % 256);
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                if(Date == null) { Console.WriteLine("Warning: Date is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Date.Length;
-                Buffer.BlockCopy(Date, 0, bytes, i, Date.Length); i += Date.Length;
-                bytes[i++] = (byte)(DateUTC % 256);
-                bytes[i++] = (byte)((DateUTC >> 8) % 256);
-                bytes[i++] = (byte)((DateUTC >> 16) % 256);
-                bytes[i++] = (byte)((DateUTC >> 24) % 256);
-                bytes[i++] = (byte)(Duration % 256);
-                bytes[i++] = (byte)((Duration >> 8) % 256);
-                bytes[i++] = (byte)((Duration >> 16) % 256);
-                bytes[i++] = (byte)((Duration >> 24) % 256);
-                bytes[i++] = (byte)(Cover % 256);
-                bytes[i++] = (byte)((Cover >> 8) % 256);
-                bytes[i++] = (byte)((Cover >> 16) % 256);
-                bytes[i++] = (byte)((Cover >> 24) % 256);
-                bytes[i++] = (byte)(Amount % 256);
-                bytes[i++] = (byte)((Amount >> 8) % 256);
-                bytes[i++] = (byte)((Amount >> 16) % 256);
-                bytes[i++] = (byte)((Amount >> 24) % 256);
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                Buffer.BlockCopy(GlobalPos.GetBytes(), 0, bytes, i, 24); i += 24;
-                bytes[i++] = (byte)(EventFlags % 256);
-                bytes[i++] = (byte)((EventFlags >> 8) % 256);
-                bytes[i++] = (byte)((EventFlags >> 16) % 256);
-                bytes[i++] = (byte)((EventFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- EventData --");
-                output.AppendLine(String.Format("EventID: {0}", EventID));
-                Helpers.FieldToString(output, Creator, "Creator");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Category, "Category");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Date, "Date");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("DateUTC: {0}", DateUTC));
-                output.AppendLine(String.Format("Duration: {0}", Duration));
-                output.AppendLine(String.Format("Cover: {0}", Cover));
-                output.AppendLine(String.Format("Amount: {0}", Amount));
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("GlobalPos: {0}", GlobalPos));
-                output.Append(String.Format("EventFlags: {0}", EventFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EventInfoReply; } }
-        public AgentDataBlock AgentData;
-        public EventDataBlock EventData;
-
-        public EventInfoReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 180;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            EventData = new EventDataBlock();
-        }
-
-        public EventInfoReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-        }
-
-        public EventInfoReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += EventData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            EventData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EventInfoReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += EventData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EventNotificationAddRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EventDataBlock
-        {
-            public uint EventID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public EventDataBlock() { }
-            public EventDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    EventID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(EventID % 256);
-                bytes[i++] = (byte)((EventID >> 8) % 256);
-                bytes[i++] = (byte)((EventID >> 16) % 256);
-                bytes[i++] = (byte)((EventID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- EventData --");
-                output.Append(String.Format("EventID: {0}", EventID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EventNotificationAddRequest; } }
-        public AgentDataBlock AgentData;
-        public EventDataBlock EventData;
-
-        public EventNotificationAddRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 181;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            EventData = new EventDataBlock();
-        }
-
-        public EventNotificationAddRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-        }
-
-        public EventNotificationAddRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += EventData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            EventData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EventNotificationAddRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += EventData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EventNotificationRemoveRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EventDataBlock
-        {
-            public uint EventID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public EventDataBlock() { }
-            public EventDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    EventID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(EventID % 256);
-                bytes[i++] = (byte)((EventID >> 8) % 256);
-                bytes[i++] = (byte)((EventID >> 16) % 256);
-                bytes[i++] = (byte)((EventID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- EventData --");
-                output.Append(String.Format("EventID: {0}", EventID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EventNotificationRemoveRequest; } }
-        public AgentDataBlock AgentData;
-        public EventDataBlock EventData;
-
-        public EventNotificationRemoveRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 182;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            EventData = new EventDataBlock();
-        }
-
-        public EventNotificationRemoveRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-        }
-
-        public EventNotificationRemoveRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += EventData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            EventData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EventNotificationRemoveRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += EventData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EventGodDeletePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EventDataBlock
-        {
-            public uint EventID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public EventDataBlock() { }
-            public EventDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    EventID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(EventID % 256);
-                bytes[i++] = (byte)((EventID >> 8) % 256);
-                bytes[i++] = (byte)((EventID >> 16) % 256);
-                bytes[i++] = (byte)((EventID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- EventData --");
-                output.Append(String.Format("EventID: {0}", EventID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-            private byte[] _querytext;
-            public byte[] QueryText
-            {
-                get { return _querytext; }
-                set
-                {
-                    if (value == null) { _querytext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _querytext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _querytext, 0, value.Length); }
-                }
-            }
-            public uint QueryFlags;
-            public int QueryStart;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (QueryText != null) { length += 1 + QueryText.Length; }
-                    return length;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _querytext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _querytext, 0, length); i += length;
-                    QueryFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    QueryStart = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(QueryText == null) { Console.WriteLine("Warning: QueryText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)QueryText.Length;
-                Buffer.BlockCopy(QueryText, 0, bytes, i, QueryText.Length); i += QueryText.Length;
-                bytes[i++] = (byte)(QueryFlags % 256);
-                bytes[i++] = (byte)((QueryFlags >> 8) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 16) % 256);
-                bytes[i++] = (byte)((QueryFlags >> 24) % 256);
-                bytes[i++] = (byte)(QueryStart % 256);
-                bytes[i++] = (byte)((QueryStart >> 8) % 256);
-                bytes[i++] = (byte)((QueryStart >> 16) % 256);
-                bytes[i++] = (byte)((QueryStart >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("QueryID: {0}", QueryID));
-                Helpers.FieldToString(output, QueryText, "QueryText");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("QueryFlags: {0}", QueryFlags));
-                output.Append(String.Format("QueryStart: {0}", QueryStart));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EventGodDelete; } }
-        public AgentDataBlock AgentData;
-        public EventDataBlock EventData;
-        public QueryDataBlock QueryData;
-
-        public EventGodDeletePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 183;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            EventData = new EventDataBlock();
-            QueryData = new QueryDataBlock();
-        }
-
-        public EventGodDeletePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public EventGodDeletePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += EventData.Length;            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            EventData.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EventGodDelete ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += EventData.ToString() + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PickInfoReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID PickID;
-            public LLUUID CreatorID;
-            public bool TopPick;
-            public LLUUID ParcelID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            public LLUUID SnapshotID;
-            private byte[] _user;
-            public byte[] User
-            {
-                get { return _user; }
-                set
-                {
-                    if (value == null) { _user = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _user = new byte[value.Length]; Buffer.BlockCopy(value, 0, _user, 0, value.Length); }
-                }
-            }
-            private byte[] _originalname;
-            public byte[] OriginalName
-            {
-                get { return _originalname; }
-                set
-                {
-                    if (value == null) { _originalname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _originalname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _originalname, 0, value.Length); }
-                }
-            }
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public LLVector3d PosGlobal;
-            public int SortOrder;
-            public bool Enabled;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 94;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Desc != null) { length += 2 + Desc.Length; }
-                    if (User != null) { length += 1 + User.Length; }
-                    if (OriginalName != null) { length += 1 + OriginalName.Length; }
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    PickID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    TopPick = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _user = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _user, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _originalname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _originalname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    PosGlobal.FromBytes(bytes, i); i += 24;
-                    SortOrder = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Enabled = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(PickID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((TopPick) ? 1 : 0);
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Desc.Length % 256);
-                bytes[i++] = (byte)((Desc.Length >> 8) % 256);
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(User == null) { Console.WriteLine("Warning: User is null, in " + this.GetType()); }
-                bytes[i++] = (byte)User.Length;
-                Buffer.BlockCopy(User, 0, bytes, i, User.Length); i += User.Length;
-                if(OriginalName == null) { Console.WriteLine("Warning: OriginalName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)OriginalName.Length;
-                Buffer.BlockCopy(OriginalName, 0, bytes, i, OriginalName.Length); i += OriginalName.Length;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                Buffer.BlockCopy(PosGlobal.GetBytes(), 0, bytes, i, 24); i += 24;
-                bytes[i++] = (byte)(SortOrder % 256);
-                bytes[i++] = (byte)((SortOrder >> 8) % 256);
-                bytes[i++] = (byte)((SortOrder >> 16) % 256);
-                bytes[i++] = (byte)((SortOrder >> 24) % 256);
-                bytes[i++] = (byte)((Enabled) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("PickID: {0}", PickID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("TopPick: {0}", TopPick));
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SnapshotID: {0}", SnapshotID));
-                Helpers.FieldToString(output, User, "User");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, OriginalName, "OriginalName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("PosGlobal: {0}", PosGlobal));
-                output.AppendLine(String.Format("SortOrder: {0}", SortOrder));
-                output.Append(String.Format("Enabled: {0}", Enabled));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PickInfoReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public PickInfoReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 184;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public PickInfoReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public PickInfoReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PickInfoReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PickInfoUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID PickID;
-            public LLUUID CreatorID;
-            public bool TopPick;
-            public LLUUID ParcelID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            public LLUUID SnapshotID;
-            public LLVector3d PosGlobal;
-            public int SortOrder;
-            public bool Enabled;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 94;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Desc != null) { length += 2 + Desc.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    PickID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    TopPick = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                    PosGlobal.FromBytes(bytes, i); i += 24;
-                    SortOrder = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Enabled = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(PickID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((TopPick) ? 1 : 0);
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Desc.Length % 256);
-                bytes[i++] = (byte)((Desc.Length >> 8) % 256);
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(PosGlobal.GetBytes(), 0, bytes, i, 24); i += 24;
-                bytes[i++] = (byte)(SortOrder % 256);
-                bytes[i++] = (byte)((SortOrder >> 8) % 256);
-                bytes[i++] = (byte)((SortOrder >> 16) % 256);
-                bytes[i++] = (byte)((SortOrder >> 24) % 256);
-                bytes[i++] = (byte)((Enabled) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("PickID: {0}", PickID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("TopPick: {0}", TopPick));
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SnapshotID: {0}", SnapshotID));
-                output.AppendLine(String.Format("PosGlobal: {0}", PosGlobal));
-                output.AppendLine(String.Format("SortOrder: {0}", SortOrder));
-                output.Append(String.Format("Enabled: {0}", Enabled));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PickInfoUpdate; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public PickInfoUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 185;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public PickInfoUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public PickInfoUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PickInfoUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PickDeletePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID PickID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PickID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(PickID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("PickID: {0}", PickID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PickDelete; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public PickDeletePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 186;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public PickDeletePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public PickDeletePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PickDelete ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PickGodDeletePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID PickID;
-            public LLUUID QueryID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PickID.FromBytes(bytes, i); i += 16;
-                    QueryID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(PickID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("PickID: {0}", PickID));
-                output.Append(String.Format("QueryID: {0}", QueryID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PickGodDelete; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public PickGodDeletePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 187;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public PickGodDeletePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public PickGodDeletePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PickGodDelete ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptQuestionPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID TaskID;
-            public LLUUID ItemID;
-            private byte[] _objectname;
-            public byte[] ObjectName
-            {
-                get { return _objectname; }
-                set
-                {
-                    if (value == null) { _objectname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _objectname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _objectname, 0, value.Length); }
-                }
-            }
-            private byte[] _objectowner;
-            public byte[] ObjectOwner
-            {
-                get { return _objectowner; }
-                set
-                {
-                    if (value == null) { _objectowner = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _objectowner = new byte[value.Length]; Buffer.BlockCopy(value, 0, _objectowner, 0, value.Length); }
-                }
-            }
-            public int Questions;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 36;
-                    if (ObjectName != null) { length += 1 + ObjectName.Length; }
-                    if (ObjectOwner != null) { length += 1 + ObjectOwner.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TaskID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _objectname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _objectname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _objectowner = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _objectowner, 0, length); i += length;
-                    Questions = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(ObjectName == null) { Console.WriteLine("Warning: ObjectName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ObjectName.Length;
-                Buffer.BlockCopy(ObjectName, 0, bytes, i, ObjectName.Length); i += ObjectName.Length;
-                if(ObjectOwner == null) { Console.WriteLine("Warning: ObjectOwner is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ObjectOwner.Length;
-                Buffer.BlockCopy(ObjectOwner, 0, bytes, i, ObjectOwner.Length); i += ObjectOwner.Length;
-                bytes[i++] = (byte)(Questions % 256);
-                bytes[i++] = (byte)((Questions >> 8) % 256);
-                bytes[i++] = (byte)((Questions >> 16) % 256);
-                bytes[i++] = (byte)((Questions >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("TaskID: {0}", TaskID));
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                Helpers.FieldToString(output, ObjectName, "ObjectName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, ObjectOwner, "ObjectOwner");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("Questions: {0}", Questions));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptQuestion; } }
-        public DataBlock Data;
-
-        public ScriptQuestionPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 188;
-            Header.Reliable = true;
-            Data = new DataBlock();
-        }
-
-        public ScriptQuestionPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ScriptQuestionPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptQuestion ---" + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptControlChangePacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            public bool TakeControls;
-            public uint Controls;
-            public bool PassToAgent;
-
-            public int Length
-            {
-                get
-                {
-                    return 6;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TakeControls = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    Controls = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PassToAgent = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((TakeControls) ? 1 : 0);
-                bytes[i++] = (byte)(Controls % 256);
-                bytes[i++] = (byte)((Controls >> 8) % 256);
-                bytes[i++] = (byte)((Controls >> 16) % 256);
-                bytes[i++] = (byte)((Controls >> 24) % 256);
-                bytes[i++] = (byte)((PassToAgent) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("TakeControls: {0}", TakeControls));
-                output.AppendLine(String.Format("Controls: {0}", Controls));
-                output.Append(String.Format("PassToAgent: {0}", PassToAgent));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptControlChange; } }
-        public DataBlock[] Data;
-
-        public ScriptControlChangePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 189;
-            Header.Reliable = true;
-            Data = new DataBlock[0];
-        }
-
-        public ScriptControlChangePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public ScriptControlChangePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptControlChange ---" + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptDialogPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ObjectID;
-            private byte[] _firstname;
-            public byte[] FirstName
-            {
-                get { return _firstname; }
-                set
-                {
-                    if (value == null) { _firstname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _firstname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _firstname, 0, value.Length); }
-                }
-            }
-            private byte[] _lastname;
-            public byte[] LastName
-            {
-                get { return _lastname; }
-                set
-                {
-                    if (value == null) { _lastname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _lastname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _lastname, 0, value.Length); }
-                }
-            }
-            private byte[] _objectname;
-            public byte[] ObjectName
-            {
-                get { return _objectname; }
-                set
-                {
-                    if (value == null) { _objectname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _objectname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _objectname, 0, value.Length); }
-                }
-            }
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-            public int ChatChannel;
-            public LLUUID ImageID;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 36;
-                    if (FirstName != null) { length += 1 + FirstName.Length; }
-                    if (LastName != null) { length += 1 + LastName.Length; }
-                    if (ObjectName != null) { length += 1 + ObjectName.Length; }
-                    if (Message != null) { length += 2 + Message.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _firstname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _firstname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _lastname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _lastname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _objectname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _objectname, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                    ChatChannel = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ImageID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(FirstName == null) { Console.WriteLine("Warning: FirstName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FirstName.Length;
-                Buffer.BlockCopy(FirstName, 0, bytes, i, FirstName.Length); i += FirstName.Length;
-                if(LastName == null) { Console.WriteLine("Warning: LastName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)LastName.Length;
-                Buffer.BlockCopy(LastName, 0, bytes, i, LastName.Length); i += LastName.Length;
-                if(ObjectName == null) { Console.WriteLine("Warning: ObjectName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ObjectName.Length;
-                Buffer.BlockCopy(ObjectName, 0, bytes, i, ObjectName.Length); i += ObjectName.Length;
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Message.Length % 256);
-                bytes[i++] = (byte)((Message.Length >> 8) % 256);
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-                bytes[i++] = (byte)(ChatChannel % 256);
-                bytes[i++] = (byte)((ChatChannel >> 8) % 256);
-                bytes[i++] = (byte)((ChatChannel >> 16) % 256);
-                bytes[i++] = (byte)((ChatChannel >> 24) % 256);
-                Buffer.BlockCopy(ImageID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                Helpers.FieldToString(output, FirstName, "FirstName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, LastName, "LastName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, ObjectName, "ObjectName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Message, "Message");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ChatChannel: {0}", ChatChannel));
-                output.Append(String.Format("ImageID: {0}", ImageID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ButtonsBlock
-        {
-            private byte[] _buttonlabel;
-            public byte[] ButtonLabel
-            {
-                get { return _buttonlabel; }
-                set
-                {
-                    if (value == null) { _buttonlabel = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _buttonlabel = new byte[value.Length]; Buffer.BlockCopy(value, 0, _buttonlabel, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (ButtonLabel != null) { length += 1 + ButtonLabel.Length; }
-                    return length;
-                }
-            }
-
-            public ButtonsBlock() { }
-            public ButtonsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _buttonlabel = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _buttonlabel, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(ButtonLabel == null) { Console.WriteLine("Warning: ButtonLabel is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ButtonLabel.Length;
-                Buffer.BlockCopy(ButtonLabel, 0, bytes, i, ButtonLabel.Length); i += ButtonLabel.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Buttons --");
-                Helpers.FieldToString(output, ButtonLabel, "ButtonLabel");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptDialog; } }
-        public DataBlock Data;
-        public ButtonsBlock[] Buttons;
-
-        public ScriptDialogPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 190;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Data = new DataBlock();
-            Buttons = new ButtonsBlock[0];
-        }
-
-        public ScriptDialogPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Buttons.Length < count) {
-                Buttons = new ButtonsBlock[count];
-                for(int j = 0; j < count; j++) Buttons[j] = new ButtonsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Buttons[j].FromBytes(bytes, ref i); }
-        }
-
-        public ScriptDialogPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Buttons.Length < count) {
-                Buttons = new ButtonsBlock[count];
-                for(int j = 0; j < count; j++) Buttons[j] = new ButtonsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Buttons[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Data.Length;;
-            length++;
-            for (int j = 0; j < Buttons.Length; j++) { length += Buttons[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Buttons.Length;
-            for (int j = 0; j < Buttons.Length; j++) { Buttons[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptDialog ---" + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            for (int j = 0; j < Buttons.Length; j++)
-            {
-                output += Buttons[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptDialogReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ObjectID;
-            public int ChatChannel;
-            public int ButtonIndex;
-            private byte[] _buttonlabel;
-            public byte[] ButtonLabel
-            {
-                get { return _buttonlabel; }
-                set
-                {
-                    if (value == null) { _buttonlabel = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _buttonlabel = new byte[value.Length]; Buffer.BlockCopy(value, 0, _buttonlabel, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (ButtonLabel != null) { length += 1 + ButtonLabel.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    ChatChannel = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ButtonIndex = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _buttonlabel = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _buttonlabel, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ChatChannel % 256);
-                bytes[i++] = (byte)((ChatChannel >> 8) % 256);
-                bytes[i++] = (byte)((ChatChannel >> 16) % 256);
-                bytes[i++] = (byte)((ChatChannel >> 24) % 256);
-                bytes[i++] = (byte)(ButtonIndex % 256);
-                bytes[i++] = (byte)((ButtonIndex >> 8) % 256);
-                bytes[i++] = (byte)((ButtonIndex >> 16) % 256);
-                bytes[i++] = (byte)((ButtonIndex >> 24) % 256);
-                if(ButtonLabel == null) { Console.WriteLine("Warning: ButtonLabel is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ButtonLabel.Length;
-                Buffer.BlockCopy(ButtonLabel, 0, bytes, i, ButtonLabel.Length); i += ButtonLabel.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("ChatChannel: {0}", ChatChannel));
-                output.AppendLine(String.Format("ButtonIndex: {0}", ButtonIndex));
-                Helpers.FieldToString(output, ButtonLabel, "ButtonLabel");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptDialogReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ScriptDialogReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 191;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ScriptDialogReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ScriptDialogReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptDialogReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ForceScriptControlReleasePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ForceScriptControlRelease; } }
-        public AgentDataBlock AgentData;
-
-        public ForceScriptControlReleasePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 192;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public ForceScriptControlReleasePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public ForceScriptControlReleasePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ForceScriptControlRelease ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RevokePermissionsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ObjectID;
-            public uint ObjectPermissions;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    ObjectPermissions = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ObjectPermissions % 256);
-                bytes[i++] = (byte)((ObjectPermissions >> 8) % 256);
-                bytes[i++] = (byte)((ObjectPermissions >> 16) % 256);
-                bytes[i++] = (byte)((ObjectPermissions >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.Append(String.Format("ObjectPermissions: {0}", ObjectPermissions));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RevokePermissions; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public RevokePermissionsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 193;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public RevokePermissionsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public RevokePermissionsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RevokePermissions ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LoadURLPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            private byte[] _objectname;
-            public byte[] ObjectName
-            {
-                get { return _objectname; }
-                set
-                {
-                    if (value == null) { _objectname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _objectname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _objectname, 0, value.Length); }
-                }
-            }
-            public LLUUID ObjectID;
-            public LLUUID OwnerID;
-            public bool OwnerIsGroup;
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-            private byte[] _url;
-            public byte[] URL
-            {
-                get { return _url; }
-                set
-                {
-                    if (value == null) { _url = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _url = new byte[value.Length]; Buffer.BlockCopy(value, 0, _url, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 33;
-                    if (ObjectName != null) { length += 1 + ObjectName.Length; }
-                    if (Message != null) { length += 1 + Message.Length; }
-                    if (URL != null) { length += 1 + URL.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _objectname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _objectname, 0, length); i += length;
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    OwnerIsGroup = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _url = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _url, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(ObjectName == null) { Console.WriteLine("Warning: ObjectName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ObjectName.Length;
-                Buffer.BlockCopy(ObjectName, 0, bytes, i, ObjectName.Length); i += ObjectName.Length;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((OwnerIsGroup) ? 1 : 0);
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Message.Length;
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-                if(URL == null) { Console.WriteLine("Warning: URL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)URL.Length;
-                Buffer.BlockCopy(URL, 0, bytes, i, URL.Length); i += URL.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                Helpers.FieldToString(output, ObjectName, "ObjectName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("OwnerIsGroup: {0}", OwnerIsGroup));
-                Helpers.FieldToString(output, Message, "Message");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, URL, "URL");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LoadURL; } }
-        public DataBlock Data;
-
-        public LoadURLPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 194;
-            Header.Reliable = true;
-            Data = new DataBlock();
-        }
-
-        public LoadURLPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public LoadURLPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LoadURL ---" + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptTeleportRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            private byte[] _objectname;
-            public byte[] ObjectName
-            {
-                get { return _objectname; }
-                set
-                {
-                    if (value == null) { _objectname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _objectname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _objectname, 0, value.Length); }
-                }
-            }
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public LLVector3 SimPosition;
-            public LLVector3 LookAt;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (ObjectName != null) { length += 1 + ObjectName.Length; }
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _objectname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _objectname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    SimPosition.FromBytes(bytes, i); i += 12;
-                    LookAt.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(ObjectName == null) { Console.WriteLine("Warning: ObjectName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ObjectName.Length;
-                Buffer.BlockCopy(ObjectName, 0, bytes, i, ObjectName.Length); i += ObjectName.Length;
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                Buffer.BlockCopy(SimPosition.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                Helpers.FieldToString(output, ObjectName, "ObjectName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("SimPosition: {0}", SimPosition));
-                output.Append(String.Format("LookAt: {0}", LookAt));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptTeleportRequest; } }
-        public DataBlock Data;
-
-        public ScriptTeleportRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 195;
-            Header.Reliable = true;
-            Data = new DataBlock();
-        }
-
-        public ScriptTeleportRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ScriptTeleportRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptTeleportRequest ---" + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelOverlayPacket : Packet
-    {
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int SequenceID;
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 4;
-                    if (Data != null) { length += 2 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    SequenceID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(SequenceID % 256);
-                bytes[i++] = (byte)((SequenceID >> 8) % 256);
-                bytes[i++] = (byte)((SequenceID >> 16) % 256);
-                bytes[i++] = (byte)((SequenceID >> 24) % 256);
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("SequenceID: {0}", SequenceID));
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelOverlay; } }
-        public ParcelDataBlock ParcelData;
-
-        public ParcelOverlayPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 196;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelOverlayPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelOverlayPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelOverlay ---" + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelPropertiesRequestByIDPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int SequenceID;
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SequenceID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(SequenceID % 256);
-                bytes[i++] = (byte)((SequenceID >> 8) % 256);
-                bytes[i++] = (byte)((SequenceID >> 16) % 256);
-                bytes[i++] = (byte)((SequenceID >> 24) % 256);
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("SequenceID: {0}", SequenceID));
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelPropertiesRequestByID; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelPropertiesRequestByIDPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 197;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelPropertiesRequestByIDPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelPropertiesRequestByIDPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelPropertiesRequestByID ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelPropertiesUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-            public uint Flags;
-            public uint ParcelFlags;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            private byte[] _musicurl;
-            public byte[] MusicURL
-            {
-                get { return _musicurl; }
-                set
-                {
-                    if (value == null) { _musicurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _musicurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _musicurl, 0, value.Length); }
-                }
-            }
-            private byte[] _mediaurl;
-            public byte[] MediaURL
-            {
-                get { return _mediaurl; }
-                set
-                {
-                    if (value == null) { _mediaurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mediaurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediaurl, 0, value.Length); }
-                }
-            }
-            public LLUUID MediaID;
-            public byte MediaAutoScale;
-            public LLUUID GroupID;
-            public int PassPrice;
-            public float PassHours;
-            public byte Category;
-            public LLUUID AuthBuyerID;
-            public LLUUID SnapshotID;
-            public LLVector3 UserLocation;
-            public LLVector3 UserLookAt;
-            public byte LandingType;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 115;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Desc != null) { length += 1 + Desc.Length; }
-                    if (MusicURL != null) { length += 1 + MusicURL.Length; }
-                    if (MediaURL != null) { length += 1 + MediaURL.Length; }
-                    return length;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParcelFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _musicurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _musicurl, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _mediaurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mediaurl, 0, length); i += length;
-                    MediaID.FromBytes(bytes, i); i += 16;
-                    MediaAutoScale = (byte)bytes[i++];
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    PassPrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    PassHours = BitConverter.ToSingle(bytes, i); i += 4;
-                    Category = (byte)bytes[i++];
-                    AuthBuyerID.FromBytes(bytes, i); i += 16;
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                    UserLocation.FromBytes(bytes, i); i += 12;
-                    UserLookAt.FromBytes(bytes, i); i += 12;
-                    LandingType = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(ParcelFlags % 256);
-                bytes[i++] = (byte)((ParcelFlags >> 8) % 256);
-                bytes[i++] = (byte)((ParcelFlags >> 16) % 256);
-                bytes[i++] = (byte)((ParcelFlags >> 24) % 256);
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Desc.Length;
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                if(MusicURL == null) { Console.WriteLine("Warning: MusicURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MusicURL.Length;
-                Buffer.BlockCopy(MusicURL, 0, bytes, i, MusicURL.Length); i += MusicURL.Length;
-                if(MediaURL == null) { Console.WriteLine("Warning: MediaURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MediaURL.Length;
-                Buffer.BlockCopy(MediaURL, 0, bytes, i, MediaURL.Length); i += MediaURL.Length;
-                Buffer.BlockCopy(MediaID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = MediaAutoScale;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(PassPrice % 256);
-                bytes[i++] = (byte)((PassPrice >> 8) % 256);
-                bytes[i++] = (byte)((PassPrice >> 16) % 256);
-                bytes[i++] = (byte)((PassPrice >> 24) % 256);
-                ba = BitConverter.GetBytes(PassHours);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = Category;
-                Buffer.BlockCopy(AuthBuyerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(UserLocation.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(UserLookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = LandingType;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("ParcelFlags: {0}", ParcelFlags));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, MusicURL, "MusicURL");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, MediaURL, "MediaURL");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("MediaID: {0}", MediaID));
-                output.AppendLine(String.Format("MediaAutoScale: {0}", MediaAutoScale));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("PassPrice: {0}", PassPrice));
-                output.AppendLine(String.Format("PassHours: {0}", PassHours));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                output.AppendLine(String.Format("AuthBuyerID: {0}", AuthBuyerID));
-                output.AppendLine(String.Format("SnapshotID: {0}", SnapshotID));
-                output.AppendLine(String.Format("UserLocation: {0}", UserLocation));
-                output.AppendLine(String.Format("UserLookAt: {0}", UserLookAt));
-                output.Append(String.Format("LandingType: {0}", LandingType));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelPropertiesUpdate; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelPropertiesUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 198;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelPropertiesUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelPropertiesUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelPropertiesUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelReturnObjectsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-            public uint ReturnType;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ReturnType = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = (byte)(ReturnType % 256);
-                bytes[i++] = (byte)((ReturnType >> 8) % 256);
-                bytes[i++] = (byte)((ReturnType >> 16) % 256);
-                bytes[i++] = (byte)((ReturnType >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("ReturnType: {0}", ReturnType));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TaskIDsBlock
-        {
-            public LLUUID TaskID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TaskIDsBlock() { }
-            public TaskIDsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TaskID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TaskIDs --");
-                output.Append(String.Format("TaskID: {0}", TaskID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class OwnerIDsBlock
-        {
-            public LLUUID OwnerID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public OwnerIDsBlock() { }
-            public OwnerIDsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- OwnerIDs --");
-                output.Append(String.Format("OwnerID: {0}", OwnerID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelReturnObjects; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-        public TaskIDsBlock[] TaskIDs;
-        public OwnerIDsBlock[] OwnerIDs;
-
-        public ParcelReturnObjectsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 199;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-            TaskIDs = new TaskIDsBlock[0];
-            OwnerIDs = new OwnerIDsBlock[0];
-        }
-
-        public ParcelReturnObjectsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(TaskIDs.Length < count) {
-                TaskIDs = new TaskIDsBlock[count];
-                for(int j = 0; j < count; j++) TaskIDs[j] = new TaskIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { TaskIDs[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(OwnerIDs.Length < count) {
-                OwnerIDs = new OwnerIDsBlock[count];
-                for(int j = 0; j < count; j++) OwnerIDs[j] = new OwnerIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { OwnerIDs[j].FromBytes(bytes, ref i); }
-        }
-
-        public ParcelReturnObjectsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(TaskIDs.Length < count) {
-                TaskIDs = new TaskIDsBlock[count];
-                for(int j = 0; j < count; j++) TaskIDs[j] = new TaskIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { TaskIDs[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(OwnerIDs.Length < count) {
-                OwnerIDs = new OwnerIDsBlock[count];
-                for(int j = 0; j < count; j++) OwnerIDs[j] = new OwnerIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { OwnerIDs[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            length++;
-            for (int j = 0; j < TaskIDs.Length; j++) { length += TaskIDs[j].Length; }
-            length++;
-            for (int j = 0; j < OwnerIDs.Length; j++) { length += OwnerIDs[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)TaskIDs.Length;
-            for (int j = 0; j < TaskIDs.Length; j++) { TaskIDs[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)OwnerIDs.Length;
-            for (int j = 0; j < OwnerIDs.Length; j++) { OwnerIDs[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelReturnObjects ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            for (int j = 0; j < TaskIDs.Length; j++)
-            {
-                output += TaskIDs[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < OwnerIDs.Length; j++)
-            {
-                output += OwnerIDs[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelSetOtherCleanTimePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-            public int OtherCleanTime;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OtherCleanTime = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = (byte)(OtherCleanTime % 256);
-                bytes[i++] = (byte)((OtherCleanTime >> 8) % 256);
-                bytes[i++] = (byte)((OtherCleanTime >> 16) % 256);
-                bytes[i++] = (byte)((OtherCleanTime >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("OtherCleanTime: {0}", OtherCleanTime));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelSetOtherCleanTime; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelSetOtherCleanTimePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 200;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelSetOtherCleanTimePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelSetOtherCleanTimePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelSetOtherCleanTime ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelDisableObjectsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-            public uint ReturnType;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ReturnType = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = (byte)(ReturnType % 256);
-                bytes[i++] = (byte)((ReturnType >> 8) % 256);
-                bytes[i++] = (byte)((ReturnType >> 16) % 256);
-                bytes[i++] = (byte)((ReturnType >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("ReturnType: {0}", ReturnType));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TaskIDsBlock
-        {
-            public LLUUID TaskID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TaskIDsBlock() { }
-            public TaskIDsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TaskID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TaskIDs --");
-                output.Append(String.Format("TaskID: {0}", TaskID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class OwnerIDsBlock
-        {
-            public LLUUID OwnerID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public OwnerIDsBlock() { }
-            public OwnerIDsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- OwnerIDs --");
-                output.Append(String.Format("OwnerID: {0}", OwnerID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelDisableObjects; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-        public TaskIDsBlock[] TaskIDs;
-        public OwnerIDsBlock[] OwnerIDs;
-
-        public ParcelDisableObjectsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 201;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-            TaskIDs = new TaskIDsBlock[0];
-            OwnerIDs = new OwnerIDsBlock[0];
-        }
-
-        public ParcelDisableObjectsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(TaskIDs.Length < count) {
-                TaskIDs = new TaskIDsBlock[count];
-                for(int j = 0; j < count; j++) TaskIDs[j] = new TaskIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { TaskIDs[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(OwnerIDs.Length < count) {
-                OwnerIDs = new OwnerIDsBlock[count];
-                for(int j = 0; j < count; j++) OwnerIDs[j] = new OwnerIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { OwnerIDs[j].FromBytes(bytes, ref i); }
-        }
-
-        public ParcelDisableObjectsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(TaskIDs.Length < count) {
-                TaskIDs = new TaskIDsBlock[count];
-                for(int j = 0; j < count; j++) TaskIDs[j] = new TaskIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { TaskIDs[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(OwnerIDs.Length < count) {
-                OwnerIDs = new OwnerIDsBlock[count];
-                for(int j = 0; j < count; j++) OwnerIDs[j] = new OwnerIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { OwnerIDs[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            length++;
-            for (int j = 0; j < TaskIDs.Length; j++) { length += TaskIDs[j].Length; }
-            length++;
-            for (int j = 0; j < OwnerIDs.Length; j++) { length += OwnerIDs[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)TaskIDs.Length;
-            for (int j = 0; j < TaskIDs.Length; j++) { TaskIDs[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)OwnerIDs.Length;
-            for (int j = 0; j < OwnerIDs.Length; j++) { OwnerIDs[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelDisableObjects ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            for (int j = 0; j < TaskIDs.Length; j++)
-            {
-                output += TaskIDs[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < OwnerIDs.Length; j++)
-            {
-                output += OwnerIDs[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelSelectObjectsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-            public uint ReturnType;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ReturnType = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = (byte)(ReturnType % 256);
-                bytes[i++] = (byte)((ReturnType >> 8) % 256);
-                bytes[i++] = (byte)((ReturnType >> 16) % 256);
-                bytes[i++] = (byte)((ReturnType >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("ReturnType: {0}", ReturnType));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ReturnIDsBlock
-        {
-            public LLUUID ReturnID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ReturnIDsBlock() { }
-            public ReturnIDsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ReturnID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ReturnID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ReturnIDs --");
-                output.Append(String.Format("ReturnID: {0}", ReturnID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelSelectObjects; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-        public ReturnIDsBlock[] ReturnIDs;
-
-        public ParcelSelectObjectsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 202;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-            ReturnIDs = new ReturnIDsBlock[0];
-        }
-
-        public ParcelSelectObjectsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ReturnIDs.Length < count) {
-                ReturnIDs = new ReturnIDsBlock[count];
-                for(int j = 0; j < count; j++) ReturnIDs[j] = new ReturnIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ReturnIDs[j].FromBytes(bytes, ref i); }
-        }
-
-        public ParcelSelectObjectsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ReturnIDs.Length < count) {
-                ReturnIDs = new ReturnIDsBlock[count];
-                for(int j = 0; j < count; j++) ReturnIDs[j] = new ReturnIDsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ReturnIDs[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            length++;
-            for (int j = 0; j < ReturnIDs.Length; j++) { length += ReturnIDs[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ReturnIDs.Length;
-            for (int j = 0; j < ReturnIDs.Length; j++) { ReturnIDs[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelSelectObjects ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ReturnIDs.Length; j++)
-            {
-                output += ReturnIDs[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EstateCovenantRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EstateCovenantRequest; } }
-        public AgentDataBlock AgentData;
-
-        public EstateCovenantRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 203;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public EstateCovenantRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public EstateCovenantRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EstateCovenantRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EstateCovenantReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID CovenantID;
-            public uint CovenantTimestamp;
-            private byte[] _estatename;
-            public byte[] EstateName
-            {
-                get { return _estatename; }
-                set
-                {
-                    if (value == null) { _estatename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _estatename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _estatename, 0, value.Length); }
-                }
-            }
-            public LLUUID EstateOwnerID;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 36;
-                    if (EstateName != null) { length += 1 + EstateName.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    CovenantID.FromBytes(bytes, i); i += 16;
-                    CovenantTimestamp = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _estatename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _estatename, 0, length); i += length;
-                    EstateOwnerID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(CovenantID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CovenantTimestamp % 256);
-                bytes[i++] = (byte)((CovenantTimestamp >> 8) % 256);
-                bytes[i++] = (byte)((CovenantTimestamp >> 16) % 256);
-                bytes[i++] = (byte)((CovenantTimestamp >> 24) % 256);
-                if(EstateName == null) { Console.WriteLine("Warning: EstateName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)EstateName.Length;
-                Buffer.BlockCopy(EstateName, 0, bytes, i, EstateName.Length); i += EstateName.Length;
-                Buffer.BlockCopy(EstateOwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("CovenantID: {0}", CovenantID));
-                output.AppendLine(String.Format("CovenantTimestamp: {0}", CovenantTimestamp));
-                Helpers.FieldToString(output, EstateName, "EstateName");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("EstateOwnerID: {0}", EstateOwnerID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EstateCovenantReply; } }
-        public DataBlock Data;
-
-        public EstateCovenantReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 204;
-            Header.Reliable = true;
-            Data = new DataBlock();
-        }
-
-        public EstateCovenantReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public EstateCovenantReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EstateCovenantReply ---" + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ForceObjectSelectPacket : Packet
-    {
-        /// <exclude/>
-        public class HeaderBlock
-        {
-            public bool ResetList;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public HeaderBlock() { }
-            public HeaderBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ResetList = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((ResetList) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Header --");
-                output.Append(String.Format("ResetList: {0}", ResetList));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public uint LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ForceObjectSelect; } }
-        public HeaderBlock _Header;
-        public DataBlock[] Data;
-
-        public ForceObjectSelectPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 205;
-            Header.Reliable = true;
-            _Header = new HeaderBlock();
-            Data = new DataBlock[0];
-        }
-
-        public ForceObjectSelectPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            _Header.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public ForceObjectSelectPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            _Header.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += _Header.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            _Header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ForceObjectSelect ---" + Environment.NewLine;
-                output += _Header.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelBuyPassPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelBuyPass; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelBuyPassPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 206;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelBuyPassPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelBuyPassPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelBuyPass ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelDeedToGroupPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID GroupID;
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelDeedToGroup; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelDeedToGroupPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 207;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelDeedToGroupPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelDeedToGroupPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelDeedToGroup ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelReclaimPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelReclaim; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelReclaimPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 208;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelReclaimPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelReclaimPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelReclaim ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelClaimPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID GroupID;
-            public bool IsGroupOwned;
-            public bool Final;
-
-            public int Length
-            {
-                get
-                {
-                    return 18;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    IsGroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    Final = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((IsGroupOwned) ? 1 : 0);
-                bytes[i++] = (byte)((Final) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("IsGroupOwned: {0}", IsGroupOwned));
-                output.Append(String.Format("Final: {0}", Final));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public float West;
-            public float South;
-            public float East;
-            public float North;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    West = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    South = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    East = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    North = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                ba = BitConverter.GetBytes(West);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(South);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(East);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(North);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("West: {0}", West));
-                output.AppendLine(String.Format("South: {0}", South));
-                output.AppendLine(String.Format("East: {0}", East));
-                output.Append(String.Format("North: {0}", North));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelClaim; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-        public ParcelDataBlock[] ParcelData;
-
-        public ParcelClaimPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 209;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-            ParcelData = new ParcelDataBlock[0];
-        }
-
-        public ParcelClaimPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParcelData.Length < count) {
-                ParcelData = new ParcelDataBlock[count];
-                for(int j = 0; j < count; j++) ParcelData[j] = new ParcelDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParcelData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ParcelClaimPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParcelData.Length < count) {
-                ParcelData = new ParcelDataBlock[count];
-                for(int j = 0; j < count; j++) ParcelData[j] = new ParcelDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParcelData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            length++;
-            for (int j = 0; j < ParcelData.Length; j++) { length += ParcelData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ParcelData.Length;
-            for (int j = 0; j < ParcelData.Length; j++) { ParcelData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelClaim ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            for (int j = 0; j < ParcelData.Length; j++)
-            {
-                output += ParcelData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelJoinPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public float West;
-            public float South;
-            public float East;
-            public float North;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    West = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    South = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    East = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    North = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                ba = BitConverter.GetBytes(West);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(South);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(East);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(North);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("West: {0}", West));
-                output.AppendLine(String.Format("South: {0}", South));
-                output.AppendLine(String.Format("East: {0}", East));
-                output.Append(String.Format("North: {0}", North));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelJoin; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelJoinPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 210;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelJoinPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelJoinPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelJoin ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelDividePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public float West;
-            public float South;
-            public float East;
-            public float North;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    West = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    South = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    East = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    North = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                ba = BitConverter.GetBytes(West);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(South);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(East);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(North);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("West: {0}", West));
-                output.AppendLine(String.Format("South: {0}", South));
-                output.AppendLine(String.Format("East: {0}", East));
-                output.Append(String.Format("North: {0}", North));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelDivide; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelDividePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 211;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelDividePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelDividePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelDivide ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelReleasePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelRelease; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelReleasePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 212;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelReleasePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelReleasePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelRelease ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelBuyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID GroupID;
-            public bool IsGroupOwned;
-            public bool RemoveContribution;
-            public int LocalID;
-            public bool Final;
-
-            public int Length
-            {
-                get
-                {
-                    return 23;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    IsGroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RemoveContribution = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Final = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((IsGroupOwned) ? 1 : 0);
-                bytes[i++] = (byte)((RemoveContribution) ? 1 : 0);
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = (byte)((Final) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("IsGroupOwned: {0}", IsGroupOwned));
-                output.AppendLine(String.Format("RemoveContribution: {0}", RemoveContribution));
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("Final: {0}", Final));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int Price;
-            public int Area;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Price = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Area = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Price % 256);
-                bytes[i++] = (byte)((Price >> 8) % 256);
-                bytes[i++] = (byte)((Price >> 16) % 256);
-                bytes[i++] = (byte)((Price >> 24) % 256);
-                bytes[i++] = (byte)(Area % 256);
-                bytes[i++] = (byte)((Area >> 8) % 256);
-                bytes[i++] = (byte)((Area >> 16) % 256);
-                bytes[i++] = (byte)((Area >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("Price: {0}", Price));
-                output.Append(String.Format("Area: {0}", Area));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelBuy; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelBuyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 213;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelBuyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelBuyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelBuy ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelGodForceOwnerPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID OwnerID;
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelGodForceOwner; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelGodForceOwnerPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 214;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelGodForceOwnerPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelGodForceOwnerPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelGodForceOwner ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelAccessListRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public int SequenceID;
-            public uint Flags;
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SequenceID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(SequenceID % 256);
-                bytes[i++] = (byte)((SequenceID >> 8) % 256);
-                bytes[i++] = (byte)((SequenceID >> 16) % 256);
-                bytes[i++] = (byte)((SequenceID >> 24) % 256);
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("SequenceID: {0}", SequenceID));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelAccessListRequest; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelAccessListRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 215;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelAccessListRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelAccessListRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelAccessListRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelAccessListReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID AgentID;
-            public int SequenceID;
-            public uint Flags;
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 28;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SequenceID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SequenceID % 256);
-                bytes[i++] = (byte)((SequenceID >> 8) % 256);
-                bytes[i++] = (byte)((SequenceID >> 16) % 256);
-                bytes[i++] = (byte)((SequenceID >> 24) % 256);
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SequenceID: {0}", SequenceID));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ListBlock
-        {
-            public LLUUID ID;
-            public int Time;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public ListBlock() { }
-            public ListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    Time = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Time % 256);
-                bytes[i++] = (byte)((Time >> 8) % 256);
-                bytes[i++] = (byte)((Time >> 16) % 256);
-                bytes[i++] = (byte)((Time >> 24) % 256);
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- List --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.AppendLine(String.Format("Time: {0}", Time));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelAccessListReply; } }
-        public DataBlock Data;
-        public ListBlock[] List;
-
-        public ParcelAccessListReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 216;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Data = new DataBlock();
-            List = new ListBlock[0];
-        }
-
-        public ParcelAccessListReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(List.Length < count) {
-                List = new ListBlock[count];
-                for(int j = 0; j < count; j++) List[j] = new ListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { List[j].FromBytes(bytes, ref i); }
-        }
-
-        public ParcelAccessListReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Data.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(List.Length < count) {
-                List = new ListBlock[count];
-                for(int j = 0; j < count; j++) List[j] = new ListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { List[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Data.Length;;
-            length++;
-            for (int j = 0; j < List.Length; j++) { length += List[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)List.Length;
-            for (int j = 0; j < List.Length; j++) { List[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelAccessListReply ---" + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            for (int j = 0; j < List.Length; j++)
-            {
-                output += List[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelAccessListUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public uint Flags;
-            public int LocalID;
-            public LLUUID TransactionID;
-            public int SequenceID;
-            public int Sections;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    SequenceID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Sections = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SequenceID % 256);
-                bytes[i++] = (byte)((SequenceID >> 8) % 256);
-                bytes[i++] = (byte)((SequenceID >> 16) % 256);
-                bytes[i++] = (byte)((SequenceID >> 24) % 256);
-                bytes[i++] = (byte)(Sections % 256);
-                bytes[i++] = (byte)((Sections >> 8) % 256);
-                bytes[i++] = (byte)((Sections >> 16) % 256);
-                bytes[i++] = (byte)((Sections >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("SequenceID: {0}", SequenceID));
-                output.Append(String.Format("Sections: {0}", Sections));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ListBlock
-        {
-            public LLUUID ID;
-            public int Time;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public ListBlock() { }
-            public ListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    Time = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Time % 256);
-                bytes[i++] = (byte)((Time >> 8) % 256);
-                bytes[i++] = (byte)((Time >> 16) % 256);
-                bytes[i++] = (byte)((Time >> 24) % 256);
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- List --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.AppendLine(String.Format("Time: {0}", Time));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelAccessListUpdate; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-        public ListBlock[] List;
-
-        public ParcelAccessListUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 217;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-            List = new ListBlock[0];
-        }
-
-        public ParcelAccessListUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(List.Length < count) {
-                List = new ListBlock[count];
-                for(int j = 0; j < count; j++) List[j] = new ListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { List[j].FromBytes(bytes, ref i); }
-        }
-
-        public ParcelAccessListUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(List.Length < count) {
-                List = new ListBlock[count];
-                for(int j = 0; j < count; j++) List[j] = new ListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { List[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            length++;
-            for (int j = 0; j < List.Length; j++) { length += List[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)List.Length;
-            for (int j = 0; j < List.Length; j++) { List[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelAccessListUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            for (int j = 0; j < List.Length; j++)
-            {
-                output += List[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelDwellRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public int LocalID;
-            public LLUUID ParcelID;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("ParcelID: {0}", ParcelID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelDwellRequest; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelDwellRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 218;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelDwellRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelDwellRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelDwellRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelDwellReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public int LocalID;
-            public LLUUID ParcelID;
-            public float Dwell;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParcelID.FromBytes(bytes, i); i += 16;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Dwell = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                Buffer.BlockCopy(ParcelID.GetBytes(), 0, bytes, i, 16); i += 16;
-                ba = BitConverter.GetBytes(Dwell);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.AppendLine(String.Format("ParcelID: {0}", ParcelID));
-                output.Append(String.Format("Dwell: {0}", Dwell));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelDwellReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ParcelDwellReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 219;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ParcelDwellReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ParcelDwellReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelDwellReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelGodMarkAsContentPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelGodMarkAsContent; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelGodMarkAsContentPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 227;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelGodMarkAsContentPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelGodMarkAsContentPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelGodMarkAsContent ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ViewerStartAuctionPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int LocalID;
-            public LLUUID SnapshotID;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("SnapshotID: {0}", SnapshotID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ViewerStartAuction; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ViewerStartAuctionPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 228;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ViewerStartAuctionPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ViewerStartAuctionPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ViewerStartAuction ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UUIDNameRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class UUIDNameBlockBlock
-        {
-            public LLUUID ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public UUIDNameBlockBlock() { }
-            public UUIDNameBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UUIDNameBlock --");
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UUIDNameRequest; } }
-        public UUIDNameBlockBlock[] UUIDNameBlock;
-
-        public UUIDNameRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 235;
-            Header.Reliable = true;
-            UUIDNameBlock = new UUIDNameBlockBlock[0];
-        }
-
-        public UUIDNameRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(UUIDNameBlock.Length < count) {
-                UUIDNameBlock = new UUIDNameBlockBlock[count];
-                for(int j = 0; j < count; j++) UUIDNameBlock[j] = new UUIDNameBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { UUIDNameBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public UUIDNameRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(UUIDNameBlock.Length < count) {
-                UUIDNameBlock = new UUIDNameBlockBlock[count];
-                for(int j = 0; j < count; j++) UUIDNameBlock[j] = new UUIDNameBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { UUIDNameBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < UUIDNameBlock.Length; j++) { length += UUIDNameBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)UUIDNameBlock.Length;
-            for (int j = 0; j < UUIDNameBlock.Length; j++) { UUIDNameBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UUIDNameRequest ---" + Environment.NewLine;
-            for (int j = 0; j < UUIDNameBlock.Length; j++)
-            {
-                output += UUIDNameBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UUIDNameReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class UUIDNameBlockBlock
-        {
-            public LLUUID ID;
-            private byte[] _firstname;
-            public byte[] FirstName
-            {
-                get { return _firstname; }
-                set
-                {
-                    if (value == null) { _firstname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _firstname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _firstname, 0, value.Length); }
-                }
-            }
-            private byte[] _lastname;
-            public byte[] LastName
-            {
-                get { return _lastname; }
-                set
-                {
-                    if (value == null) { _lastname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _lastname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _lastname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (FirstName != null) { length += 1 + FirstName.Length; }
-                    if (LastName != null) { length += 1 + LastName.Length; }
-                    return length;
-                }
-            }
-
-            public UUIDNameBlockBlock() { }
-            public UUIDNameBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _firstname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _firstname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _lastname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _lastname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(FirstName == null) { Console.WriteLine("Warning: FirstName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FirstName.Length;
-                Buffer.BlockCopy(FirstName, 0, bytes, i, FirstName.Length); i += FirstName.Length;
-                if(LastName == null) { Console.WriteLine("Warning: LastName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)LastName.Length;
-                Buffer.BlockCopy(LastName, 0, bytes, i, LastName.Length); i += LastName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UUIDNameBlock --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                Helpers.FieldToString(output, FirstName, "FirstName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, LastName, "LastName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UUIDNameReply; } }
-        public UUIDNameBlockBlock[] UUIDNameBlock;
-
-        public UUIDNameReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 236;
-            Header.Reliable = true;
-            UUIDNameBlock = new UUIDNameBlockBlock[0];
-        }
-
-        public UUIDNameReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(UUIDNameBlock.Length < count) {
-                UUIDNameBlock = new UUIDNameBlockBlock[count];
-                for(int j = 0; j < count; j++) UUIDNameBlock[j] = new UUIDNameBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { UUIDNameBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public UUIDNameReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(UUIDNameBlock.Length < count) {
-                UUIDNameBlock = new UUIDNameBlockBlock[count];
-                for(int j = 0; j < count; j++) UUIDNameBlock[j] = new UUIDNameBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { UUIDNameBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < UUIDNameBlock.Length; j++) { length += UUIDNameBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)UUIDNameBlock.Length;
-            for (int j = 0; j < UUIDNameBlock.Length; j++) { UUIDNameBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UUIDNameReply ---" + Environment.NewLine;
-            for (int j = 0; j < UUIDNameBlock.Length; j++)
-            {
-                output += UUIDNameBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UUIDGroupNameRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class UUIDNameBlockBlock
-        {
-            public LLUUID ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public UUIDNameBlockBlock() { }
-            public UUIDNameBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UUIDNameBlock --");
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UUIDGroupNameRequest; } }
-        public UUIDNameBlockBlock[] UUIDNameBlock;
-
-        public UUIDGroupNameRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 237;
-            Header.Reliable = true;
-            UUIDNameBlock = new UUIDNameBlockBlock[0];
-        }
-
-        public UUIDGroupNameRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(UUIDNameBlock.Length < count) {
-                UUIDNameBlock = new UUIDNameBlockBlock[count];
-                for(int j = 0; j < count; j++) UUIDNameBlock[j] = new UUIDNameBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { UUIDNameBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public UUIDGroupNameRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(UUIDNameBlock.Length < count) {
-                UUIDNameBlock = new UUIDNameBlockBlock[count];
-                for(int j = 0; j < count; j++) UUIDNameBlock[j] = new UUIDNameBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { UUIDNameBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < UUIDNameBlock.Length; j++) { length += UUIDNameBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)UUIDNameBlock.Length;
-            for (int j = 0; j < UUIDNameBlock.Length; j++) { UUIDNameBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UUIDGroupNameRequest ---" + Environment.NewLine;
-            for (int j = 0; j < UUIDNameBlock.Length; j++)
-            {
-                output += UUIDNameBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UUIDGroupNameReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class UUIDNameBlockBlock
-        {
-            public LLUUID ID;
-            private byte[] _groupname;
-            public byte[] GroupName
-            {
-                get { return _groupname; }
-                set
-                {
-                    if (value == null) { _groupname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _groupname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _groupname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (GroupName != null) { length += 1 + GroupName.Length; }
-                    return length;
-                }
-            }
-
-            public UUIDNameBlockBlock() { }
-            public UUIDNameBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _groupname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _groupname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(GroupName == null) { Console.WriteLine("Warning: GroupName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)GroupName.Length;
-                Buffer.BlockCopy(GroupName, 0, bytes, i, GroupName.Length); i += GroupName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UUIDNameBlock --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                Helpers.FieldToString(output, GroupName, "GroupName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UUIDGroupNameReply; } }
-        public UUIDNameBlockBlock[] UUIDNameBlock;
-
-        public UUIDGroupNameReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 238;
-            Header.Reliable = true;
-            UUIDNameBlock = new UUIDNameBlockBlock[0];
-        }
-
-        public UUIDGroupNameReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(UUIDNameBlock.Length < count) {
-                UUIDNameBlock = new UUIDNameBlockBlock[count];
-                for(int j = 0; j < count; j++) UUIDNameBlock[j] = new UUIDNameBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { UUIDNameBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public UUIDGroupNameReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(UUIDNameBlock.Length < count) {
-                UUIDNameBlock = new UUIDNameBlockBlock[count];
-                for(int j = 0; j < count; j++) UUIDNameBlock[j] = new UUIDNameBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { UUIDNameBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < UUIDNameBlock.Length; j++) { length += UUIDNameBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)UUIDNameBlock.Length;
-            for (int j = 0; j < UUIDNameBlock.Length; j++) { UUIDNameBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UUIDGroupNameReply ---" + Environment.NewLine;
-            for (int j = 0; j < UUIDNameBlock.Length; j++)
-            {
-                output += UUIDNameBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChildAgentDyingPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChildAgentDying; } }
-        public AgentDataBlock AgentData;
-
-        public ChildAgentDyingPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 240;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public ChildAgentDyingPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public ChildAgentDyingPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChildAgentDying ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChildAgentUnknownPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChildAgentUnknown; } }
-        public AgentDataBlock AgentData;
-
-        public ChildAgentUnknownPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 241;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public ChildAgentUnknownPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public ChildAgentUnknownPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChildAgentUnknown ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GetScriptRunningPacket : Packet
-    {
-        /// <exclude/>
-        public class ScriptBlock
-        {
-            public LLUUID ObjectID;
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public ScriptBlock() { }
-            public ScriptBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Script --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GetScriptRunning; } }
-        public ScriptBlock Script;
-
-        public GetScriptRunningPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 243;
-            Header.Reliable = true;
-            Script = new ScriptBlock();
-        }
-
-        public GetScriptRunningPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Script.FromBytes(bytes, ref i);
-        }
-
-        public GetScriptRunningPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Script.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Script.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Script.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GetScriptRunning ---" + Environment.NewLine;
-                output += Script.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptRunningReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class ScriptBlock
-        {
-            public LLUUID ObjectID;
-            public LLUUID ItemID;
-            public bool Running;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public ScriptBlock() { }
-            public ScriptBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    Running = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Running) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Script --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("Running: {0}", Running));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptRunningReply; } }
-        public ScriptBlock Script;
-
-        public ScriptRunningReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 244;
-            Header.Reliable = true;
-            Script = new ScriptBlock();
-        }
-
-        public ScriptRunningReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Script.FromBytes(bytes, ref i);
-        }
-
-        public ScriptRunningReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Script.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Script.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Script.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptRunningReply ---" + Environment.NewLine;
-                output += Script.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SetScriptRunningPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ScriptBlock
-        {
-            public LLUUID ObjectID;
-            public LLUUID ItemID;
-            public bool Running;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public ScriptBlock() { }
-            public ScriptBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    Running = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Running) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Script --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("Running: {0}", Running));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SetScriptRunning; } }
-        public AgentDataBlock AgentData;
-        public ScriptBlock Script;
-
-        public SetScriptRunningPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 245;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Script = new ScriptBlock();
-        }
-
-        public SetScriptRunningPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Script.FromBytes(bytes, ref i);
-        }
-
-        public SetScriptRunningPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Script.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Script.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Script.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SetScriptRunning ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Script.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptResetPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ScriptBlock
-        {
-            public LLUUID ObjectID;
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public ScriptBlock() { }
-            public ScriptBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Script --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptReset; } }
-        public AgentDataBlock AgentData;
-        public ScriptBlock Script;
-
-        public ScriptResetPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 246;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Script = new ScriptBlock();
-        }
-
-        public ScriptResetPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Script.FromBytes(bytes, ref i);
-        }
-
-        public ScriptResetPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Script.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Script.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Script.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptReset ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Script.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptSensorRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class RequesterBlock
-        {
-            public LLUUID SourceID;
-            public LLUUID RequestID;
-            public LLUUID SearchID;
-            public LLVector3 SearchPos;
-            public LLQuaternion SearchDir;
-            private byte[] _searchname;
-            public byte[] SearchName
-            {
-                get { return _searchname; }
-                set
-                {
-                    if (value == null) { _searchname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _searchname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _searchname, 0, value.Length); }
-                }
-            }
-            public int Type;
-            public float Range;
-            public float Arc;
-            public ulong RegionHandle;
-            public byte SearchRegions;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 93;
-                    if (SearchName != null) { length += 1 + SearchName.Length; }
-                    return length;
-                }
-            }
-
-            public RequesterBlock() { }
-            public RequesterBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    SourceID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    SearchID.FromBytes(bytes, i); i += 16;
-                    SearchPos.FromBytes(bytes, i); i += 12;
-                    SearchDir.FromBytes(bytes, i, true); i += 12;
-                    length = (ushort)bytes[i++];
-                    _searchname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _searchname, 0, length); i += length;
-                    Type = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Range = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Arc = BitConverter.ToSingle(bytes, i); i += 4;
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    SearchRegions = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(SourceID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SearchID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SearchPos.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(SearchDir.GetBytes(), 0, bytes, i, 12); i += 12;
-                if(SearchName == null) { Console.WriteLine("Warning: SearchName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SearchName.Length;
-                Buffer.BlockCopy(SearchName, 0, bytes, i, SearchName.Length); i += SearchName.Length;
-                bytes[i++] = (byte)(Type % 256);
-                bytes[i++] = (byte)((Type >> 8) % 256);
-                bytes[i++] = (byte)((Type >> 16) % 256);
-                bytes[i++] = (byte)((Type >> 24) % 256);
-                ba = BitConverter.GetBytes(Range);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(Arc);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = SearchRegions;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Requester --");
-                output.AppendLine(String.Format("SourceID: {0}", SourceID));
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.AppendLine(String.Format("SearchID: {0}", SearchID));
-                output.AppendLine(String.Format("SearchPos: {0}", SearchPos));
-                output.AppendLine(String.Format("SearchDir: {0}", SearchDir));
-                Helpers.FieldToString(output, SearchName, "SearchName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("Range: {0}", Range));
-                output.AppendLine(String.Format("Arc: {0}", Arc));
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.Append(String.Format("SearchRegions: {0}", SearchRegions));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptSensorRequest; } }
-        public RequesterBlock Requester;
-
-        public ScriptSensorRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 247;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Requester = new RequesterBlock();
-        }
-
-        public ScriptSensorRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Requester.FromBytes(bytes, ref i);
-        }
-
-        public ScriptSensorRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Requester.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Requester.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Requester.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptSensorRequest ---" + Environment.NewLine;
-                output += Requester.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ScriptSensorReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class RequesterBlock
-        {
-            public LLUUID SourceID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public RequesterBlock() { }
-            public RequesterBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SourceID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(SourceID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Requester --");
-                output.Append(String.Format("SourceID: {0}", SourceID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class SensedDataBlock
-        {
-            public LLUUID ObjectID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public LLVector3 Position;
-            public LLVector3 Velocity;
-            public LLQuaternion Rotation;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            public int Type;
-            public float Range;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 92;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public SensedDataBlock() { }
-            public SensedDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    Position.FromBytes(bytes, i); i += 12;
-                    Velocity.FromBytes(bytes, i); i += 12;
-                    Rotation.FromBytes(bytes, i, true); i += 12;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    Type = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Range = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Velocity.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                bytes[i++] = (byte)(Type % 256);
-                bytes[i++] = (byte)((Type >> 8) % 256);
-                bytes[i++] = (byte)((Type >> 16) % 256);
-                bytes[i++] = (byte)((Type >> 24) % 256);
-                ba = BitConverter.GetBytes(Range);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SensedData --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.AppendLine(String.Format("Velocity: {0}", Velocity));
-                output.AppendLine(String.Format("Rotation: {0}", Rotation));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.Append(String.Format("Range: {0}", Range));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ScriptSensorReply; } }
-        public RequesterBlock Requester;
-        public SensedDataBlock[] SensedData;
-
-        public ScriptSensorReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 248;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            Requester = new RequesterBlock();
-            SensedData = new SensedDataBlock[0];
-        }
-
-        public ScriptSensorReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Requester.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(SensedData.Length < count) {
-                SensedData = new SensedDataBlock[count];
-                for(int j = 0; j < count; j++) SensedData[j] = new SensedDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { SensedData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ScriptSensorReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Requester.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(SensedData.Length < count) {
-                SensedData = new SensedDataBlock[count];
-                for(int j = 0; j < count; j++) SensedData[j] = new SensedDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { SensedData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += Requester.Length;;
-            length++;
-            for (int j = 0; j < SensedData.Length; j++) { length += SensedData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Requester.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)SensedData.Length;
-            for (int j = 0; j < SensedData.Length; j++) { SensedData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ScriptSensorReply ---" + Environment.NewLine;
-                output += Requester.ToString() + Environment.NewLine;
-            for (int j = 0; j < SensedData.Length; j++)
-            {
-                output += SensedData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CompleteAgentMovementPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint CircuitCode;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    CircuitCode = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CircuitCode % 256);
-                bytes[i++] = (byte)((CircuitCode >> 8) % 256);
-                bytes[i++] = (byte)((CircuitCode >> 16) % 256);
-                bytes[i++] = (byte)((CircuitCode >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("CircuitCode: {0}", CircuitCode));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CompleteAgentMovement; } }
-        public AgentDataBlock AgentData;
-
-        public CompleteAgentMovementPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 249;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public CompleteAgentMovementPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public CompleteAgentMovementPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CompleteAgentMovement ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentMovementCompletePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLVector3 Position;
-            public LLVector3 LookAt;
-            public ulong RegionHandle;
-            public uint Timestamp;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Position.FromBytes(bytes, i); i += 12;
-                    LookAt.FromBytes(bytes, i); i += 12;
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    Timestamp = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = (byte)(Timestamp % 256);
-                bytes[i++] = (byte)((Timestamp >> 8) % 256);
-                bytes[i++] = (byte)((Timestamp >> 16) % 256);
-                bytes[i++] = (byte)((Timestamp >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.AppendLine(String.Format("LookAt: {0}", LookAt));
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.Append(String.Format("Timestamp: {0}", Timestamp));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class SimDataBlock
-        {
-            private byte[] _channelversion;
-            public byte[] ChannelVersion
-            {
-                get { return _channelversion; }
-                set
-                {
-                    if (value == null) { _channelversion = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _channelversion = new byte[value.Length]; Buffer.BlockCopy(value, 0, _channelversion, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (ChannelVersion != null) { length += 2 + ChannelVersion.Length; }
-                    return length;
-                }
-            }
-
-            public SimDataBlock() { }
-            public SimDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _channelversion = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _channelversion, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(ChannelVersion == null) { Console.WriteLine("Warning: ChannelVersion is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(ChannelVersion.Length % 256);
-                bytes[i++] = (byte)((ChannelVersion.Length >> 8) % 256);
-                Buffer.BlockCopy(ChannelVersion, 0, bytes, i, ChannelVersion.Length); i += ChannelVersion.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SimData --");
-                Helpers.FieldToString(output, ChannelVersion, "ChannelVersion");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentMovementComplete; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-        public SimDataBlock SimData;
-
-        public AgentMovementCompletePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 250;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-            SimData = new SimDataBlock();
-        }
-
-        public AgentMovementCompletePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            SimData.FromBytes(bytes, ref i);
-        }
-
-        public AgentMovementCompletePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            SimData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;            length += SimData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            SimData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentMovementComplete ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-                output += SimData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LogoutRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LogoutRequest; } }
-        public AgentDataBlock AgentData;
-
-        public LogoutRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 252;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public LogoutRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public LogoutRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LogoutRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LogoutReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LogoutReply; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public LogoutReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 253;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public LogoutReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public LogoutReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LogoutReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ImprovedInstantMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MessageBlockBlock
-        {
-            public bool FromGroup;
-            public LLUUID ToAgentID;
-            public uint ParentEstateID;
-            public LLUUID RegionID;
-            public LLVector3 Position;
-            public byte Offline;
-            public byte Dialog;
-            public LLUUID ID;
-            public uint Timestamp;
-            private byte[] _fromagentname;
-            public byte[] FromAgentName
-            {
-                get { return _fromagentname; }
-                set
-                {
-                    if (value == null) { _fromagentname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _fromagentname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _fromagentname, 0, value.Length); }
-                }
-            }
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-            private byte[] _binarybucket;
-            public byte[] BinaryBucket
-            {
-                get { return _binarybucket; }
-                set
-                {
-                    if (value == null) { _binarybucket = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _binarybucket = new byte[value.Length]; Buffer.BlockCopy(value, 0, _binarybucket, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 71;
-                    if (FromAgentName != null) { length += 1 + FromAgentName.Length; }
-                    if (Message != null) { length += 2 + Message.Length; }
-                    if (BinaryBucket != null) { length += 2 + BinaryBucket.Length; }
-                    return length;
-                }
-            }
-
-            public MessageBlockBlock() { }
-            public MessageBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    FromGroup = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    ToAgentID.FromBytes(bytes, i); i += 16;
-                    ParentEstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RegionID.FromBytes(bytes, i); i += 16;
-                    Position.FromBytes(bytes, i); i += 12;
-                    Offline = (byte)bytes[i++];
-                    Dialog = (byte)bytes[i++];
-                    ID.FromBytes(bytes, i); i += 16;
-                    Timestamp = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _fromagentname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _fromagentname, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _binarybucket = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _binarybucket, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((FromGroup) ? 1 : 0);
-                Buffer.BlockCopy(ToAgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ParentEstateID % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 8) % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 16) % 256);
-                bytes[i++] = (byte)((ParentEstateID >> 24) % 256);
-                Buffer.BlockCopy(RegionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = Offline;
-                bytes[i++] = Dialog;
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Timestamp % 256);
-                bytes[i++] = (byte)((Timestamp >> 8) % 256);
-                bytes[i++] = (byte)((Timestamp >> 16) % 256);
-                bytes[i++] = (byte)((Timestamp >> 24) % 256);
-                if(FromAgentName == null) { Console.WriteLine("Warning: FromAgentName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FromAgentName.Length;
-                Buffer.BlockCopy(FromAgentName, 0, bytes, i, FromAgentName.Length); i += FromAgentName.Length;
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Message.Length % 256);
-                bytes[i++] = (byte)((Message.Length >> 8) % 256);
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-                if(BinaryBucket == null) { Console.WriteLine("Warning: BinaryBucket is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(BinaryBucket.Length % 256);
-                bytes[i++] = (byte)((BinaryBucket.Length >> 8) % 256);
-                Buffer.BlockCopy(BinaryBucket, 0, bytes, i, BinaryBucket.Length); i += BinaryBucket.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MessageBlock --");
-                output.AppendLine(String.Format("FromGroup: {0}", FromGroup));
-                output.AppendLine(String.Format("ToAgentID: {0}", ToAgentID));
-                output.AppendLine(String.Format("ParentEstateID: {0}", ParentEstateID));
-                output.AppendLine(String.Format("RegionID: {0}", RegionID));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.AppendLine(String.Format("Offline: {0}", Offline));
-                output.AppendLine(String.Format("Dialog: {0}", Dialog));
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.AppendLine(String.Format("Timestamp: {0}", Timestamp));
-                Helpers.FieldToString(output, FromAgentName, "FromAgentName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Message, "Message");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, BinaryBucket, "BinaryBucket");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ImprovedInstantMessage; } }
-        public AgentDataBlock AgentData;
-        public MessageBlockBlock MessageBlock;
-
-        public ImprovedInstantMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 254;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MessageBlock = new MessageBlockBlock();
-        }
-
-        public ImprovedInstantMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MessageBlock.FromBytes(bytes, ref i);
-        }
-
-        public ImprovedInstantMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MessageBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MessageBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MessageBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ImprovedInstantMessage ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MessageBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RetrieveInstantMessagesPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RetrieveInstantMessages; } }
-        public AgentDataBlock AgentData;
-
-        public RetrieveInstantMessagesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 255;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public RetrieveInstantMessagesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public RetrieveInstantMessagesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RetrieveInstantMessages ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class FindAgentPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentBlockBlock
-        {
-            public LLUUID Hunter;
-            public LLUUID Prey;
-            public uint SpaceIP;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentBlockBlock() { }
-            public AgentBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Hunter.FromBytes(bytes, i); i += 16;
-                    Prey.FromBytes(bytes, i); i += 16;
-                    SpaceIP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(Hunter.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(Prey.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SpaceIP % 256);
-                bytes[i++] = (byte)((SpaceIP >> 8) % 256);
-                bytes[i++] = (byte)((SpaceIP >> 16) % 256);
-                bytes[i++] = (byte)((SpaceIP >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentBlock --");
-                output.AppendLine(String.Format("Hunter: {0}", Hunter));
-                output.AppendLine(String.Format("Prey: {0}", Prey));
-                output.Append(String.Format("SpaceIP: {0}", SpaceIP));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class LocationBlockBlock
-        {
-            public double GlobalX;
-            public double GlobalY;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public LocationBlockBlock() { }
-            public LocationBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 8);
-                    GlobalX = BitConverter.ToDouble(bytes, i); i += 8;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 8);
-                    GlobalY = BitConverter.ToDouble(bytes, i); i += 8;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                ba = BitConverter.GetBytes(GlobalX);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 8); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 8); i += 8;
-                ba = BitConverter.GetBytes(GlobalY);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 8); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 8); i += 8;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- LocationBlock --");
-                output.AppendLine(String.Format("GlobalX: {0}", GlobalX));
-                output.Append(String.Format("GlobalY: {0}", GlobalY));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.FindAgent; } }
-        public AgentBlockBlock AgentBlock;
-        public LocationBlockBlock[] LocationBlock;
-
-        public FindAgentPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 256;
-            Header.Reliable = true;
-            AgentBlock = new AgentBlockBlock();
-            LocationBlock = new LocationBlockBlock[0];
-        }
-
-        public FindAgentPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(LocationBlock.Length < count) {
-                LocationBlock = new LocationBlockBlock[count];
-                for(int j = 0; j < count; j++) LocationBlock[j] = new LocationBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { LocationBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public FindAgentPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(LocationBlock.Length < count) {
-                LocationBlock = new LocationBlockBlock[count];
-                for(int j = 0; j < count; j++) LocationBlock[j] = new LocationBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { LocationBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentBlock.Length;;
-            length++;
-            for (int j = 0; j < LocationBlock.Length; j++) { length += LocationBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentBlock.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)LocationBlock.Length;
-            for (int j = 0; j < LocationBlock.Length; j++) { LocationBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- FindAgent ---" + Environment.NewLine;
-                output += AgentBlock.ToString() + Environment.NewLine;
-            for (int j = 0; j < LocationBlock.Length; j++)
-            {
-                output += LocationBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestGodlikePowersPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RequestBlockBlock
-        {
-            public bool Godlike;
-            public LLUUID Token;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public RequestBlockBlock() { }
-            public RequestBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Godlike = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    Token.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((Godlike) ? 1 : 0);
-                Buffer.BlockCopy(Token.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RequestBlock --");
-                output.AppendLine(String.Format("Godlike: {0}", Godlike));
-                output.Append(String.Format("Token: {0}", Token));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestGodlikePowers; } }
-        public AgentDataBlock AgentData;
-        public RequestBlockBlock RequestBlock;
-
-        public RequestGodlikePowersPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 257;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            RequestBlock = new RequestBlockBlock();
-        }
-
-        public RequestGodlikePowersPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RequestBlock.FromBytes(bytes, ref i);
-        }
-
-        public RequestGodlikePowersPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RequestBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RequestBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RequestBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestGodlikePowers ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RequestBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GrantGodlikePowersPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GrantDataBlock
-        {
-            public byte GodLevel;
-            public LLUUID Token;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public GrantDataBlock() { }
-            public GrantDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GodLevel = (byte)bytes[i++];
-                    Token.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = GodLevel;
-                Buffer.BlockCopy(Token.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GrantData --");
-                output.AppendLine(String.Format("GodLevel: {0}", GodLevel));
-                output.Append(String.Format("Token: {0}", Token));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GrantGodlikePowers; } }
-        public AgentDataBlock AgentData;
-        public GrantDataBlock GrantData;
-
-        public GrantGodlikePowersPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 258;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GrantData = new GrantDataBlock();
-        }
-
-        public GrantGodlikePowersPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GrantData.FromBytes(bytes, ref i);
-        }
-
-        public GrantGodlikePowersPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GrantData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GrantData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GrantData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GrantGodlikePowers ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GrantData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GodlikeMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MethodDataBlock
-        {
-            private byte[] _method;
-            public byte[] Method
-            {
-                get { return _method; }
-                set
-                {
-                    if (value == null) { _method = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _method = new byte[value.Length]; Buffer.BlockCopy(value, 0, _method, 0, value.Length); }
-                }
-            }
-            public LLUUID Invoice;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Method != null) { length += 1 + Method.Length; }
-                    return length;
-                }
-            }
-
-            public MethodDataBlock() { }
-            public MethodDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _method = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _method, 0, length); i += length;
-                    Invoice.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Method == null) { Console.WriteLine("Warning: Method is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Method.Length;
-                Buffer.BlockCopy(Method, 0, bytes, i, Method.Length); i += Method.Length;
-                Buffer.BlockCopy(Invoice.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MethodData --");
-                Helpers.FieldToString(output, Method, "Method");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("Invoice: {0}", Invoice));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParamListBlock
-        {
-            private byte[] _parameter;
-            public byte[] Parameter
-            {
-                get { return _parameter; }
-                set
-                {
-                    if (value == null) { _parameter = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _parameter = new byte[value.Length]; Buffer.BlockCopy(value, 0, _parameter, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Parameter != null) { length += 1 + Parameter.Length; }
-                    return length;
-                }
-            }
-
-            public ParamListBlock() { }
-            public ParamListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _parameter = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _parameter, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Parameter == null) { Console.WriteLine("Warning: Parameter is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Parameter.Length;
-                Buffer.BlockCopy(Parameter, 0, bytes, i, Parameter.Length); i += Parameter.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParamList --");
-                Helpers.FieldToString(output, Parameter, "Parameter");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GodlikeMessage; } }
-        public AgentDataBlock AgentData;
-        public MethodDataBlock MethodData;
-        public ParamListBlock[] ParamList;
-
-        public GodlikeMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 259;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MethodData = new MethodDataBlock();
-            ParamList = new ParamListBlock[0];
-        }
-
-        public GodlikeMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MethodData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParamList.Length < count) {
-                ParamList = new ParamListBlock[count];
-                for(int j = 0; j < count; j++) ParamList[j] = new ParamListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParamList[j].FromBytes(bytes, ref i); }
-        }
-
-        public GodlikeMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MethodData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParamList.Length < count) {
-                ParamList = new ParamListBlock[count];
-                for(int j = 0; j < count; j++) ParamList[j] = new ParamListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParamList[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MethodData.Length;;
-            length++;
-            for (int j = 0; j < ParamList.Length; j++) { length += ParamList[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MethodData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ParamList.Length;
-            for (int j = 0; j < ParamList.Length; j++) { ParamList[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GodlikeMessage ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MethodData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ParamList.Length; j++)
-            {
-                output += ParamList[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EstateOwnerMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MethodDataBlock
-        {
-            private byte[] _method;
-            public byte[] Method
-            {
-                get { return _method; }
-                set
-                {
-                    if (value == null) { _method = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _method = new byte[value.Length]; Buffer.BlockCopy(value, 0, _method, 0, value.Length); }
-                }
-            }
-            public LLUUID Invoice;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Method != null) { length += 1 + Method.Length; }
-                    return length;
-                }
-            }
-
-            public MethodDataBlock() { }
-            public MethodDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _method = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _method, 0, length); i += length;
-                    Invoice.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Method == null) { Console.WriteLine("Warning: Method is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Method.Length;
-                Buffer.BlockCopy(Method, 0, bytes, i, Method.Length); i += Method.Length;
-                Buffer.BlockCopy(Invoice.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MethodData --");
-                Helpers.FieldToString(output, Method, "Method");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("Invoice: {0}", Invoice));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParamListBlock
-        {
-            private byte[] _parameter;
-            public byte[] Parameter
-            {
-                get { return _parameter; }
-                set
-                {
-                    if (value == null) { _parameter = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _parameter = new byte[value.Length]; Buffer.BlockCopy(value, 0, _parameter, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Parameter != null) { length += 1 + Parameter.Length; }
-                    return length;
-                }
-            }
-
-            public ParamListBlock() { }
-            public ParamListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _parameter = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _parameter, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Parameter == null) { Console.WriteLine("Warning: Parameter is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Parameter.Length;
-                Buffer.BlockCopy(Parameter, 0, bytes, i, Parameter.Length); i += Parameter.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParamList --");
-                Helpers.FieldToString(output, Parameter, "Parameter");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EstateOwnerMessage; } }
-        public AgentDataBlock AgentData;
-        public MethodDataBlock MethodData;
-        public ParamListBlock[] ParamList;
-
-        public EstateOwnerMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 260;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MethodData = new MethodDataBlock();
-            ParamList = new ParamListBlock[0];
-        }
-
-        public EstateOwnerMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MethodData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParamList.Length < count) {
-                ParamList = new ParamListBlock[count];
-                for(int j = 0; j < count; j++) ParamList[j] = new ParamListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParamList[j].FromBytes(bytes, ref i); }
-        }
-
-        public EstateOwnerMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MethodData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParamList.Length < count) {
-                ParamList = new ParamListBlock[count];
-                for(int j = 0; j < count; j++) ParamList[j] = new ParamListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParamList[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MethodData.Length;;
-            length++;
-            for (int j = 0; j < ParamList.Length; j++) { length += ParamList[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MethodData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ParamList.Length;
-            for (int j = 0; j < ParamList.Length; j++) { ParamList[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EstateOwnerMessage ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MethodData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ParamList.Length; j++)
-            {
-                output += ParamList[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GenericMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MethodDataBlock
-        {
-            private byte[] _method;
-            public byte[] Method
-            {
-                get { return _method; }
-                set
-                {
-                    if (value == null) { _method = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _method = new byte[value.Length]; Buffer.BlockCopy(value, 0, _method, 0, value.Length); }
-                }
-            }
-            public LLUUID Invoice;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Method != null) { length += 1 + Method.Length; }
-                    return length;
-                }
-            }
-
-            public MethodDataBlock() { }
-            public MethodDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _method = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _method, 0, length); i += length;
-                    Invoice.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Method == null) { Console.WriteLine("Warning: Method is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Method.Length;
-                Buffer.BlockCopy(Method, 0, bytes, i, Method.Length); i += Method.Length;
-                Buffer.BlockCopy(Invoice.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MethodData --");
-                Helpers.FieldToString(output, Method, "Method");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("Invoice: {0}", Invoice));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParamListBlock
-        {
-            private byte[] _parameter;
-            public byte[] Parameter
-            {
-                get { return _parameter; }
-                set
-                {
-                    if (value == null) { _parameter = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _parameter = new byte[value.Length]; Buffer.BlockCopy(value, 0, _parameter, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Parameter != null) { length += 1 + Parameter.Length; }
-                    return length;
-                }
-            }
-
-            public ParamListBlock() { }
-            public ParamListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _parameter = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _parameter, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Parameter == null) { Console.WriteLine("Warning: Parameter is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Parameter.Length;
-                Buffer.BlockCopy(Parameter, 0, bytes, i, Parameter.Length); i += Parameter.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParamList --");
-                Helpers.FieldToString(output, Parameter, "Parameter");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GenericMessage; } }
-        public AgentDataBlock AgentData;
-        public MethodDataBlock MethodData;
-        public ParamListBlock[] ParamList;
-
-        public GenericMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 261;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MethodData = new MethodDataBlock();
-            ParamList = new ParamListBlock[0];
-        }
-
-        public GenericMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MethodData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParamList.Length < count) {
-                ParamList = new ParamListBlock[count];
-                for(int j = 0; j < count; j++) ParamList[j] = new ParamListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParamList[j].FromBytes(bytes, ref i); }
-        }
-
-        public GenericMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MethodData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParamList.Length < count) {
-                ParamList = new ParamListBlock[count];
-                for(int j = 0; j < count; j++) ParamList[j] = new ParamListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParamList[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MethodData.Length;;
-            length++;
-            for (int j = 0; j < ParamList.Length; j++) { length += ParamList[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MethodData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ParamList.Length;
-            for (int j = 0; j < ParamList.Length; j++) { ParamList[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GenericMessage ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MethodData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ParamList.Length; j++)
-            {
-                output += ParamList[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MuteListRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MuteDataBlock
-        {
-            public uint MuteCRC;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public MuteDataBlock() { }
-            public MuteDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    MuteCRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(MuteCRC % 256);
-                bytes[i++] = (byte)((MuteCRC >> 8) % 256);
-                bytes[i++] = (byte)((MuteCRC >> 16) % 256);
-                bytes[i++] = (byte)((MuteCRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MuteData --");
-                output.Append(String.Format("MuteCRC: {0}", MuteCRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MuteListRequest; } }
-        public AgentDataBlock AgentData;
-        public MuteDataBlock MuteData;
-
-        public MuteListRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 262;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            MuteData = new MuteDataBlock();
-        }
-
-        public MuteListRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MuteData.FromBytes(bytes, ref i);
-        }
-
-        public MuteListRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MuteData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MuteData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MuteData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MuteListRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MuteData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UpdateMuteListEntryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MuteDataBlock
-        {
-            public LLUUID MuteID;
-            private byte[] _mutename;
-            public byte[] MuteName
-            {
-                get { return _mutename; }
-                set
-                {
-                    if (value == null) { _mutename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mutename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mutename, 0, value.Length); }
-                }
-            }
-            public int MuteType;
-            public uint MuteFlags;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (MuteName != null) { length += 1 + MuteName.Length; }
-                    return length;
-                }
-            }
-
-            public MuteDataBlock() { }
-            public MuteDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    MuteID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _mutename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mutename, 0, length); i += length;
-                    MuteType = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    MuteFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(MuteID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(MuteName == null) { Console.WriteLine("Warning: MuteName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MuteName.Length;
-                Buffer.BlockCopy(MuteName, 0, bytes, i, MuteName.Length); i += MuteName.Length;
-                bytes[i++] = (byte)(MuteType % 256);
-                bytes[i++] = (byte)((MuteType >> 8) % 256);
-                bytes[i++] = (byte)((MuteType >> 16) % 256);
-                bytes[i++] = (byte)((MuteType >> 24) % 256);
-                bytes[i++] = (byte)(MuteFlags % 256);
-                bytes[i++] = (byte)((MuteFlags >> 8) % 256);
-                bytes[i++] = (byte)((MuteFlags >> 16) % 256);
-                bytes[i++] = (byte)((MuteFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MuteData --");
-                output.AppendLine(String.Format("MuteID: {0}", MuteID));
-                Helpers.FieldToString(output, MuteName, "MuteName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("MuteType: {0}", MuteType));
-                output.Append(String.Format("MuteFlags: {0}", MuteFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UpdateMuteListEntry; } }
-        public AgentDataBlock AgentData;
-        public MuteDataBlock MuteData;
-
-        public UpdateMuteListEntryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 263;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            MuteData = new MuteDataBlock();
-        }
-
-        public UpdateMuteListEntryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MuteData.FromBytes(bytes, ref i);
-        }
-
-        public UpdateMuteListEntryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MuteData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MuteData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MuteData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UpdateMuteListEntry ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MuteData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RemoveMuteListEntryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MuteDataBlock
-        {
-            public LLUUID MuteID;
-            private byte[] _mutename;
-            public byte[] MuteName
-            {
-                get { return _mutename; }
-                set
-                {
-                    if (value == null) { _mutename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mutename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mutename, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (MuteName != null) { length += 1 + MuteName.Length; }
-                    return length;
-                }
-            }
-
-            public MuteDataBlock() { }
-            public MuteDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    MuteID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _mutename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mutename, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(MuteID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(MuteName == null) { Console.WriteLine("Warning: MuteName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MuteName.Length;
-                Buffer.BlockCopy(MuteName, 0, bytes, i, MuteName.Length); i += MuteName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MuteData --");
-                output.AppendLine(String.Format("MuteID: {0}", MuteID));
-                Helpers.FieldToString(output, MuteName, "MuteName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RemoveMuteListEntry; } }
-        public AgentDataBlock AgentData;
-        public MuteDataBlock MuteData;
-
-        public RemoveMuteListEntryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 264;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            MuteData = new MuteDataBlock();
-        }
-
-        public RemoveMuteListEntryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MuteData.FromBytes(bytes, ref i);
-        }
-
-        public RemoveMuteListEntryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MuteData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MuteData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MuteData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RemoveMuteListEntry ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MuteData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CopyInventoryFromNotecardPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class NotecardDataBlock
-        {
-            public LLUUID NotecardItemID;
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public NotecardDataBlock() { }
-            public NotecardDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    NotecardItemID.FromBytes(bytes, i); i += 16;
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(NotecardItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- NotecardData --");
-                output.AppendLine(String.Format("NotecardItemID: {0}", NotecardItemID));
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("FolderID: {0}", FolderID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CopyInventoryFromNotecard; } }
-        public AgentDataBlock AgentData;
-        public NotecardDataBlock NotecardData;
-        public InventoryDataBlock[] InventoryData;
-
-        public CopyInventoryFromNotecardPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 265;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            NotecardData = new NotecardDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public CopyInventoryFromNotecardPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            NotecardData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public CopyInventoryFromNotecardPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            NotecardData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += NotecardData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            NotecardData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CopyInventoryFromNotecard ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += NotecardData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UpdateInventoryItemPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            public uint CallbackID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public bool GroupOwned;
-            public LLUUID TransactionID;
-            public sbyte Type;
-            public sbyte InvType;
-            public uint Flags;
-            public byte SaleType;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int CreationDate;
-            public uint CRC;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 140;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    CallbackID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    CreationDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CallbackID % 256);
-                bytes[i++] = (byte)((CallbackID >> 8) % 256);
-                bytes[i++] = (byte)((CallbackID >> 16) % 256);
-                bytes[i++] = (byte)((CallbackID >> 24) % 256);
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)((GroupOwned) ? 1 : 0);
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("CallbackID: {0}", CallbackID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("GroupOwned: {0}", GroupOwned));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.Append(String.Format("CRC: {0}", CRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UpdateInventoryItem; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public UpdateInventoryItemPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 266;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public UpdateInventoryItemPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public UpdateInventoryItemPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UpdateInventoryItem ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UpdateCreateInventoryItemPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public bool SimApproved;
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SimApproved = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((SimApproved) ? 1 : 0);
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SimApproved: {0}", SimApproved));
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            public uint CallbackID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public bool GroupOwned;
-            public LLUUID AssetID;
-            public sbyte Type;
-            public sbyte InvType;
-            public uint Flags;
-            public byte SaleType;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int CreationDate;
-            public uint CRC;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 140;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    CallbackID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    AssetID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    CreationDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CallbackID % 256);
-                bytes[i++] = (byte)((CallbackID >> 8) % 256);
-                bytes[i++] = (byte)((CallbackID >> 16) % 256);
-                bytes[i++] = (byte)((CallbackID >> 24) % 256);
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)((GroupOwned) ? 1 : 0);
-                Buffer.BlockCopy(AssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("CallbackID: {0}", CallbackID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("GroupOwned: {0}", GroupOwned));
-                output.AppendLine(String.Format("AssetID: {0}", AssetID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.Append(String.Format("CRC: {0}", CRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UpdateCreateInventoryItem; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public UpdateCreateInventoryItemPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 267;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public UpdateCreateInventoryItemPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public UpdateCreateInventoryItemPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UpdateCreateInventoryItem ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MoveInventoryItemPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public bool Stamp;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Stamp = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Stamp) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("Stamp: {0}", Stamp));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            private byte[] _newname;
-            public byte[] NewName
-            {
-                get { return _newname; }
-                set
-                {
-                    if (value == null) { _newname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _newname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _newname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 32;
-                    if (NewName != null) { length += 1 + NewName.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _newname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _newname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(NewName == null) { Console.WriteLine("Warning: NewName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)NewName.Length;
-                Buffer.BlockCopy(NewName, 0, bytes, i, NewName.Length); i += NewName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                Helpers.FieldToString(output, NewName, "NewName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MoveInventoryItem; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public MoveInventoryItemPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 268;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public MoveInventoryItemPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public MoveInventoryItemPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MoveInventoryItem ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CopyInventoryItemPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public uint CallbackID;
-            public LLUUID OldAgentID;
-            public LLUUID OldItemID;
-            public LLUUID NewFolderID;
-            private byte[] _newname;
-            public byte[] NewName
-            {
-                get { return _newname; }
-                set
-                {
-                    if (value == null) { _newname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _newname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _newname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 52;
-                    if (NewName != null) { length += 1 + NewName.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    CallbackID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OldAgentID.FromBytes(bytes, i); i += 16;
-                    OldItemID.FromBytes(bytes, i); i += 16;
-                    NewFolderID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _newname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _newname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(CallbackID % 256);
-                bytes[i++] = (byte)((CallbackID >> 8) % 256);
-                bytes[i++] = (byte)((CallbackID >> 16) % 256);
-                bytes[i++] = (byte)((CallbackID >> 24) % 256);
-                Buffer.BlockCopy(OldAgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OldItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(NewFolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(NewName == null) { Console.WriteLine("Warning: NewName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)NewName.Length;
-                Buffer.BlockCopy(NewName, 0, bytes, i, NewName.Length); i += NewName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("CallbackID: {0}", CallbackID));
-                output.AppendLine(String.Format("OldAgentID: {0}", OldAgentID));
-                output.AppendLine(String.Format("OldItemID: {0}", OldItemID));
-                output.AppendLine(String.Format("NewFolderID: {0}", NewFolderID));
-                Helpers.FieldToString(output, NewName, "NewName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CopyInventoryItem; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public CopyInventoryItemPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 269;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public CopyInventoryItemPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public CopyInventoryItemPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CopyInventoryItem ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RemoveInventoryItemPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RemoveInventoryItem; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public RemoveInventoryItemPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 270;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public RemoveInventoryItemPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public RemoveInventoryItemPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RemoveInventoryItem ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChangeInventoryItemFlagsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChangeInventoryItemFlags; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public ChangeInventoryItemFlagsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 271;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public ChangeInventoryItemFlagsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ChangeInventoryItemFlagsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChangeInventoryItemFlags ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SaveAssetIntoInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID NewAssetID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    NewAssetID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(NewAssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("NewAssetID: {0}", NewAssetID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SaveAssetIntoInventory; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock InventoryData;
-
-        public SaveAssetIntoInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 272;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public SaveAssetIntoInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public SaveAssetIntoInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SaveAssetIntoInventory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CreateInventoryFolderPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FolderDataBlock
-        {
-            public LLUUID FolderID;
-            public LLUUID ParentID;
-            public sbyte Type;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 33;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public FolderDataBlock() { }
-            public FolderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    ParentID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ParentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FolderData --");
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("ParentID: {0}", ParentID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CreateInventoryFolder; } }
-        public AgentDataBlock AgentData;
-        public FolderDataBlock FolderData;
-
-        public CreateInventoryFolderPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 273;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            FolderData = new FolderDataBlock();
-        }
-
-        public CreateInventoryFolderPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            FolderData.FromBytes(bytes, ref i);
-        }
-
-        public CreateInventoryFolderPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            FolderData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += FolderData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            FolderData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CreateInventoryFolder ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += FolderData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UpdateInventoryFolderPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FolderDataBlock
-        {
-            public LLUUID FolderID;
-            public LLUUID ParentID;
-            public sbyte Type;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 33;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public FolderDataBlock() { }
-            public FolderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    ParentID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ParentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FolderData --");
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("ParentID: {0}", ParentID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UpdateInventoryFolder; } }
-        public AgentDataBlock AgentData;
-        public FolderDataBlock[] FolderData;
-
-        public UpdateInventoryFolderPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 274;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            FolderData = new FolderDataBlock[0];
-        }
-
-        public UpdateInventoryFolderPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-        }
-
-        public UpdateInventoryFolderPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < FolderData.Length; j++) { length += FolderData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)FolderData.Length;
-            for (int j = 0; j < FolderData.Length; j++) { FolderData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UpdateInventoryFolder ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < FolderData.Length; j++)
-            {
-                output += FolderData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MoveInventoryFolderPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public bool Stamp;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Stamp = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Stamp) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("Stamp: {0}", Stamp));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID FolderID;
-            public LLUUID ParentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    ParentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ParentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.Append(String.Format("ParentID: {0}", ParentID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MoveInventoryFolder; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public MoveInventoryFolderPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 275;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public MoveInventoryFolderPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public MoveInventoryFolderPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MoveInventoryFolder ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RemoveInventoryFolderPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FolderDataBlock
-        {
-            public LLUUID FolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public FolderDataBlock() { }
-            public FolderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FolderData --");
-                output.Append(String.Format("FolderID: {0}", FolderID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RemoveInventoryFolder; } }
-        public AgentDataBlock AgentData;
-        public FolderDataBlock[] FolderData;
-
-        public RemoveInventoryFolderPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 276;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            FolderData = new FolderDataBlock[0];
-        }
-
-        public RemoveInventoryFolderPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-        }
-
-        public RemoveInventoryFolderPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < FolderData.Length; j++) { length += FolderData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)FolderData.Length;
-            for (int j = 0; j < FolderData.Length; j++) { FolderData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RemoveInventoryFolder ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < FolderData.Length; j++)
-            {
-                output += FolderData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class FetchInventoryDescendentsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID FolderID;
-            public LLUUID OwnerID;
-            public int SortOrder;
-            public bool FetchFolders;
-            public bool FetchItems;
-
-            public int Length
-            {
-                get
-                {
-                    return 38;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    SortOrder = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    FetchFolders = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    FetchItems = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SortOrder % 256);
-                bytes[i++] = (byte)((SortOrder >> 8) % 256);
-                bytes[i++] = (byte)((SortOrder >> 16) % 256);
-                bytes[i++] = (byte)((SortOrder >> 24) % 256);
-                bytes[i++] = (byte)((FetchFolders) ? 1 : 0);
-                bytes[i++] = (byte)((FetchItems) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("SortOrder: {0}", SortOrder));
-                output.AppendLine(String.Format("FetchFolders: {0}", FetchFolders));
-                output.Append(String.Format("FetchItems: {0}", FetchItems));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.FetchInventoryDescendents; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock InventoryData;
-
-        public FetchInventoryDescendentsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 277;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public FetchInventoryDescendentsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public FetchInventoryDescendentsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- FetchInventoryDescendents ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class InventoryDescendentsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID FolderID;
-            public LLUUID OwnerID;
-            public int Version;
-            public int Descendents;
-
-            public int Length
-            {
-                get
-                {
-                    return 56;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    Version = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Descendents = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Version % 256);
-                bytes[i++] = (byte)((Version >> 8) % 256);
-                bytes[i++] = (byte)((Version >> 16) % 256);
-                bytes[i++] = (byte)((Version >> 24) % 256);
-                bytes[i++] = (byte)(Descendents % 256);
-                bytes[i++] = (byte)((Descendents >> 8) % 256);
-                bytes[i++] = (byte)((Descendents >> 16) % 256);
-                bytes[i++] = (byte)((Descendents >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("Version: {0}", Version));
-                output.Append(String.Format("Descendents: {0}", Descendents));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FolderDataBlock
-        {
-            public LLUUID FolderID;
-            public LLUUID ParentID;
-            public sbyte Type;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 33;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public FolderDataBlock() { }
-            public FolderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    ParentID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ParentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FolderData --");
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("ParentID: {0}", ParentID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ItemDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public bool GroupOwned;
-            public LLUUID AssetID;
-            public sbyte Type;
-            public sbyte InvType;
-            public uint Flags;
-            public byte SaleType;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int CreationDate;
-            public uint CRC;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 136;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public ItemDataBlock() { }
-            public ItemDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    AssetID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    CreationDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)((GroupOwned) ? 1 : 0);
-                Buffer.BlockCopy(AssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ItemData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("GroupOwned: {0}", GroupOwned));
-                output.AppendLine(String.Format("AssetID: {0}", AssetID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.Append(String.Format("CRC: {0}", CRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.InventoryDescendents; } }
-        public AgentDataBlock AgentData;
-        public FolderDataBlock[] FolderData;
-        public ItemDataBlock[] ItemData;
-
-        public InventoryDescendentsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 278;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            FolderData = new FolderDataBlock[0];
-            ItemData = new ItemDataBlock[0];
-        }
-
-        public InventoryDescendentsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(ItemData.Length < count) {
-                ItemData = new ItemDataBlock[count];
-                for(int j = 0; j < count; j++) ItemData[j] = new ItemDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ItemData[j].FromBytes(bytes, ref i); }
-        }
-
-        public InventoryDescendentsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(ItemData.Length < count) {
-                ItemData = new ItemDataBlock[count];
-                for(int j = 0; j < count; j++) ItemData[j] = new ItemDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ItemData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < FolderData.Length; j++) { length += FolderData[j].Length; }
-            length++;
-            for (int j = 0; j < ItemData.Length; j++) { length += ItemData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)FolderData.Length;
-            for (int j = 0; j < FolderData.Length; j++) { FolderData[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)ItemData.Length;
-            for (int j = 0; j < ItemData.Length; j++) { ItemData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- InventoryDescendents ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < FolderData.Length; j++)
-            {
-                output += FolderData[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < ItemData.Length; j++)
-            {
-                output += ItemData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class FetchInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID OwnerID;
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.FetchInventory; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public FetchInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 279;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public FetchInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public FetchInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- FetchInventory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class FetchInventoryReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public bool GroupOwned;
-            public LLUUID AssetID;
-            public sbyte Type;
-            public sbyte InvType;
-            public uint Flags;
-            public byte SaleType;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int CreationDate;
-            public uint CRC;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 136;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    AssetID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    CreationDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)((GroupOwned) ? 1 : 0);
-                Buffer.BlockCopy(AssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("GroupOwned: {0}", GroupOwned));
-                output.AppendLine(String.Format("AssetID: {0}", AssetID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.Append(String.Format("CRC: {0}", CRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.FetchInventoryReply; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock[] InventoryData;
-
-        public FetchInventoryReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 280;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public FetchInventoryReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public FetchInventoryReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- FetchInventoryReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class BulkUpdateInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FolderDataBlock
-        {
-            public LLUUID FolderID;
-            public LLUUID ParentID;
-            public sbyte Type;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 33;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public FolderDataBlock() { }
-            public FolderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    ParentID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ParentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FolderData --");
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("ParentID: {0}", ParentID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ItemDataBlock
-        {
-            public LLUUID ItemID;
-            public uint CallbackID;
-            public LLUUID FolderID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public bool GroupOwned;
-            public LLUUID AssetID;
-            public sbyte Type;
-            public sbyte InvType;
-            public uint Flags;
-            public byte SaleType;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int CreationDate;
-            public uint CRC;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 140;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public ItemDataBlock() { }
-            public ItemDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    CallbackID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    AssetID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    CreationDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CallbackID % 256);
-                bytes[i++] = (byte)((CallbackID >> 8) % 256);
-                bytes[i++] = (byte)((CallbackID >> 16) % 256);
-                bytes[i++] = (byte)((CallbackID >> 24) % 256);
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)((GroupOwned) ? 1 : 0);
-                Buffer.BlockCopy(AssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ItemData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("CallbackID: {0}", CallbackID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("GroupOwned: {0}", GroupOwned));
-                output.AppendLine(String.Format("AssetID: {0}", AssetID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.Append(String.Format("CRC: {0}", CRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.BulkUpdateInventory; } }
-        public AgentDataBlock AgentData;
-        public FolderDataBlock[] FolderData;
-        public ItemDataBlock[] ItemData;
-
-        public BulkUpdateInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 281;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            FolderData = new FolderDataBlock[0];
-            ItemData = new ItemDataBlock[0];
-        }
-
-        public BulkUpdateInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(ItemData.Length < count) {
-                ItemData = new ItemDataBlock[count];
-                for(int j = 0; j < count; j++) ItemData[j] = new ItemDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ItemData[j].FromBytes(bytes, ref i); }
-        }
-
-        public BulkUpdateInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(ItemData.Length < count) {
-                ItemData = new ItemDataBlock[count];
-                for(int j = 0; j < count; j++) ItemData[j] = new ItemDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ItemData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < FolderData.Length; j++) { length += FolderData[j].Length; }
-            length++;
-            for (int j = 0; j < ItemData.Length; j++) { length += ItemData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)FolderData.Length;
-            for (int j = 0; j < FolderData.Length; j++) { FolderData[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)ItemData.Length;
-            for (int j = 0; j < ItemData.Length; j++) { ItemData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- BulkUpdateInventory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < FolderData.Length; j++)
-            {
-                output += FolderData[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < ItemData.Length; j++)
-            {
-                output += ItemData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestInventoryAssetPacket : Packet
-    {
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-            public LLUUID AgentID;
-            public LLUUID OwnerID;
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 64;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("QueryID: {0}", QueryID));
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestInventoryAsset; } }
-        public QueryDataBlock QueryData;
-
-        public RequestInventoryAssetPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 282;
-            Header.Reliable = true;
-            QueryData = new QueryDataBlock();
-        }
-
-        public RequestInventoryAssetPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public RequestInventoryAssetPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestInventoryAsset ---" + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class InventoryAssetResponsePacket : Packet
-    {
-        /// <exclude/>
-        public class QueryDataBlock
-        {
-            public LLUUID QueryID;
-            public LLUUID AssetID;
-            public bool IsReadable;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public QueryDataBlock() { }
-            public QueryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    QueryID.FromBytes(bytes, i); i += 16;
-                    AssetID.FromBytes(bytes, i); i += 16;
-                    IsReadable = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(QueryID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((IsReadable) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- QueryData --");
-                output.AppendLine(String.Format("QueryID: {0}", QueryID));
-                output.AppendLine(String.Format("AssetID: {0}", AssetID));
-                output.Append(String.Format("IsReadable: {0}", IsReadable));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.InventoryAssetResponse; } }
-        public QueryDataBlock QueryData;
-
-        public InventoryAssetResponsePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 283;
-            Header.Reliable = true;
-            QueryData = new QueryDataBlock();
-        }
-
-        public InventoryAssetResponsePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public InventoryAssetResponsePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            QueryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += QueryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            QueryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- InventoryAssetResponse ---" + Environment.NewLine;
-                output += QueryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RemoveInventoryObjectsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FolderDataBlock
-        {
-            public LLUUID FolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public FolderDataBlock() { }
-            public FolderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FolderData --");
-                output.Append(String.Format("FolderID: {0}", FolderID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ItemDataBlock
-        {
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ItemDataBlock() { }
-            public ItemDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ItemData --");
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RemoveInventoryObjects; } }
-        public AgentDataBlock AgentData;
-        public FolderDataBlock[] FolderData;
-        public ItemDataBlock[] ItemData;
-
-        public RemoveInventoryObjectsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 284;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            FolderData = new FolderDataBlock[0];
-            ItemData = new ItemDataBlock[0];
-        }
-
-        public RemoveInventoryObjectsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(ItemData.Length < count) {
-                ItemData = new ItemDataBlock[count];
-                for(int j = 0; j < count; j++) ItemData[j] = new ItemDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ItemData[j].FromBytes(bytes, ref i); }
-        }
-
-        public RemoveInventoryObjectsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(ItemData.Length < count) {
-                ItemData = new ItemDataBlock[count];
-                for(int j = 0; j < count; j++) ItemData[j] = new ItemDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ItemData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < FolderData.Length; j++) { length += FolderData[j].Length; }
-            length++;
-            for (int j = 0; j < ItemData.Length; j++) { length += ItemData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)FolderData.Length;
-            for (int j = 0; j < FolderData.Length; j++) { FolderData[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)ItemData.Length;
-            for (int j = 0; j < ItemData.Length; j++) { ItemData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RemoveInventoryObjects ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < FolderData.Length; j++)
-            {
-                output += FolderData[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < ItemData.Length; j++)
-            {
-                output += ItemData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PurgeInventoryDescendentsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID FolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.Append(String.Format("FolderID: {0}", FolderID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PurgeInventoryDescendents; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock InventoryData;
-
-        public PurgeInventoryDescendentsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 285;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public PurgeInventoryDescendentsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public PurgeInventoryDescendentsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PurgeInventoryDescendents ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UpdateTaskInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class UpdateDataBlock
-        {
-            public uint LocalID;
-            public byte Key;
-
-            public int Length
-            {
-                get
-                {
-                    return 5;
-                }
-            }
-
-            public UpdateDataBlock() { }
-            public UpdateDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Key = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                bytes[i++] = Key;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UpdateData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("Key: {0}", Key));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public bool GroupOwned;
-            public LLUUID TransactionID;
-            public sbyte Type;
-            public sbyte InvType;
-            public uint Flags;
-            public byte SaleType;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int CreationDate;
-            public uint CRC;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 136;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    CreationDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)((GroupOwned) ? 1 : 0);
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("GroupOwned: {0}", GroupOwned));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.Append(String.Format("CRC: {0}", CRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UpdateTaskInventory; } }
-        public AgentDataBlock AgentData;
-        public UpdateDataBlock UpdateData;
-        public InventoryDataBlock InventoryData;
-
-        public UpdateTaskInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 286;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            UpdateData = new UpdateDataBlock();
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public UpdateTaskInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            UpdateData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public UpdateTaskInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            UpdateData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += UpdateData.Length;            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            UpdateData.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UpdateTaskInventory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += UpdateData.ToString() + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RemoveTaskInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public uint LocalID;
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RemoveTaskInventory; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock InventoryData;
-
-        public RemoveTaskInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 287;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public RemoveTaskInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public RemoveTaskInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RemoveTaskInventory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MoveTaskInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID FolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("FolderID: {0}", FolderID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public uint LocalID;
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MoveTaskInventory; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock InventoryData;
-
-        public MoveTaskInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 288;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public MoveTaskInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public MoveTaskInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MoveTaskInventory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestTaskInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public uint LocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    LocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.Append(String.Format("LocalID: {0}", LocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestTaskInventory; } }
-        public AgentDataBlock AgentData;
-        public InventoryDataBlock InventoryData;
-
-        public RequestTaskInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 289;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public RequestTaskInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public RequestTaskInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestTaskInventory ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ReplyTaskInventoryPacket : Packet
-    {
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID TaskID;
-            public short Serial;
-            private byte[] _filename;
-            public byte[] Filename
-            {
-                get { return _filename; }
-                set
-                {
-                    if (value == null) { _filename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _filename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _filename, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 18;
-                    if (Filename != null) { length += 1 + Filename.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TaskID.FromBytes(bytes, i); i += 16;
-                    Serial = (short)(bytes[i++] + (bytes[i++] << 8));
-                    length = (ushort)bytes[i++];
-                    _filename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _filename, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Serial % 256);
-                bytes[i++] = (byte)((Serial >> 8) % 256);
-                if(Filename == null) { Console.WriteLine("Warning: Filename is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Filename.Length;
-                Buffer.BlockCopy(Filename, 0, bytes, i, Filename.Length); i += Filename.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("TaskID: {0}", TaskID));
-                output.AppendLine(String.Format("Serial: {0}", Serial));
-                Helpers.FieldToString(output, Filename, "Filename");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ReplyTaskInventory; } }
-        public InventoryDataBlock InventoryData;
-
-        public ReplyTaskInventoryPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 290;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public ReplyTaskInventoryPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public ReplyTaskInventoryPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ReplyTaskInventory ---" + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DeRezObjectPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AgentBlockBlock
-        {
-            public LLUUID GroupID;
-            public byte Destination;
-            public LLUUID DestinationID;
-            public LLUUID TransactionID;
-            public byte PacketCount;
-            public byte PacketNumber;
-
-            public int Length
-            {
-                get
-                {
-                    return 51;
-                }
-            }
-
-            public AgentBlockBlock() { }
-            public AgentBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    Destination = (byte)bytes[i++];
-                    DestinationID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    PacketCount = (byte)bytes[i++];
-                    PacketNumber = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = Destination;
-                Buffer.BlockCopy(DestinationID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = PacketCount;
-                bytes[i++] = PacketNumber;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentBlock --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("Destination: {0}", Destination));
-                output.AppendLine(String.Format("DestinationID: {0}", DestinationID));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("PacketCount: {0}", PacketCount));
-                output.Append(String.Format("PacketNumber: {0}", PacketNumber));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DeRezObject; } }
-        public AgentDataBlock AgentData;
-        public AgentBlockBlock AgentBlock;
-        public ObjectDataBlock[] ObjectData;
-
-        public DeRezObjectPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 291;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            AgentBlock = new AgentBlockBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public DeRezObjectPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            AgentBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public DeRezObjectPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            AgentBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += AgentBlock.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            AgentBlock.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DeRezObject ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += AgentBlock.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DeRezAckPacket : Packet
-    {
-        /// <exclude/>
-        public class TransactionDataBlock
-        {
-            public LLUUID TransactionID;
-            public bool Success;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public TransactionDataBlock() { }
-            public TransactionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    Success = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Success) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionData --");
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.Append(String.Format("Success: {0}", Success));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DeRezAck; } }
-        public TransactionDataBlock TransactionData;
-
-        public DeRezAckPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 292;
-            Header.Reliable = true;
-            TransactionData = new TransactionDataBlock();
-        }
-
-        public DeRezAckPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransactionData.FromBytes(bytes, ref i);
-        }
-
-        public DeRezAckPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransactionData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TransactionData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TransactionData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DeRezAck ---" + Environment.NewLine;
-                output += TransactionData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RezObjectPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RezDataBlock
-        {
-            public LLUUID FromTaskID;
-            public byte BypassRaycast;
-            public LLVector3 RayStart;
-            public LLVector3 RayEnd;
-            public LLUUID RayTargetID;
-            public bool RayEndIsIntersection;
-            public bool RezSelected;
-            public bool RemoveItem;
-            public uint ItemFlags;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-
-            public int Length
-            {
-                get
-                {
-                    return 76;
-                }
-            }
-
-            public RezDataBlock() { }
-            public RezDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FromTaskID.FromBytes(bytes, i); i += 16;
-                    BypassRaycast = (byte)bytes[i++];
-                    RayStart.FromBytes(bytes, i); i += 12;
-                    RayEnd.FromBytes(bytes, i); i += 12;
-                    RayTargetID.FromBytes(bytes, i); i += 16;
-                    RayEndIsIntersection = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RezSelected = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RemoveItem = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    ItemFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FromTaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = BypassRaycast;
-                Buffer.BlockCopy(RayStart.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(RayEnd.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(RayTargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((RayEndIsIntersection) ? 1 : 0);
-                bytes[i++] = (byte)((RezSelected) ? 1 : 0);
-                bytes[i++] = (byte)((RemoveItem) ? 1 : 0);
-                bytes[i++] = (byte)(ItemFlags % 256);
-                bytes[i++] = (byte)((ItemFlags >> 8) % 256);
-                bytes[i++] = (byte)((ItemFlags >> 16) % 256);
-                bytes[i++] = (byte)((ItemFlags >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RezData --");
-                output.AppendLine(String.Format("FromTaskID: {0}", FromTaskID));
-                output.AppendLine(String.Format("BypassRaycast: {0}", BypassRaycast));
-                output.AppendLine(String.Format("RayStart: {0}", RayStart));
-                output.AppendLine(String.Format("RayEnd: {0}", RayEnd));
-                output.AppendLine(String.Format("RayTargetID: {0}", RayTargetID));
-                output.AppendLine(String.Format("RayEndIsIntersection: {0}", RayEndIsIntersection));
-                output.AppendLine(String.Format("RezSelected: {0}", RezSelected));
-                output.AppendLine(String.Format("RemoveItem: {0}", RemoveItem));
-                output.AppendLine(String.Format("ItemFlags: {0}", ItemFlags));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.Append(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public bool GroupOwned;
-            public LLUUID TransactionID;
-            public sbyte Type;
-            public sbyte InvType;
-            public uint Flags;
-            public byte SaleType;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int CreationDate;
-            public uint CRC;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 136;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    CreationDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)((GroupOwned) ? 1 : 0);
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("GroupOwned: {0}", GroupOwned));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.Append(String.Format("CRC: {0}", CRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RezObject; } }
-        public AgentDataBlock AgentData;
-        public RezDataBlock RezData;
-        public InventoryDataBlock InventoryData;
-
-        public RezObjectPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 293;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            RezData = new RezDataBlock();
-            InventoryData = new InventoryDataBlock();
-        }
-
-        public RezObjectPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RezData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public RezObjectPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RezData.FromBytes(bytes, ref i);
-            InventoryData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RezData.Length;            length += InventoryData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RezData.ToBytes(bytes, ref i);
-            InventoryData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RezObject ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RezData.ToString() + Environment.NewLine;
-                output += InventoryData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RezObjectFromNotecardPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RezDataBlock
-        {
-            public LLUUID FromTaskID;
-            public byte BypassRaycast;
-            public LLVector3 RayStart;
-            public LLVector3 RayEnd;
-            public LLUUID RayTargetID;
-            public bool RayEndIsIntersection;
-            public bool RezSelected;
-            public bool RemoveItem;
-            public uint ItemFlags;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-
-            public int Length
-            {
-                get
-                {
-                    return 76;
-                }
-            }
-
-            public RezDataBlock() { }
-            public RezDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FromTaskID.FromBytes(bytes, i); i += 16;
-                    BypassRaycast = (byte)bytes[i++];
-                    RayStart.FromBytes(bytes, i); i += 12;
-                    RayEnd.FromBytes(bytes, i); i += 12;
-                    RayTargetID.FromBytes(bytes, i); i += 16;
-                    RayEndIsIntersection = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RezSelected = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RemoveItem = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    ItemFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FromTaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = BypassRaycast;
-                Buffer.BlockCopy(RayStart.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(RayEnd.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(RayTargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((RayEndIsIntersection) ? 1 : 0);
-                bytes[i++] = (byte)((RezSelected) ? 1 : 0);
-                bytes[i++] = (byte)((RemoveItem) ? 1 : 0);
-                bytes[i++] = (byte)(ItemFlags % 256);
-                bytes[i++] = (byte)((ItemFlags >> 8) % 256);
-                bytes[i++] = (byte)((ItemFlags >> 16) % 256);
-                bytes[i++] = (byte)((ItemFlags >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RezData --");
-                output.AppendLine(String.Format("FromTaskID: {0}", FromTaskID));
-                output.AppendLine(String.Format("BypassRaycast: {0}", BypassRaycast));
-                output.AppendLine(String.Format("RayStart: {0}", RayStart));
-                output.AppendLine(String.Format("RayEnd: {0}", RayEnd));
-                output.AppendLine(String.Format("RayTargetID: {0}", RayTargetID));
-                output.AppendLine(String.Format("RayEndIsIntersection: {0}", RayEndIsIntersection));
-                output.AppendLine(String.Format("RezSelected: {0}", RezSelected));
-                output.AppendLine(String.Format("RemoveItem: {0}", RemoveItem));
-                output.AppendLine(String.Format("ItemFlags: {0}", ItemFlags));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.Append(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class NotecardDataBlock
-        {
-            public LLUUID NotecardItemID;
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public NotecardDataBlock() { }
-            public NotecardDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    NotecardItemID.FromBytes(bytes, i); i += 16;
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(NotecardItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- NotecardData --");
-                output.AppendLine(String.Format("NotecardItemID: {0}", NotecardItemID));
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryDataBlock
-        {
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public InventoryDataBlock() { }
-            public InventoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryData --");
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RezObjectFromNotecard; } }
-        public AgentDataBlock AgentData;
-        public RezDataBlock RezData;
-        public NotecardDataBlock NotecardData;
-        public InventoryDataBlock[] InventoryData;
-
-        public RezObjectFromNotecardPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 294;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            RezData = new RezDataBlock();
-            NotecardData = new NotecardDataBlock();
-            InventoryData = new InventoryDataBlock[0];
-        }
-
-        public RezObjectFromNotecardPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RezData.FromBytes(bytes, ref i);
-            NotecardData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public RezObjectFromNotecardPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RezData.FromBytes(bytes, ref i);
-            NotecardData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InventoryData.Length < count) {
-                InventoryData = new InventoryDataBlock[count];
-                for(int j = 0; j < count; j++) InventoryData[j] = new InventoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InventoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RezData.Length;            length += NotecardData.Length;;
-            length++;
-            for (int j = 0; j < InventoryData.Length; j++) { length += InventoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RezData.ToBytes(bytes, ref i);
-            NotecardData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InventoryData.Length;
-            for (int j = 0; j < InventoryData.Length; j++) { InventoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RezObjectFromNotecard ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RezData.ToString() + Environment.NewLine;
-                output += NotecardData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InventoryData.Length; j++)
-            {
-                output += InventoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AcceptFriendshipPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionBlockBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TransactionBlockBlock() { }
-            public TransactionBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionBlock --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FolderDataBlock
-        {
-            public LLUUID FolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public FolderDataBlock() { }
-            public FolderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FolderData --");
-                output.Append(String.Format("FolderID: {0}", FolderID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AcceptFriendship; } }
-        public AgentDataBlock AgentData;
-        public TransactionBlockBlock TransactionBlock;
-        public FolderDataBlock[] FolderData;
-
-        public AcceptFriendshipPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 297;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            TransactionBlock = new TransactionBlockBlock();
-            FolderData = new FolderDataBlock[0];
-        }
-
-        public AcceptFriendshipPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-        }
-
-        public AcceptFriendshipPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TransactionBlock.Length;;
-            length++;
-            for (int j = 0; j < FolderData.Length; j++) { length += FolderData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TransactionBlock.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)FolderData.Length;
-            for (int j = 0; j < FolderData.Length; j++) { FolderData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AcceptFriendship ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TransactionBlock.ToString() + Environment.NewLine;
-            for (int j = 0; j < FolderData.Length; j++)
-            {
-                output += FolderData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DeclineFriendshipPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionBlockBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TransactionBlockBlock() { }
-            public TransactionBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionBlock --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DeclineFriendship; } }
-        public AgentDataBlock AgentData;
-        public TransactionBlockBlock TransactionBlock;
-
-        public DeclineFriendshipPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 298;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            TransactionBlock = new TransactionBlockBlock();
-        }
-
-        public DeclineFriendshipPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionBlock.FromBytes(bytes, ref i);
-        }
-
-        public DeclineFriendshipPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TransactionBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TransactionBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DeclineFriendship ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TransactionBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class FormFriendshipPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentBlockBlock
-        {
-            public LLUUID SourceID;
-            public LLUUID DestID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentBlockBlock() { }
-            public AgentBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SourceID.FromBytes(bytes, i); i += 16;
-                    DestID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(SourceID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(DestID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentBlock --");
-                output.AppendLine(String.Format("SourceID: {0}", SourceID));
-                output.Append(String.Format("DestID: {0}", DestID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.FormFriendship; } }
-        public AgentBlockBlock AgentBlock;
-
-        public FormFriendshipPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 299;
-            Header.Reliable = true;
-            AgentBlock = new AgentBlockBlock();
-        }
-
-        public FormFriendshipPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentBlock.FromBytes(bytes, ref i);
-        }
-
-        public FormFriendshipPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- FormFriendship ---" + Environment.NewLine;
-                output += AgentBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TerminateFriendshipPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ExBlockBlock
-        {
-            public LLUUID OtherID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ExBlockBlock() { }
-            public ExBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    OtherID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(OtherID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ExBlock --");
-                output.Append(String.Format("OtherID: {0}", OtherID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TerminateFriendship; } }
-        public AgentDataBlock AgentData;
-        public ExBlockBlock ExBlock;
-
-        public TerminateFriendshipPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 300;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ExBlock = new ExBlockBlock();
-        }
-
-        public TerminateFriendshipPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ExBlock.FromBytes(bytes, ref i);
-        }
-
-        public TerminateFriendshipPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ExBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ExBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ExBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TerminateFriendship ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ExBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class OfferCallingCardPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AgentBlockBlock
-        {
-            public LLUUID DestID;
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentBlockBlock() { }
-            public AgentBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    DestID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(DestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentBlock --");
-                output.AppendLine(String.Format("DestID: {0}", DestID));
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.OfferCallingCard; } }
-        public AgentDataBlock AgentData;
-        public AgentBlockBlock AgentBlock;
-
-        public OfferCallingCardPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 301;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            AgentBlock = new AgentBlockBlock();
-        }
-
-        public OfferCallingCardPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            AgentBlock.FromBytes(bytes, ref i);
-        }
-
-        public OfferCallingCardPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            AgentBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += AgentBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            AgentBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- OfferCallingCard ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += AgentBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AcceptCallingCardPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionBlockBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TransactionBlockBlock() { }
-            public TransactionBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionBlock --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FolderDataBlock
-        {
-            public LLUUID FolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public FolderDataBlock() { }
-            public FolderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FolderData --");
-                output.Append(String.Format("FolderID: {0}", FolderID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AcceptCallingCard; } }
-        public AgentDataBlock AgentData;
-        public TransactionBlockBlock TransactionBlock;
-        public FolderDataBlock[] FolderData;
-
-        public AcceptCallingCardPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 302;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            TransactionBlock = new TransactionBlockBlock();
-            FolderData = new FolderDataBlock[0];
-        }
-
-        public AcceptCallingCardPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-        }
-
-        public AcceptCallingCardPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionBlock.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(FolderData.Length < count) {
-                FolderData = new FolderDataBlock[count];
-                for(int j = 0; j < count; j++) FolderData[j] = new FolderDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { FolderData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TransactionBlock.Length;;
-            length++;
-            for (int j = 0; j < FolderData.Length; j++) { length += FolderData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TransactionBlock.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)FolderData.Length;
-            for (int j = 0; j < FolderData.Length; j++) { FolderData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AcceptCallingCard ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TransactionBlock.ToString() + Environment.NewLine;
-            for (int j = 0; j < FolderData.Length; j++)
-            {
-                output += FolderData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DeclineCallingCardPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionBlockBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TransactionBlockBlock() { }
-            public TransactionBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionBlock --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DeclineCallingCard; } }
-        public AgentDataBlock AgentData;
-        public TransactionBlockBlock TransactionBlock;
-
-        public DeclineCallingCardPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 303;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            TransactionBlock = new TransactionBlockBlock();
-        }
-
-        public DeclineCallingCardPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionBlock.FromBytes(bytes, ref i);
-        }
-
-        public DeclineCallingCardPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TransactionBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TransactionBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DeclineCallingCard ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TransactionBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RezScriptPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class UpdateBlockBlock
-        {
-            public uint ObjectLocalID;
-            public bool Enabled;
-
-            public int Length
-            {
-                get
-                {
-                    return 5;
-                }
-            }
-
-            public UpdateBlockBlock() { }
-            public UpdateBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Enabled = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = (byte)((Enabled) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UpdateBlock --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.Append(String.Format("Enabled: {0}", Enabled));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryBlockBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public bool GroupOwned;
-            public LLUUID TransactionID;
-            public sbyte Type;
-            public sbyte InvType;
-            public uint Flags;
-            public byte SaleType;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int CreationDate;
-            public uint CRC;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 136;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryBlockBlock() { }
-            public InventoryBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    CreationDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)((GroupOwned) ? 1 : 0);
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryBlock --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("GroupOwned: {0}", GroupOwned));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.Append(String.Format("CRC: {0}", CRC));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RezScript; } }
-        public AgentDataBlock AgentData;
-        public UpdateBlockBlock UpdateBlock;
-        public InventoryBlockBlock InventoryBlock;
-
-        public RezScriptPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 304;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            UpdateBlock = new UpdateBlockBlock();
-            InventoryBlock = new InventoryBlockBlock();
-        }
-
-        public RezScriptPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            UpdateBlock.FromBytes(bytes, ref i);
-            InventoryBlock.FromBytes(bytes, ref i);
-        }
-
-        public RezScriptPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            UpdateBlock.FromBytes(bytes, ref i);
-            InventoryBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += UpdateBlock.Length;            length += InventoryBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            UpdateBlock.ToBytes(bytes, ref i);
-            InventoryBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RezScript ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += UpdateBlock.ToString() + Environment.NewLine;
-                output += InventoryBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CreateInventoryItemPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryBlockBlock
-        {
-            public uint CallbackID;
-            public LLUUID FolderID;
-            public LLUUID TransactionID;
-            public uint NextOwnerMask;
-            public sbyte Type;
-            public sbyte InvType;
-            public byte WearableType;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 43;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryBlockBlock() { }
-            public InventoryBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    CallbackID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Type = (sbyte)bytes[i++];
-                    InvType = (sbyte)bytes[i++];
-                    WearableType = (byte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(CallbackID % 256);
-                bytes[i++] = (byte)((CallbackID >> 8) % 256);
-                bytes[i++] = (byte)((CallbackID >> 16) % 256);
-                bytes[i++] = (byte)((CallbackID >> 24) % 256);
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)InvType;
-                bytes[i++] = WearableType;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryBlock --");
-                output.AppendLine(String.Format("CallbackID: {0}", CallbackID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("InvType: {0}", InvType));
-                output.AppendLine(String.Format("WearableType: {0}", WearableType));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CreateInventoryItem; } }
-        public AgentDataBlock AgentData;
-        public InventoryBlockBlock InventoryBlock;
-
-        public CreateInventoryItemPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 305;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            InventoryBlock = new InventoryBlockBlock();
-        }
-
-        public CreateInventoryItemPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryBlock.FromBytes(bytes, ref i);
-        }
-
-        public CreateInventoryItemPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            InventoryBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += InventoryBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            InventoryBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CreateInventoryItem ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += InventoryBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CreateLandmarkForEventPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EventDataBlock
-        {
-            public uint EventID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public EventDataBlock() { }
-            public EventDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    EventID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(EventID % 256);
-                bytes[i++] = (byte)((EventID >> 8) % 256);
-                bytes[i++] = (byte)((EventID >> 16) % 256);
-                bytes[i++] = (byte)((EventID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- EventData --");
-                output.Append(String.Format("EventID: {0}", EventID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InventoryBlockBlock
-        {
-            public LLUUID FolderID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public InventoryBlockBlock() { }
-            public InventoryBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InventoryBlock --");
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CreateLandmarkForEvent; } }
-        public AgentDataBlock AgentData;
-        public EventDataBlock EventData;
-        public InventoryBlockBlock InventoryBlock;
-
-        public CreateLandmarkForEventPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 306;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            EventData = new EventDataBlock();
-            InventoryBlock = new InventoryBlockBlock();
-        }
-
-        public CreateLandmarkForEventPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-            InventoryBlock.FromBytes(bytes, ref i);
-        }
-
-        public CreateLandmarkForEventPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            EventData.FromBytes(bytes, ref i);
-            InventoryBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += EventData.Length;            length += InventoryBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            EventData.ToBytes(bytes, ref i);
-            InventoryBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CreateLandmarkForEvent ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += EventData.ToString() + Environment.NewLine;
-                output += InventoryBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RegionHandleRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class RequestBlockBlock
-        {
-            public LLUUID RegionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public RequestBlockBlock() { }
-            public RequestBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RegionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RequestBlock --");
-                output.Append(String.Format("RegionID: {0}", RegionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RegionHandleRequest; } }
-        public RequestBlockBlock RequestBlock;
-
-        public RegionHandleRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 309;
-            Header.Reliable = true;
-            RequestBlock = new RequestBlockBlock();
-        }
-
-        public RegionHandleRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RequestBlock.FromBytes(bytes, ref i);
-        }
-
-        public RegionHandleRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RequestBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += RequestBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RequestBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RegionHandleRequest ---" + Environment.NewLine;
-                output += RequestBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RegionIDAndHandleReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class ReplyBlockBlock
-        {
-            public LLUUID RegionID;
-            public ulong RegionHandle;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public ReplyBlockBlock() { }
-            public ReplyBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionID.FromBytes(bytes, i); i += 16;
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RegionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ReplyBlock --");
-                output.AppendLine(String.Format("RegionID: {0}", RegionID));
-                output.Append(String.Format("RegionHandle: {0}", RegionHandle));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RegionIDAndHandleReply; } }
-        public ReplyBlockBlock ReplyBlock;
-
-        public RegionIDAndHandleReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 310;
-            Header.Reliable = true;
-            ReplyBlock = new ReplyBlockBlock();
-        }
-
-        public RegionIDAndHandleReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ReplyBlock.FromBytes(bytes, ref i);
-        }
-
-        public RegionIDAndHandleReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ReplyBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ReplyBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ReplyBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RegionIDAndHandleReply ---" + Environment.NewLine;
-                output += ReplyBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MoneyTransferRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID SourceID;
-            public LLUUID DestID;
-            public byte Flags;
-            public int Amount;
-            public byte AggregatePermNextOwner;
-            public byte AggregatePermInventory;
-            public int TransactionType;
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 43;
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    SourceID.FromBytes(bytes, i); i += 16;
-                    DestID.FromBytes(bytes, i); i += 16;
-                    Flags = (byte)bytes[i++];
-                    Amount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    AggregatePermNextOwner = (byte)bytes[i++];
-                    AggregatePermInventory = (byte)bytes[i++];
-                    TransactionType = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(SourceID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(DestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = Flags;
-                bytes[i++] = (byte)(Amount % 256);
-                bytes[i++] = (byte)((Amount >> 8) % 256);
-                bytes[i++] = (byte)((Amount >> 16) % 256);
-                bytes[i++] = (byte)((Amount >> 24) % 256);
-                bytes[i++] = AggregatePermNextOwner;
-                bytes[i++] = AggregatePermInventory;
-                bytes[i++] = (byte)(TransactionType % 256);
-                bytes[i++] = (byte)((TransactionType >> 8) % 256);
-                bytes[i++] = (byte)((TransactionType >> 16) % 256);
-                bytes[i++] = (byte)((TransactionType >> 24) % 256);
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("SourceID: {0}", SourceID));
-                output.AppendLine(String.Format("DestID: {0}", DestID));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("Amount: {0}", Amount));
-                output.AppendLine(String.Format("AggregatePermNextOwner: {0}", AggregatePermNextOwner));
-                output.AppendLine(String.Format("AggregatePermInventory: {0}", AggregatePermInventory));
-                output.AppendLine(String.Format("TransactionType: {0}", TransactionType));
-                Helpers.FieldToString(output, Description, "Description");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MoneyTransferRequest; } }
-        public AgentDataBlock AgentData;
-        public MoneyDataBlock MoneyData;
-
-        public MoneyTransferRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 311;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MoneyData = new MoneyDataBlock();
-        }
-
-        public MoneyTransferRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public MoneyTransferRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MoneyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MoneyTransferRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MoneyBalanceRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MoneyBalanceRequest; } }
-        public AgentDataBlock AgentData;
-        public MoneyDataBlock MoneyData;
-
-        public MoneyBalanceRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 313;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MoneyData = new MoneyDataBlock();
-        }
-
-        public MoneyBalanceRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public MoneyBalanceRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MoneyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MoneyBalanceRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MoneyBalanceReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID TransactionID;
-            public bool TransactionSuccess;
-            public int MoneyBalance;
-            public int SquareMetersCredit;
-            public int SquareMetersCommitted;
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 45;
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    TransactionSuccess = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    MoneyBalance = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SquareMetersCredit = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SquareMetersCommitted = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((TransactionSuccess) ? 1 : 0);
-                bytes[i++] = (byte)(MoneyBalance % 256);
-                bytes[i++] = (byte)((MoneyBalance >> 8) % 256);
-                bytes[i++] = (byte)((MoneyBalance >> 16) % 256);
-                bytes[i++] = (byte)((MoneyBalance >> 24) % 256);
-                bytes[i++] = (byte)(SquareMetersCredit % 256);
-                bytes[i++] = (byte)((SquareMetersCredit >> 8) % 256);
-                bytes[i++] = (byte)((SquareMetersCredit >> 16) % 256);
-                bytes[i++] = (byte)((SquareMetersCredit >> 24) % 256);
-                bytes[i++] = (byte)(SquareMetersCommitted % 256);
-                bytes[i++] = (byte)((SquareMetersCommitted >> 8) % 256);
-                bytes[i++] = (byte)((SquareMetersCommitted >> 16) % 256);
-                bytes[i++] = (byte)((SquareMetersCommitted >> 24) % 256);
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("TransactionSuccess: {0}", TransactionSuccess));
-                output.AppendLine(String.Format("MoneyBalance: {0}", MoneyBalance));
-                output.AppendLine(String.Format("SquareMetersCredit: {0}", SquareMetersCredit));
-                output.AppendLine(String.Format("SquareMetersCommitted: {0}", SquareMetersCommitted));
-                Helpers.FieldToString(output, Description, "Description");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MoneyBalanceReply; } }
-        public MoneyDataBlock MoneyData;
-
-        public MoneyBalanceReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 314;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            MoneyData = new MoneyDataBlock();
-        }
-
-        public MoneyBalanceReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public MoneyBalanceReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += MoneyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MoneyBalanceReply ---" + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RoutedMoneyBalanceReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class TargetBlockBlock
-        {
-            public uint TargetIP;
-            public ushort TargetPort;
-
-            public int Length
-            {
-                get
-                {
-                    return 6;
-                }
-            }
-
-            public TargetBlockBlock() { }
-            public TargetBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TargetIP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TargetPort = (ushort)((bytes[i++] << 8) + bytes[i++]);
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(TargetIP % 256);
-                bytes[i++] = (byte)((TargetIP >> 8) % 256);
-                bytes[i++] = (byte)((TargetIP >> 16) % 256);
-                bytes[i++] = (byte)((TargetIP >> 24) % 256);
-                bytes[i++] = (byte)((TargetPort >> 8) % 256);
-                bytes[i++] = (byte)(TargetPort % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TargetBlock --");
-                output.AppendLine(String.Format("TargetIP: {0}", TargetIP));
-                output.Append(String.Format("TargetPort: {0}", TargetPort));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID TransactionID;
-            public bool TransactionSuccess;
-            public int MoneyBalance;
-            public int SquareMetersCredit;
-            public int SquareMetersCommitted;
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 45;
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    TransactionSuccess = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    MoneyBalance = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SquareMetersCredit = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SquareMetersCommitted = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((TransactionSuccess) ? 1 : 0);
-                bytes[i++] = (byte)(MoneyBalance % 256);
-                bytes[i++] = (byte)((MoneyBalance >> 8) % 256);
-                bytes[i++] = (byte)((MoneyBalance >> 16) % 256);
-                bytes[i++] = (byte)((MoneyBalance >> 24) % 256);
-                bytes[i++] = (byte)(SquareMetersCredit % 256);
-                bytes[i++] = (byte)((SquareMetersCredit >> 8) % 256);
-                bytes[i++] = (byte)((SquareMetersCredit >> 16) % 256);
-                bytes[i++] = (byte)((SquareMetersCredit >> 24) % 256);
-                bytes[i++] = (byte)(SquareMetersCommitted % 256);
-                bytes[i++] = (byte)((SquareMetersCommitted >> 8) % 256);
-                bytes[i++] = (byte)((SquareMetersCommitted >> 16) % 256);
-                bytes[i++] = (byte)((SquareMetersCommitted >> 24) % 256);
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("TransactionSuccess: {0}", TransactionSuccess));
-                output.AppendLine(String.Format("MoneyBalance: {0}", MoneyBalance));
-                output.AppendLine(String.Format("SquareMetersCredit: {0}", SquareMetersCredit));
-                output.AppendLine(String.Format("SquareMetersCommitted: {0}", SquareMetersCommitted));
-                Helpers.FieldToString(output, Description, "Description");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RoutedMoneyBalanceReply; } }
-        public TargetBlockBlock TargetBlock;
-        public MoneyDataBlock MoneyData;
-
-        public RoutedMoneyBalanceReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 315;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            TargetBlock = new TargetBlockBlock();
-            MoneyData = new MoneyDataBlock();
-        }
-
-        public RoutedMoneyBalanceReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TargetBlock.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public RoutedMoneyBalanceReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TargetBlock.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += TargetBlock.Length;            length += MoneyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TargetBlock.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RoutedMoneyBalanceReply ---" + Environment.NewLine;
-                output += TargetBlock.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ActivateGesturesPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID AssetID;
-            public uint GestureFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    AssetID.FromBytes(bytes, i); i += 16;
-                    GestureFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(GestureFlags % 256);
-                bytes[i++] = (byte)((GestureFlags >> 8) % 256);
-                bytes[i++] = (byte)((GestureFlags >> 16) % 256);
-                bytes[i++] = (byte)((GestureFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("AssetID: {0}", AssetID));
-                output.Append(String.Format("GestureFlags: {0}", GestureFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ActivateGestures; } }
-        public AgentDataBlock AgentData;
-        public DataBlock[] Data;
-
-        public ActivateGesturesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 316;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock[0];
-        }
-
-        public ActivateGesturesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public ActivateGesturesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ActivateGestures ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DeactivateGesturesPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID ItemID;
-            public uint GestureFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    GestureFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(GestureFlags % 256);
-                bytes[i++] = (byte)((GestureFlags >> 8) % 256);
-                bytes[i++] = (byte)((GestureFlags >> 16) % 256);
-                bytes[i++] = (byte)((GestureFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("GestureFlags: {0}", GestureFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DeactivateGestures; } }
-        public AgentDataBlock AgentData;
-        public DataBlock[] Data;
-
-        public DeactivateGesturesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 317;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock[0];
-        }
-
-        public DeactivateGesturesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public DeactivateGesturesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DeactivateGestures ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MuteListUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class MuteDataBlock
-        {
-            public LLUUID AgentID;
-            private byte[] _filename;
-            public byte[] Filename
-            {
-                get { return _filename; }
-                set
-                {
-                    if (value == null) { _filename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _filename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _filename, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 16;
-                    if (Filename != null) { length += 1 + Filename.Length; }
-                    return length;
-                }
-            }
-
-            public MuteDataBlock() { }
-            public MuteDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _filename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _filename, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Filename == null) { Console.WriteLine("Warning: Filename is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Filename.Length;
-                Buffer.BlockCopy(Filename, 0, bytes, i, Filename.Length); i += Filename.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MuteData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                Helpers.FieldToString(output, Filename, "Filename");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MuteListUpdate; } }
-        public MuteDataBlock MuteData;
-
-        public MuteListUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 318;
-            Header.Reliable = true;
-            MuteData = new MuteDataBlock();
-        }
-
-        public MuteListUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            MuteData.FromBytes(bytes, ref i);
-        }
-
-        public MuteListUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            MuteData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += MuteData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            MuteData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MuteListUpdate ---" + Environment.NewLine;
-                output += MuteData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UseCachedMuteListPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UseCachedMuteList; } }
-        public AgentDataBlock AgentData;
-
-        public UseCachedMuteListPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 319;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public UseCachedMuteListPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public UseCachedMuteListPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UseCachedMuteList ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GrantUserRightsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RightsBlock
-        {
-            public LLUUID AgentRelated;
-            public int RelatedRights;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public RightsBlock() { }
-            public RightsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentRelated.FromBytes(bytes, i); i += 16;
-                    RelatedRights = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentRelated.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(RelatedRights % 256);
-                bytes[i++] = (byte)((RelatedRights >> 8) % 256);
-                bytes[i++] = (byte)((RelatedRights >> 16) % 256);
-                bytes[i++] = (byte)((RelatedRights >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Rights --");
-                output.AppendLine(String.Format("AgentRelated: {0}", AgentRelated));
-                output.Append(String.Format("RelatedRights: {0}", RelatedRights));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GrantUserRights; } }
-        public AgentDataBlock AgentData;
-        public RightsBlock[] Rights;
-
-        public GrantUserRightsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 320;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Rights = new RightsBlock[0];
-        }
-
-        public GrantUserRightsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Rights.Length < count) {
-                Rights = new RightsBlock[count];
-                for(int j = 0; j < count; j++) Rights[j] = new RightsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Rights[j].FromBytes(bytes, ref i); }
-        }
-
-        public GrantUserRightsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Rights.Length < count) {
-                Rights = new RightsBlock[count];
-                for(int j = 0; j < count; j++) Rights[j] = new RightsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Rights[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Rights.Length; j++) { length += Rights[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Rights.Length;
-            for (int j = 0; j < Rights.Length; j++) { Rights[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GrantUserRights ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Rights.Length; j++)
-            {
-                output += Rights[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChangeUserRightsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RightsBlock
-        {
-            public LLUUID AgentRelated;
-            public int RelatedRights;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public RightsBlock() { }
-            public RightsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentRelated.FromBytes(bytes, i); i += 16;
-                    RelatedRights = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentRelated.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(RelatedRights % 256);
-                bytes[i++] = (byte)((RelatedRights >> 8) % 256);
-                bytes[i++] = (byte)((RelatedRights >> 16) % 256);
-                bytes[i++] = (byte)((RelatedRights >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Rights --");
-                output.AppendLine(String.Format("AgentRelated: {0}", AgentRelated));
-                output.Append(String.Format("RelatedRights: {0}", RelatedRights));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChangeUserRights; } }
-        public AgentDataBlock AgentData;
-        public RightsBlock[] Rights;
-
-        public ChangeUserRightsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 321;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Rights = new RightsBlock[0];
-        }
-
-        public ChangeUserRightsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Rights.Length < count) {
-                Rights = new RightsBlock[count];
-                for(int j = 0; j < count; j++) Rights[j] = new RightsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Rights[j].FromBytes(bytes, ref i); }
-        }
-
-        public ChangeUserRightsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Rights.Length < count) {
-                Rights = new RightsBlock[count];
-                for(int j = 0; j < count; j++) Rights[j] = new RightsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Rights[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Rights.Length; j++) { length += Rights[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Rights.Length;
-            for (int j = 0; j < Rights.Length; j++) { Rights[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChangeUserRights ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Rights.Length; j++)
-            {
-                output += Rights[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class OnlineNotificationPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentBlockBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentBlockBlock() { }
-            public AgentBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentBlock --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.OnlineNotification; } }
-        public AgentBlockBlock[] AgentBlock;
-
-        public OnlineNotificationPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 322;
-            Header.Reliable = true;
-            AgentBlock = new AgentBlockBlock[0];
-        }
-
-        public OnlineNotificationPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(AgentBlock.Length < count) {
-                AgentBlock = new AgentBlockBlock[count];
-                for(int j = 0; j < count; j++) AgentBlock[j] = new AgentBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AgentBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public OnlineNotificationPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(AgentBlock.Length < count) {
-                AgentBlock = new AgentBlockBlock[count];
-                for(int j = 0; j < count; j++) AgentBlock[j] = new AgentBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AgentBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < AgentBlock.Length; j++) { length += AgentBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)AgentBlock.Length;
-            for (int j = 0; j < AgentBlock.Length; j++) { AgentBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- OnlineNotification ---" + Environment.NewLine;
-            for (int j = 0; j < AgentBlock.Length; j++)
-            {
-                output += AgentBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class OfflineNotificationPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentBlockBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentBlockBlock() { }
-            public AgentBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentBlock --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.OfflineNotification; } }
-        public AgentBlockBlock[] AgentBlock;
-
-        public OfflineNotificationPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 323;
-            Header.Reliable = true;
-            AgentBlock = new AgentBlockBlock[0];
-        }
-
-        public OfflineNotificationPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(AgentBlock.Length < count) {
-                AgentBlock = new AgentBlockBlock[count];
-                for(int j = 0; j < count; j++) AgentBlock[j] = new AgentBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AgentBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public OfflineNotificationPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(AgentBlock.Length < count) {
-                AgentBlock = new AgentBlockBlock[count];
-                for(int j = 0; j < count; j++) AgentBlock[j] = new AgentBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AgentBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < AgentBlock.Length; j++) { length += AgentBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)AgentBlock.Length;
-            for (int j = 0; j < AgentBlock.Length; j++) { AgentBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- OfflineNotification ---" + Environment.NewLine;
-            for (int j = 0; j < AgentBlock.Length; j++)
-            {
-                output += AgentBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SetStartLocationRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class StartLocationDataBlock
-        {
-            private byte[] _simname;
-            public byte[] SimName
-            {
-                get { return _simname; }
-                set
-                {
-                    if (value == null) { _simname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simname, 0, value.Length); }
-                }
-            }
-            public uint LocationID;
-            public LLVector3 LocationPos;
-            public LLVector3 LocationLookAt;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 28;
-                    if (SimName != null) { length += 1 + SimName.Length; }
-                    return length;
-                }
-            }
-
-            public StartLocationDataBlock() { }
-            public StartLocationDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _simname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simname, 0, length); i += length;
-                    LocationID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LocationPos.FromBytes(bytes, i); i += 12;
-                    LocationLookAt.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(SimName == null) { Console.WriteLine("Warning: SimName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimName.Length;
-                Buffer.BlockCopy(SimName, 0, bytes, i, SimName.Length); i += SimName.Length;
-                bytes[i++] = (byte)(LocationID % 256);
-                bytes[i++] = (byte)((LocationID >> 8) % 256);
-                bytes[i++] = (byte)((LocationID >> 16) % 256);
-                bytes[i++] = (byte)((LocationID >> 24) % 256);
-                Buffer.BlockCopy(LocationPos.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LocationLookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- StartLocationData --");
-                Helpers.FieldToString(output, SimName, "SimName");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("LocationID: {0}", LocationID));
-                output.AppendLine(String.Format("LocationPos: {0}", LocationPos));
-                output.Append(String.Format("LocationLookAt: {0}", LocationLookAt));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SetStartLocationRequest; } }
-        public AgentDataBlock AgentData;
-        public StartLocationDataBlock StartLocationData;
-
-        public SetStartLocationRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 324;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            StartLocationData = new StartLocationDataBlock();
-        }
-
-        public SetStartLocationRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            StartLocationData.FromBytes(bytes, ref i);
-        }
-
-        public SetStartLocationRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            StartLocationData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += StartLocationData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            StartLocationData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SetStartLocationRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += StartLocationData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AssetUploadRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AssetBlockBlock
-        {
-            public LLUUID TransactionID;
-            public sbyte Type;
-            public bool Tempfile;
-            public bool StoreLocal;
-            private byte[] _assetdata;
-            public byte[] AssetData
-            {
-                get { return _assetdata; }
-                set
-                {
-                    if (value == null) { _assetdata = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _assetdata = new byte[value.Length]; Buffer.BlockCopy(value, 0, _assetdata, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 19;
-                    if (AssetData != null) { length += 2 + AssetData.Length; }
-                    return length;
-                }
-            }
-
-            public AssetBlockBlock() { }
-            public AssetBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    Tempfile = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    StoreLocal = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _assetdata = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _assetdata, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)((Tempfile) ? 1 : 0);
-                bytes[i++] = (byte)((StoreLocal) ? 1 : 0);
-                if(AssetData == null) { Console.WriteLine("Warning: AssetData is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(AssetData.Length % 256);
-                bytes[i++] = (byte)((AssetData.Length >> 8) % 256);
-                Buffer.BlockCopy(AssetData, 0, bytes, i, AssetData.Length); i += AssetData.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AssetBlock --");
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("Tempfile: {0}", Tempfile));
-                output.AppendLine(String.Format("StoreLocal: {0}", StoreLocal));
-                Helpers.FieldToString(output, AssetData, "AssetData");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AssetUploadRequest; } }
-        public AssetBlockBlock AssetBlock;
-
-        public AssetUploadRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 333;
-            Header.Reliable = true;
-            AssetBlock = new AssetBlockBlock();
-        }
-
-        public AssetUploadRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AssetBlock.FromBytes(bytes, ref i);
-        }
-
-        public AssetUploadRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AssetBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AssetBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AssetBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AssetUploadRequest ---" + Environment.NewLine;
-                output += AssetBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AssetUploadCompletePacket : Packet
-    {
-        /// <exclude/>
-        public class AssetBlockBlock
-        {
-            public LLUUID UUID;
-            public sbyte Type;
-            public bool Success;
-
-            public int Length
-            {
-                get
-                {
-                    return 18;
-                }
-            }
-
-            public AssetBlockBlock() { }
-            public AssetBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    UUID.FromBytes(bytes, i); i += 16;
-                    Type = (sbyte)bytes[i++];
-                    Success = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(UUID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)Type;
-                bytes[i++] = (byte)((Success) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AssetBlock --");
-                output.AppendLine(String.Format("UUID: {0}", UUID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.Append(String.Format("Success: {0}", Success));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AssetUploadComplete; } }
-        public AssetBlockBlock AssetBlock;
-
-        public AssetUploadCompletePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 334;
-            Header.Reliable = true;
-            AssetBlock = new AssetBlockBlock();
-        }
-
-        public AssetUploadCompletePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AssetBlock.FromBytes(bytes, ref i);
-        }
-
-        public AssetUploadCompletePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AssetBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AssetBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AssetBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AssetUploadComplete ---" + Environment.NewLine;
-                output += AssetBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CreateGroupRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _charter;
-            public byte[] Charter
-            {
-                get { return _charter; }
-                set
-                {
-                    if (value == null) { _charter = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _charter = new byte[value.Length]; Buffer.BlockCopy(value, 0, _charter, 0, value.Length); }
-                }
-            }
-            public bool ShowInList;
-            public LLUUID InsigniaID;
-            public int MembershipFee;
-            public bool OpenEnrollment;
-            public bool AllowPublish;
-            public bool MaturePublish;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Charter != null) { length += 2 + Charter.Length; }
-                    return length;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _charter = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _charter, 0, length); i += length;
-                    ShowInList = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    InsigniaID.FromBytes(bytes, i); i += 16;
-                    MembershipFee = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OpenEnrollment = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    AllowPublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    MaturePublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Charter == null) { Console.WriteLine("Warning: Charter is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Charter.Length % 256);
-                bytes[i++] = (byte)((Charter.Length >> 8) % 256);
-                Buffer.BlockCopy(Charter, 0, bytes, i, Charter.Length); i += Charter.Length;
-                bytes[i++] = (byte)((ShowInList) ? 1 : 0);
-                Buffer.BlockCopy(InsigniaID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(MembershipFee % 256);
-                bytes[i++] = (byte)((MembershipFee >> 8) % 256);
-                bytes[i++] = (byte)((MembershipFee >> 16) % 256);
-                bytes[i++] = (byte)((MembershipFee >> 24) % 256);
-                bytes[i++] = (byte)((OpenEnrollment) ? 1 : 0);
-                bytes[i++] = (byte)((AllowPublish) ? 1 : 0);
-                bytes[i++] = (byte)((MaturePublish) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Charter, "Charter");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ShowInList: {0}", ShowInList));
-                output.AppendLine(String.Format("InsigniaID: {0}", InsigniaID));
-                output.AppendLine(String.Format("MembershipFee: {0}", MembershipFee));
-                output.AppendLine(String.Format("OpenEnrollment: {0}", OpenEnrollment));
-                output.AppendLine(String.Format("AllowPublish: {0}", AllowPublish));
-                output.Append(String.Format("MaturePublish: {0}", MaturePublish));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CreateGroupRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public CreateGroupRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 339;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public CreateGroupRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public CreateGroupRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CreateGroupRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CreateGroupReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ReplyDataBlock
-        {
-            public LLUUID GroupID;
-            public bool Success;
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 17;
-                    if (Message != null) { length += 1 + Message.Length; }
-                    return length;
-                }
-            }
-
-            public ReplyDataBlock() { }
-            public ReplyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    Success = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Success) ? 1 : 0);
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Message.Length;
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ReplyData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("Success: {0}", Success));
-                Helpers.FieldToString(output, Message, "Message");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CreateGroupReply; } }
-        public AgentDataBlock AgentData;
-        public ReplyDataBlock ReplyData;
-
-        public CreateGroupReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 340;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ReplyData = new ReplyDataBlock();
-        }
-
-        public CreateGroupReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ReplyData.FromBytes(bytes, ref i);
-        }
-
-        public CreateGroupReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ReplyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ReplyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ReplyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CreateGroupReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ReplyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UpdateGroupInfoPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            private byte[] _charter;
-            public byte[] Charter
-            {
-                get { return _charter; }
-                set
-                {
-                    if (value == null) { _charter = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _charter = new byte[value.Length]; Buffer.BlockCopy(value, 0, _charter, 0, value.Length); }
-                }
-            }
-            public bool ShowInList;
-            public LLUUID InsigniaID;
-            public int MembershipFee;
-            public bool OpenEnrollment;
-            public bool AllowPublish;
-            public bool MaturePublish;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 40;
-                    if (Charter != null) { length += 2 + Charter.Length; }
-                    return length;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _charter = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _charter, 0, length); i += length;
-                    ShowInList = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    InsigniaID.FromBytes(bytes, i); i += 16;
-                    MembershipFee = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OpenEnrollment = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    AllowPublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    MaturePublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Charter == null) { Console.WriteLine("Warning: Charter is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Charter.Length % 256);
-                bytes[i++] = (byte)((Charter.Length >> 8) % 256);
-                Buffer.BlockCopy(Charter, 0, bytes, i, Charter.Length); i += Charter.Length;
-                bytes[i++] = (byte)((ShowInList) ? 1 : 0);
-                Buffer.BlockCopy(InsigniaID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(MembershipFee % 256);
-                bytes[i++] = (byte)((MembershipFee >> 8) % 256);
-                bytes[i++] = (byte)((MembershipFee >> 16) % 256);
-                bytes[i++] = (byte)((MembershipFee >> 24) % 256);
-                bytes[i++] = (byte)((OpenEnrollment) ? 1 : 0);
-                bytes[i++] = (byte)((AllowPublish) ? 1 : 0);
-                bytes[i++] = (byte)((MaturePublish) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                Helpers.FieldToString(output, Charter, "Charter");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ShowInList: {0}", ShowInList));
-                output.AppendLine(String.Format("InsigniaID: {0}", InsigniaID));
-                output.AppendLine(String.Format("MembershipFee: {0}", MembershipFee));
-                output.AppendLine(String.Format("OpenEnrollment: {0}", OpenEnrollment));
-                output.AppendLine(String.Format("AllowPublish: {0}", AllowPublish));
-                output.Append(String.Format("MaturePublish: {0}", MaturePublish));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UpdateGroupInfo; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public UpdateGroupInfoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 341;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public UpdateGroupInfoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public UpdateGroupInfoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UpdateGroupInfo ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupRoleChangesPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RoleChangeBlock
-        {
-            public LLUUID RoleID;
-            public LLUUID MemberID;
-            public uint Change;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public RoleChangeBlock() { }
-            public RoleChangeBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RoleID.FromBytes(bytes, i); i += 16;
-                    MemberID.FromBytes(bytes, i); i += 16;
-                    Change = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RoleID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(MemberID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Change % 256);
-                bytes[i++] = (byte)((Change >> 8) % 256);
-                bytes[i++] = (byte)((Change >> 16) % 256);
-                bytes[i++] = (byte)((Change >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RoleChange --");
-                output.AppendLine(String.Format("RoleID: {0}", RoleID));
-                output.AppendLine(String.Format("MemberID: {0}", MemberID));
-                output.Append(String.Format("Change: {0}", Change));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupRoleChanges; } }
-        public AgentDataBlock AgentData;
-        public RoleChangeBlock[] RoleChange;
-
-        public GroupRoleChangesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 342;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            RoleChange = new RoleChangeBlock[0];
-        }
-
-        public GroupRoleChangesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(RoleChange.Length < count) {
-                RoleChange = new RoleChangeBlock[count];
-                for(int j = 0; j < count; j++) RoleChange[j] = new RoleChangeBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { RoleChange[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupRoleChangesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(RoleChange.Length < count) {
-                RoleChange = new RoleChangeBlock[count];
-                for(int j = 0; j < count; j++) RoleChange[j] = new RoleChangeBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { RoleChange[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < RoleChange.Length; j++) { length += RoleChange[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)RoleChange.Length;
-            for (int j = 0; j < RoleChange.Length; j++) { RoleChange[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupRoleChanges ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < RoleChange.Length; j++)
-            {
-                output += RoleChange[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class JoinGroupRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.JoinGroupRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public JoinGroupRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 343;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public JoinGroupRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public JoinGroupRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- JoinGroupRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class JoinGroupReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public bool Success;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    Success = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Success) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("Success: {0}", Success));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.JoinGroupReply; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public JoinGroupReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 344;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public JoinGroupReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public JoinGroupReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- JoinGroupReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EjectGroupMemberRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EjectDataBlock
-        {
-            public LLUUID EjecteeID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public EjectDataBlock() { }
-            public EjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    EjecteeID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(EjecteeID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- EjectData --");
-                output.Append(String.Format("EjecteeID: {0}", EjecteeID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EjectGroupMemberRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-        public EjectDataBlock[] EjectData;
-
-        public EjectGroupMemberRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 345;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-            EjectData = new EjectDataBlock[0];
-        }
-
-        public EjectGroupMemberRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(EjectData.Length < count) {
-                EjectData = new EjectDataBlock[count];
-                for(int j = 0; j < count; j++) EjectData[j] = new EjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { EjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public EjectGroupMemberRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(EjectData.Length < count) {
-                EjectData = new EjectDataBlock[count];
-                for(int j = 0; j < count; j++) EjectData[j] = new EjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { EjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            length++;
-            for (int j = 0; j < EjectData.Length; j++) { length += EjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)EjectData.Length;
-            for (int j = 0; j < EjectData.Length; j++) { EjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EjectGroupMemberRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            for (int j = 0; j < EjectData.Length; j++)
-            {
-                output += EjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class EjectGroupMemberReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EjectDataBlock
-        {
-            public bool Success;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public EjectDataBlock() { }
-            public EjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Success = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((Success) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- EjectData --");
-                output.Append(String.Format("Success: {0}", Success));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.EjectGroupMemberReply; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-        public EjectDataBlock EjectData;
-
-        public EjectGroupMemberReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 346;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-            EjectData = new EjectDataBlock();
-        }
-
-        public EjectGroupMemberReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            EjectData.FromBytes(bytes, ref i);
-        }
-
-        public EjectGroupMemberReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            EjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;            length += EjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            EjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- EjectGroupMemberReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-                output += EjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LeaveGroupRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LeaveGroupRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public LeaveGroupRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 347;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public LeaveGroupRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public LeaveGroupRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LeaveGroupRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LeaveGroupReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public bool Success;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    Success = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Success) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("Success: {0}", Success));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LeaveGroupReply; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public LeaveGroupReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 348;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public LeaveGroupReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public LeaveGroupReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LeaveGroupReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class InviteGroupRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InviteDataBlock
-        {
-            public LLUUID InviteeID;
-            public LLUUID RoleID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public InviteDataBlock() { }
-            public InviteDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    InviteeID.FromBytes(bytes, i); i += 16;
-                    RoleID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(InviteeID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RoleID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- InviteData --");
-                output.AppendLine(String.Format("InviteeID: {0}", InviteeID));
-                output.Append(String.Format("RoleID: {0}", RoleID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.InviteGroupRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-        public InviteDataBlock[] InviteData;
-
-        public InviteGroupRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 349;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-            InviteData = new InviteDataBlock[0];
-        }
-
-        public InviteGroupRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InviteData.Length < count) {
-                InviteData = new InviteDataBlock[count];
-                for(int j = 0; j < count; j++) InviteData[j] = new InviteDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InviteData[j].FromBytes(bytes, ref i); }
-        }
-
-        public InviteGroupRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(InviteData.Length < count) {
-                InviteData = new InviteDataBlock[count];
-                for(int j = 0; j < count; j++) InviteData[j] = new InviteDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { InviteData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            length++;
-            for (int j = 0; j < InviteData.Length; j++) { length += InviteData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)InviteData.Length;
-            for (int j = 0; j < InviteData.Length; j++) { InviteData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- InviteGroupRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            for (int j = 0; j < InviteData.Length; j++)
-            {
-                output += InviteData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupProfileRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupProfileRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public GroupProfileRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 351;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public GroupProfileRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public GroupProfileRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupProfileRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupProfileReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _charter;
-            public byte[] Charter
-            {
-                get { return _charter; }
-                set
-                {
-                    if (value == null) { _charter = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _charter = new byte[value.Length]; Buffer.BlockCopy(value, 0, _charter, 0, value.Length); }
-                }
-            }
-            public bool ShowInList;
-            private byte[] _membertitle;
-            public byte[] MemberTitle
-            {
-                get { return _membertitle; }
-                set
-                {
-                    if (value == null) { _membertitle = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _membertitle = new byte[value.Length]; Buffer.BlockCopy(value, 0, _membertitle, 0, value.Length); }
-                }
-            }
-            public ulong PowersMask;
-            public LLUUID InsigniaID;
-            public LLUUID FounderID;
-            public int MembershipFee;
-            public bool OpenEnrollment;
-            public int Money;
-            public int GroupMembershipCount;
-            public int GroupRolesCount;
-            public bool AllowPublish;
-            public bool MaturePublish;
-            public LLUUID OwnerRole;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 92;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Charter != null) { length += 2 + Charter.Length; }
-                    if (MemberTitle != null) { length += 1 + MemberTitle.Length; }
-                    return length;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _charter = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _charter, 0, length); i += length;
-                    ShowInList = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _membertitle = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _membertitle, 0, length); i += length;
-                    PowersMask = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    InsigniaID.FromBytes(bytes, i); i += 16;
-                    FounderID.FromBytes(bytes, i); i += 16;
-                    MembershipFee = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OpenEnrollment = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    Money = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMembershipCount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupRolesCount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    AllowPublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    MaturePublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    OwnerRole.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Charter == null) { Console.WriteLine("Warning: Charter is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Charter.Length % 256);
-                bytes[i++] = (byte)((Charter.Length >> 8) % 256);
-                Buffer.BlockCopy(Charter, 0, bytes, i, Charter.Length); i += Charter.Length;
-                bytes[i++] = (byte)((ShowInList) ? 1 : 0);
-                if(MemberTitle == null) { Console.WriteLine("Warning: MemberTitle is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MemberTitle.Length;
-                Buffer.BlockCopy(MemberTitle, 0, bytes, i, MemberTitle.Length); i += MemberTitle.Length;
-                bytes[i++] = (byte)(PowersMask % 256);
-                bytes[i++] = (byte)((PowersMask >> 8) % 256);
-                bytes[i++] = (byte)((PowersMask >> 16) % 256);
-                bytes[i++] = (byte)((PowersMask >> 24) % 256);
-                bytes[i++] = (byte)((PowersMask >> 32) % 256);
-                bytes[i++] = (byte)((PowersMask >> 40) % 256);
-                bytes[i++] = (byte)((PowersMask >> 48) % 256);
-                bytes[i++] = (byte)((PowersMask >> 56) % 256);
-                Buffer.BlockCopy(InsigniaID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FounderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(MembershipFee % 256);
-                bytes[i++] = (byte)((MembershipFee >> 8) % 256);
-                bytes[i++] = (byte)((MembershipFee >> 16) % 256);
-                bytes[i++] = (byte)((MembershipFee >> 24) % 256);
-                bytes[i++] = (byte)((OpenEnrollment) ? 1 : 0);
-                bytes[i++] = (byte)(Money % 256);
-                bytes[i++] = (byte)((Money >> 8) % 256);
-                bytes[i++] = (byte)((Money >> 16) % 256);
-                bytes[i++] = (byte)((Money >> 24) % 256);
-                bytes[i++] = (byte)(GroupMembershipCount % 256);
-                bytes[i++] = (byte)((GroupMembershipCount >> 8) % 256);
-                bytes[i++] = (byte)((GroupMembershipCount >> 16) % 256);
-                bytes[i++] = (byte)((GroupMembershipCount >> 24) % 256);
-                bytes[i++] = (byte)(GroupRolesCount % 256);
-                bytes[i++] = (byte)((GroupRolesCount >> 8) % 256);
-                bytes[i++] = (byte)((GroupRolesCount >> 16) % 256);
-                bytes[i++] = (byte)((GroupRolesCount >> 24) % 256);
-                bytes[i++] = (byte)((AllowPublish) ? 1 : 0);
-                bytes[i++] = (byte)((MaturePublish) ? 1 : 0);
-                Buffer.BlockCopy(OwnerRole.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Charter, "Charter");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ShowInList: {0}", ShowInList));
-                Helpers.FieldToString(output, MemberTitle, "MemberTitle");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("PowersMask: {0}", PowersMask));
-                output.AppendLine(String.Format("InsigniaID: {0}", InsigniaID));
-                output.AppendLine(String.Format("FounderID: {0}", FounderID));
-                output.AppendLine(String.Format("MembershipFee: {0}", MembershipFee));
-                output.AppendLine(String.Format("OpenEnrollment: {0}", OpenEnrollment));
-                output.AppendLine(String.Format("Money: {0}", Money));
-                output.AppendLine(String.Format("GroupMembershipCount: {0}", GroupMembershipCount));
-                output.AppendLine(String.Format("GroupRolesCount: {0}", GroupRolesCount));
-                output.AppendLine(String.Format("AllowPublish: {0}", AllowPublish));
-                output.AppendLine(String.Format("MaturePublish: {0}", MaturePublish));
-                output.Append(String.Format("OwnerRole: {0}", OwnerRole));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupProfileReply; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public GroupProfileReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 352;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public GroupProfileReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public GroupProfileReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupProfileReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupAccountSummaryRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID RequestID;
-            public int IntervalDays;
-            public int CurrentInterval;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    IntervalDays = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CurrentInterval = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(IntervalDays % 256);
-                bytes[i++] = (byte)((IntervalDays >> 8) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 16) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 24) % 256);
-                bytes[i++] = (byte)(CurrentInterval % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 8) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 16) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.AppendLine(String.Format("IntervalDays: {0}", IntervalDays));
-                output.Append(String.Format("CurrentInterval: {0}", CurrentInterval));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupAccountSummaryRequest; } }
-        public AgentDataBlock AgentData;
-        public MoneyDataBlock MoneyData;
-
-        public GroupAccountSummaryRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 353;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MoneyData = new MoneyDataBlock();
-        }
-
-        public GroupAccountSummaryRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public GroupAccountSummaryRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MoneyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupAccountSummaryRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupAccountSummaryReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID RequestID;
-            public int IntervalDays;
-            public int CurrentInterval;
-            private byte[] _startdate;
-            public byte[] StartDate
-            {
-                get { return _startdate; }
-                set
-                {
-                    if (value == null) { _startdate = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _startdate = new byte[value.Length]; Buffer.BlockCopy(value, 0, _startdate, 0, value.Length); }
-                }
-            }
-            public int Balance;
-            public int TotalCredits;
-            public int TotalDebits;
-            public int ObjectTaxCurrent;
-            public int LightTaxCurrent;
-            public int LandTaxCurrent;
-            public int GroupTaxCurrent;
-            public int ParcelDirFeeCurrent;
-            public int ObjectTaxEstimate;
-            public int LightTaxEstimate;
-            public int LandTaxEstimate;
-            public int GroupTaxEstimate;
-            public int ParcelDirFeeEstimate;
-            public int NonExemptMembers;
-            private byte[] _lasttaxdate;
-            public byte[] LastTaxDate
-            {
-                get { return _lasttaxdate; }
-                set
-                {
-                    if (value == null) { _lasttaxdate = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _lasttaxdate = new byte[value.Length]; Buffer.BlockCopy(value, 0, _lasttaxdate, 0, value.Length); }
-                }
-            }
-            private byte[] _taxdate;
-            public byte[] TaxDate
-            {
-                get { return _taxdate; }
-                set
-                {
-                    if (value == null) { _taxdate = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _taxdate = new byte[value.Length]; Buffer.BlockCopy(value, 0, _taxdate, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 80;
-                    if (StartDate != null) { length += 1 + StartDate.Length; }
-                    if (LastTaxDate != null) { length += 1 + LastTaxDate.Length; }
-                    if (TaxDate != null) { length += 1 + TaxDate.Length; }
-                    return length;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    IntervalDays = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CurrentInterval = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _startdate = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _startdate, 0, length); i += length;
-                    Balance = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TotalCredits = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TotalDebits = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ObjectTaxCurrent = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LightTaxCurrent = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LandTaxCurrent = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupTaxCurrent = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParcelDirFeeCurrent = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ObjectTaxEstimate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LightTaxEstimate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LandTaxEstimate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupTaxEstimate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParcelDirFeeEstimate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NonExemptMembers = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _lasttaxdate = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _lasttaxdate, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _taxdate = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _taxdate, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(IntervalDays % 256);
-                bytes[i++] = (byte)((IntervalDays >> 8) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 16) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 24) % 256);
-                bytes[i++] = (byte)(CurrentInterval % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 8) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 16) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 24) % 256);
-                if(StartDate == null) { Console.WriteLine("Warning: StartDate is null, in " + this.GetType()); }
-                bytes[i++] = (byte)StartDate.Length;
-                Buffer.BlockCopy(StartDate, 0, bytes, i, StartDate.Length); i += StartDate.Length;
-                bytes[i++] = (byte)(Balance % 256);
-                bytes[i++] = (byte)((Balance >> 8) % 256);
-                bytes[i++] = (byte)((Balance >> 16) % 256);
-                bytes[i++] = (byte)((Balance >> 24) % 256);
-                bytes[i++] = (byte)(TotalCredits % 256);
-                bytes[i++] = (byte)((TotalCredits >> 8) % 256);
-                bytes[i++] = (byte)((TotalCredits >> 16) % 256);
-                bytes[i++] = (byte)((TotalCredits >> 24) % 256);
-                bytes[i++] = (byte)(TotalDebits % 256);
-                bytes[i++] = (byte)((TotalDebits >> 8) % 256);
-                bytes[i++] = (byte)((TotalDebits >> 16) % 256);
-                bytes[i++] = (byte)((TotalDebits >> 24) % 256);
-                bytes[i++] = (byte)(ObjectTaxCurrent % 256);
-                bytes[i++] = (byte)((ObjectTaxCurrent >> 8) % 256);
-                bytes[i++] = (byte)((ObjectTaxCurrent >> 16) % 256);
-                bytes[i++] = (byte)((ObjectTaxCurrent >> 24) % 256);
-                bytes[i++] = (byte)(LightTaxCurrent % 256);
-                bytes[i++] = (byte)((LightTaxCurrent >> 8) % 256);
-                bytes[i++] = (byte)((LightTaxCurrent >> 16) % 256);
-                bytes[i++] = (byte)((LightTaxCurrent >> 24) % 256);
-                bytes[i++] = (byte)(LandTaxCurrent % 256);
-                bytes[i++] = (byte)((LandTaxCurrent >> 8) % 256);
-                bytes[i++] = (byte)((LandTaxCurrent >> 16) % 256);
-                bytes[i++] = (byte)((LandTaxCurrent >> 24) % 256);
-                bytes[i++] = (byte)(GroupTaxCurrent % 256);
-                bytes[i++] = (byte)((GroupTaxCurrent >> 8) % 256);
-                bytes[i++] = (byte)((GroupTaxCurrent >> 16) % 256);
-                bytes[i++] = (byte)((GroupTaxCurrent >> 24) % 256);
-                bytes[i++] = (byte)(ParcelDirFeeCurrent % 256);
-                bytes[i++] = (byte)((ParcelDirFeeCurrent >> 8) % 256);
-                bytes[i++] = (byte)((ParcelDirFeeCurrent >> 16) % 256);
-                bytes[i++] = (byte)((ParcelDirFeeCurrent >> 24) % 256);
-                bytes[i++] = (byte)(ObjectTaxEstimate % 256);
-                bytes[i++] = (byte)((ObjectTaxEstimate >> 8) % 256);
-                bytes[i++] = (byte)((ObjectTaxEstimate >> 16) % 256);
-                bytes[i++] = (byte)((ObjectTaxEstimate >> 24) % 256);
-                bytes[i++] = (byte)(LightTaxEstimate % 256);
-                bytes[i++] = (byte)((LightTaxEstimate >> 8) % 256);
-                bytes[i++] = (byte)((LightTaxEstimate >> 16) % 256);
-                bytes[i++] = (byte)((LightTaxEstimate >> 24) % 256);
-                bytes[i++] = (byte)(LandTaxEstimate % 256);
-                bytes[i++] = (byte)((LandTaxEstimate >> 8) % 256);
-                bytes[i++] = (byte)((LandTaxEstimate >> 16) % 256);
-                bytes[i++] = (byte)((LandTaxEstimate >> 24) % 256);
-                bytes[i++] = (byte)(GroupTaxEstimate % 256);
-                bytes[i++] = (byte)((GroupTaxEstimate >> 8) % 256);
-                bytes[i++] = (byte)((GroupTaxEstimate >> 16) % 256);
-                bytes[i++] = (byte)((GroupTaxEstimate >> 24) % 256);
-                bytes[i++] = (byte)(ParcelDirFeeEstimate % 256);
-                bytes[i++] = (byte)((ParcelDirFeeEstimate >> 8) % 256);
-                bytes[i++] = (byte)((ParcelDirFeeEstimate >> 16) % 256);
-                bytes[i++] = (byte)((ParcelDirFeeEstimate >> 24) % 256);
-                bytes[i++] = (byte)(NonExemptMembers % 256);
-                bytes[i++] = (byte)((NonExemptMembers >> 8) % 256);
-                bytes[i++] = (byte)((NonExemptMembers >> 16) % 256);
-                bytes[i++] = (byte)((NonExemptMembers >> 24) % 256);
-                if(LastTaxDate == null) { Console.WriteLine("Warning: LastTaxDate is null, in " + this.GetType()); }
-                bytes[i++] = (byte)LastTaxDate.Length;
-                Buffer.BlockCopy(LastTaxDate, 0, bytes, i, LastTaxDate.Length); i += LastTaxDate.Length;
-                if(TaxDate == null) { Console.WriteLine("Warning: TaxDate is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TaxDate.Length;
-                Buffer.BlockCopy(TaxDate, 0, bytes, i, TaxDate.Length); i += TaxDate.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.AppendLine(String.Format("IntervalDays: {0}", IntervalDays));
-                output.AppendLine(String.Format("CurrentInterval: {0}", CurrentInterval));
-                Helpers.FieldToString(output, StartDate, "StartDate");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Balance: {0}", Balance));
-                output.AppendLine(String.Format("TotalCredits: {0}", TotalCredits));
-                output.AppendLine(String.Format("TotalDebits: {0}", TotalDebits));
-                output.AppendLine(String.Format("ObjectTaxCurrent: {0}", ObjectTaxCurrent));
-                output.AppendLine(String.Format("LightTaxCurrent: {0}", LightTaxCurrent));
-                output.AppendLine(String.Format("LandTaxCurrent: {0}", LandTaxCurrent));
-                output.AppendLine(String.Format("GroupTaxCurrent: {0}", GroupTaxCurrent));
-                output.AppendLine(String.Format("ParcelDirFeeCurrent: {0}", ParcelDirFeeCurrent));
-                output.AppendLine(String.Format("ObjectTaxEstimate: {0}", ObjectTaxEstimate));
-                output.AppendLine(String.Format("LightTaxEstimate: {0}", LightTaxEstimate));
-                output.AppendLine(String.Format("LandTaxEstimate: {0}", LandTaxEstimate));
-                output.AppendLine(String.Format("GroupTaxEstimate: {0}", GroupTaxEstimate));
-                output.AppendLine(String.Format("ParcelDirFeeEstimate: {0}", ParcelDirFeeEstimate));
-                output.AppendLine(String.Format("NonExemptMembers: {0}", NonExemptMembers));
-                Helpers.FieldToString(output, LastTaxDate, "LastTaxDate");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, TaxDate, "TaxDate");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupAccountSummaryReply; } }
-        public AgentDataBlock AgentData;
-        public MoneyDataBlock MoneyData;
-
-        public GroupAccountSummaryReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 354;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MoneyData = new MoneyDataBlock();
-        }
-
-        public GroupAccountSummaryReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public GroupAccountSummaryReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MoneyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupAccountSummaryReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupAccountDetailsRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID RequestID;
-            public int IntervalDays;
-            public int CurrentInterval;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    IntervalDays = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CurrentInterval = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(IntervalDays % 256);
-                bytes[i++] = (byte)((IntervalDays >> 8) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 16) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 24) % 256);
-                bytes[i++] = (byte)(CurrentInterval % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 8) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 16) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.AppendLine(String.Format("IntervalDays: {0}", IntervalDays));
-                output.Append(String.Format("CurrentInterval: {0}", CurrentInterval));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupAccountDetailsRequest; } }
-        public AgentDataBlock AgentData;
-        public MoneyDataBlock MoneyData;
-
-        public GroupAccountDetailsRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 355;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MoneyData = new MoneyDataBlock();
-        }
-
-        public GroupAccountDetailsRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public GroupAccountDetailsRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MoneyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupAccountDetailsRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupAccountDetailsReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID RequestID;
-            public int IntervalDays;
-            public int CurrentInterval;
-            private byte[] _startdate;
-            public byte[] StartDate
-            {
-                get { return _startdate; }
-                set
-                {
-                    if (value == null) { _startdate = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _startdate = new byte[value.Length]; Buffer.BlockCopy(value, 0, _startdate, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (StartDate != null) { length += 1 + StartDate.Length; }
-                    return length;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    IntervalDays = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CurrentInterval = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _startdate = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _startdate, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(IntervalDays % 256);
-                bytes[i++] = (byte)((IntervalDays >> 8) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 16) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 24) % 256);
-                bytes[i++] = (byte)(CurrentInterval % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 8) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 16) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 24) % 256);
-                if(StartDate == null) { Console.WriteLine("Warning: StartDate is null, in " + this.GetType()); }
-                bytes[i++] = (byte)StartDate.Length;
-                Buffer.BlockCopy(StartDate, 0, bytes, i, StartDate.Length); i += StartDate.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.AppendLine(String.Format("IntervalDays: {0}", IntervalDays));
-                output.AppendLine(String.Format("CurrentInterval: {0}", CurrentInterval));
-                Helpers.FieldToString(output, StartDate, "StartDate");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class HistoryDataBlock
-        {
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public int Amount;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 4;
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public HistoryDataBlock() { }
-            public HistoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    Amount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(Amount % 256);
-                bytes[i++] = (byte)((Amount >> 8) % 256);
-                bytes[i++] = (byte)((Amount >> 16) % 256);
-                bytes[i++] = (byte)((Amount >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HistoryData --");
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("Amount: {0}", Amount));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupAccountDetailsReply; } }
-        public AgentDataBlock AgentData;
-        public MoneyDataBlock MoneyData;
-        public HistoryDataBlock[] HistoryData;
-
-        public GroupAccountDetailsReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 356;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MoneyData = new MoneyDataBlock();
-            HistoryData = new HistoryDataBlock[0];
-        }
-
-        public GroupAccountDetailsReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(HistoryData.Length < count) {
-                HistoryData = new HistoryDataBlock[count];
-                for(int j = 0; j < count; j++) HistoryData[j] = new HistoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { HistoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupAccountDetailsReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(HistoryData.Length < count) {
-                HistoryData = new HistoryDataBlock[count];
-                for(int j = 0; j < count; j++) HistoryData[j] = new HistoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { HistoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MoneyData.Length;;
-            length++;
-            for (int j = 0; j < HistoryData.Length; j++) { length += HistoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)HistoryData.Length;
-            for (int j = 0; j < HistoryData.Length; j++) { HistoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupAccountDetailsReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            for (int j = 0; j < HistoryData.Length; j++)
-            {
-                output += HistoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupAccountTransactionsRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID RequestID;
-            public int IntervalDays;
-            public int CurrentInterval;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    IntervalDays = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CurrentInterval = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(IntervalDays % 256);
-                bytes[i++] = (byte)((IntervalDays >> 8) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 16) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 24) % 256);
-                bytes[i++] = (byte)(CurrentInterval % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 8) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 16) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.AppendLine(String.Format("IntervalDays: {0}", IntervalDays));
-                output.Append(String.Format("CurrentInterval: {0}", CurrentInterval));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupAccountTransactionsRequest; } }
-        public AgentDataBlock AgentData;
-        public MoneyDataBlock MoneyData;
-
-        public GroupAccountTransactionsRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 357;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MoneyData = new MoneyDataBlock();
-        }
-
-        public GroupAccountTransactionsRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public GroupAccountTransactionsRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MoneyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupAccountTransactionsRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupAccountTransactionsReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MoneyDataBlock
-        {
-            public LLUUID RequestID;
-            public int IntervalDays;
-            public int CurrentInterval;
-            private byte[] _startdate;
-            public byte[] StartDate
-            {
-                get { return _startdate; }
-                set
-                {
-                    if (value == null) { _startdate = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _startdate = new byte[value.Length]; Buffer.BlockCopy(value, 0, _startdate, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 24;
-                    if (StartDate != null) { length += 1 + StartDate.Length; }
-                    return length;
-                }
-            }
-
-            public MoneyDataBlock() { }
-            public MoneyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    IntervalDays = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CurrentInterval = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _startdate = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _startdate, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(IntervalDays % 256);
-                bytes[i++] = (byte)((IntervalDays >> 8) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 16) % 256);
-                bytes[i++] = (byte)((IntervalDays >> 24) % 256);
-                bytes[i++] = (byte)(CurrentInterval % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 8) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 16) % 256);
-                bytes[i++] = (byte)((CurrentInterval >> 24) % 256);
-                if(StartDate == null) { Console.WriteLine("Warning: StartDate is null, in " + this.GetType()); }
-                bytes[i++] = (byte)StartDate.Length;
-                Buffer.BlockCopy(StartDate, 0, bytes, i, StartDate.Length); i += StartDate.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MoneyData --");
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.AppendLine(String.Format("IntervalDays: {0}", IntervalDays));
-                output.AppendLine(String.Format("CurrentInterval: {0}", CurrentInterval));
-                Helpers.FieldToString(output, StartDate, "StartDate");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class HistoryDataBlock
-        {
-            private byte[] _time;
-            public byte[] Time
-            {
-                get { return _time; }
-                set
-                {
-                    if (value == null) { _time = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _time = new byte[value.Length]; Buffer.BlockCopy(value, 0, _time, 0, value.Length); }
-                }
-            }
-            private byte[] _user;
-            public byte[] User
-            {
-                get { return _user; }
-                set
-                {
-                    if (value == null) { _user = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _user = new byte[value.Length]; Buffer.BlockCopy(value, 0, _user, 0, value.Length); }
-                }
-            }
-            public int Type;
-            private byte[] _item;
-            public byte[] Item
-            {
-                get { return _item; }
-                set
-                {
-                    if (value == null) { _item = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _item = new byte[value.Length]; Buffer.BlockCopy(value, 0, _item, 0, value.Length); }
-                }
-            }
-            public int Amount;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 8;
-                    if (Time != null) { length += 1 + Time.Length; }
-                    if (User != null) { length += 1 + User.Length; }
-                    if (Item != null) { length += 1 + Item.Length; }
-                    return length;
-                }
-            }
-
-            public HistoryDataBlock() { }
-            public HistoryDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _time = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _time, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _user = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _user, 0, length); i += length;
-                    Type = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _item = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _item, 0, length); i += length;
-                    Amount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Time == null) { Console.WriteLine("Warning: Time is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Time.Length;
-                Buffer.BlockCopy(Time, 0, bytes, i, Time.Length); i += Time.Length;
-                if(User == null) { Console.WriteLine("Warning: User is null, in " + this.GetType()); }
-                bytes[i++] = (byte)User.Length;
-                Buffer.BlockCopy(User, 0, bytes, i, User.Length); i += User.Length;
-                bytes[i++] = (byte)(Type % 256);
-                bytes[i++] = (byte)((Type >> 8) % 256);
-                bytes[i++] = (byte)((Type >> 16) % 256);
-                bytes[i++] = (byte)((Type >> 24) % 256);
-                if(Item == null) { Console.WriteLine("Warning: Item is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Item.Length;
-                Buffer.BlockCopy(Item, 0, bytes, i, Item.Length); i += Item.Length;
-                bytes[i++] = (byte)(Amount % 256);
-                bytes[i++] = (byte)((Amount >> 8) % 256);
-                bytes[i++] = (byte)((Amount >> 16) % 256);
-                bytes[i++] = (byte)((Amount >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HistoryData --");
-                Helpers.FieldToString(output, Time, "Time");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, User, "User");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Type: {0}", Type));
-                Helpers.FieldToString(output, Item, "Item");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("Amount: {0}", Amount));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupAccountTransactionsReply; } }
-        public AgentDataBlock AgentData;
-        public MoneyDataBlock MoneyData;
-        public HistoryDataBlock[] HistoryData;
-
-        public GroupAccountTransactionsReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 358;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            MoneyData = new MoneyDataBlock();
-            HistoryData = new HistoryDataBlock[0];
-        }
-
-        public GroupAccountTransactionsReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(HistoryData.Length < count) {
-                HistoryData = new HistoryDataBlock[count];
-                for(int j = 0; j < count; j++) HistoryData[j] = new HistoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { HistoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupAccountTransactionsReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            MoneyData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(HistoryData.Length < count) {
-                HistoryData = new HistoryDataBlock[count];
-                for(int j = 0; j < count; j++) HistoryData[j] = new HistoryDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { HistoryData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += MoneyData.Length;;
-            length++;
-            for (int j = 0; j < HistoryData.Length; j++) { length += HistoryData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            MoneyData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)HistoryData.Length;
-            for (int j = 0; j < HistoryData.Length; j++) { HistoryData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupAccountTransactionsReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += MoneyData.ToString() + Environment.NewLine;
-            for (int j = 0; j < HistoryData.Length; j++)
-            {
-                output += HistoryData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupActiveProposalsRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionDataBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TransactionDataBlock() { }
-            public TransactionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionData --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupActiveProposalsRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-        public TransactionDataBlock TransactionData;
-
-        public GroupActiveProposalsRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 359;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-            TransactionData = new TransactionDataBlock();
-        }
-
-        public GroupActiveProposalsRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-        }
-
-        public GroupActiveProposalsRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;            length += TransactionData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            TransactionData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupActiveProposalsRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-                output += TransactionData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupActiveProposalItemReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionDataBlock
-        {
-            public LLUUID TransactionID;
-            public uint TotalNumItems;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public TransactionDataBlock() { }
-            public TransactionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    TotalNumItems = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(TotalNumItems % 256);
-                bytes[i++] = (byte)((TotalNumItems >> 8) % 256);
-                bytes[i++] = (byte)((TotalNumItems >> 16) % 256);
-                bytes[i++] = (byte)((TotalNumItems >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionData --");
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.Append(String.Format("TotalNumItems: {0}", TotalNumItems));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ProposalDataBlock
-        {
-            public LLUUID VoteID;
-            public LLUUID VoteInitiator;
-            private byte[] _tersedateid;
-            public byte[] TerseDateID
-            {
-                get { return _tersedateid; }
-                set
-                {
-                    if (value == null) { _tersedateid = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _tersedateid = new byte[value.Length]; Buffer.BlockCopy(value, 0, _tersedateid, 0, value.Length); }
-                }
-            }
-            private byte[] _startdatetime;
-            public byte[] StartDateTime
-            {
-                get { return _startdatetime; }
-                set
-                {
-                    if (value == null) { _startdatetime = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _startdatetime = new byte[value.Length]; Buffer.BlockCopy(value, 0, _startdatetime, 0, value.Length); }
-                }
-            }
-            private byte[] _enddatetime;
-            public byte[] EndDateTime
-            {
-                get { return _enddatetime; }
-                set
-                {
-                    if (value == null) { _enddatetime = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _enddatetime = new byte[value.Length]; Buffer.BlockCopy(value, 0, _enddatetime, 0, value.Length); }
-                }
-            }
-            public bool AlreadyVoted;
-            private byte[] _votecast;
-            public byte[] VoteCast
-            {
-                get { return _votecast; }
-                set
-                {
-                    if (value == null) { _votecast = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _votecast = new byte[value.Length]; Buffer.BlockCopy(value, 0, _votecast, 0, value.Length); }
-                }
-            }
-            public float Majority;
-            public int Quorum;
-            private byte[] _proposaltext;
-            public byte[] ProposalText
-            {
-                get { return _proposaltext; }
-                set
-                {
-                    if (value == null) { _proposaltext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _proposaltext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _proposaltext, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 41;
-                    if (TerseDateID != null) { length += 1 + TerseDateID.Length; }
-                    if (StartDateTime != null) { length += 1 + StartDateTime.Length; }
-                    if (EndDateTime != null) { length += 1 + EndDateTime.Length; }
-                    if (VoteCast != null) { length += 1 + VoteCast.Length; }
-                    if (ProposalText != null) { length += 1 + ProposalText.Length; }
-                    return length;
-                }
-            }
-
-            public ProposalDataBlock() { }
-            public ProposalDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    VoteID.FromBytes(bytes, i); i += 16;
-                    VoteInitiator.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _tersedateid = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _tersedateid, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _startdatetime = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _startdatetime, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _enddatetime = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _enddatetime, 0, length); i += length;
-                    AlreadyVoted = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _votecast = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _votecast, 0, length); i += length;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Majority = BitConverter.ToSingle(bytes, i); i += 4;
-                    Quorum = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _proposaltext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _proposaltext, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(VoteID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(VoteInitiator.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(TerseDateID == null) { Console.WriteLine("Warning: TerseDateID is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TerseDateID.Length;
-                Buffer.BlockCopy(TerseDateID, 0, bytes, i, TerseDateID.Length); i += TerseDateID.Length;
-                if(StartDateTime == null) { Console.WriteLine("Warning: StartDateTime is null, in " + this.GetType()); }
-                bytes[i++] = (byte)StartDateTime.Length;
-                Buffer.BlockCopy(StartDateTime, 0, bytes, i, StartDateTime.Length); i += StartDateTime.Length;
-                if(EndDateTime == null) { Console.WriteLine("Warning: EndDateTime is null, in " + this.GetType()); }
-                bytes[i++] = (byte)EndDateTime.Length;
-                Buffer.BlockCopy(EndDateTime, 0, bytes, i, EndDateTime.Length); i += EndDateTime.Length;
-                bytes[i++] = (byte)((AlreadyVoted) ? 1 : 0);
-                if(VoteCast == null) { Console.WriteLine("Warning: VoteCast is null, in " + this.GetType()); }
-                bytes[i++] = (byte)VoteCast.Length;
-                Buffer.BlockCopy(VoteCast, 0, bytes, i, VoteCast.Length); i += VoteCast.Length;
-                ba = BitConverter.GetBytes(Majority);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(Quorum % 256);
-                bytes[i++] = (byte)((Quorum >> 8) % 256);
-                bytes[i++] = (byte)((Quorum >> 16) % 256);
-                bytes[i++] = (byte)((Quorum >> 24) % 256);
-                if(ProposalText == null) { Console.WriteLine("Warning: ProposalText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ProposalText.Length;
-                Buffer.BlockCopy(ProposalText, 0, bytes, i, ProposalText.Length); i += ProposalText.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ProposalData --");
-                output.AppendLine(String.Format("VoteID: {0}", VoteID));
-                output.AppendLine(String.Format("VoteInitiator: {0}", VoteInitiator));
-                Helpers.FieldToString(output, TerseDateID, "TerseDateID");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, StartDateTime, "StartDateTime");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, EndDateTime, "EndDateTime");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("AlreadyVoted: {0}", AlreadyVoted));
-                Helpers.FieldToString(output, VoteCast, "VoteCast");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Majority: {0}", Majority));
-                output.AppendLine(String.Format("Quorum: {0}", Quorum));
-                Helpers.FieldToString(output, ProposalText, "ProposalText");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupActiveProposalItemReply; } }
-        public AgentDataBlock AgentData;
-        public TransactionDataBlock TransactionData;
-        public ProposalDataBlock[] ProposalData;
-
-        public GroupActiveProposalItemReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 360;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            TransactionData = new TransactionDataBlock();
-            ProposalData = new ProposalDataBlock[0];
-        }
-
-        public GroupActiveProposalItemReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ProposalData.Length < count) {
-                ProposalData = new ProposalDataBlock[count];
-                for(int j = 0; j < count; j++) ProposalData[j] = new ProposalDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ProposalData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupActiveProposalItemReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ProposalData.Length < count) {
-                ProposalData = new ProposalDataBlock[count];
-                for(int j = 0; j < count; j++) ProposalData[j] = new ProposalDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ProposalData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TransactionData.Length;;
-            length++;
-            for (int j = 0; j < ProposalData.Length; j++) { length += ProposalData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TransactionData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ProposalData.Length;
-            for (int j = 0; j < ProposalData.Length; j++) { ProposalData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupActiveProposalItemReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TransactionData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ProposalData.Length; j++)
-            {
-                output += ProposalData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupVoteHistoryRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionDataBlock
-        {
-            public LLUUID TransactionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public TransactionDataBlock() { }
-            public TransactionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionData --");
-                output.Append(String.Format("TransactionID: {0}", TransactionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupVoteHistoryRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-        public TransactionDataBlock TransactionData;
-
-        public GroupVoteHistoryRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 361;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-            TransactionData = new TransactionDataBlock();
-        }
-
-        public GroupVoteHistoryRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-        }
-
-        public GroupVoteHistoryRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;            length += TransactionData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            TransactionData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupVoteHistoryRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-                output += TransactionData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupVoteHistoryItemReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TransactionDataBlock
-        {
-            public LLUUID TransactionID;
-            public uint TotalNumItems;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public TransactionDataBlock() { }
-            public TransactionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TransactionID.FromBytes(bytes, i); i += 16;
-                    TotalNumItems = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransactionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(TotalNumItems % 256);
-                bytes[i++] = (byte)((TotalNumItems >> 8) % 256);
-                bytes[i++] = (byte)((TotalNumItems >> 16) % 256);
-                bytes[i++] = (byte)((TotalNumItems >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransactionData --");
-                output.AppendLine(String.Format("TransactionID: {0}", TransactionID));
-                output.Append(String.Format("TotalNumItems: {0}", TotalNumItems));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class HistoryItemDataBlock
-        {
-            public LLUUID VoteID;
-            private byte[] _tersedateid;
-            public byte[] TerseDateID
-            {
-                get { return _tersedateid; }
-                set
-                {
-                    if (value == null) { _tersedateid = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _tersedateid = new byte[value.Length]; Buffer.BlockCopy(value, 0, _tersedateid, 0, value.Length); }
-                }
-            }
-            private byte[] _startdatetime;
-            public byte[] StartDateTime
-            {
-                get { return _startdatetime; }
-                set
-                {
-                    if (value == null) { _startdatetime = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _startdatetime = new byte[value.Length]; Buffer.BlockCopy(value, 0, _startdatetime, 0, value.Length); }
-                }
-            }
-            private byte[] _enddatetime;
-            public byte[] EndDateTime
-            {
-                get { return _enddatetime; }
-                set
-                {
-                    if (value == null) { _enddatetime = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _enddatetime = new byte[value.Length]; Buffer.BlockCopy(value, 0, _enddatetime, 0, value.Length); }
-                }
-            }
-            public LLUUID VoteInitiator;
-            private byte[] _votetype;
-            public byte[] VoteType
-            {
-                get { return _votetype; }
-                set
-                {
-                    if (value == null) { _votetype = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _votetype = new byte[value.Length]; Buffer.BlockCopy(value, 0, _votetype, 0, value.Length); }
-                }
-            }
-            private byte[] _voteresult;
-            public byte[] VoteResult
-            {
-                get { return _voteresult; }
-                set
-                {
-                    if (value == null) { _voteresult = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _voteresult = new byte[value.Length]; Buffer.BlockCopy(value, 0, _voteresult, 0, value.Length); }
-                }
-            }
-            public float Majority;
-            public int Quorum;
-            private byte[] _proposaltext;
-            public byte[] ProposalText
-            {
-                get { return _proposaltext; }
-                set
-                {
-                    if (value == null) { _proposaltext = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _proposaltext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _proposaltext, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 40;
-                    if (TerseDateID != null) { length += 1 + TerseDateID.Length; }
-                    if (StartDateTime != null) { length += 1 + StartDateTime.Length; }
-                    if (EndDateTime != null) { length += 1 + EndDateTime.Length; }
-                    if (VoteType != null) { length += 1 + VoteType.Length; }
-                    if (VoteResult != null) { length += 1 + VoteResult.Length; }
-                    if (ProposalText != null) { length += 2 + ProposalText.Length; }
-                    return length;
-                }
-            }
-
-            public HistoryItemDataBlock() { }
-            public HistoryItemDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    VoteID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _tersedateid = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _tersedateid, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _startdatetime = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _startdatetime, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _enddatetime = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _enddatetime, 0, length); i += length;
-                    VoteInitiator.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _votetype = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _votetype, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _voteresult = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _voteresult, 0, length); i += length;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Majority = BitConverter.ToSingle(bytes, i); i += 4;
-                    Quorum = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _proposaltext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _proposaltext, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(VoteID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(TerseDateID == null) { Console.WriteLine("Warning: TerseDateID is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TerseDateID.Length;
-                Buffer.BlockCopy(TerseDateID, 0, bytes, i, TerseDateID.Length); i += TerseDateID.Length;
-                if(StartDateTime == null) { Console.WriteLine("Warning: StartDateTime is null, in " + this.GetType()); }
-                bytes[i++] = (byte)StartDateTime.Length;
-                Buffer.BlockCopy(StartDateTime, 0, bytes, i, StartDateTime.Length); i += StartDateTime.Length;
-                if(EndDateTime == null) { Console.WriteLine("Warning: EndDateTime is null, in " + this.GetType()); }
-                bytes[i++] = (byte)EndDateTime.Length;
-                Buffer.BlockCopy(EndDateTime, 0, bytes, i, EndDateTime.Length); i += EndDateTime.Length;
-                Buffer.BlockCopy(VoteInitiator.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(VoteType == null) { Console.WriteLine("Warning: VoteType is null, in " + this.GetType()); }
-                bytes[i++] = (byte)VoteType.Length;
-                Buffer.BlockCopy(VoteType, 0, bytes, i, VoteType.Length); i += VoteType.Length;
-                if(VoteResult == null) { Console.WriteLine("Warning: VoteResult is null, in " + this.GetType()); }
-                bytes[i++] = (byte)VoteResult.Length;
-                Buffer.BlockCopy(VoteResult, 0, bytes, i, VoteResult.Length); i += VoteResult.Length;
-                ba = BitConverter.GetBytes(Majority);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(Quorum % 256);
-                bytes[i++] = (byte)((Quorum >> 8) % 256);
-                bytes[i++] = (byte)((Quorum >> 16) % 256);
-                bytes[i++] = (byte)((Quorum >> 24) % 256);
-                if(ProposalText == null) { Console.WriteLine("Warning: ProposalText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(ProposalText.Length % 256);
-                bytes[i++] = (byte)((ProposalText.Length >> 8) % 256);
-                Buffer.BlockCopy(ProposalText, 0, bytes, i, ProposalText.Length); i += ProposalText.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HistoryItemData --");
-                output.AppendLine(String.Format("VoteID: {0}", VoteID));
-                Helpers.FieldToString(output, TerseDateID, "TerseDateID");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, StartDateTime, "StartDateTime");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, EndDateTime, "EndDateTime");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("VoteInitiator: {0}", VoteInitiator));
-                Helpers.FieldToString(output, VoteType, "VoteType");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, VoteResult, "VoteResult");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Majority: {0}", Majority));
-                output.AppendLine(String.Format("Quorum: {0}", Quorum));
-                Helpers.FieldToString(output, ProposalText, "ProposalText");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class VoteItemBlock
-        {
-            public LLUUID CandidateID;
-            private byte[] _votecast;
-            public byte[] VoteCast
-            {
-                get { return _votecast; }
-                set
-                {
-                    if (value == null) { _votecast = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _votecast = new byte[value.Length]; Buffer.BlockCopy(value, 0, _votecast, 0, value.Length); }
-                }
-            }
-            public int NumVotes;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 20;
-                    if (VoteCast != null) { length += 1 + VoteCast.Length; }
-                    return length;
-                }
-            }
-
-            public VoteItemBlock() { }
-            public VoteItemBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    CandidateID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _votecast = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _votecast, 0, length); i += length;
-                    NumVotes = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(CandidateID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(VoteCast == null) { Console.WriteLine("Warning: VoteCast is null, in " + this.GetType()); }
-                bytes[i++] = (byte)VoteCast.Length;
-                Buffer.BlockCopy(VoteCast, 0, bytes, i, VoteCast.Length); i += VoteCast.Length;
-                bytes[i++] = (byte)(NumVotes % 256);
-                bytes[i++] = (byte)((NumVotes >> 8) % 256);
-                bytes[i++] = (byte)((NumVotes >> 16) % 256);
-                bytes[i++] = (byte)((NumVotes >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- VoteItem --");
-                output.AppendLine(String.Format("CandidateID: {0}", CandidateID));
-                Helpers.FieldToString(output, VoteCast, "VoteCast");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("NumVotes: {0}", NumVotes));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupVoteHistoryItemReply; } }
-        public AgentDataBlock AgentData;
-        public TransactionDataBlock TransactionData;
-        public HistoryItemDataBlock HistoryItemData;
-        public VoteItemBlock[] VoteItem;
-
-        public GroupVoteHistoryItemReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 362;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            TransactionData = new TransactionDataBlock();
-            HistoryItemData = new HistoryItemDataBlock();
-            VoteItem = new VoteItemBlock[0];
-        }
-
-        public GroupVoteHistoryItemReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-            HistoryItemData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(VoteItem.Length < count) {
-                VoteItem = new VoteItemBlock[count];
-                for(int j = 0; j < count; j++) VoteItem[j] = new VoteItemBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { VoteItem[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupVoteHistoryItemReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TransactionData.FromBytes(bytes, ref i);
-            HistoryItemData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(VoteItem.Length < count) {
-                VoteItem = new VoteItemBlock[count];
-                for(int j = 0; j < count; j++) VoteItem[j] = new VoteItemBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { VoteItem[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += TransactionData.Length;            length += HistoryItemData.Length;;
-            length++;
-            for (int j = 0; j < VoteItem.Length; j++) { length += VoteItem[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TransactionData.ToBytes(bytes, ref i);
-            HistoryItemData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)VoteItem.Length;
-            for (int j = 0; j < VoteItem.Length; j++) { VoteItem[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupVoteHistoryItemReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TransactionData.ToString() + Environment.NewLine;
-                output += HistoryItemData.ToString() + Environment.NewLine;
-            for (int j = 0; j < VoteItem.Length; j++)
-            {
-                output += VoteItem[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class StartGroupProposalPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ProposalDataBlock
-        {
-            public LLUUID GroupID;
-            public int Quorum;
-            public float Majority;
-            public int Duration;
-            private byte[] _proposaltext;
-            public byte[] ProposalText
-            {
-                get { return _proposaltext; }
-                set
-                {
-                    if (value == null) { _proposaltext = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _proposaltext = new byte[value.Length]; Buffer.BlockCopy(value, 0, _proposaltext, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 28;
-                    if (ProposalText != null) { length += 1 + ProposalText.Length; }
-                    return length;
-                }
-            }
-
-            public ProposalDataBlock() { }
-            public ProposalDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    Quorum = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Majority = BitConverter.ToSingle(bytes, i); i += 4;
-                    Duration = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _proposaltext = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _proposaltext, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Quorum % 256);
-                bytes[i++] = (byte)((Quorum >> 8) % 256);
-                bytes[i++] = (byte)((Quorum >> 16) % 256);
-                bytes[i++] = (byte)((Quorum >> 24) % 256);
-                ba = BitConverter.GetBytes(Majority);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(Duration % 256);
-                bytes[i++] = (byte)((Duration >> 8) % 256);
-                bytes[i++] = (byte)((Duration >> 16) % 256);
-                bytes[i++] = (byte)((Duration >> 24) % 256);
-                if(ProposalText == null) { Console.WriteLine("Warning: ProposalText is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ProposalText.Length;
-                Buffer.BlockCopy(ProposalText, 0, bytes, i, ProposalText.Length); i += ProposalText.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ProposalData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("Quorum: {0}", Quorum));
-                output.AppendLine(String.Format("Majority: {0}", Majority));
-                output.AppendLine(String.Format("Duration: {0}", Duration));
-                Helpers.FieldToString(output, ProposalText, "ProposalText");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.StartGroupProposal; } }
-        public AgentDataBlock AgentData;
-        public ProposalDataBlock ProposalData;
-
-        public StartGroupProposalPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 363;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ProposalData = new ProposalDataBlock();
-        }
-
-        public StartGroupProposalPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ProposalData.FromBytes(bytes, ref i);
-        }
-
-        public StartGroupProposalPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ProposalData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ProposalData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ProposalData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- StartGroupProposal ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ProposalData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupProposalBallotPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ProposalDataBlock
-        {
-            public LLUUID ProposalID;
-            public LLUUID GroupID;
-            private byte[] _votecast;
-            public byte[] VoteCast
-            {
-                get { return _votecast; }
-                set
-                {
-                    if (value == null) { _votecast = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _votecast = new byte[value.Length]; Buffer.BlockCopy(value, 0, _votecast, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 32;
-                    if (VoteCast != null) { length += 1 + VoteCast.Length; }
-                    return length;
-                }
-            }
-
-            public ProposalDataBlock() { }
-            public ProposalDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ProposalID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _votecast = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _votecast, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ProposalID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(VoteCast == null) { Console.WriteLine("Warning: VoteCast is null, in " + this.GetType()); }
-                bytes[i++] = (byte)VoteCast.Length;
-                Buffer.BlockCopy(VoteCast, 0, bytes, i, VoteCast.Length); i += VoteCast.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ProposalData --");
-                output.AppendLine(String.Format("ProposalID: {0}", ProposalID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                Helpers.FieldToString(output, VoteCast, "VoteCast");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupProposalBallot; } }
-        public AgentDataBlock AgentData;
-        public ProposalDataBlock ProposalData;
-
-        public GroupProposalBallotPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 364;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ProposalData = new ProposalDataBlock();
-        }
-
-        public GroupProposalBallotPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ProposalData.FromBytes(bytes, ref i);
-        }
-
-        public GroupProposalBallotPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ProposalData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ProposalData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ProposalData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupProposalBallot ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ProposalData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupMembersRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public LLUUID RequestID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("RequestID: {0}", RequestID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupMembersRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public GroupMembersRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 366;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public GroupMembersRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public GroupMembersRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupMembersRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupMembersReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public LLUUID RequestID;
-            public int MemberCount;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    MemberCount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(MemberCount % 256);
-                bytes[i++] = (byte)((MemberCount >> 8) % 256);
-                bytes[i++] = (byte)((MemberCount >> 16) % 256);
-                bytes[i++] = (byte)((MemberCount >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.Append(String.Format("MemberCount: {0}", MemberCount));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MemberDataBlock
-        {
-            public LLUUID AgentID;
-            public int Contribution;
-            private byte[] _onlinestatus;
-            public byte[] OnlineStatus
-            {
-                get { return _onlinestatus; }
-                set
-                {
-                    if (value == null) { _onlinestatus = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _onlinestatus = new byte[value.Length]; Buffer.BlockCopy(value, 0, _onlinestatus, 0, value.Length); }
-                }
-            }
-            public ulong AgentPowers;
-            private byte[] _title;
-            public byte[] Title
-            {
-                get { return _title; }
-                set
-                {
-                    if (value == null) { _title = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _title = new byte[value.Length]; Buffer.BlockCopy(value, 0, _title, 0, value.Length); }
-                }
-            }
-            public bool IsOwner;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 29;
-                    if (OnlineStatus != null) { length += 1 + OnlineStatus.Length; }
-                    if (Title != null) { length += 1 + Title.Length; }
-                    return length;
-                }
-            }
-
-            public MemberDataBlock() { }
-            public MemberDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    Contribution = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _onlinestatus = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _onlinestatus, 0, length); i += length;
-                    AgentPowers = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    length = (ushort)bytes[i++];
-                    _title = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _title, 0, length); i += length;
-                    IsOwner = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Contribution % 256);
-                bytes[i++] = (byte)((Contribution >> 8) % 256);
-                bytes[i++] = (byte)((Contribution >> 16) % 256);
-                bytes[i++] = (byte)((Contribution >> 24) % 256);
-                if(OnlineStatus == null) { Console.WriteLine("Warning: OnlineStatus is null, in " + this.GetType()); }
-                bytes[i++] = (byte)OnlineStatus.Length;
-                Buffer.BlockCopy(OnlineStatus, 0, bytes, i, OnlineStatus.Length); i += OnlineStatus.Length;
-                bytes[i++] = (byte)(AgentPowers % 256);
-                bytes[i++] = (byte)((AgentPowers >> 8) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 16) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 24) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 32) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 40) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 48) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 56) % 256);
-                if(Title == null) { Console.WriteLine("Warning: Title is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Title.Length;
-                Buffer.BlockCopy(Title, 0, bytes, i, Title.Length); i += Title.Length;
-                bytes[i++] = (byte)((IsOwner) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MemberData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("Contribution: {0}", Contribution));
-                Helpers.FieldToString(output, OnlineStatus, "OnlineStatus");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("AgentPowers: {0}", AgentPowers));
-                Helpers.FieldToString(output, Title, "Title");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("IsOwner: {0}", IsOwner));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupMembersReply; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-        public MemberDataBlock[] MemberData;
-
-        public GroupMembersReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 367;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-            MemberData = new MemberDataBlock[0];
-        }
-
-        public GroupMembersReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(MemberData.Length < count) {
-                MemberData = new MemberDataBlock[count];
-                for(int j = 0; j < count; j++) MemberData[j] = new MemberDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { MemberData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupMembersReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(MemberData.Length < count) {
-                MemberData = new MemberDataBlock[count];
-                for(int j = 0; j < count; j++) MemberData[j] = new MemberDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { MemberData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            length++;
-            for (int j = 0; j < MemberData.Length; j++) { length += MemberData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)MemberData.Length;
-            for (int j = 0; j < MemberData.Length; j++) { MemberData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupMembersReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            for (int j = 0; j < MemberData.Length; j++)
-            {
-                output += MemberData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ActivateGroupPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ActivateGroup; } }
-        public AgentDataBlock AgentData;
-
-        public ActivateGroupPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 368;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public ActivateGroupPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public ActivateGroupPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ActivateGroup ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SetGroupContributionPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID GroupID;
-            public int Contribution;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    Contribution = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Contribution % 256);
-                bytes[i++] = (byte)((Contribution >> 8) % 256);
-                bytes[i++] = (byte)((Contribution >> 16) % 256);
-                bytes[i++] = (byte)((Contribution >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("Contribution: {0}", Contribution));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SetGroupContribution; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public SetGroupContributionPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 369;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public SetGroupContributionPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public SetGroupContributionPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SetGroupContribution ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SetGroupAcceptNoticesPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public LLUUID GroupID;
-            public bool AcceptNotices;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    AcceptNotices = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((AcceptNotices) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("AcceptNotices: {0}", AcceptNotices));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class NewDataBlock
-        {
-            public bool ListInProfile;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public NewDataBlock() { }
-            public NewDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ListInProfile = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((ListInProfile) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- NewData --");
-                output.Append(String.Format("ListInProfile: {0}", ListInProfile));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SetGroupAcceptNotices; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-        public NewDataBlock NewData;
-
-        public SetGroupAcceptNoticesPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 370;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-            NewData = new NewDataBlock();
-        }
-
-        public SetGroupAcceptNoticesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            NewData.FromBytes(bytes, ref i);
-        }
-
-        public SetGroupAcceptNoticesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-            NewData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;            length += NewData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            NewData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SetGroupAcceptNotices ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-                output += NewData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupRoleDataRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public LLUUID RequestID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("RequestID: {0}", RequestID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupRoleDataRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public GroupRoleDataRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 371;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public GroupRoleDataRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public GroupRoleDataRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupRoleDataRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupRoleDataReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public LLUUID RequestID;
-            public int RoleCount;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    RoleCount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(RoleCount % 256);
-                bytes[i++] = (byte)((RoleCount >> 8) % 256);
-                bytes[i++] = (byte)((RoleCount >> 16) % 256);
-                bytes[i++] = (byte)((RoleCount >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.Append(String.Format("RoleCount: {0}", RoleCount));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RoleDataBlock
-        {
-            public LLUUID RoleID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _title;
-            public byte[] Title
-            {
-                get { return _title; }
-                set
-                {
-                    if (value == null) { _title = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _title = new byte[value.Length]; Buffer.BlockCopy(value, 0, _title, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            public ulong Powers;
-            public uint Members;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 28;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Title != null) { length += 1 + Title.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public RoleDataBlock() { }
-            public RoleDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RoleID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _title = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _title, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    Powers = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    Members = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RoleID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Title == null) { Console.WriteLine("Warning: Title is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Title.Length;
-                Buffer.BlockCopy(Title, 0, bytes, i, Title.Length); i += Title.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                bytes[i++] = (byte)(Powers % 256);
-                bytes[i++] = (byte)((Powers >> 8) % 256);
-                bytes[i++] = (byte)((Powers >> 16) % 256);
-                bytes[i++] = (byte)((Powers >> 24) % 256);
-                bytes[i++] = (byte)((Powers >> 32) % 256);
-                bytes[i++] = (byte)((Powers >> 40) % 256);
-                bytes[i++] = (byte)((Powers >> 48) % 256);
-                bytes[i++] = (byte)((Powers >> 56) % 256);
-                bytes[i++] = (byte)(Members % 256);
-                bytes[i++] = (byte)((Members >> 8) % 256);
-                bytes[i++] = (byte)((Members >> 16) % 256);
-                bytes[i++] = (byte)((Members >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RoleData --");
-                output.AppendLine(String.Format("RoleID: {0}", RoleID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Title, "Title");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Powers: {0}", Powers));
-                output.Append(String.Format("Members: {0}", Members));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupRoleDataReply; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-        public RoleDataBlock[] RoleData;
-
-        public GroupRoleDataReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 372;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-            RoleData = new RoleDataBlock[0];
-        }
-
-        public GroupRoleDataReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(RoleData.Length < count) {
-                RoleData = new RoleDataBlock[count];
-                for(int j = 0; j < count; j++) RoleData[j] = new RoleDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { RoleData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupRoleDataReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(RoleData.Length < count) {
-                RoleData = new RoleDataBlock[count];
-                for(int j = 0; j < count; j++) RoleData[j] = new RoleDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { RoleData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            length++;
-            for (int j = 0; j < RoleData.Length; j++) { length += RoleData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)RoleData.Length;
-            for (int j = 0; j < RoleData.Length; j++) { RoleData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupRoleDataReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            for (int j = 0; j < RoleData.Length; j++)
-            {
-                output += RoleData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupRoleMembersRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public LLUUID RequestID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("RequestID: {0}", RequestID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupRoleMembersRequest; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock GroupData;
-
-        public GroupRoleMembersRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 373;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock();
-        }
-
-        public GroupRoleMembersRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public GroupRoleMembersRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            GroupData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += GroupData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            GroupData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupRoleMembersRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += GroupData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupRoleMembersReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-            public LLUUID RequestID;
-            public uint TotalPairs;
-
-            public int Length
-            {
-                get
-                {
-                    return 52;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    TotalPairs = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(TotalPairs % 256);
-                bytes[i++] = (byte)((TotalPairs >> 8) % 256);
-                bytes[i++] = (byte)((TotalPairs >> 16) % 256);
-                bytes[i++] = (byte)((TotalPairs >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.Append(String.Format("TotalPairs: {0}", TotalPairs));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class MemberDataBlock
-        {
-            public LLUUID RoleID;
-            public LLUUID MemberID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public MemberDataBlock() { }
-            public MemberDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RoleID.FromBytes(bytes, i); i += 16;
-                    MemberID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RoleID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(MemberID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MemberData --");
-                output.AppendLine(String.Format("RoleID: {0}", RoleID));
-                output.Append(String.Format("MemberID: {0}", MemberID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupRoleMembersReply; } }
-        public AgentDataBlock AgentData;
-        public MemberDataBlock[] MemberData;
-
-        public GroupRoleMembersReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 374;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            MemberData = new MemberDataBlock[0];
-        }
-
-        public GroupRoleMembersReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(MemberData.Length < count) {
-                MemberData = new MemberDataBlock[count];
-                for(int j = 0; j < count; j++) MemberData[j] = new MemberDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { MemberData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupRoleMembersReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(MemberData.Length < count) {
-                MemberData = new MemberDataBlock[count];
-                for(int j = 0; j < count; j++) MemberData[j] = new MemberDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { MemberData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < MemberData.Length; j++) { length += MemberData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)MemberData.Length;
-            for (int j = 0; j < MemberData.Length; j++) { MemberData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupRoleMembersReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < MemberData.Length; j++)
-            {
-                output += MemberData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupTitlesRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-            public LLUUID RequestID;
-
-            public int Length
-            {
-                get
-                {
-                    return 64;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("RequestID: {0}", RequestID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupTitlesRequest; } }
-        public AgentDataBlock AgentData;
-
-        public GroupTitlesRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 375;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public GroupTitlesRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public GroupTitlesRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupTitlesRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupTitlesReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-            public LLUUID RequestID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    RequestID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("RequestID: {0}", RequestID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            private byte[] _title;
-            public byte[] Title
-            {
-                get { return _title; }
-                set
-                {
-                    if (value == null) { _title = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _title = new byte[value.Length]; Buffer.BlockCopy(value, 0, _title, 0, value.Length); }
-                }
-            }
-            public LLUUID RoleID;
-            public bool Selected;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 17;
-                    if (Title != null) { length += 1 + Title.Length; }
-                    return length;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _title = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _title, 0, length); i += length;
-                    RoleID.FromBytes(bytes, i); i += 16;
-                    Selected = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Title == null) { Console.WriteLine("Warning: Title is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Title.Length;
-                Buffer.BlockCopy(Title, 0, bytes, i, Title.Length); i += Title.Length;
-                Buffer.BlockCopy(RoleID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((Selected) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                Helpers.FieldToString(output, Title, "Title");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("RoleID: {0}", RoleID));
-                output.Append(String.Format("Selected: {0}", Selected));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupTitlesReply; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock[] GroupData;
-
-        public GroupTitlesReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 376;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock[0];
-        }
-
-        public GroupTitlesReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(GroupData.Length < count) {
-                GroupData = new GroupDataBlock[count];
-                for(int j = 0; j < count; j++) GroupData[j] = new GroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GroupData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupTitlesReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(GroupData.Length < count) {
-                GroupData = new GroupDataBlock[count];
-                for(int j = 0; j < count; j++) GroupData[j] = new GroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GroupData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < GroupData.Length; j++) { length += GroupData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)GroupData.Length;
-            for (int j = 0; j < GroupData.Length; j++) { GroupData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupTitlesReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < GroupData.Length; j++)
-            {
-                output += GroupData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupTitleUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-            public LLUUID TitleRoleID;
-
-            public int Length
-            {
-                get
-                {
-                    return 64;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    TitleRoleID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(TitleRoleID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.Append(String.Format("TitleRoleID: {0}", TitleRoleID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupTitleUpdate; } }
-        public AgentDataBlock AgentData;
-
-        public GroupTitleUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 377;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public GroupTitleUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public GroupTitleUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupTitleUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupRoleUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RoleDataBlock
-        {
-            public LLUUID RoleID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            private byte[] _title;
-            public byte[] Title
-            {
-                get { return _title; }
-                set
-                {
-                    if (value == null) { _title = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _title = new byte[value.Length]; Buffer.BlockCopy(value, 0, _title, 0, value.Length); }
-                }
-            }
-            public ulong Powers;
-            public byte UpdateType;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 25;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    if (Title != null) { length += 1 + Title.Length; }
-                    return length;
-                }
-            }
-
-            public RoleDataBlock() { }
-            public RoleDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RoleID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _title = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _title, 0, length); i += length;
-                    Powers = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    UpdateType = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RoleID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                if(Title == null) { Console.WriteLine("Warning: Title is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Title.Length;
-                Buffer.BlockCopy(Title, 0, bytes, i, Title.Length); i += Title.Length;
-                bytes[i++] = (byte)(Powers % 256);
-                bytes[i++] = (byte)((Powers >> 8) % 256);
-                bytes[i++] = (byte)((Powers >> 16) % 256);
-                bytes[i++] = (byte)((Powers >> 24) % 256);
-                bytes[i++] = (byte)((Powers >> 32) % 256);
-                bytes[i++] = (byte)((Powers >> 40) % 256);
-                bytes[i++] = (byte)((Powers >> 48) % 256);
-                bytes[i++] = (byte)((Powers >> 56) % 256);
-                bytes[i++] = UpdateType;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RoleData --");
-                output.AppendLine(String.Format("RoleID: {0}", RoleID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Title, "Title");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Powers: {0}", Powers));
-                output.Append(String.Format("UpdateType: {0}", UpdateType));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupRoleUpdate; } }
-        public AgentDataBlock AgentData;
-        public RoleDataBlock[] RoleData;
-
-        public GroupRoleUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 378;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            RoleData = new RoleDataBlock[0];
-        }
-
-        public GroupRoleUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(RoleData.Length < count) {
-                RoleData = new RoleDataBlock[count];
-                for(int j = 0; j < count; j++) RoleData[j] = new RoleDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { RoleData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupRoleUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(RoleData.Length < count) {
-                RoleData = new RoleDataBlock[count];
-                for(int j = 0; j < count; j++) RoleData[j] = new RoleDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { RoleData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < RoleData.Length; j++) { length += RoleData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)RoleData.Length;
-            for (int j = 0; j < RoleData.Length; j++) { RoleData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupRoleUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < RoleData.Length; j++)
-            {
-                output += RoleData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LiveHelpGroupRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class RequestDataBlock
-        {
-            public LLUUID RequestID;
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public RequestDataBlock() { }
-            public RequestDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RequestData --");
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LiveHelpGroupRequest; } }
-        public RequestDataBlock RequestData;
-
-        public LiveHelpGroupRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 379;
-            Header.Reliable = true;
-            RequestData = new RequestDataBlock();
-        }
-
-        public LiveHelpGroupRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RequestData.FromBytes(bytes, ref i);
-        }
-
-        public LiveHelpGroupRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RequestData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += RequestData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RequestData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LiveHelpGroupRequest ---" + Environment.NewLine;
-                output += RequestData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LiveHelpGroupReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class ReplyDataBlock
-        {
-            public LLUUID RequestID;
-            public LLUUID GroupID;
-            private byte[] _selection;
-            public byte[] Selection
-            {
-                get { return _selection; }
-                set
-                {
-                    if (value == null) { _selection = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _selection = new byte[value.Length]; Buffer.BlockCopy(value, 0, _selection, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 32;
-                    if (Selection != null) { length += 1 + Selection.Length; }
-                    return length;
-                }
-            }
-
-            public ReplyDataBlock() { }
-            public ReplyDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RequestID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _selection = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _selection, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(RequestID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Selection == null) { Console.WriteLine("Warning: Selection is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Selection.Length;
-                Buffer.BlockCopy(Selection, 0, bytes, i, Selection.Length); i += Selection.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ReplyData --");
-                output.AppendLine(String.Format("RequestID: {0}", RequestID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                Helpers.FieldToString(output, Selection, "Selection");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LiveHelpGroupReply; } }
-        public ReplyDataBlock ReplyData;
-
-        public LiveHelpGroupReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 380;
-            Header.Reliable = true;
-            ReplyData = new ReplyDataBlock();
-        }
-
-        public LiveHelpGroupReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ReplyData.FromBytes(bytes, ref i);
-        }
-
-        public LiveHelpGroupReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ReplyData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ReplyData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ReplyData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LiveHelpGroupReply ---" + Environment.NewLine;
-                output += ReplyData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentWearablesRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentWearablesRequest; } }
-        public AgentDataBlock AgentData;
-
-        public AgentWearablesRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 381;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AgentWearablesRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AgentWearablesRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentWearablesRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentWearablesUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint SerialNum;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    SerialNum = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SerialNum % 256);
-                bytes[i++] = (byte)((SerialNum >> 8) % 256);
-                bytes[i++] = (byte)((SerialNum >> 16) % 256);
-                bytes[i++] = (byte)((SerialNum >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("SerialNum: {0}", SerialNum));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class WearableDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID AssetID;
-            public byte WearableType;
-
-            public int Length
-            {
-                get
-                {
-                    return 33;
-                }
-            }
-
-            public WearableDataBlock() { }
-            public WearableDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    AssetID.FromBytes(bytes, i); i += 16;
-                    WearableType = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = WearableType;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- WearableData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("AssetID: {0}", AssetID));
-                output.Append(String.Format("WearableType: {0}", WearableType));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentWearablesUpdate; } }
-        public AgentDataBlock AgentData;
-        public WearableDataBlock[] WearableData;
-
-        public AgentWearablesUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 382;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            WearableData = new WearableDataBlock[0];
-        }
-
-        public AgentWearablesUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-        }
-
-        public AgentWearablesUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < WearableData.Length; j++) { length += WearableData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)WearableData.Length;
-            for (int j = 0; j < WearableData.Length; j++) { WearableData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentWearablesUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < WearableData.Length; j++)
-            {
-                output += WearableData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentIsNowWearingPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class WearableDataBlock
-        {
-            public LLUUID ItemID;
-            public byte WearableType;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public WearableDataBlock() { }
-            public WearableDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    WearableType = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = WearableType;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- WearableData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.Append(String.Format("WearableType: {0}", WearableType));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentIsNowWearing; } }
-        public AgentDataBlock AgentData;
-        public WearableDataBlock[] WearableData;
-
-        public AgentIsNowWearingPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 383;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            WearableData = new WearableDataBlock[0];
-        }
-
-        public AgentIsNowWearingPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-        }
-
-        public AgentIsNowWearingPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < WearableData.Length; j++) { length += WearableData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)WearableData.Length;
-            for (int j = 0; j < WearableData.Length; j++) { WearableData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentIsNowWearing ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < WearableData.Length; j++)
-            {
-                output += WearableData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentCachedTexturePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public int SerialNum;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    SerialNum = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SerialNum % 256);
-                bytes[i++] = (byte)((SerialNum >> 8) % 256);
-                bytes[i++] = (byte)((SerialNum >> 16) % 256);
-                bytes[i++] = (byte)((SerialNum >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("SerialNum: {0}", SerialNum));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class WearableDataBlock
-        {
-            public LLUUID ID;
-            public byte TextureIndex;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public WearableDataBlock() { }
-            public WearableDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    TextureIndex = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = TextureIndex;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- WearableData --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.Append(String.Format("TextureIndex: {0}", TextureIndex));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentCachedTexture; } }
-        public AgentDataBlock AgentData;
-        public WearableDataBlock[] WearableData;
-
-        public AgentCachedTexturePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 384;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            WearableData = new WearableDataBlock[0];
-        }
-
-        public AgentCachedTexturePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-        }
-
-        public AgentCachedTexturePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < WearableData.Length; j++) { length += WearableData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)WearableData.Length;
-            for (int j = 0; j < WearableData.Length; j++) { WearableData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentCachedTexture ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < WearableData.Length; j++)
-            {
-                output += WearableData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentCachedTextureResponsePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public int SerialNum;
-
-            public int Length
-            {
-                get
-                {
-                    return 36;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    SerialNum = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(SerialNum % 256);
-                bytes[i++] = (byte)((SerialNum >> 8) % 256);
-                bytes[i++] = (byte)((SerialNum >> 16) % 256);
-                bytes[i++] = (byte)((SerialNum >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("SerialNum: {0}", SerialNum));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class WearableDataBlock
-        {
-            public LLUUID TextureID;
-            public byte TextureIndex;
-            private byte[] _hostname;
-            public byte[] HostName
-            {
-                get { return _hostname; }
-                set
-                {
-                    if (value == null) { _hostname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _hostname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _hostname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 17;
-                    if (HostName != null) { length += 1 + HostName.Length; }
-                    return length;
-                }
-            }
-
-            public WearableDataBlock() { }
-            public WearableDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TextureID.FromBytes(bytes, i); i += 16;
-                    TextureIndex = (byte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _hostname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _hostname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TextureID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = TextureIndex;
-                if(HostName == null) { Console.WriteLine("Warning: HostName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)HostName.Length;
-                Buffer.BlockCopy(HostName, 0, bytes, i, HostName.Length); i += HostName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- WearableData --");
-                output.AppendLine(String.Format("TextureID: {0}", TextureID));
-                output.AppendLine(String.Format("TextureIndex: {0}", TextureIndex));
-                Helpers.FieldToString(output, HostName, "HostName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentCachedTextureResponse; } }
-        public AgentDataBlock AgentData;
-        public WearableDataBlock[] WearableData;
-
-        public AgentCachedTextureResponsePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 385;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            WearableData = new WearableDataBlock[0];
-        }
-
-        public AgentCachedTextureResponsePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-        }
-
-        public AgentCachedTextureResponsePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(WearableData.Length < count) {
-                WearableData = new WearableDataBlock[count];
-                for(int j = 0; j < count; j++) WearableData[j] = new WearableDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { WearableData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < WearableData.Length; j++) { length += WearableData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)WearableData.Length;
-            for (int j = 0; j < WearableData.Length; j++) { WearableData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentCachedTextureResponse ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < WearableData.Length; j++)
-            {
-                output += WearableData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentDataUpdateRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentDataUpdateRequest; } }
-        public AgentDataBlock AgentData;
-
-        public AgentDataUpdateRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 386;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AgentDataUpdateRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AgentDataUpdateRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentDataUpdateRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentDataUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            private byte[] _firstname;
-            public byte[] FirstName
-            {
-                get { return _firstname; }
-                set
-                {
-                    if (value == null) { _firstname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _firstname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _firstname, 0, value.Length); }
-                }
-            }
-            private byte[] _lastname;
-            public byte[] LastName
-            {
-                get { return _lastname; }
-                set
-                {
-                    if (value == null) { _lastname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _lastname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _lastname, 0, value.Length); }
-                }
-            }
-            private byte[] _grouptitle;
-            public byte[] GroupTitle
-            {
-                get { return _grouptitle; }
-                set
-                {
-                    if (value == null) { _grouptitle = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _grouptitle = new byte[value.Length]; Buffer.BlockCopy(value, 0, _grouptitle, 0, value.Length); }
-                }
-            }
-            public LLUUID ActiveGroupID;
-            public ulong GroupPowers;
-            private byte[] _groupname;
-            public byte[] GroupName
-            {
-                get { return _groupname; }
-                set
-                {
-                    if (value == null) { _groupname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _groupname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _groupname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 40;
-                    if (FirstName != null) { length += 1 + FirstName.Length; }
-                    if (LastName != null) { length += 1 + LastName.Length; }
-                    if (GroupTitle != null) { length += 1 + GroupTitle.Length; }
-                    if (GroupName != null) { length += 1 + GroupName.Length; }
-                    return length;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _firstname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _firstname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _lastname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _lastname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _grouptitle = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _grouptitle, 0, length); i += length;
-                    ActiveGroupID.FromBytes(bytes, i); i += 16;
-                    GroupPowers = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    length = (ushort)bytes[i++];
-                    _groupname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _groupname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(FirstName == null) { Console.WriteLine("Warning: FirstName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)FirstName.Length;
-                Buffer.BlockCopy(FirstName, 0, bytes, i, FirstName.Length); i += FirstName.Length;
-                if(LastName == null) { Console.WriteLine("Warning: LastName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)LastName.Length;
-                Buffer.BlockCopy(LastName, 0, bytes, i, LastName.Length); i += LastName.Length;
-                if(GroupTitle == null) { Console.WriteLine("Warning: GroupTitle is null, in " + this.GetType()); }
-                bytes[i++] = (byte)GroupTitle.Length;
-                Buffer.BlockCopy(GroupTitle, 0, bytes, i, GroupTitle.Length); i += GroupTitle.Length;
-                Buffer.BlockCopy(ActiveGroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(GroupPowers % 256);
-                bytes[i++] = (byte)((GroupPowers >> 8) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 16) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 24) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 32) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 40) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 48) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 56) % 256);
-                if(GroupName == null) { Console.WriteLine("Warning: GroupName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)GroupName.Length;
-                Buffer.BlockCopy(GroupName, 0, bytes, i, GroupName.Length); i += GroupName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                Helpers.FieldToString(output, FirstName, "FirstName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, LastName, "LastName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, GroupTitle, "GroupTitle");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ActiveGroupID: {0}", ActiveGroupID));
-                output.AppendLine(String.Format("GroupPowers: {0}", GroupPowers));
-                Helpers.FieldToString(output, GroupName, "GroupName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentDataUpdate; } }
-        public AgentDataBlock AgentData;
-
-        public AgentDataUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 387;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AgentDataUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AgentDataUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentDataUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class GroupDataUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentGroupDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-            public ulong AgentPowers;
-            private byte[] _grouptitle;
-            public byte[] GroupTitle
-            {
-                get { return _grouptitle; }
-                set
-                {
-                    if (value == null) { _grouptitle = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _grouptitle = new byte[value.Length]; Buffer.BlockCopy(value, 0, _grouptitle, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 40;
-                    if (GroupTitle != null) { length += 1 + GroupTitle.Length; }
-                    return length;
-                }
-            }
-
-            public AgentGroupDataBlock() { }
-            public AgentGroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    AgentPowers = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    length = (ushort)bytes[i++];
-                    _grouptitle = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _grouptitle, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(AgentPowers % 256);
-                bytes[i++] = (byte)((AgentPowers >> 8) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 16) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 24) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 32) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 40) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 48) % 256);
-                bytes[i++] = (byte)((AgentPowers >> 56) % 256);
-                if(GroupTitle == null) { Console.WriteLine("Warning: GroupTitle is null, in " + this.GetType()); }
-                bytes[i++] = (byte)GroupTitle.Length;
-                Buffer.BlockCopy(GroupTitle, 0, bytes, i, GroupTitle.Length); i += GroupTitle.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentGroupData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("AgentPowers: {0}", AgentPowers));
-                Helpers.FieldToString(output, GroupTitle, "GroupTitle");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.GroupDataUpdate; } }
-        public AgentGroupDataBlock[] AgentGroupData;
-
-        public GroupDataUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 388;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentGroupData = new AgentGroupDataBlock[0];
-        }
-
-        public GroupDataUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(AgentGroupData.Length < count) {
-                AgentGroupData = new AgentGroupDataBlock[count];
-                for(int j = 0; j < count; j++) AgentGroupData[j] = new AgentGroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AgentGroupData[j].FromBytes(bytes, ref i); }
-        }
-
-        public GroupDataUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(AgentGroupData.Length < count) {
-                AgentGroupData = new AgentGroupDataBlock[count];
-                for(int j = 0; j < count; j++) AgentGroupData[j] = new AgentGroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AgentGroupData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < AgentGroupData.Length; j++) { length += AgentGroupData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)AgentGroupData.Length;
-            for (int j = 0; j < AgentGroupData.Length; j++) { AgentGroupData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- GroupDataUpdate ---" + Environment.NewLine;
-            for (int j = 0; j < AgentGroupData.Length; j++)
-            {
-                output += AgentGroupData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentGroupDataUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public ulong GroupPowers;
-            public bool AcceptNotices;
-            public LLUUID GroupInsigniaID;
-            public int Contribution;
-            private byte[] _groupname;
-            public byte[] GroupName
-            {
-                get { return _groupname; }
-                set
-                {
-                    if (value == null) { _groupname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _groupname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _groupname, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 45;
-                    if (GroupName != null) { length += 1 + GroupName.Length; }
-                    return length;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    GroupPowers = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    AcceptNotices = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    GroupInsigniaID.FromBytes(bytes, i); i += 16;
-                    Contribution = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _groupname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _groupname, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(GroupPowers % 256);
-                bytes[i++] = (byte)((GroupPowers >> 8) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 16) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 24) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 32) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 40) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 48) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 56) % 256);
-                bytes[i++] = (byte)((AcceptNotices) ? 1 : 0);
-                Buffer.BlockCopy(GroupInsigniaID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Contribution % 256);
-                bytes[i++] = (byte)((Contribution >> 8) % 256);
-                bytes[i++] = (byte)((Contribution >> 16) % 256);
-                bytes[i++] = (byte)((Contribution >> 24) % 256);
-                if(GroupName == null) { Console.WriteLine("Warning: GroupName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)GroupName.Length;
-                Buffer.BlockCopy(GroupName, 0, bytes, i, GroupName.Length); i += GroupName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("GroupPowers: {0}", GroupPowers));
-                output.AppendLine(String.Format("AcceptNotices: {0}", AcceptNotices));
-                output.AppendLine(String.Format("GroupInsigniaID: {0}", GroupInsigniaID));
-                output.AppendLine(String.Format("Contribution: {0}", Contribution));
-                Helpers.FieldToString(output, GroupName, "GroupName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentGroupDataUpdate; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock[] GroupData;
-
-        public AgentGroupDataUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 389;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock[0];
-        }
-
-        public AgentGroupDataUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(GroupData.Length < count) {
-                GroupData = new GroupDataBlock[count];
-                for(int j = 0; j < count; j++) GroupData[j] = new GroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GroupData[j].FromBytes(bytes, ref i); }
-        }
-
-        public AgentGroupDataUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(GroupData.Length < count) {
-                GroupData = new GroupDataBlock[count];
-                for(int j = 0; j < count; j++) GroupData[j] = new GroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GroupData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < GroupData.Length; j++) { length += GroupData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)GroupData.Length;
-            for (int j = 0; j < GroupData.Length; j++) { GroupData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentGroupDataUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < GroupData.Length; j++)
-            {
-                output += GroupData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentDropGroupPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentDropGroup; } }
-        public AgentDataBlock AgentData;
-
-        public AgentDropGroupPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 390;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AgentDropGroupPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AgentDropGroupPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentDropGroup ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CreateTrustedCircuitPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlockBlock
-        {
-            public LLUUID EndPointID;
-            public byte[] Digest;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public DataBlockBlock() { }
-            public DataBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    EndPointID.FromBytes(bytes, i); i += 16;
-                    Digest = new byte[32];
-                    Buffer.BlockCopy(bytes, i, Digest, 0, 32); i += 32;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(EndPointID.GetBytes(), 0, bytes, i, 16); i += 16;
-                                Buffer.BlockCopy(Digest, 0, bytes, i, 32);i += 32;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlock --");
-                output.AppendLine(String.Format("EndPointID: {0}", EndPointID));
-                Helpers.FieldToString(output, Digest, "Digest");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CreateTrustedCircuit; } }
-        public DataBlockBlock DataBlock;
-
-        public CreateTrustedCircuitPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 392;
-            Header.Reliable = true;
-            DataBlock = new DataBlockBlock();
-        }
-
-        public CreateTrustedCircuitPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public CreateTrustedCircuitPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += DataBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            DataBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CreateTrustedCircuit ---" + Environment.NewLine;
-                output += DataBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DenyTrustedCircuitPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlockBlock
-        {
-            public LLUUID EndPointID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public DataBlockBlock() { }
-            public DataBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    EndPointID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(EndPointID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlock --");
-                output.Append(String.Format("EndPointID: {0}", EndPointID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DenyTrustedCircuit; } }
-        public DataBlockBlock DataBlock;
-
-        public DenyTrustedCircuitPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 393;
-            Header.Reliable = true;
-            DataBlock = new DataBlockBlock();
-        }
-
-        public DenyTrustedCircuitPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public DenyTrustedCircuitPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += DataBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            DataBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DenyTrustedCircuit ---" + Environment.NewLine;
-                output += DataBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestTrustedCircuitPacket : Packet
-    {
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestTrustedCircuit; } }
-
-        public RequestTrustedCircuitPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 394;
-            Header.Reliable = true;
-        }
-
-        public RequestTrustedCircuitPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-        }
-
-        public RequestTrustedCircuitPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestTrustedCircuit ---" + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RezSingleAttachmentFromInvPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID OwnerID;
-            public byte AttachmentPt;
-            public uint ItemFlags;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 49;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    AttachmentPt = (byte)bytes[i++];
-                    ItemFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = AttachmentPt;
-                bytes[i++] = (byte)(ItemFlags % 256);
-                bytes[i++] = (byte)((ItemFlags >> 8) % 256);
-                bytes[i++] = (byte)((ItemFlags >> 16) % 256);
-                bytes[i++] = (byte)((ItemFlags >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("AttachmentPt: {0}", AttachmentPt));
-                output.AppendLine(String.Format("ItemFlags: {0}", ItemFlags));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RezSingleAttachmentFromInv; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-
-        public RezSingleAttachmentFromInvPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 395;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public RezSingleAttachmentFromInvPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public RezSingleAttachmentFromInvPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RezSingleAttachmentFromInv ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RezMultipleAttachmentsFromInvPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class HeaderDataBlock
-        {
-            public LLUUID CompoundMsgID;
-            public byte TotalObjects;
-            public bool FirstDetachAll;
-
-            public int Length
-            {
-                get
-                {
-                    return 18;
-                }
-            }
-
-            public HeaderDataBlock() { }
-            public HeaderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    CompoundMsgID.FromBytes(bytes, i); i += 16;
-                    TotalObjects = (byte)bytes[i++];
-                    FirstDetachAll = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(CompoundMsgID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = TotalObjects;
-                bytes[i++] = (byte)((FirstDetachAll) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HeaderData --");
-                output.AppendLine(String.Format("CompoundMsgID: {0}", CompoundMsgID));
-                output.AppendLine(String.Format("TotalObjects: {0}", TotalObjects));
-                output.Append(String.Format("FirstDetachAll: {0}", FirstDetachAll));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ItemID;
-            public LLUUID OwnerID;
-            public byte AttachmentPt;
-            public uint ItemFlags;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 49;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    AttachmentPt = (byte)bytes[i++];
-                    ItemFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = AttachmentPt;
-                bytes[i++] = (byte)(ItemFlags % 256);
-                bytes[i++] = (byte)((ItemFlags >> 8) % 256);
-                bytes[i++] = (byte)((ItemFlags >> 16) % 256);
-                bytes[i++] = (byte)((ItemFlags >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("AttachmentPt: {0}", AttachmentPt));
-                output.AppendLine(String.Format("ItemFlags: {0}", ItemFlags));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RezMultipleAttachmentsFromInv; } }
-        public AgentDataBlock AgentData;
-        public HeaderDataBlock HeaderData;
-        public ObjectDataBlock[] ObjectData;
-
-        public RezMultipleAttachmentsFromInvPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 396;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            HeaderData = new HeaderDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public RezMultipleAttachmentsFromInvPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeaderData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public RezMultipleAttachmentsFromInvPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeaderData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += HeaderData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            HeaderData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RezMultipleAttachmentsFromInv ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += HeaderData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class DetachAttachmentIntoInvPacket : Packet
-    {
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID ItemID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    ItemID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("ItemID: {0}", ItemID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.DetachAttachmentIntoInv; } }
-        public ObjectDataBlock ObjectData;
-
-        public DetachAttachmentIntoInvPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 397;
-            Header.Reliable = true;
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public DetachAttachmentIntoInvPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public DetachAttachmentIntoInvPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- DetachAttachmentIntoInv ---" + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CreateNewOutfitAttachmentsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class HeaderDataBlock
-        {
-            public LLUUID NewFolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public HeaderDataBlock() { }
-            public HeaderDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    NewFolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(NewFolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- HeaderData --");
-                output.Append(String.Format("NewFolderID: {0}", NewFolderID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID OldItemID;
-            public LLUUID OldFolderID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    OldItemID.FromBytes(bytes, i); i += 16;
-                    OldFolderID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(OldItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OldFolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("OldItemID: {0}", OldItemID));
-                output.Append(String.Format("OldFolderID: {0}", OldFolderID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CreateNewOutfitAttachments; } }
-        public AgentDataBlock AgentData;
-        public HeaderDataBlock HeaderData;
-        public ObjectDataBlock[] ObjectData;
-
-        public CreateNewOutfitAttachmentsPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 398;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            HeaderData = new HeaderDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public CreateNewOutfitAttachmentsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeaderData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public CreateNewOutfitAttachmentsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            HeaderData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += HeaderData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            HeaderData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CreateNewOutfitAttachments ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += HeaderData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UserInfoRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UserInfoRequest; } }
-        public AgentDataBlock AgentData;
-
-        public UserInfoRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 399;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public UserInfoRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public UserInfoRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UserInfoRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UserInfoReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class UserDataBlock
-        {
-            public bool IMViaEMail;
-            private byte[] _directoryvisibility;
-            public byte[] DirectoryVisibility
-            {
-                get { return _directoryvisibility; }
-                set
-                {
-                    if (value == null) { _directoryvisibility = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _directoryvisibility = new byte[value.Length]; Buffer.BlockCopy(value, 0, _directoryvisibility, 0, value.Length); }
-                }
-            }
-            private byte[] _email;
-            public byte[] EMail
-            {
-                get { return _email; }
-                set
-                {
-                    if (value == null) { _email = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _email = new byte[value.Length]; Buffer.BlockCopy(value, 0, _email, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 1;
-                    if (DirectoryVisibility != null) { length += 1 + DirectoryVisibility.Length; }
-                    if (EMail != null) { length += 2 + EMail.Length; }
-                    return length;
-                }
-            }
-
-            public UserDataBlock() { }
-            public UserDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    IMViaEMail = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _directoryvisibility = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _directoryvisibility, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _email = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _email, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((IMViaEMail) ? 1 : 0);
-                if(DirectoryVisibility == null) { Console.WriteLine("Warning: DirectoryVisibility is null, in " + this.GetType()); }
-                bytes[i++] = (byte)DirectoryVisibility.Length;
-                Buffer.BlockCopy(DirectoryVisibility, 0, bytes, i, DirectoryVisibility.Length); i += DirectoryVisibility.Length;
-                if(EMail == null) { Console.WriteLine("Warning: EMail is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(EMail.Length % 256);
-                bytes[i++] = (byte)((EMail.Length >> 8) % 256);
-                Buffer.BlockCopy(EMail, 0, bytes, i, EMail.Length); i += EMail.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UserData --");
-                output.AppendLine(String.Format("IMViaEMail: {0}", IMViaEMail));
-                Helpers.FieldToString(output, DirectoryVisibility, "DirectoryVisibility");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, EMail, "EMail");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UserInfoReply; } }
-        public AgentDataBlock AgentData;
-        public UserDataBlock UserData;
-
-        public UserInfoReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 400;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            UserData = new UserDataBlock();
-        }
-
-        public UserInfoReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            UserData.FromBytes(bytes, ref i);
-        }
-
-        public UserInfoReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            UserData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += UserData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            UserData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UserInfoReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += UserData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class UpdateUserInfoPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class UserDataBlock
-        {
-            public bool IMViaEMail;
-            private byte[] _directoryvisibility;
-            public byte[] DirectoryVisibility
-            {
-                get { return _directoryvisibility; }
-                set
-                {
-                    if (value == null) { _directoryvisibility = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _directoryvisibility = new byte[value.Length]; Buffer.BlockCopy(value, 0, _directoryvisibility, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 1;
-                    if (DirectoryVisibility != null) { length += 1 + DirectoryVisibility.Length; }
-                    return length;
-                }
-            }
-
-            public UserDataBlock() { }
-            public UserDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    IMViaEMail = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    length = (ushort)bytes[i++];
-                    _directoryvisibility = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _directoryvisibility, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((IMViaEMail) ? 1 : 0);
-                if(DirectoryVisibility == null) { Console.WriteLine("Warning: DirectoryVisibility is null, in " + this.GetType()); }
-                bytes[i++] = (byte)DirectoryVisibility.Length;
-                Buffer.BlockCopy(DirectoryVisibility, 0, bytes, i, DirectoryVisibility.Length); i += DirectoryVisibility.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- UserData --");
-                output.AppendLine(String.Format("IMViaEMail: {0}", IMViaEMail));
-                Helpers.FieldToString(output, DirectoryVisibility, "DirectoryVisibility");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.UpdateUserInfo; } }
-        public AgentDataBlock AgentData;
-        public UserDataBlock UserData;
-
-        public UpdateUserInfoPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 401;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            UserData = new UserDataBlock();
-        }
-
-        public UpdateUserInfoPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            UserData.FromBytes(bytes, ref i);
-        }
-
-        public UpdateUserInfoPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            UserData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += UserData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            UserData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- UpdateUserInfo ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += UserData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class InitiateDownloadPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class FileDataBlock
-        {
-            private byte[] _simfilename;
-            public byte[] SimFilename
-            {
-                get { return _simfilename; }
-                set
-                {
-                    if (value == null) { _simfilename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _simfilename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _simfilename, 0, value.Length); }
-                }
-            }
-            private byte[] _viewerfilename;
-            public byte[] ViewerFilename
-            {
-                get { return _viewerfilename; }
-                set
-                {
-                    if (value == null) { _viewerfilename = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _viewerfilename = new byte[value.Length]; Buffer.BlockCopy(value, 0, _viewerfilename, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (SimFilename != null) { length += 1 + SimFilename.Length; }
-                    if (ViewerFilename != null) { length += 1 + ViewerFilename.Length; }
-                    return length;
-                }
-            }
-
-            public FileDataBlock() { }
-            public FileDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _simfilename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _simfilename, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _viewerfilename = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _viewerfilename, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(SimFilename == null) { Console.WriteLine("Warning: SimFilename is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SimFilename.Length;
-                Buffer.BlockCopy(SimFilename, 0, bytes, i, SimFilename.Length); i += SimFilename.Length;
-                if(ViewerFilename == null) { Console.WriteLine("Warning: ViewerFilename is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ViewerFilename.Length;
-                Buffer.BlockCopy(ViewerFilename, 0, bytes, i, ViewerFilename.Length); i += ViewerFilename.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- FileData --");
-                Helpers.FieldToString(output, SimFilename, "SimFilename");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, ViewerFilename, "ViewerFilename");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.InitiateDownload; } }
-        public AgentDataBlock AgentData;
-        public FileDataBlock FileData;
-
-        public InitiateDownloadPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 403;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            FileData = new FileDataBlock();
-        }
-
-        public InitiateDownloadPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            FileData.FromBytes(bytes, ref i);
-        }
-
-        public InitiateDownloadPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            FileData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += FileData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            FileData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- InitiateDownload ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += FileData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SystemMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class MethodDataBlock
-        {
-            private byte[] _method;
-            public byte[] Method
-            {
-                get { return _method; }
-                set
-                {
-                    if (value == null) { _method = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _method = new byte[value.Length]; Buffer.BlockCopy(value, 0, _method, 0, value.Length); }
-                }
-            }
-            public LLUUID Invoice;
-            public byte[] Digest;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 48;
-                    if (Method != null) { length += 1 + Method.Length; }
-                    return length;
-                }
-            }
-
-            public MethodDataBlock() { }
-            public MethodDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _method = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _method, 0, length); i += length;
-                    Invoice.FromBytes(bytes, i); i += 16;
-                    Digest = new byte[32];
-                    Buffer.BlockCopy(bytes, i, Digest, 0, 32); i += 32;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Method == null) { Console.WriteLine("Warning: Method is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Method.Length;
-                Buffer.BlockCopy(Method, 0, bytes, i, Method.Length); i += Method.Length;
-                Buffer.BlockCopy(Invoice.GetBytes(), 0, bytes, i, 16); i += 16;
-                                Buffer.BlockCopy(Digest, 0, bytes, i, 32);i += 32;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- MethodData --");
-                Helpers.FieldToString(output, Method, "Method");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Invoice: {0}", Invoice));
-                Helpers.FieldToString(output, Digest, "Digest");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParamListBlock
-        {
-            private byte[] _parameter;
-            public byte[] Parameter
-            {
-                get { return _parameter; }
-                set
-                {
-                    if (value == null) { _parameter = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _parameter = new byte[value.Length]; Buffer.BlockCopy(value, 0, _parameter, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Parameter != null) { length += 1 + Parameter.Length; }
-                    return length;
-                }
-            }
-
-            public ParamListBlock() { }
-            public ParamListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _parameter = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _parameter, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Parameter == null) { Console.WriteLine("Warning: Parameter is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Parameter.Length;
-                Buffer.BlockCopy(Parameter, 0, bytes, i, Parameter.Length); i += Parameter.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParamList --");
-                Helpers.FieldToString(output, Parameter, "Parameter");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SystemMessage; } }
-        public MethodDataBlock MethodData;
-        public ParamListBlock[] ParamList;
-
-        public SystemMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 404;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            MethodData = new MethodDataBlock();
-            ParamList = new ParamListBlock[0];
-        }
-
-        public SystemMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            MethodData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParamList.Length < count) {
-                ParamList = new ParamListBlock[count];
-                for(int j = 0; j < count; j++) ParamList[j] = new ParamListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParamList[j].FromBytes(bytes, ref i); }
-        }
-
-        public SystemMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            MethodData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ParamList.Length < count) {
-                ParamList = new ParamListBlock[count];
-                for(int j = 0; j < count; j++) ParamList[j] = new ParamListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ParamList[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += MethodData.Length;;
-            length++;
-            for (int j = 0; j < ParamList.Length; j++) { length += ParamList[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            MethodData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ParamList.Length;
-            for (int j = 0; j < ParamList.Length; j++) { ParamList[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SystemMessage ---" + Environment.NewLine;
-                output += MethodData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ParamList.Length; j++)
-            {
-                output += ParamList[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MapLayerRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint Flags;
-            public uint EstateID;
-            public bool Godlike;
-
-            public int Length
-            {
-                get
-                {
-                    return 41;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Godlike = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(EstateID % 256);
-                bytes[i++] = (byte)((EstateID >> 8) % 256);
-                bytes[i++] = (byte)((EstateID >> 16) % 256);
-                bytes[i++] = (byte)((EstateID >> 24) % 256);
-                bytes[i++] = (byte)((Godlike) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("EstateID: {0}", EstateID));
-                output.Append(String.Format("Godlike: {0}", Godlike));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MapLayerRequest; } }
-        public AgentDataBlock AgentData;
-
-        public MapLayerRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 405;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public MapLayerRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public MapLayerRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MapLayerRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MapLayerReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class LayerDataBlock
-        {
-            public uint Left;
-            public uint Right;
-            public uint Top;
-            public uint Bottom;
-            public LLUUID ImageID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public LayerDataBlock() { }
-            public LayerDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Left = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Right = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Top = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Bottom = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ImageID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Left % 256);
-                bytes[i++] = (byte)((Left >> 8) % 256);
-                bytes[i++] = (byte)((Left >> 16) % 256);
-                bytes[i++] = (byte)((Left >> 24) % 256);
-                bytes[i++] = (byte)(Right % 256);
-                bytes[i++] = (byte)((Right >> 8) % 256);
-                bytes[i++] = (byte)((Right >> 16) % 256);
-                bytes[i++] = (byte)((Right >> 24) % 256);
-                bytes[i++] = (byte)(Top % 256);
-                bytes[i++] = (byte)((Top >> 8) % 256);
-                bytes[i++] = (byte)((Top >> 16) % 256);
-                bytes[i++] = (byte)((Top >> 24) % 256);
-                bytes[i++] = (byte)(Bottom % 256);
-                bytes[i++] = (byte)((Bottom >> 8) % 256);
-                bytes[i++] = (byte)((Bottom >> 16) % 256);
-                bytes[i++] = (byte)((Bottom >> 24) % 256);
-                Buffer.BlockCopy(ImageID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- LayerData --");
-                output.AppendLine(String.Format("Left: {0}", Left));
-                output.AppendLine(String.Format("Right: {0}", Right));
-                output.AppendLine(String.Format("Top: {0}", Top));
-                output.AppendLine(String.Format("Bottom: {0}", Bottom));
-                output.Append(String.Format("ImageID: {0}", ImageID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MapLayerReply; } }
-        public AgentDataBlock AgentData;
-        public LayerDataBlock[] LayerData;
-
-        public MapLayerReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 406;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            LayerData = new LayerDataBlock[0];
-        }
-
-        public MapLayerReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(LayerData.Length < count) {
-                LayerData = new LayerDataBlock[count];
-                for(int j = 0; j < count; j++) LayerData[j] = new LayerDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { LayerData[j].FromBytes(bytes, ref i); }
-        }
-
-        public MapLayerReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(LayerData.Length < count) {
-                LayerData = new LayerDataBlock[count];
-                for(int j = 0; j < count; j++) LayerData[j] = new LayerDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { LayerData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < LayerData.Length; j++) { length += LayerData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)LayerData.Length;
-            for (int j = 0; j < LayerData.Length; j++) { LayerData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MapLayerReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < LayerData.Length; j++)
-            {
-                output += LayerData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MapBlockRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint Flags;
-            public uint EstateID;
-            public bool Godlike;
-
-            public int Length
-            {
-                get
-                {
-                    return 41;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Godlike = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(EstateID % 256);
-                bytes[i++] = (byte)((EstateID >> 8) % 256);
-                bytes[i++] = (byte)((EstateID >> 16) % 256);
-                bytes[i++] = (byte)((EstateID >> 24) % 256);
-                bytes[i++] = (byte)((Godlike) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("EstateID: {0}", EstateID));
-                output.Append(String.Format("Godlike: {0}", Godlike));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class PositionDataBlock
-        {
-            public ushort MinX;
-            public ushort MaxX;
-            public ushort MinY;
-            public ushort MaxY;
-
-            public int Length
-            {
-                get
-                {
-                    return 8;
-                }
-            }
-
-            public PositionDataBlock() { }
-            public PositionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    MinX = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    MaxX = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    MinY = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    MaxY = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(MinX % 256);
-                bytes[i++] = (byte)((MinX >> 8) % 256);
-                bytes[i++] = (byte)(MaxX % 256);
-                bytes[i++] = (byte)((MaxX >> 8) % 256);
-                bytes[i++] = (byte)(MinY % 256);
-                bytes[i++] = (byte)((MinY >> 8) % 256);
-                bytes[i++] = (byte)(MaxY % 256);
-                bytes[i++] = (byte)((MaxY >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PositionData --");
-                output.AppendLine(String.Format("MinX: {0}", MinX));
-                output.AppendLine(String.Format("MaxX: {0}", MaxX));
-                output.AppendLine(String.Format("MinY: {0}", MinY));
-                output.Append(String.Format("MaxY: {0}", MaxY));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MapBlockRequest; } }
-        public AgentDataBlock AgentData;
-        public PositionDataBlock PositionData;
-
-        public MapBlockRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 407;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            PositionData = new PositionDataBlock();
-        }
-
-        public MapBlockRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PositionData.FromBytes(bytes, ref i);
-        }
-
-        public MapBlockRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            PositionData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += PositionData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            PositionData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MapBlockRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += PositionData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MapNameRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint Flags;
-            public uint EstateID;
-            public bool Godlike;
-
-            public int Length
-            {
-                get
-                {
-                    return 41;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Godlike = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(EstateID % 256);
-                bytes[i++] = (byte)((EstateID >> 8) % 256);
-                bytes[i++] = (byte)((EstateID >> 16) % 256);
-                bytes[i++] = (byte)((EstateID >> 24) % 256);
-                bytes[i++] = (byte)((Godlike) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("EstateID: {0}", EstateID));
-                output.Append(String.Format("Godlike: {0}", Godlike));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class NameDataBlock
-        {
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public NameDataBlock() { }
-            public NameDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- NameData --");
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MapNameRequest; } }
-        public AgentDataBlock AgentData;
-        public NameDataBlock NameData;
-
-        public MapNameRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 408;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            NameData = new NameDataBlock();
-        }
-
-        public MapNameRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            NameData.FromBytes(bytes, ref i);
-        }
-
-        public MapNameRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            NameData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += NameData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            NameData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MapNameRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += NameData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MapBlockReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public ushort X;
-            public ushort Y;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            public byte Access;
-            public uint RegionFlags;
-            public byte WaterHeight;
-            public byte Agents;
-            public LLUUID MapImageID;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 27;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    X = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    Y = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    Access = (byte)bytes[i++];
-                    RegionFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    WaterHeight = (byte)bytes[i++];
-                    Agents = (byte)bytes[i++];
-                    MapImageID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(X % 256);
-                bytes[i++] = (byte)((X >> 8) % 256);
-                bytes[i++] = (byte)(Y % 256);
-                bytes[i++] = (byte)((Y >> 8) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                bytes[i++] = Access;
-                bytes[i++] = (byte)(RegionFlags % 256);
-                bytes[i++] = (byte)((RegionFlags >> 8) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 16) % 256);
-                bytes[i++] = (byte)((RegionFlags >> 24) % 256);
-                bytes[i++] = WaterHeight;
-                bytes[i++] = Agents;
-                Buffer.BlockCopy(MapImageID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("X: {0}", X));
-                output.AppendLine(String.Format("Y: {0}", Y));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Access: {0}", Access));
-                output.AppendLine(String.Format("RegionFlags: {0}", RegionFlags));
-                output.AppendLine(String.Format("WaterHeight: {0}", WaterHeight));
-                output.AppendLine(String.Format("Agents: {0}", Agents));
-                output.Append(String.Format("MapImageID: {0}", MapImageID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MapBlockReply; } }
-        public AgentDataBlock AgentData;
-        public DataBlock[] Data;
-
-        public MapBlockReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 409;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock[0];
-        }
-
-        public MapBlockReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public MapBlockReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MapBlockReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MapItemRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public uint Flags;
-            public uint EstateID;
-            public bool Godlike;
-
-            public int Length
-            {
-                get
-                {
-                    return 41;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EstateID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Godlike = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(EstateID % 256);
-                bytes[i++] = (byte)((EstateID >> 8) % 256);
-                bytes[i++] = (byte)((EstateID >> 16) % 256);
-                bytes[i++] = (byte)((EstateID >> 24) % 256);
-                bytes[i++] = (byte)((Godlike) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("EstateID: {0}", EstateID));
-                output.Append(String.Format("Godlike: {0}", Godlike));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RequestDataBlock
-        {
-            public uint ItemType;
-            public ulong RegionHandle;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public RequestDataBlock() { }
-            public RequestDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemType = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ItemType % 256);
-                bytes[i++] = (byte)((ItemType >> 8) % 256);
-                bytes[i++] = (byte)((ItemType >> 16) % 256);
-                bytes[i++] = (byte)((ItemType >> 24) % 256);
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RequestData --");
-                output.AppendLine(String.Format("ItemType: {0}", ItemType));
-                output.Append(String.Format("RegionHandle: {0}", RegionHandle));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MapItemRequest; } }
-        public AgentDataBlock AgentData;
-        public RequestDataBlock RequestData;
-
-        public MapItemRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 410;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            RequestData = new RequestDataBlock();
-        }
-
-        public MapItemRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RequestData.FromBytes(bytes, ref i);
-        }
-
-        public MapItemRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RequestData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RequestData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RequestData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MapItemRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RequestData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MapItemReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public uint Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RequestDataBlock
-        {
-            public uint ItemType;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public RequestDataBlock() { }
-            public RequestDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ItemType = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ItemType % 256);
-                bytes[i++] = (byte)((ItemType >> 8) % 256);
-                bytes[i++] = (byte)((ItemType >> 16) % 256);
-                bytes[i++] = (byte)((ItemType >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RequestData --");
-                output.Append(String.Format("ItemType: {0}", ItemType));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public uint X;
-            public uint Y;
-            public LLUUID ID;
-            public int Extra;
-            public int Extra2;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 32;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    X = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Y = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ID.FromBytes(bytes, i); i += 16;
-                    Extra = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Extra2 = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(X % 256);
-                bytes[i++] = (byte)((X >> 8) % 256);
-                bytes[i++] = (byte)((X >> 16) % 256);
-                bytes[i++] = (byte)((X >> 24) % 256);
-                bytes[i++] = (byte)(Y % 256);
-                bytes[i++] = (byte)((Y >> 8) % 256);
-                bytes[i++] = (byte)((Y >> 16) % 256);
-                bytes[i++] = (byte)((Y >> 24) % 256);
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Extra % 256);
-                bytes[i++] = (byte)((Extra >> 8) % 256);
-                bytes[i++] = (byte)((Extra >> 16) % 256);
-                bytes[i++] = (byte)((Extra >> 24) % 256);
-                bytes[i++] = (byte)(Extra2 % 256);
-                bytes[i++] = (byte)((Extra2 >> 8) % 256);
-                bytes[i++] = (byte)((Extra2 >> 16) % 256);
-                bytes[i++] = (byte)((Extra2 >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("X: {0}", X));
-                output.AppendLine(String.Format("Y: {0}", Y));
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.AppendLine(String.Format("Extra: {0}", Extra));
-                output.AppendLine(String.Format("Extra2: {0}", Extra2));
-                Helpers.FieldToString(output, Name, "Name");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MapItemReply; } }
-        public AgentDataBlock AgentData;
-        public RequestDataBlock RequestData;
-        public DataBlock[] Data;
-
-        public MapItemReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 411;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            RequestData = new RequestDataBlock();
-            Data = new DataBlock[0];
-        }
-
-        public MapItemReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RequestData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public MapItemReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RequestData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Data.Length < count) {
-                Data = new DataBlock[count];
-                for(int j = 0; j < count; j++) Data[j] = new DataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Data[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RequestData.Length;;
-            length++;
-            for (int j = 0; j < Data.Length; j++) { length += Data[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RequestData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Data.Length;
-            for (int j = 0; j < Data.Length; j++) { Data[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MapItemReply ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RequestData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Data.Length; j++)
-            {
-                output += Data[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SendPostcardPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID AssetID;
-            public LLVector3d PosGlobal;
-            private byte[] _to;
-            public byte[] To
-            {
-                get { return _to; }
-                set
-                {
-                    if (value == null) { _to = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _to = new byte[value.Length]; Buffer.BlockCopy(value, 0, _to, 0, value.Length); }
-                }
-            }
-            private byte[] _from;
-            public byte[] From
-            {
-                get { return _from; }
-                set
-                {
-                    if (value == null) { _from = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _from = new byte[value.Length]; Buffer.BlockCopy(value, 0, _from, 0, value.Length); }
-                }
-            }
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _subject;
-            public byte[] Subject
-            {
-                get { return _subject; }
-                set
-                {
-                    if (value == null) { _subject = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _subject = new byte[value.Length]; Buffer.BlockCopy(value, 0, _subject, 0, value.Length); }
-                }
-            }
-            private byte[] _msg;
-            public byte[] Msg
-            {
-                get { return _msg; }
-                set
-                {
-                    if (value == null) { _msg = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _msg = new byte[value.Length]; Buffer.BlockCopy(value, 0, _msg, 0, value.Length); }
-                }
-            }
-            public bool AllowPublish;
-            public bool MaturePublish;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 74;
-                    if (To != null) { length += 1 + To.Length; }
-                    if (From != null) { length += 1 + From.Length; }
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Subject != null) { length += 1 + Subject.Length; }
-                    if (Msg != null) { length += 2 + Msg.Length; }
-                    return length;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    AssetID.FromBytes(bytes, i); i += 16;
-                    PosGlobal.FromBytes(bytes, i); i += 24;
-                    length = (ushort)bytes[i++];
-                    _to = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _to, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _from = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _from, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _subject = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _subject, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _msg = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _msg, 0, length); i += length;
-                    AllowPublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    MaturePublish = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AssetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(PosGlobal.GetBytes(), 0, bytes, i, 24); i += 24;
-                if(To == null) { Console.WriteLine("Warning: To is null, in " + this.GetType()); }
-                bytes[i++] = (byte)To.Length;
-                Buffer.BlockCopy(To, 0, bytes, i, To.Length); i += To.Length;
-                if(From == null) { Console.WriteLine("Warning: From is null, in " + this.GetType()); }
-                bytes[i++] = (byte)From.Length;
-                Buffer.BlockCopy(From, 0, bytes, i, From.Length); i += From.Length;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Subject == null) { Console.WriteLine("Warning: Subject is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Subject.Length;
-                Buffer.BlockCopy(Subject, 0, bytes, i, Subject.Length); i += Subject.Length;
-                if(Msg == null) { Console.WriteLine("Warning: Msg is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Msg.Length % 256);
-                bytes[i++] = (byte)((Msg.Length >> 8) % 256);
-                Buffer.BlockCopy(Msg, 0, bytes, i, Msg.Length); i += Msg.Length;
-                bytes[i++] = (byte)((AllowPublish) ? 1 : 0);
-                bytes[i++] = (byte)((MaturePublish) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("AssetID: {0}", AssetID));
-                output.AppendLine(String.Format("PosGlobal: {0}", PosGlobal));
-                Helpers.FieldToString(output, To, "To");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, From, "From");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Subject, "Subject");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Msg, "Msg");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("AllowPublish: {0}", AllowPublish));
-                output.Append(String.Format("MaturePublish: {0}", MaturePublish));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SendPostcard; } }
-        public AgentDataBlock AgentData;
-
-        public SendPostcardPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 412;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public SendPostcardPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public SendPostcardPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SendPostcard ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelMediaCommandMessagePacket : Packet
-    {
-        /// <exclude/>
-        public class CommandBlockBlock
-        {
-            public uint Flags;
-            public uint Command;
-            public float Time;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public CommandBlockBlock() { }
-            public CommandBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Flags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Command = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Time = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(Flags % 256);
-                bytes[i++] = (byte)((Flags >> 8) % 256);
-                bytes[i++] = (byte)((Flags >> 16) % 256);
-                bytes[i++] = (byte)((Flags >> 24) % 256);
-                bytes[i++] = (byte)(Command % 256);
-                bytes[i++] = (byte)((Command >> 8) % 256);
-                bytes[i++] = (byte)((Command >> 16) % 256);
-                bytes[i++] = (byte)((Command >> 24) % 256);
-                ba = BitConverter.GetBytes(Time);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- CommandBlock --");
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("Command: {0}", Command));
-                output.Append(String.Format("Time: {0}", Time));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelMediaCommandMessage; } }
-        public CommandBlockBlock CommandBlock;
-
-        public ParcelMediaCommandMessagePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 419;
-            Header.Reliable = true;
-            CommandBlock = new CommandBlockBlock();
-        }
-
-        public ParcelMediaCommandMessagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            CommandBlock.FromBytes(bytes, ref i);
-        }
-
-        public ParcelMediaCommandMessagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            CommandBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += CommandBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            CommandBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelMediaCommandMessage ---" + Environment.NewLine;
-                output += CommandBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelMediaUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlockBlock
-        {
-            private byte[] _mediaurl;
-            public byte[] MediaURL
-            {
-                get { return _mediaurl; }
-                set
-                {
-                    if (value == null) { _mediaurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mediaurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediaurl, 0, value.Length); }
-                }
-            }
-            public LLUUID MediaID;
-            public byte MediaAutoScale;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 17;
-                    if (MediaURL != null) { length += 1 + MediaURL.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlockBlock() { }
-            public DataBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _mediaurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mediaurl, 0, length); i += length;
-                    MediaID.FromBytes(bytes, i); i += 16;
-                    MediaAutoScale = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(MediaURL == null) { Console.WriteLine("Warning: MediaURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MediaURL.Length;
-                Buffer.BlockCopy(MediaURL, 0, bytes, i, MediaURL.Length); i += MediaURL.Length;
-                Buffer.BlockCopy(MediaID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = MediaAutoScale;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlock --");
-                Helpers.FieldToString(output, MediaURL, "MediaURL");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("MediaID: {0}", MediaID));
-                output.Append(String.Format("MediaAutoScale: {0}", MediaAutoScale));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlockExtendedBlock
-        {
-            private byte[] _mediatype;
-            public byte[] MediaType
-            {
-                get { return _mediatype; }
-                set
-                {
-                    if (value == null) { _mediatype = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mediatype = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediatype, 0, value.Length); }
-                }
-            }
-            private byte[] _mediadesc;
-            public byte[] MediaDesc
-            {
-                get { return _mediadesc; }
-                set
-                {
-                    if (value == null) { _mediadesc = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mediadesc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediadesc, 0, value.Length); }
-                }
-            }
-            public int MediaWidth;
-            public int MediaHeight;
-            public byte MediaLoop;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 9;
-                    if (MediaType != null) { length += 1 + MediaType.Length; }
-                    if (MediaDesc != null) { length += 1 + MediaDesc.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlockExtendedBlock() { }
-            public DataBlockExtendedBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _mediatype = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mediatype, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _mediadesc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mediadesc, 0, length); i += length;
-                    MediaWidth = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    MediaHeight = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    MediaLoop = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(MediaType == null) { Console.WriteLine("Warning: MediaType is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MediaType.Length;
-                Buffer.BlockCopy(MediaType, 0, bytes, i, MediaType.Length); i += MediaType.Length;
-                if(MediaDesc == null) { Console.WriteLine("Warning: MediaDesc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MediaDesc.Length;
-                Buffer.BlockCopy(MediaDesc, 0, bytes, i, MediaDesc.Length); i += MediaDesc.Length;
-                bytes[i++] = (byte)(MediaWidth % 256);
-                bytes[i++] = (byte)((MediaWidth >> 8) % 256);
-                bytes[i++] = (byte)((MediaWidth >> 16) % 256);
-                bytes[i++] = (byte)((MediaWidth >> 24) % 256);
-                bytes[i++] = (byte)(MediaHeight % 256);
-                bytes[i++] = (byte)((MediaHeight >> 8) % 256);
-                bytes[i++] = (byte)((MediaHeight >> 16) % 256);
-                bytes[i++] = (byte)((MediaHeight >> 24) % 256);
-                bytes[i++] = MediaLoop;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlockExtended --");
-                Helpers.FieldToString(output, MediaType, "MediaType");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, MediaDesc, "MediaDesc");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("MediaWidth: {0}", MediaWidth));
-                output.AppendLine(String.Format("MediaHeight: {0}", MediaHeight));
-                output.Append(String.Format("MediaLoop: {0}", MediaLoop));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelMediaUpdate; } }
-        public DataBlockBlock DataBlock;
-        public DataBlockExtendedBlock DataBlockExtended;
-
-        public ParcelMediaUpdatePacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 420;
-            Header.Reliable = true;
-            DataBlock = new DataBlockBlock();
-            DataBlockExtended = new DataBlockExtendedBlock();
-        }
-
-        public ParcelMediaUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-            DataBlockExtended.FromBytes(bytes, ref i);
-        }
-
-        public ParcelMediaUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-            DataBlockExtended.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += DataBlock.Length;            length += DataBlockExtended.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            DataBlock.ToBytes(bytes, ref i);
-            DataBlockExtended.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelMediaUpdate ---" + Environment.NewLine;
-                output += DataBlock.ToString() + Environment.NewLine;
-                output += DataBlockExtended.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LandStatRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RequestDataBlock
-        {
-            public uint ReportType;
-            public uint RequestFlags;
-            private byte[] _filter;
-            public byte[] Filter
-            {
-                get { return _filter; }
-                set
-                {
-                    if (value == null) { _filter = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _filter = new byte[value.Length]; Buffer.BlockCopy(value, 0, _filter, 0, value.Length); }
-                }
-            }
-            public int ParcelLocalID;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 12;
-                    if (Filter != null) { length += 1 + Filter.Length; }
-                    return length;
-                }
-            }
-
-            public RequestDataBlock() { }
-            public RequestDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ReportType = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RequestFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _filter = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _filter, 0, length); i += length;
-                    ParcelLocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ReportType % 256);
-                bytes[i++] = (byte)((ReportType >> 8) % 256);
-                bytes[i++] = (byte)((ReportType >> 16) % 256);
-                bytes[i++] = (byte)((ReportType >> 24) % 256);
-                bytes[i++] = (byte)(RequestFlags % 256);
-                bytes[i++] = (byte)((RequestFlags >> 8) % 256);
-                bytes[i++] = (byte)((RequestFlags >> 16) % 256);
-                bytes[i++] = (byte)((RequestFlags >> 24) % 256);
-                if(Filter == null) { Console.WriteLine("Warning: Filter is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Filter.Length;
-                Buffer.BlockCopy(Filter, 0, bytes, i, Filter.Length); i += Filter.Length;
-                bytes[i++] = (byte)(ParcelLocalID % 256);
-                bytes[i++] = (byte)((ParcelLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ParcelLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ParcelLocalID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RequestData --");
-                output.AppendLine(String.Format("ReportType: {0}", ReportType));
-                output.AppendLine(String.Format("RequestFlags: {0}", RequestFlags));
-                Helpers.FieldToString(output, Filter, "Filter");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("ParcelLocalID: {0}", ParcelLocalID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LandStatRequest; } }
-        public AgentDataBlock AgentData;
-        public RequestDataBlock RequestData;
-
-        public LandStatRequestPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 421;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            RequestData = new RequestDataBlock();
-        }
-
-        public LandStatRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RequestData.FromBytes(bytes, ref i);
-        }
-
-        public LandStatRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RequestData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += RequestData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RequestData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LandStatRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RequestData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LandStatReplyPacket : Packet
-    {
-        /// <exclude/>
-        public class RequestDataBlock
-        {
-            public uint ReportType;
-            public uint RequestFlags;
-            public uint TotalObjectCount;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public RequestDataBlock() { }
-            public RequestDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ReportType = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RequestFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TotalObjectCount = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ReportType % 256);
-                bytes[i++] = (byte)((ReportType >> 8) % 256);
-                bytes[i++] = (byte)((ReportType >> 16) % 256);
-                bytes[i++] = (byte)((ReportType >> 24) % 256);
-                bytes[i++] = (byte)(RequestFlags % 256);
-                bytes[i++] = (byte)((RequestFlags >> 8) % 256);
-                bytes[i++] = (byte)((RequestFlags >> 16) % 256);
-                bytes[i++] = (byte)((RequestFlags >> 24) % 256);
-                bytes[i++] = (byte)(TotalObjectCount % 256);
-                bytes[i++] = (byte)((TotalObjectCount >> 8) % 256);
-                bytes[i++] = (byte)((TotalObjectCount >> 16) % 256);
-                bytes[i++] = (byte)((TotalObjectCount >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RequestData --");
-                output.AppendLine(String.Format("ReportType: {0}", ReportType));
-                output.AppendLine(String.Format("RequestFlags: {0}", RequestFlags));
-                output.Append(String.Format("TotalObjectCount: {0}", TotalObjectCount));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ReportDataBlock
-        {
-            public uint TaskLocalID;
-            public LLUUID TaskID;
-            public float LocationX;
-            public float LocationY;
-            public float LocationZ;
-            public float Score;
-            private byte[] _taskname;
-            public byte[] TaskName
-            {
-                get { return _taskname; }
-                set
-                {
-                    if (value == null) { _taskname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _taskname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _taskname, 0, value.Length); }
-                }
-            }
-            private byte[] _ownername;
-            public byte[] OwnerName
-            {
-                get { return _ownername; }
-                set
-                {
-                    if (value == null) { _ownername = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _ownername = new byte[value.Length]; Buffer.BlockCopy(value, 0, _ownername, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 36;
-                    if (TaskName != null) { length += 1 + TaskName.Length; }
-                    if (OwnerName != null) { length += 1 + OwnerName.Length; }
-                    return length;
-                }
-            }
-
-            public ReportDataBlock() { }
-            public ReportDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TaskLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TaskID.FromBytes(bytes, i); i += 16;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    LocationX = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    LocationY = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    LocationZ = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Score = BitConverter.ToSingle(bytes, i); i += 4;
-                    length = (ushort)bytes[i++];
-                    _taskname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _taskname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _ownername = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _ownername, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(TaskLocalID % 256);
-                bytes[i++] = (byte)((TaskLocalID >> 8) % 256);
-                bytes[i++] = (byte)((TaskLocalID >> 16) % 256);
-                bytes[i++] = (byte)((TaskLocalID >> 24) % 256);
-                Buffer.BlockCopy(TaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-                ba = BitConverter.GetBytes(LocationX);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(LocationY);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(LocationZ);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(Score);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                if(TaskName == null) { Console.WriteLine("Warning: TaskName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TaskName.Length;
-                Buffer.BlockCopy(TaskName, 0, bytes, i, TaskName.Length); i += TaskName.Length;
-                if(OwnerName == null) { Console.WriteLine("Warning: OwnerName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)OwnerName.Length;
-                Buffer.BlockCopy(OwnerName, 0, bytes, i, OwnerName.Length); i += OwnerName.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ReportData --");
-                output.AppendLine(String.Format("TaskLocalID: {0}", TaskLocalID));
-                output.AppendLine(String.Format("TaskID: {0}", TaskID));
-                output.AppendLine(String.Format("LocationX: {0}", LocationX));
-                output.AppendLine(String.Format("LocationY: {0}", LocationY));
-                output.AppendLine(String.Format("LocationZ: {0}", LocationZ));
-                output.AppendLine(String.Format("Score: {0}", Score));
-                Helpers.FieldToString(output, TaskName, "TaskName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, OwnerName, "OwnerName");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LandStatReply; } }
-        public RequestDataBlock RequestData;
-        public ReportDataBlock[] ReportData;
-
-        public LandStatReplyPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 422;
-            Header.Reliable = true;
-            RequestData = new RequestDataBlock();
-            ReportData = new ReportDataBlock[0];
-        }
-
-        public LandStatReplyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RequestData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ReportData.Length < count) {
-                ReportData = new ReportDataBlock[count];
-                for(int j = 0; j < count; j++) ReportData[j] = new ReportDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ReportData[j].FromBytes(bytes, ref i); }
-        }
-
-        public LandStatReplyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RequestData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ReportData.Length < count) {
-                ReportData = new ReportDataBlock[count];
-                for(int j = 0; j < count; j++) ReportData[j] = new ReportDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ReportData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += RequestData.Length;;
-            length++;
-            for (int j = 0; j < ReportData.Length; j++) { length += ReportData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RequestData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ReportData.Length;
-            for (int j = 0; j < ReportData.Length; j++) { ReportData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LandStatReply ---" + Environment.NewLine;
-                output += RequestData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ReportData.Length; j++)
-            {
-                output += ReportData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ErrorPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataBlock
-        {
-            public int Code;
-            private byte[] _token;
-            public byte[] Token
-            {
-                get { return _token; }
-                set
-                {
-                    if (value == null) { _token = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _token = new byte[value.Length]; Buffer.BlockCopy(value, 0, _token, 0, value.Length); }
-                }
-            }
-            public LLUUID ID;
-            private byte[] _system;
-            public byte[] System
-            {
-                get { return _system; }
-                set
-                {
-                    if (value == null) { _system = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _system = new byte[value.Length]; Buffer.BlockCopy(value, 0, _system, 0, value.Length); }
-                }
-            }
-            private byte[] _message;
-            public byte[] Message
-            {
-                get { return _message; }
-                set
-                {
-                    if (value == null) { _message = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _message = new byte[value.Length]; Buffer.BlockCopy(value, 0, _message, 0, value.Length); }
-                }
-            }
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 20;
-                    if (Token != null) { length += 1 + Token.Length; }
-                    if (System != null) { length += 1 + System.Length; }
-                    if (Message != null) { length += 2 + Message.Length; }
-                    if (Data != null) { length += 2 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public DataBlock() { }
-            public DataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    Code = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _token = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _token, 0, length); i += length;
-                    ID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _system = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _system, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _message = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _message, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(Code % 256);
-                bytes[i++] = (byte)((Code >> 8) % 256);
-                bytes[i++] = (byte)((Code >> 16) % 256);
-                bytes[i++] = (byte)((Code >> 24) % 256);
-                if(Token == null) { Console.WriteLine("Warning: Token is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Token.Length;
-                Buffer.BlockCopy(Token, 0, bytes, i, Token.Length); i += Token.Length;
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(System == null) { Console.WriteLine("Warning: System is null, in " + this.GetType()); }
-                bytes[i++] = (byte)System.Length;
-                Buffer.BlockCopy(System, 0, bytes, i, System.Length); i += System.Length;
-                if(Message == null) { Console.WriteLine("Warning: Message is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Message.Length % 256);
-                bytes[i++] = (byte)((Message.Length >> 8) % 256);
-                Buffer.BlockCopy(Message, 0, bytes, i, Message.Length); i += Message.Length;
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Data --");
-                output.AppendLine(String.Format("Code: {0}", Code));
-                Helpers.FieldToString(output, Token, "Token");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ID: {0}", ID));
-                Helpers.FieldToString(output, System, "System");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Message, "Message");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.Error; } }
-        public AgentDataBlock AgentData;
-        public DataBlock Data;
-
-        public ErrorPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 423;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Data = new DataBlock();
-        }
-
-        public ErrorPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public ErrorPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            Data.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;            length += Data.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            Data.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- Error ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += Data.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectIncludeInSearchPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public bool IncludeInSearch;
-
-            public int Length
-            {
-                get
-                {
-                    return 5;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    IncludeInSearch = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = (byte)((IncludeInSearch) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.Append(String.Format("IncludeInSearch: {0}", IncludeInSearch));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectIncludeInSearch; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectIncludeInSearchPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 424;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectIncludeInSearchPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectIncludeInSearchPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectIncludeInSearch ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PacketAckPacket : Packet
-    {
-        /// <exclude/>
-        public class PacketsBlock
-        {
-            public uint ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public PacketsBlock() { }
-            public PacketsBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Packets --");
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PacketAck; } }
-        public PacketsBlock[] Packets;
-
-        public PacketAckPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 65531;
-            Header.Reliable = true;
-            Packets = new PacketsBlock[0];
-        }
-
-        public PacketAckPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(Packets.Length < count) {
-                Packets = new PacketsBlock[count];
-                for(int j = 0; j < count; j++) Packets[j] = new PacketsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Packets[j].FromBytes(bytes, ref i); }
-        }
-
-        public PacketAckPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(Packets.Length < count) {
-                Packets = new PacketsBlock[count];
-                for(int j = 0; j < count; j++) Packets[j] = new PacketsBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Packets[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            length++;
-            for (int j = 0; j < Packets.Length; j++) { length += Packets[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Packets.Length;
-            for (int j = 0; j < Packets.Length; j++) { Packets[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PacketAck ---" + Environment.NewLine;
-            for (int j = 0; j < Packets.Length; j++)
-            {
-                output += Packets[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class OpenCircuitPacket : Packet
-    {
-        /// <exclude/>
-        public class CircuitInfoBlock
-        {
-            public uint IP;
-            public ushort Port;
-
-            public int Length
-            {
-                get
-                {
-                    return 6;
-                }
-            }
-
-            public CircuitInfoBlock() { }
-            public CircuitInfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    IP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Port = (ushort)((bytes[i++] << 8) + bytes[i++]);
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(IP % 256);
-                bytes[i++] = (byte)((IP >> 8) % 256);
-                bytes[i++] = (byte)((IP >> 16) % 256);
-                bytes[i++] = (byte)((IP >> 24) % 256);
-                bytes[i++] = (byte)((Port >> 8) % 256);
-                bytes[i++] = (byte)(Port % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- CircuitInfo --");
-                output.AppendLine(String.Format("IP: {0}", IP));
-                output.Append(String.Format("Port: {0}", Port));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.OpenCircuit; } }
-        public CircuitInfoBlock CircuitInfo;
-
-        public OpenCircuitPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 65532;
-            Header.Reliable = true;
-            CircuitInfo = new CircuitInfoBlock();
-        }
-
-        public OpenCircuitPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            CircuitInfo.FromBytes(bytes, ref i);
-        }
-
-        public OpenCircuitPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            CircuitInfo.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-            length += CircuitInfo.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            CircuitInfo.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- OpenCircuit ---" + Environment.NewLine;
-                output += CircuitInfo.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CloseCircuitPacket : Packet
-    {
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CloseCircuit; } }
-
-        public CloseCircuitPacket()
-        {
-            Header = new LowHeader();
-            Header.ID = 65533;
-            Header.Reliable = true;
-        }
-
-        public CloseCircuitPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-        }
-
-        public CloseCircuitPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 10;
-;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CloseCircuit ---" + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectAddPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLUUID GroupID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.Append(String.Format("GroupID: {0}", GroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public byte PCode;
-            public byte Material;
-            public uint AddFlags;
-            public byte PathCurve;
-            public byte ProfileCurve;
-            public ushort PathBegin;
-            public ushort PathEnd;
-            public byte PathScaleX;
-            public byte PathScaleY;
-            public byte PathShearX;
-            public byte PathShearY;
-            public sbyte PathTwist;
-            public sbyte PathTwistBegin;
-            public sbyte PathRadiusOffset;
-            public sbyte PathTaperX;
-            public sbyte PathTaperY;
-            public byte PathRevolutions;
-            public sbyte PathSkew;
-            public ushort ProfileBegin;
-            public ushort ProfileEnd;
-            public ushort ProfileHollow;
-            public byte BypassRaycast;
-            public LLVector3 RayStart;
-            public LLVector3 RayEnd;
-            public LLUUID RayTargetID;
-            public byte RayEndIsIntersection;
-            public LLVector3 Scale;
-            public LLQuaternion Rotation;
-            public byte State;
-
-            public int Length
-            {
-                get
-                {
-                    return 96;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PCode = (byte)bytes[i++];
-                    Material = (byte)bytes[i++];
-                    AddFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PathCurve = (byte)bytes[i++];
-                    ProfileCurve = (byte)bytes[i++];
-                    PathBegin = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    PathEnd = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    PathScaleX = (byte)bytes[i++];
-                    PathScaleY = (byte)bytes[i++];
-                    PathShearX = (byte)bytes[i++];
-                    PathShearY = (byte)bytes[i++];
-                    PathTwist = (sbyte)bytes[i++];
-                    PathTwistBegin = (sbyte)bytes[i++];
-                    PathRadiusOffset = (sbyte)bytes[i++];
-                    PathTaperX = (sbyte)bytes[i++];
-                    PathTaperY = (sbyte)bytes[i++];
-                    PathRevolutions = (byte)bytes[i++];
-                    PathSkew = (sbyte)bytes[i++];
-                    ProfileBegin = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    ProfileEnd = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    ProfileHollow = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    BypassRaycast = (byte)bytes[i++];
-                    RayStart.FromBytes(bytes, i); i += 12;
-                    RayEnd.FromBytes(bytes, i); i += 12;
-                    RayTargetID.FromBytes(bytes, i); i += 16;
-                    RayEndIsIntersection = (byte)bytes[i++];
-                    Scale.FromBytes(bytes, i); i += 12;
-                    Rotation.FromBytes(bytes, i, true); i += 12;
-                    State = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = PCode;
-                bytes[i++] = Material;
-                bytes[i++] = (byte)(AddFlags % 256);
-                bytes[i++] = (byte)((AddFlags >> 8) % 256);
-                bytes[i++] = (byte)((AddFlags >> 16) % 256);
-                bytes[i++] = (byte)((AddFlags >> 24) % 256);
-                bytes[i++] = PathCurve;
-                bytes[i++] = ProfileCurve;
-                bytes[i++] = (byte)(PathBegin % 256);
-                bytes[i++] = (byte)((PathBegin >> 8) % 256);
-                bytes[i++] = (byte)(PathEnd % 256);
-                bytes[i++] = (byte)((PathEnd >> 8) % 256);
-                bytes[i++] = PathScaleX;
-                bytes[i++] = PathScaleY;
-                bytes[i++] = PathShearX;
-                bytes[i++] = PathShearY;
-                bytes[i++] = (byte)PathTwist;
-                bytes[i++] = (byte)PathTwistBegin;
-                bytes[i++] = (byte)PathRadiusOffset;
-                bytes[i++] = (byte)PathTaperX;
-                bytes[i++] = (byte)PathTaperY;
-                bytes[i++] = PathRevolutions;
-                bytes[i++] = (byte)PathSkew;
-                bytes[i++] = (byte)(ProfileBegin % 256);
-                bytes[i++] = (byte)((ProfileBegin >> 8) % 256);
-                bytes[i++] = (byte)(ProfileEnd % 256);
-                bytes[i++] = (byte)((ProfileEnd >> 8) % 256);
-                bytes[i++] = (byte)(ProfileHollow % 256);
-                bytes[i++] = (byte)((ProfileHollow >> 8) % 256);
-                bytes[i++] = BypassRaycast;
-                Buffer.BlockCopy(RayStart.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(RayEnd.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(RayTargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = RayEndIsIntersection;
-                Buffer.BlockCopy(Scale.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = State;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("PCode: {0}", PCode));
-                output.AppendLine(String.Format("Material: {0}", Material));
-                output.AppendLine(String.Format("AddFlags: {0}", AddFlags));
-                output.AppendLine(String.Format("PathCurve: {0}", PathCurve));
-                output.AppendLine(String.Format("ProfileCurve: {0}", ProfileCurve));
-                output.AppendLine(String.Format("PathBegin: {0}", PathBegin));
-                output.AppendLine(String.Format("PathEnd: {0}", PathEnd));
-                output.AppendLine(String.Format("PathScaleX: {0}", PathScaleX));
-                output.AppendLine(String.Format("PathScaleY: {0}", PathScaleY));
-                output.AppendLine(String.Format("PathShearX: {0}", PathShearX));
-                output.AppendLine(String.Format("PathShearY: {0}", PathShearY));
-                output.AppendLine(String.Format("PathTwist: {0}", PathTwist));
-                output.AppendLine(String.Format("PathTwistBegin: {0}", PathTwistBegin));
-                output.AppendLine(String.Format("PathRadiusOffset: {0}", PathRadiusOffset));
-                output.AppendLine(String.Format("PathTaperX: {0}", PathTaperX));
-                output.AppendLine(String.Format("PathTaperY: {0}", PathTaperY));
-                output.AppendLine(String.Format("PathRevolutions: {0}", PathRevolutions));
-                output.AppendLine(String.Format("PathSkew: {0}", PathSkew));
-                output.AppendLine(String.Format("ProfileBegin: {0}", ProfileBegin));
-                output.AppendLine(String.Format("ProfileEnd: {0}", ProfileEnd));
-                output.AppendLine(String.Format("ProfileHollow: {0}", ProfileHollow));
-                output.AppendLine(String.Format("BypassRaycast: {0}", BypassRaycast));
-                output.AppendLine(String.Format("RayStart: {0}", RayStart));
-                output.AppendLine(String.Format("RayEnd: {0}", RayEnd));
-                output.AppendLine(String.Format("RayTargetID: {0}", RayTargetID));
-                output.AppendLine(String.Format("RayEndIsIntersection: {0}", RayEndIsIntersection));
-                output.AppendLine(String.Format("Scale: {0}", Scale));
-                output.AppendLine(String.Format("Rotation: {0}", Rotation));
-                output.Append(String.Format("State: {0}", State));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectAdd; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-
-        public ObjectAddPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 1;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public ObjectAddPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public ObjectAddPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectAdd ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class MultipleObjectUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public byte Type;
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 5;
-                    if (Data != null) { length += 1 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Type = (byte)bytes[i++];
-                    length = (ushort)bytes[i++];
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                bytes[i++] = Type;
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Data.Length;
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.MultipleObjectUpdate; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public MultipleObjectUpdatePacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 2;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public MultipleObjectUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public MultipleObjectUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- MultipleObjectUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestMultipleObjectsPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public byte CacheMissType;
-            public uint ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 5;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    CacheMissType = (byte)bytes[i++];
-                    ID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = CacheMissType;
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("CacheMissType: {0}", CacheMissType));
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestMultipleObjects; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public RequestMultipleObjectsPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 3;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public RequestMultipleObjectsPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public RequestMultipleObjectsPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestMultipleObjects ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectPositionPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ObjectLocalID;
-            public LLVector3 Position;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectLocalID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Position.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ObjectLocalID % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 8) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 16) % 256);
-                bytes[i++] = (byte)((ObjectLocalID >> 24) % 256);
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectLocalID: {0}", ObjectLocalID));
-                output.Append(String.Format("Position: {0}", Position));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectPosition; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectPositionPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 4;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectPositionPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectPositionPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectPosition ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestObjectPropertiesFamilyPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint RequestFlags;
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RequestFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RequestFlags % 256);
-                bytes[i++] = (byte)((RequestFlags >> 8) % 256);
-                bytes[i++] = (byte)((RequestFlags >> 16) % 256);
-                bytes[i++] = (byte)((RequestFlags >> 24) % 256);
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("RequestFlags: {0}", RequestFlags));
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestObjectPropertiesFamily; } }
-        public AgentDataBlock AgentData;
-        public ObjectDataBlock ObjectData;
-
-        public RequestObjectPropertiesFamilyPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 5;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public RequestObjectPropertiesFamilyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public RequestObjectPropertiesFamilyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestObjectPropertiesFamily ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CoarseLocationUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class LocationBlock
-        {
-            public byte X;
-            public byte Y;
-            public byte Z;
-
-            public int Length
-            {
-                get
-                {
-                    return 3;
-                }
-            }
-
-            public LocationBlock() { }
-            public LocationBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    X = (byte)bytes[i++];
-                    Y = (byte)bytes[i++];
-                    Z = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = X;
-                bytes[i++] = Y;
-                bytes[i++] = Z;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Location --");
-                output.AppendLine(String.Format("X: {0}", X));
-                output.AppendLine(String.Format("Y: {0}", Y));
-                output.Append(String.Format("Z: {0}", Z));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class IndexBlock
-        {
-            public short You;
-            public short Prey;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public IndexBlock() { }
-            public IndexBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    You = (short)(bytes[i++] + (bytes[i++] << 8));
-                    Prey = (short)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(You % 256);
-                bytes[i++] = (byte)((You >> 8) % 256);
-                bytes[i++] = (byte)(Prey % 256);
-                bytes[i++] = (byte)((Prey >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Index --");
-                output.AppendLine(String.Format("You: {0}", You));
-                output.Append(String.Format("Prey: {0}", Prey));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.Append(String.Format("AgentID: {0}", AgentID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CoarseLocationUpdate; } }
-        public LocationBlock[] Location;
-        public IndexBlock Index;
-        public AgentDataBlock[] AgentData;
-
-        public CoarseLocationUpdatePacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 6;
-            Header.Reliable = true;
-            Location = new LocationBlock[0];
-            Index = new IndexBlock();
-            AgentData = new AgentDataBlock[0];
-        }
-
-        public CoarseLocationUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(Location.Length < count) {
-                Location = new LocationBlock[count];
-                for(int j = 0; j < count; j++) Location[j] = new LocationBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Location[j].FromBytes(bytes, ref i); }
-            Index.FromBytes(bytes, ref i);
-            count = (int)bytes[i++];
-            if(AgentData.Length < count) {
-                AgentData = new AgentDataBlock[count];
-                for(int j = 0; j < count; j++) AgentData[j] = new AgentDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AgentData[j].FromBytes(bytes, ref i); }
-        }
-
-        public CoarseLocationUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(Location.Length < count) {
-                Location = new LocationBlock[count];
-                for(int j = 0; j < count; j++) Location[j] = new LocationBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Location[j].FromBytes(bytes, ref i); }
-            Index.FromBytes(bytes, ref i);
-            count = (int)bytes[i++];
-            if(AgentData.Length < count) {
-                AgentData = new AgentDataBlock[count];
-                for(int j = 0; j < count; j++) AgentData[j] = new AgentDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AgentData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += Index.Length;;
-            length++;
-            for (int j = 0; j < Location.Length; j++) { length += Location[j].Length; }
-            length++;
-            for (int j = 0; j < AgentData.Length; j++) { length += AgentData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Location.Length;
-            for (int j = 0; j < Location.Length; j++) { Location[j].ToBytes(bytes, ref i); }
-            Index.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)AgentData.Length;
-            for (int j = 0; j < AgentData.Length; j++) { AgentData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CoarseLocationUpdate ---" + Environment.NewLine;
-            for (int j = 0; j < Location.Length; j++)
-            {
-                output += Location[j].ToString() + Environment.NewLine;
-            }
-                output += Index.ToString() + Environment.NewLine;
-            for (int j = 0; j < AgentData.Length; j++)
-            {
-                output += AgentData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CrossedRegionPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RegionDataBlock
-        {
-            public uint SimIP;
-            public ushort SimPort;
-            public ulong RegionHandle;
-            private byte[] _seedcapability;
-            public byte[] SeedCapability
-            {
-                get { return _seedcapability; }
-                set
-                {
-                    if (value == null) { _seedcapability = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _seedcapability = new byte[value.Length]; Buffer.BlockCopy(value, 0, _seedcapability, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 14;
-                    if (SeedCapability != null) { length += 2 + SeedCapability.Length; }
-                    return length;
-                }
-            }
-
-            public RegionDataBlock() { }
-            public RegionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    SimIP = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SimPort = (ushort)((bytes[i++] << 8) + bytes[i++]);
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _seedcapability = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _seedcapability, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(SimIP % 256);
-                bytes[i++] = (byte)((SimIP >> 8) % 256);
-                bytes[i++] = (byte)((SimIP >> 16) % 256);
-                bytes[i++] = (byte)((SimIP >> 24) % 256);
-                bytes[i++] = (byte)((SimPort >> 8) % 256);
-                bytes[i++] = (byte)(SimPort % 256);
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                if(SeedCapability == null) { Console.WriteLine("Warning: SeedCapability is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(SeedCapability.Length % 256);
-                bytes[i++] = (byte)((SeedCapability.Length >> 8) % 256);
-                Buffer.BlockCopy(SeedCapability, 0, bytes, i, SeedCapability.Length); i += SeedCapability.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionData --");
-                output.AppendLine(String.Format("SimIP: {0}", SimIP));
-                output.AppendLine(String.Format("SimPort: {0}", SimPort));
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                Helpers.FieldToString(output, SeedCapability, "SeedCapability");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class InfoBlock
-        {
-            public LLVector3 Position;
-            public LLVector3 LookAt;
-
-            public int Length
-            {
-                get
-                {
-                    return 24;
-                }
-            }
-
-            public InfoBlock() { }
-            public InfoBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Position.FromBytes(bytes, i); i += 12;
-                    LookAt.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Info --");
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.Append(String.Format("LookAt: {0}", LookAt));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CrossedRegion; } }
-        public AgentDataBlock AgentData;
-        public RegionDataBlock RegionData;
-        public InfoBlock Info;
-
-        public CrossedRegionPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 7;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            RegionData = new RegionDataBlock();
-            Info = new InfoBlock();
-        }
-
-        public CrossedRegionPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RegionData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public CrossedRegionPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            RegionData.FromBytes(bytes, ref i);
-            Info.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;            length += RegionData.Length;            length += Info.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            RegionData.ToBytes(bytes, ref i);
-            Info.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CrossedRegion ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += RegionData.ToString() + Environment.NewLine;
-                output += Info.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ConfirmEnableSimulatorPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ConfirmEnableSimulator; } }
-        public AgentDataBlock AgentData;
-
-        public ConfirmEnableSimulatorPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 8;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public ConfirmEnableSimulatorPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public ConfirmEnableSimulatorPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ConfirmEnableSimulator ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectPropertiesPacket : Packet
-    {
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public LLUUID ObjectID;
-            public LLUUID CreatorID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public ulong CreationDate;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public int OwnershipCost;
-            public byte SaleType;
-            public int SalePrice;
-            public byte AggregatePerms;
-            public byte AggregatePermTextures;
-            public byte AggregatePermTexturesOwner;
-            public uint Category;
-            public short InventorySerial;
-            public LLUUID ItemID;
-            public LLUUID FolderID;
-            public LLUUID FromTaskID;
-            public LLUUID LastOwnerID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-            private byte[] _touchname;
-            public byte[] TouchName
-            {
-                get { return _touchname; }
-                set
-                {
-                    if (value == null) { _touchname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _touchname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _touchname, 0, value.Length); }
-                }
-            }
-            private byte[] _sitname;
-            public byte[] SitName
-            {
-                get { return _sitname; }
-                set
-                {
-                    if (value == null) { _sitname = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _sitname = new byte[value.Length]; Buffer.BlockCopy(value, 0, _sitname, 0, value.Length); }
-                }
-            }
-            private byte[] _textureid;
-            public byte[] TextureID
-            {
-                get { return _textureid; }
-                set
-                {
-                    if (value == null) { _textureid = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _textureid = new byte[value.Length]; Buffer.BlockCopy(value, 0, _textureid, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 174;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    if (TouchName != null) { length += 1 + TouchName.Length; }
-                    if (SitName != null) { length += 1 + SitName.Length; }
-                    if (TextureID != null) { length += 1 + TextureID.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    CreatorID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    CreationDate = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnershipCost = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    AggregatePerms = (byte)bytes[i++];
-                    AggregatePermTextures = (byte)bytes[i++];
-                    AggregatePermTexturesOwner = (byte)bytes[i++];
-                    Category = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    InventorySerial = (short)(bytes[i++] + (bytes[i++] << 8));
-                    ItemID.FromBytes(bytes, i); i += 16;
-                    FolderID.FromBytes(bytes, i); i += 16;
-                    FromTaskID.FromBytes(bytes, i); i += 16;
-                    LastOwnerID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _touchname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _touchname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _sitname = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _sitname, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _textureid = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _textureid, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(CreatorID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CreationDate % 256);
-                bytes[i++] = (byte)((CreationDate >> 8) % 256);
-                bytes[i++] = (byte)((CreationDate >> 16) % 256);
-                bytes[i++] = (byte)((CreationDate >> 24) % 256);
-                bytes[i++] = (byte)((CreationDate >> 32) % 256);
-                bytes[i++] = (byte)((CreationDate >> 40) % 256);
-                bytes[i++] = (byte)((CreationDate >> 48) % 256);
-                bytes[i++] = (byte)((CreationDate >> 56) % 256);
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnershipCost % 256);
-                bytes[i++] = (byte)((OwnershipCost >> 8) % 256);
-                bytes[i++] = (byte)((OwnershipCost >> 16) % 256);
-                bytes[i++] = (byte)((OwnershipCost >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                bytes[i++] = AggregatePerms;
-                bytes[i++] = AggregatePermTextures;
-                bytes[i++] = AggregatePermTexturesOwner;
-                bytes[i++] = (byte)(Category % 256);
-                bytes[i++] = (byte)((Category >> 8) % 256);
-                bytes[i++] = (byte)((Category >> 16) % 256);
-                bytes[i++] = (byte)((Category >> 24) % 256);
-                bytes[i++] = (byte)(InventorySerial % 256);
-                bytes[i++] = (byte)((InventorySerial >> 8) % 256);
-                Buffer.BlockCopy(ItemID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FolderID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(FromTaskID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(LastOwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-                if(TouchName == null) { Console.WriteLine("Warning: TouchName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TouchName.Length;
-                Buffer.BlockCopy(TouchName, 0, bytes, i, TouchName.Length); i += TouchName.Length;
-                if(SitName == null) { Console.WriteLine("Warning: SitName is null, in " + this.GetType()); }
-                bytes[i++] = (byte)SitName.Length;
-                Buffer.BlockCopy(SitName, 0, bytes, i, SitName.Length); i += SitName.Length;
-                if(TextureID == null) { Console.WriteLine("Warning: TextureID is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TextureID.Length;
-                Buffer.BlockCopy(TextureID, 0, bytes, i, TextureID.Length); i += TextureID.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("CreatorID: {0}", CreatorID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("CreationDate: {0}", CreationDate));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("OwnershipCost: {0}", OwnershipCost));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                output.AppendLine(String.Format("AggregatePerms: {0}", AggregatePerms));
-                output.AppendLine(String.Format("AggregatePermTextures: {0}", AggregatePermTextures));
-                output.AppendLine(String.Format("AggregatePermTexturesOwner: {0}", AggregatePermTexturesOwner));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                output.AppendLine(String.Format("InventorySerial: {0}", InventorySerial));
-                output.AppendLine(String.Format("ItemID: {0}", ItemID));
-                output.AppendLine(String.Format("FolderID: {0}", FolderID));
-                output.AppendLine(String.Format("FromTaskID: {0}", FromTaskID));
-                output.AppendLine(String.Format("LastOwnerID: {0}", LastOwnerID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, TouchName, "TouchName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, SitName, "SitName");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, TextureID, "TextureID");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectProperties; } }
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectPropertiesPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 9;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectPropertiesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectPropertiesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectProperties ---" + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectPropertiesFamilyPacket : Packet
-    {
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint RequestFlags;
-            public LLUUID ObjectID;
-            public LLUUID OwnerID;
-            public LLUUID GroupID;
-            public uint BaseMask;
-            public uint OwnerMask;
-            public uint GroupMask;
-            public uint EveryoneMask;
-            public uint NextOwnerMask;
-            public int OwnershipCost;
-            public byte SaleType;
-            public int SalePrice;
-            public uint Category;
-            public LLUUID LastOwnerID;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _description;
-            public byte[] Description
-            {
-                get { return _description; }
-                set
-                {
-                    if (value == null) { _description = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _description = new byte[value.Length]; Buffer.BlockCopy(value, 0, _description, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 101;
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Description != null) { length += 1 + Description.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RequestFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    BaseMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    EveryoneMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    NextOwnerMask = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnershipCost = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SaleType = (byte)bytes[i++];
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Category = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LastOwnerID.FromBytes(bytes, i); i += 16;
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _description = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _description, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RequestFlags % 256);
-                bytes[i++] = (byte)((RequestFlags >> 8) % 256);
-                bytes[i++] = (byte)((RequestFlags >> 16) % 256);
-                bytes[i++] = (byte)((RequestFlags >> 24) % 256);
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(BaseMask % 256);
-                bytes[i++] = (byte)((BaseMask >> 8) % 256);
-                bytes[i++] = (byte)((BaseMask >> 16) % 256);
-                bytes[i++] = (byte)((BaseMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnerMask % 256);
-                bytes[i++] = (byte)((OwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((OwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(GroupMask % 256);
-                bytes[i++] = (byte)((GroupMask >> 8) % 256);
-                bytes[i++] = (byte)((GroupMask >> 16) % 256);
-                bytes[i++] = (byte)((GroupMask >> 24) % 256);
-                bytes[i++] = (byte)(EveryoneMask % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 8) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 16) % 256);
-                bytes[i++] = (byte)((EveryoneMask >> 24) % 256);
-                bytes[i++] = (byte)(NextOwnerMask % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 8) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 16) % 256);
-                bytes[i++] = (byte)((NextOwnerMask >> 24) % 256);
-                bytes[i++] = (byte)(OwnershipCost % 256);
-                bytes[i++] = (byte)((OwnershipCost >> 8) % 256);
-                bytes[i++] = (byte)((OwnershipCost >> 16) % 256);
-                bytes[i++] = (byte)((OwnershipCost >> 24) % 256);
-                bytes[i++] = SaleType;
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                bytes[i++] = (byte)(Category % 256);
-                bytes[i++] = (byte)((Category >> 8) % 256);
-                bytes[i++] = (byte)((Category >> 16) % 256);
-                bytes[i++] = (byte)((Category >> 24) % 256);
-                Buffer.BlockCopy(LastOwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Description == null) { Console.WriteLine("Warning: Description is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Description.Length;
-                Buffer.BlockCopy(Description, 0, bytes, i, Description.Length); i += Description.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("RequestFlags: {0}", RequestFlags));
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("BaseMask: {0}", BaseMask));
-                output.AppendLine(String.Format("OwnerMask: {0}", OwnerMask));
-                output.AppendLine(String.Format("GroupMask: {0}", GroupMask));
-                output.AppendLine(String.Format("EveryoneMask: {0}", EveryoneMask));
-                output.AppendLine(String.Format("NextOwnerMask: {0}", NextOwnerMask));
-                output.AppendLine(String.Format("OwnershipCost: {0}", OwnershipCost));
-                output.AppendLine(String.Format("SaleType: {0}", SaleType));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                output.AppendLine(String.Format("LastOwnerID: {0}", LastOwnerID));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Description, "Description");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectPropertiesFamily; } }
-        public ObjectDataBlock ObjectData;
-
-        public ObjectPropertiesFamilyPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 10;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            ObjectData = new ObjectDataBlock();
-        }
-
-        public ObjectPropertiesFamilyPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public ObjectPropertiesFamilyPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ObjectData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += ObjectData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ObjectData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectPropertiesFamily ---" + Environment.NewLine;
-                output += ObjectData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelPropertiesRequestPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int SequenceID;
-            public float West;
-            public float South;
-            public float East;
-            public float North;
-            public bool SnapSelection;
-
-            public int Length
-            {
-                get
-                {
-                    return 21;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SequenceID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    West = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    South = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    East = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    North = BitConverter.ToSingle(bytes, i); i += 4;
-                    SnapSelection = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(SequenceID % 256);
-                bytes[i++] = (byte)((SequenceID >> 8) % 256);
-                bytes[i++] = (byte)((SequenceID >> 16) % 256);
-                bytes[i++] = (byte)((SequenceID >> 24) % 256);
-                ba = BitConverter.GetBytes(West);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(South);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(East);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(North);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)((SnapSelection) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("SequenceID: {0}", SequenceID));
-                output.AppendLine(String.Format("West: {0}", West));
-                output.AppendLine(String.Format("South: {0}", South));
-                output.AppendLine(String.Format("East: {0}", East));
-                output.AppendLine(String.Format("North: {0}", North));
-                output.Append(String.Format("SnapSelection: {0}", SnapSelection));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelPropertiesRequest; } }
-        public AgentDataBlock AgentData;
-        public ParcelDataBlock ParcelData;
-
-        public ParcelPropertiesRequestPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 11;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            ParcelData = new ParcelDataBlock();
-        }
-
-        public ParcelPropertiesRequestPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public ParcelPropertiesRequestPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            ParcelData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;            length += ParcelData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelPropertiesRequest ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AttachedSoundPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlockBlock
-        {
-            public LLUUID SoundID;
-            public LLUUID ObjectID;
-            public LLUUID OwnerID;
-            public float Gain;
-            public byte Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 53;
-                }
-            }
-
-            public DataBlockBlock() { }
-            public DataBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SoundID.FromBytes(bytes, i); i += 16;
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Gain = BitConverter.ToSingle(bytes, i); i += 4;
-                    Flags = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(SoundID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                ba = BitConverter.GetBytes(Gain);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = Flags;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlock --");
-                output.AppendLine(String.Format("SoundID: {0}", SoundID));
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("Gain: {0}", Gain));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AttachedSound; } }
-        public DataBlockBlock DataBlock;
-
-        public AttachedSoundPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 13;
-            Header.Reliable = true;
-            DataBlock = new DataBlockBlock();
-        }
-
-        public AttachedSoundPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public AttachedSoundPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += DataBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            DataBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AttachedSound ---" + Environment.NewLine;
-                output += DataBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AttachedSoundGainChangePacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlockBlock
-        {
-            public LLUUID ObjectID;
-            public float Gain;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public DataBlockBlock() { }
-            public DataBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Gain = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                ba = BitConverter.GetBytes(Gain);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlock --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.Append(String.Format("Gain: {0}", Gain));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AttachedSoundGainChange; } }
-        public DataBlockBlock DataBlock;
-
-        public AttachedSoundGainChangePacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 14;
-            Header.Reliable = true;
-            DataBlock = new DataBlockBlock();
-        }
-
-        public AttachedSoundGainChangePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public AttachedSoundGainChangePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            DataBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += DataBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            DataBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AttachedSoundGainChange ---" + Environment.NewLine;
-                output += DataBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class PreloadSoundPacket : Packet
-    {
-        /// <exclude/>
-        public class DataBlockBlock
-        {
-            public LLUUID ObjectID;
-            public LLUUID OwnerID;
-            public LLUUID SoundID;
-
-            public int Length
-            {
-                get
-                {
-                    return 48;
-                }
-            }
-
-            public DataBlockBlock() { }
-            public DataBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    SoundID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SoundID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataBlock --");
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.Append(String.Format("SoundID: {0}", SoundID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.PreloadSound; } }
-        public DataBlockBlock[] DataBlock;
-
-        public PreloadSoundPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 15;
-            Header.Reliable = true;
-            DataBlock = new DataBlockBlock[0];
-        }
-
-        public PreloadSoundPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(DataBlock.Length < count) {
-                DataBlock = new DataBlockBlock[count];
-                for(int j = 0; j < count; j++) DataBlock[j] = new DataBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { DataBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public PreloadSoundPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(DataBlock.Length < count) {
-                DataBlock = new DataBlockBlock[count];
-                for(int j = 0; j < count; j++) DataBlock[j] = new DataBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { DataBlock[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-;
-            length++;
-            for (int j = 0; j < DataBlock.Length; j++) { length += DataBlock[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)DataBlock.Length;
-            for (int j = 0; j < DataBlock.Length; j++) { DataBlock[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- PreloadSound ---" + Environment.NewLine;
-            for (int j = 0; j < DataBlock.Length; j++)
-            {
-                output += DataBlock[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ViewerEffectPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class EffectBlock
-        {
-            public LLUUID ID;
-            public LLUUID AgentID;
-            public byte Type;
-            public float Duration;
-            public byte[] Color;
-            private byte[] _typedata;
-            public byte[] TypeData
-            {
-                get { return _typedata; }
-                set
-                {
-                    if (value == null) { _typedata = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _typedata = new byte[value.Length]; Buffer.BlockCopy(value, 0, _typedata, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 41;
-                    if (TypeData != null) { length += 1 + TypeData.Length; }
-                    return length;
-                }
-            }
-
-            public EffectBlock() { }
-            public EffectBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    Type = (byte)bytes[i++];
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Duration = BitConverter.ToSingle(bytes, i); i += 4;
-                    Color = new byte[4];
-                    Buffer.BlockCopy(bytes, i, Color, 0, 4); i += 4;
-                    length = (ushort)bytes[i++];
-                    _typedata = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _typedata, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = Type;
-                ba = BitConverter.GetBytes(Duration);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                                Buffer.BlockCopy(Color, 0, bytes, i, 4);i += 4;
-                if(TypeData == null) { Console.WriteLine("Warning: TypeData is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TypeData.Length;
-                Buffer.BlockCopy(TypeData, 0, bytes, i, TypeData.Length); i += TypeData.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Effect --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("Type: {0}", Type));
-                output.AppendLine(String.Format("Duration: {0}", Duration));
-                Helpers.FieldToString(output, Color, "Color");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, TypeData, "TypeData");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ViewerEffect; } }
-        public AgentDataBlock AgentData;
-        public EffectBlock[] Effect;
-
-        public ViewerEffectPacket()
-        {
-            Header = new MediumHeader();
-            Header.ID = 17;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            Effect = new EffectBlock[0];
-        }
-
-        public ViewerEffectPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Effect.Length < count) {
-                Effect = new EffectBlock[count];
-                for(int j = 0; j < count; j++) Effect[j] = new EffectBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Effect[j].FromBytes(bytes, ref i); }
-        }
-
-        public ViewerEffectPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(Effect.Length < count) {
-                Effect = new EffectBlock[count];
-                for(int j = 0; j < count; j++) Effect[j] = new EffectBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { Effect[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 8;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < Effect.Length; j++) { length += Effect[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)Effect.Length;
-            for (int j = 0; j < Effect.Length; j++) { Effect[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ViewerEffect ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < Effect.Length; j++)
-            {
-                output += Effect[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class StartPingCheckPacket : Packet
-    {
-        /// <exclude/>
-        public class PingIDBlock
-        {
-            public byte PingID;
-            public uint OldestUnacked;
-
-            public int Length
-            {
-                get
-                {
-                    return 5;
-                }
-            }
-
-            public PingIDBlock() { }
-            public PingIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PingID = (byte)bytes[i++];
-                    OldestUnacked = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = PingID;
-                bytes[i++] = (byte)(OldestUnacked % 256);
-                bytes[i++] = (byte)((OldestUnacked >> 8) % 256);
-                bytes[i++] = (byte)((OldestUnacked >> 16) % 256);
-                bytes[i++] = (byte)((OldestUnacked >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PingID --");
-                output.AppendLine(String.Format("PingID: {0}", PingID));
-                output.Append(String.Format("OldestUnacked: {0}", OldestUnacked));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.StartPingCheck; } }
-        public PingIDBlock PingID;
-
-        public StartPingCheckPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 1;
-            Header.Reliable = true;
-            PingID = new PingIDBlock();
-        }
-
-        public StartPingCheckPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            PingID.FromBytes(bytes, ref i);
-        }
-
-        public StartPingCheckPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            PingID.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += PingID.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            PingID.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- StartPingCheck ---" + Environment.NewLine;
-                output += PingID.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CompletePingCheckPacket : Packet
-    {
-        /// <exclude/>
-        public class PingIDBlock
-        {
-            public byte PingID;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public PingIDBlock() { }
-            public PingIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    PingID = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = PingID;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PingID --");
-                output.Append(String.Format("PingID: {0}", PingID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CompletePingCheck; } }
-        public PingIDBlock PingID;
-
-        public CompletePingCheckPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 2;
-            Header.Reliable = true;
-            PingID = new PingIDBlock();
-        }
-
-        public CompletePingCheckPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            PingID.FromBytes(bytes, ref i);
-        }
-
-        public CompletePingCheckPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            PingID.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += PingID.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            PingID.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CompletePingCheck ---" + Environment.NewLine;
-                output += PingID.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLQuaternion BodyRotation;
-            public LLQuaternion HeadRotation;
-            public byte State;
-            public LLVector3 CameraCenter;
-            public LLVector3 CameraAtAxis;
-            public LLVector3 CameraLeftAxis;
-            public LLVector3 CameraUpAxis;
-            public float Far;
-            public uint ControlFlags;
-            public byte Flags;
-
-            public int Length
-            {
-                get
-                {
-                    return 114;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    BodyRotation.FromBytes(bytes, i, true); i += 12;
-                    HeadRotation.FromBytes(bytes, i, true); i += 12;
-                    State = (byte)bytes[i++];
-                    CameraCenter.FromBytes(bytes, i); i += 12;
-                    CameraAtAxis.FromBytes(bytes, i); i += 12;
-                    CameraLeftAxis.FromBytes(bytes, i); i += 12;
-                    CameraUpAxis.FromBytes(bytes, i); i += 12;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Far = BitConverter.ToSingle(bytes, i); i += 4;
-                    ControlFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Flags = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(BodyRotation.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(HeadRotation.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = State;
-                Buffer.BlockCopy(CameraCenter.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(CameraAtAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(CameraLeftAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(CameraUpAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                ba = BitConverter.GetBytes(Far);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(ControlFlags % 256);
-                bytes[i++] = (byte)((ControlFlags >> 8) % 256);
-                bytes[i++] = (byte)((ControlFlags >> 16) % 256);
-                bytes[i++] = (byte)((ControlFlags >> 24) % 256);
-                bytes[i++] = Flags;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("BodyRotation: {0}", BodyRotation));
-                output.AppendLine(String.Format("HeadRotation: {0}", HeadRotation));
-                output.AppendLine(String.Format("State: {0}", State));
-                output.AppendLine(String.Format("CameraCenter: {0}", CameraCenter));
-                output.AppendLine(String.Format("CameraAtAxis: {0}", CameraAtAxis));
-                output.AppendLine(String.Format("CameraLeftAxis: {0}", CameraLeftAxis));
-                output.AppendLine(String.Format("CameraUpAxis: {0}", CameraUpAxis));
-                output.AppendLine(String.Format("Far: {0}", Far));
-                output.AppendLine(String.Format("ControlFlags: {0}", ControlFlags));
-                output.Append(String.Format("Flags: {0}", Flags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentUpdate; } }
-        public AgentDataBlock AgentData;
-
-        public AgentUpdatePacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 4;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AgentUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AgentUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentAnimationPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AnimationListBlock
-        {
-            public LLUUID AnimID;
-            public bool StartAnim;
-
-            public int Length
-            {
-                get
-                {
-                    return 17;
-                }
-            }
-
-            public AnimationListBlock() { }
-            public AnimationListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AnimID.FromBytes(bytes, i); i += 16;
-                    StartAnim = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AnimID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((StartAnim) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AnimationList --");
-                output.AppendLine(String.Format("AnimID: {0}", AnimID));
-                output.Append(String.Format("StartAnim: {0}", StartAnim));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class PhysicalAvatarEventListBlock
-        {
-            private byte[] _typedata;
-            public byte[] TypeData
-            {
-                get { return _typedata; }
-                set
-                {
-                    if (value == null) { _typedata = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _typedata = new byte[value.Length]; Buffer.BlockCopy(value, 0, _typedata, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (TypeData != null) { length += 1 + TypeData.Length; }
-                    return length;
-                }
-            }
-
-            public PhysicalAvatarEventListBlock() { }
-            public PhysicalAvatarEventListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _typedata = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _typedata, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(TypeData == null) { Console.WriteLine("Warning: TypeData is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TypeData.Length;
-                Buffer.BlockCopy(TypeData, 0, bytes, i, TypeData.Length); i += TypeData.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PhysicalAvatarEventList --");
-                Helpers.FieldToString(output, TypeData, "TypeData");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentAnimation; } }
-        public AgentDataBlock AgentData;
-        public AnimationListBlock[] AnimationList;
-        public PhysicalAvatarEventListBlock[] PhysicalAvatarEventList;
-
-        public AgentAnimationPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 5;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            AnimationList = new AnimationListBlock[0];
-            PhysicalAvatarEventList = new PhysicalAvatarEventListBlock[0];
-        }
-
-        public AgentAnimationPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(AnimationList.Length < count) {
-                AnimationList = new AnimationListBlock[count];
-                for(int j = 0; j < count; j++) AnimationList[j] = new AnimationListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AnimationList[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(PhysicalAvatarEventList.Length < count) {
-                PhysicalAvatarEventList = new PhysicalAvatarEventListBlock[count];
-                for(int j = 0; j < count; j++) PhysicalAvatarEventList[j] = new PhysicalAvatarEventListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { PhysicalAvatarEventList[j].FromBytes(bytes, ref i); }
-        }
-
-        public AgentAnimationPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(AnimationList.Length < count) {
-                AnimationList = new AnimationListBlock[count];
-                for(int j = 0; j < count; j++) AnimationList[j] = new AnimationListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AnimationList[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(PhysicalAvatarEventList.Length < count) {
-                PhysicalAvatarEventList = new PhysicalAvatarEventListBlock[count];
-                for(int j = 0; j < count; j++) PhysicalAvatarEventList[j] = new PhysicalAvatarEventListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { PhysicalAvatarEventList[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < AnimationList.Length; j++) { length += AnimationList[j].Length; }
-            length++;
-            for (int j = 0; j < PhysicalAvatarEventList.Length; j++) { length += PhysicalAvatarEventList[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)AnimationList.Length;
-            for (int j = 0; j < AnimationList.Length; j++) { AnimationList[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)PhysicalAvatarEventList.Length;
-            for (int j = 0; j < PhysicalAvatarEventList.Length; j++) { PhysicalAvatarEventList[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentAnimation ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < AnimationList.Length; j++)
-            {
-                output += AnimationList[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < PhysicalAvatarEventList.Length; j++)
-            {
-                output += PhysicalAvatarEventList[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentRequestSitPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class TargetObjectBlock
-        {
-            public LLUUID TargetID;
-            public LLVector3 Offset;
-
-            public int Length
-            {
-                get
-                {
-                    return 28;
-                }
-            }
-
-            public TargetObjectBlock() { }
-            public TargetObjectBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    TargetID.FromBytes(bytes, i); i += 16;
-                    Offset.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TargetID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(Offset.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TargetObject --");
-                output.AppendLine(String.Format("TargetID: {0}", TargetID));
-                output.Append(String.Format("Offset: {0}", Offset));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentRequestSit; } }
-        public AgentDataBlock AgentData;
-        public TargetObjectBlock TargetObject;
-
-        public AgentRequestSitPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 6;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            TargetObject = new TargetObjectBlock();
-        }
-
-        public AgentRequestSitPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TargetObject.FromBytes(bytes, ref i);
-        }
-
-        public AgentRequestSitPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            TargetObject.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += AgentData.Length;            length += TargetObject.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            TargetObject.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentRequestSit ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-                output += TargetObject.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AgentSitPacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AgentSit; } }
-        public AgentDataBlock AgentData;
-
-        public AgentSitPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 7;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public AgentSitPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public AgentSitPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AgentSit ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class RequestImagePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class RequestImageBlock
-        {
-            public LLUUID Image;
-            public sbyte DiscardLevel;
-            public float DownloadPriority;
-            public uint Packet;
-            public byte Type;
-
-            public int Length
-            {
-                get
-                {
-                    return 26;
-                }
-            }
-
-            public RequestImageBlock() { }
-            public RequestImageBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Image.FromBytes(bytes, i); i += 16;
-                    DiscardLevel = (sbyte)bytes[i++];
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    DownloadPriority = BitConverter.ToSingle(bytes, i); i += 4;
-                    Packet = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Type = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(Image.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)DiscardLevel;
-                ba = BitConverter.GetBytes(DownloadPriority);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(Packet % 256);
-                bytes[i++] = (byte)((Packet >> 8) % 256);
-                bytes[i++] = (byte)((Packet >> 16) % 256);
-                bytes[i++] = (byte)((Packet >> 24) % 256);
-                bytes[i++] = Type;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RequestImage --");
-                output.AppendLine(String.Format("Image: {0}", Image));
-                output.AppendLine(String.Format("DiscardLevel: {0}", DiscardLevel));
-                output.AppendLine(String.Format("DownloadPriority: {0}", DownloadPriority));
-                output.AppendLine(String.Format("Packet: {0}", Packet));
-                output.Append(String.Format("Type: {0}", Type));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.RequestImage; } }
-        public AgentDataBlock AgentData;
-        public RequestImageBlock[] RequestImage;
-
-        public RequestImagePacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 8;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-            RequestImage = new RequestImageBlock[0];
-        }
-
-        public RequestImagePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(RequestImage.Length < count) {
-                RequestImage = new RequestImageBlock[count];
-                for(int j = 0; j < count; j++) RequestImage[j] = new RequestImageBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { RequestImage[j].FromBytes(bytes, ref i); }
-        }
-
-        public RequestImagePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(RequestImage.Length < count) {
-                RequestImage = new RequestImageBlock[count];
-                for(int j = 0; j < count; j++) RequestImage[j] = new RequestImageBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { RequestImage[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < RequestImage.Length; j++) { length += RequestImage[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)RequestImage.Length;
-            for (int j = 0; j < RequestImage.Length; j++) { RequestImage[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- RequestImage ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < RequestImage.Length; j++)
-            {
-                output += RequestImage[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ImageDataPacket : Packet
-    {
-        /// <exclude/>
-        public class ImageIDBlock
-        {
-            public LLUUID ID;
-            public byte Codec;
-            public uint Size;
-            public ushort Packets;
-
-            public int Length
-            {
-                get
-                {
-                    return 23;
-                }
-            }
-
-            public ImageIDBlock() { }
-            public ImageIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    Codec = (byte)bytes[i++];
-                    Size = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Packets = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = Codec;
-                bytes[i++] = (byte)(Size % 256);
-                bytes[i++] = (byte)((Size >> 8) % 256);
-                bytes[i++] = (byte)((Size >> 16) % 256);
-                bytes[i++] = (byte)((Size >> 24) % 256);
-                bytes[i++] = (byte)(Packets % 256);
-                bytes[i++] = (byte)((Packets >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ImageID --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.AppendLine(String.Format("Codec: {0}", Codec));
-                output.AppendLine(String.Format("Size: {0}", Size));
-                output.Append(String.Format("Packets: {0}", Packets));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ImageDataBlock
-        {
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Data != null) { length += 2 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public ImageDataBlock() { }
-            public ImageDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ImageData --");
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ImageData; } }
-        public ImageIDBlock ImageID;
-        public ImageDataBlock ImageData;
-
-        public ImageDataPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 9;
-            Header.Reliable = true;
-            ImageID = new ImageIDBlock();
-            ImageData = new ImageDataBlock();
-        }
-
-        public ImageDataPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ImageID.FromBytes(bytes, ref i);
-            ImageData.FromBytes(bytes, ref i);
-        }
-
-        public ImageDataPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ImageID.FromBytes(bytes, ref i);
-            ImageData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += ImageID.Length;            length += ImageData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ImageID.ToBytes(bytes, ref i);
-            ImageData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ImageData ---" + Environment.NewLine;
-                output += ImageID.ToString() + Environment.NewLine;
-                output += ImageData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ImagePacketPacket : Packet
-    {
-        /// <exclude/>
-        public class ImageIDBlock
-        {
-            public LLUUID ID;
-            public ushort Packet;
-
-            public int Length
-            {
-                get
-                {
-                    return 18;
-                }
-            }
-
-            public ImageIDBlock() { }
-            public ImageIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                    Packet = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Packet % 256);
-                bytes[i++] = (byte)((Packet >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ImageID --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.Append(String.Format("Packet: {0}", Packet));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ImageDataBlock
-        {
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Data != null) { length += 2 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public ImageDataBlock() { }
-            public ImageDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ImageData --");
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ImagePacket; } }
-        public ImageIDBlock ImageID;
-        public ImageDataBlock ImageData;
-
-        public ImagePacketPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 10;
-            Header.Reliable = true;
-            ImageID = new ImageIDBlock();
-            ImageData = new ImageDataBlock();
-        }
-
-        public ImagePacketPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ImageID.FromBytes(bytes, ref i);
-            ImageData.FromBytes(bytes, ref i);
-        }
-
-        public ImagePacketPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ImageID.FromBytes(bytes, ref i);
-            ImageData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += ImageID.Length;            length += ImageData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ImageID.ToBytes(bytes, ref i);
-            ImageData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ImagePacket ---" + Environment.NewLine;
-                output += ImageID.ToString() + Environment.NewLine;
-                output += ImageData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class LayerDataPacket : Packet
-    {
-        /// <exclude/>
-        public class LayerIDBlock
-        {
-            public byte Type;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public LayerIDBlock() { }
-            public LayerIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Type = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = Type;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- LayerID --");
-                output.Append(String.Format("Type: {0}", Type));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class LayerDataBlock
-        {
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Data != null) { length += 2 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public LayerDataBlock() { }
-            public LayerDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- LayerData --");
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.LayerData; } }
-        public LayerIDBlock LayerID;
-        public LayerDataBlock LayerData;
-
-        public LayerDataPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 11;
-            Header.Reliable = true;
-            LayerID = new LayerIDBlock();
-            LayerData = new LayerDataBlock();
-        }
-
-        public LayerDataPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            LayerID.FromBytes(bytes, ref i);
-            LayerData.FromBytes(bytes, ref i);
-        }
-
-        public LayerDataPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            LayerID.FromBytes(bytes, ref i);
-            LayerData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += LayerID.Length;            length += LayerData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            LayerID.ToBytes(bytes, ref i);
-            LayerData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- LayerData ---" + Environment.NewLine;
-                output += LayerID.ToString() + Environment.NewLine;
-                output += LayerData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class RegionDataBlock
-        {
-            public ulong RegionHandle;
-            public ushort TimeDilation;
-
-            public int Length
-            {
-                get
-                {
-                    return 10;
-                }
-            }
-
-            public RegionDataBlock() { }
-            public RegionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    TimeDilation = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = (byte)(TimeDilation % 256);
-                bytes[i++] = (byte)((TimeDilation >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionData --");
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.Append(String.Format("TimeDilation: {0}", TimeDilation));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ID;
-            public byte State;
-            public LLUUID FullID;
-            public uint CRC;
-            public byte PCode;
-            public byte Material;
-            public byte ClickAction;
-            public LLVector3 Scale;
-            private byte[] _objectdata;
-            public byte[] ObjectData
-            {
-                get { return _objectdata; }
-                set
-                {
-                    if (value == null) { _objectdata = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _objectdata = new byte[value.Length]; Buffer.BlockCopy(value, 0, _objectdata, 0, value.Length); }
-                }
-            }
-            public uint ParentID;
-            public uint UpdateFlags;
-            public byte PathCurve;
-            public byte ProfileCurve;
-            public ushort PathBegin;
-            public ushort PathEnd;
-            public byte PathScaleX;
-            public byte PathScaleY;
-            public byte PathShearX;
-            public byte PathShearY;
-            public sbyte PathTwist;
-            public sbyte PathTwistBegin;
-            public sbyte PathRadiusOffset;
-            public sbyte PathTaperX;
-            public sbyte PathTaperY;
-            public byte PathRevolutions;
-            public sbyte PathSkew;
-            public ushort ProfileBegin;
-            public ushort ProfileEnd;
-            public ushort ProfileHollow;
-            private byte[] _textureentry;
-            public byte[] TextureEntry
-            {
-                get { return _textureentry; }
-                set
-                {
-                    if (value == null) { _textureentry = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _textureentry = new byte[value.Length]; Buffer.BlockCopy(value, 0, _textureentry, 0, value.Length); }
-                }
-            }
-            private byte[] _textureanim;
-            public byte[] TextureAnim
-            {
-                get { return _textureanim; }
-                set
-                {
-                    if (value == null) { _textureanim = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _textureanim = new byte[value.Length]; Buffer.BlockCopy(value, 0, _textureanim, 0, value.Length); }
-                }
-            }
-            private byte[] _namevalue;
-            public byte[] NameValue
-            {
-                get { return _namevalue; }
-                set
-                {
-                    if (value == null) { _namevalue = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _namevalue = new byte[value.Length]; Buffer.BlockCopy(value, 0, _namevalue, 0, value.Length); }
-                }
-            }
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-            private byte[] _text;
-            public byte[] Text
-            {
-                get { return _text; }
-                set
-                {
-                    if (value == null) { _text = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _text = new byte[value.Length]; Buffer.BlockCopy(value, 0, _text, 0, value.Length); }
-                }
-            }
-            public byte[] TextColor;
-            private byte[] _mediaurl;
-            public byte[] MediaURL
-            {
-                get { return _mediaurl; }
-                set
-                {
-                    if (value == null) { _mediaurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mediaurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediaurl, 0, value.Length); }
-                }
-            }
-            private byte[] _psblock;
-            public byte[] PSBlock
-            {
-                get { return _psblock; }
-                set
-                {
-                    if (value == null) { _psblock = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _psblock = new byte[value.Length]; Buffer.BlockCopy(value, 0, _psblock, 0, value.Length); }
-                }
-            }
-            private byte[] _extraparams;
-            public byte[] ExtraParams
-            {
-                get { return _extraparams; }
-                set
-                {
-                    if (value == null) { _extraparams = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _extraparams = new byte[value.Length]; Buffer.BlockCopy(value, 0, _extraparams, 0, value.Length); }
-                }
-            }
-            public LLUUID Sound;
-            public LLUUID OwnerID;
-            public float Gain;
-            public byte Flags;
-            public float Radius;
-            public byte JointType;
-            public LLVector3 JointPivot;
-            public LLVector3 JointAxisOrAnchor;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 141;
-                    if (ObjectData != null) { length += 1 + ObjectData.Length; }
-                    if (TextureEntry != null) { length += 2 + TextureEntry.Length; }
-                    if (TextureAnim != null) { length += 1 + TextureAnim.Length; }
-                    if (NameValue != null) { length += 2 + NameValue.Length; }
-                    if (Data != null) { length += 2 + Data.Length; }
-                    if (Text != null) { length += 1 + Text.Length; }
-                    if (MediaURL != null) { length += 1 + MediaURL.Length; }
-                    if (PSBlock != null) { length += 1 + PSBlock.Length; }
-                    if (ExtraParams != null) { length += 1 + ExtraParams.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    ID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    State = (byte)bytes[i++];
-                    FullID.FromBytes(bytes, i); i += 16;
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PCode = (byte)bytes[i++];
-                    Material = (byte)bytes[i++];
-                    ClickAction = (byte)bytes[i++];
-                    Scale.FromBytes(bytes, i); i += 12;
-                    length = (ushort)bytes[i++];
-                    _objectdata = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _objectdata, 0, length); i += length;
-                    ParentID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    UpdateFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PathCurve = (byte)bytes[i++];
-                    ProfileCurve = (byte)bytes[i++];
-                    PathBegin = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    PathEnd = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    PathScaleX = (byte)bytes[i++];
-                    PathScaleY = (byte)bytes[i++];
-                    PathShearX = (byte)bytes[i++];
-                    PathShearY = (byte)bytes[i++];
-                    PathTwist = (sbyte)bytes[i++];
-                    PathTwistBegin = (sbyte)bytes[i++];
-                    PathRadiusOffset = (sbyte)bytes[i++];
-                    PathTaperX = (sbyte)bytes[i++];
-                    PathTaperY = (sbyte)bytes[i++];
-                    PathRevolutions = (byte)bytes[i++];
-                    PathSkew = (sbyte)bytes[i++];
-                    ProfileBegin = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    ProfileEnd = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    ProfileHollow = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _textureentry = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _textureentry, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _textureanim = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _textureanim, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _namevalue = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _namevalue, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _text = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _text, 0, length); i += length;
-                    TextColor = new byte[4];
-                    Buffer.BlockCopy(bytes, i, TextColor, 0, 4); i += 4;
-                    length = (ushort)bytes[i++];
-                    _mediaurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mediaurl, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _psblock = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _psblock, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _extraparams = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _extraparams, 0, length); i += length;
-                    Sound.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Gain = BitConverter.ToSingle(bytes, i); i += 4;
-                    Flags = (byte)bytes[i++];
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Radius = BitConverter.ToSingle(bytes, i); i += 4;
-                    JointType = (byte)bytes[i++];
-                    JointPivot.FromBytes(bytes, i); i += 12;
-                    JointAxisOrAnchor.FromBytes(bytes, i); i += 12;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-                bytes[i++] = State;
-                Buffer.BlockCopy(FullID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-                bytes[i++] = PCode;
-                bytes[i++] = Material;
-                bytes[i++] = ClickAction;
-                Buffer.BlockCopy(Scale.GetBytes(), 0, bytes, i, 12); i += 12;
-                if(ObjectData == null) { Console.WriteLine("Warning: ObjectData is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ObjectData.Length;
-                Buffer.BlockCopy(ObjectData, 0, bytes, i, ObjectData.Length); i += ObjectData.Length;
-                bytes[i++] = (byte)(ParentID % 256);
-                bytes[i++] = (byte)((ParentID >> 8) % 256);
-                bytes[i++] = (byte)((ParentID >> 16) % 256);
-                bytes[i++] = (byte)((ParentID >> 24) % 256);
-                bytes[i++] = (byte)(UpdateFlags % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 8) % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 16) % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 24) % 256);
-                bytes[i++] = PathCurve;
-                bytes[i++] = ProfileCurve;
-                bytes[i++] = (byte)(PathBegin % 256);
-                bytes[i++] = (byte)((PathBegin >> 8) % 256);
-                bytes[i++] = (byte)(PathEnd % 256);
-                bytes[i++] = (byte)((PathEnd >> 8) % 256);
-                bytes[i++] = PathScaleX;
-                bytes[i++] = PathScaleY;
-                bytes[i++] = PathShearX;
-                bytes[i++] = PathShearY;
-                bytes[i++] = (byte)PathTwist;
-                bytes[i++] = (byte)PathTwistBegin;
-                bytes[i++] = (byte)PathRadiusOffset;
-                bytes[i++] = (byte)PathTaperX;
-                bytes[i++] = (byte)PathTaperY;
-                bytes[i++] = PathRevolutions;
-                bytes[i++] = (byte)PathSkew;
-                bytes[i++] = (byte)(ProfileBegin % 256);
-                bytes[i++] = (byte)((ProfileBegin >> 8) % 256);
-                bytes[i++] = (byte)(ProfileEnd % 256);
-                bytes[i++] = (byte)((ProfileEnd >> 8) % 256);
-                bytes[i++] = (byte)(ProfileHollow % 256);
-                bytes[i++] = (byte)((ProfileHollow >> 8) % 256);
-                if(TextureEntry == null) { Console.WriteLine("Warning: TextureEntry is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(TextureEntry.Length % 256);
-                bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256);
-                Buffer.BlockCopy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length;
-                if(TextureAnim == null) { Console.WriteLine("Warning: TextureAnim is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TextureAnim.Length;
-                Buffer.BlockCopy(TextureAnim, 0, bytes, i, TextureAnim.Length); i += TextureAnim.Length;
-                if(NameValue == null) { Console.WriteLine("Warning: NameValue is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(NameValue.Length % 256);
-                bytes[i++] = (byte)((NameValue.Length >> 8) % 256);
-                Buffer.BlockCopy(NameValue, 0, bytes, i, NameValue.Length); i += NameValue.Length;
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-                if(Text == null) { Console.WriteLine("Warning: Text is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Text.Length;
-                Buffer.BlockCopy(Text, 0, bytes, i, Text.Length); i += Text.Length;
-                                Buffer.BlockCopy(TextColor, 0, bytes, i, 4);i += 4;
-                if(MediaURL == null) { Console.WriteLine("Warning: MediaURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MediaURL.Length;
-                Buffer.BlockCopy(MediaURL, 0, bytes, i, MediaURL.Length); i += MediaURL.Length;
-                if(PSBlock == null) { Console.WriteLine("Warning: PSBlock is null, in " + this.GetType()); }
-                bytes[i++] = (byte)PSBlock.Length;
-                Buffer.BlockCopy(PSBlock, 0, bytes, i, PSBlock.Length); i += PSBlock.Length;
-                if(ExtraParams == null) { Console.WriteLine("Warning: ExtraParams is null, in " + this.GetType()); }
-                bytes[i++] = (byte)ExtraParams.Length;
-                Buffer.BlockCopy(ExtraParams, 0, bytes, i, ExtraParams.Length); i += ExtraParams.Length;
-                Buffer.BlockCopy(Sound.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                ba = BitConverter.GetBytes(Gain);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = Flags;
-                ba = BitConverter.GetBytes(Radius);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = JointType;
-                Buffer.BlockCopy(JointPivot.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(JointAxisOrAnchor.GetBytes(), 0, bytes, i, 12); i += 12;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.AppendLine(String.Format("State: {0}", State));
-                output.AppendLine(String.Format("FullID: {0}", FullID));
-                output.AppendLine(String.Format("CRC: {0}", CRC));
-                output.AppendLine(String.Format("PCode: {0}", PCode));
-                output.AppendLine(String.Format("Material: {0}", Material));
-                output.AppendLine(String.Format("ClickAction: {0}", ClickAction));
-                output.AppendLine(String.Format("Scale: {0}", Scale));
-                Helpers.FieldToString(output, ObjectData, "ObjectData");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("ParentID: {0}", ParentID));
-                output.AppendLine(String.Format("UpdateFlags: {0}", UpdateFlags));
-                output.AppendLine(String.Format("PathCurve: {0}", PathCurve));
-                output.AppendLine(String.Format("ProfileCurve: {0}", ProfileCurve));
-                output.AppendLine(String.Format("PathBegin: {0}", PathBegin));
-                output.AppendLine(String.Format("PathEnd: {0}", PathEnd));
-                output.AppendLine(String.Format("PathScaleX: {0}", PathScaleX));
-                output.AppendLine(String.Format("PathScaleY: {0}", PathScaleY));
-                output.AppendLine(String.Format("PathShearX: {0}", PathShearX));
-                output.AppendLine(String.Format("PathShearY: {0}", PathShearY));
-                output.AppendLine(String.Format("PathTwist: {0}", PathTwist));
-                output.AppendLine(String.Format("PathTwistBegin: {0}", PathTwistBegin));
-                output.AppendLine(String.Format("PathRadiusOffset: {0}", PathRadiusOffset));
-                output.AppendLine(String.Format("PathTaperX: {0}", PathTaperX));
-                output.AppendLine(String.Format("PathTaperY: {0}", PathTaperY));
-                output.AppendLine(String.Format("PathRevolutions: {0}", PathRevolutions));
-                output.AppendLine(String.Format("PathSkew: {0}", PathSkew));
-                output.AppendLine(String.Format("ProfileBegin: {0}", ProfileBegin));
-                output.AppendLine(String.Format("ProfileEnd: {0}", ProfileEnd));
-                output.AppendLine(String.Format("ProfileHollow: {0}", ProfileHollow));
-                Helpers.FieldToString(output, TextureEntry, "TextureEntry");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, TextureAnim, "TextureAnim");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, NameValue, "NameValue");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Data, "Data");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Text, "Text");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, TextColor, "TextColor");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, MediaURL, "MediaURL");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, PSBlock, "PSBlock");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, ExtraParams, "ExtraParams");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Sound: {0}", Sound));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("Gain: {0}", Gain));
-                output.AppendLine(String.Format("Flags: {0}", Flags));
-                output.AppendLine(String.Format("Radius: {0}", Radius));
-                output.AppendLine(String.Format("JointType: {0}", JointType));
-                output.AppendLine(String.Format("JointPivot: {0}", JointPivot));
-                output.Append(String.Format("JointAxisOrAnchor: {0}", JointAxisOrAnchor));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectUpdate; } }
-        public RegionDataBlock RegionData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectUpdatePacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 12;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            RegionData = new RegionDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += RegionData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RegionData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectUpdate ---" + Environment.NewLine;
-                output += RegionData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectUpdateCompressedPacket : Packet
-    {
-        /// <exclude/>
-        public class RegionDataBlock
-        {
-            public ulong RegionHandle;
-            public ushort TimeDilation;
-
-            public int Length
-            {
-                get
-                {
-                    return 10;
-                }
-            }
-
-            public RegionDataBlock() { }
-            public RegionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    TimeDilation = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = (byte)(TimeDilation % 256);
-                bytes[i++] = (byte)((TimeDilation >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionData --");
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.Append(String.Format("TimeDilation: {0}", TimeDilation));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint UpdateFlags;
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 4;
-                    if (Data != null) { length += 2 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    UpdateFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(UpdateFlags % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 8) % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 16) % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 24) % 256);
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("UpdateFlags: {0}", UpdateFlags));
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectUpdateCompressed; } }
-        public RegionDataBlock RegionData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectUpdateCompressedPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 13;
-            Header.Reliable = true;
-            RegionData = new RegionDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectUpdateCompressedPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectUpdateCompressedPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += RegionData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RegionData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectUpdateCompressed ---" + Environment.NewLine;
-                output += RegionData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ObjectUpdateCachedPacket : Packet
-    {
-        /// <exclude/>
-        public class RegionDataBlock
-        {
-            public ulong RegionHandle;
-            public ushort TimeDilation;
-
-            public int Length
-            {
-                get
-                {
-                    return 10;
-                }
-            }
-
-            public RegionDataBlock() { }
-            public RegionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    TimeDilation = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = (byte)(TimeDilation % 256);
-                bytes[i++] = (byte)((TimeDilation >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionData --");
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.Append(String.Format("TimeDilation: {0}", TimeDilation));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ID;
-            public uint CRC;
-            public uint UpdateFlags;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    CRC = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    UpdateFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-                bytes[i++] = (byte)(CRC % 256);
-                bytes[i++] = (byte)((CRC >> 8) % 256);
-                bytes[i++] = (byte)((CRC >> 16) % 256);
-                bytes[i++] = (byte)((CRC >> 24) % 256);
-                bytes[i++] = (byte)(UpdateFlags % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 8) % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 16) % 256);
-                bytes[i++] = (byte)((UpdateFlags >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.AppendLine(String.Format("CRC: {0}", CRC));
-                output.Append(String.Format("UpdateFlags: {0}", UpdateFlags));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ObjectUpdateCached; } }
-        public RegionDataBlock RegionData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ObjectUpdateCachedPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 14;
-            Header.Reliable = true;
-            RegionData = new RegionDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ObjectUpdateCachedPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ObjectUpdateCachedPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += RegionData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RegionData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ObjectUpdateCached ---" + Environment.NewLine;
-                output += RegionData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ImprovedTerseObjectUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class RegionDataBlock
-        {
-            public ulong RegionHandle;
-            public ushort TimeDilation;
-
-            public int Length
-            {
-                get
-                {
-                    return 10;
-                }
-            }
-
-            public RegionDataBlock() { }
-            public RegionDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    TimeDilation = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = (byte)(TimeDilation % 256);
-                bytes[i++] = (byte)((TimeDilation >> 8) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- RegionData --");
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.Append(String.Format("TimeDilation: {0}", TimeDilation));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-            private byte[] _textureentry;
-            public byte[] TextureEntry
-            {
-                get { return _textureentry; }
-                set
-                {
-                    if (value == null) { _textureentry = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _textureentry = new byte[value.Length]; Buffer.BlockCopy(value, 0, _textureentry, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Data != null) { length += 1 + Data.Length; }
-                    if (TextureEntry != null) { length += 2 + TextureEntry.Length; }
-                    return length;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _textureentry = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _textureentry, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Data.Length;
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-                if(TextureEntry == null) { Console.WriteLine("Warning: TextureEntry is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(TextureEntry.Length % 256);
-                bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256);
-                Buffer.BlockCopy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                Helpers.FieldToString(output, Data, "Data");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, TextureEntry, "TextureEntry");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ImprovedTerseObjectUpdate; } }
-        public RegionDataBlock RegionData;
-        public ObjectDataBlock[] ObjectData;
-
-        public ImprovedTerseObjectUpdatePacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 15;
-            Header.Reliable = true;
-            RegionData = new RegionDataBlock();
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public ImprovedTerseObjectUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public ImprovedTerseObjectUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            RegionData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += RegionData.Length;;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            RegionData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ImprovedTerseObjectUpdate ---" + Environment.NewLine;
-                output += RegionData.ToString() + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class KillObjectPacket : Packet
-    {
-        /// <exclude/>
-        public class ObjectDataBlock
-        {
-            public uint ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 4;
-                }
-            }
-
-            public ObjectDataBlock() { }
-            public ObjectDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ObjectData --");
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.KillObject; } }
-        public ObjectDataBlock[] ObjectData;
-
-        public KillObjectPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 16;
-            Header.Reliable = true;
-            ObjectData = new ObjectDataBlock[0];
-        }
-
-        public KillObjectPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public KillObjectPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            int count = (int)bytes[i++];
-            if(ObjectData.Length < count) {
-                ObjectData = new ObjectDataBlock[count];
-                for(int j = 0; j < count; j++) ObjectData[j] = new ObjectDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { ObjectData[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-;
-            length++;
-            for (int j = 0; j < ObjectData.Length; j++) { length += ObjectData[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)ObjectData.Length;
-            for (int j = 0; j < ObjectData.Length; j++) { ObjectData[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- KillObject ---" + Environment.NewLine;
-            for (int j = 0; j < ObjectData.Length; j++)
-            {
-                output += ObjectData[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class TransferPacketPacket : Packet
-    {
-        /// <exclude/>
-        public class TransferDataBlock
-        {
-            public LLUUID TransferID;
-            public int ChannelType;
-            public int Packet;
-            public int Status;
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1500) { throw new OverflowException("Value exceeds 1500 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 28;
-                    if (Data != null) { length += 2 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public TransferDataBlock() { }
-            public TransferDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    TransferID.FromBytes(bytes, i); i += 16;
-                    ChannelType = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Packet = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Status = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(TransferID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(ChannelType % 256);
-                bytes[i++] = (byte)((ChannelType >> 8) % 256);
-                bytes[i++] = (byte)((ChannelType >> 16) % 256);
-                bytes[i++] = (byte)((ChannelType >> 24) % 256);
-                bytes[i++] = (byte)(Packet % 256);
-                bytes[i++] = (byte)((Packet >> 8) % 256);
-                bytes[i++] = (byte)((Packet >> 16) % 256);
-                bytes[i++] = (byte)((Packet >> 24) % 256);
-                bytes[i++] = (byte)(Status % 256);
-                bytes[i++] = (byte)((Status >> 8) % 256);
-                bytes[i++] = (byte)((Status >> 16) % 256);
-                bytes[i++] = (byte)((Status >> 24) % 256);
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- TransferData --");
-                output.AppendLine(String.Format("TransferID: {0}", TransferID));
-                output.AppendLine(String.Format("ChannelType: {0}", ChannelType));
-                output.AppendLine(String.Format("Packet: {0}", Packet));
-                output.AppendLine(String.Format("Status: {0}", Status));
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.TransferPacket; } }
-        public TransferDataBlock TransferData;
-
-        public TransferPacketPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 17;
-            Header.Reliable = true;
-            TransferData = new TransferDataBlock();
-        }
-
-        public TransferPacketPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransferData.FromBytes(bytes, ref i);
-        }
-
-        public TransferPacketPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            TransferData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += TransferData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            TransferData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- TransferPacket ---" + Environment.NewLine;
-                output += TransferData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SendXferPacketPacket : Packet
-    {
-        /// <exclude/>
-        public class XferIDBlock
-        {
-            public ulong ID;
-            public uint Packet;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public XferIDBlock() { }
-            public XferIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    Packet = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-                bytes[i++] = (byte)((ID >> 32) % 256);
-                bytes[i++] = (byte)((ID >> 40) % 256);
-                bytes[i++] = (byte)((ID >> 48) % 256);
-                bytes[i++] = (byte)((ID >> 56) % 256);
-                bytes[i++] = (byte)(Packet % 256);
-                bytes[i++] = (byte)((Packet >> 8) % 256);
-                bytes[i++] = (byte)((Packet >> 16) % 256);
-                bytes[i++] = (byte)((Packet >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- XferID --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.Append(String.Format("Packet: {0}", Packet));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class DataPacketBlock
-        {
-            private byte[] _data;
-            public byte[] Data
-            {
-                get { return _data; }
-                set
-                {
-                    if (value == null) { _data = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _data = new byte[value.Length]; Buffer.BlockCopy(value, 0, _data, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (Data != null) { length += 2 + Data.Length; }
-                    return length;
-                }
-            }
-
-            public DataPacketBlock() { }
-            public DataPacketBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _data = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _data, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(Data == null) { Console.WriteLine("Warning: Data is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Data.Length % 256);
-                bytes[i++] = (byte)((Data.Length >> 8) % 256);
-                Buffer.BlockCopy(Data, 0, bytes, i, Data.Length); i += Data.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- DataPacket --");
-                Helpers.FieldToString(output, Data, "Data");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SendXferPacket; } }
-        public XferIDBlock XferID;
-        public DataPacketBlock DataPacket;
-
-        public SendXferPacketPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 18;
-            Header.Reliable = true;
-            XferID = new XferIDBlock();
-            DataPacket = new DataPacketBlock();
-        }
-
-        public SendXferPacketPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            XferID.FromBytes(bytes, ref i);
-            DataPacket.FromBytes(bytes, ref i);
-        }
-
-        public SendXferPacketPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            XferID.FromBytes(bytes, ref i);
-            DataPacket.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += XferID.Length;            length += DataPacket.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            XferID.ToBytes(bytes, ref i);
-            DataPacket.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SendXferPacket ---" + Environment.NewLine;
-                output += XferID.ToString() + Environment.NewLine;
-                output += DataPacket.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ConfirmXferPacketPacket : Packet
-    {
-        /// <exclude/>
-        public class XferIDBlock
-        {
-            public ulong ID;
-            public uint Packet;
-
-            public int Length
-            {
-                get
-                {
-                    return 12;
-                }
-            }
-
-            public XferIDBlock() { }
-            public XferIDBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    Packet = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(ID % 256);
-                bytes[i++] = (byte)((ID >> 8) % 256);
-                bytes[i++] = (byte)((ID >> 16) % 256);
-                bytes[i++] = (byte)((ID >> 24) % 256);
-                bytes[i++] = (byte)((ID >> 32) % 256);
-                bytes[i++] = (byte)((ID >> 40) % 256);
-                bytes[i++] = (byte)((ID >> 48) % 256);
-                bytes[i++] = (byte)((ID >> 56) % 256);
-                bytes[i++] = (byte)(Packet % 256);
-                bytes[i++] = (byte)((Packet >> 8) % 256);
-                bytes[i++] = (byte)((Packet >> 16) % 256);
-                bytes[i++] = (byte)((Packet >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- XferID --");
-                output.AppendLine(String.Format("ID: {0}", ID));
-                output.Append(String.Format("Packet: {0}", Packet));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ConfirmXferPacket; } }
-        public XferIDBlock XferID;
-
-        public ConfirmXferPacketPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 19;
-            Header.Reliable = true;
-            XferID = new XferIDBlock();
-        }
-
-        public ConfirmXferPacketPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            XferID.FromBytes(bytes, ref i);
-        }
-
-        public ConfirmXferPacketPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            XferID.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += XferID.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            XferID.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ConfirmXferPacket ---" + Environment.NewLine;
-                output += XferID.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarAnimationPacket : Packet
-    {
-        /// <exclude/>
-        public class SenderBlock
-        {
-            public LLUUID ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public SenderBlock() { }
-            public SenderBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- Sender --");
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AnimationListBlock
-        {
-            public LLUUID AnimID;
-            public int AnimSequenceID;
-
-            public int Length
-            {
-                get
-                {
-                    return 20;
-                }
-            }
-
-            public AnimationListBlock() { }
-            public AnimationListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AnimID.FromBytes(bytes, i); i += 16;
-                    AnimSequenceID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(AnimID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(AnimSequenceID % 256);
-                bytes[i++] = (byte)((AnimSequenceID >> 8) % 256);
-                bytes[i++] = (byte)((AnimSequenceID >> 16) % 256);
-                bytes[i++] = (byte)((AnimSequenceID >> 24) % 256);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AnimationList --");
-                output.AppendLine(String.Format("AnimID: {0}", AnimID));
-                output.Append(String.Format("AnimSequenceID: {0}", AnimSequenceID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AnimationSourceListBlock
-        {
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public AnimationSourceListBlock() { }
-            public AnimationSourceListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AnimationSourceList --");
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class PhysicalAvatarEventListBlock
-        {
-            private byte[] _typedata;
-            public byte[] TypeData
-            {
-                get { return _typedata; }
-                set
-                {
-                    if (value == null) { _typedata = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _typedata = new byte[value.Length]; Buffer.BlockCopy(value, 0, _typedata, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (TypeData != null) { length += 1 + TypeData.Length; }
-                    return length;
-                }
-            }
-
-            public PhysicalAvatarEventListBlock() { }
-            public PhysicalAvatarEventListBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)bytes[i++];
-                    _typedata = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _typedata, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(TypeData == null) { Console.WriteLine("Warning: TypeData is null, in " + this.GetType()); }
-                bytes[i++] = (byte)TypeData.Length;
-                Buffer.BlockCopy(TypeData, 0, bytes, i, TypeData.Length); i += TypeData.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- PhysicalAvatarEventList --");
-                Helpers.FieldToString(output, TypeData, "TypeData");
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarAnimation; } }
-        public SenderBlock Sender;
-        public AnimationListBlock[] AnimationList;
-        public AnimationSourceListBlock[] AnimationSourceList;
-        public PhysicalAvatarEventListBlock[] PhysicalAvatarEventList;
-
-        public AvatarAnimationPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 20;
-            Header.Reliable = true;
-            Sender = new SenderBlock();
-            AnimationList = new AnimationListBlock[0];
-            AnimationSourceList = new AnimationSourceListBlock[0];
-            PhysicalAvatarEventList = new PhysicalAvatarEventListBlock[0];
-        }
-
-        public AvatarAnimationPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Sender.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(AnimationList.Length < count) {
-                AnimationList = new AnimationListBlock[count];
-                for(int j = 0; j < count; j++) AnimationList[j] = new AnimationListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AnimationList[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(AnimationSourceList.Length < count) {
-                AnimationSourceList = new AnimationSourceListBlock[count];
-                for(int j = 0; j < count; j++) AnimationSourceList[j] = new AnimationSourceListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AnimationSourceList[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(PhysicalAvatarEventList.Length < count) {
-                PhysicalAvatarEventList = new PhysicalAvatarEventListBlock[count];
-                for(int j = 0; j < count; j++) PhysicalAvatarEventList[j] = new PhysicalAvatarEventListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { PhysicalAvatarEventList[j].FromBytes(bytes, ref i); }
-        }
-
-        public AvatarAnimationPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            Sender.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(AnimationList.Length < count) {
-                AnimationList = new AnimationListBlock[count];
-                for(int j = 0; j < count; j++) AnimationList[j] = new AnimationListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AnimationList[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(AnimationSourceList.Length < count) {
-                AnimationSourceList = new AnimationSourceListBlock[count];
-                for(int j = 0; j < count; j++) AnimationSourceList[j] = new AnimationSourceListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AnimationSourceList[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(PhysicalAvatarEventList.Length < count) {
-                PhysicalAvatarEventList = new PhysicalAvatarEventListBlock[count];
-                for(int j = 0; j < count; j++) PhysicalAvatarEventList[j] = new PhysicalAvatarEventListBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { PhysicalAvatarEventList[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += Sender.Length;;
-            length++;
-            for (int j = 0; j < AnimationList.Length; j++) { length += AnimationList[j].Length; }
-            length++;
-            for (int j = 0; j < AnimationSourceList.Length; j++) { length += AnimationSourceList[j].Length; }
-            length++;
-            for (int j = 0; j < PhysicalAvatarEventList.Length; j++) { length += PhysicalAvatarEventList[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            Sender.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)AnimationList.Length;
-            for (int j = 0; j < AnimationList.Length; j++) { AnimationList[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)AnimationSourceList.Length;
-            for (int j = 0; j < AnimationSourceList.Length; j++) { AnimationSourceList[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)PhysicalAvatarEventList.Length;
-            for (int j = 0; j < PhysicalAvatarEventList.Length; j++) { PhysicalAvatarEventList[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarAnimation ---" + Environment.NewLine;
-                output += Sender.ToString() + Environment.NewLine;
-            for (int j = 0; j < AnimationList.Length; j++)
-            {
-                output += AnimationList[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < AnimationSourceList.Length; j++)
-            {
-                output += AnimationSourceList[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < PhysicalAvatarEventList.Length; j++)
-            {
-                output += PhysicalAvatarEventList[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class AvatarSitResponsePacket : Packet
-    {
-        /// <exclude/>
-        public class SitObjectBlock
-        {
-            public LLUUID ID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public SitObjectBlock() { }
-            public SitObjectBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(ID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SitObject --");
-                output.Append(String.Format("ID: {0}", ID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class SitTransformBlock
-        {
-            public bool AutoPilot;
-            public LLVector3 SitPosition;
-            public LLQuaternion SitRotation;
-            public LLVector3 CameraEyeOffset;
-            public LLVector3 CameraAtOffset;
-            public bool ForceMouselook;
-
-            public int Length
-            {
-                get
-                {
-                    return 50;
-                }
-            }
-
-            public SitTransformBlock() { }
-            public SitTransformBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    AutoPilot = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    SitPosition.FromBytes(bytes, i); i += 12;
-                    SitRotation.FromBytes(bytes, i, true); i += 12;
-                    CameraEyeOffset.FromBytes(bytes, i); i += 12;
-                    CameraAtOffset.FromBytes(bytes, i); i += 12;
-                    ForceMouselook = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((AutoPilot) ? 1 : 0);
-                Buffer.BlockCopy(SitPosition.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(SitRotation.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(CameraEyeOffset.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(CameraAtOffset.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)((ForceMouselook) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SitTransform --");
-                output.AppendLine(String.Format("AutoPilot: {0}", AutoPilot));
-                output.AppendLine(String.Format("SitPosition: {0}", SitPosition));
-                output.AppendLine(String.Format("SitRotation: {0}", SitRotation));
-                output.AppendLine(String.Format("CameraEyeOffset: {0}", CameraEyeOffset));
-                output.AppendLine(String.Format("CameraAtOffset: {0}", CameraAtOffset));
-                output.Append(String.Format("ForceMouselook: {0}", ForceMouselook));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.AvatarSitResponse; } }
-        public SitObjectBlock SitObject;
-        public SitTransformBlock SitTransform;
-
-        public AvatarSitResponsePacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 21;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            SitObject = new SitObjectBlock();
-            SitTransform = new SitTransformBlock();
-        }
-
-        public AvatarSitResponsePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            SitObject.FromBytes(bytes, ref i);
-            SitTransform.FromBytes(bytes, ref i);
-        }
-
-        public AvatarSitResponsePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            SitObject.FromBytes(bytes, ref i);
-            SitTransform.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += SitObject.Length;            length += SitTransform.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            SitObject.ToBytes(bytes, ref i);
-            SitTransform.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- AvatarSitResponse ---" + Environment.NewLine;
-                output += SitObject.ToString() + Environment.NewLine;
-                output += SitTransform.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class CameraConstraintPacket : Packet
-    {
-        /// <exclude/>
-        public class CameraCollidePlaneBlock
-        {
-            public LLVector4 Plane;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public CameraCollidePlaneBlock() { }
-            public CameraCollidePlaneBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Plane.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(Plane.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- CameraCollidePlane --");
-                output.Append(String.Format("Plane: {0}", Plane));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.CameraConstraint; } }
-        public CameraCollidePlaneBlock CameraCollidePlane;
-
-        public CameraConstraintPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 22;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            CameraCollidePlane = new CameraCollidePlaneBlock();
-        }
-
-        public CameraConstraintPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            CameraCollidePlane.FromBytes(bytes, ref i);
-        }
-
-        public CameraConstraintPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            CameraCollidePlane.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += CameraCollidePlane.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            CameraCollidePlane.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- CameraConstraint ---" + Environment.NewLine;
-                output += CameraCollidePlane.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ParcelPropertiesPacket : Packet
-    {
-        /// <exclude/>
-        public class ParcelDataBlock
-        {
-            public int RequestResult;
-            public int SequenceID;
-            public bool SnapSelection;
-            public int SelfCount;
-            public int OtherCount;
-            public int PublicCount;
-            public int LocalID;
-            public LLUUID OwnerID;
-            public bool IsGroupOwned;
-            public uint AuctionID;
-            public int ClaimDate;
-            public int ClaimPrice;
-            public int RentPrice;
-            public LLVector3 AABBMin;
-            public LLVector3 AABBMax;
-            private byte[] _bitmap;
-            public byte[] Bitmap
-            {
-                get { return _bitmap; }
-                set
-                {
-                    if (value == null) { _bitmap = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _bitmap = new byte[value.Length]; Buffer.BlockCopy(value, 0, _bitmap, 0, value.Length); }
-                }
-            }
-            public int Area;
-            public byte Status;
-            public int SimWideMaxPrims;
-            public int SimWideTotalPrims;
-            public int MaxPrims;
-            public int TotalPrims;
-            public int OwnerPrims;
-            public int GroupPrims;
-            public int OtherPrims;
-            public int SelectedPrims;
-            public float ParcelPrimBonus;
-            public int OtherCleanTime;
-            public uint ParcelFlags;
-            public int SalePrice;
-            private byte[] _name;
-            public byte[] Name
-            {
-                get { return _name; }
-                set
-                {
-                    if (value == null) { _name = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _name = new byte[value.Length]; Buffer.BlockCopy(value, 0, _name, 0, value.Length); }
-                }
-            }
-            private byte[] _desc;
-            public byte[] Desc
-            {
-                get { return _desc; }
-                set
-                {
-                    if (value == null) { _desc = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _desc = new byte[value.Length]; Buffer.BlockCopy(value, 0, _desc, 0, value.Length); }
-                }
-            }
-            private byte[] _musicurl;
-            public byte[] MusicURL
-            {
-                get { return _musicurl; }
-                set
-                {
-                    if (value == null) { _musicurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _musicurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _musicurl, 0, value.Length); }
-                }
-            }
-            private byte[] _mediaurl;
-            public byte[] MediaURL
-            {
-                get { return _mediaurl; }
-                set
-                {
-                    if (value == null) { _mediaurl = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _mediaurl = new byte[value.Length]; Buffer.BlockCopy(value, 0, _mediaurl, 0, value.Length); }
-                }
-            }
-            public LLUUID MediaID;
-            public byte MediaAutoScale;
-            public LLUUID GroupID;
-            public int PassPrice;
-            public float PassHours;
-            public byte Category;
-            public LLUUID AuthBuyerID;
-            public LLUUID SnapshotID;
-            public LLVector3 UserLocation;
-            public LLVector3 UserLookAt;
-            public byte LandingType;
-            public bool RegionPushOverride;
-            public bool RegionDenyAnonymous;
-            public bool RegionDenyIdentified;
-            public bool RegionDenyTransacted;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 238;
-                    if (Bitmap != null) { length += 2 + Bitmap.Length; }
-                    if (Name != null) { length += 1 + Name.Length; }
-                    if (Desc != null) { length += 1 + Desc.Length; }
-                    if (MusicURL != null) { length += 1 + MusicURL.Length; }
-                    if (MediaURL != null) { length += 1 + MediaURL.Length; }
-                    return length;
-                }
-            }
-
-            public ParcelDataBlock() { }
-            public ParcelDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RequestResult = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SequenceID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SnapSelection = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    SelfCount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OtherCount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    PublicCount = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    LocalID = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    IsGroupOwned = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    AuctionID = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ClaimDate = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ClaimPrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    RentPrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    AABBMin.FromBytes(bytes, i); i += 12;
-                    AABBMax.FromBytes(bytes, i); i += 12;
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _bitmap = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _bitmap, 0, length); i += length;
-                    Area = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    Status = (byte)bytes[i++];
-                    SimWideMaxPrims = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SimWideTotalPrims = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    MaxPrims = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    TotalPrims = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OwnerPrims = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    GroupPrims = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    OtherPrims = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SelectedPrims = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    ParcelPrimBonus = BitConverter.ToSingle(bytes, i); i += 4;
-                    OtherCleanTime = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    ParcelFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    SalePrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    length = (ushort)bytes[i++];
-                    _name = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _name, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _desc = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _desc, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _musicurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _musicurl, 0, length); i += length;
-                    length = (ushort)bytes[i++];
-                    _mediaurl = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _mediaurl, 0, length); i += length;
-                    MediaID.FromBytes(bytes, i); i += 16;
-                    MediaAutoScale = (byte)bytes[i++];
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    PassPrice = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    PassHours = BitConverter.ToSingle(bytes, i); i += 4;
-                    Category = (byte)bytes[i++];
-                    AuthBuyerID.FromBytes(bytes, i); i += 16;
-                    SnapshotID.FromBytes(bytes, i); i += 16;
-                    UserLocation.FromBytes(bytes, i); i += 12;
-                    UserLookAt.FromBytes(bytes, i); i += 12;
-                    LandingType = (byte)bytes[i++];
-                    RegionPushOverride = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RegionDenyAnonymous = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RegionDenyIdentified = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    RegionDenyTransacted = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(RequestResult % 256);
-                bytes[i++] = (byte)((RequestResult >> 8) % 256);
-                bytes[i++] = (byte)((RequestResult >> 16) % 256);
-                bytes[i++] = (byte)((RequestResult >> 24) % 256);
-                bytes[i++] = (byte)(SequenceID % 256);
-                bytes[i++] = (byte)((SequenceID >> 8) % 256);
-                bytes[i++] = (byte)((SequenceID >> 16) % 256);
-                bytes[i++] = (byte)((SequenceID >> 24) % 256);
-                bytes[i++] = (byte)((SnapSelection) ? 1 : 0);
-                bytes[i++] = (byte)(SelfCount % 256);
-                bytes[i++] = (byte)((SelfCount >> 8) % 256);
-                bytes[i++] = (byte)((SelfCount >> 16) % 256);
-                bytes[i++] = (byte)((SelfCount >> 24) % 256);
-                bytes[i++] = (byte)(OtherCount % 256);
-                bytes[i++] = (byte)((OtherCount >> 8) % 256);
-                bytes[i++] = (byte)((OtherCount >> 16) % 256);
-                bytes[i++] = (byte)((OtherCount >> 24) % 256);
-                bytes[i++] = (byte)(PublicCount % 256);
-                bytes[i++] = (byte)((PublicCount >> 8) % 256);
-                bytes[i++] = (byte)((PublicCount >> 16) % 256);
-                bytes[i++] = (byte)((PublicCount >> 24) % 256);
-                bytes[i++] = (byte)(LocalID % 256);
-                bytes[i++] = (byte)((LocalID >> 8) % 256);
-                bytes[i++] = (byte)((LocalID >> 16) % 256);
-                bytes[i++] = (byte)((LocalID >> 24) % 256);
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)((IsGroupOwned) ? 1 : 0);
-                bytes[i++] = (byte)(AuctionID % 256);
-                bytes[i++] = (byte)((AuctionID >> 8) % 256);
-                bytes[i++] = (byte)((AuctionID >> 16) % 256);
-                bytes[i++] = (byte)((AuctionID >> 24) % 256);
-                bytes[i++] = (byte)(ClaimDate % 256);
-                bytes[i++] = (byte)((ClaimDate >> 8) % 256);
-                bytes[i++] = (byte)((ClaimDate >> 16) % 256);
-                bytes[i++] = (byte)((ClaimDate >> 24) % 256);
-                bytes[i++] = (byte)(ClaimPrice % 256);
-                bytes[i++] = (byte)((ClaimPrice >> 8) % 256);
-                bytes[i++] = (byte)((ClaimPrice >> 16) % 256);
-                bytes[i++] = (byte)((ClaimPrice >> 24) % 256);
-                bytes[i++] = (byte)(RentPrice % 256);
-                bytes[i++] = (byte)((RentPrice >> 8) % 256);
-                bytes[i++] = (byte)((RentPrice >> 16) % 256);
-                bytes[i++] = (byte)((RentPrice >> 24) % 256);
-                Buffer.BlockCopy(AABBMin.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(AABBMax.GetBytes(), 0, bytes, i, 12); i += 12;
-                if(Bitmap == null) { Console.WriteLine("Warning: Bitmap is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(Bitmap.Length % 256);
-                bytes[i++] = (byte)((Bitmap.Length >> 8) % 256);
-                Buffer.BlockCopy(Bitmap, 0, bytes, i, Bitmap.Length); i += Bitmap.Length;
-                bytes[i++] = (byte)(Area % 256);
-                bytes[i++] = (byte)((Area >> 8) % 256);
-                bytes[i++] = (byte)((Area >> 16) % 256);
-                bytes[i++] = (byte)((Area >> 24) % 256);
-                bytes[i++] = Status;
-                bytes[i++] = (byte)(SimWideMaxPrims % 256);
-                bytes[i++] = (byte)((SimWideMaxPrims >> 8) % 256);
-                bytes[i++] = (byte)((SimWideMaxPrims >> 16) % 256);
-                bytes[i++] = (byte)((SimWideMaxPrims >> 24) % 256);
-                bytes[i++] = (byte)(SimWideTotalPrims % 256);
-                bytes[i++] = (byte)((SimWideTotalPrims >> 8) % 256);
-                bytes[i++] = (byte)((SimWideTotalPrims >> 16) % 256);
-                bytes[i++] = (byte)((SimWideTotalPrims >> 24) % 256);
-                bytes[i++] = (byte)(MaxPrims % 256);
-                bytes[i++] = (byte)((MaxPrims >> 8) % 256);
-                bytes[i++] = (byte)((MaxPrims >> 16) % 256);
-                bytes[i++] = (byte)((MaxPrims >> 24) % 256);
-                bytes[i++] = (byte)(TotalPrims % 256);
-                bytes[i++] = (byte)((TotalPrims >> 8) % 256);
-                bytes[i++] = (byte)((TotalPrims >> 16) % 256);
-                bytes[i++] = (byte)((TotalPrims >> 24) % 256);
-                bytes[i++] = (byte)(OwnerPrims % 256);
-                bytes[i++] = (byte)((OwnerPrims >> 8) % 256);
-                bytes[i++] = (byte)((OwnerPrims >> 16) % 256);
-                bytes[i++] = (byte)((OwnerPrims >> 24) % 256);
-                bytes[i++] = (byte)(GroupPrims % 256);
-                bytes[i++] = (byte)((GroupPrims >> 8) % 256);
-                bytes[i++] = (byte)((GroupPrims >> 16) % 256);
-                bytes[i++] = (byte)((GroupPrims >> 24) % 256);
-                bytes[i++] = (byte)(OtherPrims % 256);
-                bytes[i++] = (byte)((OtherPrims >> 8) % 256);
-                bytes[i++] = (byte)((OtherPrims >> 16) % 256);
-                bytes[i++] = (byte)((OtherPrims >> 24) % 256);
-                bytes[i++] = (byte)(SelectedPrims % 256);
-                bytes[i++] = (byte)((SelectedPrims >> 8) % 256);
-                bytes[i++] = (byte)((SelectedPrims >> 16) % 256);
-                bytes[i++] = (byte)((SelectedPrims >> 24) % 256);
-                ba = BitConverter.GetBytes(ParcelPrimBonus);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = (byte)(OtherCleanTime % 256);
-                bytes[i++] = (byte)((OtherCleanTime >> 8) % 256);
-                bytes[i++] = (byte)((OtherCleanTime >> 16) % 256);
-                bytes[i++] = (byte)((OtherCleanTime >> 24) % 256);
-                bytes[i++] = (byte)(ParcelFlags % 256);
-                bytes[i++] = (byte)((ParcelFlags >> 8) % 256);
-                bytes[i++] = (byte)((ParcelFlags >> 16) % 256);
-                bytes[i++] = (byte)((ParcelFlags >> 24) % 256);
-                bytes[i++] = (byte)(SalePrice % 256);
-                bytes[i++] = (byte)((SalePrice >> 8) % 256);
-                bytes[i++] = (byte)((SalePrice >> 16) % 256);
-                bytes[i++] = (byte)((SalePrice >> 24) % 256);
-                if(Name == null) { Console.WriteLine("Warning: Name is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Name.Length;
-                Buffer.BlockCopy(Name, 0, bytes, i, Name.Length); i += Name.Length;
-                if(Desc == null) { Console.WriteLine("Warning: Desc is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Desc.Length;
-                Buffer.BlockCopy(Desc, 0, bytes, i, Desc.Length); i += Desc.Length;
-                if(MusicURL == null) { Console.WriteLine("Warning: MusicURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MusicURL.Length;
-                Buffer.BlockCopy(MusicURL, 0, bytes, i, MusicURL.Length); i += MusicURL.Length;
-                if(MediaURL == null) { Console.WriteLine("Warning: MediaURL is null, in " + this.GetType()); }
-                bytes[i++] = (byte)MediaURL.Length;
-                Buffer.BlockCopy(MediaURL, 0, bytes, i, MediaURL.Length); i += MediaURL.Length;
-                Buffer.BlockCopy(MediaID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = MediaAutoScale;
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(PassPrice % 256);
-                bytes[i++] = (byte)((PassPrice >> 8) % 256);
-                bytes[i++] = (byte)((PassPrice >> 16) % 256);
-                bytes[i++] = (byte)((PassPrice >> 24) % 256);
-                ba = BitConverter.GetBytes(PassHours);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = Category;
-                Buffer.BlockCopy(AuthBuyerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SnapshotID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(UserLocation.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(UserLookAt.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = LandingType;
-                bytes[i++] = (byte)((RegionPushOverride) ? 1 : 0);
-                bytes[i++] = (byte)((RegionDenyAnonymous) ? 1 : 0);
-                bytes[i++] = (byte)((RegionDenyIdentified) ? 1 : 0);
-                bytes[i++] = (byte)((RegionDenyTransacted) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- ParcelData --");
-                output.AppendLine(String.Format("RequestResult: {0}", RequestResult));
-                output.AppendLine(String.Format("SequenceID: {0}", SequenceID));
-                output.AppendLine(String.Format("SnapSelection: {0}", SnapSelection));
-                output.AppendLine(String.Format("SelfCount: {0}", SelfCount));
-                output.AppendLine(String.Format("OtherCount: {0}", OtherCount));
-                output.AppendLine(String.Format("PublicCount: {0}", PublicCount));
-                output.AppendLine(String.Format("LocalID: {0}", LocalID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("IsGroupOwned: {0}", IsGroupOwned));
-                output.AppendLine(String.Format("AuctionID: {0}", AuctionID));
-                output.AppendLine(String.Format("ClaimDate: {0}", ClaimDate));
-                output.AppendLine(String.Format("ClaimPrice: {0}", ClaimPrice));
-                output.AppendLine(String.Format("RentPrice: {0}", RentPrice));
-                output.AppendLine(String.Format("AABBMin: {0}", AABBMin));
-                output.AppendLine(String.Format("AABBMax: {0}", AABBMax));
-                Helpers.FieldToString(output, Bitmap, "Bitmap");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("Area: {0}", Area));
-                output.AppendLine(String.Format("Status: {0}", Status));
-                output.AppendLine(String.Format("SimWideMaxPrims: {0}", SimWideMaxPrims));
-                output.AppendLine(String.Format("SimWideTotalPrims: {0}", SimWideTotalPrims));
-                output.AppendLine(String.Format("MaxPrims: {0}", MaxPrims));
-                output.AppendLine(String.Format("TotalPrims: {0}", TotalPrims));
-                output.AppendLine(String.Format("OwnerPrims: {0}", OwnerPrims));
-                output.AppendLine(String.Format("GroupPrims: {0}", GroupPrims));
-                output.AppendLine(String.Format("OtherPrims: {0}", OtherPrims));
-                output.AppendLine(String.Format("SelectedPrims: {0}", SelectedPrims));
-                output.AppendLine(String.Format("ParcelPrimBonus: {0}", ParcelPrimBonus));
-                output.AppendLine(String.Format("OtherCleanTime: {0}", OtherCleanTime));
-                output.AppendLine(String.Format("ParcelFlags: {0}", ParcelFlags));
-                output.AppendLine(String.Format("SalePrice: {0}", SalePrice));
-                Helpers.FieldToString(output, Name, "Name");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, Desc, "Desc");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, MusicURL, "MusicURL");
-                output.Append(Environment.NewLine);
-                Helpers.FieldToString(output, MediaURL, "MediaURL");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("MediaID: {0}", MediaID));
-                output.AppendLine(String.Format("MediaAutoScale: {0}", MediaAutoScale));
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("PassPrice: {0}", PassPrice));
-                output.AppendLine(String.Format("PassHours: {0}", PassHours));
-                output.AppendLine(String.Format("Category: {0}", Category));
-                output.AppendLine(String.Format("AuthBuyerID: {0}", AuthBuyerID));
-                output.AppendLine(String.Format("SnapshotID: {0}", SnapshotID));
-                output.AppendLine(String.Format("UserLocation: {0}", UserLocation));
-                output.AppendLine(String.Format("UserLookAt: {0}", UserLookAt));
-                output.AppendLine(String.Format("LandingType: {0}", LandingType));
-                output.AppendLine(String.Format("RegionPushOverride: {0}", RegionPushOverride));
-                output.AppendLine(String.Format("RegionDenyAnonymous: {0}", RegionDenyAnonymous));
-                output.AppendLine(String.Format("RegionDenyIdentified: {0}", RegionDenyIdentified));
-                output.Append(String.Format("RegionDenyTransacted: {0}", RegionDenyTransacted));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AgeVerificationBlockBlock
-        {
-            public bool RegionDenyAgeUnverified;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public AgeVerificationBlockBlock() { }
-            public AgeVerificationBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionDenyAgeUnverified = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)((RegionDenyAgeUnverified) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgeVerificationBlock --");
-                output.Append(String.Format("RegionDenyAgeUnverified: {0}", RegionDenyAgeUnverified));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ParcelProperties; } }
-        public ParcelDataBlock ParcelData;
-        public AgeVerificationBlockBlock AgeVerificationBlock;
-
-        public ParcelPropertiesPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 23;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            ParcelData = new ParcelDataBlock();
-            AgeVerificationBlock = new AgeVerificationBlockBlock();
-        }
-
-        public ParcelPropertiesPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ParcelData.FromBytes(bytes, ref i);
-            AgeVerificationBlock.FromBytes(bytes, ref i);
-        }
-
-        public ParcelPropertiesPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            ParcelData.FromBytes(bytes, ref i);
-            AgeVerificationBlock.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += ParcelData.Length;            length += AgeVerificationBlock.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            ParcelData.ToBytes(bytes, ref i);
-            AgeVerificationBlock.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ParcelProperties ---" + Environment.NewLine;
-                output += ParcelData.ToString() + Environment.NewLine;
-                output += AgeVerificationBlock.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChildAgentUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public ulong RegionHandle;
-            public uint ViewerCircuitCode;
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLVector3 AgentPos;
-            public LLVector3 AgentVel;
-            public LLVector3 Center;
-            public LLVector3 Size;
-            public LLVector3 AtAxis;
-            public LLVector3 LeftAxis;
-            public LLVector3 UpAxis;
-            public bool ChangedGrid;
-            public float Far;
-            public float Aspect;
-            private byte[] _throttles;
-            public byte[] Throttles
-            {
-                get { return _throttles; }
-                set
-                {
-                    if (value == null) { _throttles = null; return; }
-                    if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
-                    else { _throttles = new byte[value.Length]; Buffer.BlockCopy(value, 0, _throttles, 0, value.Length); }
-                }
-            }
-            public uint LocomotionState;
-            public LLQuaternion HeadRotation;
-            public LLQuaternion BodyRotation;
-            public uint ControlFlags;
-            public float EnergyLevel;
-            public byte GodLevel;
-            public bool AlwaysRun;
-            public LLUUID PreyAgent;
-            public byte AgentAccess;
-            private byte[] _agenttextures;
-            public byte[] AgentTextures
-            {
-                get { return _agenttextures; }
-                set
-                {
-                    if (value == null) { _agenttextures = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _agenttextures = new byte[value.Length]; Buffer.BlockCopy(value, 0, _agenttextures, 0, value.Length); }
-                }
-            }
-            public LLUUID ActiveGroupID;
-
-            public int Length
-            {
-                get
-                {
-                    int length = 208;
-                    if (Throttles != null) { length += 1 + Throttles.Length; }
-                    if (AgentTextures != null) { length += 2 + AgentTextures.Length; }
-                    return length;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    ViewerCircuitCode = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    AgentPos.FromBytes(bytes, i); i += 12;
-                    AgentVel.FromBytes(bytes, i); i += 12;
-                    Center.FromBytes(bytes, i); i += 12;
-                    Size.FromBytes(bytes, i); i += 12;
-                    AtAxis.FromBytes(bytes, i); i += 12;
-                    LeftAxis.FromBytes(bytes, i); i += 12;
-                    UpAxis.FromBytes(bytes, i); i += 12;
-                    ChangedGrid = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Far = BitConverter.ToSingle(bytes, i); i += 4;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Aspect = BitConverter.ToSingle(bytes, i); i += 4;
-                    length = (ushort)bytes[i++];
-                    _throttles = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _throttles, 0, length); i += length;
-                    LocomotionState = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    HeadRotation.FromBytes(bytes, i, true); i += 12;
-                    BodyRotation.FromBytes(bytes, i, true); i += 12;
-                    ControlFlags = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    EnergyLevel = BitConverter.ToSingle(bytes, i); i += 4;
-                    GodLevel = (byte)bytes[i++];
-                    AlwaysRun = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                    PreyAgent.FromBytes(bytes, i); i += 16;
-                    AgentAccess = (byte)bytes[i++];
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _agenttextures = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _agenttextures, 0, length); i += length;
-                    ActiveGroupID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = (byte)(ViewerCircuitCode % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 8) % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 16) % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 24) % 256);
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AgentPos.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(AgentVel.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Center.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Size.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(AtAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LeftAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(UpAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)((ChangedGrid) ? 1 : 0);
-                ba = BitConverter.GetBytes(Far);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                ba = BitConverter.GetBytes(Aspect);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                if(Throttles == null) { Console.WriteLine("Warning: Throttles is null, in " + this.GetType()); }
-                bytes[i++] = (byte)Throttles.Length;
-                Buffer.BlockCopy(Throttles, 0, bytes, i, Throttles.Length); i += Throttles.Length;
-                bytes[i++] = (byte)(LocomotionState % 256);
-                bytes[i++] = (byte)((LocomotionState >> 8) % 256);
-                bytes[i++] = (byte)((LocomotionState >> 16) % 256);
-                bytes[i++] = (byte)((LocomotionState >> 24) % 256);
-                Buffer.BlockCopy(HeadRotation.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(BodyRotation.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)(ControlFlags % 256);
-                bytes[i++] = (byte)((ControlFlags >> 8) % 256);
-                bytes[i++] = (byte)((ControlFlags >> 16) % 256);
-                bytes[i++] = (byte)((ControlFlags >> 24) % 256);
-                ba = BitConverter.GetBytes(EnergyLevel);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-                bytes[i++] = GodLevel;
-                bytes[i++] = (byte)((AlwaysRun) ? 1 : 0);
-                Buffer.BlockCopy(PreyAgent.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = AgentAccess;
-                if(AgentTextures == null) { Console.WriteLine("Warning: AgentTextures is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(AgentTextures.Length % 256);
-                bytes[i++] = (byte)((AgentTextures.Length >> 8) % 256);
-                Buffer.BlockCopy(AgentTextures, 0, bytes, i, AgentTextures.Length); i += AgentTextures.Length;
-                Buffer.BlockCopy(ActiveGroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.AppendLine(String.Format("ViewerCircuitCode: {0}", ViewerCircuitCode));
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("AgentPos: {0}", AgentPos));
-                output.AppendLine(String.Format("AgentVel: {0}", AgentVel));
-                output.AppendLine(String.Format("Center: {0}", Center));
-                output.AppendLine(String.Format("Size: {0}", Size));
-                output.AppendLine(String.Format("AtAxis: {0}", AtAxis));
-                output.AppendLine(String.Format("LeftAxis: {0}", LeftAxis));
-                output.AppendLine(String.Format("UpAxis: {0}", UpAxis));
-                output.AppendLine(String.Format("ChangedGrid: {0}", ChangedGrid));
-                output.AppendLine(String.Format("Far: {0}", Far));
-                output.AppendLine(String.Format("Aspect: {0}", Aspect));
-                Helpers.FieldToString(output, Throttles, "Throttles");
-                output.Append(Environment.NewLine);
-                output.AppendLine(String.Format("LocomotionState: {0}", LocomotionState));
-                output.AppendLine(String.Format("HeadRotation: {0}", HeadRotation));
-                output.AppendLine(String.Format("BodyRotation: {0}", BodyRotation));
-                output.AppendLine(String.Format("ControlFlags: {0}", ControlFlags));
-                output.AppendLine(String.Format("EnergyLevel: {0}", EnergyLevel));
-                output.AppendLine(String.Format("GodLevel: {0}", GodLevel));
-                output.AppendLine(String.Format("AlwaysRun: {0}", AlwaysRun));
-                output.AppendLine(String.Format("PreyAgent: {0}", PreyAgent));
-                output.AppendLine(String.Format("AgentAccess: {0}", AgentAccess));
-                Helpers.FieldToString(output, AgentTextures, "AgentTextures");
-                output.Append(Environment.NewLine);
-                output.Append(String.Format("ActiveGroupID: {0}", ActiveGroupID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GroupDataBlock
-        {
-            public LLUUID GroupID;
-            public ulong GroupPowers;
-            public bool AcceptNotices;
-
-            public int Length
-            {
-                get
-                {
-                    return 25;
-                }
-            }
-
-            public GroupDataBlock() { }
-            public GroupDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GroupID.FromBytes(bytes, i); i += 16;
-                    GroupPowers = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    AcceptNotices = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GroupID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(GroupPowers % 256);
-                bytes[i++] = (byte)((GroupPowers >> 8) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 16) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 24) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 32) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 40) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 48) % 256);
-                bytes[i++] = (byte)((GroupPowers >> 56) % 256);
-                bytes[i++] = (byte)((AcceptNotices) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GroupData --");
-                output.AppendLine(String.Format("GroupID: {0}", GroupID));
-                output.AppendLine(String.Format("GroupPowers: {0}", GroupPowers));
-                output.Append(String.Format("AcceptNotices: {0}", AcceptNotices));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class AnimationDataBlock
-        {
-            public LLUUID Animation;
-            public LLUUID ObjectID;
-
-            public int Length
-            {
-                get
-                {
-                    return 32;
-                }
-            }
-
-            public AnimationDataBlock() { }
-            public AnimationDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    Animation.FromBytes(bytes, i); i += 16;
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(Animation.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AnimationData --");
-                output.AppendLine(String.Format("Animation: {0}", Animation));
-                output.Append(String.Format("ObjectID: {0}", ObjectID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class GranterBlockBlock
-        {
-            public LLUUID GranterID;
-
-            public int Length
-            {
-                get
-                {
-                    return 16;
-                }
-            }
-
-            public GranterBlockBlock() { }
-            public GranterBlockBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    GranterID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                Buffer.BlockCopy(GranterID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- GranterBlock --");
-                output.Append(String.Format("GranterID: {0}", GranterID));
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class NVPairDataBlock
-        {
-            private byte[] _nvpairs;
-            public byte[] NVPairs
-            {
-                get { return _nvpairs; }
-                set
-                {
-                    if (value == null) { _nvpairs = null; return; }
-                    if (value.Length > 1100) { throw new OverflowException("Value exceeds 1100 characters"); }
-                    else { _nvpairs = new byte[value.Length]; Buffer.BlockCopy(value, 0, _nvpairs, 0, value.Length); }
-                }
-            }
-
-            public int Length
-            {
-                get
-                {
-                    int length = 0;
-                    if (NVPairs != null) { length += 2 + NVPairs.Length; }
-                    return length;
-                }
-            }
-
-            public NVPairDataBlock() { }
-            public NVPairDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                int length;
-                try
-                {
-                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));
-                    _nvpairs = new byte[length];
-                    Buffer.BlockCopy(bytes, i, _nvpairs, 0, length); i += length;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                if(NVPairs == null) { Console.WriteLine("Warning: NVPairs is null, in " + this.GetType()); }
-                bytes[i++] = (byte)(NVPairs.Length % 256);
-                bytes[i++] = (byte)((NVPairs.Length >> 8) % 256);
-                Buffer.BlockCopy(NVPairs, 0, bytes, i, NVPairs.Length); i += NVPairs.Length;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- NVPairData --");
-                Helpers.FieldToString(output, NVPairs, "NVPairs");
-                return output.ToString();
-            }
-        }
-
-        /// <exclude/>
-        public class VisualParamBlock
-        {
-            public byte ParamValue;
-
-            public int Length
-            {
-                get
-                {
-                    return 1;
-                }
-            }
-
-            public VisualParamBlock() { }
-            public VisualParamBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    ParamValue = (byte)bytes[i++];
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = ParamValue;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- VisualParam --");
-                output.Append(String.Format("ParamValue: {0}", ParamValue));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChildAgentUpdate; } }
-        public AgentDataBlock AgentData;
-        public GroupDataBlock[] GroupData;
-        public AnimationDataBlock[] AnimationData;
-        public GranterBlockBlock[] GranterBlock;
-        public NVPairDataBlock[] NVPairData;
-        public VisualParamBlock[] VisualParam;
-
-        public ChildAgentUpdatePacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 25;
-            Header.Reliable = true;
-            Header.Zerocoded = true;
-            AgentData = new AgentDataBlock();
-            GroupData = new GroupDataBlock[0];
-            AnimationData = new AnimationDataBlock[0];
-            GranterBlock = new GranterBlockBlock[0];
-            NVPairData = new NVPairDataBlock[0];
-            VisualParam = new VisualParamBlock[0];
-        }
-
-        public ChildAgentUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(GroupData.Length < count) {
-                GroupData = new GroupDataBlock[count];
-                for(int j = 0; j < count; j++) GroupData[j] = new GroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GroupData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(AnimationData.Length < count) {
-                AnimationData = new AnimationDataBlock[count];
-                for(int j = 0; j < count; j++) AnimationData[j] = new AnimationDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AnimationData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(GranterBlock.Length < count) {
-                GranterBlock = new GranterBlockBlock[count];
-                for(int j = 0; j < count; j++) GranterBlock[j] = new GranterBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GranterBlock[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(NVPairData.Length < count) {
-                NVPairData = new NVPairDataBlock[count];
-                for(int j = 0; j < count; j++) NVPairData[j] = new NVPairDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { NVPairData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(VisualParam.Length < count) {
-                VisualParam = new VisualParamBlock[count];
-                for(int j = 0; j < count; j++) VisualParam[j] = new VisualParamBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { VisualParam[j].FromBytes(bytes, ref i); }
-        }
-
-        public ChildAgentUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-            int count = (int)bytes[i++];
-            if(GroupData.Length < count) {
-                GroupData = new GroupDataBlock[count];
-                for(int j = 0; j < count; j++) GroupData[j] = new GroupDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GroupData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(AnimationData.Length < count) {
-                AnimationData = new AnimationDataBlock[count];
-                for(int j = 0; j < count; j++) AnimationData[j] = new AnimationDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { AnimationData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(GranterBlock.Length < count) {
-                GranterBlock = new GranterBlockBlock[count];
-                for(int j = 0; j < count; j++) GranterBlock[j] = new GranterBlockBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { GranterBlock[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(NVPairData.Length < count) {
-                NVPairData = new NVPairDataBlock[count];
-                for(int j = 0; j < count; j++) NVPairData[j] = new NVPairDataBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { NVPairData[j].FromBytes(bytes, ref i); }
-            count = (int)bytes[i++];
-            if(VisualParam.Length < count) {
-                VisualParam = new VisualParamBlock[count];
-                for(int j = 0; j < count; j++) VisualParam[j] = new VisualParamBlock();
-            }
-            for (int j = 0; j < count; j++)
-            { VisualParam[j].FromBytes(bytes, ref i); }
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += AgentData.Length;;
-            length++;
-            for (int j = 0; j < GroupData.Length; j++) { length += GroupData[j].Length; }
-            length++;
-            for (int j = 0; j < AnimationData.Length; j++) { length += AnimationData[j].Length; }
-            length++;
-            for (int j = 0; j < GranterBlock.Length; j++) { length += GranterBlock[j].Length; }
-            length++;
-            for (int j = 0; j < NVPairData.Length; j++) { length += NVPairData[j].Length; }
-            length++;
-            for (int j = 0; j < VisualParam.Length; j++) { length += VisualParam[j].Length; }
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            bytes[i++] = (byte)GroupData.Length;
-            for (int j = 0; j < GroupData.Length; j++) { GroupData[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)AnimationData.Length;
-            for (int j = 0; j < AnimationData.Length; j++) { AnimationData[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)GranterBlock.Length;
-            for (int j = 0; j < GranterBlock.Length; j++) { GranterBlock[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)NVPairData.Length;
-            for (int j = 0; j < NVPairData.Length; j++) { NVPairData[j].ToBytes(bytes, ref i); }
-            bytes[i++] = (byte)VisualParam.Length;
-            for (int j = 0; j < VisualParam.Length; j++) { VisualParam[j].ToBytes(bytes, ref i); }
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChildAgentUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            for (int j = 0; j < GroupData.Length; j++)
-            {
-                output += GroupData[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < AnimationData.Length; j++)
-            {
-                output += AnimationData[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < GranterBlock.Length; j++)
-            {
-                output += GranterBlock[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < NVPairData.Length; j++)
-            {
-                output += NVPairData[j].ToString() + Environment.NewLine;
-            }
-            for (int j = 0; j < VisualParam.Length; j++)
-            {
-                output += VisualParam[j].ToString() + Environment.NewLine;
-            }
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChildAgentAlivePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public ulong RegionHandle;
-            public uint ViewerCircuitCode;
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-
-            public int Length
-            {
-                get
-                {
-                    return 44;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    ViewerCircuitCode = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = (byte)(ViewerCircuitCode % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 8) % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 16) % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 24) % 256);
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.AppendLine(String.Format("ViewerCircuitCode: {0}", ViewerCircuitCode));
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.Append(String.Format("SessionID: {0}", SessionID));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChildAgentAlive; } }
-        public AgentDataBlock AgentData;
-
-        public ChildAgentAlivePacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 26;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public ChildAgentAlivePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public ChildAgentAlivePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChildAgentAlive ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class ChildAgentPositionUpdatePacket : Packet
-    {
-        /// <exclude/>
-        public class AgentDataBlock
-        {
-            public ulong RegionHandle;
-            public uint ViewerCircuitCode;
-            public LLUUID AgentID;
-            public LLUUID SessionID;
-            public LLVector3 AgentPos;
-            public LLVector3 AgentVel;
-            public LLVector3 Center;
-            public LLVector3 Size;
-            public LLVector3 AtAxis;
-            public LLVector3 LeftAxis;
-            public LLVector3 UpAxis;
-            public bool ChangedGrid;
-
-            public int Length
-            {
-                get
-                {
-                    return 129;
-                }
-            }
-
-            public AgentDataBlock() { }
-            public AgentDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    RegionHandle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    ViewerCircuitCode = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
-                    AgentID.FromBytes(bytes, i); i += 16;
-                    SessionID.FromBytes(bytes, i); i += 16;
-                    AgentPos.FromBytes(bytes, i); i += 12;
-                    AgentVel.FromBytes(bytes, i); i += 12;
-                    Center.FromBytes(bytes, i); i += 12;
-                    Size.FromBytes(bytes, i); i += 12;
-                    AtAxis.FromBytes(bytes, i); i += 12;
-                    LeftAxis.FromBytes(bytes, i); i += 12;
-                    UpAxis.FromBytes(bytes, i); i += 12;
-                    ChangedGrid = (bytes[i++] != 0) ? (bool)true : (bool)false;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                bytes[i++] = (byte)(RegionHandle % 256);
-                bytes[i++] = (byte)((RegionHandle >> 8) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 16) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 24) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 32) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 40) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 48) % 256);
-                bytes[i++] = (byte)((RegionHandle >> 56) % 256);
-                bytes[i++] = (byte)(ViewerCircuitCode % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 8) % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 16) % 256);
-                bytes[i++] = (byte)((ViewerCircuitCode >> 24) % 256);
-                Buffer.BlockCopy(AgentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(SessionID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(AgentPos.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(AgentVel.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Center.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(Size.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(AtAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(LeftAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                Buffer.BlockCopy(UpAxis.GetBytes(), 0, bytes, i, 12); i += 12;
-                bytes[i++] = (byte)((ChangedGrid) ? 1 : 0);
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- AgentData --");
-                output.AppendLine(String.Format("RegionHandle: {0}", RegionHandle));
-                output.AppendLine(String.Format("ViewerCircuitCode: {0}", ViewerCircuitCode));
-                output.AppendLine(String.Format("AgentID: {0}", AgentID));
-                output.AppendLine(String.Format("SessionID: {0}", SessionID));
-                output.AppendLine(String.Format("AgentPos: {0}", AgentPos));
-                output.AppendLine(String.Format("AgentVel: {0}", AgentVel));
-                output.AppendLine(String.Format("Center: {0}", Center));
-                output.AppendLine(String.Format("Size: {0}", Size));
-                output.AppendLine(String.Format("AtAxis: {0}", AtAxis));
-                output.AppendLine(String.Format("LeftAxis: {0}", LeftAxis));
-                output.AppendLine(String.Format("UpAxis: {0}", UpAxis));
-                output.Append(String.Format("ChangedGrid: {0}", ChangedGrid));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.ChildAgentPositionUpdate; } }
-        public AgentDataBlock AgentData;
-
-        public ChildAgentPositionUpdatePacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 27;
-            Header.Reliable = true;
-            AgentData = new AgentDataBlock();
-        }
-
-        public ChildAgentPositionUpdatePacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public ChildAgentPositionUpdatePacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            AgentData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += AgentData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            AgentData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- ChildAgentPositionUpdate ---" + Environment.NewLine;
-                output += AgentData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-    /// <exclude/>
-    public class SoundTriggerPacket : Packet
-    {
-        /// <exclude/>
-        public class SoundDataBlock
-        {
-            public LLUUID SoundID;
-            public LLUUID OwnerID;
-            public LLUUID ObjectID;
-            public LLUUID ParentID;
-            public ulong Handle;
-            public LLVector3 Position;
-            public float Gain;
-
-            public int Length
-            {
-                get
-                {
-                    return 88;
-                }
-            }
-
-            public SoundDataBlock() { }
-            public SoundDataBlock(byte[] bytes, ref int i)
-            {
-                FromBytes(bytes, ref i);
-            }
-
-            public void FromBytes(byte[] bytes, ref int i)
-            {
-                try
-                {
-                    SoundID.FromBytes(bytes, i); i += 16;
-                    OwnerID.FromBytes(bytes, i); i += 16;
-                    ObjectID.FromBytes(bytes, i); i += 16;
-                    ParentID.FromBytes(bytes, i); i += 16;
-                    Handle = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + ((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + ((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + ((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));
-                    Position.FromBytes(bytes, i); i += 12;
-                    if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);
-                    Gain = BitConverter.ToSingle(bytes, i); i += 4;
-                }
-                catch (Exception)
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            public void ToBytes(byte[] bytes, ref int i)
-            {
-                byte[] ba;
-                Buffer.BlockCopy(SoundID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ObjectID.GetBytes(), 0, bytes, i, 16); i += 16;
-                Buffer.BlockCopy(ParentID.GetBytes(), 0, bytes, i, 16); i += 16;
-                bytes[i++] = (byte)(Handle % 256);
-                bytes[i++] = (byte)((Handle >> 8) % 256);
-                bytes[i++] = (byte)((Handle >> 16) % 256);
-                bytes[i++] = (byte)((Handle >> 24) % 256);
-                bytes[i++] = (byte)((Handle >> 32) % 256);
-                bytes[i++] = (byte)((Handle >> 40) % 256);
-                bytes[i++] = (byte)((Handle >> 48) % 256);
-                bytes[i++] = (byte)((Handle >> 56) % 256);
-                Buffer.BlockCopy(Position.GetBytes(), 0, bytes, i, 12); i += 12;
-                ba = BitConverter.GetBytes(Gain);
-                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }
-                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;
-            }
-
-            public override string ToString()
-            {
-                StringBuilder output = new StringBuilder();
-                output.AppendLine("-- SoundData --");
-                output.AppendLine(String.Format("SoundID: {0}", SoundID));
-                output.AppendLine(String.Format("OwnerID: {0}", OwnerID));
-                output.AppendLine(String.Format("ObjectID: {0}", ObjectID));
-                output.AppendLine(String.Format("ParentID: {0}", ParentID));
-                output.AppendLine(String.Format("Handle: {0}", Handle));
-                output.AppendLine(String.Format("Position: {0}", Position));
-                output.Append(String.Format("Gain: {0}", Gain));
-                return output.ToString();
-            }
-        }
-
-        private Header header;
-        public override Header Header { get { return header; } set { header = value; } }
-        public override PacketType Type { get { return PacketType.SoundTrigger; } }
-        public SoundDataBlock SoundData;
-
-        public SoundTriggerPacket()
-        {
-            Header = new HighHeader();
-            Header.ID = 29;
-            Header.Reliable = true;
-            SoundData = new SoundDataBlock();
-        }
-
-        public SoundTriggerPacket(byte[] bytes, ref int i) : this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            header.FromBytes(bytes, ref i, ref packetEnd);
-            if (header.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            SoundData.FromBytes(bytes, ref i);
-        }
-
-        public SoundTriggerPacket(Header head, byte[] bytes, ref int i): this()
-        {
-            int packetEnd = bytes.Length - 1;
-            FromBytes(head, bytes, ref i, ref packetEnd, null);
-        }
-
-        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
-        {
-            Header = head;
-            if (head.Zerocoded && zeroBuffer != null)
-            {
-                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;
-                bytes = zeroBuffer;
-            }
-            SoundData.FromBytes(bytes, ref i);
-        }
-
-        public override byte[] ToBytes()
-        {
-            int length = 7;
-            length += SoundData.Length;;
-            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
-            byte[] bytes = new byte[length];
-            int i = 0;
-            header.ToBytes(bytes, ref i);
-            SoundData.ToBytes(bytes, ref i);
-            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
-            return bytes;
-        }
-
-        public override string ToString()
-        {
-            string output = "--- SoundTrigger ---" + Environment.NewLine;
-                output += SoundData.ToString() + Environment.NewLine;
-            return output;
-        }
-
-    }
-
-}
diff --git a/old/libsl1550/libsecondlife/_VisualParam_.cs b/old/libsl1550/libsecondlife/_VisualParam_.cs
deleted file mode 100644
index 980d19a..0000000
--- a/old/libsl1550/libsecondlife/_VisualParam_.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace libsecondlife
-{
-    /// <summary>
-    /// A single visual characteristic of an avatar mesh, such as eyebrow height
-    /// </summary>
-    public struct VisualParam
-    {
-        /// <summary>Index of this visual param</summary>
-        public int ParamID;
-        /// <summary>Internal name</summary>
-        public string Name;
-        /// <summary>Group ID this parameter belongs to</summary>
-        public int Group;
-        /// <summary>Name of the wearable this parameter belongs to</summary>
-        public string Wearable;
-        /// <summary>Displayable label of this characteristic</summary>
-        public string Label;
-        /// <summary>Displayable label for the minimum value of this characteristic</summary>
-        public string LabelMin;
-        /// <summary>Displayable label for the maximum value of this characteristic</summary>
-        public string LabelMax;
-        /// <summary>Default value</summary>
-        public float DefaultValue;
-        /// <summary>Minimum value</summary>
-        public float MinValue;
-        /// <summary>Maximum value</summary>
-        public float MaxValue;
-
-        /// <summary>
-        /// Set all the values through the constructor
-        /// </summary>
-        /// <param name="paramID">Index of this visual param</param>
-        /// <param name="name">Internal name</param>
-        /// <param name="group"></param>
-        /// <param name="wearable"></param>
-        /// <param name="label">Displayable label of this characteristic</param>
-        /// <param name="labelMin">Displayable label for the minimum value of this characteristic</param>
-        /// <param name="labelMax">Displayable label for the maximum value of this characteristic</param>
-        /// <param name="def">Default value</param>
-        /// <param name="min">Minimum value</param>
-        /// <param name="max">Maximum value</param>
-        public VisualParam(int paramID, string name, int group, string wearable, string label, string labelMin, string labelMax, float def, float min, float max)
-        {
-            ParamID = paramID;
-            Name = name;
-            Group = group;
-            Wearable = wearable;
-            Label = label;
-            LabelMin = labelMin;
-            LabelMax = labelMax;
-            DefaultValue = def;
-            MaxValue = max;
-            MinValue = min;
-        }
-    }
-
-    /// <summary>
-    /// Holds the Params array of all the avatar appearance parameters
-    /// </summary>
-    public static class VisualParams
-    {
-        public static VisualParam Find(string name, string wearable)
-        {
-          foreach (KeyValuePair<int,VisualParam> param in Params)
-            if (param.Value.Name == name && param.Value.Wearable == wearable)
-              return param.Value;
-
-          return new VisualParam();
-        }
-
-        public static SortedList<int, VisualParam> Params;
-
-        static VisualParams()
-        {
-            Params = new SortedList<int,VisualParam>();
-
-            Params[1] = new VisualParam(1, "Big_Brow", 0, "shape", "Brow Size", "Small", "Large", -0.3f, -0.3f, 2f);
-            Params[2] = new VisualParam(2, "Nose_Big_Out", 0, "shape", "Nose Size", "Small", "Large", -0.8f, -0.8f, 2.5f);
-            Params[4] = new VisualParam(4, "Broad_Nostrils", 0, "shape", "Nostril Width", "Narrow", "Broad", -0.5f, -0.5f, 1f);
-            Params[5] = new VisualParam(5, "Cleft_Chin", 0, "shape", "Chin Cleft", "Round", "Cleft", -0.1f, -0.1f, 1f);
-            Params[6] = new VisualParam(6, "Bulbous_Nose_Tip", 0, "shape", "Nose Tip Shape", "Pointy", "Bulbous", -0.3f, -0.3f, 1f);
-            Params[7] = new VisualParam(7, "Weak_Chin", 0, "shape", "Chin Angle", "Chin Out", "Chin In", -0.5f, -0.5f, 0.5f);
-            Params[8] = new VisualParam(8, "Double_Chin", 0, "shape", "Chin-Neck", "Tight Chin", "Double Chin", -0.5f, -0.5f, 1.5f);
-            Params[10] = new VisualParam(10, "Sunken_Cheeks", 0, "shape", "Lower Cheeks", "Well-Fed", "Sunken", -1.5f, -1.5f, 3f);
-            Params[11] = new VisualParam(11, "Noble_Nose_Bridge", 0, "shape", "Upper Bridge", "Low", "High", -0.5f, -0.5f, 1.5f);
-            Params[12] = new VisualParam(12, "Jowls", 0, "shape", "", "Less", "More", -0.5f, -0.5f, 2.5f);
-            Params[13] = new VisualParam(13, "Cleft_Chin_Upper", 0, "shape", "Upper Chin Cleft", "Round", "Cleft", 0f, 0f, 1.5f);
-            Params[14] = new VisualParam(14, "High_Cheek_Bones", 0, "shape", "Cheek Bones", "Low", "High", -0.5f, -0.5f, 1f);
-            Params[15] = new VisualParam(15, "Ears_Out", 0, "shape", "Ear Angle", "In", "Out", -0.5f, -0.5f, 1.5f);
-            Params[16] = new VisualParam(16, "Pointy_Eyebrows", 0, "hair", "Eyebrow Points", "Smooth", "Pointy", -0.5f, -0.5f, 3f);
-            Params[17] = new VisualParam(17, "Square_Jaw", 0, "shape", "Jaw Shape", "Pointy", "Square", -0.5f, -0.5f, 1f);
-            Params[18] = new VisualParam(18, "Puffy_Upper_Cheeks", 0, "shape", "Upper Cheeks", "Thin", "Puffy", -1.5f, -1.5f, 2.5f);
-            Params[19] = new VisualParam(19, "Upturned_Nose_Tip", 0, "shape", "Nose Tip Angle", "Downturned", "Upturned", -1.5f, -1.5f, 1f);
-            Params[20] = new VisualParam(20, "Bulbous_Nose", 0, "shape", "Nose Thickness", "Thin Nose", "Bulbous Nose", -0.5f, -0.5f, 1.5f);
-            Params[21] = new VisualParam(21, "Upper_Eyelid_Fold", 0, "shape", "Upper Eyelid Fold", "Uncreased", "Creased", -0.2f, -0.2f, 1.3f);
-            Params[22] = new VisualParam(22, "Attached_Earlobes", 0, "shape", "Attached Earlobes", "Unattached", "Attached", 0f, 0f, 1f);
-            Params[23] = new VisualParam(23, "Baggy_Eyes", 0, "shape", "Eye Bags", "Smooth", "Baggy", -0.5f, -0.5f, 1.5f);
-            Params[24] = new VisualParam(24, "Wide_Eyes", 0, "shape", "Eye Opening", "Narrow", "Wide", -1.5f, -1.5f, 2f);
-            Params[25] = new VisualParam(25, "Wide_Lip_Cleft", 0, "shape", "Lip Cleft", "Narrow", "Wide", -0.8f, -0.8f, 1.5f);
-            Params[27] = new VisualParam(27, "Wide_Nose_Bridge", 0, "shape", "Bridge Width", "Narrow", "Wide", -1.3f, -1.3f, 1.2f);
-            Params[31] = new VisualParam(31, "Arced_Eyebrows", 0, "hair", "Eyebrow Arc", "Flat", "Arced", 0.5f, 0f, 2f);
-            Params[33] = new VisualParam(33, "Height", 0, "shape", "Height", "Short", "Tall", -2.3f, -2.3f, 2f);
-            Params[34] = new VisualParam(34, "Thickness", 0, "shape", "Body Thickness", "Body Thin", "Body Thick", -0.7f, -0.7f, 1.5f);
-            Params[35] = new VisualParam(35, "Big_Ears", 0, "shape", "Ear Size", "Small", "Large", -1f, -1f, 2f);
-            Params[36] = new VisualParam(36, "Shoulders", 0, "shape", "Shoulders", "Narrow", "Broad", -0.5f, -1.8f, 1.4f);
-            Params[37] = new VisualParam(37, "Hip Width", 0, "shape", "Hip Width", "Narrow", "Wide", -3.2f, -3.2f, 2.8f);
-            Params[38] = new VisualParam(38, "Torso Length", 0, "shape", "", "Short Torso", "Long Torso", -1f, -1f, 1f);
-            Params[80] = new VisualParam(80, "male", 0, "shape", "", "", "", 0f, 0f, 1f);
-            Params[93] = new VisualParam(93, "Glove Length", 0, "gloves", "", "Short", "Long", 0.8f, 0.01f, 1f);
-            Params[98] = new VisualParam(98, "Eye Lightness", 0, "eyes", "", "Darker", "Lighter", 0f, 0f, 1f);
-            Params[99] = new VisualParam(99, "Eye Color", 0, "eyes", "", "Natural", "Unnatural", 0f, 0f, 1f);
-            Params[105] = new VisualParam(105, "Breast Size", 0, "shape", "", "Small", "Large", 0.5f, 0f, 1f);
-            Params[108] = new VisualParam(108, "Rainbow Color", 0, "skin", "", "None", "Wild", 0f, 0f, 1f);
-            Params[110] = new VisualParam(110, "Red Skin", 0, "skin", "Ruddiness", "Pale", "Ruddy", 0f, 0f, 0.1f);
-            Params[111] = new VisualParam(111, "Pigment", 0, "skin", "", "Light", "Dark", 0.5f, 0f, 1f);
-            Params[112] = new VisualParam(112, "Rainbow Color", 0, "hair", "", "None", "Wild", 0f, 0f, 1f);
-            Params[113] = new VisualParam(113, "Red Hair", 0, "hair", "", "No Red", "Very Red", 0f, 0f, 1f);
-            Params[114] = new VisualParam(114, "Blonde Hair", 0, "hair", "", "Black", "Blonde", 0.5f, 0f, 1f);
-            Params[115] = new VisualParam(115, "White Hair", 0, "hair", "", "No White", "All White", 0f, 0f, 1f);
-            Params[116] = new VisualParam(116, "Rosy Complexion", 0, "skin", "", "Less Rosy", "More Rosy", 0f, 0f, 1f);
-            Params[117] = new VisualParam(117, "Lip Pinkness", 0, "skin", "", "Darker", "Pinker", 0f, 0f, 1f);
-            Params[119] = new VisualParam(119, "Eyebrow Size", 0, "hair", "", "Thin Eyebrows", "Bushy Eyebrows", 0.5f, 0f, 1f);
-            Params[130] = new VisualParam(130, "Front Fringe", 0, "hair", "", "Short", "Long", 0.45f, 0f, 1f);
-            Params[131] = new VisualParam(131, "Side Fringe", 0, "hair", "", "Short", "Long", 0.5f, 0f, 1f);
-            Params[132] = new VisualParam(132, "Back Fringe", 0, "hair", "", "Short", "Long", 0.39f, 0f, 1f);
-            Params[133] = new VisualParam(133, "Hair Front", 0, "hair", "", "Short", "Long", 0.25f, 0f, 1f);
-            Params[134] = new VisualParam(134, "Hair Sides", 0, "hair", "", "Short", "Long", 0.5f, 0f, 1f);
-            Params[135] = new VisualParam(135, "Hair Back", 0, "hair", "", "Short", "Long", 0.55f, 0f, 1f);
-            Params[136] = new VisualParam(136, "Hair Sweep", 0, "hair", "", "Sweep Forward", "Sweep Back", 0.5f, 0f, 1f);
-            Params[137] = new VisualParam(137, "Hair Tilt", 0, "hair", "", "Left", "Right", 0.5f, 0f, 1f);
-            Params[140] = new VisualParam(140, "Hair_Part_Middle", 0, "hair", "Middle Part", "No Part", "Part", 0f, 0f, 2f);
-            Params[141] = new VisualParam(141, "Hair_Part_Right", 0, "hair", "Right Part", "No Part", "Part", 0f, 0f, 2f);
-            Params[142] = new VisualParam(142, "Hair_Part_Left", 0, "hair", "Left Part", "No Part", "Part", 0f, 0f, 2f);
-            Params[143] = new VisualParam(143, "Hair_Sides_Full", 0, "hair", "Full Hair Sides", "Mowhawk", "Full Sides", 0.125f, -4f, 1.5f);
-            Params[150] = new VisualParam(150, "Body Definition", 0, "skin", "", "Less", "More", 0f, 0f, 1f);
-            Params[155] = new VisualParam(155, "Lip Width", 0, "shape", "Lip Width", "Narrow Lips", "Wide Lips", 0f, -0.9f, 1.3f);
-            Params[157] = new VisualParam(157, "Belly Size", 0, "shape", "", "Small", "Big", 0f, 0f, 1f);
-            Params[162] = new VisualParam(162, "Facial Definition", 0, "skin", "", "Less", "More", 0f, 0f, 1f);
-            Params[163] = new VisualParam(163, "wrinkles", 0, "skin", "", "Less", "More", 0f, 0f, 1f);
-            Params[165] = new VisualParam(165, "Freckles", 0, "skin", "", "Less", "More", 0f, 0f, 1f);
-            Params[166] = new VisualParam(166, "Sideburns", 0, "hair", "", "Short Sideburns", "Mutton Chops", 0f, 0f, 1f);
-            Params[167] = new VisualParam(167, "Moustache", 0, "hair", "", "Chaplin", "Handlebars", 0f, 0f, 1f);
-            Params[168] = new VisualParam(168, "Soulpatch", 0, "hair", "", "Less soul", "More soul", 0f, 0f, 1f);
-            Params[169] = new VisualParam(169, "Chin Curtains", 0, "hair", "", "Less Curtains", "More Curtains", 0f, 0f, 1f);
-            Params[177] = new VisualParam(177, "Hair_Rumpled", 0, "hair", "Rumpled Hair", "Smooth Hair", "Rumpled Hair", 0f, 0f, 1f);
-            Params[181] = new VisualParam(181, "Hair_Big_Front", 0, "hair", "Big Hair Front", "Less", "More", 0.14f, -1f, 1f);
-            Params[182] = new VisualParam(182, "Hair_Big_Top", 0, "hair", "Big Hair Top", "Less", "More", 0.7f, -1f, 1f);
-            Params[183] = new VisualParam(183, "Hair_Big_Back", 0, "hair", "Big Hair Back", "Less", "More", 0.05f, -1f, 1f);
-            Params[184] = new VisualParam(184, "Hair_Spiked", 0, "hair", "Spiked Hair", "No Spikes", "Big Spikes", 0f, 0f, 1f);
-            Params[185] = new VisualParam(185, "Deep_Chin", 0, "shape", "Chin Depth", "Shallow", "Deep", -1f, -1f, 1f);
-            Params[192] = new VisualParam(192, "Bangs_Part_Middle", 0, "hair", "Part Bangs", "No Part", "Part Bangs", 0f, 0f, 1f);
-            Params[193] = new VisualParam(193, "Head Shape", 0, "shape", "Head Shape", "More Square", "More Round", 0.5f, 0f, 1f);
-            Params[196] = new VisualParam(196, "Eye Spacing", 0, "shape", "Eye Spacing", "Close Set Eyes", "Far Set Eyes", 0f, -2f, 1f);
-            Params[198] = new VisualParam(198, "Heel Height", 0, "shoes", "", "Low Heels", "High Heels", 0f, 0f, 1f);
-            Params[503] = new VisualParam(503, "Platform Height", 0, "shoes", "", "Low Platforms", "High Platforms", 0f, 0f, 1f);
-            Params[505] = new VisualParam(505, "Lip Thickness", 0, "shape", "", "Thin Lips", "Fat Lips", 0.5f, 0f, 1f);
-            Params[506] = new VisualParam(506, "Mouth_Height", 0, "shape", "Mouth Position", "High", "Low", -2f, -2f, 2f);
-            Params[507] = new VisualParam(507, "Breast_Gravity", 0, "shape", "Breast Buoyancy", "Less Gravity", "More Gravity", 0f, -1.5f, 2f);
-            Params[508] = new VisualParam(508, "Shoe_Platform_Width", 0, "shoes", "Platform Width", "Narrow", "Wide", -1f, -1f, 2f);
-            Params[513] = new VisualParam(513, "Heel Shape", 0, "shoes", "", "Pointy Heels", "Thick Heels", 0.5f, 0f, 1f);
-            Params[514] = new VisualParam(514, "Toe Shape", 0, "shoes", "", "Pointy", "Square", 0.5f, 0f, 1f);
-            Params[515] = new VisualParam(515, "Foot_Size", 0, "shape", "Foot Size", "Small", "Big", -1f, -1f, 3f);
-            Params[517] = new VisualParam(517, "Wide_Nose", 0, "shape", "Nose Width", "Narrow", "Wide", -0.5f, -0.5f, 1f);
-            Params[518] = new VisualParam(518, "Eyelashes_Long", 0, "shape", "Eyelash Length", "Short", "Long", -0.3f, -0.3f, 1.5f);
-            Params[603] = new VisualParam(603, "Sleeve Length", 0, "undershirt", "", "Short", "Long", 0.4f, 0.01f, 1f);
-            Params[604] = new VisualParam(604, "Bottom", 0, "undershirt", "", "Short", "Long", 0.85f, 0f, 1f);
-            Params[605] = new VisualParam(605, "Collar Front", 0, "undershirt", "", "Low", "High", 0.84f, 0f, 1f);
-            Params[606] = new VisualParam(606, "Sleeve Length", 0, "jacket", "", "Short", "Long", 0.8f, 0f, 1f);
-            Params[607] = new VisualParam(607, "Collar Front", 0, "jacket", "", "Low", "High", 0.8f, 0f, 1f);
-            Params[608] = new VisualParam(608, "bottom length lower", 0, "jacket", "Jacket Length", "Short", "Long", 0.8f, 0f, 1f);
-            Params[609] = new VisualParam(609, "open jacket", 0, "jacket", "Open Front", "Open", "Closed", 0.2f, 0f, 1f);
-            Params[616] = new VisualParam(616, "Shoe Height", 0, "shoes", "", "Short", "Tall", 0.1f, 0f, 1f);
-            Params[617] = new VisualParam(617, "Socks Length", 0, "socks", "", "Short", "Long", 0.35f, 0f, 1f);
-            Params[619] = new VisualParam(619, "Pants Length", 0, "underpants", "", "Short", "Long", 0.3f, 0f, 1f);
-            Params[624] = new VisualParam(624, "Pants Waist", 0, "underpants", "", "Low", "High", 0.8f, 0f, 1f);
-            Params[625] = new VisualParam(625, "Leg_Pantflair", 0, "pants", "Cuff Flare", "Tight Cuffs", "Flared Cuffs", 0f, 0f, 1.5f);
-            Params[629] = new VisualParam(629, "Forehead Angle", 0, "shape", "", "More Vertical", "More Sloped", 0.5f, 0f, 1f);
-            Params[637] = new VisualParam(637, "Body Fat", 0, "shape", "", "Less Body Fat", "More Body Fat", 0f, 0f, 1f);
-            Params[638] = new VisualParam(638, "Low_Crotch", 0, "pants", "Pants Crotch", "High and Tight", "Low and Loose", 0f, 0f, 1.3f);
-            Params[646] = new VisualParam(646, "Egg_Head", 0, "shape", "Egg Head", "Chin Heavy", "Forehead Heavy", 0f, -1.3f, 1f);
-            Params[647] = new VisualParam(647, "Squash_Stretch_Head", 0, "shape", "Head Stretch", "Squash Head", "Stretch Head", 0f, -0.5f, 1f);
-            Params[649] = new VisualParam(649, "Torso Muscles", 0, "shape", "Torso Muscles", "Less Muscular", "More Muscular", 0.5f, 0f, 1f);
-            Params[650] = new VisualParam(650, "Eyelid_Corner_Up", 0, "shape", "Outer Eye Corner", "Corner Down", "Corner Up", -1.3f, -1.3f, 1.2f);
-            Params[652] = new VisualParam(652, "Leg Muscles", 0, "shape", "", "Less Muscular", "More Muscular", 0.5f, 0f, 1f);
-            Params[653] = new VisualParam(653, "Tall_Lips", 0, "shape", "Lip Fullness", "Less Full", "More Full", -1f, -1f, 2f);
-            Params[654] = new VisualParam(654, "Shoe_Toe_Thick", 0, "shoes", "Toe Thickness", "Flat Toe", "Thick Toe", 0f, 0f, 2f);
-            Params[656] = new VisualParam(656, "Crooked_Nose", 0, "shape", "Crooked Nose", "Nose Left", "Nose Right", -2f, -2f, 2f);
-            Params[659] = new VisualParam(659, "Mouth Corner", 0, "shape", "", "Corner Down", "Corner Up", 0.5f, 0f, 1f);
-            Params[662] = new VisualParam(662, "Face Shear", 0, "shape", "", "Shear Right Up", "Shear Left Up", 0.5f, 0f, 1f);
-            Params[663] = new VisualParam(663, "Shift_Mouth", 0, "shape", "Shift Mouth", "Shift Left", "Shift Right", 0f, -2f, 2f);
-            Params[664] = new VisualParam(664, "Pop_Eye", 0, "shape", "Eye Pop", "Pop Right Eye", "Pop Left Eye", 0f, -1.3f, 1.3f);
-            Params[665] = new VisualParam(665, "Jaw_Jut", 0, "shape", "Jaw Jut", "Overbite", "Underbite", 0f, -2f, 2f);
-            Params[674] = new VisualParam(674, "Hair_Shear_Back", 0, "hair", "Shear Back", "Full Back", "Sheared Back", -0.3f, -1f, 2f);
-            Params[675] = new VisualParam(675, "Hand Size", 0, "shape", "", "Small Hands", "Large Hands", -0.3f, -0.3f, 0.3f);
-            Params[676] = new VisualParam(676, "Love_Handles", 0, "shape", "Love Handles", "Less Love", "More Love", 0f, -1f, 2f);
-            Params[678] = new VisualParam(678, "Torso Muscles", 0, "shape", "", "Less Muscular", "More Muscular", 0.5f, 0f, 1f);
-            Params[682] = new VisualParam(682, "Head Size", 0, "shape", "Head Size", "Small Head", "Big Head", 0.5f, 0f, 1f);
-            Params[683] = new VisualParam(683, "Neck Thickness", 0, "shape", "", "Skinny Neck", "Thick Neck", -0.15f, -0.4f, 0.2f);
-            Params[684] = new VisualParam(684, "Breast_Female_Cleavage", 0, "shape", "Breast Cleavage", "Separate", "Join", 0f, -0.3f, 1.3f);
-            Params[685] = new VisualParam(685, "Chest_Male_No_Pecs", 0, "shape", "Pectorals", "Big Pectorals", "Sunken Chest", 0f, -0.5f, 1.1f);
-            Params[690] = new VisualParam(690, "Eye Size", 0, "shape", "Eye Size", "Beady Eyes", "Anime Eyes", 0.5f, 0f, 1f);
-            Params[692] = new VisualParam(692, "Leg Length", 0, "shape", "", "Short Legs", "Long Legs", -1f, -1f, 1f);
-            Params[693] = new VisualParam(693, "Arm Length", 0, "shape", "", "Short Arms", "Long arms", 0.6f, -1f, 1f);
-            Params[700] = new VisualParam(700, "Lipstick Color", 0, "skin", "", "Pink", "Black", 0.25f, 0f, 1f);
-            Params[701] = new VisualParam(701, "Lipstick", 0, "skin", "", "No Lipstick", "More Lipstick", 0f, 0f, 0.9f);
-            Params[702] = new VisualParam(702, "Lipgloss", 0, "skin", "", "No Lipgloss", "Glossy", 0f, 0f, 1f);
-            Params[703] = new VisualParam(703, "Eyeliner", 0, "skin", "", "No Eyeliner", "Full Eyeliner", 0f, 0f, 1f);
-            Params[704] = new VisualParam(704, "Blush", 0, "skin", "", "No Blush", "More Blush", 0f, 0f, 0.9f);
-            Params[705] = new VisualParam(705, "Blush Color", 0, "skin", "", "Pink", "Orange", 0.5f, 0f, 1f);
-            Params[706] = new VisualParam(706, "Out Shdw Opacity", 0, "skin", "", "Clear", "Opaque", 0.6f, 0.2f, 1f);
-            Params[707] = new VisualParam(707, "Outer Shadow", 0, "skin", "", "No Eyeshadow", "More Eyeshadow", 0f, 0f, 0.7f);
-            Params[708] = new VisualParam(708, "Out Shdw Color", 0, "skin", "", "Light", "Dark", 0f, 0f, 1f);
-            Params[709] = new VisualParam(709, "Inner Shadow", 0, "skin", "", "No Eyeshadow", "More Eyeshadow", 0f, 0f, 1f);
-            Params[710] = new VisualParam(710, "Nail Polish", 0, "skin", "", "No Polish", "Painted Nails", 0f, 0f, 1f);
-            Params[711] = new VisualParam(711, "Blush Opacity", 0, "skin", "", "Clear", "Opaque", 0.5f, 0f, 1f);
-            Params[712] = new VisualParam(712, "In Shdw Color", 0, "skin", "", "Light", "Dark", 0f, 0f, 1f);
-            Params[713] = new VisualParam(713, "In Shdw Opacity", 0, "skin", "", "Clear", "Opaque", 0.7f, 0.2f, 1f);
-            Params[714] = new VisualParam(714, "Eyeliner Color", 0, "skin", "", "Dark Green", "Black", 0f, 0f, 1f);
-            Params[715] = new VisualParam(715, "Nail Polish Color", 0, "skin", "", "Pink", "Black", 0f, 0f, 1f);
-            Params[750] = new VisualParam(750, "Eyebrow Density", 0, "hair", "", "Sparse", "Dense", 0.7f, 0f, 1f);
-            Params[752] = new VisualParam(752, "Hair Thickness", 0, "hair", "", "5 O'Clock Shadow", "Bushy Hair", 0.5f, 0f, 1f);
-            Params[753] = new VisualParam(753, "Saddlebags", 0, "shape", "Saddle Bags", "Less Saddle", "More Saddle", 0f, -0.5f, 3f);
-            Params[754] = new VisualParam(754, "Hair_Taper_Back", 0, "hair", "Taper Back", "Wide Back", "Narrow Back", 0f, -1f, 2f);
-            Params[755] = new VisualParam(755, "Hair_Taper_Front", 0, "hair", "Taper Front", "Wide Front", "Narrow Front", 0.05f, -1.5f, 1.5f);
-            Params[756] = new VisualParam(756, "Neck Length", 0, "shape", "", "Short Neck", "Long Neck", 0f, -1f, 1f);
-            Params[757] = new VisualParam(757, "Lower_Eyebrows", 0, "hair", "Eyebrow Height", "Higher", "Lower", -1f, -4f, 2f);
-            Params[758] = new VisualParam(758, "Lower_Bridge_Nose", 0, "shape", "Lower Bridge", "Low", "High", -1.5f, -1.5f, 1.5f);
-            Params[759] = new VisualParam(759, "Low_Septum_Nose", 0, "shape", "Nostril Division", "High", "Low", 0.5f, -1f, 1.5f);
-            Params[760] = new VisualParam(760, "Jaw_Angle", 0, "shape", "Jaw Angle", "Low Jaw", "High Jaw", 0f, -1.2f, 2f);
-            Params[762] = new VisualParam(762, "Hair_Shear_Front", 0, "hair", "Shear Front", "Full Front", "Sheared Front", 0f, 0f, 3f);
-            Params[763] = new VisualParam(763, "Hair Volume", 0, "hair", "", "Less Volume", "More Volume", 0.55f, 0f, 1f);
-            Params[764] = new VisualParam(764, "Lip_Cleft_Deep", 0, "shape", "Lip Cleft Depth", "Shallow", "Deep", -0.5f, -0.5f, 1.2f);
-            Params[765] = new VisualParam(765, "Puffy_Lower_Lids", 0, "shape", "Puffy Eyelids", "Flat", "Puffy", -0.3f, -0.3f, 2.5f);
-            Params[769] = new VisualParam(769, "Eye Depth", 0, "shape", "", "Sunken Eyes", "Bugged Eyes", 0.5f, 0f, 1f);
-            Params[773] = new VisualParam(773, "Head Length", 0, "shape", "", "Flat Head", "Long Head", 0.5f, 0f, 1f);
-            Params[775] = new VisualParam(775, "Body Freckles", 0, "skin", "", "Less Freckles", "More Freckles", 0f, 0f, 1f);
-            Params[779] = new VisualParam(779, "Collar Back", 0, "undershirt", "", "Low", "High", 0.84f, 0f, 1f);
-            Params[780] = new VisualParam(780, "Collar Back", 0, "jacket", "", "Low", "High", 0.8f, 0f, 1f);
-            Params[781] = new VisualParam(781, "Collar Back", 0, "shirt", "", "Low", "High", 0.78f, 0f, 1f);
-            Params[785] = new VisualParam(785, "Pigtails", 0, "hair", "", "Short Pigtails", "Long Pigtails", 0f, 0f, 1f);
-            Params[789] = new VisualParam(789, "Ponytail", 0, "hair", "", "Short Ponytail", "Long Ponytail", 0f, 0f, 1f);
-            Params[795] = new VisualParam(795, "Butt Size", 0, "shape", "Butt Size", "Flat Butt", "Big Butt", 0.25f, 0f, 1f);
-            Params[796] = new VisualParam(796, "Pointy_Ears", 0, "shape", "Ear Tips", "Flat", "Pointy", -0.4f, -0.4f, 3f);
-            Params[799] = new VisualParam(799, "Lip Ratio", 0, "shape", "Lip Ratio", "More Upper Lip", "More Lower Lip", 0.5f, 0f, 1f);
-            Params[800] = new VisualParam(800, "Sleeve Length", 0, "shirt", "", "Short", "Long", 0.89f, 0f, 1f);
-            Params[801] = new VisualParam(801, "Shirt Bottom", 0, "shirt", "", "Short", "Long", 1f, 0f, 1f);
-            Params[802] = new VisualParam(802, "Collar Front", 0, "shirt", "", "Low", "High", 0.78f, 0f, 1f);
-            Params[803] = new VisualParam(803, "shirt_red", 0, "shirt", "", "", "", 1f, 0f, 1f);
-            Params[804] = new VisualParam(804, "shirt_green", 0, "shirt", "", "", "", 1f, 0f, 1f);
-            Params[805] = new VisualParam(805, "shirt_blue", 0, "shirt", "", "", "", 1f, 0f, 1f);
-            Params[806] = new VisualParam(806, "pants_red", 0, "pants", "", "", "", 1f, 0f, 1f);
-            Params[807] = new VisualParam(807, "pants_green", 0, "pants", "", "", "", 1f, 0f, 1f);
-            Params[808] = new VisualParam(808, "pants_blue", 0, "pants", "", "", "", 1f, 0f, 1f);
-            Params[812] = new VisualParam(812, "shoes_red", 0, "shoes", "", "", "", 1f, 0f, 1f);
-            Params[813] = new VisualParam(813, "shoes_green", 0, "shoes", "", "", "", 1f, 0f, 1f);
-            Params[814] = new VisualParam(814, "Waist Height", 0, "pants", "", "Low", "High", 1f, 0f, 1f);
-            Params[815] = new VisualParam(815, "Pants Length", 0, "pants", "", "Short", "Long", 0.8f, 0f, 1f);
-            Params[816] = new VisualParam(816, "Loose Lower Clothing", 0, "pants", "Pants Fit", "Tight Pants", "Loose Pants", 0f, 0f, 1f);
-            Params[817] = new VisualParam(817, "shoes_blue", 0, "shoes", "", "", "", 1f, 0f, 1f);
-            Params[818] = new VisualParam(818, "socks_red", 0, "socks", "", "", "", 1f, 0f, 1f);
-            Params[819] = new VisualParam(819, "socks_green", 0, "socks", "", "", "", 1f, 0f, 1f);
-            Params[820] = new VisualParam(820, "socks_blue", 0, "socks", "", "", "", 1f, 0f, 1f);
-            Params[821] = new VisualParam(821, "undershirt_red", 0, "undershirt", "", "", "", 1f, 0f, 1f);
-            Params[822] = new VisualParam(822, "undershirt_green", 0, "undershirt", "", "", "", 1f, 0f, 1f);
-            Params[823] = new VisualParam(823, "undershirt_blue", 0, "undershirt", "", "", "", 1f, 0f, 1f);
-            Params[824] = new VisualParam(824, "underpants_red", 0, "underpants", "", "", "", 1f, 0f, 1f);
-            Params[825] = new VisualParam(825, "underpants_green", 0, "underpants", "", "", "", 1f, 0f, 1f);
-            Params[826] = new VisualParam(826, "underpants_blue", 0, "underpants", "", "", "", 1f, 0f, 1f);
-            Params[827] = new VisualParam(827, "gloves_red", 0, "gloves", "", "", "", 1f, 0f, 1f);
-            Params[828] = new VisualParam(828, "Loose Upper Clothing", 0, "shirt", "Shirt Fit", "Tight Shirt", "Loose Shirt", 0f, 0f, 1f);
-            Params[829] = new VisualParam(829, "gloves_green", 0, "gloves", "", "", "", 1f, 0f, 1f);
-            Params[830] = new VisualParam(830, "gloves_blue", 0, "gloves", "", "", "", 1f, 0f, 1f);
-            Params[834] = new VisualParam(834, "jacket_red", 0, "jacket", "", "", "", 1f, 0f, 1f);
-            Params[835] = new VisualParam(835, "jacket_green", 0, "jacket", "", "", "", 1f, 0f, 1f);
-            Params[836] = new VisualParam(836, "jacket_blue", 0, "jacket", "", "", "", 1f, 0f, 1f);
-            Params[840] = new VisualParam(840, "Shirtsleeve_flair", 0, "shirt", "Sleeve Looseness", "Tight Sleeves", "Loose Sleeves", 0f, 0f, 1.5f);
-            Params[841] = new VisualParam(841, "Bowed_Legs", 0, "shape", "Knee Angle", "Knock Kneed", "Bow Legged", 0f, -1f, 1f);
-            Params[842] = new VisualParam(842, "Hip Length", 0, "shape", "", "Short hips", "Long Hips", -1f, -1f, 1f);
-            Params[844] = new VisualParam(844, "Glove Fingers", 0, "gloves", "", "Fingerless", "Fingers", 1f, 0.01f, 1f);
-            Params[848] = new VisualParam(848, "skirt_bustle", 0, "skirt", "bustle skirt", "no bustle", "more bustle", 0.2f, 0f, 2f);
-            Params[858] = new VisualParam(858, "Skirt Length", 0, "skirt", "", "Short", "Long", 0.4f, 0.01f, 1f);
-            Params[859] = new VisualParam(859, "Slit Front", 0, "skirt", "", "Open Front", "Closed Front", 1f, 0f, 1f);
-            Params[860] = new VisualParam(860, "Slit Back", 0, "skirt", "", "Open Back", "Closed Back", 1f, 0f, 1f);
-            Params[861] = new VisualParam(861, "Slit Left", 0, "skirt", "", "Open Left", "Closed Left", 1f, 0f, 1f);
-            Params[862] = new VisualParam(862, "Slit Right", 0, "skirt", "", "Open Right", "Closed Right", 1f, 0f, 1f);
-            Params[863] = new VisualParam(863, "skirt_looseness", 0, "skirt", "Skirt Fit", "Tight Skirt", "Poofy Skirt", 0.333f, 0f, 1f);
-            Params[868] = new VisualParam(868, "Shirt Wrinkles", 0, "shirt", "", "", "", 0f, 0f, 1f);
-            Params[869] = new VisualParam(869, "Pants Wrinkles", 0, "pants", "", "", "", 0f, 0f, 1f);
-            Params[877] = new VisualParam(877, "Jacket Wrinkles", 0, "jacket", "Jacket Wrinkles", "No Wrinkles", "Wrinkles", 0f, 0f, 1f);
-            Params[879] = new VisualParam(879, "Male_Package", 0, "shape", "Package", "Coin Purse", "Duffle Bag", 0f, -0.5f, 2f);
-            Params[880] = new VisualParam(880, "Eyelid_Inner_Corner_Up", 0, "shape", "Inner Eye Corner", "Corner Down", "Corner Up", -1.3f, -1.3f, 1.2f);
-            Params[921] = new VisualParam(921, "skirt_red", 0, "skirt", "", "", "", 1f, 0f, 1f);
-            Params[922] = new VisualParam(922, "skirt_green", 0, "skirt", "", "", "", 1f, 0f, 1f);
-            Params[923] = new VisualParam(923, "skirt_blue", 0, "skirt", "", "", "", 1f, 0f, 1f);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/Baker/Baker.cs b/old/libsl1550/libsecondlife/examples/Baker/Baker.cs
deleted file mode 100644
index fba119b..0000000
--- a/old/libsl1550/libsecondlife/examples/Baker/Baker.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace Baker
-{
-    static class Baker
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main(string[] args)
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new frmBaker());
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/Baker/Baker.csproj b/old/libsl1550/libsecondlife/examples/Baker/Baker.csproj
deleted file mode 100644
index b11f6e9..0000000
--- a/old/libsl1550/libsecondlife/examples/Baker/Baker.csproj
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{4A32A4E5-717C-4B60-B3D7-704518684893}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Baker</RootNamespace>
-    <AssemblyName>Baker</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-  <ItemGroup>
-    <EmbeddedResource Include="frmBaker.resx">
-      <DependentUpon>frmBaker.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <Compile Include="Oven.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Baker.cs" />
-    <Compile Include="frmBaker.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="frmBaker.designer.cs">
-      <DependentUpon>frmBaker.cs</DependentUpon>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/Baker/Oven.cs b/old/libsl1550/libsecondlife/examples/Baker/Oven.cs
deleted file mode 100644
index 71a38fc..0000000
--- a/old/libsl1550/libsecondlife/examples/Baker/Oven.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Runtime.InteropServices;
-
-namespace Baker
-{
-	public static class Oven
-	{
-		public static Bitmap ModifyAlphaMask(Bitmap alpha, byte weight, float ramp)
-		{
-			// Create the new modifiable image (our canvas)
-			int width = alpha.Width;
-			int height = alpha.Height;
-			int pixelFormatSize = Image.GetPixelFormatSize(alpha.PixelFormat) / 8;
-			int stride = width * pixelFormatSize;
-			byte[] data = new byte[stride * height];
-			GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned);
-			IntPtr pointer = Marshal.UnsafeAddrOfPinnedArrayElement(data, 0);
-			Bitmap modified = new Bitmap(width, height, stride, alpha.PixelFormat, pointer);
-
-			// Copy the existing alpha mask to the canvas
-			Graphics g = Graphics.FromImage(modified);
-			g.DrawImageUnscaledAndClipped(alpha, new Rectangle(0, 0, width, height));
-			g.Dispose();
-
-			// Modify the canvas based on the input weight and ramp values
-			// TODO: use the ramp
-			// TODO: only bother with the alpha values
-			for (int i = 0; i < data.Length; i++)
-			{
-				if (data[i] < weight) data[i] = 0;
-			}
-
-			return modified;
-		}
-
-		public static Bitmap ApplyAlphaMask(Bitmap source, Bitmap alpha)
-		{
-			// Create the new modifiable image (our canvas)
-			int width = source.Width;
-			int height = source.Height;
-
-			if (alpha.Width != width || alpha.Height != height ||
-			    alpha.PixelFormat != source.PixelFormat)
-			{
-				throw new Exception("Source image and alpha mask formats do not match");
-			}
-
-			int pixelFormatSize = Image.GetPixelFormatSize(source.PixelFormat) / 8;
-			int stride = width * pixelFormatSize;
-			byte[] data = new byte[stride * height];
-			GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned);
-			IntPtr pointer = Marshal.UnsafeAddrOfPinnedArrayElement(data, 0);
-			Bitmap modified = new Bitmap(width, height, stride, source.PixelFormat, pointer);
-
-			// Copy the source image to the canvas
-			Graphics g = Graphics.FromImage(modified);
-			g.DrawImageUnscaledAndClipped(source, new Rectangle(0, 0, width, height));
-			g.Dispose();
-
-			// Get access to the pixel data for the alpha mask (probably using lockbits)
-
-			// Combine the alpha mask alpha bytes in to the canvas
-
-			return modified;
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/examples/Baker/bin/Release/Baker.exe b/old/libsl1550/libsecondlife/examples/Baker/bin/Release/Baker.exe
deleted file mode 100644
index 6eff2d7..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Baker/bin/Release/Baker.exe and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Baker/bin/Release/Baker.pdb b/old/libsl1550/libsecondlife/examples/Baker/bin/Release/Baker.pdb
deleted file mode 100644
index 2b09fb3..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Baker/bin/Release/Baker.pdb and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Baker/bin/Release/CookComputing.XmlRpcV2.dll b/old/libsl1550/libsecondlife/examples/Baker/bin/Release/CookComputing.XmlRpcV2.dll
deleted file mode 100644
index 4dd869c..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Baker/bin/Release/CookComputing.XmlRpcV2.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Baker/bin/Release/libsecondlife.dll b/old/libsl1550/libsecondlife/examples/Baker/bin/Release/libsecondlife.dll
deleted file mode 100644
index c2f9982..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Baker/bin/Release/libsecondlife.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Baker/frmBaker.Designer.cs b/old/libsl1550/libsecondlife/examples/Baker/frmBaker.Designer.cs
deleted file mode 100644
index d1f8e95..0000000
--- a/old/libsl1550/libsecondlife/examples/Baker/frmBaker.Designer.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-namespace Baker
-{
-    partial class frmBaker
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.pic1 = new System.Windows.Forms.PictureBox();
-            this.cmdLoadShirt = new System.Windows.Forms.Button();
-            this.scrollWeight = new System.Windows.Forms.HScrollBar();
-            this.cmdLoadSkin = new System.Windows.Forms.Button();
-            this.cboMask = new System.Windows.Forms.ComboBox();
-            ((System.ComponentModel.ISupportInitialize)(this.pic1)).BeginInit();
-            this.SuspendLayout();
-            //
-            // pic1
-            //
-            this.pic1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.pic1.Location = new System.Drawing.Point(12, 41);
-            this.pic1.Name = "pic1";
-            this.pic1.Size = new System.Drawing.Size(512, 483);
-            this.pic1.TabIndex = 0;
-            this.pic1.TabStop = false;
-            //
-            // cmdLoadShirt
-            //
-            this.cmdLoadShirt.Location = new System.Drawing.Point(449, 530);
-            this.cmdLoadShirt.Name = "cmdLoadShirt";
-            this.cmdLoadShirt.Size = new System.Drawing.Size(75, 23);
-            this.cmdLoadShirt.TabIndex = 1;
-            this.cmdLoadShirt.Text = "Load Shirt";
-            this.cmdLoadShirt.UseVisualStyleBackColor = true;
-            //
-            // scrollWeight
-            //
-            this.scrollWeight.Location = new System.Drawing.Point(12, 530);
-            this.scrollWeight.Maximum = 255;
-            this.scrollWeight.Name = "scrollWeight";
-            this.scrollWeight.Size = new System.Drawing.Size(345, 23);
-            this.scrollWeight.TabIndex = 0;
-            this.scrollWeight.Scroll += new System.Windows.Forms.ScrollEventHandler(this.scrollWeight_Scroll);
-            //
-            // cmdLoadSkin
-            //
-            this.cmdLoadSkin.Location = new System.Drawing.Point(366, 530);
-            this.cmdLoadSkin.Name = "cmdLoadSkin";
-            this.cmdLoadSkin.Size = new System.Drawing.Size(75, 23);
-            this.cmdLoadSkin.TabIndex = 2;
-            this.cmdLoadSkin.Text = "Load Skin";
-            this.cmdLoadSkin.UseVisualStyleBackColor = true;
-            this.cmdLoadSkin.Click += new System.EventHandler(this.cmdLoadSkin_Click);
-            //
-            // cboMask
-            //
-            this.cboMask.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cboMask.FormattingEnabled = true;
-            this.cboMask.Items.AddRange(new object[] {
-            "glove_length_alpha",
-            "gloves_fingers_alpha",
-            "jacket_length_lower_alpha",
-            "jacket_length_upper_alpha",
-            "jacket_open_lower_alpha",
-            "jacket_open_upper_alpha",
-            "pants_length_alpha",
-            "pants_waist_alpha",
-            "shirt_bottom_alpha",
-            "shirt_collar_alpha",
-            "shirt_collar_back_alpha",
-            "shirt_sleeve_alpha",
-            "shoe_height_alpha",
-            "skirt_length_alpha",
-            "skirt_slit_front_alpha",
-            "skirt_slit_left_alpha",
-            "skirt_slit_right_alpha"});
-            this.cboMask.Location = new System.Drawing.Point(358, 12);
-            this.cboMask.Name = "cboMask";
-            this.cboMask.Size = new System.Drawing.Size(166, 21);
-            this.cboMask.TabIndex = 3;
-            this.cboMask.SelectedIndexChanged += new System.EventHandler(this.cboMask_SelectedIndexChanged);
-            //
-            // frmBaker
-            //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(538, 563);
-            this.Controls.Add(this.cboMask);
-            this.Controls.Add(this.cmdLoadSkin);
-            this.Controls.Add(this.scrollWeight);
-            this.Controls.Add(this.cmdLoadShirt);
-            this.Controls.Add(this.pic1);
-            this.Name = "frmBaker";
-            this.Text = "Baker";
-            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmBaker_FormClosing);
-            this.Load += new System.EventHandler(this.frmBaker_Load);
-            ((System.ComponentModel.ISupportInitialize)(this.pic1)).EndInit();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.PictureBox pic1;
-        private System.Windows.Forms.HScrollBar scrollWeight;
-        private System.Windows.Forms.Button cmdLoadShirt;
-        private System.Windows.Forms.Button cmdLoadSkin;
-        private System.Windows.Forms.ComboBox cboMask;
-
-    }
-}
-
-
diff --git a/old/libsl1550/libsecondlife/examples/Baker/frmBaker.cs b/old/libsl1550/libsecondlife/examples/Baker/frmBaker.cs
deleted file mode 100644
index 678869b..0000000
--- a/old/libsl1550/libsecondlife/examples/Baker/frmBaker.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Text;
-using System.Windows.Forms;
-using System.IO;
-
-namespace Baker
-{
-    public partial class frmBaker : Form
-    {
-        Bitmap AlphaMask;
-
-        public frmBaker()
-        {
-            InitializeComponent();
-        }
-
-        private void frmBaker_Load(object sender, EventArgs e)
-        {
-            cboMask.SelectedIndex = 0;
-            DisplayResource(cboMask.Text);
-        }
-
-        private void DisplayResource(string resource)
-        {
-            Stream stream = libsecondlife.Helpers.GetResourceStream(resource + ".tga");
-
-            if (stream != null)
-            {
-                AlphaMask = OpenJPEGNet.LoadTGAClass.LoadTGA(stream);
-                pic1.Image = Oven.ModifyAlphaMask(AlphaMask, (byte)scrollWeight.Value, 0.0f);
-            }
-            else
-            {
-                MessageBox.Show("Failed to load embedded resource \"" + resource + "\"", "Baker",
-                    MessageBoxButtons.OK, MessageBoxIcon.Error);
-            }
-        }
-
-        private void scrollWeight_Scroll(object sender, ScrollEventArgs e)
-        {
-            pic1.Image = Oven.ModifyAlphaMask(AlphaMask, (byte)scrollWeight.Value, 0.0f);
-        }
-
-        private void frmBaker_FormClosing(object sender, FormClosingEventArgs e)
-        {
-        }
-
-        private void cmdLoadSkin_Click(object sender, EventArgs e)
-        {
-
-        }
-
-        private void cmdLoadShirt_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog dialog = new OpenFileDialog();
-
-
-
-            //dialog.Filter = "JPEG2000 (*.jp2,*.j2c,*.j2k)|";
-            //if (dialog.ShowDialog() == DialogResult.OK)
-            //{
-            //    try
-            //    {
-            //        byte[] j2kdata = File.ReadAllBytes(dialog.FileName);
-            //        Image image = OpenJPEGNet.OpenJPEG.DecodeToImage(j2kdata);
-            //        pic1.Image = image;
-            //    }
-            //    catch (Exception ex)
-            //    {
-            //        MessageBox.Show(ex.Message);
-            //    }
-            //}
-        }
-
-        private void cboMask_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            DisplayResource(cboMask.Text);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/Baker/frmBaker.resx b/old/libsl1550/libsecondlife/examples/Baker/frmBaker.resx
deleted file mode 100644
index 19dc0dd..0000000
--- a/old/libsl1550/libsecondlife/examples/Baker/frmBaker.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/BodyPartMorphGenerator.csproj b/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/BodyPartMorphGenerator.csproj
deleted file mode 100644
index 4654024..0000000
--- a/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/BodyPartMorphGenerator.csproj
+++ /dev/null
@@ -1,48 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{98C44481-3F15-4305-840D-037EA0D9C221}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>BodyPartMorphGenerator</RootNamespace>
-    <AssemblyName>GenBodyParams</AssemblyName>
-    <StartupObject>BodyPartMorphGenerator.GenBodyParams</StartupObject>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="GenBodyParams.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/Properties/AssemblyInfo.cs b/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/Properties/AssemblyInfo.cs
deleted file mode 100644
index 0885e5f..0000000
--- a/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("BodyPartMorphGenerator")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("BodyPartMorphGenerator")]
-[assembly: AssemblyCopyright("Copyright ©  2006")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("d60d839c-ea04-4784-a308-b94f8698b388")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/genbodyparams.cs b/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/genbodyparams.cs
deleted file mode 100644
index 92a40e7..0000000
--- a/old/libsl1550/libsecondlife/examples/BodyPartMorphGenerator/genbodyparams.cs
+++ /dev/null
@@ -1,342 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace BodyPartMorphGenerator
-{
-    class GenBodyParams
-    {
-        static void Main(string[] args)
-        {
-            string FileName = "avatar_lad.xml";
-            string outFileParts = "_BodyShapeParams_.cs";
-
-            if (args.Length < 1)
-            {
-                if (!File.Exists(FileName))
-                {
-                    Console.WriteLine("Usage: genbodyparams [" + FileName + "]");
-                    return;
-                }
-
-            }
-            else
-            {
-                FileName = args[0];
-                if (!File.Exists(FileName))
-                {
-                    Console.WriteLine("Could not find file: " + FileName);
-                    return;
-                }
-            }
-
-            if (args.Length == 2)
-            {
-                outFileParts = args[1];
-            }
-
-            XmlDocument doc = new XmlDocument();
-            doc.LoadXml(File.ReadAllText(FileName));
-
-            XmlNodeList list = doc.GetElementsByTagName("param");
-
-            StringWriter MasterClass = new StringWriter();
-            MasterClass.WriteLine("using System;");
-            MasterClass.WriteLine("using System.Collections.Generic;");
-            MasterClass.WriteLine("using System.IO;");
-            MasterClass.WriteLine("using System.Text;");
-//            MasterClass.WriteLine();
-//            MasterClass.WriteLine("using libsecondlife.AssetSystem.BodyShape;");
-            MasterClass.WriteLine();
-            MasterClass.WriteLine("namespace libsecondlife.AssetSystem");
-            MasterClass.WriteLine("{");
-            MasterClass.WriteLine("    public class BodyShapeParams");
-            MasterClass.WriteLine("    {");
-
-            StringWriter Labels = new StringWriter();
-            Labels.WriteLine("        public static string GetLabel( uint Param )");
-            Labels.WriteLine("        {");
-            Labels.WriteLine("            switch( Param )");
-            Labels.WriteLine("            {");
-            Labels.WriteLine("                default:");
-            Labels.WriteLine("                    return \"\";");
-
-            StringWriter LabelMin = new StringWriter();
-            LabelMin.WriteLine("        public static string GetLabelMin( uint Param )");
-            LabelMin.WriteLine("        {");
-            LabelMin.WriteLine("            switch( Param )");
-            LabelMin.WriteLine("            {");
-            LabelMin.WriteLine("                default:");
-            LabelMin.WriteLine("                    throw new Exception(\"Unknown Body Part Parameter: \" + Param);");
-
-            StringWriter LabelMax = new StringWriter();
-            LabelMax.WriteLine("        public static string GetLabelMax( uint Param )");
-            LabelMax.WriteLine("        {");
-            LabelMax.WriteLine("            switch( Param )");
-            LabelMax.WriteLine("            {");
-            LabelMax.WriteLine("                default:");
-            LabelMax.WriteLine("                    throw new Exception(\"Unknown Body Part Parameter: \" + Param);");
-
-
-            StringWriter Names = new StringWriter();
-            Names.WriteLine("        public static string GetName( uint Param )");
-            Names.WriteLine("        {");
-            Names.WriteLine("            switch( Param )");
-            Names.WriteLine("            {");
-            Names.WriteLine("                default:");
-            Names.WriteLine("                    throw new Exception(\"Unknown Body Part Parameter: \" + Param);");
-
-            StringWriter ValueMin = new StringWriter();
-            ValueMin.WriteLine("        public static float GetValueMin( uint Param )");
-            ValueMin.WriteLine("        {");
-            ValueMin.WriteLine("            switch( Param )");
-            ValueMin.WriteLine("            {");
-            ValueMin.WriteLine("                default:");
-            ValueMin.WriteLine("                    throw new Exception(\"Unknown Body Part Parameter: \" + Param);");
-
-            StringWriter ValueMax = new StringWriter();
-            ValueMax.WriteLine("        public static float GetValueMax( uint Param )");
-            ValueMax.WriteLine("        {");
-            ValueMax.WriteLine("            switch( Param )");
-            ValueMax.WriteLine("            {");
-            ValueMax.WriteLine("                default:");
-            ValueMax.WriteLine("                    throw new Exception(\"Unknown Body Part Parameter: \" + Param);");
-
-            StringWriter ValueDefault = new StringWriter();
-            ValueDefault.WriteLine("        public static float GetValueDefault( uint Param )");
-            ValueDefault.WriteLine("        {");
-            ValueDefault.WriteLine("            switch( Param )");
-            ValueDefault.WriteLine("            {");
-            ValueDefault.WriteLine("                default:");
-            ValueDefault.WriteLine("                    throw new Exception(\"Unknown Body Part Parameter: \" + Param);");
-
-            StringWriter ValueValid = new StringWriter();
-            ValueValid.WriteLine("        public static bool IsValueValid( uint Param, float Value )");
-            ValueValid.WriteLine("        {");
-            ValueValid.WriteLine("            switch( Param )");
-            ValueValid.WriteLine("            {");
-            ValueValid.WriteLine("                default:");
-            ValueValid.WriteLine("                    throw new Exception(\"Unknown Body Part Parameter: \" + Param);");
-
-
-            List<string> EditGroups = new List<string>();
-
-//            XmlTextWriter xtw = new XmlTextWriter(sw);
-
-            File.Delete("ParamTable.csv");
-            StreamWriter ParamTable = File.AppendText("ParamTable.csv");
-            ParamTable.WriteLine("ID\tName\tEditGroup\tLabel\tLabelMin\tLabelMax\tMinValue\tMaxValue");
-
-            foreach( XmlNode node in list )
-            {
-                if ((node.Attributes["shared"] != null) && (node.Attributes["shared"].Value.Equals("1")))
-                {
-                    // this param will have been already been defined
-                    continue;
-                }
-
-                if (
-                    (node.Attributes["edit_group"] != null)
-                     && ( node.Attributes["edit_group"].Value.Equals("driven")
-//                         || node.Attributes["edit_group"].Value.Equals("dummy")
-                        )
-                    )
-                {
-                    // this param is calculated by the client based on other params
-                    continue;
-                }
-/*
-                if( node.Attributes["edit_group"] != null )
-                {
-                    if( !EditGroups.Contains( node.Attributes["edit_group"].Value ) )
-                    {
-                        EditGroups.Add(node.Attributes["edit_group"].Value);
-                        Console.WriteLine(node.Attributes["edit_group"].Value);
-                    }
-                }
-*/
-                // Used to identify which nodes are bodyshape parameter nodes
-                if ( node.Attributes["id"] != null
-                     && node.Attributes["name"] != null
-                     && node.Attributes["wearable"] != null
-                     // && ( (node.Attributes["label"] != null) || (node.Attributes["label_min"] != null) )
-                    )
-                {
-                    string ParamName = node.Attributes["name"].Value;
-                    Console.WriteLine(ParamName);
-                    string ParamEditGroup = "";
-                    if( node.Attributes["edit_group"] != null )
-                    {
-                        ParamEditGroup = node.Attributes["edit_group"].Value;
-                    }
-
-                    string ParamLabel = "";
-                    string ParamLabelMin = "";
-                    string ParamLabelMax = "";
-                    string ParamMin = "";
-                    string ParamMax = "";
-
-
-                    string ID = node.Attributes["id"].Value;
-
-
-
-                    if (node.Attributes["label"] != null)
-                    {
-                        // Label
-                        Labels.WriteLine("                case " + ID + ":");
-                        Labels.WriteLine("                    return \"" + node.Attributes["label"].Value + "\";");
-
-                        ParamLabel = node.Attributes["label"].Value;
-                    }
-
-                    if (node.Attributes["label_min"] != null)
-                    {
-                        // Label Min
-                        LabelMin.WriteLine("                case " + ID + ":");
-                        LabelMin.WriteLine("                    return \"" + node.Attributes["label_min"].Value + "\";");
-
-                        ParamLabelMin = node.Attributes["label_min"].Value;
-                    }
-
-                    if (node.Attributes["label_max"] != null)
-                    {
-                        // Label Max
-                        LabelMax.WriteLine("                case " + ID + ":");
-                        LabelMax.WriteLine("                    return \"" + node.Attributes["label_max"].Value + "\";");
-
-                        ParamLabelMax = node.Attributes["label_max"].Value;
-                    }
-
-                    // Name
-                    Names.WriteLine("                case " + ID + ":");
-                    Names.WriteLine("                    return \"" + node.Attributes["name"].Value + "\";");
-
-                    // Min Values
-                    ValueMin.WriteLine("                case " + ID + ":");
-                    ValueMin.WriteLine("                    return " + node.Attributes["value_min"].Value + "f;");
-
-                    ParamMin = node.Attributes["value_min"].Value;
-
-                    // Max Values
-                    ValueMax.WriteLine("                case " + ID + ":");
-                    ValueMax.WriteLine("                    return " + node.Attributes["value_max"].Value + "f;");
-
-                    ParamMax = node.Attributes["value_max"].Value;
-
-                    // Default values
-                    if (node.Attributes["value_default"] != null)
-                    {
-                        ValueDefault.WriteLine("                case " + ID + ":");
-                        ValueDefault.WriteLine("                    return " + node.Attributes["value_default"].Value + "f;");
-                    }
-                    else
-                    {
-                        ValueDefault.WriteLine("                case " + ID + ":");
-                        ValueDefault.WriteLine("                    return " + node.Attributes["value_min"].Value + "f;");
-                    }
-
-                    // Validation Values
-                    ValueValid.WriteLine("                case " + node.Attributes["id"].Value + ":");
-                    ValueValid.WriteLine("                    return ( (Value >= " + node.Attributes["value_min"].Value + "f) && (Value <= " + node.Attributes["value_max"].Value + "f) );");
-
-                    ParamTable.WriteLine(    ID
-                                    + "\t" + ParamName
-                                    + "\t" + ParamEditGroup
-                                    + "\t" + ParamLabel
-                                    + "\t" + ParamLabelMin
-                                    + "\t" + ParamLabelMax
-                                    + "\t" + ParamMin
-                                    + "\t" + ParamMax);
-                }
-            }
-
-            ParamTable.Flush();
-            ParamTable.Close();
-
-            // Finish up name stuff
-            Names.WriteLine("            }"); // Close switch
-            Names.WriteLine("        }"); // Close method
-
-            // Finish up label stuff
-            Labels.WriteLine("            }"); // Close  switch
-            Labels.WriteLine("        }"); // Close  method
-
-            // Finish up min label stuff
-            LabelMin.WriteLine("            }"); // Close  switch
-            LabelMin.WriteLine("        }"); // Close  method
-
-            // Finish up max label stuff
-            LabelMax.WriteLine("            }"); // Close  switch
-            LabelMax.WriteLine("        }"); // Close  method
-
-            // Finish up Max Value stuff
-            ValueMin.WriteLine("            }"); // Close  switch
-            ValueMin.WriteLine("        }"); // Close  method
-
-            // Finish up Min Value stuff
-            ValueMax.WriteLine("            }"); // Close  switch
-            ValueMax.WriteLine("        }"); // Close  method
-
-            // Finish up Default Value stuff
-            ValueDefault.WriteLine("            }"); // Close  switch
-            ValueDefault.WriteLine("        }"); // Close  method
-
-            // Finish up Value Valid stuff
-            ValueValid.WriteLine("            }"); // Close  switch
-            ValueValid.WriteLine("        }"); // Close  method
-
-
-            StringWriter ValidateAll = new StringWriter();
-            ValidateAll.WriteLine("        public static bool IsValid( Dictionary<uint,float> BodyShape )");
-            ValidateAll.WriteLine("        {");
-            ValidateAll.WriteLine("            foreach(KeyValuePair<uint, float> kvp in BodyShape)");
-            ValidateAll.WriteLine("            {");
-            ValidateAll.WriteLine("                if( !IsValueValid(kvp.Key, kvp.Value) ) { return false; }");
-            ValidateAll.WriteLine("            }");
-            ValidateAll.WriteLine("");
-            ValidateAll.WriteLine("            return true;");
-            ValidateAll.WriteLine("        }");
-
-            StringWriter ToString = new StringWriter();
-            ToString.WriteLine("        public static string ToString( Dictionary<uint,float> BodyShape )");
-            ToString.WriteLine("        {");
-            ToString.WriteLine("            StringWriter sw = new StringWriter();");
-            ToString.WriteLine("");
-            ToString.WriteLine("            foreach(KeyValuePair<uint, float> kvp in BodyShape)");
-            ToString.WriteLine("            {");
-            ToString.WriteLine("                sw.Write( kvp.Key + \":\" );");
-            ToString.WriteLine("                sw.Write( GetLabel(kvp.Key) + \":\" );");
-            ToString.WriteLine("                sw.WriteLine( kvp.Value );");
-            ToString.WriteLine("            }");
-            ToString.WriteLine("");
-            ToString.WriteLine("            return sw.ToString();");
-            ToString.WriteLine("        }");
-
-
-
-            // Combine Master Class
-            MasterClass.Write(Names.ToString());
-            MasterClass.Write(Labels.ToString());
-            MasterClass.Write(LabelMin.ToString());
-            MasterClass.Write(LabelMax.ToString());
-            MasterClass.Write(ValueMin.ToString());
-            MasterClass.Write(ValueMax.ToString());
-            MasterClass.Write(ValueDefault.ToString());
-            MasterClass.Write(ValueValid.ToString());
-            MasterClass.Write(ValidateAll.ToString());
-            MasterClass.Write(ToString.ToString());
-
-            // Finish up the file
-            MasterClass.WriteLine("    }"); // Close Class
-            MasterClass.WriteLine("}"); // Close Namespace
-
-            Console.WriteLine("Writing " + outFileParts + "...");
-            File.WriteAllText(outFileParts, MasterClass.ToString());
-
-            // Console.WriteLine(PartClasses.ToString());
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/GUITestClient.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/GUITestClient.cs
deleted file mode 100644
index 562dc51..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/GUITestClient.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace libsecondlife.GUITestClient
-{
-    static class Program
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new frmTestClient());
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/GUITestClient.csproj b/old/libsl1550/libsecondlife/examples/GUITestClient/GUITestClient.csproj
deleted file mode 100644
index ef0f555..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/GUITestClient.csproj
+++ /dev/null
@@ -1,89 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{9E0EE72D-AAA7-42EC-8E59-2C3EA5ED6D98}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>GUITestClient</RootNamespace>
-    <AssemblyName>GUITestClient</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Deployment" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Interfaces\MinimapInterface.cs" />
-    <Compile Include="Interfaces\TeleportInterface.cs" />
-    <Compile Include="frmTestClient.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="frmTestClient.Designer.cs">
-      <DependentUpon>frmTestClient.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Interface.cs" />
-    <Compile Include="GUITestClient.cs" />
-    <Compile Include="Interfaces\HeightmapInterface.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="frmTestClient.resx">
-      <SubType>Designer</SubType>
-      <DependentUpon>frmTestClient.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Resources.resx</DependentUpon>
-      <DesignTime>True</DesignTime>
-    </Compile>
-    <None Include="Properties\Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
-    <Compile Include="Properties\Settings.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Settings.settings</DependentUpon>
-      <DesignTimeSharedInput>True</DesignTimeSharedInput>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Interface.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/Interface.cs
deleted file mode 100644
index 71ed38e..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Interface.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Collections.Generic;
-
-namespace libsecondlife.GUITestClient
-{
-    public abstract class Interface
-    {
-        public string Name;
-        public string Description;
-        public SecondLife Client;
-        public TabPage TabPage;
-
-        public abstract void Initialize();
-
-        public abstract void Paint(object sender, PaintEventArgs e);
-
-        /// <summary>
-        /// When set to true, think will be called.
-        /// </summary>
-        public bool Active;
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/HeightmapInterface.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/HeightmapInterface.cs
deleted file mode 100644
index 64c99d9..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/HeightmapInterface.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Windows.Forms;
-using libsecondlife;
-
-namespace libsecondlife.GUITestClient
-{
-    public class HeightmapInterface : Interface
-    {
-        private PictureBox[,] Boxes = new PictureBox[16, 16];
-
-        public HeightmapInterface(frmTestClient testClient)
-        {
-            Name = "Heightmap";
-            Description = "Displays a graphical heightmap of the current simulator";
-        }
-
-        public override void Initialize()
-        {
-            Client.Terrain.OnLandPatch += new TerrainManager.LandPatchCallback(Terrain_OnLandPatch);
-            Client.Settings.STORE_LAND_PATCHES = true;
-
-            for (int y = 0; y < 16; y++)
-            {
-                for (int x = 0; x < 16; x++)
-                {
-                    Boxes[x, y] = new System.Windows.Forms.PictureBox();
-                    PictureBox box = Boxes[x, y];
-                    ((System.ComponentModel.ISupportInitialize)(box)).BeginInit();
-                    box.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-                    box.Name = x + "," + y;
-                    box.Location = new System.Drawing.Point(x * 16, y * 16);
-                    box.Size = new System.Drawing.Size(16, 16);
-                    box.Visible = true;
-                    //box.MouseUp += new MouseEventHandler(box_MouseUp);
-                    ((System.ComponentModel.ISupportInitialize)(box)).EndInit();
-
-                    TabPage.Controls.Add(box);
-                }
-            }
-        }
-
-        public override void Paint(object sender, PaintEventArgs e)
-        {
-            ;
-        }
-
-        void Terrain_OnLandPatch(Simulator simulator, int x, int y, int width, float[] data)
-        {
-            if (x >= 16 || y >= 16)
-            {
-                Console.WriteLine("Bad patch coordinates, x = " + x + ", y = " + y);
-                return;
-            }
-
-            if (width != 16)
-            {
-                Console.WriteLine("Unhandled patch size " + width + "x" + width);
-                return;
-            }
-
-            Bitmap patch = new Bitmap(16, 16, PixelFormat.Format24bppRgb);
-
-            for (int yp = 0; yp < 16; yp++)
-            {
-                for (int xp = 0; xp < 16; xp++)
-                {
-                    float height = data[yp * 16 + xp];
-                    int colorVal = Helpers.FloatToByte(height, 0.0f, 60.0f);
-                    int lesserVal = (int)((float)colorVal * 0.75f);
-                    Color color;
-
-                    if (height >= simulator.WaterHeight)
-                        color = Color.FromArgb(lesserVal, colorVal, lesserVal);
-                    else
-                        color = Color.FromArgb(lesserVal, lesserVal, colorVal);
-
-                    patch.SetPixel(xp, yp, color);
-                }
-            }
-
-            Boxes[x, y].Image = (System.Drawing.Image)patch;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/MinimapInterface.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/MinimapInterface.cs
deleted file mode 100644
index d8a06ea..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/MinimapInterface.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing.Imaging;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using libsecondlife;
-using System.Net;
-using System.Diagnostics;
-
-namespace libsecondlife.GUITestClient
-{
-    public class MinimapInterface : Interface
-    {
-        //A magic number to calculate index sim y coord from actual coord
-        private const int GRID_Y_OFFSET = 1279;
-        //Base URL for web map api sim images
-        private const String MAP_IMG_URL = "http://secondlife.com/apps/mapapi/grid/map_image/";
-        private PictureBox world = new PictureBox();
-        private Button cmdRefresh = new Button();
-        private System.Drawing.Image mMapImage = null;
-        private string oldSim = String.Empty;
-
-        public MinimapInterface(frmTestClient testClient)
-        {
-            Name = "Minimap";
-            Description = "Displays a graphical minimap of the current simulator";
-        }
-
-        private void map_onclick(object sender, System.EventArgs e)
-        {
-            ;
-        }
-
-        private void cmdRefresh_onclick(object sender, System.EventArgs e)
-        {
-            printMap();
-        }
-
-        public void printMap()
-        {
-            Bitmap map      = new Bitmap(256, 256, PixelFormat.Format32bppRgb);
-            Font font       = new Font("Tahoma", 8, FontStyle.Bold);
-            Pen mAvPen      = new Pen(Brushes.GreenYellow, 1);
-            Brush mAvBrush  = new SolidBrush(Color.Green);
-            String strInfo  = String.Empty;
-
-            // Get new background map if necessary
-            if (mMapImage == null || oldSim != Client.Network.CurrentSim.Name)
-            {
-                oldSim = Client.Network.CurrentSim.Name;
-                mMapImage = DownloadWebMapImage();
-            }
-
-            // Create in memory bitmap
-            using (Graphics g = Graphics.FromImage(map))
-            {
-                // Draw background map
-                g.DrawImage(mMapImage, new Rectangle(0, 0, 256, 256), 0, 0, 256, 256, GraphicsUnit.Pixel);
-
-                // Draw all avatars
-                Client.Network.CurrentSim.AvatarPositions.ForEach(
-                    delegate(LLVector3 pos)
-                    {
-                        Rectangle rect = new Rectangle((int)Math.Round(pos.X, 0) - 2, 255 - ((int)Math.Round(pos.Y, 0) - 2), 4, 4);
-                        g.FillEllipse(mAvBrush, rect);
-                        g.DrawEllipse(mAvPen, rect);
-                    }
-                );
-
-                // Draw self ;)
-                Rectangle myrect = new Rectangle((int)Math.Round(Client.Self.SimPosition.X, 0) - 3, 255 - ((int)Math.Round(Client.Self.SimPosition.Y, 0) - 3), 6, 6);
-                g.FillEllipse(new SolidBrush(Color.Yellow), myrect);
-                g.DrawEllipse(new Pen(Brushes.Goldenrod, 1), myrect);
-
-                // Draw region info
-                strInfo = string.Format("Sim {0}/{1}/{2}/{3}\nAvatars {4}", Client.Network.CurrentSim.Name,
-                                                                            Math.Round(Client.Self.SimPosition.X, 0),
-                                                                            Math.Round(Client.Self.SimPosition.Y, 0),
-                                                                            Math.Round(Client.Self.SimPosition.Z, 0),
-                                                                            Client.Network.CurrentSim.AvatarPositions.Count);
-                g.DrawString(strInfo, font, Brushes.DarkOrange, 4, 4);
-            }
-            // update picture box with new map bitmap
-            world.BackgroundImage = map;
-        }
-
-        public override void Initialize()
-        {
-            ((System.ComponentModel.ISupportInitialize)(world)).BeginInit();
-            world.BorderStyle   = System.Windows.Forms.BorderStyle.FixedSingle;
-            world.Size          = new System.Drawing.Size(256, 256);
-            world.Visible       = true;
-            world.Click         += new System.EventHandler(this.map_onclick);
-            ((System.ComponentModel.ISupportInitialize)(world)).EndInit();
-
-            //((System.ComponentModel.ISupportInitialize)(cmdRefresh)).BeginInit();
-            cmdRefresh.Text     = "Refresh";
-            cmdRefresh.Size     = new System.Drawing.Size(80, 24);
-            cmdRefresh.Left     = world.Left + world.Width + 20;
-            cmdRefresh.Click    += new System.EventHandler(this.cmdRefresh_onclick);
-            cmdRefresh.Visible  = true;
-            //((System.ComponentModel.ISupportInitialize)(world)).EndInit();
-
-            TabPage.Controls.Add(world);
-            TabPage.Controls.Add(cmdRefresh);
-        }
-
-        // Ripped from "Terrain Scultor" by Cadroe with minors changes
-        // http://spinmass.blogspot.com/2007/08/terrain-sculptor-maps-sims-and-creates.html
-        private System.Drawing.Image DownloadWebMapImage()
-        {
-            HttpWebRequest request = null;
-            HttpWebResponse response = null;
-            String imgURL = "";
-            GridRegion currRegion;
-
-            Client.Grid.GetGridRegion(Client.Network.CurrentSim.Name, GridLayerType.Terrain, out currRegion);
-            try
-            {
-                //Form the URL using the sim coordinates
-                imgURL = MAP_IMG_URL + currRegion.X.ToString() + "-" +
-                        (GRID_Y_OFFSET - currRegion.Y).ToString() + "-1-0";
-                //Make the http request
-                request = (HttpWebRequest)HttpWebRequest.Create(imgURL);
-                request.Timeout = 5000;
-                request.ReadWriteTimeout = 20000;
-                response = (HttpWebResponse)request.GetResponse();
-
-                return System.Drawing.Image.FromStream(response.GetResponseStream());
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.ToString(), "Error Downloading Web Map Image");
-                return null;
-            }
-        }
-
-        public override void Paint(object sender, PaintEventArgs e)
-        {
-            ;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/TeleportInterface.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/TeleportInterface.cs
deleted file mode 100644
index 35a174b..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Interfaces/TeleportInterface.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Drawing.Imaging;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using libsecondlife;
-
-namespace libsecondlife.GUITestClient
-{
-    class TeleportInterface : Interface
-    {
-        private System.Windows.Forms.Button     cmdTeleport;
-        private System.Windows.Forms.TextBox    txtLocation;
-        private System.Windows.Forms.Label      lblLocation;
-
-        public TeleportInterface(frmTestClient testClient)
-        {
-            Name = "Teleport";
-            Description = "Teleport your's agent in SL Grid";
-        }
-
-        public override void Initialize()
-        {
-            txtLocation         = new System.Windows.Forms.TextBox();
-            txtLocation.Size    = new System.Drawing.Size(238, 24);
-            txtLocation.Top     = 100;
-            txtLocation.Left    = 12;
-
-            lblLocation         = new System.Windows.Forms.Label();
-            lblLocation.Size    = new System.Drawing.Size(238, 24);
-            lblLocation.Top     = txtLocation.Top - 16;
-            lblLocation.Left    = txtLocation.Left;
-            lblLocation.Text    = "Location (eg: sim/x/y/z)";
-
-            cmdTeleport         = new System.Windows.Forms.Button();
-            cmdTeleport.Size    = new System.Drawing.Size(120, 24);
-            cmdTeleport.Top     = 100; cmdTeleport.Left = 257;
-            cmdTeleport.Text    = "Teleport !";
-            cmdTeleport.Click   += new System.EventHandler(this.cmdTeleport_OnClick);
-
-            TabPage.Controls.Add(txtLocation);
-            TabPage.Controls.Add(lblLocation);
-            TabPage.Controls.Add(cmdTeleport);
-        }
-
-        private void cmdTeleport_OnClick(object sender, System.EventArgs e)
-        {
-            String destination = txtLocation.Text.Trim();
-
-            string[] tokens = destination.Split(new char[] { '/' });
-            if (tokens.Length != 4)
-                goto error_handler;
-
-            string sim = tokens[0];
-            float x, y, z;
-            if (!float.TryParse(tokens[1], out x) ||
-                !float.TryParse(tokens[2], out y) ||
-                !float.TryParse(tokens[3], out z))
-            {
-                goto error_handler;
-            }
-
-            if (Client.Self.Teleport(sim, new LLVector3(x, y, z)))
-                MessageBox.Show("Teleported to " + Client.Network.CurrentSim, "Teleport");
-            else
-                MessageBox.Show("Teleport failed: " + Client.Self.TeleportMessage, "Teleport");
-            return;
-
-            error_handler:
-                MessageBox.Show("Location must to be sim/x/y/z", "Teleport");
-        }
-
-        public override void Paint(object sender, PaintEventArgs e)
-        {
-            ;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/AssemblyInfo.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/AssemblyInfo.cs
deleted file mode 100644
index c6624f5..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("GUITestClient")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Metaverse Industries LLC")]
-[assembly: AssemblyProduct("GUITestClient")]
-[assembly: AssemblyCopyright("Copyright © Metaverse Industries LLC 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("07b6c35c-78c2-4850-8ece-d99e1284959f")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Resources.Designer.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Resources.Designer.cs
deleted file mode 100644
index aed507f..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace GUITestClient.Properties {
-    using System;
-
-
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources {
-
-        private static global::System.Resources.ResourceManager resourceMan;
-
-        private static global::System.Globalization.CultureInfo resourceCulture;
-
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources() {
-        }
-
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
-            get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GUITestClient.Properties.Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Resources.resx b/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Settings.Designer.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Settings.Designer.cs
deleted file mode 100644
index fea1599..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace GUITestClient.Properties {
-
-
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
-        public static Settings Default {
-            get {
-                return defaultInstance;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Settings.settings b/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Settings.settings
deleted file mode 100644
index 3964565..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.Designer.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.Designer.cs
deleted file mode 100644
index bc7af55..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.Designer.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-namespace libsecondlife.GUITestClient
-{
-    partial class frmTestClient
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.tabControl = new System.Windows.Forms.TabControl();
-            this.tabLogin = new System.Windows.Forms.TabPage();
-            this.cmdConnect = new System.Windows.Forms.Button();
-            this.label3 = new System.Windows.Forms.Label();
-            this.txtPassword = new System.Windows.Forms.TextBox();
-            this.label2 = new System.Windows.Forms.Label();
-            this.txtLastName = new System.Windows.Forms.TextBox();
-            this.label1 = new System.Windows.Forms.Label();
-            this.txtFirstName = new System.Windows.Forms.TextBox();
-            this.tabControl.SuspendLayout();
-            this.tabLogin.SuspendLayout();
-            this.SuspendLayout();
-            //
-            // tabControl
-            //
-            this.tabControl.Controls.Add(this.tabLogin);
-            this.tabControl.Location = new System.Drawing.Point(12, 12);
-            this.tabControl.Name = "tabControl";
-            this.tabControl.SelectedIndex = 0;
-            this.tabControl.Size = new System.Drawing.Size(400, 400);
-            this.tabControl.TabIndex = 0;
-            //
-            // tabLogin
-            //
-            this.tabLogin.Controls.Add(this.cmdConnect);
-            this.tabLogin.Controls.Add(this.label3);
-            this.tabLogin.Controls.Add(this.txtPassword);
-            this.tabLogin.Controls.Add(this.label2);
-            this.tabLogin.Controls.Add(this.txtLastName);
-            this.tabLogin.Controls.Add(this.label1);
-            this.tabLogin.Controls.Add(this.txtFirstName);
-            this.tabLogin.Location = new System.Drawing.Point(4, 22);
-            this.tabLogin.Name = "tabLogin";
-            this.tabLogin.Padding = new System.Windows.Forms.Padding(3);
-            this.tabLogin.Size = new System.Drawing.Size(392, 374);
-            this.tabLogin.TabIndex = 0;
-            this.tabLogin.Text = "Login";
-            this.tabLogin.UseVisualStyleBackColor = true;
-            //
-            // cmdConnect
-            //
-            this.cmdConnect.Location = new System.Drawing.Point(257, 181);
-            this.cmdConnect.Name = "cmdConnect";
-            this.cmdConnect.Size = new System.Drawing.Size(120, 24);
-            this.cmdConnect.TabIndex = 59;
-            this.cmdConnect.Text = "Connect";
-            this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
-            //
-            // label3
-            //
-            this.label3.Location = new System.Drawing.Point(257, 139);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(120, 16);
-            this.label3.TabIndex = 58;
-            this.label3.Text = "Password";
-            //
-            // txtPassword
-            //
-            this.txtPassword.Location = new System.Drawing.Point(257, 155);
-            this.txtPassword.Name = "txtPassword";
-            this.txtPassword.PasswordChar = '*';
-            this.txtPassword.Size = new System.Drawing.Size(120, 20);
-            this.txtPassword.TabIndex = 57;
-            //
-            // label2
-            //
-            this.label2.Location = new System.Drawing.Point(138, 139);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(120, 16);
-            this.label2.TabIndex = 56;
-            this.label2.Text = "Last Name";
-            //
-            // txtLastName
-            //
-            this.txtLastName.Location = new System.Drawing.Point(138, 155);
-            this.txtLastName.Name = "txtLastName";
-            this.txtLastName.Size = new System.Drawing.Size(112, 20);
-            this.txtLastName.TabIndex = 55;
-            //
-            // label1
-            //
-            this.label1.Location = new System.Drawing.Point(12, 139);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(120, 16);
-            this.label1.TabIndex = 54;
-            this.label1.Text = "First Name";
-            //
-            // txtFirstName
-            //
-            this.txtFirstName.Location = new System.Drawing.Point(12, 155);
-            this.txtFirstName.Name = "txtFirstName";
-            this.txtFirstName.Size = new System.Drawing.Size(120, 20);
-            this.txtFirstName.TabIndex = 53;
-            //
-            // frmTestClient
-            //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(427, 420);
-            this.Controls.Add(this.tabControl);
-            this.Name = "frmTestClient";
-            this.Text = "GUI Test Client";
-            this.Paint += new System.Windows.Forms.PaintEventHandler(this.frmTestClient_Paint);
-            this.tabControl.ResumeLayout(false);
-            this.tabLogin.ResumeLayout(false);
-            this.tabLogin.PerformLayout();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.TabControl tabControl;
-        private System.Windows.Forms.TabPage tabLogin;
-        private System.Windows.Forms.Button cmdConnect;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.TextBox txtPassword;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.TextBox txtLastName;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.TextBox txtFirstName;
-    }
-}
-
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.cs b/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.cs
deleted file mode 100644
index b973786..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using System.Reflection;
-using libsecondlife;
-
-namespace libsecondlife.GUITestClient
-{
-    public partial class frmTestClient : Form
-    {
-        private SecondLife Client = new SecondLife();
-        private Dictionary<Interface, TabPage> Interfaces = new Dictionary<Interface, TabPage>();
-
-        public frmTestClient()
-        {
-            Client.Settings.MULTIPLE_SIMS = false;
-
-            InitializeComponent();
-
-            RegisterAllPlugins(Assembly.GetExecutingAssembly());
-            EnablePlugins(false);
-        }
-
-        private void cmdConnect_Click(object sender, EventArgs e)
-        {
-            if (cmdConnect.Text == "Connect")
-            {
-                cmdConnect.Text = "Disconnect";
-                txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;
-
-                if (Client.Network.Login(txtFirstName.Text, txtLastName.Text, txtPassword.Text, "GUITestClient",
-                    "jhurliman@wsu.edu"))
-                {
-                    EnablePlugins(true);
-                }
-                else
-                {
-                    MessageBox.Show(this, String.Format("Error logging in ({0}): {1}", Client.Network.LoginErrorKey,
-                        Client.Network.LoginMessage));
-                    cmdConnect.Text = "Connect";
-                    txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
-                    EnablePlugins(false);
-                }
-            }
-            else
-            {
-                Client.Network.Logout();
-                cmdConnect.Text = "Connect";
-                txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
-                EnablePlugins(false);
-            }
-        }
-
-        private void EnablePlugins(bool enable)
-        {
-            tabControl.TabPages.Clear();
-            tabControl.TabPages.Add(tabLogin);
-
-            if (enable)
-            {
-                lock (Interfaces)
-                {
-                    foreach (TabPage page in Interfaces.Values)
-                    {
-                        tabControl.TabPages.Add(page);
-                    }
-                }
-            }
-        }
-
-        private void RegisterAllPlugins(Assembly assembly)
-        {
-            foreach (Type t in assembly.GetTypes())
-            {
-                try
-                {
-                    if (t.IsSubclassOf(typeof(Interface)))
-                    {
-                        ConstructorInfo[] infos = t.GetConstructors();
-                        Interface iface = (Interface)infos[0].Invoke(new object[] { this });
-                        RegisterPlugin(iface);
-                    }
-                }
-                catch (Exception e)
-                {
-                    MessageBox.Show(e.ToString());
-                }
-            }
-        }
-
-        private void RegisterPlugin(Interface iface)
-        {
-            TabPage page = new TabPage();
-            tabControl.TabPages.Add(page);
-
-            iface.Client = Client;
-            iface.TabPage = page;
-
-            if (!Interfaces.ContainsKey(iface))
-            {
-                lock (Interfaces) Interfaces.Add(iface, page);
-            }
-
-            iface.Initialize();
-
-            page.Text = iface.Name;
-            page.ToolTipText = iface.Description;
-        }
-
-        private void frmTestClient_Paint(object sender, PaintEventArgs e)
-        {
-            lock (Interfaces)
-            {
-                foreach (Interface iface in Interfaces.Keys)
-                {
-                    iface.Paint(sender, e);
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.resx b/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.resx
deleted file mode 100644
index 19dc0dd..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/frmTestClient.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/GUITestClient.csproj.FileList.txt b/old/libsl1550/libsecondlife/examples/GUITestClient/obj/GUITestClient.csproj.FileList.txt
deleted file mode 100644
index ae61786..0000000
--- a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/GUITestClient.csproj.FileList.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-..\..\..\bin\GUITestClient.exe
-..\..\..\bin\GUITestClient.pdb
-obj\Release\ResolveAssemblyReference.cache
-obj\Release\libsecondlife.GUITestClient.frmTestClient.resources
-obj\Release\GUITestClient.Properties.Resources.resources
-obj\Release\GUITestClient.csproj.GenerateResource.Cache
-obj\Release\GUITestClient.exe
-obj\Release\GUITestClient.pdb
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.Properties.Resources.resources b/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.Properties.Resources.resources
deleted file mode 100644
index 06c24d0..0000000
Binary files a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.Properties.Resources.resources and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.csproj.GenerateResource.Cache b/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.csproj.GenerateResource.Cache
deleted file mode 100644
index d9021c4..0000000
Binary files a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.csproj.GenerateResource.Cache and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.exe b/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.exe
deleted file mode 100644
index 289615a..0000000
Binary files a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.exe and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.pdb b/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.pdb
deleted file mode 100644
index afe4e03..0000000
Binary files a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/GUITestClient.pdb and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/TempPE/Properties.Resources.Designer.cs.dll b/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/TempPE/Properties.Resources.Designer.cs.dll
deleted file mode 100644
index d801bea..0000000
Binary files a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/TempPE/Properties.Resources.Designer.cs.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/libsecondlife.GUITestClient.frmTestClient.resources b/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/libsecondlife.GUITestClient.frmTestClient.resources
deleted file mode 100644
index 06c24d0..0000000
Binary files a/old/libsl1550/libsecondlife/examples/GUITestClient/obj/Release/libsecondlife.GUITestClient.frmTestClient.resources and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Heightmap/Heightmap.cs b/old/libsl1550/libsecondlife/examples/Heightmap/Heightmap.cs
deleted file mode 100644
index 1ae8f1e..0000000
--- a/old/libsl1550/libsecondlife/examples/Heightmap/Heightmap.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace Heightmap
-{
-    static class Heightmap
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main(string[] args)
-        {
-            if (args.Length != 3)
-            {
-                Console.WriteLine("Usage: [FirstName] [LastName] [password]");
-                Console.WriteLine("Press any key to continue...");
-                Console.ReadKey();
-                return;
-            }
-
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new frmHeightmap(args[0], args[1], args[2]));
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/Heightmap/Heightmap.csproj b/old/libsl1550/libsecondlife/examples/Heightmap/Heightmap.csproj
deleted file mode 100644
index b76d1dc..0000000
--- a/old/libsl1550/libsecondlife/examples/Heightmap/Heightmap.csproj
+++ /dev/null
@@ -1,70 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{D9669D08-AC81-4F45-AD23-82787C6EFBBA}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Heightmap</RootNamespace>
-    <AssemblyName>Heightmap</AssemblyName>
-    <StartupObject>
-    </StartupObject>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Deployment" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="frmHeightmap.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="frmHeightmap.Designer.cs">
-      <DependentUpon>frmHeightmap.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Heightmap.cs" />
-    <EmbeddedResource Include="frmHeightmap.resx">
-      <SubType>Designer</SubType>
-      <DependentUpon>frmHeightmap.cs</DependentUpon>
-    </EmbeddedResource>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Properties\" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.Designer.cs b/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.Designer.cs
deleted file mode 100644
index 32e0a38..0000000
--- a/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.Designer.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace Heightmap
-{
-    partial class frmHeightmap
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.SuspendLayout();
-            //
-            // frmHeightmap
-            //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(256, 256);
-            this.Name = "frmHeightmap";
-            this.Text = "Heightmap";
-            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmHeightmap_FormClosing);
-            this.Load += new System.EventHandler(this.frmHeightmap_Load);
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-    }
-}
-
diff --git a/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.cs b/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.cs
deleted file mode 100644
index 634ffc9..0000000
--- a/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Text;
-using System.Windows.Forms;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace Heightmap
-{
-    public partial class frmHeightmap : Form
-    {
-        private SecondLife Client = new SecondLife();
-        private PictureBox[,] Boxes = new PictureBox[16, 16];
-        private System.Timers.Timer UpdateTimer = new System.Timers.Timer(1000);
-        private string FirstName, LastName, Password;
-
-        double heading = -Math.PI;
-
-        public frmHeightmap(string firstName, string lastName, string password)
-        {
-            FirstName = firstName;
-            LastName = lastName;
-            Password = password;
-
-            // Throttle land up and other things down
-            Client.Throttle.Cloud = 0;
-            Client.Throttle.Land = 1000000;
-            Client.Throttle.Wind = 0;
-
-            Client.Settings.MULTIPLE_SIMS = false;
-
-            // Build the picture boxes
-            this.SuspendLayout();
-            for (int y = 0; y < 16; y++)
-            {
-                for (int x = 0; x < 16; x++)
-                {
-                    Boxes[x, y] = new System.Windows.Forms.PictureBox();
-                    PictureBox box = Boxes[x, y];
-                    ((System.ComponentModel.ISupportInitialize)(box)).BeginInit();
-                    box.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-                    box.Name = x + "," + y;
-                    box.Location = new System.Drawing.Point(x * 16, y * 16);
-                    box.Size = new System.Drawing.Size(16, 16);
-                    box.Visible = true;
-                    box.MouseUp += new MouseEventHandler(box_MouseUp);
-                    ((System.ComponentModel.ISupportInitialize)(box)).EndInit();
-
-                    this.Controls.Add(box);
-                }
-            }
-            this.ResumeLayout();
-
-            InitializeComponent();
-        }
-
-        private void frmHeightmap_Load(object sender, EventArgs e)
-        {
-            Client.Terrain.OnLandPatch += new TerrainManager.LandPatchCallback(Terrain_OnLandPatch);
-            // Only needed so we can do lookups with TerrainHeightAtPoint
-            Client.Settings.STORE_LAND_PATCHES = true;
-
-            if (!Client.Network.Login(FirstName, LastName, Password, "Heightmap", "jhurliman@wsu.edu"))
-            {
-                Console.WriteLine("Login failed: " + Client.Network.LoginMessage);
-                Console.ReadKey();
-                this.Close();
-                return;
-            }
-            else
-            {
-                UpdateTimer.Elapsed += new System.Timers.ElapsedEventHandler(UpdateTimer_Elapsed);
-                UpdateTimer.Start();
-            }
-        }
-
-        private void box_MouseUp(object sender, MouseEventArgs e)
-        {
-            for (int y = 0; y < 16; y++)
-            {
-                for (int x = 0; x < 16; x++)
-                {
-                    if (Boxes[x, y] == sender)
-                    {
-                        float height;
-                        if (Client.Terrain.TerrainHeightAtPoint(Client.Network.CurrentSim.Handle,
-                            x * 16 + e.X, y * 16 + e.Y, out height))
-                        {
-                            MessageBox.Show(height.ToString());
-                        }
-                        else
-                        {
-                            MessageBox.Show("Unknown height");
-                        }
-                        return;
-                    }
-                }
-            }
-        }
-
-        void UpdateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
-        {
-            // Spin our camera in circles at the center of the sim to load all the terrain
-            heading += 0.5d;
-            if (heading > Math.PI) heading = -Math.PI;
-
-            Client.Self.Movement.UpdateFromHeading(heading, false);
-        }
-
-        void Terrain_OnLandPatch(Simulator simulator, int x, int y, int width, float[] data)
-        {
-            if (x >= 16 || y >= 16)
-            {
-                Console.WriteLine("Bad patch coordinates, x = " + x + ", y = " + y);
-                return;
-            }
-
-            if (width != 16)
-            {
-                Console.WriteLine("Unhandled patch size " + width + "x" + width);
-                return;
-            }
-
-            Bitmap patch = new Bitmap(16, 16, PixelFormat.Format24bppRgb);
-
-            for (int yp = 0; yp < 16; yp++)
-            {
-                for (int xp = 0; xp < 16; xp++)
-                {
-                    float height = data[yp * 16 + xp];
-                    int colorVal = Helpers.FloatToByte(height, 0.0f, 60.0f);
-                    int lesserVal = (int)((float)colorVal * 0.75f);
-                    Color color;
-
-                    if (height >= simulator.WaterHeight)
-                        color = Color.FromArgb(lesserVal, colorVal, lesserVal);
-                    else
-                        color = Color.FromArgb(lesserVal, lesserVal, colorVal);
-
-                    patch.SetPixel(xp, yp, color);
-                }
-            }
-
-            Boxes[x, y].Image = (System.Drawing.Image)patch;
-        }
-
-        private void frmHeightmap_FormClosing(object sender, FormClosingEventArgs e)
-        {
-            Client.Network.Logout();
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.resx b/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.resx
deleted file mode 100644
index 19dc0dd..0000000
--- a/old/libsl1550/libsecondlife/examples/Heightmap/frmHeightmap.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/CookComputing.XmlRpcV2.dll b/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/CookComputing.XmlRpcV2.dll
deleted file mode 100644
index 4dd869c..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/CookComputing.XmlRpcV2.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/key2name.exe b/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/key2name.exe
deleted file mode 100644
index f837b51..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/key2name.exe and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.Utilities.dll b/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.Utilities.dll
deleted file mode 100644
index bbc662c..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.Utilities.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.Utilities.pdb b/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.Utilities.pdb
deleted file mode 100644
index d9a52dd..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.Utilities.pdb and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.dll b/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.dll
deleted file mode 100644
index c2f9982..0000000
Binary files a/old/libsl1550/libsecondlife/examples/Key2Name/bin/Release/libsecondlife.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/Key2Name/key2name.cs b/old/libsl1550/libsecondlife/examples/Key2Name/key2name.cs
deleted file mode 100644
index 42a64fa..0000000
--- a/old/libsl1550/libsecondlife/examples/Key2Name/key2name.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace Key2Name
-{
-    class Program
-    {
-        static System.Threading.AutoResetEvent NameEvent = new System.Threading.AutoResetEvent(false);
-
-        static void Main(string[] args)
-        {
-            if (args.Length < 4)
-            {
-                Console.WriteLine("Usage: Key2Name [loginfirstname] [loginlastname] [password] [key]");
-                return;
-            }
-
-            SecondLife client = new SecondLife();
-            client.Avatars.OnAvatarNames += new AvatarManager.AvatarNamesCallback(Avatars_OnAvatarNames);
-
-            Console.WriteLine("Attempting to connect and login to Second Life.");
-
-            // Login to Second Life
-            if (!client.Network.Login(args[0], args[1], args[2], "key2name", "jessemalthus@gmail.com"))
-            {
-                // Login failed
-                Console.WriteLine("Error logging in: " + client.Network.LoginMessage);
-                return;
-            }
-
-            LLUUID lookup = new LLUUID();
-            LLUUID.TryParse(args[3], out lookup);
-
-            Console.WriteLine("Looking up name for " + lookup.ToString());
-
-            client.Avatars.RequestAvatarName(lookup);
-
-            if (!NameEvent.WaitOne(15 * 1000, false))
-                Console.WriteLine("Name lookup timed out.");
-
-            Console.WriteLine("Press enter to logout.");
-            Console.ReadLine();
-
-            client.Network.Logout();
-        }
-
-        static void Avatars_OnAvatarNames(System.Collections.Generic.Dictionary<LLUUID, string> names)
-        {
-            foreach (string name in names.Values)
-                Console.WriteLine("Name: " + name);
-
-            NameEvent.Set();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/Key2Name/key2name.csproj b/old/libsl1550/libsecondlife/examples/Key2Name/key2name.csproj
deleted file mode 100644
index 16da635..0000000
--- a/old/libsl1550/libsecondlife/examples/Key2Name/key2name.csproj
+++ /dev/null
@@ -1,104 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{4FF68142-9C61-42D1-87DC-5D37CB671C29}</ProjectGuid>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>
-    </ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>key2name</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>key2name</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>
-    </StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>full</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>bin\Release\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>none</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.XML" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="key2name.cs">
-      <SubType>Code</SubType>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\libsecondlife.Utilities\libsecondlife.Utilities.csproj">
-      <Project>{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}</Project>
-      <Name>libsecondlife.Utilities</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>
-    </PostBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Arguments.cs b/old/libsl1550/libsecondlife/examples/TestClient/Arguments.cs
deleted file mode 100644
index 01d852d..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Arguments.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-using System;
-using System.Collections.Specialized;
-using System.Text.RegularExpressions;
-
-namespace CommandLine.Utility
-{
-    /// <summary>
-    /// Arguments class
-    /// </summary>
-    public class Arguments
-    {
-        // Variables
-        private StringDictionary Parameters;
-
-        // Constructor
-        public Arguments(string[] Args)
-        {
-            Parameters = new StringDictionary();
-            Regex Splitter = new Regex(@"^-{1,2}|=|:",
-                RegexOptions.IgnoreCase | RegexOptions.Compiled);
-
-            Regex Remover = new Regex(@"^['""]?(.*?)['""]?$",
-                RegexOptions.IgnoreCase | RegexOptions.Compiled);
-
-            string Parameter = null;
-            string[] Parts;
-
-            // Valid parameters forms:
-            // {-,/,--}param{ ,=,:}((",')value(",'))
-            // Examples:
-            // -param1 value1 --param2 /param3:"Test-:-work"
-            //   /param4=happy -param5 '--=nice=--'
-            foreach (string Txt in Args)
-            {
-                // Look for new parameters (-,/ or --) and a
-                // possible enclosed value (=,:)
-                Parts = Splitter.Split(Txt, 3);
-
-                switch (Parts.Length)
-                {
-                    // Found a value (for the last parameter
-                    // found (space separator))
-                    case 1:
-                        if (Parameter != null)
-                        {
-                            if (!Parameters.ContainsKey(Parameter))
-                            {
-                                Parts[0] =
-                                    Remover.Replace(Parts[0], "$1");
-
-                                Parameters.Add(Parameter, Parts[0]);
-                            }
-                            Parameter = null;
-                        }
-                        // else Error: no parameter waiting for a value (skipped)
-                        break;
-
-                    // Found just a parameter
-                    case 2:
-                        // The last parameter is still waiting.
-                        // With no value, set it to true.
-                        if (Parameter != null)
-                        {
-                            if (!Parameters.ContainsKey(Parameter))
-                                Parameters.Add(Parameter, "true");
-                        }
-                        Parameter = Parts[1];
-                        break;
-
-                    // Parameter with enclosed value
-                    case 3:
-                        // The last parameter is still waiting.
-                        // With no value, set it to true.
-                        if (Parameter != null)
-                        {
-                            if (!Parameters.ContainsKey(Parameter))
-                                Parameters.Add(Parameter, "true");
-                        }
-
-                        Parameter = Parts[1];
-
-                        // Remove possible enclosing characters (",')
-                        if (!Parameters.ContainsKey(Parameter))
-                        {
-                            Parts[2] = Remover.Replace(Parts[2], "$1");
-                            Parameters.Add(Parameter, Parts[2]);
-                        }
-
-                        Parameter = null;
-                        break;
-                }
-            }
-            // In case a parameter is still waiting
-            if (Parameter != null)
-            {
-                if (!Parameters.ContainsKey(Parameter))
-                    Parameters.Add(Parameter, "true");
-            }
-        }
-
-        // Retrieve a parameter value if it exists
-        // (overriding C# indexer property)
-        public string this[string Param]
-        {
-            get
-            {
-                return (Parameters[Param]);
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/ClientManager.cs b/old/libsl1550/libsecondlife/examples/TestClient/ClientManager.cs
deleted file mode 100644
index c1fe5ab..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/ClientManager.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Xml;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class LoginDetails
-    {
-        public string FirstName;
-        public string LastName;
-        public string Password;
-        public string StartLocation;
-        public string MasterName;
-        public LLUUID MasterKey;
-        public string URI;
-    }
-
-    public class StartPosition
-    {
-        public string sim;
-        public int x;
-        public int y;
-        public int z;
-
-        public StartPosition()
-        {
-            this.sim = null;
-            this.x = 0;
-            this.y = 0;
-            this.z = 0;
-        }
-    }
-
-    public class ClientManager
-    {
-        public Dictionary<LLUUID, SecondLife> Clients = new Dictionary<LLUUID, SecondLife>();
-        public Dictionary<Simulator, Dictionary<uint, Primitive>> SimPrims = new Dictionary<Simulator, Dictionary<uint, Primitive>>();
-
-        public bool Running = true;
-
-        string version = "1.0.0";
-        private LLUUID resolvedMasterKey = LLUUID.Zero;
-        private ManualResetEvent keyResolution = new ManualResetEvent(false);
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="accounts"></param>
-        public ClientManager(List<LoginDetails> accounts)
-        {
-            foreach (LoginDetails account in accounts)
-                Login(account);
-        }
-
-        public ClientManager(List<LoginDetails> accounts, string s)
-        {
-            char sep = '/';
-            string[] startbits = s.Split(sep);
-
-            foreach (LoginDetails account in accounts)
-            {
-                account.StartLocation = NetworkManager.StartLocation(startbits[0], Int32.Parse(startbits[1]),
-                    Int32.Parse(startbits[2]), Int32.Parse(startbits[3]));
-                Login(account);
-            }
-        }
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="account"></param>
-        /// <returns></returns>
-        public TestClient Login(LoginDetails account)
-        {
-            // Check if this client is already logged in
-            foreach (TestClient c in Clients.Values)
-            {
-                if (c.Self.FirstName == account.FirstName && c.Self.LastName == account.LastName)
-                {
-                    Logout(c);
-                    break;
-                }
-            }
-
-            TestClient client = new TestClient(this);
-
-            // Optimize the throttle
-            client.Throttle.Wind = 0;
-            client.Throttle.Cloud = 0;
-            client.Throttle.Land = 1000000;
-            client.Throttle.Task = 1000000;
-
-			client.MasterName = account.MasterName;
-            client.MasterKey = account.MasterKey;
-
-            LoginParams loginParams = client.Network.DefaultLoginParams(
-                    account.FirstName, account.LastName, account.Password, "TestClient", version);
-
-            if (!String.IsNullOrEmpty(account.StartLocation))
-                loginParams.Start = account.StartLocation;
-
-            if (!String.IsNullOrEmpty(account.URI))
-                loginParams.URI = account.URI;
-
-            if (!client.Network.Login(loginParams))
-            {
-                Console.WriteLine("Failed to login " + account.FirstName + " " + account.LastName + ": " +
-                    client.Network.LoginMessage);
-            }
-
-            if (client.Network.Connected)
-            {
-                if (account.MasterKey == LLUUID.Zero && !String.IsNullOrEmpty(account.MasterName))
-                {
-                    Console.WriteLine("Resolving {0}'s UUID", account.MasterName);
-                    // Find master's key from name
-                    DirectoryManager.DirPeopleReplyCallback callback = new DirectoryManager.DirPeopleReplyCallback(KeyResolvHandler);
-                    client.Directory.OnDirPeopleReply += callback;
-                    client.Directory.StartPeopleSearch(DirectoryManager.DirFindFlags.People, account.MasterName, 0);
-                    if (keyResolution.WaitOne(TimeSpan.FromMinutes(1), false))
-                    {
-                        account.MasterKey = resolvedMasterKey;
-                        Console.WriteLine("\"{0}\" resolved to {1}", account.MasterName, account.MasterKey);
-                    }
-                    else
-                    {
-                        Console.WriteLine("Unable to obtain UUID for \"{0}\". No master will be used. Try specifying a key with --masterkey.", account.MasterName);
-                    }
-                    client.Directory.OnDirPeopleReply -= callback;
-                    keyResolution.Reset();
-                }
-
-                client.MasterKey = account.MasterKey;
-
-                Clients[client.Self.AgentID] = client;
-
-                Console.WriteLine("Logged in " + client.ToString());
-            }
-
-            return client;
-        }
-
-        private void KeyResolvHandler(LLUUID queryid, List<DirectoryManager.AgentSearchData> matches)
-        {
-            LLUUID master = matches[0].AgentID;
-            if (matches.Count > 1)
-            {
-                Console.WriteLine("Possible masters:");
-                for (int i = 0; i < matches.Count; ++i)
-                {
-                    Console.WriteLine("{0}: {1}", i, matches[i].FirstName + " " + matches[i].LastName);
-                }
-                Console.Write("Ambiguous master, choose one:");
-                string read = Console.ReadLine();
-                while (read != null)
-                {
-                    int choice = 0;
-                    if (int.TryParse(read, out choice))
-                    {
-                        master = matches[choice].AgentID;
-                        break;
-                    }
-                    else
-                    {
-                        Console.WriteLine("Responce misunderstood.");
-                        Console.Write("Type the corresponding number:");
-                    }
-                    read = Console.ReadLine();
-                }
-            }
-            resolvedMasterKey = master;
-            keyResolution.Set();
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="args"></param>
-        /// <returns></returns>
-        public TestClient Login(string[] args)
-        {
-            LoginDetails account = new LoginDetails();
-            account.FirstName = args[0];
-            account.LastName = args[1];
-            account.Password = args[2];
-
-            if (args.Length == 4)
-            {
-                account.StartLocation = NetworkManager.StartLocation(args[3], 128, 128, 40);
-            }
-
-            return Login(account);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void Run()
-        {
-            Console.WriteLine("Type quit to exit.  Type help for a command list.");
-
-            while (Running)
-            {
-                PrintPrompt();
-                string input = Console.ReadLine();
-                DoCommandAll(input, LLUUID.Zero);
-            }
-
-            foreach (SecondLife client in Clients.Values)
-            {
-                if (client.Network.Connected)
-                    client.Network.Logout();
-            }
-        }
-
-        private void PrintPrompt()
-        {
-            int online = 0;
-
-            foreach (SecondLife client in Clients.Values)
-            {
-                if (client.Network.Connected) online++;
-            }
-
-            Console.Write(online + " avatars online> ");
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="cmd"></param>
-        /// <param name="fromAgentID"></param>
-        /// <param name="imSessionID"></param>
-        public void DoCommandAll(string cmd, LLUUID fromAgentID)
-        {
-            string[] tokens = cmd.Trim().Split(new char[] { ' ', '\t' });
-            string firstToken = tokens[0].ToLower();
-
-            if (tokens.Length == 0)
-                return;
-
-            if (firstToken == "login")
-            {
-                // Special login case: Only call it once, and allow it with
-                // no logged in avatars
-                string[] args = new string[tokens.Length - 1];
-                Array.Copy(tokens, 1, args, 0, args.Length);
-                Login(args);
-            }
-            else if (firstToken == "quit")
-            {
-                Quit();
-                Console.WriteLine("All clients logged out and program finished running.");
-            }
-            else
-            {
-                // make a copy of the clients list so that it can be iterated without fear of being changed during iteration
-                Dictionary<LLUUID, SecondLife> clientsCopy = new Dictionary<LLUUID, SecondLife>(Clients);
-
-                foreach (TestClient client in clientsCopy.Values)
-                    client.DoCommand(cmd, fromAgentID);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="client"></param>
-        public void Logout(TestClient client)
-        {
-            Clients.Remove(client.Self.AgentID);
-            client.Network.Logout();
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void LogoutAll()
-        {
-            // make a copy of the clients list so that it can be iterated without fear of being changed during iteration
-            Dictionary<LLUUID, SecondLife> clientsCopy = new Dictionary<LLUUID, SecondLife>(Clients);
-
-            foreach (TestClient client in clientsCopy.Values)
-                Logout(client);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public void Quit()
-        {
-            LogoutAll();
-            Running = false;
-            // TODO: It would be really nice if we could figure out a way to abort the ReadLine here in so that Run() will exit.
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Command.cs b/old/libsl1550/libsecondlife/examples/TestClient/Command.cs
deleted file mode 100644
index 5f92f32..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Command.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public abstract class Command
-    {
-		public string Name;
-		public string Description;
-		public TestClient Client;
-
-		public abstract string Execute(string[] args, LLUUID fromAgentID);
-
-		/// <summary>
-		/// When set to true, think will be called.
-		/// </summary>
-		public bool Active;
-
-		/// <summary>
-		/// Called twice per second, when Command.Active is set to true.
-		/// </summary>
-		public virtual void Think()
-		{
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/AppearanceCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/AppearanceCommand.cs
deleted file mode 100644
index 79beb8a..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/AppearanceCommand.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Threading;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class AppearanceCommand : Command
-    {
-		public AppearanceCommand(TestClient testClient)
-        {
-            Name = "appearance";
-            Description = "Set your current appearance to your last saved appearance";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            bool success = false;
-
-            // Register a handler for the appearance event
-            AutoResetEvent appearanceEvent = new AutoResetEvent(false);
-            AppearanceManager.AppearanceUpdatedCallback callback =
-                delegate(LLObject.TextureEntry te) { appearanceEvent.Set(); };
-            Client.Appearance.OnAppearanceUpdated += callback;
-
-            // Start the appearance setting process (with baking enabled or disabled)
-            Client.Appearance.SetPreviousAppearance(!(args.Length > 0 && args[0].Equals("nobake")));
-
-            // Wait for the process to complete or time out
-            if (appearanceEvent.WaitOne(1000 * 120, false))
-                success = true;
-
-            // Unregister the handler
-            Client.Appearance.OnAppearanceUpdated -= callback;
-
-            // Return success or failure message
-            if (success)
-                return "Successfully set appearance";
-            else
-                return "Timed out while setting appearance";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/AttachmentsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/AttachmentsCommand.cs
deleted file mode 100644
index 1e48f4d..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/AttachmentsCommand.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class AttachmentsCommand : Command
-    {
-        public AttachmentsCommand(TestClient testClient)
-        {
-            Client = testClient;
-            Name = "attachments";
-            Description = "Prints a list of the currently known agent attachments";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            List<Primitive> attachments = Client.Network.CurrentSim.Objects.FindAll(
-                delegate(Primitive prim) { return prim.ParentID == Client.Self.LocalID; }
-            );
-
-            for (int i = 0; i < attachments.Count; i++)
-            {
-                Primitive prim = attachments[i];
-                AttachmentPoint point = Helpers.StateToAttachmentPoint(prim.Data.State);
-
-                // TODO: Fetch properties for the objects with missing property sets so we can show names
-                Client.Log(String.Format("[Attachment @ {0}] LocalID: {1} UUID: {2} Offset: {3}",
-                    point, prim.LocalID, prim.ID, prim.Position), Helpers.LogLevel.Info);
-            }
-
-            return "Found " + attachments.Count + " attachments";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/CloneCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/CloneCommand.cs
deleted file mode 100644
index 2d8a7d9..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/CloneCommand.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class CloneCommand : Command
-    {
-        uint SerialNum = 2;
-
-        public CloneCommand(TestClient testClient)
-        {
-            Name = "clone";
-            Description = "Clone the appearance of a nearby avatar. Usage: clone [name]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            string targetName = String.Empty;
-            List<DirectoryManager.AgentSearchData> matches;
-
-            for (int ct = 0; ct < args.Length; ct++)
-                targetName = targetName + args[ct] + " ";
-            targetName = targetName.TrimEnd();
-
-            if (targetName.Length == 0)
-                return "Usage: clone [name]";
-
-            if (Client.Directory.PeopleSearch(DirectoryManager.DirFindFlags.People, targetName, 0, 1000 * 10,
-                out matches) && matches.Count > 0)
-            {
-                LLUUID target = matches[0].AgentID;
-                targetName += String.Format(" ({0})", target);
-
-                if (Client.Appearances.ContainsKey(target))
-                {
-                    #region AvatarAppearance to AgentSetAppearance
-
-                    AvatarAppearancePacket appearance = Client.Appearances[target];
-
-                    AgentSetAppearancePacket set = new AgentSetAppearancePacket();
-                    set.AgentData.AgentID = Client.Self.AgentID;
-                    set.AgentData.SessionID = Client.Self.SessionID;
-                    set.AgentData.SerialNum = SerialNum++;
-                    set.AgentData.Size = new LLVector3(2f, 2f, 2f); // HACK
-
-                    set.WearableData = new AgentSetAppearancePacket.WearableDataBlock[0];
-                    set.VisualParam = new AgentSetAppearancePacket.VisualParamBlock[appearance.VisualParam.Length];
-
-                    for (int i = 0; i < appearance.VisualParam.Length; i++)
-                    {
-                        set.VisualParam[i] = new AgentSetAppearancePacket.VisualParamBlock();
-                        set.VisualParam[i].ParamValue = appearance.VisualParam[i].ParamValue;
-                    }
-
-                    set.ObjectData.TextureEntry = appearance.ObjectData.TextureEntry;
-
-                    #endregion AvatarAppearance to AgentSetAppearance
-
-                    // Detach everything we are currently wearing
-                    Client.Appearance.AddAttachments(new List<InventoryBase>(), true);
-
-                    // Send the new appearance packet
-                    Client.Network.SendPacket(set);
-
-                    return "Cloned " + targetName;
-                }
-                else
-                {
-                    return "Don't know the appearance of avatar " + targetName;
-                }
-            }
-            else
-            {
-                return "Couldn't find avatar " + targetName;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/WearCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/WearCommand.cs
deleted file mode 100644
index a343140..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Appearance/WearCommand.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class WearCommand : Command
-    {
-		public WearCommand(TestClient testClient)
-        {
-            Client = testClient;
-            Name = "wear";
-            Description = "Wear an outfit folder from inventory. Usage: wear [outfit name] [nobake]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            string target = String.Empty;
-            bool bake = true;
-
-            for (int ct = 0; ct < args.Length; ct++)
-            {
-                if (args[ct].Equals("nobake"))
-                    bake = false;
-                else
-                    target = target + args[ct] + " ";
-            }
-
-            target = target.TrimEnd();
-
-            try
-            {
-                Client.Appearance.WearOutfit(target.Split('/'), bake);
-            }
-            catch (InvalidOutfitException ex)
-            {
-                return "Invalid outfit (" + ex.Message + ")";
-            }
-
-            return String.Empty;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/CloneProfileCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/CloneProfileCommand.cs
deleted file mode 100644
index 215b8b0..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/CloneProfileCommand.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class CloneProfileCommand : Command
-    {
-        Avatar.AvatarProperties Properties;
-        Avatar.Interests Interests;
-        List<LLUUID> Groups = new List<LLUUID>();
-        bool ReceivedProperties = false;
-        bool ReceivedInterests = false;
-        bool ReceivedGroups = false;
-        ManualResetEvent ReceivedProfileEvent = new ManualResetEvent(false);
-
-        public CloneProfileCommand(TestClient testClient)
-        {
-            testClient.Avatars.OnAvatarInterests += new AvatarManager.AvatarInterestsCallback(Avatars_OnAvatarInterests);
-            testClient.Avatars.OnAvatarProperties += new AvatarManager.AvatarPropertiesCallback(Avatars_OnAvatarProperties);
-            testClient.Avatars.OnAvatarGroups += new AvatarManager.AvatarGroupsCallback(Avatars_OnAvatarGroups);
-            testClient.Groups.OnGroupJoined += new GroupManager.GroupJoinedCallback(Groups_OnGroupJoined);
-
-            Name = "cloneprofile";
-            Description = "Clones another avatars profile as closely as possible. WARNING: This command will " +
-                "destroy your existing profile! Usage: cloneprofile [targetuuid]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 1)
-                return Description;
-
-            LLUUID targetID;
-            ReceivedProperties = false;
-            ReceivedInterests = false;
-            ReceivedGroups = false;
-
-            try
-            {
-                targetID = new LLUUID(args[0]);
-            }
-            catch (Exception)
-            {
-                return Description;
-            }
-
-            // Request all of the packets that make up an avatar profile
-            Client.Avatars.RequestAvatarProperties(targetID);
-
-            // Wait for all the packets to arrive
-            ReceivedProfileEvent.Reset();
-            ReceivedProfileEvent.WaitOne(5000, false);
-
-            // Check if everything showed up
-            if (!ReceivedInterests || !ReceivedProperties || !ReceivedGroups)
-                return "Failed to retrieve a complete profile for that UUID";
-
-            // Synchronize our profile
-            Client.Self.UpdateInterests(Interests);
-            Client.Self.UpdateProfile(Properties);
-
-            // TODO: Leave all the groups we're currently a member of? This could
-            // break TestClient connectivity that might be relying on group authentication
-
-            // Attempt to join all the groups
-            foreach (LLUUID groupID in Groups)
-            {
-                Client.Groups.RequestJoinGroup(groupID);
-            }
-
-            return "Synchronized our profile to the profile of " + targetID.ToString();
-        }
-
-        void Avatars_OnAvatarProperties(LLUUID avatarID, Avatar.AvatarProperties properties)
-        {
-            lock (ReceivedProfileEvent)
-            {
-                Properties = properties;
-                ReceivedProperties = true;
-
-                if (ReceivedInterests && ReceivedProperties && ReceivedGroups)
-                    ReceivedProfileEvent.Set();
-            }
-        }
-
-        void Avatars_OnAvatarInterests(LLUUID avatarID, Avatar.Interests interests)
-        {
-            lock (ReceivedProfileEvent)
-            {
-                Interests = interests;
-                ReceivedInterests = true;
-
-                if (ReceivedInterests && ReceivedProperties && ReceivedGroups)
-                    ReceivedProfileEvent.Set();
-            }
-        }
-
-        void Avatars_OnAvatarGroups(LLUUID avatarID, AvatarGroupsReplyPacket.GroupDataBlock[] groups)
-        {
-            lock (ReceivedProfileEvent)
-            {
-                foreach (AvatarGroupsReplyPacket.GroupDataBlock block in groups)
-                {
-                    Groups.Add(block.GroupID);
-                }
-
-                ReceivedGroups = true;
-
-                if (ReceivedInterests && ReceivedProperties && ReceivedGroups)
-                    ReceivedProfileEvent.Set();
-            }
-        }
-
-        void Groups_OnGroupJoined(LLUUID groupID, bool success)
-        {
-            Console.WriteLine(Client.ToString() + (success ? " joined " : " failed to join ") +
-                groupID.ToString());
-
-            if (success)
-            {
-                Console.WriteLine(Client.ToString() + " setting " + groupID.ToString() +
-                    " as the active group");
-                Client.Groups.ActivateGroup(groupID);
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/EchoMasterCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/EchoMasterCommand.cs
deleted file mode 100644
index b997f54..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/EchoMasterCommand.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class EchoMasterCommand: Command
-    {
-        public EchoMasterCommand(TestClient testClient)
-		{
-			Name = "echoMaster";
-			Description = "Repeat everything that master says.";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			if (!Active)
-			{
-				Active = true;
-                Client.Self.OnChat += new AgentManager.ChatCallback(Self_OnChat);
-				return "Echoing is now on.";
-			}
-			else
-			{
-				Active = false;
-                Client.Self.OnChat -= new AgentManager.ChatCallback(Self_OnChat);
-				return "Echoing is now off.";
-			}
-		}
-
-		void Self_OnChat(string message, ChatAudibleLevel audible, ChatType type,
-            ChatSourceType sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
-		{
-			if (message.Length > 0 && Client.MasterKey == id)
-			    Client.Self.Chat(message, 0, ChatType.Normal);
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/IMCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/IMCommand.cs
deleted file mode 100644
index 693d85a..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/IMCommand.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class ImCommand : Command
-    {
-        string ToAvatarName = String.Empty;
-        ManualResetEvent NameSearchEvent = new ManualResetEvent(false);
-        Dictionary<string, LLUUID> Name2Key = new Dictionary<string, LLUUID>();
-
-        public ImCommand(TestClient testClient)
-        {
-            testClient.Avatars.OnAvatarNameSearch += new AvatarManager.AvatarNameSearchCallback(Avatars_OnAvatarNameSearch);
-
-            Name = "im";
-            Description = "Instant message someone. Usage: im [firstname] [lastname] [message]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length < 3)
-                return "Usage: im [firstname] [lastname] [message]";
-
-            ToAvatarName = args[0] + " " + args[1];
-
-            // Build the message
-            string message = String.Empty;
-            for (int ct = 2; ct < args.Length; ct++)
-                message += args[ct] + " ";
-            message = message.TrimEnd();
-            if (message.Length > 1023) message = message.Remove(1023);
-
-            if (!Name2Key.ContainsKey(ToAvatarName.ToLower()))
-            {
-                // Send the Query
-                Client.Avatars.RequestAvatarNameSearch(ToAvatarName, LLUUID.Random());
-
-                NameSearchEvent.WaitOne(6000, false);
-            }
-
-            if (Name2Key.ContainsKey(ToAvatarName.ToLower()))
-            {
-                LLUUID id = Name2Key[ToAvatarName.ToLower()];
-
-                Client.Self.InstantMessage(id, message, id);
-                return "Instant Messaged " + id.ToString() + " with message: " + message;
-            }
-            else
-            {
-                return "Name lookup for " + ToAvatarName + " failed";
-            }
-        }
-
-        void Avatars_OnAvatarNameSearch(LLUUID queryID, Dictionary<LLUUID, string> avatars)
-        {
-            foreach (KeyValuePair<LLUUID, string> kvp in avatars)
-            {
-                if (kvp.Value.ToLower() == ToAvatarName.ToLower())
-                {
-                    Name2Key[ToAvatarName.ToLower()] = kvp.Key;
-                    NameSearchEvent.Set();
-                    return;
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/SayCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/SayCommand.cs
deleted file mode 100644
index 94e5145..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/SayCommand.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class SayCommand: Command
-    {
-        public SayCommand(TestClient testClient)
-		{
-			Name = "say";
-			Description = "Say something.  (usage: say (optional channel) whatever)";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-            int channel = 0;
-            int startIndex = 0;
-
-            if (args.Length < 1)
-            {
-                return "usage: say (optional channel) whatever";
-            }
-            else if (args.Length > 1)
-            {
-                if (Int32.TryParse(args[0], out channel))
-					startIndex = 1;
-            }
-
-            StringBuilder message = new StringBuilder();
-
-			for (int i = startIndex; i < args.Length; i++)
-            {
-                message.Append(args[i]);
-                if (i != args.Length - 1) message.Append(" ");
-            }
-
-			Client.Self.Chat(message.ToString(), channel, ChatType.Normal);
-
-            return "Said " + message.ToString();
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/ShoutCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/ShoutCommand.cs
deleted file mode 100644
index b6f31d9..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/ShoutCommand.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class ShoutCommand : Command
-    {
-        public ShoutCommand(TestClient testClient)
-        {
-            Name = "shout";
-            Description = "Shout something.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            int channel = 0;
-            int startIndex = 0;
-            string message = String.Empty;
-            if (args.Length < 1)
-            {
-                return "usage: shout (optional channel) whatever";
-            }
-            else if (args.Length > 1)
-            {
-                try
-                {
-                    channel = Convert.ToInt32(args[0]);
-                    startIndex = 1;
-                }
-                catch (FormatException)
-                {
-                    channel = 0;
-                }
-            }
-
-            for (int i = startIndex; i < args.Length; i++)
-            {
-                message += args[i] + " ";
-            }
-
-            Client.Self.Chat(message, channel, ChatType.Shout);
-
-            return "Shouted " + message;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/TtsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/TtsCommand.cs
deleted file mode 100644
index e8bd122..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/TtsCommand.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Speech.Synthesis;
-using libsecondlife;
-using libsecondlife.Packets;
-using libsecondlife.AssetSystem;
-
-
-// Since this requires .Net 3.0 I've left it out of the project by default.
-// To use this: include it in the project and add a reference to the System.Speech.dll
-
-namespace libsecondlife.TestClient
-{
-    public class TtsCommand : Command
-    {
-		SpeechSynthesizer _speechSynthesizer;
-
-		public TtsCommand(TestClient testClient)
-        {
-            Name = "tts";
-            Description = "Text To Speech.  When activated, client will echo all recieved chat messages out thru the computer's speakers.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-			if (!Active)
-			{
-				if (_speechSynthesizer == null)
-					_speechSynthesizer = new SpeechSynthesizer();
-				Active = true;
-				Client.Self.OnChat += new MainAvatar.ChatCallback(Self_OnChat);
-				return "TTS is now on.";
-			}
-			else
-			{
-				Active = false;
-				Client.Self.OnChat -= new MainAvatar.ChatCallback(Self_OnChat);
-				return "TTS is now off.";
-			}
-        }
-
-		void Self_OnChat(string message, byte audible, byte type, byte sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
-		{
-			if (message.Length > 0)
-			{
-				_speechSynthesizer.SpeakAsync(message);
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/WhisperCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/WhisperCommand.cs
deleted file mode 100644
index c045573..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Communication/WhisperCommand.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class WhisperCommand : Command
-    {
-        public WhisperCommand(TestClient testClient)
-        {
-            Name = "whisper";
-            Description = "Whisper something.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            int channel = 0;
-            int startIndex = 0;
-            string message = String.Empty;
-            if (args.Length < 1)
-            {
-                return "usage: whisper (optional channel) whatever";
-            }
-            else if (args.Length > 1)
-            {
-                try
-                {
-                    channel = Convert.ToInt32(args[0]);
-                    startIndex = 1;
-                }
-                catch (FormatException)
-                {
-                    channel = 0;
-                }
-            }
-
-            for (int i = startIndex; i < args.Length; i++)
-            {
-                message += args[i] + " ";
-            }
-
-            Client.Self.Chat(message, channel, ChatType.Whisper);
-
-            return "Whispered " + message;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/DetectBotCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/DetectBotCommand.cs
deleted file mode 100644
index a65b741..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/DetectBotCommand.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class DetectBotCommand : Command
-    {
-        public DetectBotCommand(TestClient testClient)
-        {
-            Name = "detectbot";
-            Description = "Runs in the background, reporting any potential bots";
-
-            testClient.Network.RegisterCallback(PacketType.AvatarAppearance, new NetworkManager.PacketCallback(AvatarAppearanceHandler));
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            return "This command is always running";
-        }
-
-        private void AvatarAppearanceHandler(Packet packet, Simulator simulator)
-        {
-            AvatarAppearancePacket appearance = (AvatarAppearancePacket)packet;
-
-            LLObject.TextureEntry te = new LLObject.TextureEntry(appearance.ObjectData.TextureEntry, 0,
-                appearance.ObjectData.TextureEntry.Length);
-
-            if (IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.EyesBaked] ) &&
-                IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.HeadBaked]) &&
-                IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.LowerBaked]) &&
-                IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.SkirtBaked]) &&
-                IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.UpperBaked]))
-            {
-                Console.WriteLine("Avatar " + appearance.Sender.ID.ToString() + " may be a bot");
-            }
-        }
-
-        private bool IsNullOrZero(LLObject.TextureEntryFace face)
-        {
-            return (face == null || face.TextureID == LLUUID.Zero);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Friends/FriendsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Friends/FriendsCommand.cs
deleted file mode 100644
index 4601f36..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Friends/FriendsCommand.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-using System.Text;
-
-namespace libsecondlife.TestClient
-{
-    public class FriendsCommand : Command
-    {
-        ManualResetEvent GetCurrentGroupsEvent = new ManualResetEvent(false);
-
-        public FriendsCommand(TestClient testClient)
-        {
-            Name = "friends";
-            Description = "List avatar friends. Usage: friends";
-        }
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            List<FriendInfo> friends = Client.Friends.FriendsList();
-            if (friends.Count > 0)
-            {
-                StringBuilder sb = new StringBuilder();
-                foreach (FriendInfo friend in friends)
-                {
-                    sb.AppendLine(friend.Name);
-                }
-                return sb.ToString();
-            }
-            else
-            {
-                return "No friends";
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/GoHome.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/GoHome.cs
deleted file mode 100644
index 0ac04f4..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/GoHome.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class GoHomeCommand : Command
-    {
-		public GoHomeCommand(TestClient testClient)
-        {
-            Name = "gohome";
-            Description = "Teleports home";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-			if ( Client.Self.GoHome() ) {
-				return "Teleport Home Succesful";
-			} else {
-				return "Teleport Home Failed";
-			}
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/GotoLandmark.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/GotoLandmark.cs
deleted file mode 100644
index 121a46b..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/GotoLandmark.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class GotoLandmarkCommand : Command
-    {
-		public GotoLandmarkCommand(TestClient testClient)
-        {
-            Name = "goto_landmark";
-            Description = "Teleports to a Landmark. Usage: goto_landmark [UUID]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length < 1)
-            {
-                return "Usage: goto_landmark [UUID]";
-            }
-
-			LLUUID landmark = new LLUUID();
-			if ( ! LLUUID.TryParse(args[0], out landmark) ) {
-				return "Invalid LLUID";
-			} else {
-				Console.WriteLine("Teleporting to " + landmark.ToString());
-			}
-			if ( Client.Self.Teleport(landmark) ) {
-				return "Teleport Succesful";
-			} else {
-				return "Teleport Failed";
-			}
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Groups/GroupsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Groups/GroupsCommand.cs
deleted file mode 100644
index f403241..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Groups/GroupsCommand.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-using System.Text;
-
-namespace libsecondlife.TestClient
-{
-    public class GroupsCommand : Command
-    {
-        ManualResetEvent GetCurrentGroupsEvent = new ManualResetEvent(false);
-        Dictionary<LLUUID, Group> groups = new Dictionary<LLUUID, Group>();
-
-        public GroupsCommand(TestClient testClient)
-        {
-            testClient.Groups.OnCurrentGroups += new GroupManager.CurrentGroupsCallback(Groups_OnCurrentGroups);
-
-            Name = "groups";
-            Description = "List avatar groups. Usage: groups";
-        }
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (groups.Count == 0)
-            {
-                Client.Groups.RequestCurrentGroups();
-                GetCurrentGroupsEvent.WaitOne(10000, false);
-            }
-            if (groups.Count > 0)
-            {
-                return getGroupsString();
-            }
-            else
-            {
-                return "No groups";
-            }
-        }
-
-        void Groups_OnCurrentGroups(Dictionary<LLUUID, Group> pGroups)
-        {
-            groups = pGroups;
-            GetCurrentGroupsEvent.Set();
-        }
-        string getGroupsString()
-        {
-            StringBuilder sb = new StringBuilder();
-            foreach (Group group in groups.Values)
-            {
-                sb.AppendLine(group.Name);
-            }
-
-            return sb.ToString();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/BackupCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/BackupCommand.cs
deleted file mode 100644
index 6909137..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/BackupCommand.cs
+++ /dev/null
@@ -1,358 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading;
-using System.ComponentModel;
-using System.Xml;
-using System.Xml.Serialization;
-using libsecondlife;
-using libsecondlife.Packets;
-using libsecondlife.TestClient;
-
-namespace libsecondlife.TestClient
-{
-    public class QueuedDownloadInfo
-    {
-        public LLUUID TransferID;
-        public LLUUID AssetID;
-        public LLUUID ItemID;
-        public LLUUID TaskID;
-        public LLUUID OwnerID;
-        public AssetType Type;
-        public string FileName;
-        public DateTime WhenRequested;
-        public bool IsRequested;
-
-        public QueuedDownloadInfo(string file, LLUUID asset, LLUUID item, LLUUID task, LLUUID owner, AssetType type)
-        {
-            FileName = file;
-            AssetID = asset;
-            ItemID = item;
-            TaskID = task;
-            OwnerID = owner;
-            Type = type;
-            TransferID = LLUUID.Zero;
-            WhenRequested = DateTime.Now;
-            IsRequested = false;
-        }
-    }
-
-    public class BackupCommand : Command
-    {
-        /// <summary>Maximum number of transfer requests to send to the server</summary>
-        private const int MAX_TRANSFERS = 10;
-
-        // all items here, fed by the inventory walking thread
-        private Queue<QueuedDownloadInfo> PendingDownloads = new Queue<QueuedDownloadInfo>();
-
-        // items sent to the server here
-        private List<QueuedDownloadInfo> CurrentDownloads = new List<QueuedDownloadInfo>(MAX_TRANSFERS);
-
-        // background workers
-        private BackgroundWorker BackupWorker;
-        private BackgroundWorker QueueWorker;
-
-        // some stats
-        private int TextItemsFound;
-        private int TextItemsTransferred;
-        private int TextItemErrors;
-
-        #region Properties
-
-        /// <summary>
-        /// true if either of the background threads is running
-        /// </summary>
-        private bool BackgroundBackupRunning
-        {
-            get { return InventoryWalkerRunning || QueueRunnerRunning; }
-        }
-
-        /// <summary>
-        /// true if the thread walking inventory is running
-        /// </summary>
-        private bool InventoryWalkerRunning
-        {
-            get { return BackupWorker != null; }
-        }
-
-        /// <summary>
-        /// true if the thread feeding the queue to the server is running
-        /// </summary>
-        private bool QueueRunnerRunning
-        {
-            get { return QueueWorker != null; }
-        }
-
-        /// <summary>
-        /// returns a string summarizing activity
-        /// </summary>
-        /// <returns></returns>
-        private string BackgroundBackupStatus
-        {
-            get
-            {
-                StringBuilder sbResult = new StringBuilder();
-                sbResult.AppendFormat("{0} is {1} running.", Name, BoolToNot(BackgroundBackupRunning));
-                if (TextItemErrors != 0 || TextItemsFound != 0 || TextItemsTransferred != 0)
-                {
-                    sbResult.AppendFormat("\r\n{0} : Inventory walker ( {1} running ) has found {2} items.",
-                                            Name, BoolToNot(InventoryWalkerRunning), TextItemsFound);
-                    sbResult.AppendFormat("\r\n{0} : Server Transfers ( {1} running ) has transferred {2} items with {3} errors.",
-                                            Name, BoolToNot(QueueRunnerRunning), TextItemsTransferred, TextItemErrors);
-                    sbResult.AppendFormat("\r\n{0} : {1} items in Queue, {2} items requested from server.",
-                                            Name, PendingDownloads.Count, CurrentDownloads.Count);
-                }
-                return sbResult.ToString();
-            }
-        }
-
-        #endregion Properties
-
-        public BackupCommand(TestClient testClient)
-        {
-            Name = "backuptext";
-            Description = "Backup inventory to a folder on your hard drive. Usage: " + Name + " [to <directory>] | [abort] | [status]";
-            testClient.Assets.OnAssetReceived += new AssetManager.AssetReceivedCallback(Assets_OnAssetReceived);
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            StringBuilder sbResult = new StringBuilder();
-
-            if (args.Length == 1 && args[0] == "status")
-            {
-                return BackgroundBackupStatus;
-            }
-            else if (args.Length == 1 && args[0] == "abort")
-            {
-                if (!BackgroundBackupRunning)
-                    return BackgroundBackupStatus;
-
-                BackupWorker.CancelAsync();
-                QueueWorker.CancelAsync();
-
-                Thread.Sleep(500);
-
-                // check status
-                return BackgroundBackupStatus;
-            }
-            else if (args.Length != 2)
-            {
-                return "Usage: " + Name + " [to <directory>] | [abort] | [status]";
-            }
-            else if (BackgroundBackupRunning)
-            {
-                return BackgroundBackupStatus;
-            }
-
-            QueueWorker = new BackgroundWorker();
-            QueueWorker.WorkerSupportsCancellation = true;
-            QueueWorker.DoWork += new DoWorkEventHandler(bwQueueRunner_DoWork);
-            QueueWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwQueueRunner_RunWorkerCompleted);
-
-            QueueWorker.RunWorkerAsync();
-
-            BackupWorker = new BackgroundWorker();
-            BackupWorker.WorkerSupportsCancellation = true;
-            BackupWorker.DoWork +=new DoWorkEventHandler(bwBackup_DoWork);
-            BackupWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwBackup_RunWorkerCompleted);
-
-            BackupWorker.RunWorkerAsync(args);
-            return "Started background operations.";
-        }
-
-        void bwQueueRunner_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
-        {
-            QueueWorker = null;
-            Console.WriteLine(BackgroundBackupStatus);
-        }
-
-        void bwQueueRunner_DoWork(object sender, DoWorkEventArgs e)
-        {
-            TextItemErrors = TextItemsTransferred = 0;
-
-            while (QueueWorker.CancellationPending == false)
-            {
-                // have any timed out?
-                if (CurrentDownloads.Count > 0)
-                {
-                    foreach (QueuedDownloadInfo qdi in CurrentDownloads)
-                    {
-                        if ((qdi.WhenRequested + TimeSpan.FromSeconds(60)) < DateTime.Now)
-                        {
-                            Client.DebugLog(Name + ": timeout on asset " + qdi.AssetID.ToString());
-                            // submit request again
-                            qdi.TransferID = Client.Assets.RequestInventoryAsset(
-                                qdi.AssetID, qdi.ItemID, qdi.TaskID, qdi.OwnerID, qdi.Type, true);
-                            qdi.WhenRequested = DateTime.Now;
-                            qdi.IsRequested = true;
-                        }
-                    }
-                }
-
-                if (PendingDownloads.Count != 0)
-                {
-                    // room in the server queue?
-                    if (CurrentDownloads.Count < MAX_TRANSFERS)
-                    {
-                        // yes
-                        QueuedDownloadInfo qdi = PendingDownloads.Dequeue();
-                        qdi.WhenRequested = DateTime.Now;
-                        qdi.IsRequested = true;
-                        qdi.TransferID = Client.Assets.RequestInventoryAsset(
-                            qdi.AssetID, qdi.ItemID, qdi.TaskID, qdi.OwnerID, qdi.Type, true);
-
-                        lock (CurrentDownloads) CurrentDownloads.Add(qdi);
-                    }
-                }
-
-                if (CurrentDownloads.Count == 0 && PendingDownloads.Count == 0 && BackupWorker == null)
-                {
-                    Client.DebugLog(Name + ": both transfer queues empty AND inventory walking thread is done");
-                    return;
-                }
-
-                Thread.Sleep(100);
-            }
-        }
-
-        void bwBackup_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
-        {
-            Console.WriteLine(Name + ": Inventory walking thread done.");
-            BackupWorker = null;
-        }
-
-        private void bwBackup_DoWork(object sender, DoWorkEventArgs e)
-        {
-            string[] args;
-
-            TextItemsFound = 0;
-
-            args = (string[]) e.Argument;
-
-            lock (CurrentDownloads) CurrentDownloads.Clear();
-
-            // FIXME:
-            //Client.Inventory.RequestFolderContents(Client.Inventory.Store.RootFolder.UUID, Client.Self.AgentID,
-            //    true, true, false, InventorySortOrder.ByName);
-
-            DirectoryInfo di = new DirectoryInfo(args[1]);
-
-            // recurse on the root folder into the entire inventory
-            BackupFolder(Client.Inventory.Store.RootNode, di.FullName);
-        }
-
-        /// <summary>
-        /// BackupFolder - recurse through the inventory nodes sending scripts and notecards to the transfer queue
-        /// </summary>
-        /// <param name="folder">The current leaf in the inventory tree</param>
-        /// <param name="sPathSoFar">path so far, in the form @"c:\here" -- this needs to be "clean" for the current filesystem</param>
-        private void BackupFolder(InventoryNode folder, string sPathSoFar)
-        {
-            StringBuilder sbRequests = new StringBuilder();
-
-            // FIXME:
-            //Client.Inventory.RequestFolderContents(folder.Data.UUID, Client.Self.AgentID, true, true, false,
-            //    InventorySortOrder.ByName);
-
-            // first scan this folder for text
-            foreach (InventoryNode iNode in folder.Nodes.Values)
-            {
-                if (BackupWorker.CancellationPending)
-                    return;
-                if (iNode.Data is libsecondlife.InventoryItem)
-                {
-                    InventoryItem ii = iNode.Data as InventoryItem;
-                    if (ii.AssetType == AssetType.LSLText || ii.AssetType == AssetType.Notecard)
-                    {
-                        // check permissions on scripts
-                        if (ii.AssetType == AssetType.LSLText)
-                        {
-                            if ((ii.Permissions.OwnerMask & PermissionMask.Modify) == PermissionMask.None)
-                            {
-                                // skip this one
-                                continue;
-                            }
-                        }
-
-                        string sExtension = (ii.AssetType == AssetType.LSLText) ? ".lsl" : ".txt";
-                        // make the output file
-                        string sPath = sPathSoFar + @"\" + MakeValid(ii.Name.Trim()) + sExtension;
-
-                        // create the new qdi
-                        QueuedDownloadInfo qdi = new QueuedDownloadInfo(sPath, ii.AssetUUID, iNode.Data.UUID, LLUUID.Zero,
-                            Client.Self.AgentID, ii.AssetType);
-
-                        // add it to the queue
-                        lock (PendingDownloads)
-                        {
-                            TextItemsFound++;
-                            PendingDownloads.Enqueue(qdi);
-                        }
-                    }
-                }
-            }
-
-            // now run any subfolders
-            foreach (InventoryNode i in folder.Nodes.Values)
-            {
-                if (BackupWorker.CancellationPending)
-                    return;
-                else if (i.Data is libsecondlife.InventoryFolder)
-                    BackupFolder(i, sPathSoFar + @"\" + MakeValid(i.Data.Name.Trim()));
-            }
-        }
-
-        private string MakeValid(string path)
-        {
-            // FIXME: We need to strip illegal characters out
-            return path.Trim().Replace('"', '\'');
-        }
-
-        private void Assets_OnAssetReceived(AssetDownload asset, Asset blah)
-        {
-            lock (CurrentDownloads)
-            {
-                // see if we have this in our transfer list
-                QueuedDownloadInfo r = CurrentDownloads.Find(delegate(QueuedDownloadInfo q)
-                {
-                    return q.TransferID == asset.ID;
-                });
-
-                if (r != null && r.TransferID == asset.ID)
-                {
-                    if (asset.Success)
-                    {
-                        // create the directory to put this in
-                        Directory.CreateDirectory(Path.GetDirectoryName(r.FileName));
-
-                        // write out the file
-                        File.WriteAllBytes(r.FileName, asset.AssetData);
-                        Client.DebugLog(Name + " Wrote: " + r.FileName);
-                        TextItemsTransferred++;
-                    }
-                    else
-                    {
-                        TextItemErrors++;
-                        Console.WriteLine("{0}: Download of asset {1} ({2}) failed with status {3}", Name, r.FileName,
-                            r.AssetID.ToString(), asset.Status.ToString());
-                    }
-
-                    // remove the entry
-                    CurrentDownloads.Remove(r);
-                }
-            }
-        }
-
-        /// <summary>
-        /// returns blank or "not" if false
-        /// </summary>
-        /// <param name="b"></param>
-        /// <returns></returns>
-        private static string BoolToNot(bool b)
-        {
-            return b ? String.Empty : "not";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/BalanceCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/BalanceCommand.cs
deleted file mode 100644
index 92e9b39..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/BalanceCommand.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class BalanceCommand: Command
-    {
-        public BalanceCommand(TestClient testClient)
-		{
-			Name = "balance";
-			Description = "Shows the amount of L$.";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			return Client.ToString() + " has L$: " + Client.Self.Balance;
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/DeleteFolderCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/DeleteFolderCommand.cs
deleted file mode 100644
index 657ebc2..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/DeleteFolderCommand.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading;
-using System.Xml;
-using System.Xml.Serialization;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class DeleteFolderCommand : Command
-    {
-		public DeleteFolderCommand(TestClient testClient)
-        {
-            Name = "deleteFolder";
-            Description = "Deletes a folder from inventory.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            return "Broken until someone fixes me";
-
-            //string target = String.Empty;
-            //for (int ct = 0; ct < args.Length; ct++)
-            //    target = target + args[ct] + " ";
-            //target = target.TrimEnd();
-
-            //Client.Inventory.DownloadInventory();
-            //InventoryFolder folder = Client.Inventory.getFolder(target);
-            //if (folder != null)
-            //{
-            //    folder.Delete();
-            //    return "Folder " + target + " deleted.";
-            //}
-
-            //return "Unable to find: " + target;
-		}
-	}
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/DumpOutfitCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/DumpOutfitCommand.cs
deleted file mode 100644
index 251d752..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/DumpOutfitCommand.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-using System;
-using System.Text;
-using System.IO;
-using System.Collections.Generic;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class DumpOutfitCommand : Command
-    {
-        List<LLUUID> OutfitAssets = new List<LLUUID>();
-        AssetManager.ImageReceivedCallback ImageReceivedHandler;
-
-        public DumpOutfitCommand(TestClient testClient)
-        {
-            Name = "dumpoutfit";
-            Description = "Dumps all of the textures from an avatars outfit to the hard drive. Usage: dumpoutfit [avatar-uuid]";
-            ImageReceivedHandler = new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 1)
-                return "Usage: dumpoutfit [avatar-uuid]";
-
-            LLUUID target;
-
-            if (!LLUUID.TryParse(args[0], out target))
-                return "Usage: dumpoutfit [avatar-uuid]";
-
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    Avatar targetAv;
-
-                    targetAv = Client.Network.Simulators[i].Objects.Find(
-                        delegate(Avatar avatar)
-                        {
-                            return avatar.ID == target;
-                        }
-                    );
-
-                    if (targetAv != null)
-                    {
-                        StringBuilder output = new StringBuilder("Downloading ");
-
-                        lock (OutfitAssets) OutfitAssets.Clear();
-                        Client.Assets.OnImageReceived += ImageReceivedHandler;
-
-                        for (int j = 0; j < targetAv.Textures.FaceTextures.Length; j++)
-                        {
-                            LLObject.TextureEntryFace face = targetAv.Textures.FaceTextures[j];
-
-                            if (face != null)
-                            {
-                                ImageType type = ImageType.Normal;
-
-                                switch ((AppearanceManager.TextureIndex)j)
-                                {
-                                    case AppearanceManager.TextureIndex.HeadBaked:
-                                    case AppearanceManager.TextureIndex.EyesBaked:
-                                    case AppearanceManager.TextureIndex.UpperBaked:
-                                    case AppearanceManager.TextureIndex.LowerBaked:
-                                    case AppearanceManager.TextureIndex.SkirtBaked:
-                                        type = ImageType.Baked;
-                                        break;
-                                }
-
-                                OutfitAssets.Add(face.TextureID);
-                                Client.Assets.RequestImage(face.TextureID, type, 100000.0f, 0);
-
-                                output.Append(((AppearanceManager.TextureIndex)j).ToString());
-                                output.Append(" ");
-                            }
-                        }
-
-                        return output.ToString();
-                    }
-                }
-            }
-
-            return "Couldn't find avatar " + target.ToString();
-        }
-
-        private void Assets_OnImageReceived(ImageDownload image, AssetTexture assetTexture)
-        {
-            lock (OutfitAssets)
-            {
-                if (OutfitAssets.Contains(image.ID))
-                {
-                    if (image.Success)
-                    {
-                        try
-                        {
-                            File.WriteAllBytes(image.ID.ToString() + ".jp2", image.AssetData);
-                            Console.WriteLine("Wrote JPEG2000 image " + image.ID.ToString() + ".jp2");
-
-                            byte[] tgaFile = OpenJPEGNet.OpenJPEG.DecodeToTGA(image.AssetData);
-                            File.WriteAllBytes(image.ID.ToString() + ".tga", tgaFile);
-                            Console.WriteLine("Wrote TGA image " + image.ID.ToString() + ".tga");
-                        }
-                        catch (Exception e)
-                        {
-                            Console.WriteLine(e.ToString());
-                        }
-                    }
-                    else
-                    {
-                        Console.WriteLine("Failed to download image " + image.ID.ToString());
-                    }
-
-                    OutfitAssets.Remove(image.ID);
-
-                    if (OutfitAssets.Count == 0)
-                        Client.Assets.OnImageReceived -= ImageReceivedHandler;
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ExportOutfitCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ExportOutfitCommand.cs
deleted file mode 100644
index 64e05f4..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ExportOutfitCommand.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class ExportOutfitCommand : Command
-    {
-        public ExportOutfitCommand(TestClient testClient)
-        {
-            Name = "exportoutfit";
-            Description = "Exports an avatars outfit to an xml file. Usage: exportoutfit [avataruuid] outputfile.xml";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            LLUUID id;
-            string path;
-
-            if (args.Length == 1)
-            {
-                id = Client.Self.AgentID;
-                path = args[0];
-            }
-            else if (args.Length == 2)
-            {
-                if (!LLUUID.TryParse(args[0], out id))
-                    return "Usage: exportoutfit [avataruuid] outputfile.xml";
-                path = args[1];
-            }
-            else
-                return "Usage: exportoutfit [avataruuid] outputfile.xml";
-
-            lock (Client.Appearances)
-            {
-                if (Client.Appearances.ContainsKey(id))
-                {
-                    try
-                    {
-                        File.WriteAllText(path, Packet.ToXmlString(Client.Appearances[id]));
-                    }
-                    catch (Exception e)
-                    {
-                        return e.ToString();
-                    }
-
-                    return "Exported appearance for avatar " + id.ToString() + " to " + args[1];
-                }
-                else
-                {
-                    return "Couldn't find an appearance for avatar " + id.ToString();
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/GiveAllCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/GiveAllCommand.cs
deleted file mode 100644
index b203a40..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/GiveAllCommand.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class GiveAllCommand: Command
-    {
-		public GiveAllCommand(TestClient testClient)
-		{
-			Name = "giveAll";
-			Description = "Gives you all it's money.";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			if (fromAgentID == null)
-				return "Unable to send money to console.  This command only works when IMed.";
-
-		    int amount = Client.Self.Balance;
-		    Client.Self.GiveAvatarMoney(fromAgentID, Client.Self.Balance, "TestClient.GiveAll");
-		    return "Gave $" + amount + " to " + fromAgentID;
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ImportOutfitCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ImportOutfitCommand.cs
deleted file mode 100644
index f36682d..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ImportOutfitCommand.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class ImportOutfitCommand : Command
-    {
-        //private uint SerialNum = 1;
-
-        public ImportOutfitCommand(TestClient testClient)
-        {
-            Name = "importoutfit";
-            Description = "Imports an appearance from an xml file. Usage: importoutfit inputfile.xml";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 1)
-                return "Usage: importoutfit inputfile.xml";
-
-            return "LLSD packet import is under construction";
-
-            //try
-            //{
-            //    Packet packet = Packet.FromXmlString((File.ReadAllText(args[0])));
-            //    if (packet.Type != PacketType.AvatarAppearance)
-            //        return "Deserialized a " + packet.Type + " packet instead of an AvatarAppearance packet";
-            //    AvatarAppearancePacket appearance = (AvatarAppearancePacket)packet;
-
-            //    AgentSetAppearancePacket set = new AgentSetAppearancePacket();
-
-            //    set.AgentData.AgentID = Client.Self.AgentID;
-            //    set.AgentData.SessionID = Client.Self.SessionID;
-            //    set.AgentData.SerialNum = SerialNum++;
-
-            //    // HACK: Weak hack to calculate size
-            //    float AV_Height_Range = 2.025506f - 1.50856f;
-            //    float AV_Height = 1.50856f + (((float)appearance.VisualParam[25].ParamValue / 255.0f) * AV_Height_Range);
-            //    set.AgentData.Size = new LLVector3(0.45f, 0.6f, AV_Height);
-
-            //    set.ObjectData.TextureEntry = appearance.ObjectData.TextureEntry;
-            //    set.VisualParam = new AgentSetAppearancePacket.VisualParamBlock[appearance.VisualParam.Length];
-
-            //    int i = 0;
-            //    foreach (AvatarAppearancePacket.VisualParamBlock block in appearance.VisualParam)
-            //    {
-            //        set.VisualParam[i] = new AgentSetAppearancePacket.VisualParamBlock();
-            //        set.VisualParam[i].ParamValue = block.ParamValue;
-            //        i++;
-            //    }
-
-            //    set.WearableData = new AgentSetAppearancePacket.WearableDataBlock[0];
-
-            //    Client.Network.SendPacket(set);
-            //}
-            //catch (Exception)
-            //{
-            //    return "Failed to import the appearance XML file, maybe it doesn't exist or is in the wrong format?";
-            //}
-
-            //return "Imported " + args[0] + " and sent an AgentSetAppearance packet";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/InventoryCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/InventoryCommand.cs
deleted file mode 100644
index b0f020a..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/InventoryCommand.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading;
-using System.Xml;
-using System.Xml.Serialization;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class InventoryCommand : Command
-    {
-        private Inventory Inventory;
-        private InventoryManager Manager;
-
-		public InventoryCommand(TestClient testClient)
-        {
-            Name = "i";
-            Description = "Prints out inventory.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            Manager = Client.Inventory;
-            Inventory = Manager.Store;
-
-            StringBuilder result = new StringBuilder();
-
-            InventoryFolder rootFolder = Inventory.RootFolder;
-            PrintFolder(rootFolder, result, 0);
-
-            return result.ToString();
-        }
-
-        void PrintFolder(InventoryFolder f, StringBuilder result, int indent)
-        {
-            foreach (InventoryBase i in Manager.FolderContents(f.UUID, Client.Self.AgentID, true, true, InventorySortOrder.ByName, 3000))
-            {
-                result.AppendFormat("{0}{1} ({2})\n", new String(' ', indent * 2), i.Name, i.UUID);
-                if (i is InventoryFolder)
-                {
-                    InventoryFolder folder = (InventoryFolder)i;
-                    PrintFolder(folder, result, indent + 1);
-                }
-            }
-        }
-	}
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ObjectInventoryCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ObjectInventoryCommand.cs
deleted file mode 100644
index a2eafa7..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Inventory/ObjectInventoryCommand.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-using System.Collections.Generic;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class ObjectInventoryCommand : Command
-    {
-        public ObjectInventoryCommand(TestClient testClient)
-        {
-            Name = "objectinventory";
-            Description = "Retrieves a listing of items inside an object (task inventory). Usage: objectinventory [objectID]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 1)
-                return "Usage: objectinventory [objectID]";
-
-            uint objectLocalID;
-            LLUUID objectID;
-            if (!LLUUID.TryParse(args[0], out objectID))
-                return "Usage: objectinventory [objectID]";
-
-            Primitive found = Client.Network.CurrentSim.Objects.Find(delegate(Primitive prim) { return prim.ID == objectID; });
-            if (found != null)
-                objectLocalID = found.LocalID;
-            else
-                return "Couldn't find prim " + objectID.ToString();
-
-            List<InventoryBase> items = Client.Inventory.GetTaskInventory(objectID, objectLocalID, 1000 * 30);
-
-            if (items != null)
-            {
-                string result = String.Empty;
-
-                for (int i = 0; i < items.Count; i++)
-                {
-                    if (items[i] is InventoryFolder)
-                    {
-                        result += String.Format("[Folder] Name: {0}", items[i].Name) + Environment.NewLine;
-                    }
-                    else
-                    {
-                        InventoryItem item = (InventoryItem)items[i];
-                        result += String.Format("[Item] Name: {0} Desc: {1} Type: {2}", item.Name, item.Description,
-                            item.AssetType) + Environment.NewLine;
-                    }
-                }
-
-                return result;
-            }
-            else
-            {
-                return "Failed to download task inventory for " + objectLocalID;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/AgentLocationsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/AgentLocationsCommand.cs
deleted file mode 100644
index 9bd4858..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/AgentLocationsCommand.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class AgentLocationsCommand : Command
-    {
-        public AgentLocationsCommand(TestClient testClient)
-        {
-            Name = "agentlocations";
-            Description = "Downloads all of the agent locations in a specified region. Usage: agentlocations [regionhandle]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            ulong regionHandle;
-
-            if (args.Length == 0)
-                regionHandle = Client.Network.CurrentSim.Handle;
-            else if (!(args.Length == 1 && UInt64.TryParse(args[0], out regionHandle)))
-                return "Usage: agentlocations [regionhandle]";
-
-            List<GridItem> items = Client.Grid.MapItems(regionHandle, GridItemType.AgentLocations,
-                GridLayerType.Objects, 1000 * 20);
-
-            if (items != null)
-            {
-                StringBuilder ret = new StringBuilder();
-                ret.AppendLine("Agent locations:");
-
-                for (int i = 0; i < items.Count; i++)
-                {
-                    GridAgentLocation location = (GridAgentLocation)items[i];
-
-                    ret.AppendLine(String.Format("{0} avatar(s) at {1},{2}", location.AvatarCount, location.LocalX,
-                        location.LocalY));
-                }
-
-                return ret.ToString();
-            }
-            else
-            {
-                return "Failed to fetch agent locations";
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/FindSimCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/FindSimCommand.cs
deleted file mode 100644
index b75e20a..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/FindSimCommand.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class FindSimCommand : Command
-    {
-        public FindSimCommand(TestClient testClient)
-        {
-            Name = "findsim";
-            Description = "Searches for a simulator and returns information about it. Usage: findsim [Simulator Name]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length < 1)
-                return "Usage: findsim [Simulator Name]";
-
-            // Build the simulator name from the args list
-            string simName = string.Empty;
-            for (int i = 0; i < args.Length; i++)
-                simName += args[i] + " ";
-            simName = simName.TrimEnd().ToLower();
-
-            //if (!GridDataCached[Client])
-            //{
-            //    Client.Grid.RequestAllSims(GridManager.MapLayerType.Objects);
-            //    System.Threading.Thread.Sleep(5000);
-            //    GridDataCached[Client] = true;
-            //}
-
-            GridRegion region;
-
-            if (Client.Grid.GetGridRegion(simName, GridLayerType.Objects, out region))
-                return String.Format("{0}: handle={1} ({2},{3})", region.Name, region.RegionHandle, region.X, region.Y);
-            else
-                return "Lookup of " + simName + " failed";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/GridLayerCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/GridLayerCommand.cs
deleted file mode 100644
index 5f829ad..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/GridLayerCommand.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class GridLayerCommand : Command
-    {
-        public GridLayerCommand(TestClient testClient)
-        {
-            Name = "gridlayer";
-            Description = "Downloads all of the layer chunks for the grid object map";
-
-            testClient.Grid.OnGridLayer += new GridManager.GridLayerCallback(Grid_OnGridLayer);
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            Client.Grid.RequestMapLayer(GridLayerType.Objects);
-
-            return "Sent.";
-        }
-
-        private void Grid_OnGridLayer(GridLayer layer)
-        {
-            Console.WriteLine(String.Format("Layer({0}) Bottom: {1} Left: {2} Top: {3} Right: {4}",
-                layer.ImageID.ToString(), layer.Bottom, layer.Left, layer.Top, layer.Right));
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/GridMapCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/GridMapCommand.cs
deleted file mode 100644
index 3c6cb92..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/GridMapCommand.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class GridMapCommand : Command
-    {
-        public GridMapCommand(TestClient testClient)
-        {
-            Name = "gridmap";
-            Description = "Downloads all visible information about the grid map";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            //if (args.Length < 1)
-            //    return "";
-
-            Client.Grid.RequestMainlandSims(GridLayerType.Objects);
-
-            return "Sent.";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/ParcelInfoCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/ParcelInfoCommand.cs
deleted file mode 100644
index e3d0392..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Land/ParcelInfoCommand.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Utilities;
-
-namespace libsecondlife.TestClient
-{
-    public class ParcelInfoCommand : Command
-    {
-        private ParcelDownloader ParcelDownloader;
-        private AutoResetEvent ParcelsDownloaded = new AutoResetEvent(false);
-        private int ParcelCount = 0;
-
-        public ParcelInfoCommand(TestClient testClient)
-		{
-			Name = "parcelinfo";
-			Description = "Prints out info about all the parcels in this simulator";
-
-            ParcelDownloader = new ParcelDownloader(testClient);
-            ParcelDownloader.OnParcelsDownloaded += new ParcelDownloader.ParcelsDownloadedCallback(Parcels_OnParcelsDownloaded);
-            testClient.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            ParcelDownloader.DownloadSimParcels(Client.Network.CurrentSim);
-
-            ParcelsDownloaded.Reset();
-            if (ParcelsDownloaded.WaitOne(20000, false) && Client.Network.Connected)
-                return "Downloaded information for " + ParcelCount + " parcels in " + Client.Network.CurrentSim.Name;
-            else
-                return "Failed to retrieve information on all the simulator parcels";
-        }
-
-        void Parcels_OnParcelsDownloaded(Simulator simulator, Dictionary<int, Parcel> Parcels, int[,] map)
-        {
-            foreach (KeyValuePair<int, Parcel> parcel in Parcels)
-            {
-                WaterType type = ParcelDownloader.GetWaterType(map, parcel.Value.LocalID);
-                float delta = ParcelDownloader.GetHeightRange(map, parcel.Value.LocalID);
-                int deviation = ParcelDownloader.GetRectangularDeviation(parcel.Value.AABBMin, parcel.Value.AABBMax,
-                    parcel.Value.Area);
-
-                Console.WriteLine("Parcels[{0}]: Name: \"{1}\", Description: \"{2}\" ACL Count: {3}, " +
-                    "Location: {4}, Height Range: {5}, Shape Deviation: {6}", parcel.Key, parcel.Value.Name,
-                    parcel.Value.Desc, parcel.Value.AccessList.Count, type.ToString(), delta, deviation);
-            }
-
-            ParcelCount = Parcels.Count;
-            ParcelsDownloaded.Set();
-        }
-
-        void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message)
-        {
-            ParcelsDownloaded.Set();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/CrouchCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/CrouchCommand.cs
deleted file mode 100644
index 0d33342..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/CrouchCommand.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class CrouchCommand : Command
-    {
-        public CrouchCommand(TestClient testClient)
-        {
-            Name = "crouch";
-            Description = "Starts or stops crouching. Usage: crouch [start/stop]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            bool start = true;
-
-            if (args.Length == 1 && args[0].ToLower() == "stop")
-                start = false;
-
-            if (start)
-            {
-                Client.Self.Crouch(true);
-                return "Started crouching";
-            }
-            else
-            {
-                Client.Self.Crouch(false);
-                return "Stopped crouching";
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/FlyCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/FlyCommand.cs
deleted file mode 100644
index bf0611c..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/FlyCommand.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class FlyCommand : Command
-    {
-        public FlyCommand(TestClient testClient)
-        {
-            Name = "fly";
-            Description = "Starts or stops flying. Usage: fly [start/stop]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            bool start = true;
-
-            if (args.Length == 1 && args[0].ToLower() == "stop")
-                start = false;
-
-            if (start)
-            {
-                Client.Self.Fly(true);
-                return "Started flying";
-            }
-            else
-            {
-                Client.Self.Fly(false);
-                return "Stopped flying";
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/FollowCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/FollowCommand.cs
deleted file mode 100644
index a245434..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/FollowCommand.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class FollowCommand: Command
-    {
-		public FollowCommand(TestClient testClient)
-		{
-			Name = "follow";
-			Description = "Follow another avatar. (usage: follow [FirstName LastName])  If no target is set then will follow master.";
-
-            testClient.Network.RegisterCallback(PacketType.AlertMessage, new NetworkManager.PacketCallback(AlertMessageHandler));
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			string target = String.Empty;
-			for (int ct = 0; ct < args.Length; ct++)
-				target = target + args[ct] + " ";
-			target = target.TrimEnd();
-
-            if (target.Length > 0)
-            {
-                if (Follow(target))
-                    return "Following " + target;
-                else
-                    return "Unable to follow " + target + ".  Client may not be able to see that avatar.";
-            }
-            else
-            {
-                if (Follow(Client.MasterKey))
-                    return "Following " + Client.MasterKey;
-                else
-                    return "No target specified and no master not found. usage: follow [FirstName LastName])";
-            }
-		}
-
-        const float DISTANCE_BUFFER = 3.0f;
-        uint targetLocalID = 0;
-
-        bool Follow(string name)
-        {
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    Avatar target = Client.Network.Simulators[i].Objects.Find(
-                        delegate(Avatar avatar)
-                        {
-                            return avatar.Name == name;
-                        }
-                    );
-
-                    if (target != null)
-                    {
-                        targetLocalID = target.LocalID;
-                        Active = true;
-                        return true;
-                    }
-                }
-            }
-
-            Active = false;
-            return false;
-        }
-
-        bool Follow(LLUUID id)
-        {
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    Avatar target = Client.Network.Simulators[i].Objects.Find(
-                        delegate(Avatar avatar)
-                        {
-                            return avatar.ID == id;
-                        }
-                    );
-
-                    if (target != null)
-                    {
-                        targetLocalID = target.LocalID;
-                        Active = true;
-                        return true;
-                    }
-                }
-            }
-
-            Active = false;
-            return false;
-        }
-
-		public override void Think()
-		{
-            // Find the target position
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    Avatar targetAv;
-
-                    if (Client.Network.Simulators[i].Objects.TryGetAvatar(targetLocalID, out targetAv))
-                    {
-                        float distance = 0.0f;
-
-                        if (Client.Network.Simulators[i] == Client.Network.CurrentSim)
-                        {
-                            distance = LLVector3.Dist(targetAv.Position, Client.Self.SimPosition);
-                        }
-                        else
-                        {
-                            // FIXME: Calculate global distances
-                        }
-
-                        if (distance > DISTANCE_BUFFER)
-                        {
-                            uint regionX, regionY;
-                            Helpers.LongToUInts(Client.Network.Simulators[i].Handle, out regionX, out regionY);
-
-                            double xTarget = (double)targetAv.Position.X + (double)regionX;
-                            double yTarget = (double)targetAv.Position.Y + (double)regionY;
-                            double zTarget = targetAv.Position.Z - 2f;
-
-                            Client.DebugLog(String.Format("[Autopilot] {0} meters away from the target, starting autopilot to <{1},{2},{3}>",
-                                distance, xTarget, yTarget, zTarget));
-
-                            Client.Self.AutoPilot(xTarget, yTarget, zTarget);
-                        }
-                        else
-                        {
-                            // We are in range of the target and moving, stop moving
-                            Client.Self.AutoPilotCancel();
-                        }
-                    }
-                }
-            }
-
-			base.Think();
-		}
-
-        private void AlertMessageHandler(Packet packet, Simulator simulator)
-        {
-            AlertMessagePacket alert = (AlertMessagePacket)packet;
-            string message = Helpers.FieldToUTF8String(alert.AlertData.Message);
-
-            if (message.Contains("Autopilot cancel"))
-            {
-                Client.Log("Server cancelled the autopilot", Helpers.LogLevel.Info);
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/GotoCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/GotoCommand.cs
deleted file mode 100644
index 6e4cac3..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/GotoCommand.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class GotoCommand: Command
-    {
-        public GotoCommand(TestClient testClient)
-		{
-			Name = "goto";
-			Description = "Teleport to a location (e.g. \"goto Hooper/100/100/30\")";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			if (args.Length < 1)
-                return "Usage: goto sim/x/y/z";
-
-            string destination = String.Empty;
-
-            // Handle multi-word sim names by combining the arguments
-            foreach (string arg in args)
-            {
-                destination += arg + " ";
-            }
-            destination = destination.Trim();
-
-            string[] tokens = destination.Split(new char[] { '/' });
-            if (tokens.Length != 4)
-                return "Usage: goto sim/x/y/z";
-
-            string sim = tokens[0];
-            float x, y, z;
-            if (!float.TryParse(tokens[1], out x) ||
-                !float.TryParse(tokens[2], out y) ||
-                !float.TryParse(tokens[3], out z))
-            {
-                return "Usage: goto sim/x/y/z";
-            }
-
-            if (Client.Self.Teleport(sim, new LLVector3(x, y, z)))
-                return "Teleported to " + Client.Network.CurrentSim;
-            else
-                return "Teleport failed: " + Client.Self.TeleportMessage;
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/JumpCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/JumpCommand.cs
deleted file mode 100644
index a1bfd3e..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/JumpCommand.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class JumpCommand: Command
-    {
-        public JumpCommand(TestClient testClient)
-		{
-			Name = "jump";
-			Description = "Jumps or flies up";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-            Client.Self.Jump();
-            return "Jumped";
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/LocationCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/LocationCommand.cs
deleted file mode 100644
index 3f6501b..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/LocationCommand.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class LocationCommand: Command
-    {
-        public LocationCommand(TestClient testClient)
-		{
-			Name = "location";
-			Description = "Show the location.";
-		}
-
-		public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-            return "CurrentSim: '" + Client.Network.CurrentSim.ToString() + "' Position: " +
-                Client.Self.SimPosition.ToString();
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/MoveToCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/MoveToCommand.cs
deleted file mode 100644
index 0ac949e..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/MoveToCommand.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace libsecondlife.TestClient.Commands.Movement
-{
-    class MovetoCommand : Command
-    {
-        public MovetoCommand(TestClient client)
-        {
-            Name = "moveto";
-            Description = "Moves the avatar to the specified global position using simulator autopilot. Usage: moveto x y z";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 3)
-                return "Usage: moveto x y z";
-
-            uint regionX, regionY;
-            Helpers.LongToUInts(Client.Network.CurrentSim.Handle, out regionX, out regionY);
-
-            double x, y, z;
-            if (!Double.TryParse(args[0], out x) ||
-                !Double.TryParse(args[1], out y) ||
-                !Double.TryParse(args[2], out z))
-            {
-                return "Usage: moveto x y z";
-            }
-
-            // Convert the local coordinates to global ones by adding the region handle parts to x and y
-            x += (double)regionX;
-            y += (double)regionY;
-
-            Client.Self.AutoPilot(x, y, z);
-
-            return String.Format("Attempting to move to <{0},{1},{2}>", x, y, z);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SetHome.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SetHome.cs
deleted file mode 100644
index 5e14ca6..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SetHome.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class SetHomeCommand : Command
-    {
-		public SetHomeCommand(TestClient testClient)
-        {
-            Name = "sethome";
-            Description = "Sets home to the current location.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-			Client.Self.SetHome();
-            return "Home Set";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SitCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SitCommand.cs
deleted file mode 100644
index cc9b054..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SitCommand.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class SitCommand: Command
-    {
-        public SitCommand(TestClient testClient)
-		{
-			Name = "sit";
-			Description = "Attempt to sit on the closest prim";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-            Primitive closest = null;
-		    double closestDistance = Double.MaxValue;
-
-            Client.Network.CurrentSim.Objects.ForEach(
-                delegate(Primitive prim)
-                {
-                    float distance = LLVector3.Dist(Client.Self.SimPosition, prim.Position);
-
-                    if (closest == null || distance < closestDistance)
-                    {
-                        closest = prim;
-                        closestDistance = distance;
-                    }
-                }
-            );
-
-            if (closest != null)
-            {
-                Client.Self.RequestSit(closest.ID, LLVector3.Zero);
-                Client.Self.Sit();
-
-                return "Sat on " + closest.ID + ". Distance: " + closestDistance;
-            }
-            else
-            {
-                return "Couldn't find a nearby prim to sit on";
-            }
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SitOnCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SitOnCommand.cs
deleted file mode 100644
index 3ef0e26..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/SitOnCommand.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class SitOnCommand : Command
-    {
-        public SitOnCommand(TestClient testClient)
-        {
-            Name = "siton";
-            Description = "Attempt to sit on a particular prim, with specified UUID";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 1)
-                return "Usage: siton UUID";
-
-            LLUUID target;
-
-            if (LLUUID.TryParse(args[0], out target))
-            {
-                Primitive targetPrim = Client.Network.CurrentSim.Objects.Find(
-                    delegate(Primitive prim)
-                    {
-                        return prim.ID == target;
-                    }
-                );
-
-                if (targetPrim != null)
-                {
-                    Client.Self.RequestSit(targetPrim.ID, LLVector3.Zero);
-                    Client.Self.Sit();
-                    return "Requested to sit on prim " + targetPrim.ID.ToString() +
-                        " (" + targetPrim.LocalID + ")";
-                }
-            }
-
-            return "Couldn't find a prim to sit on with UUID " + args[0];
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/StandCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/StandCommand.cs
deleted file mode 100644
index e79bdfb..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Movement/StandCommand.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class StandCommand: Command
-    {
-        public StandCommand(TestClient testClient)
-	{
-		Name = "stand";
-		Description = "Stand";
-	}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-	    {
-            Client.Self.Stand();
-		    return "Standing up.";
-	    }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ChangePermsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ChangePermsCommand.cs
deleted file mode 100644
index f9e0f81..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ChangePermsCommand.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-
-namespace libsecondlife.TestClient
-{
-    public class ChangePermsCommand : Command
-    {
-        AutoResetEvent GotPermissionsEvent = new AutoResetEvent(false);
-        LLUUID SelectedObject = LLUUID.Zero;
-        Dictionary<LLUUID, Primitive> Objects = new Dictionary<LLUUID, Primitive>();
-        PermissionMask Perms = PermissionMask.None;
-        bool PermsSent = false;
-        int PermCount = 0;
-
-        public ChangePermsCommand(TestClient testClient)
-        {
-            testClient.Objects.OnObjectProperties += new ObjectManager.ObjectPropertiesCallback(Objects_OnObjectProperties);
-
-            Name = "changeperms";
-            Description = "Recursively changes all of the permissions for child and task inventory objects. Usage prim-uuid [copy] [mod] [xfer]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            LLUUID rootID;
-            Primitive rootPrim;
-            List<Primitive> childPrims;
-            List<uint> localIDs = new List<uint>();
-
-            // Reset class-wide variables
-            PermsSent = false;
-            Objects.Clear();
-            Perms = PermissionMask.None;
-            PermCount = 0;
-
-            if (args.Length < 1 || args.Length > 4)
-                return "Usage prim-uuid [copy] [mod] [xfer]";
-
-            if (!LLUUID.TryParse(args[0], out rootID))
-                return "Usage prim-uuid [copy] [mod] [xfer]";
-
-            for (int i = 1; i < args.Length; i++)
-            {
-                switch (args[i].ToLower())
-                {
-                    case "copy":
-                        Perms |= PermissionMask.Copy;
-                        break;
-                    case "mod":
-                        Perms |= PermissionMask.Modify;
-                        break;
-                    case "xfer":
-                        Perms |= PermissionMask.Transfer;
-                        break;
-                    default:
-                        return "Usage prim-uuid [copy] [mod] [xfer]";
-                }
-            }
-
-            Client.DebugLog("Using PermissionMask: " + Perms.ToString());
-
-            // Find the requested prim
-            rootPrim = Client.Network.CurrentSim.Objects.Find(delegate(Primitive prim) { return prim.ID == rootID; });
-            if (rootPrim == null)
-                return "Cannot find requested prim " + rootID.ToString();
-            else
-                Client.DebugLog("Found requested prim " + rootPrim.ID.ToString());
-
-            if (rootPrim.ParentID != 0)
-            {
-                // This is not actually a root prim, find the root
-                if (!Client.Network.CurrentSim.Objects.TryGetPrimitive(rootPrim.ParentID, out rootPrim))
-                    return "Cannot find root prim for requested object";
-                else
-                    Client.DebugLog("Set root prim to " + rootPrim.ID.ToString());
-            }
-
-            // Find all of the child objects linked to this root
-            childPrims = Client.Network.CurrentSim.Objects.FindAll(delegate(Primitive prim) { return prim.ParentID == rootPrim.LocalID; });
-
-            // Build a dictionary of primitives for referencing later
-            Objects[rootPrim.ID] = rootPrim;
-            for (int i = 0; i < childPrims.Count; i++)
-                Objects[childPrims[i].ID] = childPrims[i];
-
-            // Build a list of all the localIDs to set permissions for
-            localIDs.Add(rootPrim.LocalID);
-            for (int i = 0; i < childPrims.Count; i++)
-                localIDs.Add(childPrims[i].LocalID);
-
-            // Go through each of the three main permissions and enable or disable them
-            #region Set Linkset Permissions
-
-            PermCount = 0;
-            if ((Perms & PermissionMask.Modify) == PermissionMask.Modify)
-                Client.Objects.SetPermissions(Client.Network.CurrentSim, localIDs, PermissionWho.NextOwner, PermissionMask.Modify, true);
-            else
-                Client.Objects.SetPermissions(Client.Network.CurrentSim, localIDs, PermissionWho.NextOwner, PermissionMask.Modify, false);
-            PermsSent = true;
-
-            if (!GotPermissionsEvent.WaitOne(1000 * 30, false))
-                return "Failed to set the modify bit, permissions in an unknown state";
-
-            PermCount = 0;
-            if ((Perms & PermissionMask.Copy) == PermissionMask.Copy)
-                Client.Objects.SetPermissions(Client.Network.CurrentSim, localIDs, PermissionWho.NextOwner, PermissionMask.Copy, true);
-            else
-                Client.Objects.SetPermissions(Client.Network.CurrentSim, localIDs, PermissionWho.NextOwner, PermissionMask.Copy, false);
-            PermsSent = true;
-
-            if (!GotPermissionsEvent.WaitOne(1000 * 30, false))
-                return "Failed to set the copy bit, permissions in an unknown state";
-
-            PermCount = 0;
-            if ((Perms & PermissionMask.Transfer) == PermissionMask.Transfer)
-                Client.Objects.SetPermissions(Client.Network.CurrentSim, localIDs, PermissionWho.NextOwner, PermissionMask.Transfer, true);
-            else
-                Client.Objects.SetPermissions(Client.Network.CurrentSim, localIDs, PermissionWho.NextOwner, PermissionMask.Transfer, false);
-            PermsSent = true;
-
-            if (!GotPermissionsEvent.WaitOne(1000 * 30, false))
-                return "Failed to set the transfer bit, permissions in an unknown state";
-
-            #endregion Set Linkset Permissions
-
-            // Check each prim for task inventory and set permissions on the task inventory
-            int taskItems = 0;
-            foreach (Primitive prim in Objects.Values)
-            {
-                if ((prim.Flags & LLObject.ObjectFlags.InventoryEmpty) == 0)
-                {
-                    List<InventoryBase> items = Client.Inventory.GetTaskInventory(prim.ID, prim.LocalID, 1000 * 30);
-
-                    if (items != null)
-                    {
-                        for (int i = 0; i < items.Count; i++)
-                        {
-                            if (!(items[i] is InventoryFolder))
-                            {
-                                InventoryItem item = (InventoryItem)items[i];
-                                item.Permissions.NextOwnerMask = Perms;
-
-                                Client.Inventory.UpdateTaskInventory(prim.LocalID, item);
-                                ++taskItems;
-                            }
-                        }
-                    }
-                }
-            }
-
-            return "Set permissions to " + Perms.ToString() + " on " + localIDs.Count + " objects and " + taskItems + " inventory items";
-        }
-
-        void Objects_OnObjectProperties(Simulator simulator, LLObject.ObjectProperties properties)
-        {
-            if (PermsSent)
-            {
-                if (Objects.ContainsKey(properties.ObjectID))
-                {
-                    // FIXME: Confirm the current operation against properties.Permissions.NextOwnerMask
-
-                    ++PermCount;
-                    if (PermCount >= Objects.Count)
-                        GotPermissionsEvent.Set();
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ExportCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ExportCommand.cs
deleted file mode 100644
index 58abbb9..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ExportCommand.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife.TestClient
-{
-    public class ExportCommand : Command
-    {
-        AutoResetEvent GotPermissionsEvent = new AutoResetEvent(false);
-        LLObject.ObjectPropertiesFamily Properties;
-        bool GotPermissions = false;
-        LLUUID SelectedObject = LLUUID.Zero;
-
-        Dictionary<LLUUID, Primitive> PrimsWaiting = new Dictionary<LLUUID, Primitive>();
-        AutoResetEvent AllPropertiesReceived = new AutoResetEvent(false);
-
-        public ExportCommand(TestClient testClient)
-        {
-            testClient.Objects.OnObjectPropertiesFamily += new ObjectManager.ObjectPropertiesFamilyCallback(Objects_OnObjectPropertiesFamily);
-            testClient.Objects.OnObjectProperties += new ObjectManager.ObjectPropertiesCallback(Objects_OnObjectProperties);
-            testClient.Avatars.OnPointAt += new AvatarManager.PointAtCallback(Avatars_OnPointAt);
-
-            Name = "export";
-            Description = "Exports an object to an xml file. Usage: export uuid outputfile.xml";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 2 && !(args.Length == 1 && SelectedObject != LLUUID.Zero))
-                return "Usage: export uuid outputfile.xml";
-
-            LLUUID id;
-            uint localid;
-            string file;
-
-            if (args.Length == 2)
-            {
-                file = args[1];
-                if (!LLUUID.TryParse(args[0], out id))
-                    return "Usage: export uuid outputfile.xml";
-            }
-            else
-            {
-                file = args[0];
-                id = SelectedObject;
-            }
-
-            Primitive exportPrim;
-
-            exportPrim = Client.Network.CurrentSim.Objects.Find(
-                delegate(Primitive prim) { return prim.ID == id; }
-            );
-
-            if (exportPrim != null)
-            {
-                if (exportPrim.ParentID != 0)
-                    localid = exportPrim.ParentID;
-                else
-                    localid = exportPrim.LocalID;
-
-                // Check for export permission first
-                Client.Objects.RequestObjectPropertiesFamily(Client.Network.CurrentSim, id);
-                GotPermissionsEvent.WaitOne(1000 * 10, false);
-
-                if (!GotPermissions)
-                {
-                    return "Couldn't fetch permissions for the requested object, try again";
-                }
-                else
-                {
-                    GotPermissions = false;
-                    if (Properties.OwnerID != Client.Self.AgentID &&
-                        Properties.OwnerID != Client.MasterKey &&
-                        Client.Self.AgentID != Client.Self.AgentID)
-                    {
-                        return "That object is owned by " + Properties.OwnerID + ", we don't have permission " +
-                            "to export it";
-                    }
-                }
-
-                List<Primitive> prims = Client.Network.CurrentSim.Objects.FindAll(
-                    delegate(Primitive prim)
-                    {
-                        return (prim.LocalID == localid || prim.ParentID == localid);
-                    }
-                );
-
-                bool complete = RequestObjectProperties(prims, 250);
-
-                if (!complete)
-                {
-                    Console.WriteLine("Warning: Unable to retrieve full properties for:");
-                    foreach (LLUUID uuid in PrimsWaiting.Keys)
-                        Console.WriteLine(uuid);
-                }
-
-                string output = LLSDParser.SerializeXmlString(Helpers.PrimListToLLSD(prims));
-                try { File.WriteAllText(file, output); }
-                catch (Exception e) { return e.Message; }
-
-                return "Exported " + prims.Count + " prims to " + file;
-            }
-            else
-            {
-                return "Couldn't find UUID " + id.ToString() + " in the " +
-                    Client.Network.CurrentSim.Objects.PrimCount +
-                    "objects currently indexed in the current simulator";
-            }
-        }
-
-        private bool RequestObjectProperties(List<Primitive> objects, int msPerRequest)
-        {
-            // Create an array of the local IDs of all the prims we are requesting properties for
-            uint[] localids = new uint[objects.Count];
-
-            lock (PrimsWaiting)
-            {
-                PrimsWaiting.Clear();
-
-                for (int i = 0; i < objects.Count; ++i)
-                {
-                    localids[i] = objects[i].LocalID;
-                    PrimsWaiting.Add(objects[i].ID, objects[i]);
-                }
-            }
-
-            Client.Objects.SelectObjects(Client.Network.CurrentSim, localids);
-
-            return AllPropertiesReceived.WaitOne(2000 + msPerRequest * objects.Count, false);
-        }
-
-        void Avatars_OnPointAt(LLUUID sourceID, LLUUID targetID, LLVector3d targetPos,
-            PointAtType pointType, float duration, LLUUID id)
-        {
-            if (sourceID == Client.MasterKey)
-            {
-                //Client.DebugLog("Master is now selecting " + targetID.ToString());
-                SelectedObject = targetID;
-            }
-        }
-
-        void Objects_OnObjectPropertiesFamily(Simulator simulator, LLObject.ObjectPropertiesFamily properties)
-        {
-            Properties = properties;
-            GotPermissions = true;
-            GotPermissionsEvent.Set();
-        }
-
-        void Objects_OnObjectProperties(Simulator simulator, LLObject.ObjectProperties properties)
-        {
-            lock (PrimsWaiting)
-            {
-                PrimsWaiting.Remove(properties.ObjectID);
-
-                if (PrimsWaiting.Count == 0)
-                    AllPropertiesReceived.Set();
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ExportParticlesCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ExportParticlesCommand.cs
deleted file mode 100644
index 953f78e..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ExportParticlesCommand.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class ExportParticlesCommand : Command
-    {
-        public ExportParticlesCommand(TestClient testClient)
-        {
-            Name = "exportparticles";
-            Description = "Reverse engineers a prim with a particle system to an LSL script. Usage: exportscript [prim-uuid]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 1)
-                return "Usage: exportparticles [prim-uuid]";
-
-            LLUUID id;
-            if (!LLUUID.TryParse(args[0], out id))
-                return "Usage: exportparticles [prim-uuid]";
-
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    Primitive exportPrim = Client.Network.Simulators[i].Objects.Find(
-                        delegate(Primitive prim)
-                        {
-                            return prim.ID == id;
-                        }
-                    );
-
-                    if (exportPrim != null)
-                    {
-                        if (exportPrim.ParticleSys.CRC != 0)
-                        {
-                            StringBuilder lsl = new StringBuilder();
-
-                            #region Particle System to LSL
-
-                            lsl.Append("default" + Environment.NewLine);
-                            lsl.Append("{" + Environment.NewLine);
-                            lsl.Append("    state_entry()" + Environment.NewLine);
-                            lsl.Append("    {" + Environment.NewLine);
-                            lsl.Append("         llParticleSystem([" + Environment.NewLine);
-
-                            lsl.Append("         PSYS_PART_FLAGS, 0");
-
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.InterpColor) != 0)
-                                lsl.Append(" | PSYS_PART_INTERP_COLOR_MASK");
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.InterpScale) != 0)
-                                lsl.Append(" | PSYS_PART_INTERP_SCALE_MASK");
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.Bounce) != 0)
-                                lsl.Append(" | PSYS_PART_BOUNCE_MASK");
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.Wind) != 0)
-                                lsl.Append(" | PSYS_PART_WIND_MASK");
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.FollowSrc) != 0)
-                                lsl.Append(" | PSYS_PART_FOLLOW_SRC_MASK");
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.FollowVelocity) != 0)
-                                lsl.Append(" | PSYS_PART_FOLLOW_VELOCITY_MASK");
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.TargetPos) != 0)
-                                lsl.Append(" | PSYS_PART_TARGET_POS_MASK");
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.TargetLinear) != 0)
-                                lsl.Append(" | PSYS_PART_TARGET_LINEAR_MASK");
-                            if ((exportPrim.ParticleSys.PartDataFlags & Primitive.ParticleSystem.ParticleDataFlags.Emissive) != 0)
-                                lsl.Append(" | PSYS_PART_EMISSIVE_MASK");
-
-                            lsl.Append(","); lsl.Append(Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_PATTERN, 0");
-
-                            if ((exportPrim.ParticleSys.Pattern & Primitive.ParticleSystem.SourcePattern.Drop) != 0)
-                                lsl.Append(" | PSYS_SRC_PATTERN_DROP");
-                            if ((exportPrim.ParticleSys.Pattern & Primitive.ParticleSystem.SourcePattern.Explode) != 0)
-                                lsl.Append(" | PSYS_SRC_PATTERN_EXPLODE");
-                            if ((exportPrim.ParticleSys.Pattern & Primitive.ParticleSystem.SourcePattern.Angle) != 0)
-                                lsl.Append(" | PSYS_SRC_PATTERN_ANGLE");
-                            if ((exportPrim.ParticleSys.Pattern & Primitive.ParticleSystem.SourcePattern.AngleCone) != 0)
-                                lsl.Append(" | PSYS_SRC_PATTERN_ANGLE_CONE");
-                            if ((exportPrim.ParticleSys.Pattern & Primitive.ParticleSystem.SourcePattern.AngleConeEmpty) != 0)
-                                lsl.Append(" | PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY");
-
-                            lsl.Append("," + Environment.NewLine);
-
-                            lsl.Append("         PSYS_PART_START_ALPHA, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.PartStartColor.A) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_PART_END_ALPHA, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.PartEndColor.A) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_PART_START_COLOR, " + exportPrim.ParticleSys.PartStartColor.ToStringRGB() + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_PART_END_COLOR, " + exportPrim.ParticleSys.PartEndColor.ToStringRGB() + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_PART_START_SCALE, <" + String.Format("{0:0.00000}", exportPrim.ParticleSys.PartStartScaleX) + ", " + String.Format("{0:0.00000}", exportPrim.ParticleSys.PartStartScaleY) + ", 0>, " + Environment.NewLine);
-                            lsl.Append("         PSYS_PART_END_SCALE, <" + String.Format("{0:0.00000}", exportPrim.ParticleSys.PartEndScaleX) + ", " + String.Format("{0:0.00000}", exportPrim.ParticleSys.PartEndScaleY) + ", 0>, " + Environment.NewLine);
-                            lsl.Append("         PSYS_PART_MAX_AGE, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.PartMaxAge) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_MAX_AGE, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.MaxAge) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_ACCEL, " + exportPrim.ParticleSys.PartAcceleration.ToString() + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_BURST_PART_COUNT, " + String.Format("{0:0}", exportPrim.ParticleSys.BurstPartCount) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_BURST_RADIUS, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.BurstRadius) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_BURST_RATE, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.BurstRate) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_BURST_SPEED_MIN, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.BurstSpeedMin) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_BURST_SPEED_MAX, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.BurstSpeedMax) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_INNERANGLE, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.InnerAngle) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_OUTERANGLE, " + String.Format("{0:0.00000}", exportPrim.ParticleSys.OuterAngle) + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_OMEGA, " + exportPrim.ParticleSys.AngularVelocity.ToString() + "," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_TEXTURE, (key)\"" + exportPrim.ParticleSys.Texture.ToString() + "\"," + Environment.NewLine);
-                            lsl.Append("         PSYS_SRC_TARGET_KEY, (key)\"" + exportPrim.ParticleSys.Target.ToString() + "\"" + Environment.NewLine);
-
-                            lsl.Append("         ]);" + Environment.NewLine);
-                            lsl.Append("    }" + Environment.NewLine);
-                            lsl.Append("}" + Environment.NewLine);
-
-                            #endregion Particle System to LSL
-
-                            return lsl.ToString();
-                        }
-                        else
-                        {
-                            return "Prim " + exportPrim.LocalID + " does not have a particle system";
-                        }
-                    }
-                }
-            }
-
-            return "Couldn't find prim " + id.ToString();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/FindObjectsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/FindObjectsCommand.cs
deleted file mode 100644
index ac501ff..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/FindObjectsCommand.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-
-using libsecondlife;
-
-
-namespace libsecondlife.TestClient
-{
-    public class FindObjectsCommand : Command
-    {
-        Dictionary<LLUUID, Primitive> PrimsWaiting = new Dictionary<LLUUID, Primitive>();
-        AutoResetEvent AllPropertiesReceived = new AutoResetEvent(false);
-
-        public FindObjectsCommand(TestClient testClient)
-        {
-            testClient.Objects.OnObjectProperties += new ObjectManager.ObjectPropertiesCallback(Objects_OnObjectProperties);
-
-            Name = "findobjects";
-            Description = "Finds all objects, which name contains search-string. " +
-                "Usage: findobjects [radius] <search-string>";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            // *** parse arguments ***
-            if ((args.Length < 1) || (args.Length > 2))
-                return "Usage: findobjects [radius] <search-string>";
-            float radius = float.Parse(args[0]);
-            string searchString = (args.Length > 1)? args[1] : "";
-
-            // *** get current location ***
-            LLVector3 location = Client.Self.SimPosition;
-
-            // *** find all objects in radius ***
-            List<Primitive> prims = Client.Network.CurrentSim.Objects.FindAll(
-                delegate(Primitive prim) {
-                    LLVector3 pos = prim.Position;
-                    return ((prim.ParentID == 0) && (pos != LLVector3.Zero) && (LLVector3.Dist(pos, location) < radius));
-                }
-            );
-
-            // *** request properties of these objects ***
-            bool complete = RequestObjectProperties(prims, 250);
-
-            foreach (Primitive p in prims) {
-                string name = p.Properties.Name;
-                if ((name != null) && (name.Contains(searchString)))
-                    Console.WriteLine(String.Format("Object '{0}': {1}", name, p.ID.ToString()));
-            }
-
-            if (!complete) {
-                Console.WriteLine("Warning: Unable to retrieve full properties for:");
-                foreach (LLUUID uuid in PrimsWaiting.Keys)
-                    Console.WriteLine(uuid);
-            }
-
-            return "Done searching";
-        }
-
-        private bool RequestObjectProperties(List<Primitive> objects, int msPerRequest)
-        {
-            // Create an array of the local IDs of all the prims we are requesting properties for
-            uint[] localids = new uint[objects.Count];
-
-            lock (PrimsWaiting) {
-                PrimsWaiting.Clear();
-
-                for (int i = 0; i < objects.Count; ++i) {
-                    localids[i] = objects[i].LocalID;
-                    PrimsWaiting.Add(objects[i].ID, objects[i]);
-                }
-            }
-
-            Client.Objects.SelectObjects(Client.Network.CurrentSim, localids);
-
-            return AllPropertiesReceived.WaitOne(2000 + msPerRequest * objects.Count, false);
-        }
-
-        void Objects_OnObjectProperties(Simulator simulator, LLObject.ObjectProperties properties)
-        {
-            lock (PrimsWaiting) {
-                Primitive prim;
-                if (PrimsWaiting.TryGetValue(properties.ObjectID, out prim)) {
-                    prim.Properties = properties;
-                }
-                PrimsWaiting.Remove(properties.ObjectID);
-
-                if (PrimsWaiting.Count == 0)
-                    AllPropertiesReceived.Set();
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/FindTextureCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/FindTextureCommand.cs
deleted file mode 100644
index fa0b3d9..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/FindTextureCommand.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class FindTextureCommand : Command
-    {
-        public FindTextureCommand(TestClient testClient)
-        {
-            Name = "findtexture";
-            Description = "Checks if a specified texture is currently visible on a specified face. " +
-                "Usage: findtexture [face-index] [texture-uuid]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            int faceIndex;
-            LLUUID textureID;
-
-            if (args.Length != 2)
-                return "Usage: findtexture [face-index] [texture-uuid]";
-
-            if (Int32.TryParse(args[0], out faceIndex) &&
-                LLUUID.TryParse(args[1], out textureID))
-            {
-                Client.Network.CurrentSim.Objects.ForEach(
-                    delegate(Primitive prim)
-                    {
-                        if (prim.Textures != null && prim.Textures.FaceTextures[faceIndex] != null)
-                        {
-                            if (prim.Textures.FaceTextures[faceIndex].TextureID == textureID)
-                            {
-                                Client.Log(String.Format("Primitive {0} ({1}) has face index {2} set to {3}",
-                                    prim.ID.ToString(), prim.LocalID, faceIndex, textureID.ToString()),
-                                    Helpers.LogLevel.Info);
-                            }
-                        }
-                    }
-                );
-
-                return "Done searching";
-            }
-            else
-            {
-                return "Usage: findtexture [face-index] [texture-uuid]";
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ImportCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ImportCommand.cs
deleted file mode 100644
index 24cfc97..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/ImportCommand.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.IO;
-using libsecondlife;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife.TestClient
-{
-    public class ImportCommand : Command
-    {
-        private enum ImporterState
-        {
-            RezzingParent,
-            RezzingChildren,
-            Linking,
-            Idle
-        }
-
-        private class Linkset
-        {
-            public Primitive RootPrim;
-            public List<Primitive> Children = new List<Primitive>();
-
-            public Linkset()
-            {
-                RootPrim = new Primitive();
-            }
-
-            public Linkset(Primitive rootPrim)
-            {
-                RootPrim = rootPrim;
-            }
-        }
-
-        Primitive currentPrim;
-        LLVector3 currentPosition;
-        AutoResetEvent primDone = new AutoResetEvent(false);
-        List<Primitive> primsCreated;
-        List<uint> linkQueue;
-        uint rootLocalID;
-        ImporterState state = ImporterState.Idle;
-
-        public ImportCommand(TestClient testClient)
-        {
-            Name = "import";
-            Description = "Import prims from an exported xml file. Usage: import inputfile.xml [usegroup]";
-
-            testClient.Objects.OnNewPrim += new ObjectManager.NewPrimCallback(Objects_OnNewPrim);
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length < 1)
-                return "Usage: import inputfile.xml [usegroup]";
-
-            string filename = args[0];
-            LLUUID GroupID = (args.Length > 1) ? Client.GroupID : LLUUID.Zero;
-            string xml;
-            List<Primitive> prims;
-
-            try { xml = File.ReadAllText(filename); }
-            catch (Exception e) { return e.Message; }
-
-            try { prims = Helpers.LLSDToPrimList(LLSDParser.DeserializeXml(xml)); }
-            catch (Exception e) { return "Failed to deserialize " + filename + ": " + e.Message; }
-
-            // Build an organized structure from the imported prims
-            Dictionary<uint, Linkset> linksets = new Dictionary<uint, Linkset>();
-            for (int i = 0; i < prims.Count; i++)
-            {
-                Primitive prim = prims[i];
-
-                if (prim.ParentID == 0)
-                {
-                    if (linksets.ContainsKey(prim.LocalID))
-                        linksets[prim.LocalID].RootPrim = prim;
-                    else
-                        linksets[prim.LocalID] = new Linkset(prim);
-                }
-                else
-                {
-                    if (!linksets.ContainsKey(prim.ParentID))
-                        linksets[prim.ParentID] = new Linkset();
-
-                    linksets[prim.ParentID].Children.Add(prim);
-                }
-            }
-
-            primsCreated = new List<Primitive>();
-            Console.WriteLine("Importing " + linksets.Count + " structures.");
-
-            foreach (Linkset linkset in linksets.Values)
-            {
-                if (linkset.RootPrim.LocalID != 0)
-                {
-                    state = ImporterState.RezzingParent;
-                    currentPrim = linkset.RootPrim;
-                    // HACK: Import the structure just above our head
-                    // We need a more elaborate solution for importing with relative or absolute offsets
-                    linkset.RootPrim.Position = Client.Self.SimPosition;
-                    linkset.RootPrim.Position.Z += 3.0f;
-                    currentPosition = linkset.RootPrim.Position;
-
-                    // Rez the root prim with no rotation
-                    LLQuaternion rootRotation = linkset.RootPrim.Rotation;
-                    linkset.RootPrim.Rotation = LLQuaternion.Identity;
-
-                    Client.Objects.AddPrim(Client.Network.CurrentSim, linkset.RootPrim.Data, GroupID,
-                        linkset.RootPrim.Position, linkset.RootPrim.Scale, linkset.RootPrim.Rotation);
-
-                    if (!primDone.WaitOne(10000, false))
-                        return "Rez failed, timed out while creating the root prim.";
-
-                    state = ImporterState.RezzingChildren;
-
-                    // Rez the child prims
-                    foreach (Primitive prim in linkset.Children)
-                    {
-                        currentPrim = prim;
-                        currentPosition = prim.Position + linkset.RootPrim.Position;
-
-                        Client.Objects.AddPrim(Client.Network.CurrentSim, prim.Data, GroupID, currentPosition,
-                            prim.Scale, prim.Rotation);
-
-                        if (!primDone.WaitOne(10000, false))
-                            return "Rez failed, timed out while creating child prim.";
-                    }
-
-                    if (linkset.Children.Count != 0)
-                    {
-                        // Create a list of the local IDs of the newly created prims
-                        List<uint> primIDs = new List<uint>(primsCreated.Count);
-                        primIDs.Add(rootLocalID); // Root prim is first in list.
-                        foreach (Primitive prim in primsCreated)
-                        {
-                            if (prim.LocalID != rootLocalID)
-                                primIDs.Add(prim.LocalID);
-                        }
-                        linkQueue = new List<uint>(primIDs.Count);
-                        linkQueue.AddRange(primIDs);
-
-                        // Link and set the permissions + rotation
-                        state = ImporterState.Linking;
-                        Client.Objects.LinkPrims(Client.Network.CurrentSim, linkQueue);
-
-                        if (primDone.WaitOne(1000 * linkset.Children.Count, false))
-                            Client.Objects.SetRotation(Client.Network.CurrentSim, rootLocalID, rootRotation);
-                        else
-                            Console.WriteLine("Warning: Failed to link {0} prims", linkQueue.Count);
-
-                        Client.Objects.SetPermissions(Client.Network.CurrentSim, primIDs,
-                            PermissionWho.Everyone | PermissionWho.Group | PermissionWho.NextOwner,
-                            PermissionMask.All, true);
-                    }
-                    else
-                    {
-                        Client.Objects.SetRotation(Client.Network.CurrentSim, rootLocalID, rootRotation);
-                    }
-                    state = ImporterState.Idle;
-                }
-                else
-                {
-                    // Skip linksets with a missing root prim
-                    Console.WriteLine("WARNING: Skipping a linkset with a missing root prim");
-                }
-
-                // Reset everything for the next linkset
-                primsCreated.Clear();
-            }
-
-            return "Import complete.";
-        }
-
-        void Objects_OnNewPrim(Simulator simulator, Primitive prim, ulong regionHandle, ushort timeDilation)
-        {
-            if ((prim.Flags & LLObject.ObjectFlags.CreateSelected) == 0)
-                return; // We received an update for an object we didn't create
-
-            switch (state)
-            {
-                case ImporterState.RezzingParent:
-                    rootLocalID = prim.LocalID;
-                    goto case ImporterState.RezzingChildren;
-                case ImporterState.RezzingChildren:
-                    if (!primsCreated.Contains(prim))
-                    {
-                        Console.WriteLine("Setting properties for " + prim.LocalID);
-                        // TODO: Is there a way to set all of this at once, and update more ObjectProperties stuff?
-                        Client.Objects.SetPosition(simulator, prim.LocalID, currentPosition);
-                        Client.Objects.SetTextures(simulator, prim.LocalID, currentPrim.Textures);
-                        Client.Objects.SetLight(simulator, prim.LocalID, currentPrim.Light);
-                        Client.Objects.SetFlexible(simulator, prim.LocalID, currentPrim.Flexible);
-
-                        if (!String.IsNullOrEmpty(currentPrim.Properties.Name))
-                            Client.Objects.SetName(simulator, prim.LocalID, currentPrim.Properties.Name);
-                        if (!String.IsNullOrEmpty(currentPrim.Properties.Description))
-                            Client.Objects.SetDescription(simulator, prim.LocalID, currentPrim.Properties.Description);
-
-                        primsCreated.Add(prim);
-                        primDone.Set();
-                    }
-                    break;
-                case ImporterState.Linking:
-                    lock (linkQueue)
-                    {
-                        int index = linkQueue.IndexOf(prim.LocalID);
-                        if (index != -1)
-                        {
-                            linkQueue.RemoveAt(index);
-                            if (linkQueue.Count == 0)
-                                primDone.Set();
-                        }
-                    }
-                    break;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimCountCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimCountCommand.cs
deleted file mode 100644
index 9633d7b..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimCountCommand.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class PrimCountCommand: Command
-    {
-        public PrimCountCommand(TestClient testClient)
-		{
-			Name = "primcount";
-			Description = "Shows the number of objects currently being tracked.";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-            int count = 0;
-
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    int avcount = Client.Network.Simulators[i].Objects.AvatarCount;
-                    int primcount = Client.Network.Simulators[i].Objects.PrimCount;
-
-                    Console.WriteLine("{0} (Avatars: {1} Primitives: {2})",
-                        Client.Network.Simulators[i].Name, avcount, primcount);
-
-                    count += avcount;
-                    count += primcount;
-                }
-            }
-
-			return "Tracking a total of " + count + " objects";
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimInfoCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimInfoCommand.cs
deleted file mode 100644
index 304d39f..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimInfoCommand.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class PrimInfoCommand : Command
-    {
-        public PrimInfoCommand(TestClient testClient)
-        {
-            Name = "priminfo";
-            Description = "Dumps information about a specified prim. " + "Usage: priminfo [prim-uuid]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            LLUUID primID;
-
-            if (args.Length != 1)
-                return "Usage: priminfo [prim-uuid]";
-
-            if (LLUUID.TryParse(args[0], out primID))
-            {
-                Primitive target = Client.Network.CurrentSim.Objects.Find(
-                    delegate(Primitive prim) { return prim.ID == primID; }
-                );
-
-                if (target != null)
-                {
-                    Client.Log("Light: " + target.Light.ToString(), Helpers.LogLevel.Info);
-
-                    if (target.ParticleSys.CRC != 0)
-                        Client.Log("Particles: " + target.ParticleSys.ToString(), Helpers.LogLevel.Info);
-
-                    Client.Log("TextureEntry:", Helpers.LogLevel.Info);
-                    if (target.Textures != null)
-                    {
-                        for (int i = 0; i < target.Textures.FaceTextures.Length; i++)
-                        {
-                            if (target.Textures.FaceTextures[i] != null)
-                            {
-                                Client.Log(String.Format("Face {0}: {1}", i,
-                                    target.Textures.FaceTextures[i].TextureID.ToString()),
-                                    Helpers.LogLevel.Info);
-                            }
-                        }
-                    }
-                    else
-                    {
-                        Client.Log("null", Helpers.LogLevel.Info);
-                    }
-
-                    return "Done.";
-                }
-                else
-                {
-                    return "Could not find prim " + primID.ToString();
-                }
-            }
-            else
-            {
-                return "Usage: priminfo [prim-uuid]";
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimRegexCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimRegexCommand.cs
deleted file mode 100644
index 4399c39..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Prims/PrimRegexCommand.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-using System.Text.RegularExpressions;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class PrimRegexCommand : Command
-    {
-        public PrimRegexCommand(TestClient testClient)
-        {
-            Name = "primregex";
-            Description = "Find prim by text predicat. " +
-                "Usage: primregex [text predicat] (eg findprim .away.)";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length < 1)
-                return "Usage: primregex [text predicat]";
-
-            try
-            {
-                // Build the predicat from the args list
-                string predicatPrim = string.Empty;
-                for (int i = 0; i < args.Length; i++)
-                    predicatPrim += args[i] + " ";
-                predicatPrim = predicatPrim.TrimEnd();
-
-                // Build Regex
-                Regex regexPrimName = new Regex(predicatPrim.ToLower());
-
-                // Print result
-                Client.Log(string.Format("Searching prim for [{0}] ({1} prims loaded in simulator)\n", predicatPrim, Client.Network.CurrentSim.Objects.PrimCount), Helpers.LogLevel.Info);
-                Client.Network.CurrentSim.Objects.ForEach(
-                    delegate(Primitive prim)
-                    {
-                        if (prim.Text != null && regexPrimName.IsMatch(prim.Text.ToLower()))
-                        {
-                            Client.Log(string.Format("\nNAME={0}\nID = {1}\nFLAGS = {2}\nTEXT = '{3}'\nDESC='{4}", prim.PropertiesFamily.Name, prim.ID, prim.Flags.ToString(), prim.Text, prim.PropertiesFamily.Description), Helpers.LogLevel.Info);
-                        }
-                        else if (prim.PropertiesFamily.Name != null && regexPrimName.IsMatch(prim.PropertiesFamily.Name.ToLower()))
-                        {
-                            Client.Log(string.Format("\nNAME={0}\nID = {1}\nFLAGS = {2}\nTEXT = '{3}'\nDESC='{4}", prim.PropertiesFamily.Name, prim.ID, prim.Flags.ToString(), prim.Text, prim.PropertiesFamily.Description), Helpers.LogLevel.Info);
-                        }
-                        else if (prim.PropertiesFamily.Description != null && regexPrimName.IsMatch(prim.PropertiesFamily.Description.ToLower()))
-                        {
-                            Client.Log(string.Format("\nNAME={0}\nID = {1}\nFLAGS = {2}\nTEXT = '{3}'\nDESC='{4}", prim.PropertiesFamily.Name, prim.ID, prim.Flags.ToString(), prim.Text, prim.PropertiesFamily.Description), Helpers.LogLevel.Info);
-                        }
-                    }
-                );
-            }
-            catch (System.Exception e)
-            {
-                Client.Log(e.ToString(), Helpers.LogLevel.Error);
-                return "Error searching";
-            }
-
-            return "Done searching";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/DilationCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/DilationCommand.cs
deleted file mode 100644
index 979282c..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/DilationCommand.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class DilationCommand : Command
-    {
-		public DilationCommand(TestClient testClient)
-        {
-            Name = "dilation";
-            Description = "Shows time dilation for current sim.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            return "Dilation is " + Client.Network.CurrentSim.Stats.Dilation.ToString();
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/RegionInfoCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/RegionInfoCommand.cs
deleted file mode 100644
index c8b303f..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/RegionInfoCommand.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Text;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class RegionInfoCommand : Command
-    {
-        public RegionInfoCommand(TestClient testClient)
-		{
-			Name = "regioninfo";
-			Description = "Prints out info about all the current region";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            StringBuilder output = new StringBuilder();
-            output.AppendLine(Client.Network.CurrentSim.ToString());
-            output.Append("UUID: ");
-            output.AppendLine(Client.Network.CurrentSim.ID.ToString());
-            uint x, y;
-            Helpers.LongToUInts(Client.Network.CurrentSim.Handle, out x, out y);
-            output.AppendLine(String.Format("Handle: {0} (X: {1} Y: {2})", Client.Network.CurrentSim.Handle, x, y));
-            output.Append("Access: ");
-            output.AppendLine(Client.Network.CurrentSim.Access.ToString());
-            output.Append("Flags: ");
-            output.AppendLine(Client.Network.CurrentSim.Flags.ToString());
-            output.Append("TerrainBase0: ");
-            output.AppendLine(Client.Network.CurrentSim.TerrainBase0.ToString());
-            output.Append("TerrainBase1: ");
-            output.AppendLine(Client.Network.CurrentSim.TerrainBase1.ToString());
-            output.Append("TerrainBase2: ");
-            output.AppendLine(Client.Network.CurrentSim.TerrainBase2.ToString());
-            output.Append("TerrainBase3: ");
-            output.AppendLine(Client.Network.CurrentSim.TerrainBase3.ToString());
-            output.Append("TerrainDetail0: ");
-            output.AppendLine(Client.Network.CurrentSim.TerrainDetail0.ToString());
-            output.Append("TerrainDetail1: ");
-            output.AppendLine(Client.Network.CurrentSim.TerrainDetail1.ToString());
-            output.Append("TerrainDetail2: ");
-            output.AppendLine(Client.Network.CurrentSim.TerrainDetail2.ToString());
-            output.Append("TerrainDetail3: ");
-            output.AppendLine(Client.Network.CurrentSim.TerrainDetail3.ToString());
-            output.Append("Water Height: ");
-            output.AppendLine(Client.Network.CurrentSim.WaterHeight.ToString());
-
-            return output.ToString();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/StatsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/StatsCommand.cs
deleted file mode 100644
index bbb6757..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/StatsCommand.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class StatsCommand : Command
-    {
-        public StatsCommand(TestClient testClient)
-        {
-            Name = "stats";
-            Description = "Provide connection figures and statistics";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            StringBuilder output = new StringBuilder();
-
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    Simulator sim = Client.Network.Simulators[i];
-
-                    output.AppendLine(String.Format(
-                        "[{0}] Dilation: {1} InBPS: {2} OutBPS: {3} ResentOut: {4}  ResentIn: {5}",
-                        sim.ToString(), sim.Stats.Dilation, sim.Stats.IncomingBPS, sim.Stats.OutgoingBPS,
-                        sim.Stats.ResentPackets, sim.Stats.ReceivedResends));
-                }
-            }
-
-            Simulator csim = Client.Network.CurrentSim;
-
-            output.Append("Packets in the queue: " + Client.Network.InboxCount);
-			output.AppendLine(String.Format("FPS : {0} PhysicsFPS : {1} AgentUpdates : {2} Objects : {3} Scripted Objects : {4}",
-                csim.Stats.FPS, csim.Stats.PhysicsFPS, csim.Stats.AgentUpdates, csim.Stats.Objects, csim.Stats.ScriptedObjects));
-			output.AppendLine(String.Format("Frame Time : {0} Net Time : {1} Image Time : {2} Physics Time : {3} Script Time : {4} Other Time : {5}",
-                csim.Stats.FrameTime, csim.Stats.NetTime, csim.Stats.ImageTime, csim.Stats.PhysicsTime, csim.Stats.ScriptTime, csim.Stats.OtherTime));
-			output.AppendLine(String.Format("Agents : {0} Child Agents : {1} Active Scripts : {2}",
-                csim.Stats.Agents, csim.Stats.ChildAgents, csim.Stats.ActiveScripts));
-
-            return output.ToString();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/UptimeCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/UptimeCommand.cs
deleted file mode 100644
index 3edec73..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/Stats/UptimeCommand.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class UptimeCommand : Command
-    {
-        public DateTime Created = DateTime.Now;
-
-        public UptimeCommand(TestClient testClient)
-        {
-            Name = "uptime";
-            Description = "Shows the login name, login time and length of time logged on.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            string name = Client.ToString();
-            return "I am " + name + ", Up Since: " + Created + " (" + (DateTime.Now - Created) + ")";
-        }
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/DebugCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/DebugCommand.cs
deleted file mode 100644
index fbfde7c..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/DebugCommand.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using System.Collections.Generic;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class DebugCommand : Command
-    {
-        public DebugCommand(TestClient testClient)
-        {
-            Name = "debug";
-            Description = "Turn debug messages on or off. Usage: debug [on/off]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 1)
-                return "Usage: debug [on/off]";
-
-            if (args[0].ToLower() == "on")
-            {
-                Client.Settings.DEBUG = true;
-                return "Debug logging is on";
-            }
-            else if (args[0].ToLower() == "off")
-            {
-                Client.Settings.DEBUG = false;
-                return "Debug logging is off";
-            }
-            else
-            {
-                return "Usage: debug [on/off]";
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/HelpCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/HelpCommand.cs
deleted file mode 100644
index 5cbdcb2..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/HelpCommand.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class HelpCommand: Command
-    {
-        public HelpCommand(TestClient testClient)
-		{
-			Name = "help";
-			Description = "Lists available commands.";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			StringBuilder result = new StringBuilder();
-			result.AppendFormat("\n\nHELP\nClient accept teleport lures from master and group members.\n");
-			foreach (Command c in Client.Commands.Values)
-			{
-				result.AppendFormat(" * {0} - {1}\n", c.Name, c.Description);
-			}
-
-            return result.ToString();
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LoadCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LoadCommand.cs
deleted file mode 100644
index 70dada4..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LoadCommand.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Reflection;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class LoadCommand: Command
-    {
-        public LoadCommand(TestClient testClient)
-		{
-			Name = "load";
-			Description = "Loads commands from a dll. (Usage: load AssemblyNameWithoutExtension)";
-		}
-
-		public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			if (args.Length < 1)
-				return "Usage: load AssemblyNameWithoutExtension";
-
-			string filename = AppDomain.CurrentDomain.BaseDirectory + args[0] + ".dll";
-			Client.RegisterAllCommands(Assembly.LoadFile(filename));
-            return "Assembly " + filename + " loaded.";
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LoginCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LoginCommand.cs
deleted file mode 100644
index 737ad40..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LoginCommand.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class LoginCommand : Command
-    {
-        public LoginCommand(TestClient testClient)
-        {
-            Name = "login";
-            Description = "Logs in another avatar";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 3 && args.Length != 4)
-                return "usage: login firstname lastname password [simname]";
-
-            SecondLife newClient = Client.ClientManager.Login(args);
-
-            if (newClient.Network.Connected)
-            {
-                return "Logged in " + newClient.ToString();
-            }
-            else
-            {
-                return "Failed to login: " + newClient.Network.LoginMessage;
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LogoutCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LogoutCommand.cs
deleted file mode 100644
index cdb5bde..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/LogoutCommand.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class LogoutCommand : Command
-    {
-        public LogoutCommand(TestClient testClient)
-        {
-            Name = "logout";
-            Description = "Log this avatar out";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            string name = Client.ToString();
-			Client.ClientManager.Logout(Client);
-            return "Logged " + name + " out";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/MD5Command.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/MD5Command.cs
deleted file mode 100644
index 0a2ee5d..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/MD5Command.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class MD5Command : Command
-    {
-        public MD5Command(TestClient testClient)
-        {
-            Name = "md5";
-            Description = "Creates an MD5 hash from a given password. Usage: md5 [password]";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length == 1)
-                return Helpers.MD5(args[0]);
-            else
-                return "Usage: md5 [password]";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/PacketLogCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/PacketLogCommand.cs
deleted file mode 100644
index 9c9bd2e..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/PacketLogCommand.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class PacketLogCommand : Command
-    {
-        public PacketLogCommand(TestClient testClient)
-        {
-            Name = "packetlog";
-            Description = "Logs a given number of packets to an xml file. Usage: packetlog 10 tenpackets.xml";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length != 2)
-                return "Usage: packetlog 10 tenpackets.xml";
-
-            return "This function is currently unimplemented";
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/QuitCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/QuitCommand.cs
deleted file mode 100644
index 4cd7209..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/QuitCommand.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class QuitCommand: Command
-    {
-        public QuitCommand(TestClient testClient)
-		{
-			Name = "quit";
-			Description = "Log all avatars out and shut down";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			Client.ClientManager.LogoutAll();
-            Client.ClientManager.Running = false;
-            return "All avatars logged out";
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/SetMasterCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/SetMasterCommand.cs
deleted file mode 100644
index 268dfe0..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/SetMasterCommand.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class SetMasterCommand: Command
-    {
-		public DateTime Created = DateTime.Now;
-        private LLUUID resolvedMasterKey = LLUUID.Zero;
-        private ManualResetEvent keyResolution = new ManualResetEvent(false);
-        private LLUUID query = LLUUID.Zero;
-
-        public SetMasterCommand(TestClient testClient)
-		{
-			Name = "setmaster";
-            Description = "Sets the user name of the master user. The master user can IM to run commands. Usage: setmaster [name]";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			string masterName = String.Empty;
-			for (int ct = 0; ct < args.Length;ct++)
-				masterName = masterName + args[ct] + " ";
-            masterName = masterName.TrimEnd();
-
-            if (masterName.Length == 0)
-                return "Usage: setmaster [name]";
-
-            DirectoryManager.DirPeopleReplyCallback callback = new DirectoryManager.DirPeopleReplyCallback(KeyResolvHandler);
-            Client.Directory.OnDirPeopleReply += callback;
-
-            query = Client.Directory.StartPeopleSearch(DirectoryManager.DirFindFlags.People, masterName, 0);
-
-            if (keyResolution.WaitOne(TimeSpan.FromMinutes(1), false))
-            {
-                Client.MasterKey = resolvedMasterKey;
-                keyResolution.Reset();
-                Client.Directory.OnDirPeopleReply -= callback;
-            }
-            else
-            {
-                keyResolution.Reset();
-                Client.Directory.OnDirPeopleReply -= callback;
-                return "Unable to obtain UUID for \"" + masterName + "\". Master unchanged.";
-            }
-
-            // Send an Online-only IM to the new master
-            Client.Self.InstantMessage(
-                Client.MasterKey, "You are now my master.  IM me with \"help\" for a command list.");
-
-            return String.Format("Master set to {0} ({1})", masterName, Client.MasterKey.ToString());
-		}
-
-        private void KeyResolvHandler(LLUUID queryid, List<DirectoryManager.AgentSearchData> matches)
-        {
-            if (query != queryid)
-                return;
-
-            resolvedMasterKey = matches[0].AgentID;
-            keyResolution.Set();
-            query = LLUUID.Zero;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/SetMasterKeyCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/SetMasterKeyCommand.cs
deleted file mode 100644
index 117b9dd..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/SetMasterKeyCommand.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class SetMasterKeyCommand : Command
-    {
-        public DateTime Created = DateTime.Now;
-
-        public SetMasterKeyCommand(TestClient testClient)
-        {
-            Name = "setMasterKey";
-            Description = "Sets the key of the master user.  The master user can IM to run commands.";
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            Client.MasterKey = LLUUID.Parse(args[0]);
-
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    Avatar master = Client.Network.Simulators[i].Objects.Find(
-                        delegate(Avatar avatar)
-                        {
-                            return avatar.ID == Client.MasterKey;
-                        }
-                    );
-
-                    if (master != null)
-                    {
-                        Client.Self.InstantMessage(master.ID,
-                            "You are now my master. IM me with \"help\" for a command list.");
-                        break;
-                    }
-                }
-            }
-
-            return "Master set to " + Client.MasterKey.ToString();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/ShowEffectsCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/ShowEffectsCommand.cs
deleted file mode 100644
index 45de758..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/System/ShowEffectsCommand.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using System;
-using libsecondlife;
-
-namespace libsecondlife.TestClient
-{
-    public class ShowEffectsCommand : Command
-    {
-        bool ShowEffects = false;
-
-        public ShowEffectsCommand(TestClient testClient)
-        {
-            Name = "showeffects";
-            Description = "Prints out information for every viewer effect that is received. Usage: showeffects [on/off]";
-
-            testClient.Avatars.OnEffect += new AvatarManager.EffectCallback(Avatars_OnEffect);
-            testClient.Avatars.OnLookAt += new AvatarManager.LookAtCallback(Avatars_OnLookAt);
-            testClient.Avatars.OnPointAt += new AvatarManager.PointAtCallback(Avatars_OnPointAt);
-        }
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-        {
-            if (args.Length == 0)
-            {
-                ShowEffects = true;
-                return "Viewer effects will be shown on the console";
-            }
-            else if (args.Length == 1)
-            {
-                if (args[0] == "on")
-                {
-                    ShowEffects = true;
-                    return "Viewer effects will be shown on the console";
-                }
-                else
-                {
-                    ShowEffects = false;
-                    return "Viewer effects will not be shown";
-                }
-            }
-            else
-            {
-                return "Usage: showeffects [on/off]";
-            }
-        }
-
-        private void Avatars_OnPointAt(LLUUID sourceID, LLUUID targetID, LLVector3d targetPos,
-            PointAtType pointType, float duration, LLUUID id)
-        {
-            if (ShowEffects)
-                Console.WriteLine(
-                "ViewerEffect [PointAt]: SourceID: {0} TargetID: {1} TargetPos: {2} Type: {3} Duration: {4} ID: {5}",
-                sourceID.ToString(), targetID.ToString(), targetPos, pointType, duration,
-                id.ToString());
-        }
-
-        private void Avatars_OnLookAt(LLUUID sourceID, LLUUID targetID, LLVector3d targetPos,
-            LookAtType lookType, float duration, LLUUID id)
-        {
-            if (ShowEffects)
-                Console.WriteLine(
-                "ViewerEffect [LookAt]: SourceID: {0} TargetID: {1} TargetPos: {2} Type: {3} Duration: {4} ID: {5}",
-                sourceID.ToString(), targetID.ToString(), targetPos, lookType, duration,
-                id.ToString());
-        }
-
-        private void Avatars_OnEffect(EffectType type, LLUUID sourceID, LLUUID targetID,
-            LLVector3d targetPos, float duration, LLUUID id)
-        {
-            if (ShowEffects)
-                Console.WriteLine(
-                "ViewerEffect [{0}]: SourceID: {1} TargetID: {2} TargetPos: {3} Duration: {4} ID: {5}",
-                type, sourceID.ToString(), targetID.ToString(), targetPos, duration,
-                id.ToString());
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/TouchCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/TouchCommand.cs
deleted file mode 100644
index cdd9e09..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/TouchCommand.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class TouchCommand: Command
-    {
-        public TouchCommand(TestClient testClient)
-		{
-			Name = "touch";
-			Description = "Attempt to touch a prim with specified UUID";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-            LLUUID target;
-
-            if (args.Length != 1)
-                return "Usage: touch UUID";
-
-            if (LLUUID.TryParse(args[0], out target))
-            {
-                Primitive targetPrim = Client.Network.CurrentSim.Objects.Find(
-                    delegate(Primitive prim)
-                    {
-                        return prim.ID == target;
-                    }
-                );
-
-                if (targetPrim != null)
-                {
-                    Client.Self.Touch(targetPrim.LocalID);
-                    return "Touched prim " + targetPrim.LocalID;
-                }
-            }
-
-            return "Couldn't find a prim to touch with UUID " + args[0];
-		}
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/TreeCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/TreeCommand.cs
deleted file mode 100644
index 35e9475..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/TreeCommand.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class TreeCommand: Command
-    {
-        public TreeCommand(TestClient testClient)
-		{
-			Name = "tree";
-			Description = "Rez a tree.";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-		    if (args.Length == 1)
-		    {
-		        try
-		        {
-		            string treeName = args[0].Trim(new char[] { ' ' });
-		            Tree tree = (Tree)Enum.Parse(typeof(Tree), treeName);
-
-		            LLVector3 treePosition = Client.Self.SimPosition;
-		            treePosition.Z += 3.0f;
-
-		            Client.Objects.AddTree(Client.Network.CurrentSim, new LLVector3(0.5f, 0.5f, 0.5f),
-		                LLQuaternion.Identity, treePosition, tree, Client.GroupID, false);
-
-		            return "Attempted to rez a " + treeName + " tree";
-		        }
-		        catch (Exception)
-		        {
-		            return "Type !tree for usage";
-		        }
-		    }
-
-		    string usage = "Usage: !tree [";
-		    foreach (string value in Enum.GetNames(typeof(Tree)))
-		    {
-		        usage += value + ",";
-		    }
-		    usage = usage.TrimEnd(new char[] { ',' });
-		    usage += "]";
-		    return usage;
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Commands/WhoCommand.cs b/old/libsl1550/libsecondlife/examples/TestClient/Commands/WhoCommand.cs
deleted file mode 100644
index 7ba4a01..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Commands/WhoCommand.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class WhoCommand: Command
-    {
-        public WhoCommand(TestClient testClient)
-		{
-			Name = "who";
-			Description = "Lists seen avatars.";
-		}
-
-        public override string Execute(string[] args, LLUUID fromAgentID)
-		{
-			StringBuilder result = new StringBuilder();
-
-            lock (Client.Network.Simulators)
-            {
-                for (int i = 0; i < Client.Network.Simulators.Count; i++)
-                {
-                    Client.Network.Simulators[i].Objects.ForEach(
-                        delegate(Avatar av)
-                        {
-                            result.AppendLine();
-                            result.AppendFormat("{0} (Group: {1}, Location: {2}/{3}, UUID: {4})", av.Name,
-                                av.GroupName, (av.CurrentSim != null ? av.CurrentSim.Name : String.Empty),
-                                av.Position, av.ID.ToString());
-                        }
-                    );
-                }
-            }
-
-            return result.ToString();
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Parsing.cs b/old/libsl1550/libsecondlife/examples/TestClient/Parsing.cs
deleted file mode 100644
index d54d819..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Parsing.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace libsecondlife.TestClient
-{
-    class Parsing
-    {
-        public static string[] ParseArguments(string str)
-        {
-            List<string> list = new List<string>();
-            string current = String.Empty;
-            string trimmed = null;
-            bool withinQuote = false;
-            bool escaped = false;
-
-            foreach (char c in str)
-            {
-                if (c == '"')
-                {
-                    if (escaped)
-                    {
-                        current += '"';
-                        escaped = false;
-                    }
-                    else
-                    {
-                        current += '"';
-                        withinQuote = !withinQuote;
-                    }
-                }
-                else if (c == ' ' || c == '\t')
-                {
-                    if (escaped || withinQuote)
-                    {
-                        current += c;
-                        escaped = false;
-                    }
-                    else
-                    {
-                        trimmed = current.Trim();
-                        if (trimmed.StartsWith("\"") && trimmed.EndsWith("\""))
-                        {
-                            trimmed = trimmed.Remove(0, 1);
-                            trimmed = trimmed.Remove(trimmed.Length - 1);
-                            trimmed = trimmed.Trim();
-                        }
-                        if (trimmed.Length > 0)
-                            list.Add(trimmed);
-                        current = String.Empty;
-                    }
-                }
-                else if (c == '\\')
-                {
-                    if (escaped)
-                    {
-                        current += '\\';
-                        escaped = false;
-                    }
-                    else
-                    {
-                        escaped = true;
-                    }
-                }
-                else
-                {
-                    if (escaped)
-                        throw new FormatException(c.ToString() + " is not an escapable character.");
-                    current += c;
-                }
-            }
-
-            trimmed = current.Trim();
-
-            if (trimmed.StartsWith("\"") && trimmed.EndsWith("\""))
-            {
-                trimmed = trimmed.Remove(0, 1);
-                trimmed = trimmed.Remove(trimmed.Length - 1);
-                trimmed = trimmed.Trim();
-            }
-
-            if (trimmed.Length > 0)
-                list.Add(trimmed);
-
-            return list.ToArray();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Program.cs b/old/libsl1550/libsecondlife/examples/TestClient/Program.cs
deleted file mode 100644
index 6c67240..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Program.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using CommandLine.Utility;
-
-namespace libsecondlife.TestClient
-{
-    public class CommandLineArgumentsException : Exception
-    {
-    }
-
-    public class Program
-    {
-        private static void Usage()
-        {
-            Console.WriteLine("Usage: " + Environment.NewLine +
-                    "TestClient.exe --first firstname --last lastname --pass password --contact \"youremail\" [--startpos \"sim/x/y/z\"] [--master \"master name\"] [--masterkey \"master uuid\"] --loginuri=\"uri\"");
-        }
-
-        static void Main(string[] args)
-        {
-            Arguments arguments = new Arguments(args);
-
-            ClientManager manager;
-            List<LoginDetails> accounts = new List<LoginDetails>();
-            LoginDetails account;
-            string masterName = String.Empty;
-            LLUUID masterKey = LLUUID.Zero;
-            string file = String.Empty;
-			string loginuri = String.Empty;
-
-            try
-            {
-                if (arguments["masterkey"] != null)
-                {
-                    masterKey = LLUUID.Parse(arguments["masterkey"]);
-                }
-
-                if (arguments["master"] != null)
-                {
-                    masterName = arguments["master"];
-                }
-
-                if (arguments["loginuri"] != null)
-                {
-                    loginuri = arguments["loginuri"];
-                }
-
-                if (arguments["file"] != null)
-                {
-                    file = arguments["file"];
-
-                    // Loading names from a file
-                    try
-                    {
-                        using (StreamReader reader = new StreamReader(file))
-                        {
-                            string line;
-                            int lineNumber = 0;
-
-                            while ((line = reader.ReadLine()) != null)
-                            {
-                                lineNumber++;
-                                string[] tokens = line.Trim().Split(new char[] { ' ', ',' });
-
-                                if (tokens.Length >= 3)
-                                {
-                                    account = new LoginDetails();
-                                    account.FirstName = tokens[0];
-                                    account.LastName = tokens[1];
-                                    account.Password = tokens[2];
-
-                                    accounts.Add(account);
-
-                                    // Leaving this out until we have per-account masters (if that
-                                    // is desirable). For now the command-line option can
-                                    // specify the single master that TestClient supports
-
-                                    //if (tokens.Length == 5)
-                                    //{
-                                    //    master = tokens[3] + " " + tokens[4];
-                                    //}
-                                }
-                                else
-                                {
-                                    Console.WriteLine("Invalid data on line " + lineNumber +
-                                        ", must be in the format of: FirstName LastName Password");
-                                }
-                            }
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        Console.WriteLine("Error reading from " + args[1]);
-                        Console.WriteLine(e.ToString());
-                        return;
-                    }
-                }
-                else if (arguments["first"] != null && arguments["last"] != null && arguments["pass"] != null)
-                {
-                    // Taking a single login off the command-line
-                      account = new LoginDetails();
-                      account.FirstName = arguments["first"];
-                      account.LastName = arguments["last"];
-                      account.Password = arguments["pass"];
-
-                      accounts.Add(account);
-
-                }
-                else
-                {
-                    throw new CommandLineArgumentsException();
-                }
-            }
-
-            catch (CommandLineArgumentsException)
-            {
-                Usage();
-                return;
-            }
-
-            foreach (LoginDetails a in accounts)
-            {
-                a.MasterName = masterName;
-                a.MasterKey = masterKey;
-                a.URI = loginuri;
-            }
-
-            // Login the accounts and run the input loop
-            if (arguments["startpos"] != null)
-            {
-                manager = new ClientManager(accounts, arguments["startpos"]);
-            }
-            else
-            {
-                manager = new ClientManager(accounts);
-            }
-
-            manager.Run();
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/Properties/AssemblyInfo.cs b/old/libsl1550/libsecondlife/examples/TestClient/Properties/AssemblyInfo.cs
deleted file mode 100644
index 471a306..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("TestClient")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("TestClient")]
-[assembly: AssemblyCopyright("Copyright ©  2006")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("0563f706-7fa9-42f6-bf23-c6acd1175964")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/TestClient.build b/old/libsl1550/libsecondlife/examples/TestClient/TestClient.build
deleted file mode 100644
index d212507..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/TestClient.build
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0"?>
-
-<project
-  name="libsecondlife"
-  default="build">
-
-  <!-- global framework settings -->
-  <property
-    name="target.framework"
-    value="${framework::get-target-framework()}" />
-  <property
-    name="assembly.dir"
-    value="${framework::get-assembly-directory(target.framework)}" />
-
-  <!-- global project settings -->
-  <xmlpeek
-    file="../../../libsecondlife.build"
-    xpath="/project/property[@name = 'project.version']/@value"
-    property="project.version" />
-  <property
-     name="build.number"
-     value="${math::abs(math::floor(timespan::get-total-days(datetime::now()
-     - datetime::parse('01/01/2002'))))}" />
-  <property
-    name="assembly"
-    value="TestClient"/>
-  <property
-    name="bin_dir"
-    value="../../../bin" />
-
-  <!-- default configuration -->
-  <property
-    name="project.config"
-    value="debug" /> <!-- debug|release -->
-
-  <!-- named configurations -->
-  <target
-    name="init"
-    description="Initializes build properties">
-    <call target="${project.config}" />
-  </target>
-
-  <target
-    name="debug"
-    description="configures a debug build">
-    <property
-      name="build.debug"
-      value="true" />
-    <property
-      name="package.name"
-      value="${project::get-name()}-${project.version}-${project.config}" />
-    <property
-      name="assembly.configuration"
-      value="${framework::get-target-framework()}.${platform::get-name()} [${project.config}]" />
-  </target>
-
-  <target
-    name="release"
-    description="configures a release build">
-    <property
-      name="project.config"
-      value="release" />
-    <property
-      name="build.debug"
-      value="false" />
-    <property
-      name="package.name"
-      value="${project::get-name()}-${project.version}" />
-    <property
-      name="assembly.configuration"
-      value="${framework::get-target-framework()}.${platform::get-name()}" />
-  </target>
-
-  <!-- build tasks -->
-  <target
-    name="build"
-    depends="init"
-    description="Builds the binaries for the current configuration">
-    <echo message="Build Directory is ${bin_dir}/" />
-    <mkdir
-      dir="${bin_dir}"
-      failonerror="false" />
-    <csc
-      target="exe"
-      debug="${build.debug}"
-      output="${bin_dir}/${assembly}.exe">
-      <sources failonempty="true">
-	      <include name="*.cs" />
-	      <include name="Commands/**.cs" />
-	      <exclude name="Commands/Communication/TtsCommand.cs" />
-      </sources>
-      <references basedir="${bin_dir}/">
-        <include name="libsecondlife.dll"/>
-        <include name="openjpegnet.dll"/>
-      </references>
-    </csc>
-  </target>
-
-  <target
-    name="build-dll"
-    description="Builds libsecondlife dll">
-    <nant
-      buildfile="../../libsecondlife-cs/libsecondlife.build"
-      target="${project.config} build"/>
-  </target>
-
-  <target
-    name="clean"
-    depends="init"
-    description="Deletes the current configuration">
-    <delete failonerror="false">
-      <fileset basedir="${bin_dir}/">
-        <include name="${assembly}.exe" />
-        <include name="${assembly}.pdb" />
-        <include name="**/${assembly}.*.resources" />
-      </fileset>
-    </delete>
-  </target>
-
-  <target
-    name="*"
-    description="Handles unknown targets">
-    <echo message="skip" />
-  </target>
-</project>
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/TestClient.cs b/old/libsl1550/libsecondlife/examples/TestClient/TestClient.cs
deleted file mode 100644
index d700dd0..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/TestClient.cs
+++ /dev/null
@@ -1,245 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Xml;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.TestClient
-{
-    public class TestClient : SecondLife
-    {
-        public LLUUID GroupID = LLUUID.Zero;
-        public Dictionary<LLUUID, GroupMember> GroupMembers;
-		public Dictionary<LLUUID, AvatarAppearancePacket> Appearances = new Dictionary<LLUUID, AvatarAppearancePacket>();
-		public Dictionary<string, Command> Commands = new Dictionary<string,Command>();
-		public bool Running = true;
-        public string MasterName = String.Empty;
-        public LLUUID MasterKey = LLUUID.Zero;
-		public ClientManager ClientManager;
-
-        private LLQuaternion bodyRotation = LLQuaternion.Identity;
-        private LLVector3 forward = new LLVector3(0, 0.9999f, 0);
-        private LLVector3 left = new LLVector3(0.9999f, 0, 0);
-        private LLVector3 up = new LLVector3(0, 0, 0.9999f);
-        private System.Timers.Timer updateTimer;
-
-        /// <summary>
-        ///
-        /// </summary>
-        public TestClient(ClientManager manager)
-        {
-			ClientManager = manager;
-
-            updateTimer = new System.Timers.Timer(500);
-            updateTimer.Elapsed += new System.Timers.ElapsedEventHandler(updateTimer_Elapsed);
-
-            RegisterAllCommands(Assembly.GetExecutingAssembly());
-
-            Settings.DEBUG = true;
-            Settings.LOG_RESENDS = false;
-            Settings.STORE_LAND_PATCHES = true;
-            Settings.ALWAYS_DECODE_OBJECTS = true;
-            Settings.ALWAYS_REQUEST_OBJECTS = true;
-            Settings.SEND_AGENT_UPDATES = true;
-
-            Network.RegisterCallback(PacketType.AgentDataUpdate, new NetworkManager.PacketCallback(AgentDataUpdateHandler));
-
-            Self.OnInstantMessage += new AgentManager.InstantMessageCallback(Self_OnInstantMessage);
-            Groups.OnGroupMembers += new GroupManager.GroupMembersCallback(GroupMembersHandler);
-            Inventory.OnObjectOffered += new InventoryManager.ObjectOfferedCallback(Inventory_OnInventoryObjectReceived);
-
-            Network.RegisterCallback(PacketType.AvatarAppearance, new NetworkManager.PacketCallback(AvatarAppearanceHandler));
-            Network.RegisterCallback(PacketType.AlertMessage, new NetworkManager.PacketCallback(AlertMessageHandler));
-
-            updateTimer.Start();
-        }
-
-        public void RegisterAllCommands(Assembly assembly)
-        {
-            foreach (Type t in assembly.GetTypes())
-            {
-                try
-                {
-                    if (t.IsSubclassOf(typeof(Command)))
-                    {
-                        ConstructorInfo info = t.GetConstructor(new Type[] { typeof(TestClient) });
-                        Command command = (Command)info.Invoke(new object[] { this });
-                        RegisterCommand(command);
-                    }
-                }
-                catch (Exception e)
-                {
-                    Console.WriteLine(e.ToString());
-                }
-            }
-        }
-
-        public void RegisterCommand(Command command)
-        {
-			command.Client = this;
-			if (!Commands.ContainsKey(command.Name.ToLower()))
-			{
-                Commands.Add(command.Name.ToLower(), command);
-			}
-        }
-
-        //breaks up large responses to deal with the max IM size
-        private void SendResponseIM(SecondLife client, LLUUID fromAgentID, string data)
-        {
-            for ( int i = 0 ; i < data.Length ; i += 1024 ) {
-                int y;
-                if ((i + 1023) > data.Length)
-                {
-                    y = data.Length - i;
-                }
-                else
-                {
-                    y = 1023;
-                }
-                string message = data.Substring(i, y);
-                client.Self.InstantMessage(fromAgentID, message);
-            }
-        }
-
-		public void DoCommand(string cmd, LLUUID fromAgentID)
-        {
-			string[] tokens;
-
-            try { tokens = Parsing.ParseArguments(cmd); }
-            catch (FormatException ex) { Console.WriteLine(ex.Message); return; }
-
-            if (tokens.Length == 0)
-                return;
-
-			string firstToken = tokens[0].ToLower();
-
-            // "all balance" will send the balance command to all currently logged in bots
-			if (firstToken == "all" && tokens.Length > 1)
-			{
-			    cmd = String.Empty;
-
-			    // Reserialize all of the arguments except for "all"
-			    for (int i = 1; i < tokens.Length; i++)
-			    {
-			        cmd += tokens[i] + " ";
-			    }
-
-			    ClientManager.DoCommandAll(cmd, fromAgentID);
-
-			    return;
-			}
-
-            if (Commands.ContainsKey(firstToken))
-            {
-                string[] args = new string[tokens.Length - 1];
-                Array.Copy(tokens, 1, args, 0, args.Length);
-                string response = Commands[firstToken].Execute(args, fromAgentID);
-
-                if (!String.IsNullOrEmpty(response))
-                {
-                    Console.WriteLine(response);
-
-                    if (fromAgentID != LLUUID.Zero && Network.Connected)
-                    {
-                        // IMs don't like \r\n line endings, clean them up first
-                        response = response.Replace("\r", String.Empty);
-                        SendResponseIM(this, fromAgentID, response);
-                    }
-                }
-            }
-        }
-
-        private void updateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
-        {
-            foreach (Command c in Commands.Values)
-                if (c.Active)
-                    c.Think();
-        }
-
-        private void AgentDataUpdateHandler(Packet packet, Simulator sim)
-        {
-            AgentDataUpdatePacket p = (AgentDataUpdatePacket)packet;
-            if (p.AgentData.AgentID == sim.Client.Self.AgentID)
-            {
-                Console.WriteLine("Got the group ID for " + sim.Client.ToString() + ", requesting group members...");
-                GroupID = p.AgentData.ActiveGroupID;
-
-                sim.Client.Groups.RequestGroupMembers(GroupID);
-            }
-        }
-
-        private void GroupMembersHandler(Dictionary<LLUUID, GroupMember> members)
-        {
-            Console.WriteLine("Got " + members.Count + " group members.");
-            GroupMembers = members;
-        }
-
-        private void AvatarAppearanceHandler(Packet packet, Simulator simulator)
-        {
-            AvatarAppearancePacket appearance = (AvatarAppearancePacket)packet;
-
-            lock (Appearances) Appearances[appearance.Sender.ID] = appearance;
-        }
-
-        private void AlertMessageHandler(Packet packet, Simulator simulator)
-        {
-            AlertMessagePacket message = (AlertMessagePacket)packet;
-
-            Log("[AlertMessage] " + Helpers.FieldToUTF8String(message.AlertData.Message), Helpers.LogLevel.Info);
-        }
-
-        private void Self_OnInstantMessage(InstantMessage im, Simulator simulator)
-        {
-            if (MasterKey != LLUUID.Zero)
-            {
-                if (im.FromAgentID != MasterKey)
-                {
-                    // Received an IM from someone that is not the bot's master, ignore
-                    Console.WriteLine("<IM ({0})> {1} (not master): {2} (@{3}:{4})", im.Dialog, im.FromAgentName, im.Message,
-                        im.RegionID, im.Position);
-                    return;
-                }
-            }
-            else if (GroupMembers != null && !GroupMembers.ContainsKey(im.FromAgentID))
-            {
-                // Received an IM from someone outside the bot's group, ignore
-                Console.WriteLine("<IM ({0})> {1} (not in group): {2} (@{3}:{4})", im.Dialog, im.FromAgentName,
-                    im.Message, im.RegionID, im.Position);
-                return;
-            }
-
-            // Received an IM from someone that is authenticated
-            Console.WriteLine("<IM ({0})> {1}: {2} (@{3}:{4})", im.Dialog, im.FromAgentName, im.Message, im.RegionID, im.Position);
-
-            if (im.Dialog == InstantMessageDialog.RequestTeleport)
-            {
-                Console.WriteLine("Accepting teleport lure.");
-                Self.TeleportLureRespond(im.FromAgentID, true);
-            }
-            else if (
-                im.Dialog == InstantMessageDialog.MessageFromAgent ||
-                im.Dialog == InstantMessageDialog.MessageFromObject)
-            {
-                DoCommand(im.Message, im.FromAgentID);
-            }
-        }
-
-        private bool Inventory_OnInventoryObjectReceived(LLUUID fromAgentID, string fromAgentName,
-            uint parentEstateID, LLUUID regionID, LLVector3 position, DateTime timestamp, AssetType type,
-            LLUUID objectID, bool fromTask)
-        {
-            if (MasterKey != LLUUID.Zero)
-            {
-                if (fromAgentID != MasterKey)
-                    return false;
-            }
-            else if (GroupMembers != null && !GroupMembers.ContainsKey(fromAgentID))
-            {
-                return false;
-            }
-
-            return true;
-        }
-	}
-}
diff --git a/old/libsl1550/libsecondlife/examples/TestClient/TestClient.csproj b/old/libsl1550/libsecondlife/examples/TestClient/TestClient.csproj
deleted file mode 100644
index a58aa6d..0000000
--- a/old/libsl1550/libsecondlife/examples/TestClient/TestClient.csproj
+++ /dev/null
@@ -1,129 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{B87682F6-B2D7-4C4D-A529-400C24FD4880}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>libsecondlife.TestClient</RootNamespace>
-    <AssemblyName>TestClient</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Arguments.cs" />
-    <Compile Include="Command.cs" />
-    <Compile Include="ClientManager.cs" />
-    <Compile Include="Commands\Appearance\AppearanceCommand.cs" />
-    <Compile Include="Commands\Appearance\AttachmentsCommand.cs" />
-    <Compile Include="Commands\Appearance\CloneCommand.cs" />
-    <Compile Include="Commands\Appearance\WearCommand.cs" />
-    <Compile Include="Commands\CloneProfileCommand.cs" />
-    <Compile Include="Commands\Communication\EchoMasterCommand.cs" />
-    <Compile Include="Commands\Communication\IMCommand.cs" />
-    <Compile Include="Commands\Communication\SayCommand.cs" />
-    <Compile Include="Commands\Communication\ShoutCommand.cs" />
-    <Compile Include="Commands\Communication\WhisperCommand.cs" />
-    <Compile Include="Commands\DetectBotCommand.cs" />
-    <Compile Include="Commands\Friends\FriendsCommand.cs" />
-    <Compile Include="Commands\GoHome.cs" />
-    <Compile Include="Commands\GotoLandmark.cs" />
-    <Compile Include="Commands\Groups\GroupsCommand.cs" />
-    <Compile Include="Commands\Inventory\BackupCommand.cs" />
-    <Compile Include="Commands\Inventory\BalanceCommand.cs" />
-    <Compile Include="Commands\Inventory\DeleteFolderCommand.cs" />
-    <Compile Include="Commands\Inventory\DumpOutfitCommand.cs" />
-    <Compile Include="Commands\Inventory\ExportOutfitCommand.cs" />
-    <Compile Include="Commands\Inventory\GiveAllCommand.cs" />
-    <Compile Include="Commands\Inventory\ImportOutfitCommand.cs" />
-    <Compile Include="Commands\Inventory\InventoryCommand.cs" />
-    <Compile Include="Commands\Inventory\ObjectInventoryCommand.cs" />
-    <Compile Include="Commands\Land\FindSimCommand.cs" />
-    <Compile Include="Commands\Land\AgentLocationsCommand.cs" />
-    <Compile Include="Commands\Land\GridLayerCommand.cs" />
-    <Compile Include="Commands\Land\GridMapCommand.cs" />
-    <Compile Include="Commands\Land\ParcelInfoCommand.cs" />
-    <Compile Include="Commands\Movement\CrouchCommand.cs" />
-    <Compile Include="Commands\Movement\FlyCommand.cs" />
-    <Compile Include="Commands\Movement\FollowCommand.cs" />
-    <Compile Include="Commands\Movement\GotoCommand.cs" />
-    <Compile Include="Commands\Movement\JumpCommand.cs" />
-    <Compile Include="Commands\Movement\LocationCommand.cs" />
-    <Compile Include="Commands\Movement\MoveToCommand.cs" />
-    <Compile Include="Commands\Movement\SetHome.cs" />
-    <Compile Include="Commands\Movement\SitCommand.cs" />
-    <Compile Include="Commands\Movement\SitOnCommand.cs" />
-    <Compile Include="Commands\Movement\StandCommand.cs" />
-    <Compile Include="Commands\Prims\ChangePermsCommand.cs" />
-    <Compile Include="Commands\Prims\ExportCommand.cs" />
-    <Compile Include="Commands\Prims\ExportParticlesCommand.cs" />
-    <Compile Include="Commands\Prims\FindObjectsCommand.cs" />
-    <Compile Include="Commands\Prims\FindTextureCommand.cs" />
-    <Compile Include="Commands\Prims\ImportCommand.cs" />
-    <Compile Include="Commands\Prims\PrimCountCommand.cs" />
-    <Compile Include="Commands\Prims\PrimInfoCommand.cs" />
-    <Compile Include="Commands\Prims\PrimRegexCommand.cs" />
-    <Compile Include="Commands\Stats\DilationCommand.cs" />
-    <Compile Include="Commands\Stats\RegionInfoCommand.cs" />
-    <Compile Include="Commands\Stats\StatsCommand.cs" />
-    <Compile Include="Commands\Stats\UptimeCommand.cs" />
-    <Compile Include="Commands\System\DebugCommand.cs" />
-    <Compile Include="Commands\System\HelpCommand.cs" />
-    <Compile Include="Commands\System\LoadCommand.cs" />
-    <Compile Include="Commands\System\LoginCommand.cs" />
-    <Compile Include="Commands\System\LogoutCommand.cs" />
-    <Compile Include="Commands\System\MD5Command.cs" />
-    <Compile Include="Commands\System\PacketLogCommand.cs" />
-    <Compile Include="Commands\System\QuitCommand.cs" />
-    <Compile Include="Commands\System\SetMasterCommand.cs" />
-    <Compile Include="Commands\System\SetMasterKeyCommand.cs" />
-    <Compile Include="Commands\System\ShowEffectsCommand.cs" />
-    <Compile Include="Commands\TouchCommand.cs" />
-    <Compile Include="Commands\TreeCommand.cs" />
-    <Compile Include="Commands\WhoCommand.cs" />
-    <Compile Include="Parsing.cs" />
-    <Compile Include="Program.cs" />
-    <Compile Include="TestClient.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\libsecondlife.Utilities\libsecondlife.Utilities.csproj">
-      <Project>{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}</Project>
-      <Name>libsecondlife.Utilities</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/examples.build b/old/libsl1550/libsecondlife/examples/examples.build
deleted file mode 100644
index 6e73f03..0000000
--- a/old/libsl1550/libsecondlife/examples/examples.build
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="libsecondlife" default="build">
-  <!-- global framework settings -->
-  <property name="target.framework"
-    value="${framework::get-target-framework()}" />
-  <property name="assembly.dir"
-    value="${framework::get-assembly-directory(target.framework)}" />
-
-  <!-- global project settings -->
-  <xmlpeek
-    file="../../libsecondlife.build"
-    xpath="/project/property[@name = 'project.version']/@value"
-    property="project.version" />
-  <property name="assembly" value="examples" />
-  <property name="bin_dir" value="../../bin" />
-
-  <!-- default configuration -->
-  <property name="project.config" value="debug" /> <!-- debug|release -->
-
-  <!-- named configurations -->
-  <target name="init" description="Initializes build properties">
-    <echo message="assembly.dir=${assembly.dir}" />
-    <mkdir dir="${bin_dir}" failonerror="false" />
-    <call target="${project.config}" />
-  </target>
-
-  <target name="debug" description="configures a debug build">
-    <property name="build.debug" value="true" />
-    <property name="package.name"
-	     value="${project::get-name()}-${project.version}-${project.config}" />
-    <property name="assembly.configuration"
-      value="${framework::get-target-framework()}.${platform::get-name()} [${project.config}]" />
-  </target>
-
-  <target name="release" description="configures a release build">
-    <property name="project.config" value="release" />
-    <property name="build.debug"    value="false" />
-    <property name="package.name"   value="${project::get-name()}-${project.version}" />
-    <property name="assembly.configuration"
-      value="${framework::get-target-framework()}.${platform::get-name()}" />
-  </target>
-
-  <!-- build tasks -->
-  <target name="example" description="Build a particular example">
-    <property name="example_name" value="${path::get-file-name(example_path)}" />
-	<property name="example_buildfile" value="${example_path}/${example_name}.build" />
-    <echo message="building ${example_name}" />
-	<nant buildfile="${example_buildfile}" if="${file::exists(example_buildfile)}" />
-	  <csc target="exe" debug="${build.debug}" output="${bin_dir}/${example_name}.exe" unless="${file::exists(example_buildfile)}">
-		  <sources failonempty="true">
-			  <include name="${example_path}/**/*.cs"/>
-		  </sources>
-      <references basedir="${bin_dir}/">
-         <include name="openjpegnet.dll"/>
-         <include name="libsecondlife.dll"/>
-         <include name="System.Data.dll" />
-         <include name="System.Drawing.dll" />
-         <include name="System.Windows.Forms.dll" />
-      </references>
-    </csc>
-  </target>
-
-  <target name="build" depends="init" description="Build all examples">
-	<foreach item="Folder" in="." property="example_path">
-	  <call target="example" unless="${string::ends-with(example_path,'svn') or string::contains(example_path,'IA_') or string::contains(example_path,'Heightmap')}"/>
-    </foreach>
-  </target>
-
-  <target name="clean" description="Clean all examples">
-    <foreach item="Folder" in="." property="example_path">
-	<call target="clean-examples" unless="${string::ends-with(example_path,'svn')}"/>
-    </foreach>
-  </target>
-
-  <target name="clean-example" description="Deletes files for a given example">
-    <property name="example_name" value="${path::get-file-name(example_path)}" />
-    <delete failonerror="false">
-      <fileset basedir="${bin_dir}/">
-        <include name="${example_name}.*" />
-      </fileset>
-    </delete>
-  </target>
-
-  <target name="*" description="Handles unknown targets">
-    <echo message="skip" />
-  </target>
-</project>
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/App.ico b/old/libsl1550/libsecondlife/examples/groupmanager/App.ico
deleted file mode 100644
index 3a5525f..0000000
Binary files a/old/libsl1550/libsecondlife/examples/groupmanager/App.ico and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/groupmanager.exe b/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/groupmanager.exe
deleted file mode 100644
index b4e3f60..0000000
Binary files a/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/groupmanager.exe and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/libsecondlife.Utilities.dll b/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/libsecondlife.Utilities.dll
deleted file mode 100644
index bbc662c..0000000
Binary files a/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/libsecondlife.Utilities.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/libsecondlife.Utilities.pdb b/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/libsecondlife.Utilities.pdb
deleted file mode 100644
index d9a52dd..0000000
Binary files a/old/libsl1550/libsecondlife/examples/groupmanager/bin/Release/libsecondlife.Utilities.pdb and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.Designer.cs b/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.Designer.cs
deleted file mode 100644
index 89bb4ee..0000000
--- a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.Designer.cs
+++ /dev/null
@@ -1,829 +0,0 @@
-namespace groupmanager
-{
-    partial class frmGroupInfo
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.tabs = new System.Windows.Forms.TabControl();
-            this.tabGeneral = new System.Windows.Forms.TabPage();
-            this.grpPreferences = new System.Windows.Forms.GroupBox();
-            this.chkMature = new System.Windows.Forms.CheckBox();
-            this.numFee = new System.Windows.Forms.NumericUpDown();
-            this.chkGroupNotices = new System.Windows.Forms.CheckBox();
-            this.chkFee = new System.Windows.Forms.CheckBox();
-            this.chkOpenEnrollment = new System.Windows.Forms.CheckBox();
-            this.chkPublish = new System.Windows.Forms.CheckBox();
-            this.chkShow = new System.Windows.Forms.CheckBox();
-            this.lstMembers = new System.Windows.Forms.ListView();
-            this.colName = new System.Windows.Forms.ColumnHeader();
-            this.colTitle = new System.Windows.Forms.ColumnHeader();
-            this.colLasLogin = new System.Windows.Forms.ColumnHeader();
-            this.txtCharter = new System.Windows.Forms.TextBox();
-            this.lblFoundedBy = new System.Windows.Forms.Label();
-            this.lblGroupName = new System.Windows.Forms.Label();
-            this.picInsignia = new System.Windows.Forms.PictureBox();
-            this.tabMembersRoles = new System.Windows.Forms.TabPage();
-            this.tabsMRA = new System.Windows.Forms.TabControl();
-            this.tabMembers = new System.Windows.Forms.TabPage();
-            this.cmdEject = new System.Windows.Forms.Button();
-            this.lstMembers2 = new System.Windows.Forms.ListView();
-            this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
-            this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
-            this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
-            this.chkListRoles = new System.Windows.Forms.CheckedListBox();
-            this.treeAbilities = new System.Windows.Forms.TreeView();
-            this.label2 = new System.Windows.Forms.Label();
-            this.label1 = new System.Windows.Forms.Label();
-            this.tabRoles = new System.Windows.Forms.TabPage();
-            this.tabAbilities = new System.Windows.Forms.TabPage();
-            this.tabNotices = new System.Windows.Forms.TabPage();
-            this.textBox1 = new System.Windows.Forms.TextBox();
-            this.label3 = new System.Windows.Forms.Label();
-            this.cmdRefreshNotices = new System.Windows.Forms.Button();
-            this.lstNotices = new System.Windows.Forms.ListView();
-            this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
-            this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
-            this.columnHeader6 = new System.Windows.Forms.ColumnHeader();
-            this.tabProposals = new System.Windows.Forms.TabPage();
-            this.tabLand = new System.Windows.Forms.TabPage();
-            this.tabsMoney = new System.Windows.Forms.TabControl();
-            this.tabPlanning = new System.Windows.Forms.TabPage();
-            this.txtPlanning = new System.Windows.Forms.TextBox();
-            this.tabDetails = new System.Windows.Forms.TabPage();
-            this.txtDetails = new System.Windows.Forms.TextBox();
-            this.tabSales = new System.Windows.Forms.TabPage();
-            this.txtSales = new System.Windows.Forms.TextBox();
-            this.txtContribution = new System.Windows.Forms.TextBox();
-            this.lblLandAvailable = new System.Windows.Forms.Label();
-            this.lblLandInUse = new System.Windows.Forms.Label();
-            this.lblTotalContribution = new System.Windows.Forms.Label();
-            this.label7 = new System.Windows.Forms.Label();
-            this.label6 = new System.Windows.Forms.Label();
-            this.label5 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            this.lstLand = new System.Windows.Forms.ListView();
-            this.columnHeader7 = new System.Windows.Forms.ColumnHeader();
-            this.columnHeader8 = new System.Windows.Forms.ColumnHeader();
-            this.columnHeader9 = new System.Windows.Forms.ColumnHeader();
-            this.cmdApply = new System.Windows.Forms.Button();
-            this.cmdCancel = new System.Windows.Forms.Button();
-            this.cmdOK = new System.Windows.Forms.Button();
-            this.cmdRefresh = new System.Windows.Forms.Button();
-            this.tabs.SuspendLayout();
-            this.tabGeneral.SuspendLayout();
-            this.grpPreferences.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.numFee)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.picInsignia)).BeginInit();
-            this.tabMembersRoles.SuspendLayout();
-            this.tabsMRA.SuspendLayout();
-            this.tabMembers.SuspendLayout();
-            this.tabNotices.SuspendLayout();
-            this.tabLand.SuspendLayout();
-            this.tabsMoney.SuspendLayout();
-            this.tabPlanning.SuspendLayout();
-            this.tabDetails.SuspendLayout();
-            this.tabSales.SuspendLayout();
-            this.SuspendLayout();
-            //
-            // tabs
-            //
-            this.tabs.Controls.Add(this.tabGeneral);
-            this.tabs.Controls.Add(this.tabMembersRoles);
-            this.tabs.Controls.Add(this.tabNotices);
-            this.tabs.Controls.Add(this.tabProposals);
-            this.tabs.Controls.Add(this.tabLand);
-            this.tabs.Location = new System.Drawing.Point(6, 7);
-            this.tabs.Name = "tabs";
-            this.tabs.SelectedIndex = 0;
-            this.tabs.Size = new System.Drawing.Size(417, 507);
-            this.tabs.TabIndex = 9;
-            //
-            // tabGeneral
-            //
-            this.tabGeneral.Controls.Add(this.grpPreferences);
-            this.tabGeneral.Controls.Add(this.lstMembers);
-            this.tabGeneral.Controls.Add(this.txtCharter);
-            this.tabGeneral.Controls.Add(this.lblFoundedBy);
-            this.tabGeneral.Controls.Add(this.lblGroupName);
-            this.tabGeneral.Controls.Add(this.picInsignia);
-            this.tabGeneral.Location = new System.Drawing.Point(4, 22);
-            this.tabGeneral.Name = "tabGeneral";
-            this.tabGeneral.Padding = new System.Windows.Forms.Padding(3);
-            this.tabGeneral.Size = new System.Drawing.Size(409, 481);
-            this.tabGeneral.TabIndex = 0;
-            this.tabGeneral.Text = "General";
-            this.tabGeneral.UseVisualStyleBackColor = true;
-            //
-            // grpPreferences
-            //
-            this.grpPreferences.Controls.Add(this.chkMature);
-            this.grpPreferences.Controls.Add(this.numFee);
-            this.grpPreferences.Controls.Add(this.chkGroupNotices);
-            this.grpPreferences.Controls.Add(this.chkFee);
-            this.grpPreferences.Controls.Add(this.chkOpenEnrollment);
-            this.grpPreferences.Controls.Add(this.chkPublish);
-            this.grpPreferences.Controls.Add(this.chkShow);
-            this.grpPreferences.Location = new System.Drawing.Point(10, 353);
-            this.grpPreferences.Name = "grpPreferences";
-            this.grpPreferences.Size = new System.Drawing.Size(393, 122);
-            this.grpPreferences.TabIndex = 14;
-            this.grpPreferences.TabStop = false;
-            this.grpPreferences.Text = "Group Preferences";
-            //
-            // chkMature
-            //
-            this.chkMature.AutoSize = true;
-            this.chkMature.Location = new System.Drawing.Point(162, 19);
-            this.chkMature.Name = "chkMature";
-            this.chkMature.Size = new System.Drawing.Size(95, 17);
-            this.chkMature.TabIndex = 6;
-            this.chkMature.Text = "Mature publish";
-            this.chkMature.UseVisualStyleBackColor = true;
-            //
-            // numFee
-            //
-            this.numFee.Location = new System.Drawing.Point(162, 87);
-            this.numFee.Name = "numFee";
-            this.numFee.Size = new System.Drawing.Size(82, 20);
-            this.numFee.TabIndex = 5;
-            //
-            // chkGroupNotices
-            //
-            this.chkGroupNotices.AutoSize = true;
-            this.chkGroupNotices.Location = new System.Drawing.Point(250, 87);
-            this.chkGroupNotices.Name = "chkGroupNotices";
-            this.chkGroupNotices.Size = new System.Drawing.Size(137, 17);
-            this.chkGroupNotices.TabIndex = 4;
-            this.chkGroupNotices.Text = "Receive Group Notices";
-            this.chkGroupNotices.UseVisualStyleBackColor = true;
-            //
-            // chkFee
-            //
-            this.chkFee.AutoSize = true;
-            this.chkFee.Location = new System.Drawing.Point(36, 88);
-            this.chkFee.Name = "chkFee";
-            this.chkFee.Size = new System.Drawing.Size(114, 17);
-            this.chkFee.TabIndex = 3;
-            this.chkFee.Text = "Enrollment Fee: L$";
-            this.chkFee.UseVisualStyleBackColor = true;
-            //
-            // chkOpenEnrollment
-            //
-            this.chkOpenEnrollment.AutoSize = true;
-            this.chkOpenEnrollment.Location = new System.Drawing.Point(16, 65);
-            this.chkOpenEnrollment.Name = "chkOpenEnrollment";
-            this.chkOpenEnrollment.Size = new System.Drawing.Size(104, 17);
-            this.chkOpenEnrollment.TabIndex = 2;
-            this.chkOpenEnrollment.Text = "Open Enrollment";
-            this.chkOpenEnrollment.UseVisualStyleBackColor = true;
-            //
-            // chkPublish
-            //
-            this.chkPublish.AutoSize = true;
-            this.chkPublish.Location = new System.Drawing.Point(16, 42);
-            this.chkPublish.Name = "chkPublish";
-            this.chkPublish.Size = new System.Drawing.Size(116, 17);
-            this.chkPublish.TabIndex = 1;
-            this.chkPublish.Text = "Publish on the web";
-            this.chkPublish.UseVisualStyleBackColor = true;
-            //
-            // chkShow
-            //
-            this.chkShow.AutoSize = true;
-            this.chkShow.Location = new System.Drawing.Point(16, 19);
-            this.chkShow.Name = "chkShow";
-            this.chkShow.Size = new System.Drawing.Size(116, 17);
-            this.chkShow.TabIndex = 0;
-            this.chkShow.Text = "Show In Group List";
-            this.chkShow.UseVisualStyleBackColor = true;
-            //
-            // lstMembers
-            //
-            this.lstMembers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.colName,
-            this.colTitle,
-            this.colLasLogin});
-            this.lstMembers.Location = new System.Drawing.Point(7, 221);
-            this.lstMembers.Name = "lstMembers";
-            this.lstMembers.Size = new System.Drawing.Size(396, 126);
-            this.lstMembers.TabIndex = 13;
-            this.lstMembers.UseCompatibleStateImageBehavior = false;
-            this.lstMembers.View = System.Windows.Forms.View.Details;
-            //
-            // colName
-            //
-            this.colName.Text = "Member Name";
-            this.colName.Width = 166;
-            //
-            // colTitle
-            //
-            this.colTitle.Text = "Title";
-            this.colTitle.Width = 127;
-            //
-            // colLasLogin
-            //
-            this.colLasLogin.Text = "Last Login";
-            this.colLasLogin.Width = 95;
-            //
-            // txtCharter
-            //
-            this.txtCharter.Location = new System.Drawing.Point(146, 42);
-            this.txtCharter.Multiline = true;
-            this.txtCharter.Name = "txtCharter";
-            this.txtCharter.Size = new System.Drawing.Size(257, 173);
-            this.txtCharter.TabIndex = 12;
-            //
-            // lblFoundedBy
-            //
-            this.lblFoundedBy.AutoSize = true;
-            this.lblFoundedBy.Location = new System.Drawing.Point(7, 26);
-            this.lblFoundedBy.Name = "lblFoundedBy";
-            this.lblFoundedBy.Size = new System.Drawing.Size(137, 13);
-            this.lblFoundedBy.TabIndex = 11;
-            this.lblFoundedBy.Text = "Founded by Group Founder";
-            //
-            // lblGroupName
-            //
-            this.lblGroupName.AutoSize = true;
-            this.lblGroupName.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblGroupName.Location = new System.Drawing.Point(7, 6);
-            this.lblGroupName.Name = "lblGroupName";
-            this.lblGroupName.Size = new System.Drawing.Size(99, 17);
-            this.lblGroupName.TabIndex = 10;
-            this.lblGroupName.Text = "Group Name";
-            //
-            // picInsignia
-            //
-            this.picInsignia.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.picInsignia.Location = new System.Drawing.Point(10, 42);
-            this.picInsignia.Name = "picInsignia";
-            this.picInsignia.Size = new System.Drawing.Size(130, 130);
-            this.picInsignia.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
-            this.picInsignia.TabIndex = 9;
-            this.picInsignia.TabStop = false;
-            //
-            // tabMembersRoles
-            //
-            this.tabMembersRoles.Controls.Add(this.tabsMRA);
-            this.tabMembersRoles.Location = new System.Drawing.Point(4, 22);
-            this.tabMembersRoles.Name = "tabMembersRoles";
-            this.tabMembersRoles.Padding = new System.Windows.Forms.Padding(3);
-            this.tabMembersRoles.Size = new System.Drawing.Size(409, 481);
-            this.tabMembersRoles.TabIndex = 1;
-            this.tabMembersRoles.Text = "Members & Roles";
-            this.tabMembersRoles.UseVisualStyleBackColor = true;
-            //
-            // tabsMRA
-            //
-            this.tabsMRA.Controls.Add(this.tabMembers);
-            this.tabsMRA.Controls.Add(this.tabRoles);
-            this.tabsMRA.Controls.Add(this.tabAbilities);
-            this.tabsMRA.Location = new System.Drawing.Point(6, 6);
-            this.tabsMRA.Name = "tabsMRA";
-            this.tabsMRA.SelectedIndex = 0;
-            this.tabsMRA.Size = new System.Drawing.Size(400, 469);
-            this.tabsMRA.TabIndex = 0;
-            //
-            // tabMembers
-            //
-            this.tabMembers.Controls.Add(this.cmdEject);
-            this.tabMembers.Controls.Add(this.lstMembers2);
-            this.tabMembers.Controls.Add(this.chkListRoles);
-            this.tabMembers.Controls.Add(this.treeAbilities);
-            this.tabMembers.Controls.Add(this.label2);
-            this.tabMembers.Controls.Add(this.label1);
-            this.tabMembers.Location = new System.Drawing.Point(4, 22);
-            this.tabMembers.Name = "tabMembers";
-            this.tabMembers.Padding = new System.Windows.Forms.Padding(3);
-            this.tabMembers.Size = new System.Drawing.Size(392, 443);
-            this.tabMembers.TabIndex = 0;
-            this.tabMembers.Text = "Members";
-            this.tabMembers.UseVisualStyleBackColor = true;
-            //
-            // cmdEject
-            //
-            this.cmdEject.Location = new System.Drawing.Point(258, 152);
-            this.cmdEject.Name = "cmdEject";
-            this.cmdEject.Size = new System.Drawing.Size(128, 23);
-            this.cmdEject.TabIndex = 15;
-            this.cmdEject.Text = "Eject From Group";
-            this.cmdEject.UseVisualStyleBackColor = true;
-            //
-            // lstMembers2
-            //
-            this.lstMembers2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader1,
-            this.columnHeader2,
-            this.columnHeader3});
-            this.lstMembers2.Location = new System.Drawing.Point(6, 6);
-            this.lstMembers2.Name = "lstMembers2";
-            this.lstMembers2.Size = new System.Drawing.Size(380, 140);
-            this.lstMembers2.TabIndex = 14;
-            this.lstMembers2.UseCompatibleStateImageBehavior = false;
-            this.lstMembers2.View = System.Windows.Forms.View.Details;
-            //
-            // columnHeader1
-            //
-            this.columnHeader1.Text = "Member Name";
-            this.columnHeader1.Width = 152;
-            //
-            // columnHeader2
-            //
-            this.columnHeader2.Text = "Donated Tier";
-            this.columnHeader2.Width = 119;
-            //
-            // columnHeader3
-            //
-            this.columnHeader3.Text = "Last Login";
-            this.columnHeader3.Width = 96;
-            //
-            // chkListRoles
-            //
-            this.chkListRoles.FormattingEnabled = true;
-            this.chkListRoles.Location = new System.Drawing.Point(6, 196);
-            this.chkListRoles.Name = "chkListRoles";
-            this.chkListRoles.Size = new System.Drawing.Size(147, 244);
-            this.chkListRoles.TabIndex = 8;
-            //
-            // treeAbilities
-            //
-            this.treeAbilities.Location = new System.Drawing.Point(159, 196);
-            this.treeAbilities.Name = "treeAbilities";
-            this.treeAbilities.Size = new System.Drawing.Size(227, 244);
-            this.treeAbilities.TabIndex = 7;
-            //
-            // label2
-            //
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(156, 180);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(82, 13);
-            this.label2.TabIndex = 6;
-            this.label2.Text = "Allowed Abilities";
-            //
-            // label1
-            //
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(3, 180);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(80, 13);
-            this.label1.TabIndex = 5;
-            this.label1.Text = "Assigned Roles";
-            //
-            // tabRoles
-            //
-            this.tabRoles.Location = new System.Drawing.Point(4, 22);
-            this.tabRoles.Name = "tabRoles";
-            this.tabRoles.Padding = new System.Windows.Forms.Padding(3);
-            this.tabRoles.Size = new System.Drawing.Size(392, 443);
-            this.tabRoles.TabIndex = 1;
-            this.tabRoles.Text = "Roles";
-            this.tabRoles.UseVisualStyleBackColor = true;
-            //
-            // tabAbilities
-            //
-            this.tabAbilities.Location = new System.Drawing.Point(4, 22);
-            this.tabAbilities.Name = "tabAbilities";
-            this.tabAbilities.Size = new System.Drawing.Size(392, 443);
-            this.tabAbilities.TabIndex = 2;
-            this.tabAbilities.Text = "Abilities";
-            this.tabAbilities.UseVisualStyleBackColor = true;
-            //
-            // tabNotices
-            //
-            this.tabNotices.Controls.Add(this.textBox1);
-            this.tabNotices.Controls.Add(this.label3);
-            this.tabNotices.Controls.Add(this.cmdRefreshNotices);
-            this.tabNotices.Controls.Add(this.lstNotices);
-            this.tabNotices.Location = new System.Drawing.Point(4, 22);
-            this.tabNotices.Name = "tabNotices";
-            this.tabNotices.Size = new System.Drawing.Size(409, 481);
-            this.tabNotices.TabIndex = 2;
-            this.tabNotices.Text = "Notices";
-            this.tabNotices.UseVisualStyleBackColor = true;
-            //
-            // textBox1
-            //
-            this.textBox1.Location = new System.Drawing.Point(3, 239);
-            this.textBox1.Multiline = true;
-            this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(403, 239);
-            this.textBox1.TabIndex = 18;
-            //
-            // label3
-            //
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(3, 223);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(83, 13);
-            this.label3.TabIndex = 17;
-            this.label3.Text = "Archived Notice";
-            //
-            // cmdRefreshNotices
-            //
-            this.cmdRefreshNotices.Location = new System.Drawing.Point(289, 194);
-            this.cmdRefreshNotices.Name = "cmdRefreshNotices";
-            this.cmdRefreshNotices.Size = new System.Drawing.Size(117, 23);
-            this.cmdRefreshNotices.TabIndex = 16;
-            this.cmdRefreshNotices.Text = "Refresh List";
-            this.cmdRefreshNotices.UseVisualStyleBackColor = true;
-            //
-            // lstNotices
-            //
-            this.lstNotices.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader4,
-            this.columnHeader5,
-            this.columnHeader6});
-            this.lstNotices.Location = new System.Drawing.Point(3, 8);
-            this.lstNotices.Name = "lstNotices";
-            this.lstNotices.Size = new System.Drawing.Size(403, 180);
-            this.lstNotices.TabIndex = 15;
-            this.lstNotices.UseCompatibleStateImageBehavior = false;
-            this.lstNotices.View = System.Windows.Forms.View.Details;
-            //
-            // columnHeader4
-            //
-            this.columnHeader4.Text = "Subject";
-            this.columnHeader4.Width = 184;
-            //
-            // columnHeader5
-            //
-            this.columnHeader5.Text = "From";
-            this.columnHeader5.Width = 125;
-            //
-            // columnHeader6
-            //
-            this.columnHeader6.Text = "Date";
-            this.columnHeader6.Width = 87;
-            //
-            // tabProposals
-            //
-            this.tabProposals.Location = new System.Drawing.Point(4, 22);
-            this.tabProposals.Name = "tabProposals";
-            this.tabProposals.Size = new System.Drawing.Size(409, 481);
-            this.tabProposals.TabIndex = 3;
-            this.tabProposals.Text = "Proposals";
-            this.tabProposals.UseVisualStyleBackColor = true;
-            //
-            // tabLand
-            //
-            this.tabLand.Controls.Add(this.tabsMoney);
-            this.tabLand.Controls.Add(this.txtContribution);
-            this.tabLand.Controls.Add(this.lblLandAvailable);
-            this.tabLand.Controls.Add(this.lblLandInUse);
-            this.tabLand.Controls.Add(this.lblTotalContribution);
-            this.tabLand.Controls.Add(this.label7);
-            this.tabLand.Controls.Add(this.label6);
-            this.tabLand.Controls.Add(this.label5);
-            this.tabLand.Controls.Add(this.label4);
-            this.tabLand.Controls.Add(this.lstLand);
-            this.tabLand.Location = new System.Drawing.Point(4, 22);
-            this.tabLand.Name = "tabLand";
-            this.tabLand.Size = new System.Drawing.Size(409, 481);
-            this.tabLand.TabIndex = 4;
-            this.tabLand.Text = "Land & L$";
-            this.tabLand.UseVisualStyleBackColor = true;
-            //
-            // tabsMoney
-            //
-            this.tabsMoney.Controls.Add(this.tabPlanning);
-            this.tabsMoney.Controls.Add(this.tabDetails);
-            this.tabsMoney.Controls.Add(this.tabSales);
-            this.tabsMoney.Location = new System.Drawing.Point(3, 278);
-            this.tabsMoney.Name = "tabsMoney";
-            this.tabsMoney.SelectedIndex = 0;
-            this.tabsMoney.Size = new System.Drawing.Size(406, 200);
-            this.tabsMoney.TabIndex = 24;
-            //
-            // tabPlanning
-            //
-            this.tabPlanning.Controls.Add(this.txtPlanning);
-            this.tabPlanning.Location = new System.Drawing.Point(4, 22);
-            this.tabPlanning.Name = "tabPlanning";
-            this.tabPlanning.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPlanning.Size = new System.Drawing.Size(398, 174);
-            this.tabPlanning.TabIndex = 0;
-            this.tabPlanning.Text = "Planning";
-            this.tabPlanning.UseVisualStyleBackColor = true;
-            //
-            // txtPlanning
-            //
-            this.txtPlanning.Location = new System.Drawing.Point(6, 5);
-            this.txtPlanning.Multiline = true;
-            this.txtPlanning.Name = "txtPlanning";
-            this.txtPlanning.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
-            this.txtPlanning.Size = new System.Drawing.Size(386, 163);
-            this.txtPlanning.TabIndex = 13;
-            //
-            // tabDetails
-            //
-            this.tabDetails.Controls.Add(this.txtDetails);
-            this.tabDetails.Location = new System.Drawing.Point(4, 22);
-            this.tabDetails.Name = "tabDetails";
-            this.tabDetails.Padding = new System.Windows.Forms.Padding(3);
-            this.tabDetails.Size = new System.Drawing.Size(398, 174);
-            this.tabDetails.TabIndex = 1;
-            this.tabDetails.Text = "Details";
-            this.tabDetails.UseVisualStyleBackColor = true;
-            //
-            // txtDetails
-            //
-            this.txtDetails.Location = new System.Drawing.Point(6, 6);
-            this.txtDetails.Multiline = true;
-            this.txtDetails.Name = "txtDetails";
-            this.txtDetails.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
-            this.txtDetails.Size = new System.Drawing.Size(386, 163);
-            this.txtDetails.TabIndex = 14;
-            //
-            // tabSales
-            //
-            this.tabSales.Controls.Add(this.txtSales);
-            this.tabSales.Location = new System.Drawing.Point(4, 22);
-            this.tabSales.Name = "tabSales";
-            this.tabSales.Size = new System.Drawing.Size(398, 174);
-            this.tabSales.TabIndex = 2;
-            this.tabSales.Text = "Sales";
-            this.tabSales.UseVisualStyleBackColor = true;
-            //
-            // txtSales
-            //
-            this.txtSales.Location = new System.Drawing.Point(6, 6);
-            this.txtSales.Multiline = true;
-            this.txtSales.Name = "txtSales";
-            this.txtSales.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
-            this.txtSales.Size = new System.Drawing.Size(386, 163);
-            this.txtSales.TabIndex = 14;
-            //
-            // txtContribution
-            //
-            this.txtContribution.Location = new System.Drawing.Point(157, 237);
-            this.txtContribution.Name = "txtContribution";
-            this.txtContribution.Size = new System.Drawing.Size(94, 20);
-            this.txtContribution.TabIndex = 23;
-            //
-            // lblLandAvailable
-            //
-            this.lblLandAvailable.AutoSize = true;
-            this.lblLandAvailable.Location = new System.Drawing.Point(154, 221);
-            this.lblLandAvailable.Name = "lblLandAvailable";
-            this.lblLandAvailable.Size = new System.Drawing.Size(13, 13);
-            this.lblLandAvailable.TabIndex = 22;
-            this.lblLandAvailable.Text = "0";
-            //
-            // lblLandInUse
-            //
-            this.lblLandInUse.AutoSize = true;
-            this.lblLandInUse.Location = new System.Drawing.Point(154, 199);
-            this.lblLandInUse.Name = "lblLandInUse";
-            this.lblLandInUse.Size = new System.Drawing.Size(13, 13);
-            this.lblLandInUse.TabIndex = 21;
-            this.lblLandInUse.Text = "0";
-            //
-            // lblTotalContribution
-            //
-            this.lblTotalContribution.AutoSize = true;
-            this.lblTotalContribution.Location = new System.Drawing.Point(154, 176);
-            this.lblTotalContribution.Name = "lblTotalContribution";
-            this.lblTotalContribution.Size = new System.Drawing.Size(13, 13);
-            this.lblTotalContribution.TabIndex = 20;
-            this.lblTotalContribution.Text = "0";
-            //
-            // label7
-            //
-            this.label7.AutoSize = true;
-            this.label7.Location = new System.Drawing.Point(57, 244);
-            this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(91, 13);
-            this.label7.TabIndex = 19;
-            this.label7.Text = "Your Contribution:";
-            this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight;
-            //
-            // label6
-            //
-            this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(68, 221);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(80, 13);
-            this.label6.TabIndex = 18;
-            this.label6.Text = "Land Available:";
-            this.label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
-            //
-            // label5
-            //
-            this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(53, 199);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(95, 13);
-            this.label5.TabIndex = 17;
-            this.label5.Text = "Total Land In Use:";
-            this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight;
-            //
-            // label4
-            //
-            this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(55, 176);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(93, 13);
-            this.label4.TabIndex = 16;
-            this.label4.Text = "Total Contribution:";
-            this.label4.TextAlign = System.Drawing.ContentAlignment.TopRight;
-            //
-            // lstLand
-            //
-            this.lstLand.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader7,
-            this.columnHeader8,
-            this.columnHeader9});
-            this.lstLand.Location = new System.Drawing.Point(3, 3);
-            this.lstLand.Name = "lstLand";
-            this.lstLand.Size = new System.Drawing.Size(403, 140);
-            this.lstLand.TabIndex = 15;
-            this.lstLand.UseCompatibleStateImageBehavior = false;
-            this.lstLand.View = System.Windows.Forms.View.Details;
-            //
-            // columnHeader7
-            //
-            this.columnHeader7.Text = "Parcel Name";
-            this.columnHeader7.Width = 180;
-            //
-            // columnHeader8
-            //
-            this.columnHeader8.Text = "Region";
-            this.columnHeader8.Width = 119;
-            //
-            // columnHeader9
-            //
-            this.columnHeader9.Text = "Area";
-            this.columnHeader9.Width = 93;
-            //
-            // cmdApply
-            //
-            this.cmdApply.Location = new System.Drawing.Point(348, 520);
-            this.cmdApply.Name = "cmdApply";
-            this.cmdApply.Size = new System.Drawing.Size(75, 23);
-            this.cmdApply.TabIndex = 10;
-            this.cmdApply.Text = "Apply";
-            this.cmdApply.UseVisualStyleBackColor = true;
-            //
-            // cmdCancel
-            //
-            this.cmdCancel.Location = new System.Drawing.Point(267, 520);
-            this.cmdCancel.Name = "cmdCancel";
-            this.cmdCancel.Size = new System.Drawing.Size(75, 23);
-            this.cmdCancel.TabIndex = 11;
-            this.cmdCancel.Text = "Cancel";
-            this.cmdCancel.UseVisualStyleBackColor = true;
-            //
-            // cmdOK
-            //
-            this.cmdOK.Location = new System.Drawing.Point(186, 520);
-            this.cmdOK.Name = "cmdOK";
-            this.cmdOK.Size = new System.Drawing.Size(75, 23);
-            this.cmdOK.TabIndex = 12;
-            this.cmdOK.Text = "OK";
-            this.cmdOK.UseVisualStyleBackColor = true;
-            //
-            // cmdRefresh
-            //
-            this.cmdRefresh.Location = new System.Drawing.Point(6, 520);
-            this.cmdRefresh.Name = "cmdRefresh";
-            this.cmdRefresh.Size = new System.Drawing.Size(121, 23);
-            this.cmdRefresh.TabIndex = 13;
-            this.cmdRefresh.Text = "Refresh from server";
-            this.cmdRefresh.UseVisualStyleBackColor = true;
-            //
-            // frmGroupInfo
-            //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(431, 548);
-            this.Controls.Add(this.cmdRefresh);
-            this.Controls.Add(this.cmdOK);
-            this.Controls.Add(this.cmdCancel);
-            this.Controls.Add(this.cmdApply);
-            this.Controls.Add(this.tabs);
-            this.MaximizeBox = false;
-            this.Name = "frmGroupInfo";
-            this.ShowInTaskbar = false;
-            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
-            this.Text = "Group Information";
-            this.tabs.ResumeLayout(false);
-            this.tabGeneral.ResumeLayout(false);
-            this.tabGeneral.PerformLayout();
-            this.grpPreferences.ResumeLayout(false);
-            this.grpPreferences.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.numFee)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.picInsignia)).EndInit();
-            this.tabMembersRoles.ResumeLayout(false);
-            this.tabsMRA.ResumeLayout(false);
-            this.tabMembers.ResumeLayout(false);
-            this.tabMembers.PerformLayout();
-            this.tabNotices.ResumeLayout(false);
-            this.tabNotices.PerformLayout();
-            this.tabLand.ResumeLayout(false);
-            this.tabLand.PerformLayout();
-            this.tabsMoney.ResumeLayout(false);
-            this.tabPlanning.ResumeLayout(false);
-            this.tabPlanning.PerformLayout();
-            this.tabDetails.ResumeLayout(false);
-            this.tabDetails.PerformLayout();
-            this.tabSales.ResumeLayout(false);
-            this.tabSales.PerformLayout();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.TabControl tabs;
-        private System.Windows.Forms.TabPage tabGeneral;
-        private System.Windows.Forms.GroupBox grpPreferences;
-        private System.Windows.Forms.CheckBox chkMature;
-        private System.Windows.Forms.NumericUpDown numFee;
-        private System.Windows.Forms.CheckBox chkGroupNotices;
-        private System.Windows.Forms.CheckBox chkFee;
-        private System.Windows.Forms.CheckBox chkOpenEnrollment;
-        private System.Windows.Forms.CheckBox chkPublish;
-        private System.Windows.Forms.CheckBox chkShow;
-        private System.Windows.Forms.ListView lstMembers;
-        private System.Windows.Forms.ColumnHeader colName;
-        private System.Windows.Forms.ColumnHeader colTitle;
-        private System.Windows.Forms.ColumnHeader colLasLogin;
-        private System.Windows.Forms.TextBox txtCharter;
-        private System.Windows.Forms.Label lblFoundedBy;
-        private System.Windows.Forms.Label lblGroupName;
-        private System.Windows.Forms.PictureBox picInsignia;
-        private System.Windows.Forms.TabPage tabMembersRoles;
-        private System.Windows.Forms.TabPage tabNotices;
-        private System.Windows.Forms.TabPage tabProposals;
-        private System.Windows.Forms.TabPage tabLand;
-        private System.Windows.Forms.Button cmdApply;
-        private System.Windows.Forms.Button cmdCancel;
-        private System.Windows.Forms.Button cmdOK;
-        private System.Windows.Forms.Button cmdRefresh;
-        private System.Windows.Forms.TabControl tabsMRA;
-        private System.Windows.Forms.TabPage tabMembers;
-        private System.Windows.Forms.TabPage tabRoles;
-        private System.Windows.Forms.TabPage tabAbilities;
-        private System.Windows.Forms.ListView lstMembers2;
-        private System.Windows.Forms.ColumnHeader columnHeader1;
-        private System.Windows.Forms.ColumnHeader columnHeader2;
-        private System.Windows.Forms.ColumnHeader columnHeader3;
-        private System.Windows.Forms.CheckedListBox chkListRoles;
-        private System.Windows.Forms.TreeView treeAbilities;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.Button cmdEject;
-        private System.Windows.Forms.TextBox textBox1;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Button cmdRefreshNotices;
-        private System.Windows.Forms.ListView lstNotices;
-        private System.Windows.Forms.ColumnHeader columnHeader4;
-        private System.Windows.Forms.ColumnHeader columnHeader5;
-        private System.Windows.Forms.ColumnHeader columnHeader6;
-        private System.Windows.Forms.ListView lstLand;
-        private System.Windows.Forms.ColumnHeader columnHeader7;
-        private System.Windows.Forms.ColumnHeader columnHeader8;
-        private System.Windows.Forms.ColumnHeader columnHeader9;
-        private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.Label label4;
-        private System.Windows.Forms.TabControl tabsMoney;
-        private System.Windows.Forms.TabPage tabPlanning;
-        private System.Windows.Forms.TabPage tabDetails;
-        private System.Windows.Forms.TextBox txtContribution;
-        private System.Windows.Forms.Label lblLandAvailable;
-        private System.Windows.Forms.Label lblLandInUse;
-        private System.Windows.Forms.Label lblTotalContribution;
-        private System.Windows.Forms.Label label7;
-        private System.Windows.Forms.Label label6;
-        private System.Windows.Forms.TextBox txtPlanning;
-        private System.Windows.Forms.TextBox txtDetails;
-        private System.Windows.Forms.TabPage tabSales;
-        private System.Windows.Forms.TextBox txtSales;
-
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.cs b/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.cs
deleted file mode 100644
index 9347706..0000000
--- a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using System.IO;
-using libsecondlife;
-
-namespace groupmanager
-{
-    public partial class frmGroupInfo : Form
-    {
-        Group Group;
-        SecondLife Client;
-        GroupProfile Profile = new GroupProfile();
-        Dictionary<LLUUID, GroupMember> Members = new Dictionary<LLUUID,GroupMember>();
-        Dictionary<LLUUID, GroupTitle> Titles = new Dictionary<LLUUID,GroupTitle>();
-        Dictionary<LLUUID, GroupMemberData> MemberData = new Dictionary<LLUUID, GroupMemberData>();
-        Dictionary<LLUUID, string> Names = new Dictionary<LLUUID, string>();
-        GroupManager.GroupProfileCallback GroupProfileCallback;
-        GroupManager.GroupMembersCallback GroupMembersCallback;
-        GroupManager.GroupTitlesCallback GroupTitlesCallback;
-        AvatarManager.AvatarNamesCallback AvatarNamesCallback;
-        AssetManager.ImageReceivedCallback ImageReceivedCallback;
-
-        public frmGroupInfo(Group group, SecondLife client)
-        {
-            InitializeComponent();
-
-            while (!IsHandleCreated)
-            {
-                // Force handle creation
-                IntPtr temp = Handle;
-            }
-
-            GroupProfileCallback = new GroupManager.GroupProfileCallback(GroupProfileHandler);
-            GroupMembersCallback = new GroupManager.GroupMembersCallback(GroupMembersHandler);
-            GroupTitlesCallback = new GroupManager.GroupTitlesCallback(GroupTitlesHandler);
-            AvatarNamesCallback = new AvatarManager.AvatarNamesCallback(AvatarNamesHandler);
-            ImageReceivedCallback = new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
-
-            Group = group;
-            Client = client;
-
-            // Register the callbacks for this form
-            Client.Assets.OnImageReceived += ImageReceivedCallback;
-            Client.Groups.OnGroupProfile += GroupProfileCallback;
-            Client.Groups.OnGroupMembers += GroupMembersCallback;
-            Client.Groups.OnGroupTitles += GroupTitlesCallback;
-            Client.Avatars.OnAvatarNames += AvatarNamesCallback;
-
-            // Request the group information
-            Client.Groups.RequestGroupProfile(Group.ID);
-            Client.Groups.RequestGroupMembers(Group.ID);
-            Client.Groups.RequestGroupTitles(Group.ID);
-        }
-
-        ~frmGroupInfo()
-        {
-            // Unregister the callbacks for this form
-            Client.Assets.OnImageReceived -= ImageReceivedCallback;
-            Client.Groups.OnGroupProfile -= GroupProfileCallback;
-            Client.Groups.OnGroupMembers -= GroupMembersCallback;
-            Client.Groups.OnGroupTitles -= GroupTitlesCallback;
-            Client.Avatars.OnAvatarNames -= AvatarNamesCallback;
-        }
-
-        private void GroupProfileHandler(GroupProfile profile)
-        {
-            Profile = profile;
-
-            if (Group.InsigniaID != null && Group.InsigniaID != LLUUID.Zero)
-                Client.Assets.RequestImage(Group.InsigniaID, ImageType.Normal, 113000.0f, 0);
-
-            if (this.InvokeRequired)
-                this.BeginInvoke(new MethodInvoker(UpdateProfile));
-        }
-
-        void Assets_OnImageReceived(ImageDownload image, AssetTexture assetTexture)
-        {
-            if (image.Success)
-                picInsignia.Image = OpenJPEGNet.OpenJPEG.DecodeToImage(image.AssetData);
-        }
-
-        private void UpdateProfile()
-        {
-            lblGroupName.Text = Profile.Name;
-            txtCharter.Text = Profile.Charter;
-            chkShow.Checked = Profile.ShowInList;
-            chkPublish.Checked = Profile.AllowPublish;
-            chkOpenEnrollment.Checked = Profile.OpenEnrollment;
-            chkFee.Checked = (Profile.MembershipFee != 0);
-            numFee.Value = Profile.MembershipFee;
-            chkMature.Checked = Profile.MaturePublish;
-
-            Client.Avatars.RequestAvatarName(Profile.FounderID);
-        }
-
-        private void AvatarNamesHandler(Dictionary<LLUUID, string> names)
-        {
-            lock (Names)
-            {
-                foreach (KeyValuePair<LLUUID, string> agent in names)
-                {
-                    Names[agent.Key] = agent.Value;
-                }
-            }
-
-            UpdateNames();
-        }
-
-        private void UpdateNames()
-        {
-            if (this.InvokeRequired)
-            {
-                Invoke(new MethodInvoker(UpdateNames));
-            }
-            else
-            {
-                lock (Names)
-                {
-                    if (Profile.FounderID != null && Names.ContainsKey(Profile.FounderID))
-                    {
-                        lblFoundedBy.Text = "Founded by " + Names[Profile.FounderID];
-                    }
-
-                    lock (MemberData)
-                    {
-                        foreach (KeyValuePair<LLUUID, string> name in Names)
-                        {
-                            if (!MemberData.ContainsKey(name.Key))
-                            {
-                                MemberData[name.Key] = new GroupMemberData();
-                            }
-
-                            MemberData[name.Key].Name = name.Value;
-                        }
-                    }
-                }
-
-                UpdateMemberList();
-            }
-        }
-
-        private void UpdateMemberList()
-        {
-            // General tab list
-            lock (lstMembers)
-            {
-                lstMembers.Items.Clear();
-
-                foreach (GroupMemberData entry in MemberData.Values)
-                {
-                    ListViewItem lvi = new ListViewItem();
-                    lvi.Text = entry.Name;
-
-                    ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem();
-                    lvsi.Text = entry.Title;
-                    lvi.SubItems.Add(lvsi);
-
-                    lvsi = new ListViewItem.ListViewSubItem();
-                    lvsi.Text = entry.LastOnline;
-                    lvi.SubItems.Add(lvsi);
-
-                    lstMembers.Items.Add(lvi);
-                }
-            }
-
-            // Members tab list
-            lock (lstMembers2)
-            {
-                lstMembers2.Items.Clear();
-
-                foreach (GroupMemberData entry in MemberData.Values)
-                {
-                    ListViewItem lvi = new ListViewItem();
-                    lvi.Text = entry.Name;
-
-                    ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem();
-                    lvsi.Text = entry.Contribution.ToString();
-                    lvi.SubItems.Add(lvsi);
-
-                    lvsi = new ListViewItem.ListViewSubItem();
-                    lvsi.Text = entry.LastOnline;
-                    lvi.SubItems.Add(lvsi);
-
-                    lstMembers2.Items.Add(lvi);
-                }
-            }
-        }
-
-        private void GroupMembersHandler(Dictionary<LLUUID, GroupMember> members)
-        {
-            Members = members;
-
-            UpdateMembers();
-        }
-
-        private void UpdateMembers()
-        {
-            if (this.InvokeRequired)
-            {
-                Invoke(new MethodInvoker(UpdateMembers));
-            }
-            else
-            {
-                List<LLUUID> requestids = new List<LLUUID>();
-
-                lock (Members)
-                {
-                    lock (MemberData)
-                    {
-                        foreach (GroupMember member in Members.Values)
-                        {
-                            GroupMemberData memberData = new GroupMemberData();
-                            memberData.ID = member.ID;
-                            memberData.IsOwner = member.IsOwner;
-                            memberData.LastOnline = member.OnlineStatus;
-                            memberData.Powers = (ulong)member.Powers;
-                            memberData.Title = member.Title;
-                            memberData.Contribution = member.Contribution;
-
-                            MemberData[member.ID] = memberData;
-
-                            // Add this ID to the name request batch
-                            requestids.Add(member.ID);
-                        }
-                    }
-                }
-
-                Client.Avatars.RequestAvatarNames(requestids);
-            }
-        }
-
-        private void GroupTitlesHandler(Dictionary<LLUUID, GroupTitle> titles)
-        {
-            Titles = titles;
-
-            UpdateTitles();
-        }
-
-        private void UpdateTitles()
-        {
-            if (this.InvokeRequired)
-            {
-                Invoke(new MethodInvoker(UpdateTitles));
-            }
-            else
-            {
-                lock (Titles)
-                {
-                    foreach (KeyValuePair<LLUUID, GroupTitle> kvp in Titles)
-                    {
-                        Console.Write("Title: " + kvp.Value.Title + " = " + kvp.Key.ToString());
-                        if (kvp.Value.Selected)
-                            Console.WriteLine(" (Selected)");
-                        else
-                            Console.WriteLine();
-                    }
-                }
-            }
-        }
-    }
-
-    public class GroupMemberData
-    {
-        public LLUUID ID;
-        public string Name;
-        public string Title;
-        public string LastOnline;
-        public ulong Powers;
-        public bool IsOwner;
-        public int Contribution;
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.resx b/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.resx
deleted file mode 100644
index 19dc0dd..0000000
--- a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupInfo.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.Designer.cs b/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.Designer.cs
deleted file mode 100644
index 2a44691..0000000
--- a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.Designer.cs
+++ /dev/null
@@ -1,220 +0,0 @@
-namespace groupmanager
-{
-    partial class frmGroupManager
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.groupBox = new System.Windows.Forms.GroupBox();
-            this.lstGroups = new System.Windows.Forms.ListBox();
-            this.grpLogin = new System.Windows.Forms.GroupBox();
-            this.label3 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
-            this.label1 = new System.Windows.Forms.Label();
-            this.txtPassword = new System.Windows.Forms.TextBox();
-            this.txtLastName = new System.Windows.Forms.TextBox();
-            this.cmdConnect = new System.Windows.Forms.Button();
-            this.txtFirstName = new System.Windows.Forms.TextBox();
-            this.cmdLeave = new System.Windows.Forms.Button();
-            this.cmdCreate = new System.Windows.Forms.Button();
-            this.cmdActivate = new System.Windows.Forms.Button();
-            this.cmdInfo = new System.Windows.Forms.Button();
-            this.groupBox.SuspendLayout();
-            this.grpLogin.SuspendLayout();
-            this.SuspendLayout();
-            //
-            // groupBox
-            //
-            this.groupBox.Controls.Add(this.cmdInfo);
-            this.groupBox.Controls.Add(this.cmdActivate);
-            this.groupBox.Controls.Add(this.cmdCreate);
-            this.groupBox.Controls.Add(this.cmdLeave);
-            this.groupBox.Controls.Add(this.lstGroups);
-            this.groupBox.Enabled = false;
-            this.groupBox.Location = new System.Drawing.Point(12, 12);
-            this.groupBox.Name = "groupBox";
-            this.groupBox.Size = new System.Drawing.Size(419, 214);
-            this.groupBox.TabIndex = 0;
-            this.groupBox.TabStop = false;
-            this.groupBox.Text = "Groups";
-            //
-            // lstGroups
-            //
-            this.lstGroups.FormattingEnabled = true;
-            this.lstGroups.Location = new System.Drawing.Point(19, 31);
-            this.lstGroups.Name = "lstGroups";
-            this.lstGroups.Size = new System.Drawing.Size(384, 134);
-            this.lstGroups.TabIndex = 0;
-            this.lstGroups.SelectedIndexChanged += new System.EventHandler(this.lstGroups_SelectedIndexChanged);
-            //
-            // grpLogin
-            //
-            this.grpLogin.Controls.Add(this.label3);
-            this.grpLogin.Controls.Add(this.label2);
-            this.grpLogin.Controls.Add(this.label1);
-            this.grpLogin.Controls.Add(this.txtPassword);
-            this.grpLogin.Controls.Add(this.txtLastName);
-            this.grpLogin.Controls.Add(this.cmdConnect);
-            this.grpLogin.Controls.Add(this.txtFirstName);
-            this.grpLogin.Location = new System.Drawing.Point(12, 232);
-            this.grpLogin.Name = "grpLogin";
-            this.grpLogin.Size = new System.Drawing.Size(419, 108);
-            this.grpLogin.TabIndex = 51;
-            this.grpLogin.TabStop = false;
-            //
-            // label3
-            //
-            this.label3.Location = new System.Drawing.Point(280, 24);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(120, 16);
-            this.label3.TabIndex = 50;
-            this.label3.Text = "Password";
-            //
-            // label2
-            //
-            this.label2.Location = new System.Drawing.Point(152, 24);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(120, 16);
-            this.label2.TabIndex = 50;
-            this.label2.Text = "Last Name";
-            //
-            // label1
-            //
-            this.label1.Location = new System.Drawing.Point(16, 24);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(120, 16);
-            this.label1.TabIndex = 50;
-            this.label1.Text = "First Name";
-            //
-            // txtPassword
-            //
-            this.txtPassword.Location = new System.Drawing.Point(280, 40);
-            this.txtPassword.Name = "txtPassword";
-            this.txtPassword.PasswordChar = '*';
-            this.txtPassword.Size = new System.Drawing.Size(120, 20);
-            this.txtPassword.TabIndex = 2;
-            //
-            // txtLastName
-            //
-            this.txtLastName.Location = new System.Drawing.Point(152, 40);
-            this.txtLastName.Name = "txtLastName";
-            this.txtLastName.Size = new System.Drawing.Size(112, 20);
-            this.txtLastName.TabIndex = 1;
-            //
-            // cmdConnect
-            //
-            this.cmdConnect.Location = new System.Drawing.Point(280, 66);
-            this.cmdConnect.Name = "cmdConnect";
-            this.cmdConnect.Size = new System.Drawing.Size(120, 24);
-            this.cmdConnect.TabIndex = 3;
-            this.cmdConnect.Text = "Connect";
-            this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
-            //
-            // txtFirstName
-            //
-            this.txtFirstName.Location = new System.Drawing.Point(16, 40);
-            this.txtFirstName.Name = "txtFirstName";
-            this.txtFirstName.Size = new System.Drawing.Size(120, 20);
-            this.txtFirstName.TabIndex = 0;
-            //
-            // cmdLeave
-            //
-            this.cmdLeave.Enabled = false;
-            this.cmdLeave.Location = new System.Drawing.Point(313, 174);
-            this.cmdLeave.Name = "cmdLeave";
-            this.cmdLeave.Size = new System.Drawing.Size(90, 23);
-            this.cmdLeave.TabIndex = 7;
-            this.cmdLeave.Text = "Leave";
-            this.cmdLeave.UseVisualStyleBackColor = true;
-            //
-            // cmdCreate
-            //
-            this.cmdCreate.Location = new System.Drawing.Point(19, 174);
-            this.cmdCreate.Name = "cmdCreate";
-            this.cmdCreate.Size = new System.Drawing.Size(90, 23);
-            this.cmdCreate.TabIndex = 8;
-            this.cmdCreate.Text = "Create";
-            this.cmdCreate.UseVisualStyleBackColor = true;
-            //
-            // cmdActivate
-            //
-            this.cmdActivate.Enabled = false;
-            this.cmdActivate.Location = new System.Drawing.Point(116, 174);
-            this.cmdActivate.Name = "cmdActivate";
-            this.cmdActivate.Size = new System.Drawing.Size(90, 23);
-            this.cmdActivate.TabIndex = 9;
-            this.cmdActivate.Text = "Activate";
-            this.cmdActivate.UseVisualStyleBackColor = true;
-            //
-            // cmdInfo
-            //
-            this.cmdInfo.Enabled = false;
-            this.cmdInfo.Location = new System.Drawing.Point(216, 174);
-            this.cmdInfo.Name = "cmdInfo";
-            this.cmdInfo.Size = new System.Drawing.Size(90, 23);
-            this.cmdInfo.TabIndex = 10;
-            this.cmdInfo.Text = "Info";
-            this.cmdInfo.UseVisualStyleBackColor = true;
-            this.cmdInfo.Click += new System.EventHandler(this.cmdInfo_Click);
-            //
-            // frmGroupManager
-            //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(445, 351);
-            this.Controls.Add(this.grpLogin);
-            this.Controls.Add(this.groupBox);
-            this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(453, 378);
-            this.MinimumSize = new System.Drawing.Size(453, 378);
-            this.Name = "frmGroupManager";
-            this.Text = "Group Manager";
-            //this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmGroupManager_FormClosing);
-            this.groupBox.ResumeLayout(false);
-            this.grpLogin.ResumeLayout(false);
-            this.grpLogin.PerformLayout();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.GroupBox groupBox;
-        private System.Windows.Forms.ListBox lstGroups;
-        private System.Windows.Forms.GroupBox grpLogin;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.TextBox txtPassword;
-        private System.Windows.Forms.TextBox txtLastName;
-        private System.Windows.Forms.Button cmdConnect;
-        private System.Windows.Forms.TextBox txtFirstName;
-        private System.Windows.Forms.Button cmdInfo;
-        private System.Windows.Forms.Button cmdActivate;
-        private System.Windows.Forms.Button cmdCreate;
-        private System.Windows.Forms.Button cmdLeave;
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.cs b/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.cs
deleted file mode 100644
index 6f11880..0000000
--- a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace groupmanager
-{
-    public partial class frmGroupManager : Form
-    {
-        SecondLife Client;
-        Dictionary<LLUUID, Group> Groups;
-
-        public frmGroupManager()
-        {
-            Client = new SecondLife();
-
-            Client.Settings.MULTIPLE_SIMS = false;
-
-            // Throttle unnecessary things down
-            Client.Throttle.Land = 0;
-            Client.Throttle.Wind = 0;
-            Client.Throttle.Cloud = 0;
-
-            Client.Network.OnEventQueueRunning += new NetworkManager.EventQueueRunningCallback(Network_OnEventQueueRunning);
-            Client.Groups.OnCurrentGroups += new GroupManager.CurrentGroupsCallback(Groups_OnCurrentGroups);
-
-            InitializeComponent();
-        }
-
-        private void UpdateGroups()
-        {
-            lock (lstGroups)
-            {
-                Invoke((MethodInvoker)delegate() { lstGroups.Items.Clear(); });
-
-                foreach (Group group in Groups.Values)
-                {
-                    Client.Log(String.Format("Adding group {0} ({1})", group.Name, group.ID), Helpers.LogLevel.Info);
-
-                    Invoke((MethodInvoker)delegate() { lstGroups.Items.Add(group); });
-                }
-            }
-        }
-
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            frmGroupManager frm = new frmGroupManager();
-            frm.ShowDialog();
-        }
-
-        #region GUI Callbacks
-
-        private void cmdConnect_Click(object sender, EventArgs e)
-        {
-            if (cmdConnect.Text == "Connect")
-            {
-                cmdConnect.Text = "Disconnect";
-                txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;
-
-                if (Client.Network.Login(txtFirstName.Text, txtLastName.Text, txtPassword.Text, "GroupManager",
-                    "jhurliman@metaverseindustries.com"))
-                {
-                    groupBox.Enabled = true;
-                }
-                else
-                {
-                    MessageBox.Show(this, "Error logging in: " + Client.Network.LoginMessage);
-                    cmdConnect.Text = "Connect";
-                    txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
-                    groupBox.Enabled = false;
-                    lstGroups.Items.Clear();
-                }
-            }
-			else
-			{
-				Client.Network.Logout();
-				cmdConnect.Text = "Connect";
-				txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
-                groupBox.Enabled = false;
-                lstGroups.Items.Clear();
-			}
-        }
-
-        private void lstGroups_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            if (lstGroups.SelectedIndex >= 0)
-            {
-                cmdActivate.Enabled = cmdInfo.Enabled = cmdLeave.Enabled = true;
-            }
-            else
-            {
-                cmdActivate.Enabled = cmdInfo.Enabled = cmdLeave.Enabled = false;
-            }
-        }
-
-        private void cmdInfo_Click(object sender, EventArgs e)
-        {
-            if (lstGroups.SelectedIndex >= 0 && lstGroups.Items[lstGroups.SelectedIndex].ToString() != "none")
-            {
-                Group group = (Group)lstGroups.Items[lstGroups.SelectedIndex];
-
-                frmGroupInfo frm = new frmGroupInfo(group, Client);
-                frm.ShowDialog();
-            }
-        }
-
-        #endregion GUI Callbacks
-
-        #region Network Callbacks
-
-        private void Groups_OnCurrentGroups(Dictionary<LLUUID, Group> groups)
-        {
-            Groups = groups;
-
-            Invoke(new MethodInvoker(UpdateGroups));
-        }
-
-        private void Network_OnEventQueueRunning(Simulator simulator)
-        {
-            if (simulator == Client.Network.CurrentSim)
-            {
-                Console.WriteLine("Event queue connected for the primary simulator, requesting group info");
-
-                Client.Groups.RequestCurrentGroups();
-            }
-        }
-
-        #endregion
-    }
-}
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.resx b/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.resx
deleted file mode 100644
index 19dc0dd..0000000
--- a/old/libsl1550/libsecondlife/examples/groupmanager/frmGroupManager.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 2.0
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used for serialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/groupmanager/groupmanager.csproj b/old/libsl1550/libsecondlife/examples/groupmanager/groupmanager.csproj
deleted file mode 100644
index f7e411c..0000000
--- a/old/libsl1550/libsecondlife/examples/groupmanager/groupmanager.csproj
+++ /dev/null
@@ -1,136 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{F460FAB3-0D12-4873-89EB-2696818764B8}</ProjectGuid>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>App.ico</ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>groupmanager</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
-    <OutputType>WinExe</OutputType>
-    <RootNamespace>groupmanager</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>
-    </StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>full</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>bin\Release\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>none</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.Data">
-      <Name>System.Data</Name>
-    </Reference>
-    <Reference Include="System.Drawing">
-      <Name>System.Drawing</Name>
-    </Reference>
-    <Reference Include="System.Windows.Forms">
-      <Name>System.Windows.Forms</Name>
-    </Reference>
-    <Reference Include="System.Xml">
-      <Name>System.XML</Name>
-    </Reference>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Name>libsecondlife</Name>
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
-      <Private>False</Private>
-    </ProjectReference>
-    <ProjectReference Include="..\..\libsecondlife.Utilities\libsecondlife.Utilities.csproj">
-      <Project>{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}</Project>
-      <Name>libsecondlife.Utilities</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="frmGroupInfo.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="frmGroupInfo.Designer.cs">
-      <DependentUpon>frmGroupInfo.cs</DependentUpon>
-    </Compile>
-    <Compile Include="frmGroupManager.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="frmGroupManager.Designer.cs">
-      <DependentUpon>frmGroupManager.cs</DependentUpon>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="App.ico" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="frmGroupInfo.resx">
-      <SubType>Designer</SubType>
-      <DependentUpon>frmGroupInfo.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="frmGroupManager.resx">
-      <SubType>Designer</SubType>
-      <DependentUpon>frmGroupManager.cs</DependentUpon>
-    </EmbeddedResource>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>
-    </PostBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/name2key/bin/Release/CookComputing.XmlRpcV2.dll b/old/libsl1550/libsecondlife/examples/name2key/bin/Release/CookComputing.XmlRpcV2.dll
deleted file mode 100644
index 4dd869c..0000000
Binary files a/old/libsl1550/libsecondlife/examples/name2key/bin/Release/CookComputing.XmlRpcV2.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/name2key/bin/Release/libsecondlife.dll b/old/libsl1550/libsecondlife/examples/name2key/bin/Release/libsecondlife.dll
deleted file mode 100644
index c2f9982..0000000
Binary files a/old/libsl1550/libsecondlife/examples/name2key/bin/Release/libsecondlife.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/name2key/bin/Release/name2key.exe b/old/libsl1550/libsecondlife/examples/name2key/bin/Release/name2key.exe
deleted file mode 100644
index 0f95230..0000000
Binary files a/old/libsl1550/libsecondlife/examples/name2key/bin/Release/name2key.exe and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/name2key/name2key.cs b/old/libsl1550/libsecondlife/examples/name2key/name2key.cs
deleted file mode 100644
index 1b8dc84..0000000
--- a/old/libsl1550/libsecondlife/examples/name2key/name2key.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace name2key
-{
-	class name2key
-	{
-        private static AutoResetEvent queryEvent = new AutoResetEvent(false);
-        private static LLUUID queryID = LLUUID.Zero;
-
-        public static void DirQueryHandler(LLUUID queryid, List<DirectoryManager.AgentSearchData> results)
-        {
-            if (queryID == queryid)
-            {
-                if (results.Count < 1)
-                {
-                    Console.WriteLine("ERROR: Got an empty reply");
-                }
-                else
-                {
-                    if (results.Count > 1)
-                    {
-                        Console.WriteLine("ERROR: Ambiguous name. Returning first match");
-                    }
-
-                    Console.WriteLine("UUID: " + results[0].AgentID.ToString());
-                }
-
-                queryEvent.Set();
-            }
-        }
-
-		/// <summary>
-		/// The main entry point for the application.
-		/// </summary>
-		[STAThread]
-		static void Main(string[] args)
-		{
-			SecondLife client;
-
-			if (args.Length < 5)
-			{
-				Console.WriteLine("Usage: name2key [loginfirstname] [loginlastname] [password] [firstname] [lastname]");
-				return;
-			}
-
-			client = new SecondLife();
-
-			// Setup the callback
-            client.Directory.OnDirPeopleReply += new DirectoryManager.DirPeopleReplyCallback(DirQueryHandler);
-
-			if (!client.Network.Login(args[0], args[1], args[2], "name2key", "jhurliman@metaverseindustries.com"))
-			{
-				// Login failed
-				Console.WriteLine("ERROR: " + client.Network.LoginMessage);
-				return;
-			}
-
-			// Send the Query
-            queryID = client.Directory.StartPeopleSearch(DirectoryManager.DirFindFlags.People, args[3] + " " + args[4], 0);
-
-            // Wait for the event to trigger
-            queryEvent.WaitOne(8000, false);
-
-			client.Network.Logout();
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/examples/name2key/name2key.csproj b/old/libsl1550/libsecondlife/examples/name2key/name2key.csproj
deleted file mode 100644
index 7da86d9..0000000
--- a/old/libsl1550/libsecondlife/examples/name2key/name2key.csproj
+++ /dev/null
@@ -1,105 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{66FFD34E-652C-4EF5-81FE-06AD011169D2}</ProjectGuid>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>
-    </ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>name2key</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>name2key</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>
-    </StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>full</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>bin\Release\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>none</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.Data">
-      <Name>System.Data</Name>
-    </Reference>
-    <Reference Include="System.Xml">
-      <Name>System.XML</Name>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="name2key.cs">
-      <SubType>Code</SubType>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>
-    </PostBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/slaccountant/App.ico b/old/libsl1550/libsecondlife/examples/slaccountant/App.ico
deleted file mode 100644
index 3a5525f..0000000
Binary files a/old/libsl1550/libsecondlife/examples/slaccountant/App.ico and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/examples/slaccountant/AssemblyInfo.cs b/old/libsl1550/libsecondlife/examples/slaccountant/AssemblyInfo.cs
deleted file mode 100644
index 9f89a32..0000000
--- a/old/libsl1550/libsecondlife/examples/slaccountant/AssemblyInfo.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly: AssemblyTitle("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-//   (*) If no key is specified, the assembly is not signed.
-//   (*) KeyName refers to a key that has been installed in the Crypto Service
-//       Provider (CSP) on your machine. KeyFile refers to a file which contains
-//       a key.
-//   (*) If the KeyFile and the KeyName values are both specified, the
-//       following processing occurs:
-//       (1) If the KeyName can be found in the CSP, that key is used.
-//       (2) If the KeyName does not exist and the KeyFile does exist, the key
-//           in the KeyFile is installed into the CSP and used.
-//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-//       When specifying the KeyFile, the location of the KeyFile should be
-//       relative to the project output directory which is
-//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
-//       located in the project directory, you would specify the AssemblyKeyFile
-//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-//       documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
diff --git a/old/libsl1550/libsecondlife/examples/slaccountant/frmSLAccountant.cs b/old/libsl1550/libsecondlife/examples/slaccountant/frmSLAccountant.cs
deleted file mode 100644
index 6e2b905..0000000
--- a/old/libsl1550/libsecondlife/examples/slaccountant/frmSLAccountant.cs
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Drawing;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Data;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace SLAccountant
-{
-	/// <summary>
-	/// Summary description for Form1.
-	/// </summary>
-	public class frmSLAccountant : System.Windows.Forms.Form
-	{
-		private System.Windows.Forms.GroupBox grpLogin;
-		private System.Windows.Forms.TextBox txtPassword;
-		private System.Windows.Forms.TextBox txtLastName;
-		private System.Windows.Forms.Button cmdConnect;
-		private System.Windows.Forms.TextBox txtFirstName;
-		private System.Windows.Forms.Label label1;
-		private System.Windows.Forms.Label label2;
-		private System.Windows.Forms.Label label3;
-		/// <summary>
-		/// Required designer variable.
-		/// </summary>
-		private System.ComponentModel.Container components = null;
-		private System.Windows.Forms.Label label4;
-		private System.Windows.Forms.Label lblName;
-		private System.Windows.Forms.Label lblBalance;
-		private System.Windows.Forms.Label label6;
-		private System.Windows.Forms.Label label5;
-		private System.Windows.Forms.TextBox txtFind;
-		private System.Windows.Forms.Button cmdFind;
-		private System.Windows.Forms.TextBox txtTransfer;
-		private System.Windows.Forms.Button cmdTransfer;
-		private System.Windows.Forms.Label label7;
-		private System.Windows.Forms.ListView lstFind;
-		private System.Windows.Forms.ColumnHeader colName;
-		private System.Windows.Forms.ColumnHeader colOnline;
-		private System.Windows.Forms.ColumnHeader colUuid;
-
-		// libsecondlife instance
-		private SecondLife client;
-
-		public frmSLAccountant()
-		{
-			//
-			// Required for Windows Form Designer support
-			//
-			InitializeComponent();
-		}
-
-		/// <summary>
-		/// Clean up any resources being used.
-		/// </summary>
-		protected override void Dispose( bool disposing )
-		{
-			client.Network.Logout();
-
-			if( disposing )
-			{
-				if (components != null)
-				{
-					components.Dispose();
-				}
-			}
-			base.Dispose( disposing );
-		}
-
-		#region Windows Form Designer generated code
-		/// <summary>
-		/// Required method for Designer support - do not modify
-		/// the contents of this method with the code editor.
-		/// </summary>
-		private void InitializeComponent()
-		{
-			this.grpLogin = new System.Windows.Forms.GroupBox();
-			this.label3 = new System.Windows.Forms.Label();
-			this.label2 = new System.Windows.Forms.Label();
-			this.label1 = new System.Windows.Forms.Label();
-			this.txtPassword = new System.Windows.Forms.TextBox();
-			this.txtLastName = new System.Windows.Forms.TextBox();
-			this.cmdConnect = new System.Windows.Forms.Button();
-			this.txtFirstName = new System.Windows.Forms.TextBox();
-			this.label4 = new System.Windows.Forms.Label();
-			this.lblName = new System.Windows.Forms.Label();
-			this.lblBalance = new System.Windows.Forms.Label();
-			this.label6 = new System.Windows.Forms.Label();
-			this.label5 = new System.Windows.Forms.Label();
-			this.txtFind = new System.Windows.Forms.TextBox();
-			this.cmdFind = new System.Windows.Forms.Button();
-			this.txtTransfer = new System.Windows.Forms.TextBox();
-			this.cmdTransfer = new System.Windows.Forms.Button();
-			this.label7 = new System.Windows.Forms.Label();
-			this.lstFind = new System.Windows.Forms.ListView();
-			this.colName = new System.Windows.Forms.ColumnHeader();
-			this.colOnline = new System.Windows.Forms.ColumnHeader();
-			this.colUuid = new System.Windows.Forms.ColumnHeader();
-			this.grpLogin.SuspendLayout();
-			this.SuspendLayout();
-			//
-			// grpLogin
-			//
-			this.grpLogin.Controls.Add(this.label3);
-			this.grpLogin.Controls.Add(this.label2);
-			this.grpLogin.Controls.Add(this.label1);
-			this.grpLogin.Controls.Add(this.txtPassword);
-			this.grpLogin.Controls.Add(this.txtLastName);
-			this.grpLogin.Controls.Add(this.cmdConnect);
-			this.grpLogin.Controls.Add(this.txtFirstName);
-			this.grpLogin.Enabled = false;
-			this.grpLogin.Location = new System.Drawing.Point(16, 344);
-			this.grpLogin.Name = "grpLogin";
-			this.grpLogin.Size = new System.Drawing.Size(560, 80);
-			this.grpLogin.TabIndex = 50;
-			this.grpLogin.TabStop = false;
-			//
-			// label3
-			//
-			this.label3.Location = new System.Drawing.Point(280, 24);
-			this.label3.Name = "label3";
-			this.label3.Size = new System.Drawing.Size(120, 16);
-			this.label3.TabIndex = 50;
-			this.label3.Text = "Password";
-			//
-			// label2
-			//
-			this.label2.Location = new System.Drawing.Point(152, 24);
-			this.label2.Name = "label2";
-			this.label2.Size = new System.Drawing.Size(120, 16);
-			this.label2.TabIndex = 50;
-			this.label2.Text = "Last Name";
-			//
-			// label1
-			//
-			this.label1.Location = new System.Drawing.Point(16, 24);
-			this.label1.Name = "label1";
-			this.label1.Size = new System.Drawing.Size(120, 16);
-			this.label1.TabIndex = 50;
-			this.label1.Text = "First Name";
-			//
-			// txtPassword
-			//
-			this.txtPassword.Location = new System.Drawing.Point(280, 40);
-			this.txtPassword.Name = "txtPassword";
-			this.txtPassword.PasswordChar = '*';
-			this.txtPassword.Size = new System.Drawing.Size(120, 20);
-			this.txtPassword.TabIndex = 2;
-			this.txtPassword.Text = "";
-			//
-			// txtLastName
-			//
-			this.txtLastName.Location = new System.Drawing.Point(152, 40);
-			this.txtLastName.Name = "txtLastName";
-			this.txtLastName.Size = new System.Drawing.Size(112, 20);
-			this.txtLastName.TabIndex = 1;
-			this.txtLastName.Text = "";
-			//
-			// cmdConnect
-			//
-			this.cmdConnect.Location = new System.Drawing.Point(424, 40);
-			this.cmdConnect.Name = "cmdConnect";
-			this.cmdConnect.Size = new System.Drawing.Size(120, 24);
-			this.cmdConnect.TabIndex = 3;
-			this.cmdConnect.Text = "Connect";
-			this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
-			//
-			// txtFirstName
-			//
-			this.txtFirstName.Location = new System.Drawing.Point(16, 40);
-			this.txtFirstName.Name = "txtFirstName";
-			this.txtFirstName.Size = new System.Drawing.Size(120, 20);
-			this.txtFirstName.TabIndex = 0;
-			this.txtFirstName.Text = "";
-			//
-			// label4
-			//
-			this.label4.Location = new System.Drawing.Point(16, 8);
-			this.label4.Name = "label4";
-			this.label4.Size = new System.Drawing.Size(48, 16);
-			this.label4.TabIndex = 50;
-			this.label4.Text = "Name:";
-			//
-			// lblName
-			//
-			this.lblName.Location = new System.Drawing.Point(64, 8);
-			this.lblName.Name = "lblName";
-			this.lblName.Size = new System.Drawing.Size(184, 16);
-			this.lblName.TabIndex = 50;
-			//
-			// lblBalance
-			//
-			this.lblBalance.Location = new System.Drawing.Point(512, 8);
-			this.lblBalance.Name = "lblBalance";
-			this.lblBalance.Size = new System.Drawing.Size(64, 16);
-			this.lblBalance.TabIndex = 50;
-			this.lblBalance.TextAlign = System.Drawing.ContentAlignment.TopRight;
-			//
-			// label6
-			//
-			this.label6.Location = new System.Drawing.Point(456, 8);
-			this.label6.Name = "label6";
-			this.label6.Size = new System.Drawing.Size(56, 16);
-			this.label6.TabIndex = 50;
-			this.label6.Text = "Balance:";
-			//
-			// label5
-			//
-			this.label5.Location = new System.Drawing.Point(16, 40);
-			this.label5.Name = "label5";
-			this.label5.Size = new System.Drawing.Size(88, 16);
-			this.label5.TabIndex = 50;
-			this.label5.Text = "People Search";
-			//
-			// txtFind
-			//
-			this.txtFind.Enabled = false;
-			this.txtFind.Location = new System.Drawing.Point(16, 56);
-			this.txtFind.Name = "txtFind";
-			this.txtFind.Size = new System.Drawing.Size(184, 20);
-			this.txtFind.TabIndex = 4;
-			this.txtFind.Text = "";
-			//
-			// cmdFind
-			//
-			this.cmdFind.Enabled = false;
-			this.cmdFind.Location = new System.Drawing.Point(208, 56);
-			this.cmdFind.Name = "cmdFind";
-			this.cmdFind.Size = new System.Drawing.Size(48, 24);
-			this.cmdFind.TabIndex = 5;
-			this.cmdFind.Text = "Find";
-			this.cmdFind.Click += new System.EventHandler(this.cmdFind_Click);
-			//
-			// txtTransfer
-			//
-			this.txtTransfer.Enabled = false;
-			this.txtTransfer.Location = new System.Drawing.Point(360, 192);
-			this.txtTransfer.MaxLength = 7;
-			this.txtTransfer.Name = "txtTransfer";
-			this.txtTransfer.Size = new System.Drawing.Size(104, 20);
-			this.txtTransfer.TabIndex = 7;
-			this.txtTransfer.Text = "";
-			//
-			// cmdTransfer
-			//
-			this.cmdTransfer.Enabled = false;
-			this.cmdTransfer.Location = new System.Drawing.Point(472, 192);
-			this.cmdTransfer.Name = "cmdTransfer";
-			this.cmdTransfer.Size = new System.Drawing.Size(104, 24);
-			this.cmdTransfer.TabIndex = 8;
-			this.cmdTransfer.Text = "Transfer Lindens";
-			this.cmdTransfer.Click += new System.EventHandler(this.cmdTransfer_Click);
-			//
-			// label7
-			//
-			this.label7.Location = new System.Drawing.Point(360, 176);
-			this.label7.Name = "label7";
-			this.label7.Size = new System.Drawing.Size(88, 16);
-			this.label7.TabIndex = 17;
-			this.label7.Text = "Amount:";
-			//
-			// lstFind
-			//
-			this.lstFind.Activation = System.Windows.Forms.ItemActivation.OneClick;
-			this.lstFind.AllowColumnReorder = true;
-			this.lstFind.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-																					  this.colName,
-																					  this.colOnline,
-																					  this.colUuid});
-			this.lstFind.FullRowSelect = true;
-			this.lstFind.HideSelection = false;
-			this.lstFind.Location = new System.Drawing.Point(16, 88);
-			this.lstFind.Name = "lstFind";
-			this.lstFind.Size = new System.Drawing.Size(336, 248);
-			this.lstFind.Sorting = System.Windows.Forms.SortOrder.Ascending;
-			this.lstFind.TabIndex = 6;
-			this.lstFind.View = System.Windows.Forms.View.Details;
-			//
-			// colName
-			//
-			this.colName.Text = "Name";
-			this.colName.Width = 120;
-			//
-			// colOnline
-			//
-			this.colOnline.Text = "Online";
-			this.colOnline.Width = 50;
-			//
-			// colUuid
-			//
-			this.colUuid.Text = "UUID";
-			this.colUuid.Width = 150;
-			//
-			// frmSLAccountant
-			//
-			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-			this.ClientSize = new System.Drawing.Size(592, 437);
-			this.Controls.Add(this.lstFind);
-			this.Controls.Add(this.label7);
-			this.Controls.Add(this.cmdTransfer);
-			this.Controls.Add(this.txtTransfer);
-			this.Controls.Add(this.txtFind);
-			this.Controls.Add(this.cmdFind);
-			this.Controls.Add(this.label5);
-			this.Controls.Add(this.lblBalance);
-			this.Controls.Add(this.label6);
-			this.Controls.Add(this.lblName);
-			this.Controls.Add(this.label4);
-			this.Controls.Add(this.grpLogin);
-			this.Name = "frmSLAccountant";
-			this.Text = "SL Accountant";
-			this.Load += new System.EventHandler(this.frmSLAccountant_Load);
-			this.grpLogin.ResumeLayout(false);
-			this.ResumeLayout(false);
-
-		}
-		#endregion
-
-		/// <summary>
-		/// The main entry point for the application.
-		/// </summary>
-		[STAThread]
-		static void Main()
-		{
-            frmSLAccountant frm = new frmSLAccountant();
-            frm.ShowDialog();
-		}
-
-        private delegate void StringParamInvoker(string value);
-        private delegate void ListViewItemParamInvoker(ListViewItem item);
-
-        private void UpdateBalance(string value)
-        {
-            lblBalance.Text = value;
-        }
-
-        private void AddFindItem(ListViewItem item)
-        {
-            lock (lstFind)
-            {
-                lstFind.Items.Add(item);
-            }
-        }
-
-		private void BalanceHandler(Packet packet, Simulator simulator)
-		{
-            string value = ((MoneyBalanceReplyPacket)packet).MoneyData.MoneyBalance.ToString();
-            this.BeginInvoke(new StringParamInvoker(UpdateBalance), new object[] { value });
-		}
-
-		private void DirPeopleHandler(Packet packet, Simulator simulator)
-		{
-            DirPeopleReplyPacket reply = (DirPeopleReplyPacket)packet;
-
-            foreach (DirPeopleReplyPacket.QueryRepliesBlock block in reply.QueryReplies)
-            {
-                ListViewItem listItem = new ListViewItem(new string[] {
-                Helpers.FieldToUTF8String(block.FirstName) + " " + Helpers.FieldToUTF8String(block.LastName),
-                (block.Online ? "Yes" : "No"), block.AgentID.ToString() });
-
-                this.BeginInvoke(new ListViewItemParamInvoker(AddFindItem), new object[] { listItem });
-            }
-		}
-
-		private void frmSLAccountant_Load(object sender, System.EventArgs e)
-		{
-			client = new SecondLife();
-
-			// Install our packet handlers
-            client.Network.RegisterCallback(PacketType.MoneyBalanceReply, new NetworkManager.PacketCallback(BalanceHandler));
-            client.Network.RegisterCallback(PacketType.DirPeopleReply, new NetworkManager.PacketCallback(DirPeopleHandler));
-
-			grpLogin.Enabled = true;
-		}
-
-		private void cmdConnect_Click(object sender, System.EventArgs e)
-		{
-			if (cmdConnect.Text == "Connect")
-			{
-				cmdConnect.Text = "Disconnect";
-				txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;
-
-				if (client.Network.Login(txtFirstName.Text, txtLastName.Text, txtPassword.Text,
-                    "accountant", "jhurliman@metaverseindustries.com"))
-				{
-					Random rand = new Random();
-
-					lblName.Text = client.ToString();
-
-                    // AgentSetAppearance
-                    AgentSetAppearancePacket appearance = new AgentSetAppearancePacket();
-                    appearance.VisualParam = new AgentSetAppearancePacket.VisualParamBlock[218];
-                    // Setup some random appearance values
-                    for (int i = 0; i < 218; i++)
-                    {
-                        appearance.VisualParam[i] = new AgentSetAppearancePacket.VisualParamBlock();
-                        appearance.VisualParam[i].ParamValue = (byte)rand.Next(255);
-                    }
-                    appearance.AgentData.AgentID = client.Self.AgentID;
-                    appearance.AgentData.SessionID = client.Self.SessionID;
-                    appearance.AgentData.SerialNum = 1;
-                    appearance.AgentData.Size = new LLVector3(0.45F, 0.6F, 1.831094F);
-                    appearance.ObjectData.TextureEntry = new byte[0];
-
-                    client.Network.SendPacket(appearance);
-
-                    // Request our balance
-                    client.Self.RequestBalance();
-
-					txtFind.Enabled = cmdFind.Enabled = true;
-					txtTransfer.Enabled = cmdTransfer.Enabled = true;
-				}
-				else
-				{
-					MessageBox.Show(this, "Error logging in: " + client.Network.LoginMessage);
-					cmdConnect.Text = "Connect";
-					txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
-					txtFind.Enabled = cmdFind.Enabled = false;
-					lblName.Text = lblBalance.Text = "";
-					txtTransfer.Enabled = cmdTransfer.Enabled = false;
-				}
-			}
-			else
-			{
-				client.Network.Logout();
-				cmdConnect.Text = "Connect";
-				txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
-				txtFind.Enabled = cmdFind.Enabled = false;
-				lblName.Text = lblBalance.Text = "";
-				txtTransfer.Enabled = cmdTransfer.Enabled = false;
-			}
-		}
-
-		private void cmdFind_Click(object sender, System.EventArgs e)
-		{
-			lstFind.Items.Clear();
-
-            DirFindQueryPacket query = new DirFindQueryPacket();
-            query.AgentData.AgentID = client.Self.AgentID;
-            query.AgentData.SessionID = client.Self.SessionID;
-            query.QueryData.QueryFlags = 1;
-            query.QueryData.QueryID = LLUUID.Random();
-            query.QueryData.QueryStart = 0;
-            query.QueryData.QueryText = Helpers.StringToField(txtFind.Text);
-            query.Header.Reliable = true;
-
-            client.Network.SendPacket(query);
-		}
-
-		private void cmdTransfer_Click(object sender, System.EventArgs e)
-		{
-			int amount = 0;
-
-			try
-			{
-				amount = System.Convert.ToInt32(txtTransfer.Text);
-			}
-			catch (Exception)
-			{
-				MessageBox.Show(txtTransfer.Text + " is not a valid amount");
-				return;
-			}
-
-			if (lstFind.SelectedItems.Count != 1)
-			{
-				MessageBox.Show("Find an avatar using the directory search and select " +
-					"their name to transfer money");
-				return;
-			}
-
-			client.Self.GiveAvatarMoney(new LLUUID(lstFind.SelectedItems[0].SubItems[2].Text),
-			    amount, "SLAccountant payment");
-		}
-	}
-}
diff --git a/old/libsl1550/libsecondlife/examples/slaccountant/frmSLAccountant.resx b/old/libsl1550/libsecondlife/examples/slaccountant/frmSLAccountant.resx
deleted file mode 100644
index 85eaf36..0000000
--- a/old/libsl1550/libsecondlife/examples/slaccountant/frmSLAccountant.resx
+++ /dev/null
@@ -1,328 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!--
-    Microsoft ResX Schema
-
-    Version 1.3
-
-    The primary goals of this format is to allow a simple XML format
-    that is mostly human readable. The generation and parsing of the
-    various data types are done through the TypeConverter classes
-    associated with the data types.
-
-    Example:
-
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">1.3</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1">this is my long string</data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        [base64 mime encoded serialized .NET Framework object]
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        [base64 mime encoded string representing a byte array form of the .NET Framework object]
-    </data>
-
-    There are any number of "resheader" rows that contain simple
-    name/value pairs.
-
-    Each data row contains a name, and value. The row also contains a
-    type or mimetype. Type corresponds to a .NET class that support
-    text/value conversion through the TypeConverter architecture.
-    Classes that don't support this are serialized and stored with the
-    mimetype set.
-
-    The mimetype is used forserialized objects, and tells the
-    ResXResourceReader how to depersist the object. This is currently not
-    extensible. For a given mimetype the value must be set accordingly:
-
-    Note - application/x-microsoft.net.object.binary.base64 is the format
-    that the ResXResourceWriter will generate, however the reader can
-    read any of the formats listed below.
-
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with
-            : System.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>1.3</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <data name="grpLogin.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="grpLogin.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>8, 8</value>
-  </data>
-  <data name="grpLogin.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="grpLogin.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="grpLogin.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="grpLogin.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtPassword.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtPassword.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="txtPassword.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtLastName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtLastName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="txtLastName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdConnect.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="cmdConnect.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdConnect.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtFirstName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtFirstName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="txtFirstName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lblName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="lblName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lblName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lblBalance.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="lblBalance.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lblBalance.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label6.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label6.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label6.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label5.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label5.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label5.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtFind.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtFind.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="txtFind.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdFind.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="cmdFind.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdFind.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtTransfer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="txtTransfer.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="txtTransfer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdTransfer.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="cmdTransfer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdTransfer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label7.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label7.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label7.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lstFind.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="lstFind.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lstFind.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="colName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="colName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="colOnline.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="colOnline.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="colUuid.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="colUuid.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>(Default)</value>
-  </data>
-  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>8, 8</value>
-  </data>
-  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>80</value>
-  </data>
-  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="$this.Name">
-    <value>frmSLAccountant</value>
-  </data>
-  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-</root>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/slaccountant/slaccountant.csproj b/old/libsl1550/libsecondlife/examples/slaccountant/slaccountant.csproj
deleted file mode 100644
index c22dd41..0000000
--- a/old/libsl1550/libsecondlife/examples/slaccountant/slaccountant.csproj
+++ /dev/null
@@ -1,118 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{FC19D5F6-076E-4923-8456-9B0E00E22896}</ProjectGuid>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>App.ico</ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>slaccountant</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
-    <OutputType>WinExe</OutputType>
-    <RootNamespace>slaccountant</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>
-    </StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>full</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>none</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.Data">
-      <Name>System.Data</Name>
-    </Reference>
-    <Reference Include="System.Drawing">
-      <Name>System.Drawing</Name>
-    </Reference>
-    <Reference Include="System.Windows.Forms">
-      <Name>System.Windows.Forms</Name>
-    </Reference>
-    <Reference Include="System.Xml">
-      <Name>System.XML</Name>
-    </Reference>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Name>libsecondlife</Name>
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
-      <Private>False</Private>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="App.ico" />
-    <Compile Include="AssemblyInfo.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="frmSLAccountant.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <EmbeddedResource Include="frmSLAccountant.resx">
-      <DependentUpon>frmSLAccountant.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>
-    </PostBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/examples/sldump/sldump.cs b/old/libsl1550/libsecondlife/examples/sldump/sldump.cs
deleted file mode 100644
index b4efb0c..0000000
--- a/old/libsl1550/libsecondlife/examples/sldump/sldump.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace sldump
-{
-	class sldump
-	{
-        static bool LoginSuccess = false;
-        static AutoResetEvent LoginEvent = new AutoResetEvent(false);
-
-		// Default packet handler, registered for all packet types
-		public static void DefaultHandler(Packet packet, Simulator simulator)
-		{
-			Console.WriteLine(packet.ToString());
-		}
-
-        public static void DisconnectHandler(NetworkManager.DisconnectType type, string message)
-        {
-            if (type == NetworkManager.DisconnectType.NetworkTimeout)
-            {
-                Console.WriteLine("Network connection timed out, disconnected");
-            }
-            else if (type == NetworkManager.DisconnectType.ServerInitiated)
-            {
-                Console.WriteLine("Server disconnected us: " + message);
-            }
-        }
-
-		/// <summary>
-		/// The main entry point for the application.
-		/// </summary>
-		[STAThread]
-		static void Main(string[] args)
-		{
-			SecondLife client;
-
-			if (args.Length == 0 || (args.Length < 4 && args[0] != "--printmap"))
-			{
-				Console.WriteLine("Usage: sldump [--printmap] [--decrypt] [inputfile] [outputfile] "
-                    + "[--protocol] [firstname] [lastname] [password] [seconds (0 for infinite)]");
-				return;
-			}
-
-			if (args[0] == "--decrypt")
-			{
-				try
-				{
-					ProtocolManager.DecodeMapFile(args[1], args[2]);
-				}
-				catch (Exception e)
-				{
-					Console.WriteLine(e.ToString());
-				}
-
-				return;
-			}
-
-            client = new SecondLife();
-            // Turn off some unnecessary things
-            client.Settings.DEBUG = false;
-            client.Settings.MULTIPLE_SIMS = false;
-            // Throttle packets that we don't want all the way down
-            client.Throttle.Land = 0;
-            client.Throttle.Wind = 0;
-            client.Throttle.Cloud = 0;
-
-			if (args[0] == "--printmap")
-			{
-                ProtocolManager protocol;
-
-                try
-                {
-                    protocol = new ProtocolManager("message_template.msg", client);
-                }
-                catch (Exception e)
-                {
-                    // Error initializing the client, probably missing file(s)
-                    Console.WriteLine(e.ToString());
-                    return;
-                }
-
-                protocol.PrintMap();
-				return;
-			}
-
-			// Setup the packet callback and disconnect event handler
-            client.Network.RegisterCallback(PacketType.Default, new NetworkManager.PacketCallback(DefaultHandler));
-            client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(DisconnectHandler);
-
-            client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
-            client.Network.BeginLogin(client.Network.DefaultLoginParams(args[0], args[1], args[2], "sldump",
-                "contact@libsecondlife.org"));
-
-            LoginEvent.WaitOne();
-
-            if (!LoginSuccess)
-            {
-                Console.WriteLine("Login failed: {0}", client.Network.LoginMessage);
-                return;
-            }
-
-			Console.WriteLine("Message of the day: " + client.Network.LoginMessage);
-
-            int start = Environment.TickCount;
-            int milliseconds = Int32.Parse(args[3]) * 1000;
-            bool forever = (milliseconds > 0) ? false : true;
-
-			while (true)
-			{
-                System.Threading.Thread.Sleep(100);
-
-                if (!forever && Environment.TickCount - start > milliseconds)
-                {
-                    break;
-                }
-			}
-
-            client.Network.Logout();
-		}
-
-        static void Network_OnLogin(LoginStatus login, string message)
-        {
-            Console.WriteLine("Login: " + login.ToString() + " (" + message + ")");
-
-            switch (login)
-            {
-                case LoginStatus.Failed:
-                    LoginEvent.Set();
-                    break;
-                case LoginStatus.Success:
-                    LoginSuccess = true;
-                    LoginEvent.Set();
-                    break;
-            }
-        }
-	}
-}
diff --git a/old/libsl1550/libsecondlife/examples/sldump/sldump.csproj b/old/libsl1550/libsecondlife/examples/sldump/sldump.csproj
deleted file mode 100644
index 2c06100..0000000
--- a/old/libsl1550/libsecondlife/examples/sldump/sldump.csproj
+++ /dev/null
@@ -1,105 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{F6258A68-C624-46A0-BA73-B55D21BB0A3B}</ProjectGuid>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>
-    </ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>sldump</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>sldump</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>
-    </StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>full</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>..\..\..\bin\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>none</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.Data">
-      <Name>System.Data</Name>
-    </Reference>
-    <Reference Include="System.Xml">
-      <Name>System.XML</Name>
-    </Reference>
-    <ProjectReference Include="..\..\libsecondlife.csproj">
-      <Name>libsecondlife</Name>
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
-      <Private>False</Private>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="sldump.cs">
-      <SubType>Code</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>
-    </PostBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Tests/NetworkTests.cs b/old/libsl1550/libsecondlife/libsecondlife.Tests/NetworkTests.cs
deleted file mode 100644
index e1bb00d..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Tests/NetworkTests.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Net;
-using libsecondlife;
-using libsecondlife.Packets;
-using libsecondlife.Utilities;
-using NUnit.Framework;
-
-namespace libsecondlife.Tests
-{
-    [TestFixture]
-    public class NetworkTests : Assert
-    {
-        SecondLife Client;
-
-        ulong CurrentRegionHandle = 0;
-        ulong AhernRegionHandle = 1096213093149184;
-        ulong MorrisRegionHandle = 1096213093149183;
-        bool DetectedObject = false;
-
-        LLUUID LookupKey1 = new LLUUID("25472683cb324516904a6cd0ecabf128");
-        //string LookupName1 = "Bot Ringo";
-
-        public NetworkTests()
-        {
-            Client = new SecondLife();
-
-            // Register callbacks
-            Client.Network.RegisterCallback(PacketType.ObjectUpdate, new NetworkManager.PacketCallback(ObjectUpdateHandler));
-            //Client.Self.OnTeleport += new MainAvatar.TeleportCallback(OnTeleportHandler);
-
-            // Connect to the grid
-            string startLoc = NetworkManager.StartLocation("Ahern", 128, 128, 32);
-            Client.Network.Login("Testing", "Anvil", "testinganvil", "Unit Test Framework", startLoc,
-                "contact@libsecondlife.org");
-        }
-
-        ~NetworkTests()
-        {
-            Client.Network.Logout();
-        }
-
-        [SetUp]
-        public void Init()
-        {
-            Assert.IsTrue(Client.Network.Connected, "Client is not connected to the grid");
-
-            int start = Environment.TickCount;
-
-            Assert.AreEqual("ahern", Client.Network.CurrentSim.Name.ToLower(), "Logged in to sim " +
-                Client.Network.CurrentSim.Name + " instead of Ahern");
-        }
-
-        [Test]
-        public void DetectObjects()
-        {
-            int start = Environment.TickCount;
-            while (!DetectedObject)
-            {
-                if (Environment.TickCount - start > 10000)
-                {
-                    Assert.Fail("Timeout waiting for an ObjectUpdate packet");
-                }
-            }
-        }
-
-        [Test]
-        public void U64Receive()
-        {
-            int start = Environment.TickCount;
-            while (CurrentRegionHandle == 0)
-            {
-                if (Environment.TickCount - start > 10000)
-                {
-                    Assert.Fail("Timeout waiting for an ObjectUpdate packet");
-                }
-            }
-
-            Assert.IsTrue(CurrentRegionHandle == AhernRegionHandle, "Current region is " +
-                CurrentRegionHandle + " when we were expecting " + AhernRegionHandle + ", possible endian issue");
-        }
-
-        [Test]
-        public void Teleport()
-        {
-            Assert.IsTrue(Client.Self.Teleport(MorrisRegionHandle, new LLVector3(128, 128, 32)),
-                "Teleport to Morris failed");
-
-            // Assert that we really did make it to our scheduled destination
-            Assert.AreEqual("morris", Client.Network.CurrentSim.Name.ToLower(),
-                "Expected to teleport to Morris, ended up in " + Client.Network.CurrentSim.Name +
-                ". Possibly region full or offline?");
-
-            ///////////////////////////////////////////////////////////////////
-            // TODO: Add a local region teleport
-            ///////////////////////////////////////////////////////////////////
-
-            Assert.IsTrue(Client.Self.Teleport(AhernRegionHandle, new LLVector3(128, 128, 32)),
-                "Teleport to Ahern failed");
-
-            // Assert that we really did make it to our scheduled destination
-            Assert.AreEqual("ahern", Client.Network.CurrentSim.Name.ToLower(),
-                "Expected to teleport to Ahern, ended up in " + Client.Network.CurrentSim.Name +
-                ". Possibly region full or offline?");
-        }
-
-        private void ObjectUpdateHandler(Packet packet, Simulator sim)
-        {
-            ObjectUpdatePacket update = (ObjectUpdatePacket)packet;
-
-            DetectedObject = true;
-            CurrentRegionHandle = update.RegionData.RegionHandle;
-        }
-
-        [TearDown]
-        public void Shutdown()
-        {
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Tests/PacketTests.cs b/old/libsl1550/libsecondlife/libsecondlife.Tests/PacketTests.cs
deleted file mode 100644
index 84b74a9..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Tests/PacketTests.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using System;
-using System.Collections.Generic;
-using libsecondlife;
-using libsecondlife.Packets;
-using NUnit.Framework;
-
-namespace libsecondlife.Tests
-{
-    [TestFixture]
-    public class PacketTests : Assert
-    {
-        [Test]
-        public void HeaderFlags()
-        {
-            TestMessagePacket packet = new TestMessagePacket();
-
-            packet.Header.AppendedAcks = false;
-            packet.Header.Reliable = false;
-            packet.Header.Resent = false;
-            packet.Header.Zerocoded = false;
-
-            Assert.IsFalse(packet.Header.AppendedAcks, "AppendedAcks: Failed to initially set the flag to false");
-            Assert.IsFalse(packet.Header.Reliable, "Reliable: Failed to initially set the flag to false");
-            Assert.IsFalse(packet.Header.Resent, "Resent: Failed to initially set the flag to false");
-            Assert.IsFalse(packet.Header.Zerocoded, "Zerocoded: Failed to initially set the flag to false");
-
-            packet.Header.AppendedAcks = false;
-            packet.Header.Reliable = false;
-            packet.Header.Resent = false;
-            packet.Header.Zerocoded = false;
-
-            Assert.IsFalse(packet.Header.AppendedAcks, "AppendedAcks: Failed to set the flag to false a second time");
-            Assert.IsFalse(packet.Header.Reliable, "Reliable: Failed to set the flag to false a second time");
-            Assert.IsFalse(packet.Header.Resent, "Resent: Failed to set the flag to false a second time");
-            Assert.IsFalse(packet.Header.Zerocoded, "Zerocoded: Failed to set the flag to false a second time");
-
-            packet.Header.AppendedAcks = true;
-            packet.Header.Reliable = true;
-            packet.Header.Resent = true;
-            packet.Header.Zerocoded = true;
-
-            Assert.IsTrue(packet.Header.AppendedAcks, "AppendedAcks: Failed to set the flag to true");
-            Assert.IsTrue(packet.Header.Reliable, "Reliable: Failed to set the flag to true");
-            Assert.IsTrue(packet.Header.Resent, "Resent: Failed to set the flag to true");
-            Assert.IsTrue(packet.Header.Zerocoded, "Zerocoded: Failed to set the flag to true");
-
-            packet.Header.AppendedAcks = true;
-            packet.Header.Reliable = true;
-            packet.Header.Resent = true;
-            packet.Header.Zerocoded = true;
-
-            Assert.IsTrue(packet.Header.AppendedAcks, "AppendedAcks: Failed to set the flag to true a second time");
-            Assert.IsTrue(packet.Header.Reliable, "Reliable: Failed to set the flag to true a second time");
-            Assert.IsTrue(packet.Header.Resent, "Resent: Failed to set the flag to true a second time");
-            Assert.IsTrue(packet.Header.Zerocoded, "Zerocoded: Failed to set the flag to true a second time");
-
-            packet.Header.AppendedAcks = false;
-            packet.Header.Reliable = false;
-            packet.Header.Resent = false;
-            packet.Header.Zerocoded = false;
-
-            Assert.IsFalse(packet.Header.AppendedAcks, "AppendedAcks: Failed to set the flag back to false");
-            Assert.IsFalse(packet.Header.Reliable, "Reliable: Failed to set the flag back to false");
-            Assert.IsFalse(packet.Header.Resent, "Resent: Failed to set the flag back to false");
-            Assert.IsFalse(packet.Header.Zerocoded, "Zerocoded: Failed to set the flag back to false");
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Tests/PrimObjectTests.cs b/old/libsl1550/libsecondlife/libsecondlife.Tests/PrimObjectTests.cs
deleted file mode 100644
index 1c8c12c..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Tests/PrimObjectTests.cs
+++ /dev/null
@@ -1,196 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Net;
-using libsecondlife;
-using libsecondlife.Packets;
-using NUnit.Framework;
-
-namespace libsecondlife.Tests
-{
-    [TestFixture]
-    public class PrimObjectTests : Assert
-    {
-        [Test]
-        public void PathBegin()
-        {
-            for (byte i = 0; i < byte.MaxValue; i++)
-            {
-                float floatValue = LLObject.PathBeginFloat(i);
-                ushort result = LLObject.PathBeginUInt16(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void PathEnd()
-        {
-            for (byte i = 0; i < byte.MaxValue; i++)
-            {
-                float floatValue = LLObject.PathEndFloat(i);
-                ushort result = LLObject.PathEndUInt16(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void PathRadiusOffset()
-        {
-            for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
-            {
-                float floatValue = LLObject.PathRadiusOffsetFloat(i);
-                sbyte result = LLObject.PathRadiusOffsetByte(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void PathRevolutions()
-        {
-            for (byte i = 0; i < byte.MaxValue; i++)
-            {
-                float floatValue = LLObject.PathRevolutionsFloat(i);
-                byte result = LLObject.PathRevolutionsByte(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void PathScale()
-        {
-            for (byte i = 0; i < byte.MaxValue; i++)
-            {
-                float floatValue = LLObject.PathScaleFloat(i);
-                byte result = LLObject.PathScaleByte(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void PathShear()
-        {
-            for (byte i = 0; i < byte.MaxValue; i++)
-            {
-                float floatValue = LLObject.PathShearFloat(i);
-                byte result = LLObject.PathShearByte(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void PathSkew()
-        {
-            for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
-            {
-                float floatValue = LLObject.PathSkewFloat(i);
-                sbyte result = LLObject.PathSkewByte(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void PathTaper()
-        {
-            for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
-            {
-                float floatValue = LLObject.PathTaperFloat(i);
-                sbyte result = LLObject.PathTaperByte(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void ProfileBegin()
-        {
-            for (byte i = 0; i < byte.MaxValue; i++)
-            {
-                float floatValue = LLObject.ProfileBeginFloat(i);
-                ushort result = LLObject.ProfileBeginUInt16(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void ProfileEnd()
-        {
-            for (byte i = 0; i < byte.MaxValue; i++)
-            {
-                float floatValue = LLObject.ProfileEndFloat(i);
-                ushort result = LLObject.ProfileEndUInt16(floatValue);
-
-                Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
-                ", and ended up with " + result);
-            }
-        }
-
-        [Test]
-        public void TextureEntryOffsets()
-        {
-            for (float i = -1.0f; i <= 1.0f; i += 0.001f)
-            {
-                i = (float)Math.Round(i, 3);
-
-                short offset = Helpers.TEOffsetShort(i);
-                float foffset = Helpers.TEOffsetFloat(BitConverter.GetBytes(offset), 0);
-                foffset = (float)Math.Round(foffset, 3);
-
-                Assert.IsTrue(foffset - i < Single.Epsilon, foffset + " is not equal to " + i);
-            }
-        }
-
-        //[Test]
-        //public void TextureEntryRotations()
-        //{
-        //    ;
-        //}
-
-        [Test]
-        public void TextureEntry()
-        {
-            LLObject.TextureEntry te = new LLObject.TextureEntry(LLUUID.Random());
-            LLObject.TextureEntryFace face = te.CreateFace(0);
-            face.Bump = Bumpiness.Concrete;
-            face.Fullbright = true;
-            face.MediaFlags = true;
-            face.OffsetU = 0.5f;
-            face.OffsetV = -0.5f;
-            face.RepeatU = 3.0f;
-            face.RepeatV = 4.0f;
-            face.RGBA = new LLColor(0f, 0.25f, 0.75f, 1f);
-            face.Rotation = 1.5f;
-            face.Shiny = Shininess.Medium;
-            face.TexMapType = MappingType.Planar;
-            face.TextureID = LLUUID.Random();
-
-            byte[] teBytes = te.ToBytes();
-
-            LLObject.TextureEntry te2 = new LLObject.TextureEntry(teBytes, 0, teBytes.Length);
-
-            byte[] teBytes2 = te2.ToBytes();
-
-            Assert.IsTrue(teBytes.Length == teBytes2.Length);
-
-            for (int i = 0; i < teBytes.Length; i++)
-            {
-                Assert.IsTrue(teBytes[i] == teBytes2[i], "Byte " + i + " is not equal");
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Tests/TypeTests.cs b/old/libsl1550/libsecondlife/libsecondlife.Tests/TypeTests.cs
deleted file mode 100644
index e721fe9..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Tests/TypeTests.cs
+++ /dev/null
@@ -1,211 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using libsecondlife;
-using libsecondlife.Packets;
-using libsecondlife.StructuredData;
-using NUnit.Framework;
-
-namespace libsecondlife.Tests
-{
-    [TestFixture]
-    public class TypeTests : Assert
-    {
-        [Test]
-        public void LLUUIDs()
-        {
-            // Creation
-            LLUUID a = new LLUUID();
-            byte[] bytes = a.GetBytes();
-            for (int i = 0; i < 16; i++)
-                Assert.IsTrue(bytes[i] == 0x00);
-
-            // Comparison
-            a = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
-                0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0xFF, 0xFF }, 0);
-            LLUUID b = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
-                0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);
-
-            Assert.IsTrue(a == b, "LLUUID comparison operator failed, " + a.ToString() + " should equal " +
-                b.ToString());
-
-            // From string
-            a = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
-                0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);
-            string zeroonetwo = "00010203-0405-0607-0809-0a0b0c0d0e0f";
-            b = new LLUUID(zeroonetwo);
-
-            Assert.IsTrue(a == b, "LLUUID hyphenated string constructor failed, should have " + a.ToString() +
-                " but we got " + b.ToString());
-
-            // ToString()
-            string one = a.ToString();
-            string two = b.ToString();
-            Assert.IsTrue(a == b);
-            one = a.ToString();
-            two = b.ToString();
-            Assert.IsTrue(a == b);
-            Assert.IsTrue(a == zeroonetwo);
-
-            // TODO: CRC test
-        }
-
-        [Test]
-        public void Quaternions()
-        {
-            LLQuaternion a = new LLQuaternion(1, 0, 0, 0);
-            LLQuaternion b = new LLQuaternion(1, 0, 0, 0);
-
-            Assert.IsTrue(a == b, "LLQuaternion comparison operator failed");
-
-            LLQuaternion expected = new LLQuaternion(0, 0, 0, -1);
-            LLQuaternion result = a * b;
-
-            Assert.IsTrue(result == expected, a.ToString() + " * " + b.ToString() + " produced " + result.ToString() +
-                " instead of " + expected.ToString());
-
-            a = new LLQuaternion(1, 0, 0, 0);
-            b = new LLQuaternion(0, 1, 0, 0);
-            expected = new LLQuaternion(0, 0, 1, 0);
-            result = a * b;
-
-            Assert.IsTrue(result == expected, a.ToString() + " * " + b.ToString() + " produced " + result.ToString() +
-                " instead of " + expected.ToString());
-
-            a = new LLQuaternion(0, 0, 1, 0);
-            b = new LLQuaternion(0, 1, 0, 0);
-            expected = new LLQuaternion(-1, 0, 0, 0);
-            result = a * b;
-
-            Assert.IsTrue(result == expected, a.ToString() + " * " + b.ToString() + " produced " + result.ToString() +
-                " instead of " + expected.ToString());
-        }
-
-        [Test]
-        public void VectorQuaternionMath()
-        {
-            ;
-        }
-
-        [Test]
-        public void FloatsToTerseStrings()
-        {
-            float f = 1.20f;
-            string a = String.Empty;
-            string b = "1.2";
-
-            a = Helpers.FloatToTerseString(f);
-            Assert.IsTrue(a == b, f.ToString() + " converted to " + a + ", expecting " + b);
-
-            f = 24.00f;
-            b = "24";
-
-            a = Helpers.FloatToTerseString(f);
-            Assert.IsTrue(a == b, f.ToString() + " converted to " + a + ", expecting " + b);
-
-            f = -0.59f;
-            b = "-.59";
-
-            a = Helpers.FloatToTerseString(f);
-            Assert.IsTrue(a == b, f.ToString() + " converted to " + a + ", expecting " + b);
-
-            f = 0.59f;
-            b = ".59";
-
-            a = Helpers.FloatToTerseString(f);
-            Assert.IsTrue(a == b, f.ToString() + " converted to " + a + ", expecting " + b);
-        }
-
-        [Test]
-        public void BitUnpacking()
-        {
-            byte[] data = new byte[] { 0x80, 0x00, 0x0F, 0x50, 0x83, 0x7D };
-            BitPack bitpacker = new BitPack(data, 0);
-
-            int b = bitpacker.UnpackBits(1);
-            Assert.IsTrue(b == 1, "Unpacked " + b + " instead of 1");
-
-            b = bitpacker.UnpackBits(1);
-            Assert.IsTrue(b == 0, "Unpacked " + b + " instead of 0");
-
-            bitpacker = new BitPack(data, 2);
-
-            b = bitpacker.UnpackBits(4);
-            Assert.IsTrue(b == 0, "Unpacked " + b + " instead of 0");
-
-            b = bitpacker.UnpackBits(8);
-            Assert.IsTrue(b == 0xF5, "Unpacked " + b + " instead of 0xF5");
-
-            b = bitpacker.UnpackBits(4);
-            Assert.IsTrue(b == 0, "Unpacked " + b + " instead of 0");
-
-            b = bitpacker.UnpackBits(10);
-            Assert.IsTrue(b == 0x0183, "Unpacked " + b + " instead of 0x0183");
-        }
-
-        [Test]
-        public void BitPacking()
-        {
-            byte[] packedBytes = new byte[12];
-            BitPack bitpacker = new BitPack(packedBytes, 0);
-
-            bitpacker.PackBits(0x0ABBCCDD, 32);
-            bitpacker.PackBits(25, 5);
-            bitpacker.PackFloat(123.321f);
-            bitpacker.PackBits(1000, 16);
-
-            bitpacker = new BitPack(packedBytes, 0);
-
-            int b = bitpacker.UnpackBits(32);
-            Assert.IsTrue(b == 0x0ABBCCDD, "Unpacked " + b + " instead of 2864434397");
-
-            b = bitpacker.UnpackBits(5);
-            Assert.IsTrue(b == 25, "Unpacked " + b + " instead of 25");
-
-            float f = bitpacker.UnpackFloat();
-            Assert.IsTrue(f == 123.321f, "Unpacked " + f + " instead of 123.321");
-
-            b = bitpacker.UnpackBits(16);
-            Assert.IsTrue(b == 1000, "Unpacked " + b + " instead of 1000");
-        }
-
-        [Test]
-        public void LLSDTerseParsing()
-        {
-            string testOne = "[r0.99967899999999998428,r-0.025334599999999998787,r0]";
-            string testTwo = "[[r1,r1,r1],r0]";
-            string testThree = "{'region_handle':[r255232, r256512], 'position':[r33.6, r33.71, r43.13], 'look_at':[r34.6, r33.71, r43.13]}";
-
-            LLSD obj = LLSDParser.DeserializeNotation(testOne);
-            Assert.IsInstanceOfType(typeof(LLSDArray), obj, "Expected LLSDArray, got " + obj.GetType().ToString());
-            LLSDArray array = (LLSDArray)obj;
-            Assert.IsTrue(array.Count == 3, "Expected three contained objects, got " + array.Count);
-            Assert.IsTrue(array[0].AsReal() > 0.9d && array[0].AsReal() < 1.0d, "Unexpected value for first real " + array[0].AsReal());
-            Assert.IsTrue(array[1].AsReal() < 0.0d && array[1].AsReal() > -0.03d, "Unexpected value for second real " + array[1].AsReal());
-            Assert.IsTrue(array[2].AsReal() == 0.0d, "Unexpected value for third real " + array[2].AsReal());
-
-            obj = LLSDParser.DeserializeNotation(testTwo);
-            Assert.IsInstanceOfType(typeof(LLSDArray), obj, "Expected LLSDArray, got " + obj.GetType().ToString());
-            array = (LLSDArray)obj;
-            Assert.IsTrue(array.Count == 2, "Expected two contained objects, got " + array.Count);
-            Assert.IsTrue(array[1].AsReal() == 0.0d, "Unexpected value for real " + array[1].AsReal());
-            obj = array[0];
-            Assert.IsInstanceOfType(typeof(LLSDArray), obj, "Expected ArrayList, got " + obj.GetType().ToString());
-            array = (LLSDArray)obj;
-            Assert.IsTrue(array[0].AsReal() == 1.0d && array[1].AsReal() == 1.0d && array[2].AsReal() == 1.0d,
-                "Unexpected value(s) for nested array: " + array[0].AsReal() + ", " + array[1].AsReal() + ", " +
-                array[2].AsReal());
-
-            obj = LLSDParser.DeserializeNotation(testThree);
-            Assert.IsInstanceOfType(typeof(LLSDMap), obj, "Expected LLSDMap, got " + obj.GetType().ToString());
-            LLSDMap hashtable = (LLSDMap)obj;
-            Assert.IsTrue(hashtable.Count == 3, "Expected three contained objects, got " + hashtable.Count);
-            Assert.IsInstanceOfType(typeof(LLSDArray), hashtable["region_handle"]);
-            Assert.IsTrue(((LLSDArray)hashtable["region_handle"]).Count == 2);
-            Assert.IsInstanceOfType(typeof(LLSDArray), hashtable["position"]);
-            Assert.IsTrue(((LLSDArray)hashtable["position"]).Count == 3);
-            Assert.IsInstanceOfType(typeof(LLSDArray), hashtable["look_at"]);
-            Assert.IsTrue(((LLSDArray)hashtable["look_at"]).Count == 3);
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Tests/XmlLLSDTests.cs b/old/libsl1550/libsecondlife/libsecondlife.Tests/XmlLLSDTests.cs
deleted file mode 100644
index 348a133..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Tests/XmlLLSDTests.cs
+++ /dev/null
@@ -1,590 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using NUnit.Framework;
-using System.Collections;
-using libsecondlife.StructuredData;
-
-namespace libsecondlife.Tests
-{
-    /// <summary>
-    /// XmlLLSDTests is a suite of tests for libsl implementation of the LLSD XML format.
-    ///
-    /// </summary>
-    [TestFixture]
-    public class XmlLLSDTests
-    {
-        /// <summary>
-        /// Test that the sample LLSD supplied by Linden Lab is properly deserialized.
-        /// The LLSD string in the test is a pared down version of the sample on the blog.
-        /// http://wiki.secondlife.com/wiki/LLSD
-        /// </summary>
-        [Test]
-        public void DeserializeLLSDSample()
-        {
-            LLSD theLLSD = null;
-            LLSDMap map = null;
-            LLSD tempLLSD = null;
-            LLSDUUID tempUUID = null;
-            LLSDString tempStr = null;
-            LLSDReal tempReal = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <map>
-	                <key>region_id</key>
-	                <uuid>67153d5b-3659-afb4-8510-adda2c034649</uuid>
-	                <key>scale</key>
-	                <string>one minute</string>
-	                <key>simulator statistics</key>
-	                <map>
-		                <key>time dilation</key>
-		                <real>0.9878624</real>
-		                <key>sim fps</key>
-		                <real>44.38898</real>
-		                <key>agent updates per second</key>
-		                <real>nan</real>
-		                <key>total task count</key>
-		                <real>4</real>
-		                <key>active task count</key>
-		                <real>0</real>
-		                <key>pending uploads</key>
-		                <real>0.0001096525</real>
-	                </map>
-                </map>
-            </llsd>";
-
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            //Confirm the contents
-            Assert.IsNotNull(theLLSD);
-            Assert.IsTrue(theLLSD is LLSDMap);
-            Assert.IsTrue(theLLSD.Type == LLSDType.Map);
-            map = (LLSDMap)theLLSD;
-
-            tempLLSD = map["region_id"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDUUID);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.UUID);
-            tempUUID = (LLSDUUID)tempLLSD;
-            Assert.AreEqual(new LLUUID("67153d5b-3659-afb4-8510-adda2c034649"), tempUUID.AsUUID());
-
-            tempLLSD = map["scale"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDString);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.String);
-            tempStr = (LLSDString)tempLLSD;
-            Assert.AreEqual("one minute", tempStr.AsString());
-
-            tempLLSD = map["simulator statistics"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDMap);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.Map);
-            map = (LLSDMap)tempLLSD;
-
-            tempLLSD = map["time dilation"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDReal);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
-            tempReal = (LLSDReal)tempLLSD;
-
-            Assert.AreEqual(0.9878624d, tempReal.AsReal());
-            //TODO - figure out any relevant rounding variability for 64 bit reals
-            tempLLSD = map["sim fps"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDReal);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
-            tempReal = (LLSDReal)tempLLSD;
-            Assert.AreEqual(44.38898d, tempReal.AsReal());
-
-            tempLLSD = map["agent updates per second"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDReal);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
-            tempReal = (LLSDReal)tempLLSD;
-            Assert.AreEqual(Double.NaN, tempLLSD.AsReal());
-
-            tempLLSD = map["total task count"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDReal);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
-            tempReal = (LLSDReal)tempLLSD;
-            Assert.AreEqual(4.0d, tempReal.AsReal());
-
-            tempLLSD = map["active task count"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDReal);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
-            tempReal = (LLSDReal)tempLLSD;
-            Assert.AreEqual(0.0d, tempReal.AsReal());
-
-            tempLLSD = map["pending uploads"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.IsTrue(tempLLSD is LLSDReal);
-            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
-            tempReal = (LLSDReal)tempLLSD;
-            Assert.AreEqual(0.0001096525d, tempReal.AsReal());
-
-        }
-
-        /// <summary>
-        /// Test that various Real representations are parsed correctly.
-        /// </summary>
-        [Test]
-        public void DeserializeReals()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDReal tempReal = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <real>44.38898</real>
-		            <real>nan</real>
-		            <real>4</real>
-                    <real>-13.333</real>
-                    <real/>
-                </array>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-
-            Assert.AreEqual(LLSDType.Real, array[0].Type);
-            tempReal = (LLSDReal)array[0];
-            Assert.AreEqual(44.38898d, tempReal.AsReal());
-
-            Assert.AreEqual(LLSDType.Real, array[1].Type);
-            tempReal = (LLSDReal)array[1];
-            Assert.AreEqual(Double.NaN, tempReal.AsReal());
-
-            Assert.AreEqual(LLSDType.Real, array[2].Type);
-            tempReal = (LLSDReal)array[2];
-            Assert.AreEqual(4.0d, tempReal.AsReal());
-
-            Assert.AreEqual(LLSDType.Real, array[3].Type);
-            tempReal = (LLSDReal)array[3];
-            Assert.AreEqual(-13.333d, tempReal.AsReal());
-
-            Assert.AreEqual(LLSDType.Real, array[4].Type);
-            tempReal = (LLSDReal)array[4];
-            Assert.AreEqual(0d, tempReal.AsReal());
-        }
-
-        /// <summary>
-        /// Test that various String representations are parsed correctly.
-        /// </summary>
-        [Test]
-        public void DeserializeStrings()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDString tempStr = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <string>Kissling</string>
-                    <string>Attack ships on fire off the shoulder of Orion</string>
-                    <string>&lt; &gt; &amp; &apos; &quot;</string>
-                    <string/>
-                </array>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-
-            Assert.AreEqual(LLSDType.String, array[0].Type);
-            tempStr = (LLSDString)array[0];
-            Assert.AreEqual("Kissling", tempStr.AsString());
-
-            Assert.AreEqual(LLSDType.String, array[1].Type);
-            tempStr = (LLSDString)array[1];
-            Assert.AreEqual("Attack ships on fire off the shoulder of Orion", tempStr.AsString());
-
-            Assert.AreEqual(LLSDType.String, array[2].Type);
-            tempStr = (LLSDString)array[2];
-            Assert.AreEqual("< > & \' \"", tempStr.AsString());
-
-            Assert.AreEqual(LLSDType.String, array[3].Type);
-            tempStr = (LLSDString)array[3];
-            Assert.AreEqual("", tempStr.AsString());
-
-        }
-
-        /// <summary>
-        /// Test that various Integer representations are parsed correctly.
-        /// These tests currently only test for values within the range of a
-        /// 32 bit signed integer, even though the LLSD specification says
-        /// the type is a 64 bit signed integer, because LLSInteger is currently
-        /// implemented using int, a.k.a. Int32.  Not testing Int64 range until
-        /// it's understood if there was a design reason for the Int32.
-        /// </summary>
-        [Test]
-        public void DeserializeIntegers()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDInteger tempInt = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <integer>2147483647</integer>
-		            <integer>-2147483648</integer>
-		            <integer>0</integer>
-                    <integer>013</integer>
-                    <integer/>
-                </array>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-
-            Assert.AreEqual(LLSDType.Integer, array[0].Type);
-            tempInt = (LLSDInteger)array[0];
-            Assert.AreEqual(2147483647, tempInt.AsInteger());
-
-            Assert.AreEqual(LLSDType.Integer, array[1].Type);
-            tempInt = (LLSDInteger)array[1];
-            Assert.AreEqual(-2147483648, tempInt.AsInteger());
-
-            Assert.AreEqual(LLSDType.Integer, array[2].Type);
-            tempInt = (LLSDInteger)array[2];
-            Assert.AreEqual(0, tempInt.AsInteger());
-
-            Assert.AreEqual(LLSDType.Integer, array[3].Type);
-            tempInt = (LLSDInteger)array[3];
-            Assert.AreEqual(13, tempInt.AsInteger());
-
-            Assert.AreEqual(LLSDType.Integer, array[4].Type);
-            tempInt = (LLSDInteger)array[4];
-            Assert.AreEqual(0, tempInt.AsInteger());
-        }
-
-        /// <summary>
-        /// Test that various UUID representations are parsed correctly.
-        /// </summary>
-        [Test]
-        public void DeserializeUUID()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDUUID tempUUID = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <uuid>d7f4aeca-88f1-42a1-b385-b9db18abb255</uuid>
-                    <uuid/>
-                </array>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-
-            Assert.AreEqual(LLSDType.UUID, array[0].Type);
-            tempUUID = (LLSDUUID)array[0];
-            Assert.AreEqual(new LLUUID("d7f4aeca-88f1-42a1-b385-b9db18abb255"), tempUUID.AsUUID());
-
-            Assert.AreEqual(LLSDType.UUID, array[1].Type);
-            tempUUID = (LLSDUUID)array[1];
-            Assert.AreEqual(LLUUID.Zero, tempUUID.AsUUID());
-        }
-
-        /// <summary>
-        /// Test that various date representations are parsed correctly.
-        /// </summary>
-        [Test]
-        public void DeserializeDates()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDDate tempDate = null;
-            DateTime testDate;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <date>2006-02-01T14:29:53Z</date>
-                    <date>1999-01-01T00:00:00Z</date>
-                    <date/>
-                </array>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-
-            Assert.AreEqual(LLSDType.Date, array[0].Type);
-            tempDate = (LLSDDate)array[0];
-            DateTime.TryParse("2006-02-01T14:29:53Z", out testDate);
-            Assert.AreEqual(testDate, tempDate.AsDate());
-
-            Assert.AreEqual(LLSDType.Date, array[1].Type);
-            tempDate = (LLSDDate)array[1];
-            DateTime.TryParse("1999-01-01T00:00:00Z", out testDate);
-            Assert.AreEqual(testDate, tempDate.AsDate());
-
-            Assert.AreEqual(LLSDType.Date, array[2].Type);
-            tempDate = (LLSDDate)array[2];
-            Assert.AreEqual(Helpers.Epoch, tempDate.AsDate());
-        }
-
-        /// <summary>
-        /// Test that various Boolean representations are parsed correctly.
-        /// </summary>
-        [Test]
-        public void DeserializeBoolean()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDBoolean tempBool = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <boolean>1</boolean>
-                    <boolean>true</boolean>
-                    <boolean>0</boolean>
-                    <boolean>false</boolean>
-                    <boolean/>
-                </array>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-
-            Assert.AreEqual(LLSDType.Boolean, array[0].Type);
-            tempBool = (LLSDBoolean)array[0];
-            Assert.AreEqual(true, tempBool.AsBoolean());
-
-            Assert.AreEqual(LLSDType.Boolean, array[1].Type);
-            tempBool = (LLSDBoolean)array[1];
-            Assert.AreEqual(true, tempBool.AsBoolean());
-
-            Assert.AreEqual(LLSDType.Boolean, array[2].Type);
-            tempBool = (LLSDBoolean)array[2];
-            Assert.AreEqual(false, tempBool.AsBoolean());
-
-            Assert.AreEqual(LLSDType.Boolean, array[3].Type);
-            tempBool = (LLSDBoolean)array[3];
-            Assert.AreEqual(false, tempBool.AsBoolean());
-
-            Assert.AreEqual(LLSDType.Boolean, array[4].Type);
-            tempBool = (LLSDBoolean)array[4];
-            Assert.AreEqual(false, tempBool.AsBoolean());
-        }
-
-        /// <summary>
-        /// Test that binary elements are parsed correctly.
-        /// </summary>
-        [Test]
-        public void DeserializeBinary()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDBinary tempBinary = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <binary encoding='base64'>cmFuZG9t</binary>
-                    <binary>dGhlIHF1aWNrIGJyb3duIGZveA==</binary>
-                    <binary/>
-                </array>
-            </llsd>";
-
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-
-            Assert.AreEqual(LLSDType.Binary, array[0].Type);
-            tempBinary = (LLSDBinary)array[0];
-            byte[] testData1 = {114, 97, 110, 100, 111, 109};
-            TestBinary(tempBinary, testData1);
-
-            Assert.AreEqual(LLSDType.Binary, array[1].Type);
-            tempBinary = (LLSDBinary)array[1];
-            byte[] testData2 = {116, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98,
-                                114, 111, 119, 110, 32, 102, 111, 120};
-            TestBinary(tempBinary, testData2);
-
-            Assert.AreEqual(LLSDType.Binary, array[1].Type);
-            tempBinary = (LLSDBinary)array[2];
-            Assert.AreEqual(0, tempBinary.AsBinary().Length);
-        }
-
-        /// <summary>
-        /// Asserts that the contents of the LLSDBinary match the values and length
-        /// of the supplied byte array
-        /// </summary>
-        /// <param name="inBinary"></param>
-        /// <param name="inExpected"></param>
-        private void TestBinary(LLSDBinary inBinary, byte[] inExpected)
-        {
-            byte[] binary = inBinary.AsBinary();
-            Assert.AreEqual(inExpected.Length, binary.Length);
-            for (int i = 0; i < inExpected.Length; i++)
-            {
-                if (inExpected[i] != binary[i])
-                {
-                    Assert.Fail("Expected " + inExpected[i].ToString() + " at position " + i.ToString() +
-                        " but saw " + binary[i].ToString());
-                }
-            }
-        }
-
-        /// <summary>
-        /// Test that undefened elements are parsed correctly.
-        /// Currently this just checks that there is no error since undefined has no
-        /// value and there is no LLSD child class for Undefined elements - the
-        /// current implementation generates an instance of LLSD
-        /// </summary>
-        [Test]
-        public void DeserializeUndef()
-        {
-            LLSD theLLSD = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <undef/>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSD);
-        }
-
-        /// <summary>
-        /// Test that various URI representations are parsed correctly.
-        /// </summary>
-        [Test]
-        public void DeserializeURI()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDURI tempURI = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <uri>http://sim956.agni.lindenlab.com:12035/runtime/agents</uri>
-                    <uri/>
-                </array>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-
-            Assert.AreEqual(LLSDType.URI, array[0].Type);
-            tempURI = (LLSDURI)array[0];
-            Uri testURI = new Uri(@"http://sim956.agni.lindenlab.com:12035/runtime/agents");
-            Assert.AreEqual(testURI, tempURI.AsUri());
-
-            Assert.AreEqual(LLSDType.URI, array[1].Type);
-            tempURI = (LLSDURI)array[1];
-            Assert.AreEqual("", tempURI.AsUri().ToString());
-        }
-
-        /// <summary>
-        /// Test some nested containers.  This is not a very deep or complicated LLSD graph
-        /// but it should reveal basic nesting issues.
-        /// </summary>
-        [Test]
-        public void DeserializeNestedContainers()
-        {
-            LLSD theLLSD = null;
-            LLSDArray array = null;
-            LLSDMap map = null;
-            LLSD tempLLSD = null;
-
-            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
-            <llsd>
-                <array>
-                    <map>
-                        <key>Map One</key>
-                        <map>
-                            <key>Array One</key>
-                            <array>
-                                <integer>1</integer>
-                                <integer>2</integer>
-                            </array>
-                        </map>
-                    </map>
-                    <array>
-                        <string>A</string>
-                        <string>B</string>
-                        <array>
-                            <integer>1</integer>
-                            <integer>4</integer>
-                            <integer>9</integer>
-                        </array>
-                    </array>
-                </array>
-            </llsd>";
-            //Deserialize the string
-            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
-            theLLSD = LLSDParser.DeserializeXml(bytes);
-
-            Assert.IsTrue(theLLSD is LLSDArray);
-            array = (LLSDArray)theLLSD;
-            Assert.AreEqual(2, array.Count);
-
-            //The first element of top level array, a map
-            Assert.AreEqual(LLSDType.Map, array[0].Type);
-            map = (LLSDMap)array[0];
-            //First nested map
-            tempLLSD = map["Map One"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.AreEqual(LLSDType.Map, tempLLSD.Type);
-            map = (LLSDMap)tempLLSD;
-            //First nested array
-            tempLLSD = map["Array One"];
-            Assert.IsNotNull(tempLLSD);
-            Assert.AreEqual(LLSDType.Array, tempLLSD.Type);
-            array = (LLSDArray)tempLLSD;
-            Assert.AreEqual(2, array.Count);
-
-            array = (LLSDArray)theLLSD;
-            //Second element of top level array, an array
-            tempLLSD = array[1];
-            Assert.AreEqual(LLSDType.Array, tempLLSD.Type);
-            array = (LLSDArray)tempLLSD;
-            Assert.AreEqual(3, array.Count);
-            //Nested array
-            tempLLSD = array[2];
-            Assert.AreEqual(LLSDType.Array, tempLLSD.Type);
-            array = (LLSDArray)tempLLSD;
-            Assert.AreEqual(3, array.Count);
-        }
-
-    }
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.csproj b/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.csproj
deleted file mode 100644
index 641cece..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.csproj
+++ /dev/null
@@ -1,70 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{E0BCBBAE-A620-431A-9EB7-30173EAF195B}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>libsecondlife.Tests</RootNamespace>
-    <AssemblyName>libsecondlife.Tests</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|.NET 1.1' ">
-    <OutputPath>..\..\bin\</OutputPath>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="nunit.framework, Version=2.4.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>C:\Program Files\NUnit 2.4.3\bin\nunit.framework.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="PacketTests.cs" />
-    <Compile Include="PrimObjectTests.cs" />
-    <Compile Include="TypeTests.cs" />
-    <Compile Include="NetworkTests.cs" />
-    <Compile Include="XmlLLSDTests.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\libsecondlife.Utilities\libsecondlife.Utilities.csproj">
-      <Project>{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}</Project>
-      <Name>libsecondlife.Utilities</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Properties\" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.mdp b/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.mdp
deleted file mode 100644
index ad5de62..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.mdp
+++ /dev/null
@@ -1,33 +0,0 @@
-<Project name="libsecondlife.Tests" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
-  <Configurations active="Debug">
-    <Configuration name="Debug" ctype="DotNetProjectConfiguration">
-      <Output directory="../bin/Debug" assembly="libsecondlife.Tests" />
-      <Build debugmode="True" target="Library" />
-      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
-      <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
-    </Configuration>
-    <Configuration name="Release" ctype="DotNetProjectConfiguration">
-      <Output directory="../bin/Debug" assembly="libsecondlife.Tests" />
-      <Build debugmode="False" target="Library" />
-      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
-      <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
-    </Configuration>
-  </Configurations>
-  <DeployTargets />
-  <Contents>
-    <File name="./NetworkTests.cs" subtype="Code" buildaction="Compile" />
-    <File name="./PacketTests.cs" subtype="Code" buildaction="Compile" />
-    <File name="./PrimObjectTests.cs" subtype="Code" buildaction="Compile" />
-    <File name="./TypeTests.cs" subtype="Code" buildaction="Compile" />
-  </Contents>
-  <References>
-    <ProjectReference type="Project" localcopy="True" refto="libsecondlife" />
-    <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Project" localcopy="True" refto="libsecondlife.Utilities" />
-    <ProjectReference type="Gac" localcopy="True" refto="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
-    <ProjectReference type="Gac" localcopy="True" refto="nunit.core, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
-    <ProjectReference type="Gac" localcopy="True" refto="nunit.util, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  </References>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.sln b/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.sln
deleted file mode 100644
index 46132fb..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Tests/libsecondlife.Tests.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libsecondlife.Tests", "libsecondlife.Tests.csproj", "{E0BCBBAE-A620-431A-9EB7-30173EAF195B}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/Properties/AssemblyInfo.cs b/old/libsl1550/libsecondlife/libsecondlife.Utilities/Properties/AssemblyInfo.cs
deleted file mode 100644
index 32c0a3e..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Utilities/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("libsecondlife.Utilities")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("libsecondlife.Utilities")]
-[assembly: AssemblyCopyright("Copyright ©  2006")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("b77aa07a-daa3-431f-b5aa-0c9c5e2151fd")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/RegistrationApi.cs b/old/libsl1550/libsecondlife/libsecondlife.Utilities/RegistrationApi.cs
deleted file mode 100644
index 3f06c6d..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Utilities/RegistrationApi.cs
+++ /dev/null
@@ -1,327 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Text;
-using libsecondlife.StructuredData;
-using libsecondlife.Capabilities;
-
-namespace libsecondlife
-{
-    public class RegistrationApi
-    {
-        private struct UserInfo
-        {
-            public string FirstName;
-            public string LastName;
-            public string Password;
-        }
-
-        private struct RegistrationCaps
-        {
-            public Uri CreateUser;
-            public Uri CheckName;
-            public Uri GetLastNames;
-            public Uri GetErrorCodes;
-        }
-
-        public struct LastName
-        {
-            public int ID;
-            public string Name;
-        }
-
-        /// <summary>
-        /// see https://secure-web6.secondlife.com/developers/third_party_reg/#service_create_user or
-        /// https://wiki.secondlife.com/wiki/RegAPIDoc for description
-        /// </summary>
-        public class CreateUserParam
-        {
-            public string FirstName;
-            public LastName LastName;
-            public string Email;
-            public string Password;
-            public DateTime Birthdate;
-
-            // optional:
-            public Nullable<int> LimitedToEstate;
-            public string StartRegionName;
-            public Nullable<LLVector3> StartLocation;
-            public Nullable<LLVector3> StartLookAt;
-        }
-
-        private UserInfo _userInfo;
-        private RegistrationCaps _caps;
-        private int _initializing;
-        private List<LastName> _lastNames = new List<LastName>();
-        private Dictionary<int, string> _errors = new Dictionary<int, string>();
-
-        public bool Initializing
-        {
-            get
-            {
-                System.Diagnostics.Debug.Assert(_initializing <= 0);
-                return (_initializing < 0);
-            }
-        }
-
-        public List<LastName> LastNames
-        {
-            get
-            {
-                lock (_lastNames)
-                {
-                    if (_lastNames.Count <= 0)
-                        GatherLastNames();
-                }
-
-                return _lastNames;
-            }
-        }
-
-        public RegistrationApi(string firstName, string lastName, string password)
-        {
-            _initializing = -2;
-
-            _userInfo = new UserInfo();
-
-            _userInfo.FirstName = firstName;
-            _userInfo.LastName = lastName;
-            _userInfo.Password = password;
-
-            GatherCaps();
-        }
-
-        public void WaitForInitialization()
-        {
-            while (Initializing)
-                System.Threading.Thread.Sleep(10);
-        }
-
-        public Uri RegistrationApiCaps
-        {
-            get { return new Uri("https://cap.secondlife.com/get_reg_capabilities"); }
-        }
-
-        private void GatherCaps()
-        {
-            // build post data
-            byte[] postData = Encoding.ASCII.GetBytes(
-                String.Format("first_name={0}&last_name={1}&password={2}", _userInfo.FirstName, _userInfo.LastName,
-                _userInfo.Password));
-
-            CapsClient request = new CapsClient(RegistrationApiCaps);
-            request.OnComplete += new CapsClient.CompleteCallback(GatherCapsResponse);
-            request.StartRequest(postData);
-        }
-
-        private void GatherCapsResponse(CapsClient client, LLSD response, Exception error)
-        {
-            if (response is LLSDMap)
-            {
-                LLSDMap respTable = (LLSDMap)response;
-
-                // parse
-                _caps = new RegistrationCaps();
-
-                _caps.CreateUser = respTable["create_user"].AsUri();
-                _caps.CheckName = respTable["check_name"].AsUri();
-                _caps.GetLastNames = respTable["get_last_names"].AsUri();
-                _caps.GetErrorCodes = respTable["get_error_codes"].AsUri();
-
-                // finalize
-                _initializing++;
-
-                GatherErrorMessages();
-            }
-        }
-
-        private void GatherErrorMessages()
-        {
-            if (_caps.GetErrorCodes == null)
-                throw new InvalidOperationException("access denied");	// this should work even for not-approved users
-
-            CapsClient request = new CapsClient(_caps.GetErrorCodes);
-            request.OnComplete += new CapsClient.CompleteCallback(GatherErrorMessagesResponse);
-            request.StartRequest();
-        }
-
-        private void GatherErrorMessagesResponse(CapsClient client, LLSD response, Exception error)
-        {
-            if (response is LLSDMap)
-            {
-                // parse
-
-                //FIXME: wtf?
-                //foreach (KeyValuePair<string, object> error in (Dictionary<string, object>)response)
-                //{
-                    //StringBuilder sb = new StringBuilder();
-
-                    //sb.Append(error[1]);
-                    //sb.Append(" (");
-                    //sb.Append(error[0]);
-                    //sb.Append("): ");
-                    //sb.Append(error[2]);
-
-                    //_errors.Add((int)error[0], sb.ToString());
-                //}
-
-                // finalize
-                _initializing++;
-            }
-        }
-
-        public void GatherLastNames()
-        {
-            if (Initializing)
-                throw new InvalidOperationException("still initializing");
-
-            if (_caps.GetLastNames == null)
-                throw new InvalidOperationException("access denied: only approved developers have access to the registration api");
-
-            CapsClient request = new CapsClient(_caps.GetLastNames);
-            request.OnComplete += new CapsClient.CompleteCallback(GatherLastNamesResponse);
-            request.StartRequest();
-
-            // FIXME: Block
-        }
-
-        private void GatherLastNamesResponse(CapsClient client, LLSD response, Exception error)
-        {
-            if (response is LLSDMap)
-            {
-                LLSDMap respTable = (LLSDMap)response;
-
-                //FIXME:
-                //_lastNames = new List<LastName>(respTable.Count);
-
-                //for (Dictionary<string, object>.Enumerator it = respTable.GetEnumerator(); it.MoveNext(); )
-                //{
-                //    LastName ln = new LastName();
-
-                //    ln.ID = int.Parse(it.Current.Key.ToString());
-                //    ln.Name = it.Current.Value.ToString();
-
-                //    _lastNames.Add(ln);
-                //}
-
-                //_lastNames.Sort(new Comparison<LastName>(delegate(LastName a, LastName b) { return a.Name.CompareTo(b.Name); }));
-            }
-        }
-
-        public bool CheckName(string firstName, LastName lastName)
-        {
-            if (Initializing)
-                throw new InvalidOperationException("still initializing");
-
-            if (_caps.CheckName == null)
-                throw new InvalidOperationException("access denied; only approved developers have access to the registration api");
-
-            // Create the POST data
-            LLSDMap query = new LLSDMap();
-            query.Add("username", LLSD.FromString(firstName));
-            query.Add("last_name_id", LLSD.FromInteger(lastName.ID));
-            byte[] postData = LLSDParser.SerializeXmlBytes(query);
-
-            CapsClient request = new CapsClient(_caps.CheckName);
-            request.OnComplete += new CapsClient.CompleteCallback(CheckNameResponse);
-            request.StartRequest();
-
-            // FIXME:
-            return false;
-        }
-
-        private void CheckNameResponse(CapsClient client, LLSD response, Exception error)
-        {
-            if (response.Type == LLSDType.Boolean)
-            {
-                // FIXME:
-                //(bool)response;
-            }
-            else
-            {
-                // FIXME:
-            }
-        }
-
-        /// <summary>
-        /// Returns the new user ID or throws an exception containing the error code
-        /// The error codes can be found here: https://wiki.secondlife.com/wiki/RegAPIError
-        /// </summary>
-        /// <param name="user">New user account to create</param>
-        /// <returns>The UUID of the new user account</returns>
-        public LLUUID CreateUser(CreateUserParam user)
-        {
-            if (Initializing)
-                throw new InvalidOperationException("still initializing");
-
-            if (_caps.CreateUser == null)
-                throw new InvalidOperationException("access denied; only approved developers have access to the registration api");
-
-            // Create the POST data
-            LLSDMap query = new LLSDMap();
-            query.Add("username", LLSD.FromString(user.FirstName));
-            query.Add("last_name_id", LLSD.FromInteger(user.LastName.ID));
-            query.Add("email", LLSD.FromString(user.Email));
-            query.Add("password", LLSD.FromString(user.Password));
-            query.Add("dob", LLSD.FromString(user.Birthdate.ToString("yyyy-MM-dd")));
-
-            if (user.LimitedToEstate != null)
-                query.Add("limited_to_estate", LLSD.FromInteger(user.LimitedToEstate.Value));
-
-            if (!string.IsNullOrEmpty(user.StartRegionName))
-                query.Add("start_region_name", LLSD.FromInteger(user.LimitedToEstate.Value));
-
-            if (user.StartLocation != null)
-            {
-                query.Add("start_local_x", LLSD.FromReal(user.StartLocation.Value.X));
-                query.Add("start_local_y", LLSD.FromReal(user.StartLocation.Value.Y));
-                query.Add("start_local_z", LLSD.FromReal(user.StartLocation.Value.Z));
-            }
-
-            if (user.StartLookAt != null)
-            {
-                query.Add("start_look_at_x", LLSD.FromReal(user.StartLookAt.Value.X));
-                query.Add("start_look_at_y", LLSD.FromReal(user.StartLookAt.Value.Y));
-                query.Add("start_look_at_z", LLSD.FromReal(user.StartLookAt.Value.Z));
-            }
-
-            byte[] postData = LLSDParser.SerializeXmlBytes(query);
-
-            // Make the request
-            CapsClient request = new CapsClient(_caps.CreateUser);
-            request.OnComplete += new CapsClient.CompleteCallback(CreateUserResponse);
-            request.StartRequest();
-
-            // FIXME: Block
-            return LLUUID.Zero;
-        }
-
-        private void CreateUserResponse(CapsClient client, LLSD response, Exception error)
-        {
-            if (response is LLSDMap)
-            {
-                // everything is okay
-                // FIXME:
-                //return new LLUUID(((Dictionary<string, object>)response)["agent_id"].ToString());
-            }
-            else
-            {
-                // an error happened
-                LLSDArray al = (LLSDArray)response;
-
-                StringBuilder sb = new StringBuilder();
-
-                foreach (LLSD ec in al)
-                {
-                    if (sb.Length > 0)
-                        sb.Append("; ");
-
-                    sb.Append(_errors[ec.AsInteger()]);
-                }
-
-                // FIXME:
-                //throw new Exception("failed to create user: " + sb.ToString());
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/TCPPipe.cs b/old/libsl1550/libsecondlife/libsecondlife.Utilities/TCPPipe.cs
deleted file mode 100644
index df09262..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Utilities/TCPPipe.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-using System;
-using System.Net;
-using System.Net.Sockets;
-
-public class TCPPipe
-{
-    protected class SocketPacket
-    {
-        public System.Net.Sockets.Socket TCPSocket;
-        public byte[] DataBuffer = new byte[1];
-    }
-
-    public delegate void OnReceiveLineCallback(string line);
-    public delegate void OnDisconnectedCallback(SocketException se);
-
-    public event OnReceiveLineCallback OnReceiveLine;
-    public event OnDisconnectedCallback OnDisconnected;
-
-    protected Socket _TCPSocket;
-    protected IAsyncResult _Result;
-    protected AsyncCallback _Callback;
-    protected string _Buffer = String.Empty;
-
-    public bool Connected
-    {
-        get
-        {
-            if (_TCPSocket != null && _TCPSocket.Connected)
-                return true;
-            else
-                return false;
-        }
-    }
-
-    public TCPPipe()
-    {
-    }
-
-    public SocketException Connect(string address, int port)
-    {
-        if (_TCPSocket != null && _TCPSocket.Connected)
-            Disconnect();
-
-        try
-        {
-            IPAddress ip;
-            if (!IPAddress.TryParse(address, out ip))
-            {
-                IPAddress[] ips = Dns.GetHostAddresses(address);
-                ip = ips[0];
-            }
-            _TCPSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-            IPEndPoint ipEndPoint = new IPEndPoint(ip, port);
-            _TCPSocket.Connect(ipEndPoint);
-            if (_TCPSocket.Connected)
-            {
-                WaitForData();
-                return null;
-            }
-            else
-            {
-                return new SocketException(10000);
-            }
-        }
-        catch (SocketException se)
-        {
-            return se;
-        }
-    }
-
-    public void Disconnect()
-    {
-        _TCPSocket.Disconnect(true);
-    }
-
-    public void SendData(byte[] data)
-    {
-        if (Connected)
-            _TCPSocket.Send(data);
-        else
-            throw new InvalidOperationException("socket is not connected");
-    }
-
-    public void SendLine(string message)
-    {
-        if (Connected)
-        {
-            byte[] byData = System.Text.Encoding.ASCII.GetBytes(message + "\n");
-            _TCPSocket.Send(byData);
-        }
-        else
-        {
-            throw new InvalidOperationException("socket is not connected");
-        }
-    }
-
-    void WaitForData()
-    {
-        try
-        {
-            if (_Callback == null) _Callback = new AsyncCallback(OnDataReceived);
-            SocketPacket packet = new SocketPacket();
-            packet.TCPSocket = _TCPSocket;
-            _Result = _TCPSocket.BeginReceive(packet.DataBuffer, 0, packet.DataBuffer.Length, SocketFlags.None, _Callback, packet);
-        }
-        catch (SocketException se)
-        {
-            Console.WriteLine(se.Message);
-        }
-    }
-
-    static char[] splitNull = { '\0' };
-    static string[] splitLines = { "\r", "\n", "\r\n" };
-
-    void ReceiveData(string data)
-    {
-        if (OnReceiveLine == null) return;
-
-        //string[] splitNull = { "\0" };
-        string[] line = data.Split(splitNull, StringSplitOptions.None);
-        _Buffer += line[0];
-        //string[] splitLines = { "\r\n", "\r", "\n" };
-        string[] lines = _Buffer.Split(splitLines, StringSplitOptions.None);
-        if (lines.Length > 1)
-        {
-            int i;
-            for (i = 0; i < lines.Length - 1; i++)
-            {
-                if (lines[i].Trim().Length > 0) OnReceiveLine(lines[i]);
-            }
-            _Buffer = lines[i];
-        }
-    }
-
-    void OnDataReceived(IAsyncResult asyn)
-    {
-        try
-        {
-            SocketPacket packet = (SocketPacket)asyn.AsyncState;
-            int end = packet.TCPSocket.EndReceive(asyn);
-            char[] chars = new char[end + 1];
-            System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
-            int charLen = d.GetChars(packet.DataBuffer, 0, end, chars, 0);
-            System.String data = new System.String(chars);
-            ReceiveData(data);
-            WaitForData();
-        }
-        catch (ObjectDisposedException)
-        {
-            Console.WriteLine("WARNING: Socket closed unexpectedly");
-        }
-        catch (SocketException se)
-        {
-            if (!_TCPSocket.Connected) OnDisconnected(se);
-        }
-    }
-
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/Utilities.cs b/old/libsl1550/libsecondlife/libsecondlife.Utilities/Utilities.cs
deleted file mode 100644
index 2792b62..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Utilities/Utilities.cs
+++ /dev/null
@@ -1,533 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.Utilities
-{
-    /// <summary>
-    ///
-    /// </summary>
-    public enum WaterType
-    {
-        /// <summary></summary>
-        Unknown,
-        /// <summary></summary>
-        Dry,
-        /// <summary></summary>
-        Waterfront,
-        /// <summary></summary>
-        Underwater
-    }
-
-    public static class Realism
-    {
-        /// <summary>
-        ///  A psuedo-realistic chat function that uses the typing sound and
-        /// animation, types at three characters per second, and randomly
-        /// pauses. This function will block until the message has been sent
-        /// </summary>
-        /// <param name="client">A reference to the client that will chat</param>
-        /// <param name="message">The chat message to send</param>
-        public static void Chat(SecondLife client, string message)
-        {
-            Chat(client, message, ChatType.Normal, 3);
-        }
-
-        /// <summary>
-        /// A psuedo-realistic chat function that uses the typing sound and
-        /// animation, types at a given rate, and randomly pauses. This
-        /// function will block until the message has been sent
-        /// </summary>
-        /// <param name="client">A reference to the client that will chat</param>
-        /// <param name="message">The chat message to send</param>
-        /// <param name="type">The chat type (usually Normal, Whisper or Shout)</param>
-        /// <param name="cps">Characters per second rate for chatting</param>
-        public static void Chat(SecondLife client, string message, ChatType type, int cps)
-        {
-            Random rand = new Random();
-            int characters = 0;
-            bool typing = true;
-
-            // Start typing
-            client.Self.Chat(String.Empty, 0, ChatType.StartTyping);
-            client.Self.AnimationStart(Animations.TYPE);
-
-            while (characters < message.Length)
-            {
-                if (!typing)
-                {
-                    // Start typing again
-                    client.Self.Chat(String.Empty, 0, ChatType.StartTyping);
-                    client.Self.AnimationStart(Animations.TYPE);
-                    typing = true;
-                }
-                else
-                {
-                    // Randomly pause typing
-                    if (rand.Next(10) >= 9)
-                    {
-                        client.Self.Chat(String.Empty, 0, ChatType.StopTyping);
-                        client.Self.AnimationStop(Animations.TYPE);
-                        typing = false;
-                    }
-                }
-
-                // Sleep for a second and increase the amount of characters we've typed
-                System.Threading.Thread.Sleep(1000);
-                characters += cps;
-            }
-
-            // Send the message
-            client.Self.Chat(message, 0, type);
-
-            // Stop typing
-            client.Self.Chat(String.Empty, 0, ChatType.StopTyping);
-            client.Self.AnimationStop(Animations.TYPE);
-        }
-    }
-
-    public class ConnectionManager
-    {
-        private SecondLife Client;
-        private ulong SimHandle;
-        private LLVector3 Position = LLVector3.Zero;
-        private System.Timers.Timer CheckTimer;
-
-        public ConnectionManager(SecondLife client, int timerFrequency)
-        {
-            Client = client;
-
-            CheckTimer = new System.Timers.Timer(timerFrequency);
-            CheckTimer.Elapsed += new System.Timers.ElapsedEventHandler(CheckTimer_Elapsed);
-        }
-
-        public static bool PersistentLogin(SecondLife client, string firstName, string lastName, string password,
-            string userAgent, string start, string author)
-        {
-            int unknownLogins = 0;
-
-        Start:
-
-            if (client.Network.Login(firstName, lastName, password, userAgent, start, author))
-            {
-                client.Log("Logged in to " + client.Network.CurrentSim, Helpers.LogLevel.Info);
-                return true;
-            }
-            else
-            {
-                if (client.Network.LoginErrorKey == "god")
-                {
-                    client.Log("Grid is down, waiting 10 minutes", Helpers.LogLevel.Warning);
-                    LoginWait(10);
-                    goto Start;
-                }
-                else if (client.Network.LoginErrorKey == "key")
-                {
-                    client.Log("Bad username or password, giving up on login", Helpers.LogLevel.Error);
-                    return false;
-                }
-                else if (client.Network.LoginErrorKey == "presence")
-                {
-                    client.Log("Server is still logging us out, waiting 1 minute", Helpers.LogLevel.Warning);
-                    LoginWait(1);
-                    goto Start;
-                }
-                else if (client.Network.LoginErrorKey == "disabled")
-                {
-                    client.Log("This account has been banned! Giving up on login", Helpers.LogLevel.Error);
-                    return false;
-                }
-                else if (client.Network.LoginErrorKey == "timed out")
-                {
-                    client.Log("Login request timed out, waiting 1 minute", Helpers.LogLevel.Warning);
-                    LoginWait(1);
-                    goto Start;
-                }
-                else
-                {
-                    ++unknownLogins;
-
-                    if (unknownLogins < 5)
-                    {
-                        client.Log("Unknown login error, waiting 2 minutes: " + client.Network.LoginErrorKey,
-                            Helpers.LogLevel.Warning);
-                        LoginWait(2);
-                        goto Start;
-                    }
-                    else
-                    {
-                        client.Log("Too many unknown login error codes, giving up", Helpers.LogLevel.Error);
-                        return false;
-                    }
-                }
-            }
-        }
-
-        public void StayInSim(ulong handle, LLVector3 desiredPosition)
-        {
-            SimHandle = handle;
-            Position = desiredPosition;
-            CheckTimer.Start();
-        }
-
-        private static void LoginWait(int minutes)
-        {
-            Thread.Sleep(1000 * 60 * minutes);
-        }
-
-        private void CheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
-        {
-            if (SimHandle != 0)
-            {
-                if (Client.Network.CurrentSim.Handle != 0 &&
-                    Client.Network.CurrentSim.Handle != SimHandle)
-                {
-                    // Attempt to move to our target sim
-                    Client.Self.Teleport(SimHandle, Position);
-                }
-            }
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class ParcelDownloader
-    {
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="simulator">Simulator where the parcels are located</param>
-        /// <param name="Parcels">Mapping of parcel LocalIDs to Parcel objects</param>
-        public delegate void ParcelsDownloadedCallback(Simulator simulator, Dictionary<int, Parcel> Parcels, int[,] map);
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        public event ParcelsDownloadedCallback OnParcelsDownloaded;
-
-        private SecondLife Client;
-        /// <summary>Dictionary of 64x64 arrays of parcels which have been successfully downloaded
-        /// for each simulator (and their LocalID's, 0 = Null)</summary>
-        private Dictionary<Simulator, int[,]> ParcelMarked = new Dictionary<Simulator, int[,]>();
-        private Dictionary<Simulator, Dictionary<int, Parcel>> Parcels = new Dictionary<Simulator, Dictionary<int, Parcel>>();
-        private List<Simulator> active_sims = new List<Simulator>();
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        /// <param name="client">A reference to the SecondLife client</param>
-        public ParcelDownloader(SecondLife client)
-        {
-            Client = client;
-            Client.Parcels.OnParcelProperties += new ParcelManager.ParcelPropertiesCallback(Parcels_OnParcelProperties);
-            Client.Parcels.OnAccessListReply += new ParcelManager.ParcelAccessListReplyCallback(Parcels_OnParcelAccessList);
-        }
-
-        public void DownloadSimParcels(Simulator simulator)
-        {
-            if (simulator == null)
-            {
-                Client.Log("DownloadSimParcels() will not work with a null simulator", Helpers.LogLevel.Error);
-                return;
-            }
-
-            lock (active_sims)
-            {
-                if (active_sims.Contains(simulator))
-                {
-                    Client.Log("DownloadSimParcels(" + simulator + ") called more than once?", Helpers.LogLevel.Error);
-                    return;
-                }
-
-                active_sims.Add(simulator);
-            }
-
-            lock (ParcelMarked)
-            {
-                if (!ParcelMarked.ContainsKey(simulator))
-                {
-                    ParcelMarked[simulator] = new int[64, 64];
-                    Parcels[simulator] = new Dictionary<int, Parcel>();
-                }
-            }
-
-            Client.Parcels.PropertiesRequest(simulator, 0.0f, 0.0f, 0.0f, 0.0f, 0, false);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="map"></param>
-        /// <param name="localid"></param>
-        /// <returns></returns>
-        public float GetHeightRange(int[,] map, int localid)
-        {
-            float min = Single.MaxValue;
-            float max = 0.0f;
-
-            for (int y = 0; y < 64; y++)
-            {
-                for (int x = 0; x < 64; x++)
-                {
-                    if (map[y, x] == localid)
-                    {
-                        for (int y1 = 0; y1 < 4; y1++)
-                        {
-                            for (int x1 = 0; x1 < 4; x1++)
-                            {
-                                float height;
-                                int tries = 0;
-
-                            CheckHeight:
-
-                                if (Client.Terrain.TerrainHeightAtPoint(Client.Network.CurrentSim.Handle,
-                                    x * 4 + x1, y * 4 + y1, out height))
-                                {
-                                    if (height < min)
-                                        min = height;
-                                    if (height > max)
-                                        max = height;
-                                }
-                                else if (tries > 4)
-                                {
-                                    Client.Log("Too many tries on this terrain block, skipping",
-                                        Helpers.LogLevel.Warning);
-                                    continue;
-                                }
-                                else
-                                {
-                                    Client.Log(String.Format("Terrain height is null at {0},{1} retrying",
-                                        x * 4 + x1, y * 4 + y1), Helpers.LogLevel.Info);
-
-                                    // Terrain at this point hasn't been downloaded, move the camera to this spot
-                                    // and try again
-                                    LLVector3 position = new LLVector3((float)(x * 4 + x1), (float)(y * 4 + y1),
-                                        Client.Self.SimPosition.Z);
-                                    Client.Self.Movement.Camera.Position = position;
-
-                                    Client.Self.Movement.SendUpdate(true);
-
-                                    Thread.Sleep(1000);
-                                    goto CheckHeight;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            if (min != Single.MaxValue)
-            {
-                return max - min;
-            }
-            else
-            {
-                Client.Log("Error decoding terrain for parcel " + localid, Helpers.LogLevel.Error);
-                return Single.NaN;
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="map"></param>
-        /// <param name="localid"></param>
-        /// <returns></returns>
-        public WaterType GetWaterType(int[,] map, int localid)
-        {
-            if (!Client.Settings.STORE_LAND_PATCHES)
-            {
-                Client.Log("GetWaterType() will not work without Settings.STORE_LAND_PATCHES set to true",
-                    Helpers.LogLevel.Error);
-                return WaterType.Unknown;
-            }
-            else if (!Client.Network.Connected && Client.Network.CurrentSim != null)
-            {
-                Client.Log("GetWaterType() can only be used with an online client", Helpers.LogLevel.Error);
-                return WaterType.Unknown;
-            }
-
-            bool underwater = false;
-            bool abovewater = false;
-
-            for (int y = 0; y < 64; y++)
-            {
-                for (int x = 0; x < 64; x++)
-                {
-                    if (map[y, x] == localid)
-                    {
-                        for (int y1 = 0; y1 < 4; y1++)
-                        {
-                            for (int x1 = 0; x1 < 4; x1++)
-                            {
-                                float height;
-                                int tries = 0;
-
-                            CheckHeight:
-                                tries++;
-
-                                if (Client.Terrain.TerrainHeightAtPoint(Client.Network.CurrentSim.Handle,
-                                    x * 4 + x1, y * 4 + y1, out height))
-                                {
-                                    if (height < Client.Network.CurrentSim.WaterHeight)
-                                    {
-                                        underwater = true;
-                                    }
-                                    else
-                                    {
-                                        abovewater = true;
-                                    }
-                                }
-                                else if (tries > 4)
-                                {
-                                    Client.Log("Too many tries on this terrain block, skipping",
-                                        Helpers.LogLevel.Warning);
-                                    continue;
-                                }
-                                else
-                                {
-                                    Client.Log(String.Format("Terrain height is null at {0},{1} retrying",
-                                        x * 4 + x1, y * 4 + y1), Helpers.LogLevel.Info);
-
-                                    // Terrain at this point hasn't been downloaded, move the camera to this spot
-                                    // and try again
-                                    LLVector3 position = new LLVector3((float)(x * 4 + x1), (float)(y * 4 + y1),
-                                        Client.Self.SimPosition.Z);
-                                    Client.Self.Movement.Camera.Position = position;
-
-                                    Client.Self.Movement.SendUpdate(true);
-
-                                    Thread.Sleep(1000);
-                                    goto CheckHeight;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            if (underwater && abovewater)
-            {
-                return WaterType.Waterfront;
-            }
-            else if (abovewater)
-            {
-                return WaterType.Dry;
-            }
-            else if (underwater)
-            {
-                return WaterType.Underwater;
-            }
-            else
-            {
-                Client.Log("Error decoding terrain for parcel " + localid, Helpers.LogLevel.Error);
-                return WaterType.Unknown;
-            }
-        }
-
-        public int GetRectangularDeviation(LLVector3 aabbmin, LLVector3 aabbmax, int area)
-        {
-            int xlength = (int)(aabbmax.X - aabbmin.X);
-            int ylength = (int)(aabbmax.Y - aabbmin.Y);
-            int aabbarea = xlength * ylength;
-            return (aabbarea - area) / 16;
-        }
-
-        private void Parcels_OnParcelAccessList(Simulator simulator, int sequenceID, int localID, uint flags,
-                                                List<ParcelManager.ParcelAccessEntry> accessEntries)
-        {
-            if (simulator != null && Parcels.ContainsKey(simulator) && Parcels[simulator].ContainsKey(localID))
-            {
-                Parcel parcel = Parcels[simulator][localID];
-                parcel.AccessList = accessEntries;
-                Parcels[simulator][localID] = parcel;
-            }
-        }
-
-        private void Parcels_OnParcelProperties(Parcel parcel, ParcelManager.ParcelResult result, int sequenceID,
-            bool snapSelection)
-        {
-            // Check if this is for a simulator we're concerned with
-            if (!active_sims.Contains(parcel.Simulator)) return;
-
-            // Warn about parcel property request errors and bail out
-            if (result == ParcelManager.ParcelResult.NoData)
-            {
-                Client.Log("ParcelDownloader received a NoData response, sequenceID " + sequenceID,
-                    Helpers.LogLevel.Warning);
-                return;
-            }
-
-            // Warn about unexpected data and bail out
-            if (!ParcelMarked.ContainsKey(parcel.Simulator))
-            {
-                Client.Log("ParcelDownloader received unexpected parcel data for " + parcel.Simulator,
-                    Helpers.LogLevel.Warning);
-                return;
-            }
-
-            int x, y, index, bit;
-            int[,] markers = ParcelMarked[parcel.Simulator];
-
-            // Add this parcel to the dictionary of LocalID -> Parcel mappings
-            lock (Parcels[parcel.Simulator])
-                if (!Parcels[parcel.Simulator].ContainsKey(parcel.LocalID))
-                    Parcels[parcel.Simulator][parcel.LocalID] = parcel;
-
-            // Request the access list for this parcel
-            Client.Parcels.AccessListRequest(parcel.Simulator, parcel.LocalID,
-                ParcelManager.AccessList.Both, 0);
-
-            // Mark this area as downloaded
-            for (y = 0; y < 64; y++)
-            {
-                for (x = 0; x < 64; x++)
-                {
-                    if (markers[y, x] == 0)
-                    {
-                        index = (y * 64) + x;
-                        bit = index % 8;
-                        index >>= 3;
-
-                        if ((parcel.Bitmap[index] & (1 << bit)) != 0)
-                            markers[y, x] = parcel.LocalID;
-                    }
-                }
-            }
-
-            // Request parcel information for the next missing area
-            for (y = 0; y < 64; y++)
-            {
-                for (x = 0; x < 64; x++)
-                {
-                    if (markers[y, x] == 0)
-                    {
-                        Client.Parcels.PropertiesRequest(parcel.Simulator,
-                                                         (y + 1) * 4.0f, (x + 1) * 4.0f,
-                                                         y * 4.0f, x * 4.0f, 0, false);
-
-                        return;
-                    }
-                }
-            }
-
-            // If we get here, there are no more zeroes in the markers map
-            lock (active_sims)
-            {
-                active_sims.Remove(parcel.Simulator);
-
-                if (OnParcelsDownloaded != null)
-                {
-                    // This map is complete, fire callback
-                    try { OnParcelsDownloaded(parcel.Simulator, Parcels[parcel.Simulator], markers); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/VoiceManager.cs b/old/libsl1550/libsecondlife/libsecondlife.Utilities/VoiceManager.cs
deleted file mode 100644
index 44bb836..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Utilities/VoiceManager.cs
+++ /dev/null
@@ -1,792 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Net.Sockets;
-using System.Text;
-using System.IO;
-using System.Xml;
-using System.Threading;
-using libsecondlife;
-using libsecondlife.StructuredData;
-using libsecondlife.Capabilities;
-
-namespace libsecondlife.Utilities
-{
-    public enum VoiceStatus
-    {
-        StatusLoginRetry,
-        StatusLoggedIn,
-        StatusJoining,
-        StatusJoined,
-        StatusLeftChannel,
-        BeginErrorStatus,
-        ErrorChannelFull,
-        ErrorChannelLocked,
-        ErrorNotAvailable,
-        ErrorUnknown
-    }
-
-    public enum VoiceServiceType
-    {
-        /// <summary>Unknown voice service level</summary>
-        Unknown,
-        /// <summary>Spatialized local chat</summary>
-        TypeA,
-        /// <summary>Remote multi-party chat</summary>
-        TypeB,
-        /// <summary>One-to-one and small group chat</summary>
-        TypeC
-    }
-
-    public partial class VoiceManager
-    {
-        public const int VOICE_MAJOR_VERSION = 1;
-        public const string DAEMON_ARGS = " -p tcp -h -c -ll ";
-        public const int DAEMON_LOG_LEVEL = 1;
-        public const int DAEMON_PORT = 44124;
-        public const string VOICE_RELEASE_SERVER = "bhr.vivox.com";
-        public const string VOICE_DEBUG_SERVER = "bhd.vivox.com";
-        public const string REQUEST_TERMINATOR = "\n\n\n";
-
-        public delegate void LoginStateChangeCallback(int cookie, string accountHandle, int statusCode, string statusString, int state);
-        public delegate void NewSessionCallback(int cookie, string accountHandle, string eventSessionHandle, int state, string nameString, string uriString);
-        public delegate void SessionStateChangeCallback(int cookie, string uriString, int statusCode, string statusString, string eventSessionHandle, int state, bool isChannel, string nameString);
-        public delegate void ParticipantStateChangeCallback(int cookie, string uriString, int statusCode, string statusString, int state, string nameString, string displayNameString, int participantType);
-        public delegate void ParticipantPropertiesCallback(int cookie, string uriString, int statusCode, string statusString, bool isLocallyMuted, bool isModeratorMuted, bool isSpeaking, int volume, float energy);
-        public delegate void AuxAudioPropertiesCallback(int cookie, float energy);
-        public delegate void BasicActionCallback(int cookie, int statusCode, string statusString);
-        public delegate void ConnectorCreatedCallback(int cookie, int statusCode, string statusString, string connectorHandle);
-        public delegate void LoginCallback(int cookie, int statusCode, string statusString, string accountHandle);
-        public delegate void SessionCreatedCallback(int cookie, int statusCode, string statusString, string sessionHandle);
-        public delegate void DevicesCallback(int cookie, int statusCode, string statusString, string currentDevice);
-        public delegate void ProvisionAccountCallback(string username, string password);
-
-        public event LoginStateChangeCallback OnLoginStateChange;
-        public event NewSessionCallback OnNewSession;
-        public event SessionStateChangeCallback OnSessionStateChange;
-        public event ParticipantStateChangeCallback OnParticipantStateChange;
-        public event ParticipantPropertiesCallback OnParticipantProperties;
-        public event AuxAudioPropertiesCallback OnAuxAudioProperties;
-        public event ConnectorCreatedCallback OnConnectorCreated;
-        public event LoginCallback OnLogin;
-        public event SessionCreatedCallback OnSessionCreated;
-        public event BasicActionCallback OnSessionConnected;
-        public event BasicActionCallback OnAccountLogout;
-        public event BasicActionCallback OnConnectorInitiateShutdown;
-        public event BasicActionCallback OnAccountChannelGetList;
-        public event BasicActionCallback OnSessionTerminated;
-        public event DevicesCallback OnCaptureDevices;
-        public event DevicesCallback OnRenderDevices;
-        public event ProvisionAccountCallback OnProvisionAccount;
-
-        public SecondLife Client;
-        public string VoiceServer = VOICE_RELEASE_SERVER;
-        public bool Enabled;
-
-        protected TCPPipe _DaemonPipe;
-        protected VoiceStatus _Status;
-        protected int _CommandCookie = 0;
-        protected string _TuningSoundFile = String.Empty;
-        protected Dictionary<string, string> _ChannelMap = new Dictionary<string, string>();
-        protected List<string> _CaptureDevices = new List<string>();
-        protected List<string> _RenderDevices = new List<string>();
-
-        #region Response Processing Variables
-
-        private bool isEvent = false;
-        private bool isChannel = false;
-        private bool isLocallyMuted = false;
-        private bool isModeratorMuted = false;
-        private bool isSpeaking = false;
-        private int cookie = 0;
-        private int returnCode = 0;
-        private int statusCode = 0;
-        private int volume = 0;
-        private int state = 0;
-        private int participantType = 0;
-        private float energy = 0f;
-        private string statusString = String.Empty;
-        private string uuidString = String.Empty;
-        private string actionString = String.Empty;
-        private string connectorHandle = String.Empty;
-        private string accountHandle = String.Empty;
-        private string sessionHandle = String.Empty;
-        private string eventSessionHandle = String.Empty;
-        private string eventTypeString = String.Empty;
-        private string uriString = String.Empty;
-        private string nameString = String.Empty;
-        private string audioMediaString = String.Empty;
-        private string displayNameString = String.Empty;
-
-        #endregion Response Processing Variables
-
-        public VoiceManager(SecondLife client)
-        {
-            Client = client;
-            Client.Network.RegisterEventCallback("RequiredVoiceVersion", new Caps.EventQueueCallback(RequiredVoiceVersionEventHandler));
-
-            // Register callback handlers for the blocking functions
-            RegisterCallbacks();
-
-            Enabled = true;
-        }
-
-        public bool IsDaemonRunning()
-        {
-            throw new NotImplementedException();
-        }
-
-        public bool StartDaemon()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void StopDaemon()
-        {
-            throw new NotImplementedException();
-        }
-
-        public bool ConnectToDaemon()
-        {
-            if (!Enabled) return false;
-
-            return ConnectToDaemon("127.0.0.1", DAEMON_PORT);
-        }
-
-        public bool ConnectToDaemon(string address, int port)
-        {
-            if (!Enabled) return false;
-
-            _DaemonPipe = new TCPPipe();
-            _DaemonPipe.OnDisconnected += new TCPPipe.OnDisconnectedCallback(_DaemonPipe_OnDisconnected);
-            _DaemonPipe.OnReceiveLine += new TCPPipe.OnReceiveLineCallback(_DaemonPipe_OnReceiveLine);
-
-            SocketException se = _DaemonPipe.Connect(address, port);
-
-            if (se == null)
-            {
-                return true;
-            }
-            else
-            {
-                Console.WriteLine("Connection failed: " + se.Message);
-                return false;
-            }
-        }
-
-        public Dictionary<string, string> GetChannelMap()
-        {
-            return new Dictionary<string, string>(_ChannelMap);
-        }
-
-        public List<string> CurrentCaptureDevices()
-        {
-            return new List<string>(_CaptureDevices);
-        }
-
-        public List<string> CurrentRenderDevices()
-        {
-            return new List<string>(_RenderDevices);
-        }
-
-        public string VoiceAccountFromUUID(LLUUID id)
-        {
-            string result = "x" + Convert.ToBase64String(id.GetBytes());
-            return result.Replace('+', '-').Replace('/', '_');
-        }
-
-        public LLUUID UUIDFromVoiceAccount(string accountName)
-        {
-            if (accountName.Length == 25 && accountName[0] == 'x' && accountName[23] == '=' && accountName[24] == '=')
-            {
-                accountName = accountName.Replace('/', '_').Replace('+', '-');
-                byte[] idBytes = Convert.FromBase64String(accountName);
-
-                if (idBytes.Length == 16)
-                    return new LLUUID(idBytes, 0);
-                else
-                    return LLUUID.Zero;
-            }
-            else
-            {
-                return LLUUID.Zero;
-            }
-        }
-
-        public string SIPURIFromVoiceAccount(string account)
-        {
-            return String.Format("sip:{0}@{1}", account, VoiceServer);
-        }
-
-        public int RequestCaptureDevices()
-        {
-            if (_DaemonPipe.Connected)
-            {
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.GetCaptureDevices.1\"></Request>{1}",
-                    _CommandCookie++,
-                    REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestCaptureDevices() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        public int RequestRenderDevices()
-        {
-            if (_DaemonPipe.Connected)
-            {
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.GetRenderDevices.1\"></Request>{1}",
-                    _CommandCookie++,
-                    REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestRenderDevices() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        public int RequestCreateConnector()
-        {
-            return RequestCreateConnector(VoiceServer);
-        }
-
-        public int RequestCreateConnector(string voiceServer)
-        {
-            if (_DaemonPipe.Connected)
-            {
-                VoiceServer = voiceServer;
-
-                string accountServer = String.Format("https://www.{0}/api2/", VoiceServer);
-                string logPath = ".";
-
-                StringBuilder request = new StringBuilder();
-                request.Append(String.Format("<Request requestId=\"{0}\" action=\"Connector.Create.1\">", _CommandCookie++));
-                request.Append("<ClientName>V2 SDK</ClientName>");
-                request.Append(String.Format("<AccountManagementServer>{0}</AccountManagementServer>", accountServer));
-                request.Append("<Logging>");
-                request.Append("<Enabled>false</Enabled>");
-                request.Append(String.Format("<Folder>{0}</Folder>", logPath));
-                request.Append("<FileNamePrefix>vivox-gateway</FileNamePrefix>");
-                request.Append("<FileNameSuffix>.log</FileNameSuffix>");
-                request.Append("<LogLevel>0</LogLevel>");
-                request.Append("</Logging>");
-                request.Append("</Request>");
-                request.Append(REQUEST_TERMINATOR);
-
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(request.ToString()));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.CreateConnector() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        public bool RequestProvisionAccount()
-        {
-            if (Enabled && Client.Network.Connected)
-            {
-                if (Client.Network.CurrentSim != null && Client.Network.CurrentSim.Caps != null)
-                {
-                    Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("ProvisionVoiceAccountRequest");
-
-                    if (url != null)
-                    {
-                        CapsClient request = new CapsClient(url);
-                        request.OnComplete += new CapsClient.CompleteCallback(ProvisionCapsResponse);
-                        request.StartRequest();
-
-                        return true;
-                    }
-                    else
-                    {
-                        Client.Log("VoiceManager.RequestProvisionAccount(): ProvisionVoiceAccountRequest capability is missing",
-                            Helpers.LogLevel.Info);
-                        return false;
-                    }
-                }
-            }
-
-            Client.Log("VoiceManager.RequestProvisionAccount(): Voice system is currently disabled", Helpers.LogLevel.Info);
-            return false;
-        }
-
-        public int RequestLogin(string accountName, string password, string connectorHandle)
-        {
-            if (_DaemonPipe.Connected)
-            {
-                StringBuilder request = new StringBuilder();
-                request.Append(String.Format("<Request requestId=\"{0}\" action=\"Account.Login.1\">", _CommandCookie++));
-                request.Append(String.Format("<ConnectorHandle>{0}</ConnectorHandle>", connectorHandle));
-                request.Append(String.Format("<AccountName>{0}</AccountName>", accountName));
-                request.Append(String.Format("<AccountPassword>{0}</AccountPassword>", password));
-                request.Append("<AudioSessionAnswerMode>VerifyAnswer</AudioSessionAnswerMode>");
-                request.Append("</Request>");
-                request.Append(REQUEST_TERMINATOR);
-
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(request.ToString()));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.Login() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        public int RequestSetRenderDevice(string deviceName)
-        {
-            if (_DaemonPipe.Connected)
-            {
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.SetRenderDevice.1\"><RenderDeviceSpecifier>{1}</RenderDeviceSpecifier></Request>{2}",
-                    _CommandCookie, deviceName, REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestSetRenderDevice() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        public int RequestStartTuningMode(int duration)
-        {
-            if (_DaemonPipe.Connected)
-            {
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.CaptureAudioStart.1\"><Duration>{1}</Duration></Request>{2}",
-                    _CommandCookie, duration, REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestStartTuningMode() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        public int RequestStopTuningMode()
-        {
-            if (_DaemonPipe.Connected)
-            {
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.CaptureAudioStop.1\"></Request>{1}",
-                    _CommandCookie, REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestStopTuningMode() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return _CommandCookie - 1;
-            }
-        }
-
-        public int RequestSetSpeakerVolume(int volume)
-        {
-            if (volume < 0 || volume > 100)
-                throw new ArgumentException("volume must be between 0 and 100", "volume");
-
-            if (_DaemonPipe.Connected)
-            {
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.SetSpeakerLevel.1\"><Level>{1}</Level></Request>{2}",
-                    _CommandCookie, volume, REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestSetSpeakerVolume() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        public int RequestSetCaptureVolume(int volume)
-        {
-            if (volume < 0 || volume > 100)
-                throw new ArgumentException("volume must be between 0 and 100", "volume");
-
-            if (_DaemonPipe.Connected)
-            {
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.SetMicLevel.1\"><Level>{1}</Level></Request>{2}",
-                    _CommandCookie, volume, REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestSetCaptureVolume() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        /// <summary>
-        /// Does not appear to be working
-        /// </summary>
-        /// <param name="fileName"></param>
-        /// <param name="loop"></param>
-        public int RequestRenderAudioStart(string fileName, bool loop)
-        {
-            if (_DaemonPipe.Connected)
-            {
-                _TuningSoundFile = fileName;
-
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.RenderAudioStart.1\"><SoundFilePath>{1}</SoundFilePath><Loop>{2}</Loop></Request>{3}",
-                    _CommandCookie++, _TuningSoundFile, (loop ? "1" : "0"), REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestRenderAudioStart() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        public int RequestRenderAudioStop()
-        {
-            if (_DaemonPipe.Connected)
-            {
-                _DaemonPipe.SendData(Encoding.ASCII.GetBytes(String.Format(
-                    "<Request requestId=\"{0}\" action=\"Aux.RenderAudioStop.1\"><SoundFilePath>{1}</SoundFilePath></Request>{2}",
-                    _CommandCookie++, _TuningSoundFile, REQUEST_TERMINATOR)));
-
-                return _CommandCookie - 1;
-            }
-            else
-            {
-                Client.Log("VoiceManager.RequestRenderAudioStop() called when the daemon pipe is disconnected", Helpers.LogLevel.Error);
-                return -1;
-            }
-        }
-
-        #region Callbacks
-
-        private void RequiredVoiceVersionEventHandler(string message, LLSD llsd, Simulator simulator)
-        {
-            LLSDMap body = (LLSDMap)llsd;
-
-            if (body.ContainsKey("major_version"))
-            {
-                int majorVersion = body["major_version"].AsInteger();
-
-                if (VOICE_MAJOR_VERSION != majorVersion)
-                {
-                    Client.Log(String.Format("Voice version mismatch! Got {0}, expecting {1}. Disabling the voice manager",
-                        majorVersion, VOICE_MAJOR_VERSION), Helpers.LogLevel.Error);
-                    Enabled = false;
-                }
-                else
-                {
-                    Client.DebugLog("Voice version " + majorVersion + " verified");
-                }
-            }
-        }
-
-        private void ProvisionCapsResponse(CapsClient client, LLSD response, Exception error)
-        {
-            if (response is LLSDMap)
-            {
-                LLSDMap respTable = (LLSDMap)response;
-
-                if (OnProvisionAccount != null)
-                {
-                    try { OnProvisionAccount(respTable["username"].AsString(), respTable["password"].AsString()); }
-                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-                }
-            }
-        }
-
-        private void _DaemonPipe_OnDisconnected(SocketException se)
-        {
-            if (se != null) Console.WriteLine("Disconnected! " + se.Message);
-            else Console.WriteLine("Disconnected!");
-        }
-
-        private void _DaemonPipe_OnReceiveLine(string line)
-        {
-            XmlTextReader reader = new XmlTextReader(new StringReader(line));
-
-            while (reader.Read())
-            {
-                switch (reader.NodeType)
-                {
-                    case XmlNodeType.Element:
-                    {
-                        if (reader.Depth == 0)
-                        {
-                            isEvent = (reader.Name == "Event");
-
-                            if (isEvent || reader.Name == "Response")
-                            {
-                                for (int i = 0; i < reader.AttributeCount; i++)
-                                {
-                                    reader.MoveToAttribute(i);
-
-                                    switch (reader.Name)
-                                    {
-                                        case "requestId":
-                                            uuidString = reader.Value;
-                                            break;
-                                        case "action":
-                                            actionString = reader.Value;
-                                            break;
-                                        case "type":
-                                            eventTypeString = reader.Value;
-                                            break;
-                                    }
-                                }
-                            }
-                        }
-                        else
-                        {
-                            switch (reader.Name)
-                            {
-                                case "InputXml":
-                                    cookie = -1;
-
-                                    // Parse through here to get the cookie value
-                                    reader.Read();
-                                    if (reader.Name == "Request")
-                                    {
-                                        for (int i = 0; i < reader.AttributeCount; i++)
-                                        {
-                                            reader.MoveToAttribute(i);
-
-                                            if (reader.Name == "requestId")
-                                            {
-                                                Int32.TryParse(reader.Value, out cookie);
-                                                break;
-                                            }
-                                        }
-                                    }
-
-                                    if (cookie == -1)
-                                    {
-                                        Client.Log("VoiceManager._DaemonPipe_OnReceiveLine(): Failed to parse InputXml for the cookie",
-                                            Helpers.LogLevel.Warning);
-                                    }
-                                    break;
-                                case "CaptureDevices":
-                                    _CaptureDevices.Clear();
-                                    break;
-                                case "RenderDevices":
-                                    _RenderDevices.Clear();
-                                    break;
-                                case "ReturnCode":
-                                    returnCode = reader.ReadElementContentAsInt();
-                                    break;
-                                case "StatusCode":
-                                    statusCode = reader.ReadElementContentAsInt();
-                                    break;
-                                case "StatusString":
-                                    statusString = reader.ReadElementContentAsString();
-                                    break;
-                                case "State":
-                                    state = reader.ReadElementContentAsInt();
-                                    break;
-                                case "ConnectorHandle":
-                                    connectorHandle = reader.ReadElementContentAsString();
-                                    break;
-                                case "AccountHandle":
-                                    accountHandle = reader.ReadElementContentAsString();
-                                    break;
-                                case "SessionHandle":
-                                    sessionHandle = reader.ReadElementContentAsString();
-                                    break;
-                                case "URI":
-                                    uriString = reader.ReadElementContentAsString();
-                                    break;
-                                case "IsChannel":
-                                    isChannel = reader.ReadElementContentAsBoolean();
-                                    break;
-                                case "Name":
-                                    nameString = reader.ReadElementContentAsString();
-                                    break;
-                                case "AudioMedia":
-                                    audioMediaString = reader.ReadElementContentAsString();
-                                    break;
-                                case "ChannelName":
-                                    nameString = reader.ReadElementContentAsString();
-                                    break;
-                                case "ParticipantURI":
-                                    uriString = reader.ReadElementContentAsString();
-                                    break;
-                                case "DisplayName":
-                                    displayNameString = reader.ReadElementContentAsString();
-                                    break;
-                                case "AccountName":
-                                    nameString = reader.ReadElementContentAsString();
-                                    break;
-                                case "ParticipantType":
-                                    participantType = reader.ReadElementContentAsInt();
-                                    break;
-                                case "IsLocallyMuted":
-                                    isLocallyMuted = reader.ReadElementContentAsBoolean();
-                                    break;
-                                case "IsModeratorMuted":
-                                    isModeratorMuted = reader.ReadElementContentAsBoolean();
-                                    break;
-                                case "IsSpeaking":
-                                    isSpeaking = reader.ReadElementContentAsBoolean();
-                                    break;
-                                case "Volume":
-                                    volume = reader.ReadElementContentAsInt();
-                                    break;
-                                case "Energy":
-                                    energy = reader.ReadElementContentAsFloat();
-                                    break;
-                                case "MicEnergy":
-                                    energy = reader.ReadElementContentAsFloat();
-                                    break;
-                                case "ChannelURI":
-                                    uriString = reader.ReadElementContentAsString();
-                                    break;
-                                case "ChannelListResult":
-                                    _ChannelMap[nameString] = uriString;
-                                    break;
-                                case "CaptureDevice":
-                                    reader.Read();
-                                    _CaptureDevices.Add(reader.ReadElementContentAsString());
-                                    break;
-                                case "CurrentCaptureDevice":
-                                    reader.Read();
-                                    nameString = reader.ReadElementContentAsString();
-                                    break;
-                                case "RenderDevice":
-                                    reader.Read();
-                                    _RenderDevices.Add(reader.ReadElementContentAsString());
-                                    break;
-                                case "CurrentRenderDevice":
-                                    reader.Read();
-                                    nameString = reader.ReadElementContentAsString();
-                                    break;
-                            }
-                        }
-
-                        break;
-                    }
-                    case XmlNodeType.EndElement:
-                        if (reader.Depth == 0)
-                            ProcessEvent();
-                        break;
-                }
-            }
-
-            if (isEvent)
-            {
-            }
-
-            //Client.DebugLog("VOICE: " + line);
-        }
-
-        private void ProcessEvent()
-        {
-            if (isEvent)
-            {
-                switch (eventTypeString)
-                {
-                    case "LoginStateChangeEvent":
-                        if (OnLoginStateChange != null) OnLoginStateChange(cookie, accountHandle, statusCode, statusString, state);
-                        break;
-                    case "SessionNewEvent":
-                        if (OnNewSession != null) OnNewSession(cookie, accountHandle, eventSessionHandle, state, nameString, uriString);
-                        break;
-                    case "SessionStateChangeEvent":
-                        if (OnSessionStateChange != null) OnSessionStateChange(cookie, uriString, statusCode, statusString, eventSessionHandle, state, isChannel, nameString);
-                        break;
-                    case "ParticipantStateChangeEvent":
-                        if (OnParticipantStateChange != null) OnParticipantStateChange(cookie, uriString, statusCode, statusString, state, nameString, displayNameString, participantType);
-                        break;
-                    case "ParticipantPropertiesEvent":
-                        if (OnParticipantProperties != null) OnParticipantProperties(cookie, uriString, statusCode, statusString, isLocallyMuted, isModeratorMuted, isSpeaking, volume, energy);
-                        break;
-                    case "AuxAudioPropertiesEvent":
-                        if (OnAuxAudioProperties != null) OnAuxAudioProperties(cookie, energy);
-                        break;
-                }
-            }
-            else
-            {
-                switch (actionString)
-                {
-                    case "Connector.Create.1":
-                        if (OnConnectorCreated != null) OnConnectorCreated(cookie, statusCode, statusString, connectorHandle);
-                        break;
-                    case "Account.Login.1":
-                        if (OnLogin != null) OnLogin(cookie, statusCode, statusString, accountHandle);
-                        break;
-                    case "Session.Create.1":
-                        if (OnSessionCreated != null) OnSessionCreated(cookie, statusCode, statusString, sessionHandle);
-                        break;
-                    case "Session.Connect.1":
-                        if (OnSessionConnected != null) OnSessionConnected(cookie, statusCode, statusString);
-                        break;
-                    case "Session.Terminate.1":
-                        if (OnSessionTerminated != null) OnSessionTerminated(cookie, statusCode, statusString);
-                        break;
-                    case "Account.Logout.1":
-                        if (OnAccountLogout != null) OnAccountLogout(cookie, statusCode, statusString);
-                        break;
-                    case "Connector.InitiateShutdown.1":
-                        if (OnConnectorInitiateShutdown != null) OnConnectorInitiateShutdown(cookie, statusCode, statusString);
-                        break;
-                    case "Account.ChannelGetList.1":
-                        if (OnAccountChannelGetList != null) OnAccountChannelGetList(cookie, statusCode, statusString);
-                        break;
-                    case "Aux.GetCaptureDevices.1":
-                        if (OnCaptureDevices != null) OnCaptureDevices(cookie, statusCode, statusString, nameString);
-                        break;
-                    case "Aux.GetRenderDevices.1":
-                        if (OnRenderDevices != null) OnRenderDevices(cookie, statusCode, statusString, nameString);
-                        break;
-                }
-            }
-        }
-
-        #endregion Callbacks
-    }
-}
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/VoiceManagerBlocking.cs b/old/libsl1550/libsecondlife/libsecondlife.Utilities/VoiceManagerBlocking.cs
deleted file mode 100644
index 8bee165..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Utilities/VoiceManagerBlocking.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2006-2007, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using libsecondlife;
-
-namespace libsecondlife.Utilities
-{
-    public partial class VoiceManager
-    {
-        /// <summary>Amount of time to wait for the voice daemon to respond.
-        /// The value needs to stay relatively high because some of the calls
-        /// require the voice daemon to make remote queries before replying</summary>
-        public int BlockingTimeout = 30 * 1000;
-
-        protected Dictionary<int, AutoResetEvent> Events = new Dictionary<int, AutoResetEvent>();
-
-        public List<string> CaptureDevices()
-        {
-            AutoResetEvent evt = new AutoResetEvent(false);
-            Events[_CommandCookie] = evt;
-
-            if (RequestCaptureDevices() == -1)
-            {
-                Events.Remove(_CommandCookie);
-                return new List<string>();
-            }
-
-            if (evt.WaitOne(BlockingTimeout, false))
-                return CurrentCaptureDevices();
-            else
-                return new List<string>();
-        }
-
-        public List<string> RenderDevices()
-        {
-            AutoResetEvent evt = new AutoResetEvent(false);
-            Events[_CommandCookie] = evt;
-
-            if (RequestRenderDevices() == -1)
-            {
-                Events.Remove(_CommandCookie);
-                return new List<string>();
-            }
-
-            if (evt.WaitOne(BlockingTimeout, false))
-                return CurrentRenderDevices();
-            else
-                return new List<string>();
-        }
-
-        public string CreateConnector(out int status)
-        {
-            status = 0;
-
-            AutoResetEvent evt = new AutoResetEvent(false);
-            Events[_CommandCookie] = evt;
-
-            if (RequestCreateConnector() == -1)
-            {
-                Events.Remove(_CommandCookie);
-                return String.Empty;
-            }
-
-            bool success = evt.WaitOne(BlockingTimeout, false);
-            status = statusCode;
-
-            if (success && statusCode == 0)
-                return connectorHandle;
-            else
-                return String.Empty;
-        }
-
-        public string Login(string accountName, string password, string connectorHandle, out int status)
-        {
-            status = 0;
-
-            AutoResetEvent evt = new AutoResetEvent(false);
-            Events[_CommandCookie] = evt;
-
-            if (RequestLogin(accountHandle, password, connectorHandle) == -1)
-            {
-                Events.Remove(_CommandCookie);
-                return String.Empty;
-            }
-
-            bool success = evt.WaitOne(BlockingTimeout, false);
-            status = statusCode;
-
-            if (success && statusCode == 0)
-                return accountHandle;
-            else
-                return String.Empty;
-        }
-
-        protected void RegisterCallbacks()
-        {
-            OnCaptureDevices += new DevicesCallback(VoiceManager_OnCaptureDevices);
-            OnRenderDevices += new DevicesCallback(VoiceManager_OnRenderDevices);
-            OnConnectorCreated += new ConnectorCreatedCallback(VoiceManager_OnConnectorCreated);
-            OnLogin += new LoginCallback(VoiceManager_OnLogin);
-        }
-
-        #region Callbacks
-
-        private void VoiceManager_OnCaptureDevices(int cookie, int statusCode, string statusString, string currentDevice)
-        {
-            if (Events.ContainsKey(cookie))
-                Events[cookie].Set();
-        }
-
-        private void VoiceManager_OnRenderDevices(int cookie, int statusCode, string statusString, string currentDevice)
-        {
-            if (Events.ContainsKey(cookie))
-                Events[cookie].Set();
-        }
-
-        private void VoiceManager_OnConnectorCreated(int cookie, int statusCode, string statusString, string connectorHandle)
-        {
-            if (Events.ContainsKey(cookie))
-                Events[cookie].Set();
-        }
-
-        private void VoiceManager_OnLogin(int cookie, int statusCode, string statusString, string accountHandle)
-        {
-            if (Events.ContainsKey(cookie))
-                Events[cookie].Set();
-        }
-
-        #endregion Callbacks
-    }
-}
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/CookComputing.XmlRpcV2.dll b/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/CookComputing.XmlRpcV2.dll
deleted file mode 100644
index 4dd869c..0000000
Binary files a/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/CookComputing.XmlRpcV2.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.Utilities.dll b/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.Utilities.dll
deleted file mode 100644
index bbc662c..0000000
Binary files a/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.Utilities.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.Utilities.pdb b/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.Utilities.pdb
deleted file mode 100644
index d9a52dd..0000000
Binary files a/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.Utilities.pdb and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.dll b/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.dll
deleted file mode 100644
index c2f9982..0000000
Binary files a/old/libsl1550/libsecondlife/libsecondlife.Utilities/bin/Release/libsecondlife.dll and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/libsecondlife.Utilities.csproj b/old/libsl1550/libsecondlife/libsecondlife.Utilities/libsecondlife.Utilities.csproj
deleted file mode 100644
index c06d0d4..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Utilities/libsecondlife.Utilities.csproj
+++ /dev/null
@@ -1,64 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>libsecondlife.Utilities</RootNamespace>
-    <AssemblyName>libsecondlife.Utilities</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="RegistrationApi.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="TCPPipe.cs" />
-    <Compile Include="Utilities.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="VoiceManager.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="VoiceManagerBlocking.cs">
-      <SubType>Code</SubType>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\libsecondlife.csproj">
-      <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
-      <Name>libsecondlife</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/libsecondlife.Utilities/libsecondlife.Utilities.mdp b/old/libsl1550/libsecondlife/libsecondlife.Utilities/libsecondlife.Utilities.mdp
deleted file mode 100644
index 30d6db5..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.Utilities/libsecondlife.Utilities.mdp
+++ /dev/null
@@ -1,27 +0,0 @@
-<Project name="libsecondlife.Utilities" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
-  <Configurations active="Debug">
-    <Configuration name="Debug" ctype="DotNetProjectConfiguration">
-      <Output directory="../bin/Debug" assembly="libsecondlife.Utilities" />
-      <Build debugmode="True" target="Library" />
-      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
-      <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
-    </Configuration>
-    <Configuration name="Release" ctype="DotNetProjectConfiguration">
-      <Output directory="../bin/Debug" assembly="libsecondlife.Utilities" />
-      <Build debugmode="False" target="Library" />
-      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
-      <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
-    </Configuration>
-  </Configurations>
-  <DeployTargets />
-  <Contents>
-    <File name="./Properties/AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
-    <File name="./Utilities.cs" subtype="Code" buildaction="Compile" />
-  </Contents>
-  <References>
-    <ProjectReference type="Project" localcopy="True" refto="libsecondlife" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  </References>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/libsecondlife.build b/old/libsl1550/libsecondlife/libsecondlife.build
deleted file mode 100644
index 8b36cda..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.build
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-<project name="libsecondlife" default="build">
-	<sysinfo />
-
-	<!-- global framework settings -->
-	<property name="target.framework" value="${framework::get-target-framework()}" />
-	<property name="assembly.dir" value="${framework::get-assembly-directory(target.framework)}" />
-
-	<!-- global project settings -->
-	<xmlpeek verbose="false"
-	  file="../libsecondlife.build"
-	  xpath="/project/property[@name = 'project.version']/@value"
-	  property="project.version" />
-	<property name="build.number"
-	   value="${math::abs(math::floor(timespan::get-total-days(datetime::now() - datetime::parse('01/01/2002'))))}" />
-	<property name="assembly" value="libsecondlife" />
-	<property name="bin_dir" value="../bin" />
-
-	<!-- default configuration -->
-	<property name="project.config" value="debug" />
-	<!-- debug|release -->
-
-	<!-- named configurations -->
-	<target name="init" description="Initializes build properties">
-		<call target="${project.config}" />
-	</target>
-
-	<target name="debug" description="configures a debug build">
-		<property name="build.debug" value="true" />
-		<property name="package.name"
-		  value="${project::get-name()}-${project.version}-${project.config}" />
-		<property name="assembly.configuration"
-		  value="${framework::get-target-framework()}.${platform::get-name()} [${project.config}]" />
-	</target>
-
-	<target name="release" description="configures a release build">
-		<property name="project.config" value="release" />
-		<property name="build.debug"    value="false" />
-		<property name="package.name"   value="${project::get-name()}-${project.version}" />
-		<property name="assembly.configuration"
-		  value="${framework::get-target-framework()}.${platform::get-name()}" />
-	</target>
-
-	<!-- build tasks -->
-	<target name="map" depends="init" description="generates the packet map source code">
-		<mkdir dir="${bin_dir}" failonerror="true"/>
-
-		<csc target="exe" output="../bin/mapgenerator.exe" debug="${build.debug}">
-			<sources>
-				<include name="mapgenerator/mapgenerator.cs" />
-				<include name="mapgenerator/ProtocolManager.cs" />
-			</sources>
-		</csc>
-		<!-- Does _Packets_.cs really need to be reproduced? -->
-		<!-- Don't do it unless we have must, otherwise lots of stuff recompiles. -->
-		<uptodate property="_Packets_.cs.uptodate">
-			<sourcefiles>
-				<include name="../bin/mapgenerator.exe" />
-				<include name="../data/message_template.msg mapgenerator/template.cs" />
-			</sourcefiles>
-			<targetfiles>
-				<include name="_Packets_.cs" />
-			</targetfiles>
-		</uptodate>
-		<exec program="../bin/mapgenerator.exe" output="_Packets_.cs" useruntimeengine="true" unless="${_Packets_.cs.uptodate}">
-			<arg line="../data/message_template.msg mapgenerator/template.cs mapgenerator/unusedpackets.txt _Packets_.cs" />
-		</exec>
-	</target>
-
-	<target name="build" depends="init" description="compiles the source code">
-	    <if test="${property::exists('CCNetLabel')}">
-			<!-- Produce AssemblyInfo.cs for libsecondlife.dll -->
-			<asminfo output="AssemblyInfo.cs" language="CSharp">
-				<imports>
-					<import namespace="System" />
-					<import namespace="System.Reflection" />
-					<import namespace="System.Runtime.InteropServices" />
-				</imports>
-				<attributes>
-					<attribute type="ComVisibleAttribute" value="false" />
-					<attribute type="CLSCompliantAttribute" value="false" />
-					<attribute type="AssemblyVersionAttribute" value="${CCNetLabel}" />
-					<attribute type="AssemblyTitleAttribute" value="libsecondlife" />
-					<attribute type="AssemblyDescriptionAttribute" value="Networking layer for Second Life" />
-					<attribute type="AssemblyCopyrightAttribute" value="Copyright © libsecondlife 2006" />
-				</attributes>
-			</asminfo>
-		</if>
-
-		<!-- Make sure the bin/ directory exists -->
-		<mkdir dir="${bin_dir}" failonerror="true"/>
-
-		<!-- Compile the library -->
-		<csc target="library" unsafe="true" output="../bin/libsecondlife.dll" doc="../bin/libsecondlife.xml" debug="${build.debug}">
-			<sources>
-				<include name="*.cs" />
-				<include name="LLSD/*.cs" />
-				<include name="Capabilities/*.cs" />
-				<include name="libsecondlife.Utilities/*.cs" />
-			</sources>
-                        <resources dynamicprefix="true" prefix="libsecondlife" basedir="." failonempty="true">
-                            <include name="Resources/*.tga" />
-                            <include name="Resources/*.xml" />
-			</resources>
-			<references>
-				<include name="${bin_dir}/CookComputing.XmlRpcV2.dll" />
-				<include name="System.Drawing.dll" />
-			</references>
-			<nowarn>
-			    <warning number="1591" />
-			</nowarn>
-		</csc>
-
-		<!-- Create the avatar_data directory -->
-		<mkdir dir="${bin_dir}/avatar_data" failonerror="false"/>
-
-		<!-- Copy the resource files to the avatar_data dir -->
-		<copy todir="${bin_dir}/avatar_data">
-    		<fileset basedir="Resources">
-        		<include name="*.*" />
-    		</fileset>
-		</copy>
-	</target>
-
-	<target name="test-dll" depends="init build" description="makes the test dll">
-		<csc target="library" output="libsecondlife.Tests/tests.dll">
-			<sources>
-				<include name="libsecondlife.Tests/*.cs" />
-			</sources>
-			<references>
-				<include name="libsecondlife.dll" />
-				<include name="NUnit.dll" />
-			</references>
-		</csc>
-	</target>
-
-	<target name="clean" description="remove build output">
-		<delete failonerror="false">
-			<fileset basedir="${bin_dir}/">
-				<include name="libsecondlife.dll" />
-				<include name="libsecondlife.dll.mdb" />
-				<include name="mapgenerator.exe" />
-			</fileset>
-		</delete>
-	</target>
-</project>
diff --git a/old/libsl1550/libsecondlife/libsecondlife.csproj b/old/libsl1550/libsecondlife/libsecondlife.csproj
deleted file mode 100644
index 9baeb8d..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.csproj
+++ /dev/null
@@ -1,189 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</ProjectGuid>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>
-    </ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>libsecondlife</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
-    <OutputType>Library</OutputType>
-    <RootNamespace>libsecondlife</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>
-    </StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>..\bin\</OutputPath>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>full</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>..\..\..\OpenSimDev\bin\</OutputPath>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
-    <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
-    <WarningLevel>4</WarningLevel>
-    <DebugType>none</DebugType>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="CookComputing.XmlRpcV2, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\bin\CookComputing.XmlRpcV2.dll</HintPath>
-    </Reference>
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.Data">
-      <Name>System.Data</Name>
-    </Reference>
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Xml">
-      <Name>System.XML</Name>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="AgentManager.cs" />
-    <Compile Include="AgentManagerCamera.cs" />
-    <Compile Include="AgentManagerMovement.cs" />
-    <Compile Include="AgentThrottle.cs" />
-    <Compile Include="Animations.cs" />
-    <Compile Include="AppearanceManager.cs" />
-    <Compile Include="AssemblyInfo.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="AssetManager.cs" />
-    <Compile Include="AssetTypes.cs" />
-    <Compile Include="Avatar.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="AvatarManager.cs" />
-    <Compile Include="BakeLayer.cs" />
-    <Compile Include="BitPack.cs" />
-    <Compile Include="BlockingQueue.cs" />
-    <Compile Include="Capabilities\CapsClient.cs" />
-    <Compile Include="Capabilities\CapsListener.cs" />
-    <Compile Include="Capabilities\CapsBase.cs">
-      <SubType>Component</SubType>
-    </Compile>
-    <Compile Include="Capabilities\EventQueueClient.cs" />
-    <Compile Include="Capabilities\EventQueueListener.cs" />
-    <Compile Include="Caps.cs" />
-    <Compile Include="CapsToPacket.cs" />
-    <Compile Include="CoordinateFrame.cs" />
-    <Compile Include="EventDictionary.cs" />
-    <Compile Include="DirectoryManager.cs" />
-    <Compile Include="FriendsManager.cs" />
-    <Compile Include="Image.cs" />
-    <Compile Include="Inventory.cs" />
-    <Compile Include="InventoryManager.cs" />
-    <Compile Include="LLObject.cs" />
-    <Compile Include="LLSD\BinaryLLSD.cs" />
-    <Compile Include="LLSD\LLSD.cs" />
-    <Compile Include="LLSD\NotationLLSD.cs" />
-    <Compile Include="LLSD\XmlLLSD.cs" />
-    <Compile Include="Login.cs" />
-    <Compile Include="EstateTools.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="GridManager.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="GroupManager.cs" />
-    <Compile Include="Helpers.cs" />
-    <Compile Include="NameValue.cs" />
-    <Compile Include="NetworkManager.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ObjectManager.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ObjectPoolBase.cs" />
-    <Compile Include="ObjectTracker.cs" />
-    <Compile Include="OpenJPEG.cs" />
-    <Compile Include="ParcelManager.cs" />
-    <Compile Include="ParticleSystem.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Permissions.cs" />
-    <Compile Include="Prims.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ProtocolManager.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ReaderWriterLock.cs" />
-    <Compile Include="SafeDictionary.cs" />
-    <Compile Include="SecondLife.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Settings.cs" />
-    <Compile Include="Simulator.cs" />
-    <Compile Include="SoundManager.cs" />
-    <Compile Include="TerrainManager.cs" />
-    <Compile Include="TextureEntry.cs" />
-    <Compile Include="TGALoader.cs" />
-    <Compile Include="ThreadUtil.cs" />
-    <Compile Include="InventoryNode.cs" />
-    <Compile Include="InventoryNodeDictionary.cs" />
-    <Compile Include="Types.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="UDPBase.cs" />
-    <Compile Include="_Packets_.cs" />
-    <Compile Include="_VisualParam_.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>xcopy "$(ProjectDir)\Resources\*.*" "$(OutDir)libsl_data" /i /d /y</PostBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/libsecondlife.sln b/old/libsl1550/libsecondlife/libsecondlife.sln
deleted file mode 100644
index a83d93a..0000000
--- a/old/libsl1550/libsecondlife/libsecondlife.sln
+++ /dev/null
@@ -1,138 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libsecondlife", "libsecondlife.csproj", "{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sldump", "examples\sldump\sldump.csproj", "{F6258A68-C624-46A0-BA73-B55D21BB0A3B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "slaccountant", "examples\slaccountant\slaccountant.csproj", "{FC19D5F6-076E-4923-8456-9B0E00E22896}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "name2key", "examples\name2key\name2key.csproj", "{66FFD34E-652C-4EF5-81FE-06AD011169D2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mapgenerator", "mapgenerator\mapgenerator.csproj", "{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "groupmanager", "examples\groupmanager\groupmanager.csproj", "{F460FAB3-0D12-4873-89EB-2696818764B8}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestClient", "examples\TestClient\TestClient.csproj", "{B87682F6-B2D7-4C4D-A529-400C24FD4880}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libsecondlife.Utilities", "libsecondlife.Utilities\libsecondlife.Utilities.csproj", "{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libsecondlife.Tests", "libsecondlife.Tests\libsecondlife.Tests.csproj", "{E0BCBBAE-A620-431A-9EB7-30173EAF195B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualParamGenerator", "VisualParamGenerator\VisualParamGenerator.csproj", "{D2A514C5-5590-4789-9032-6E5B4C297B80}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Heightmap", "examples\Heightmap\Heightmap.csproj", "{D9669D08-AC81-4F45-AD23-82787C6EFBBA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "key2name", "examples\Key2Name\key2name.csproj", "{4FF68142-9C61-42D1-87DC-5D37CB671C29}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Baker", "examples\Baker\Baker.csproj", "{4A32A4E5-717C-4B60-B3D7-704518684893}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Decoder", "..\Decoder\Decoder.csproj", "{7AE16AC1-E64C-4FDC-9B85-4BB6145D511C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecondGlance", "..\SecondGlance\SecondGlance.csproj", "{D72C92D1-559A-48A7-93F5-99F4E99F3F98}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLProxy", "..\SLProxy\SLProxy.csproj", "{E4115DC9-FC88-47D6-B3B6-2400AD19B80D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatConsole", "..\SLProxy\ChatConsole.csproj", "{D8ECCBE1-AC71-4054-AAA6-2D50E5629504}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GUITestClient", "examples\GUITestClient\GUITestClient.csproj", "{9E0EE72D-AAA7-42EC-8E59-2C3EA5ED6D98}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "importprimscript", "..\importprimscript\importprimscript.csproj", "{32A7AA59-5129-4446-A6DC-2F581ED1A25C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLImageUpload", "..\SLImageUpload\SLImageUpload.csproj", "{F3BDC0BC-74EB-451E-8FFE-AA162474F2F2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VoiceTest", "..\VoiceTest\VoiceTest.csproj", "{B69597A7-5DC5-4564-9089-727D0348EB4E}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Release|Any CPU.Build.0 = Release|Any CPU
-		{F6258A68-C624-46A0-BA73-B55D21BB0A3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{F6258A68-C624-46A0-BA73-B55D21BB0A3B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{F6258A68-C624-46A0-BA73-B55D21BB0A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{F6258A68-C624-46A0-BA73-B55D21BB0A3B}.Release|Any CPU.Build.0 = Release|Any CPU
-		{FC19D5F6-076E-4923-8456-9B0E00E22896}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{FC19D5F6-076E-4923-8456-9B0E00E22896}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{FC19D5F6-076E-4923-8456-9B0E00E22896}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{FC19D5F6-076E-4923-8456-9B0E00E22896}.Release|Any CPU.Build.0 = Release|Any CPU
-		{66FFD34E-652C-4EF5-81FE-06AD011169D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{66FFD34E-652C-4EF5-81FE-06AD011169D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{66FFD34E-652C-4EF5-81FE-06AD011169D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{66FFD34E-652C-4EF5-81FE-06AD011169D2}.Release|Any CPU.Build.0 = Release|Any CPU
-		{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}.Release|Any CPU.Build.0 = Release|Any CPU
-		{F460FAB3-0D12-4873-89EB-2696818764B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{F460FAB3-0D12-4873-89EB-2696818764B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{F460FAB3-0D12-4873-89EB-2696818764B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{F460FAB3-0D12-4873-89EB-2696818764B8}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B87682F6-B2D7-4C4D-A529-400C24FD4880}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{B87682F6-B2D7-4C4D-A529-400C24FD4880}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{B87682F6-B2D7-4C4D-A529-400C24FD4880}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{B87682F6-B2D7-4C4D-A529-400C24FD4880}.Release|Any CPU.Build.0 = Release|Any CPU
-		{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{CE5E06C2-2428-416B-ADC1-F1FE16A0FB27}.Release|Any CPU.Build.0 = Release|Any CPU
-		{E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D2A514C5-5590-4789-9032-6E5B4C297B80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{D2A514C5-5590-4789-9032-6E5B4C297B80}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{D2A514C5-5590-4789-9032-6E5B4C297B80}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{D2A514C5-5590-4789-9032-6E5B4C297B80}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D9669D08-AC81-4F45-AD23-82787C6EFBBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{D9669D08-AC81-4F45-AD23-82787C6EFBBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{D9669D08-AC81-4F45-AD23-82787C6EFBBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{D9669D08-AC81-4F45-AD23-82787C6EFBBA}.Release|Any CPU.Build.0 = Release|Any CPU
-		{4FF68142-9C61-42D1-87DC-5D37CB671C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{4FF68142-9C61-42D1-87DC-5D37CB671C29}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{4FF68142-9C61-42D1-87DC-5D37CB671C29}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{4FF68142-9C61-42D1-87DC-5D37CB671C29}.Release|Any CPU.Build.0 = Release|Any CPU
-		{4A32A4E5-717C-4B60-B3D7-704518684893}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{4A32A4E5-717C-4B60-B3D7-704518684893}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{4A32A4E5-717C-4B60-B3D7-704518684893}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{4A32A4E5-717C-4B60-B3D7-704518684893}.Release|Any CPU.Build.0 = Release|Any CPU
-		{7AE16AC1-E64C-4FDC-9B85-4BB6145D511C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{7AE16AC1-E64C-4FDC-9B85-4BB6145D511C}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{7AE16AC1-E64C-4FDC-9B85-4BB6145D511C}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{7AE16AC1-E64C-4FDC-9B85-4BB6145D511C}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D72C92D1-559A-48A7-93F5-99F4E99F3F98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{D72C92D1-559A-48A7-93F5-99F4E99F3F98}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{D72C92D1-559A-48A7-93F5-99F4E99F3F98}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{D72C92D1-559A-48A7-93F5-99F4E99F3F98}.Release|Any CPU.Build.0 = Release|Any CPU
-		{E4115DC9-FC88-47D6-B3B6-2400AD19B80D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{E4115DC9-FC88-47D6-B3B6-2400AD19B80D}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{E4115DC9-FC88-47D6-B3B6-2400AD19B80D}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{E4115DC9-FC88-47D6-B3B6-2400AD19B80D}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D8ECCBE1-AC71-4054-AAA6-2D50E5629504}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{D8ECCBE1-AC71-4054-AAA6-2D50E5629504}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{D8ECCBE1-AC71-4054-AAA6-2D50E5629504}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{D8ECCBE1-AC71-4054-AAA6-2D50E5629504}.Release|Any CPU.Build.0 = Release|Any CPU
-		{9E0EE72D-AAA7-42EC-8E59-2C3EA5ED6D98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{9E0EE72D-AAA7-42EC-8E59-2C3EA5ED6D98}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{9E0EE72D-AAA7-42EC-8E59-2C3EA5ED6D98}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{9E0EE72D-AAA7-42EC-8E59-2C3EA5ED6D98}.Release|Any CPU.Build.0 = Release|Any CPU
-		{32A7AA59-5129-4446-A6DC-2F581ED1A25C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{32A7AA59-5129-4446-A6DC-2F581ED1A25C}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{32A7AA59-5129-4446-A6DC-2F581ED1A25C}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{32A7AA59-5129-4446-A6DC-2F581ED1A25C}.Release|Any CPU.Build.0 = Release|Any CPU
-		{F3BDC0BC-74EB-451E-8FFE-AA162474F2F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{F3BDC0BC-74EB-451E-8FFE-AA162474F2F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{F3BDC0BC-74EB-451E-8FFE-AA162474F2F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{F3BDC0BC-74EB-451E-8FFE-AA162474F2F2}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B69597A7-5DC5-4564-9089-727D0348EB4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{B69597A7-5DC5-4564-9089-727D0348EB4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{B69597A7-5DC5-4564-9089-727D0348EB4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{B69597A7-5DC5-4564-9089-727D0348EB4E}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/old/libsl1550/libsecondlife/libsecondlife.suo b/old/libsl1550/libsecondlife/libsecondlife.suo
deleted file mode 100644
index bc5a2df..0000000
Binary files a/old/libsl1550/libsecondlife/libsecondlife.suo and /dev/null differ
diff --git a/old/libsl1550/libsecondlife/mapgenerator/Properties/AssemblyInfo.cs b/old/libsl1550/libsecondlife/mapgenerator/Properties/AssemblyInfo.cs
deleted file mode 100644
index 08ce28d..0000000
--- a/old/libsl1550/libsecondlife/mapgenerator/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("mapgenerator")]
-[assembly: AssemblyDescription("C# class generator from the Second Life message template")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("libsecondlife")]
-[assembly: AssemblyProduct("mapgenerator")]
-[assembly: AssemblyCopyright("Copyright © libsecondlife 2006")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("87314973-b32d-4dab-b0da-ab3c5280d268")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/old/libsl1550/libsecondlife/mapgenerator/ProtocolManager.cs b/old/libsl1550/libsecondlife/mapgenerator/ProtocolManager.cs
deleted file mode 100644
index b318325..0000000
--- a/old/libsl1550/libsecondlife/mapgenerator/ProtocolManager.cs
+++ /dev/null
@@ -1,691 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace libsecondlife
-{
-    /// <summary>
-    ///
-    /// </summary>
-	public enum PacketFrequency
-	{
-        /// <summary></summary>
-		Low,
-        /// <summary></summary>
-		Medium,
-        /// <summary></summary>
-		High
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public enum FieldType
-	{
-        /// <summary></summary>
-		U8,
-        /// <summary></summary>
-		U16,
-        /// <summary></summary>
-		U32,
-        /// <summary></summary>
-		U64,
-        /// <summary></summary>
-		S8,
-        /// <summary></summary>
-		S16,
-        /// <summary></summary>
-		S32,
-        /// <summary></summary>
-		F32,
-        /// <summary></summary>
-		F64,
-        /// <summary></summary>
-		LLUUID,
-        /// <summary></summary>
-		BOOL,
-        /// <summary></summary>
-		LLVector3,
-        /// <summary></summary>
-		LLVector3d,
-        /// <summary></summary>
-		LLVector4,
-        /// <summary></summary>
-		LLQuaternion,
-        /// <summary></summary>
-		IPADDR,
-        /// <summary></summary>
-		IPPORT,
-        /// <summary></summary>
-		Variable,
-        /// <summary></summary>
-		Fixed,
-        /// <summary></summary>
-		Single,
-        /// <summary></summary>
-		Multiple
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public class MapField : IComparable
-	{
-        /// <summary></summary>
-		public int KeywordPosition;
-        /// <summary></summary>
-		public string Name;
-        /// <summary></summary>
-		public FieldType Type;
-        /// <summary></summary>
-		public int Count;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-		public int CompareTo(object obj)
-		{
-			MapField temp = (MapField)obj;
-
-			if (this.KeywordPosition > temp.KeywordPosition)
-			{
-				return 1;
-			}
-			else
-			{
-				if(temp.KeywordPosition == this.KeywordPosition)
-				{
-					return 0;
-				}
-				else
-				{
-					return -1;
-				}
-			}
-		}
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public class MapBlock : IComparable
-	{
-        /// <summary></summary>
-		public int KeywordPosition;
-        /// <summary></summary>
-		public string Name;
-        /// <summary></summary>
-		public int Count;
-        /// <summary></summary>
-		public List<MapField> Fields;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-		public int CompareTo(object obj)
-		{
-			MapBlock temp = (MapBlock)obj;
-
-			if (this.KeywordPosition > temp.KeywordPosition)
-			{
-				return 1;
-			}
-			else
-			{
-				if(temp.KeywordPosition == this.KeywordPosition)
-				{
-					return 0;
-				}
-				else
-				{
-					return -1;
-				}
-			}
-		}
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public class MapPacket
-	{
-        /// <summary></summary>
-		public ushort ID;
-        /// <summary></summary>
-		public string Name;
-        /// <summary></summary>
-		public PacketFrequency Frequency;
-        /// <summary></summary>
-		public bool Trusted;
-        /// <summary></summary>
-		public bool Encoded;
-        /// <summary></summary>
-		public List<MapBlock> Blocks;
-	}
-
-    /// <summary>
-    ///
-    /// </summary>
-	public class ProtocolManager
-	{
-        /// <summary></summary>
-		public Dictionary<FieldType, int> TypeSizes;
-        /// <summary></summary>
-		public Dictionary<string, int> KeywordPositions;
-        /// <summary></summary>
-		public MapPacket[] LowMaps;
-        /// <summary></summary>
-		public MapPacket[] MediumMaps;
-        /// <summary></summary>
-		public MapPacket[] HighMaps;
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="keywordFile"></param>
-        /// <param name="mapFile"></param>
-        /// <param name="client"></param>
-		public ProtocolManager(string mapFile)
-		{
-			// Initialize the map arrays
-			LowMaps = new MapPacket[65536];
-			MediumMaps = new MapPacket[256];
-			HighMaps = new MapPacket[256];
-
-			// Build the type size hash table
-			TypeSizes = new Dictionary<FieldType,int>();
-			TypeSizes.Add(FieldType.U8, 1);
-			TypeSizes.Add(FieldType.U16, 2);
-			TypeSizes.Add(FieldType.U32, 4);
-			TypeSizes.Add(FieldType.U64, 8);
-			TypeSizes.Add(FieldType.S8, 1);
-			TypeSizes.Add(FieldType.S16, 2);
-			TypeSizes.Add(FieldType.S32, 4);
-			TypeSizes.Add(FieldType.F32, 4);
-			TypeSizes.Add(FieldType.F64, 8);
-			TypeSizes.Add(FieldType.LLUUID, 16);
-			TypeSizes.Add(FieldType.BOOL, 1);
-			TypeSizes.Add(FieldType.LLVector3, 12);
-			TypeSizes.Add(FieldType.LLVector3d, 24);
-			TypeSizes.Add(FieldType.LLVector4, 16);
-			TypeSizes.Add(FieldType.LLQuaternion, 16);
-			TypeSizes.Add(FieldType.IPADDR, 4);
-			TypeSizes.Add(FieldType.IPPORT, 2);
-			TypeSizes.Add(FieldType.Variable, -1);
-			TypeSizes.Add(FieldType.Fixed, -2);
-
-            KeywordPositions = new Dictionary<string, int>();
-			LoadMapFile(mapFile);
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="command"></param>
-        /// <returns></returns>
-		public MapPacket Command(string command)
-		{
-			foreach (MapPacket map in HighMaps)
-			{
-				if (map != null)
-				{
-					if (command == map.Name)
-					{
-						return map;
-					}
-				}
-			}
-
-			foreach (MapPacket map in MediumMaps)
-			{
-				if (map != null)
-				{
-					if (command == map.Name)
-					{
-						return map;
-					}
-				}
-			}
-
-			foreach (MapPacket map in LowMaps)
-			{
-				if (map != null)
-				{
-					if (command == map.Name)
-					{
-						return map;
-					}
-				}
-			}
-
-			throw new Exception("Cannot find map for command \"" + command + "\"");
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="data"></param>
-        /// <returns></returns>
-		public MapPacket Command(byte[] data)
-		{
-			ushort command;
-
-			if (data.Length < 5)
-			{
-				return null;
-			}
-
-			if (data[4] == 0xFF)
-			{
-				if ((byte)data[5] == 0xFF)
-				{
-					// Low frequency
-					command = (ushort)(data[6] * 256 + data[7]);
-					return Command(command, PacketFrequency.Low);
-				}
-				else
-				{
-					// Medium frequency
-					command = (ushort)data[5];
-					return Command(command, PacketFrequency.Medium);
-				}
-			}
-			else
-			{
-				// High frequency
-				command = (ushort)data[4];
-				return Command(command, PacketFrequency.High);
-			}
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="command"></param>
-        /// <param name="frequency"></param>
-        /// <returns></returns>
-		public MapPacket Command(ushort command, PacketFrequency frequency)
-		{
-			switch (frequency)
-			{
-				case PacketFrequency.High:
-					return HighMaps[command];
-				case PacketFrequency.Medium:
-					return MediumMaps[command];
-				case PacketFrequency.Low:
-					return LowMaps[command];
-			}
-
-			throw new Exception("Cannot find map for command \"" + command + "\" with frequency \"" + frequency + "\"");
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-		public void PrintMap(TextWriter writer)
-		{
-            PrintOneMap(writer, LowMaps, "Low   ");
-            PrintOneMap(writer, MediumMaps, "Medium");
-            PrintOneMap(writer, HighMaps, "High  ");
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="map"></param>
-        /// <param name="frequency"></param>
-		private void PrintOneMap(TextWriter writer, MapPacket[] map, string frequency) {
-			int i;
-
-			for (i = 0; i < map.Length; ++i)
-			{
-				if (map[i] != null)
-				{
-					writer.WriteLine("{0} {1,5} - {2} - {3} - {4}", frequency, i, map[i].Name,
-						map[i].Trusted ? "Trusted" : "Untrusted",
-						map[i].Encoded ? "Unencoded" : "Zerocoded");
-
-					foreach (MapBlock block in map[i].Blocks)
-					{
-						if (block.Count == -1)
-						{
-							writer.WriteLine("\t{0,4} {1} (Variable)", block.KeywordPosition, block.Name);
-						}
-						else
-						{
-							writer.WriteLine("\t{0,4} {1} ({2})", block.KeywordPosition, block.Name, block.Count);
-						}
-
-						foreach (MapField field in block.Fields)
-						{
-							writer.WriteLine("\t\t{0,4} {1} ({2} / {3})", field.KeywordPosition, field.Name,
-								field.Type, field.Count);
-						}
-					}
-				}
-			}
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="mapFile"></param>
-        /// <param name="outputFile"></param>
-		public static void DecodeMapFile(string mapFile, string outputFile)
-		{
-			byte magicKey = 0;
-			byte[] buffer = new byte[2048];
-			int nread;
-			BinaryReader map;
-			BinaryWriter output;
-
-			try
-			{
-				map = new BinaryReader(new FileStream(mapFile, FileMode.Open));
-			}
-			catch(Exception e)
-			{
-				throw new Exception("Map file error", e);
-			}
-
-			try
-			{
-				output = new BinaryWriter(new FileStream(outputFile, FileMode.CreateNew));
-			}
-			catch(Exception e)
-			{
-				throw new Exception("Map file error", e);
-			}
-
-			while ((nread = map.Read(buffer, 0, 2048)) != 0)
-			{
-				for (int i = 0; i < nread; ++i)
-				{
-					buffer[i] ^= magicKey;
-					magicKey += 43;
-				}
-
-				output.Write(buffer, 0, nread);
-			}
-
-			map.Close();
-			output.Close();
-		}
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="mapFile"></param>
-		private void LoadMapFile(string mapFile)
-		{
-			FileStream map;
-
-			// Load the protocol map file
-			try
-			{
-				map = new FileStream(mapFile, FileMode.Open, FileAccess.Read);
-			}
-			catch(Exception e)
-			{
-				throw new Exception("Map file error", e);
-			}
-
-			try
-			{
-				StreamReader r = new StreamReader(map);
-				r.BaseStream.Seek(0, SeekOrigin.Begin);
-				string newline;
-				string trimmedline;
-				bool inPacket = false;
-				bool inBlock = false;
-				MapPacket currentPacket = null;
-				MapBlock currentBlock = null;
-				char[] trimArray = new char[] {' ', '\t'};
-
-				// While not at the end of the file
-				while (r.Peek() > -1)
-				{
-					#region ParseMap
-
-					newline = r.ReadLine();
-					trimmedline = System.Text.RegularExpressions.Regex.Replace(newline, @"\s+", " ");
-					trimmedline = trimmedline.Trim(trimArray);
-
-					if (!inPacket)
-					{
-						// Outside of all packet blocks
-
-						if (trimmedline == "{")
-						{
-							inPacket = true;
-						}
-					}
-					else
-					{
-						// Inside of a packet block
-
-						if (!inBlock)
-						{
-							// Inside a packet block, outside of the blocks
-
-							if (trimmedline == "{")
-							{
-								inBlock = true;
-							}
-							else if (trimmedline == "}")
-							{
-								// Reached the end of the packet
-								// currentPacket.Blocks.Sort();
-								inPacket = false;
-							}
-							else
-							{
-								// The packet header
-								#region ParsePacketHeader
-
-								// Splice the string in to tokens
-								string[] tokens = trimmedline.Split(new char[] {' ', '\t'});
-
-								if (tokens.Length > 3)
-								{
-                                    //Hash packet name to insure correct keyword ordering
-                                    KeywordPosition(tokens[0]);
-
-									uint packetID;
-
-									// Remove the leading "0x"
-									if (tokens[2].Length > 2 && tokens[2].Substring(0, 2) == "0x")
-									{
-										tokens[2] = tokens[2].Substring(2, tokens[2].Length - 2);
-										packetID = UInt32.Parse(tokens[2], System.Globalization.NumberStyles.HexNumber);
-									} else {
-										packetID = UInt32.Parse(tokens[2]);
-									}
-
-
-									if (tokens[1] == "Fixed")
-									{
-
-										// Truncate the id to a short
-										packetID &= 0xFFFF;
-										LowMaps[packetID] = new MapPacket();
-										LowMaps[packetID].ID = (ushort)packetID;
-										LowMaps[packetID].Frequency = PacketFrequency.Low;
-										LowMaps[packetID].Name = tokens[0];
-										LowMaps[packetID].Trusted = (tokens[3] == "Trusted");
-										LowMaps[packetID].Encoded = (tokens[4] == "Zerocoded");
-										LowMaps[packetID].Blocks = new List<MapBlock>();
-
-										currentPacket = LowMaps[packetID];
-									}
-									else if (tokens[1] == "Low")
-									{
-										LowMaps[packetID] = new MapPacket();
-										LowMaps[packetID].ID = (ushort)packetID;
-										LowMaps[packetID].Frequency = PacketFrequency.Low;
-										LowMaps[packetID].Name = tokens[0];
-										LowMaps[packetID].Trusted = (tokens[2] == "Trusted");
-										LowMaps[packetID].Encoded = (tokens[3] == "Zerocoded");
-										LowMaps[packetID].Blocks = new List<MapBlock>();
-
-										currentPacket = LowMaps[packetID];
-
-									}
-									else if (tokens[1] == "Medium")
-									{
-										MediumMaps[packetID] = new MapPacket();
-										MediumMaps[packetID].ID = (ushort)packetID;
-										MediumMaps[packetID].Frequency = PacketFrequency.Medium;
-										MediumMaps[packetID].Name = tokens[0];
-										MediumMaps[packetID].Trusted = (tokens[2] == "Trusted");
-										MediumMaps[packetID].Encoded = (tokens[3] == "Zerocoded");
-										MediumMaps[packetID].Blocks = new List<MapBlock>();
-
-										currentPacket = MediumMaps[packetID];
-
-									}
-									else if (tokens[1] == "High")
-									{
-										HighMaps[packetID] = new MapPacket();
-										HighMaps[packetID].ID = (ushort)packetID;
-										HighMaps[packetID].Frequency = PacketFrequency.High;
-										HighMaps[packetID].Name = tokens[0];
-										HighMaps[packetID].Trusted = (tokens[2] == "Trusted");
-										HighMaps[packetID].Encoded = (tokens[3] == "Zerocoded");
-										HighMaps[packetID].Blocks = new List<MapBlock>();
-
-										currentPacket = HighMaps[packetID];
-
-									}
-									else
-									{
-										//Client.Log("Unknown packet frequency", Helpers.LogLevel.Error);
-                                        throw new Exception("Unknown packet frequency");
-									}
-								}
-
-								#endregion
-							}
-						}
-						else
-						{
-							if (trimmedline.Length > 0 && trimmedline.Substring(0, 1) == "{")
-							{
-								// A field
-								#region ParseField
-
-								MapField field = new MapField();
-
-								// Splice the string in to tokens
-								string[] tokens = trimmedline.Split(new char[] {' ', '\t'});
-
-								field.Name = tokens[1];
-								field.KeywordPosition = KeywordPosition(field.Name);
-								field.Type = (FieldType)Enum.Parse(typeof(FieldType), tokens[2], true);
-
-								if (tokens[3] != "}")
-								{
-									field.Count = Int32.Parse(tokens[3]);
-								}
-								else
-								{
-									field.Count = 1;
-								}
-
-								// Save this field to the current block
-								currentBlock.Fields.Add(field);
-
-								#endregion
-							}
-							else if (trimmedline == "}")
-							{
-								// currentBlock.Fields.Sort();
-								inBlock = false;
-							}
-							else if (trimmedline.Length != 0 && trimmedline.Substring(0, 2) != "//")
-							{
-								// The block header
-								#region ParseBlockHeader
-
-								currentBlock = new MapBlock();
-
-								// Splice the string in to tokens
-								string[] tokens = trimmedline.Split(new char[] {' ', '\t'});
-
-								currentBlock.Name = tokens[0];
-								currentBlock.KeywordPosition = KeywordPosition(currentBlock.Name);
-								currentBlock.Fields = new List<MapField>();
-								currentPacket.Blocks.Add(currentBlock);
-
-								if (tokens[1] == "Single")
-								{
-									currentBlock.Count = 1;
-								}
-								else if (tokens[1] == "Multiple")
-								{
-									currentBlock.Count = Int32.Parse(tokens[2]);
-								}
-								else if (tokens[1] == "Variable")
-								{
-									currentBlock.Count = -1;
-								}
-								else
-								{
-									//Client.Log("Unknown block frequency", Helpers.LogLevel.Error);
-                                    throw new Exception("Unknown block frequency");
-								}
-
-								#endregion
-							}
-						}
-					}
-
-					#endregion
-				}
-
-				r.Close();
-				map.Close();
-			}
-			catch (Exception e)
-			{
-                throw e;
-			}
-		}
-
-		private int KeywordPosition(string keyword)
-		{
-			if (KeywordPositions.ContainsKey(keyword))
-			{
-				return KeywordPositions[keyword];
-			}
-
-            int hash = 0;
-            for (int i = 1; i < keyword.Length; i++)
-            {
-                hash = (hash + (int)(keyword[i])) * 2;
-            }
-            hash *= 2;
-            hash &= 0x1FFF;
-
-            int startHash = hash;
-
-            while (KeywordPositions.ContainsValue(hash))
-            {
-                hash++;
-                hash &= 0x1FFF;
-                if (hash == startHash)
-                {
-                    //Give up looking, went through all values and they were all taken.
-                    throw new Exception("All hash values are taken. Failed to add keyword: " + keyword);
-                }
-            }
-
-            KeywordPositions[keyword] = hash;
-            return hash;
-		}
-    }
-}
diff --git a/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.cs b/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.cs
deleted file mode 100644
index adc2346..0000000
--- a/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.cs
+++ /dev/null
@@ -1,980 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using libsecondlife;
-
-namespace mapgenerator
-{
-    class mapgenerator
-    {
-        static void WriteFieldMember(TextWriter writer, MapField field)
-        {
-            string type = String.Empty;
-
-            switch (field.Type)
-            {
-                case FieldType.BOOL:
-                    type = "bool";
-                    break;
-                case FieldType.F32:
-                    type = "float";
-                    break;
-                case FieldType.F64:
-                    type = "double";
-                    break;
-                case FieldType.IPPORT:
-                case FieldType.U16:
-                    type = "ushort";
-                    break;
-                case FieldType.IPADDR:
-                case FieldType.U32:
-                    type = "uint";
-                    break;
-                case FieldType.LLQuaternion:
-                    type = "LLQuaternion";
-                    break;
-                case FieldType.LLUUID:
-                    type = "LLUUID";
-                    break;
-                case FieldType.LLVector3:
-                    type = "LLVector3";
-                    break;
-                case FieldType.LLVector3d:
-                    type = "LLVector3d";
-                    break;
-                case FieldType.LLVector4:
-                    type = "LLVector4";
-                    break;
-                case FieldType.S16:
-                    type = "short";
-                    break;
-                case FieldType.S32:
-                    type = "int";
-                    break;
-                case FieldType.S8:
-                    type = "sbyte";
-                    break;
-                case FieldType.U64:
-                    type = "ulong";
-                    break;
-                case FieldType.U8:
-                    type = "byte";
-                    break;
-                case FieldType.Fixed:
-                    type = "byte[]";
-                    break;
-            }
-            if (field.Type != FieldType.Variable)
-            {
-                //writer.WriteLine("            /// <summary>" + field.Name + " field</summary>");
-                writer.WriteLine("            public " + type + " " + field.Name + ";");
-            }
-            else
-            {
-                writer.WriteLine("            private byte[] _" + field.Name.ToLower() + ";");
-                //writer.WriteLine("            /// <summary>" + field.Name + " field</summary>");
-                writer.WriteLine("            public byte[] " + field.Name + Environment.NewLine + "            {");
-                writer.WriteLine("                get { return _" + field.Name.ToLower() + "; }");
-                writer.WriteLine("                set" + Environment.NewLine + "                {");
-                writer.WriteLine("                    if (value == null) { _" +
-                    field.Name.ToLower() + " = null; return; }");
-                writer.WriteLine("                    if (value.Length > " +
-                    ((field.Count == 1) ? "255" : "1500") + ") { throw new OverflowException(" +
-                    "\"Value exceeds " + ((field.Count == 1) ? "255" : "1500") + " characters\"); }");
-                writer.WriteLine("                    else { _" + field.Name.ToLower() +
-                    " = new byte[value.Length]; Buffer.BlockCopy(value, 0, _" +
-                    field.Name.ToLower() + ", 0, value.Length); }");
-                writer.WriteLine("                }" + Environment.NewLine + "            }");
-            }
-        }
-
-        static void WriteFieldFromBytes(TextWriter writer, MapField field)
-        {
-            switch (field.Type)
-            {
-                case FieldType.BOOL:
-                    writer.WriteLine("                    " +
-                        field.Name + " = (bytes[i++] != 0) ? (bool)true : (bool)false;");
-                    break;
-                case FieldType.F32:
-                    writer.WriteLine("                    " +
-                        "if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 4);");
-                    writer.WriteLine("                    " +
-                        field.Name + " = BitConverter.ToSingle(bytes, i); i += 4;");
-                    break;
-                case FieldType.F64:
-                    writer.WriteLine("                    " +
-                        "if (!BitConverter.IsLittleEndian) Array.Reverse(bytes, i, 8);");
-                    writer.WriteLine("                    " +
-                        field.Name + " = BitConverter.ToDouble(bytes, i); i += 8;");
-                    break;
-                case FieldType.Fixed:
-                    writer.WriteLine("                    " + field.Name + " = new byte[" + field.Count + "];");
-                    writer.WriteLine("                    Buffer.BlockCopy(bytes, i, " + field.Name +
-                        ", 0, " + field.Count + "); i += " + field.Count + ";");
-                    break;
-                case FieldType.IPADDR:
-                case FieldType.U32:
-                    writer.WriteLine("                    " + field.Name +
-                        " = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));");
-                    break;
-                case FieldType.IPPORT:
-                    // IPPORT is big endian while U16/S16 are little endian. Go figure
-                    writer.WriteLine("                    " + field.Name +
-                        " = (ushort)((bytes[i++] << 8) + bytes[i++]);");
-                    break;
-                case FieldType.U16:
-                    writer.WriteLine("                    " + field.Name +
-                        " = (ushort)(bytes[i++] + (bytes[i++] << 8));");
-                    break;
-                case FieldType.LLQuaternion:
-                    writer.WriteLine("                    " + field.Name + ".FromBytes(bytes, i, true); i += 12;");
-                    break;
-                case FieldType.LLUUID:
-                    writer.WriteLine("                    " + field.Name + ".FromBytes(bytes, i); i += 16;");
-                    break;
-                case FieldType.LLVector3:
-                    writer.WriteLine("                    " + field.Name + ".FromBytes(bytes, i); i += 12;");
-                    break;
-                case FieldType.LLVector3d:
-                    writer.WriteLine("                    " + field.Name + ".FromBytes(bytes, i); i += 24;");
-                    break;
-                case FieldType.LLVector4:
-                    writer.WriteLine("                    " + field.Name + ".FromBytes(bytes, i); i += 16;");
-                    break;
-                case FieldType.S16:
-                    writer.WriteLine("                    " + field.Name +
-                        " = (short)(bytes[i++] + (bytes[i++] << 8));");
-                    break;
-                case FieldType.S32:
-                    writer.WriteLine("                    " + field.Name +
-                        " = (int)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));");
-                    break;
-                case FieldType.S8:
-                    writer.WriteLine("                    " + field.Name +
-                        " = (sbyte)bytes[i++];");
-                    break;
-                case FieldType.U64:
-                    writer.WriteLine("                    " + field.Name +
-                        " = (ulong)((ulong)bytes[i++] + ((ulong)bytes[i++] << 8) + " +
-                        "((ulong)bytes[i++] << 16) + ((ulong)bytes[i++] << 24) + " +
-                        "((ulong)bytes[i++] << 32) + ((ulong)bytes[i++] << 40) + " +
-                        "((ulong)bytes[i++] << 48) + ((ulong)bytes[i++] << 56));");
-                    break;
-                case FieldType.U8:
-                    writer.WriteLine("                    " + field.Name +
-                        " = (byte)bytes[i++];");
-                    break;
-                case FieldType.Variable:
-                    if (field.Count == 1)
-                    {
-                        writer.WriteLine("                    length = (ushort)bytes[i++];");
-                    }
-                    else
-                    {
-                        writer.WriteLine("                    length = (ushort)(bytes[i++] + (bytes[i++] << 8));");
-                    }
-                    writer.WriteLine("                    _" + field.Name.ToLower() + " = new byte[length];");
-                    writer.WriteLine("                    Buffer.BlockCopy(bytes, i, _" + field.Name.ToLower() +
-                        ", 0, length); i += length;");
-                    break;
-                default:
-                    writer.WriteLine("!!! ERROR: Unhandled FieldType: " + field.Type.ToString() + " !!!");
-                    break;
-            }
-        }
-
-        static void WriteFieldToBytes(TextWriter writer, MapField field)
-        {
-            writer.Write("                ");
-
-            switch (field.Type)
-            {
-                case FieldType.BOOL:
-                    writer.WriteLine("bytes[i++] = (byte)((" + field.Name + ") ? 1 : 0);");
-                    break;
-                case FieldType.F32:
-                    writer.WriteLine("ba = BitConverter.GetBytes(" + field.Name + ");" + Environment.NewLine +
-                        "                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 4); }" + Environment.NewLine +
-                        "                Buffer.BlockCopy(ba, 0, bytes, i, 4); i += 4;");
-                    break;
-                case FieldType.F64:
-                    writer.WriteLine("ba = BitConverter.GetBytes(" + field.Name + ");" + Environment.NewLine +
-                        "                if(!BitConverter.IsLittleEndian) { Array.Reverse(ba, 0, 8); }" + Environment.NewLine +
-                        "                Buffer.BlockCopy(ba, 0, bytes, i, 8); i += 8;");
-                    break;
-                case FieldType.Fixed:
-                    writer.WriteLine("                Buffer.BlockCopy(" + field.Name + ", 0, bytes, i, " + field.Count + ");" +
-                        "i += " + field.Count + ";");
-                    break;
-                case FieldType.IPPORT:
-                    // IPPORT is big endian while U16/S16 is little endian. Go figure
-                    writer.WriteLine("bytes[i++] = (byte)((" + field.Name + " >> 8) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)(" + field.Name + " % 256);");
-                    break;
-                case FieldType.U16:
-                case FieldType.S16:
-                    writer.WriteLine("bytes[i++] = (byte)(" + field.Name + " % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 8) % 256);");
-                    break;
-                case FieldType.LLUUID:
-                    writer.WriteLine("Buffer.BlockCopy(" + field.Name + ".GetBytes(), 0, bytes, i, 16); i += 16;");
-                    break;
-                case FieldType.LLVector4:
-                    writer.WriteLine("Buffer.BlockCopy(" + field.Name + ".GetBytes(), 0, bytes, i, 16); i += 16;");
-                    break;
-                case FieldType.LLQuaternion:
-                case FieldType.LLVector3:
-                    writer.WriteLine("Buffer.BlockCopy(" + field.Name + ".GetBytes(), 0, bytes, i, 12); i += 12;");
-                    break;
-                case FieldType.LLVector3d:
-                    writer.WriteLine("Buffer.BlockCopy(" + field.Name + ".GetBytes(), 0, bytes, i, 24); i += 24;");
-                    break;
-                case FieldType.U8:
-                    writer.WriteLine("bytes[i++] = " + field.Name + ";");
-                    break;
-                case FieldType.S8:
-                    writer.WriteLine("bytes[i++] = (byte)" + field.Name + ";");
-                    break;
-                case FieldType.IPADDR:
-                case FieldType.U32:
-                case FieldType.S32:
-                    writer.WriteLine("bytes[i++] = (byte)(" + field.Name + " % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 8) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 16) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 24) % 256);");
-                    break;
-                case FieldType.U64:
-                    writer.WriteLine("bytes[i++] = (byte)(" + field.Name + " % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 8) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 16) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 24) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 32) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 40) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 48) % 256);");
-                    writer.WriteLine("                bytes[i++] = (byte)((" + field.Name + " >> 56) % 256);");
-                    break;
-                case FieldType.Variable:
-                    writer.WriteLine("if(" + field.Name + " == null) { Console.WriteLine(\"Warning: " + field.Name + " is null, in \" + this.GetType()); }");
-                    writer.Write("                ");
-                    if (field.Count == 1)
-                    {
-                        writer.WriteLine("bytes[i++] = (byte)" + field.Name + ".Length;");
-                    }
-                    else
-                    {
-                        writer.WriteLine("bytes[i++] = (byte)(" + field.Name + ".Length % 256);");
-                        writer.WriteLine("                bytes[i++] = (byte)((" +
-                            field.Name + ".Length >> 8) % 256);");
-                    }
-                    writer.WriteLine("                Buffer.BlockCopy(" + field.Name + ", 0, bytes, i, " +
-                        field.Name + ".Length); " + "i += " + field.Name + ".Length;");
-                    break;
-                default:
-                    writer.WriteLine("!!! ERROR: Unhandled FieldType: " + field.Type.ToString() + " !!!");
-                    break;
-            }
-        }
-
-        static int GetFieldLength(TextWriter writer, MapField field)
-        {
-            switch(field.Type)
-            {
-                case FieldType.BOOL:
-                case FieldType.U8:
-                case FieldType.S8:
-                    return 1;
-                case FieldType.U16:
-                case FieldType.S16:
-                case FieldType.IPPORT:
-                    return 2;
-                case FieldType.U32:
-                case FieldType.S32:
-                case FieldType.F32:
-                case FieldType.IPADDR:
-                    return 4;
-                case FieldType.U64:
-                case FieldType.F64:
-                    return 8;
-                case FieldType.LLVector3:
-                case FieldType.LLQuaternion:
-                    return 12;
-                case FieldType.LLUUID:
-                case FieldType.LLVector4:
-                //case FieldType.LLQuaternion:
-                    return 16;
-                case FieldType.LLVector3d:
-                    return 24;
-                case FieldType.Fixed:
-                    return field.Count;
-                case FieldType.Variable:
-                    return 0;
-                default:
-                    writer.WriteLine("!!! ERROR: Unhandled FieldType " + field.Type.ToString() + " !!!");
-                    return 0;
-            }
-        }
-
-        static void WriteBlockClass(TextWriter writer, MapBlock block, MapPacket packet)
-        {
-            bool variableFields = false;
-            bool floatFields = false;
-
-            //writer.WriteLine("        /// <summary>" + block.Name + " block</summary>");
-            writer.WriteLine("        /// <exclude/>");
-            //writer.WriteLine("        [XmlType(\"" + packet.Name.ToLower() + "_" + block.Name.ToLower() + "\")]");
-            writer.WriteLine("        public class " + block.Name + "Block" + Environment.NewLine + "        {");
-
-            foreach (MapField field in block.Fields)
-            {
-                WriteFieldMember(writer, field);
-
-                if (field.Type == FieldType.Variable) { variableFields = true; }
-                if (field.Type == FieldType.F32 || field.Type == FieldType.F64) { floatFields = true; }
-            }
-
-            // Length property
-            writer.WriteLine("");
-            //writer.WriteLine("            /// <summary>Length of this block serialized in bytes</summary>");
-            writer.WriteLine(//"            [XmlIgnore]" + Environment.NewLine +
-                             "            public int Length" + Environment.NewLine +
-                             "            {" + Environment.NewLine +
-                             "                get" + Environment.NewLine +
-                             "                {");
-            int length = 0;
-
-            // Figure out the length of this block
-            foreach (MapField field in block.Fields)
-            {
-                length += GetFieldLength(writer, field);
-            }
-
-            if (!variableFields)
-            {
-                writer.WriteLine("                    return " + length + ";");
-            }
-            else
-            {
-                writer.WriteLine("                    int length = " + length + ";");
-
-                foreach (MapField field in block.Fields)
-                {
-                    if (field.Type == FieldType.Variable)
-                    {
-                        writer.WriteLine("                    if (" + field.Name +
-                            " != null) { length += " + field.Count + " + " + field.Name + ".Length; }");
-                    }
-                }
-
-                writer.WriteLine("                    return length;");
-            }
-
-            writer.WriteLine("                }" + Environment.NewLine + "            }" + Environment.NewLine);
-
-            // Default constructor
-            //writer.WriteLine("            /// <summary>Default constructor</summary>");
-            writer.WriteLine("            public " + block.Name + "Block() { }");
-
-            // Constructor for building the class from bytes
-            //writer.WriteLine("            /// <summary>Constructor for building the block from a byte array</summary>");
-            writer.WriteLine("            public " + block.Name + "Block(byte[] bytes, ref int i)" + Environment.NewLine +
-                "            {" + Environment.NewLine +
-                "                FromBytes(bytes, ref i);" + Environment.NewLine +
-                "            }" + Environment.NewLine);
-
-            // Initiates instance variables from a byte message
-            writer.WriteLine("            public void FromBytes(byte[] bytes, ref int i)" + Environment.NewLine +
-                "            {");
-
-            // Declare a length variable if we need it for variable fields in this constructor
-            if (variableFields) { writer.WriteLine("                int length;"); }
-
-            // Start of the try catch block
-            writer.WriteLine("                try" + Environment.NewLine + "                {");
-
-            foreach (MapField field in block.Fields)
-            {
-                WriteFieldFromBytes(writer, field);
-            }
-
-            writer.WriteLine("                }" + Environment.NewLine +
-                "                catch (Exception)" + Environment.NewLine +
-                "                {" + Environment.NewLine +
-                "                    throw new MalformedDataException();" + Environment.NewLine +
-                "                }" + Environment.NewLine + "            }" + Environment.NewLine);
-
-            // ToBytes() function
-            //writer.WriteLine("            /// <summary>Serialize this block to a byte array</summary>");
-            writer.WriteLine("            public void ToBytes(byte[] bytes, ref int i)" + Environment.NewLine +
-                "            {");
-
-            // Declare a byte[] variable if we need it for floating point field conversions
-            if (floatFields) { writer.WriteLine("                byte[] ba;"); }
-
-            foreach (MapField field in block.Fields)
-            {
-                WriteFieldToBytes(writer, field);
-            }
-
-            writer.WriteLine("            }" + Environment.NewLine);
-
-            // ToString() function
-            writer.WriteLine("            public override string ToString()" + Environment.NewLine + "            {");
-            writer.WriteLine("                StringBuilder output = new StringBuilder();");
-            writer.WriteLine("                output.AppendLine(\"-- " + block.Name + " --\");");
-
-            for (int i = 0; i < block.Fields.Count; i++)
-            {
-                MapField field = block.Fields[i];
-
-                if (field.Type == FieldType.Variable || field.Type == FieldType.Fixed)
-                {
-                    writer.WriteLine("                Helpers.FieldToString(output, " + field.Name + ", \"" + field.Name + "\");");
-                    if (i != block.Fields.Count - 1) writer.WriteLine("                output.Append(Environment.NewLine);");
-                }
-                else
-                {
-                    if (i != block.Fields.Count - 1) writer.WriteLine("                output.AppendLine(String.Format(\"" + field.Name + ": {0}\", " + field.Name + "));");
-                    else writer.WriteLine("                output.Append(String.Format(\"" + field.Name + ": {0}\", " + field.Name + "));");
-                }
-            }
-
-            writer.WriteLine("                return output.ToString();" + Environment.NewLine + "            }");
-            writer.WriteLine("        }" + Environment.NewLine);
-        }
-
-        static void WritePacketClass(TextWriter writer, MapPacket packet)
-        {
-            string sanitizedName;
-
-            //writer.WriteLine("    /// <summary>" + packet.Name + " packet</summary>");
-            writer.WriteLine("    /// <exclude/>");
-            writer.WriteLine("    public class " + packet.Name + "Packet : Packet" + Environment.NewLine + "    {");
-
-            // Write out each block class
-            foreach (MapBlock block in packet.Blocks)
-            {
-                WriteBlockClass(writer, block, packet);
-            }
-
-            // Header member
-            writer.WriteLine("        private Header header;");
-            //writer.WriteLine("        /// <summary>The header for this packet</summary>");
-            writer.WriteLine("        public override Header Header { get { return header; } set { header = value; } }");
-
-            // PacketType member
-            //writer.WriteLine("        /// <summary>Will return PacketType." + packet.Name+ "</summary>");
-            writer.WriteLine("        public override PacketType Type { get { return PacketType." +
-                packet.Name + "; } }");
-
-            // Block members
-            foreach (MapBlock block in packet.Blocks)
-            {
-                // TODO: More thorough name blacklisting
-                if (block.Name == "Header") { sanitizedName = "_" + block.Name; }
-                else { sanitizedName = block.Name; }
-
-                //writer.WriteLine("        /// <summary>" + block.Name + " block</summary>");
-                writer.WriteLine("        public " + block.Name + "Block" +
-                    ((block.Count != 1) ? "[]" : "") + " " + sanitizedName + ";");
-            }
-
-            writer.WriteLine("");
-
-            // Default constructor
-            //writer.WriteLine("        /// <summary>Default constructor</summary>");
-            writer.WriteLine("        public " + packet.Name + "Packet()" + Environment.NewLine + "        {");
-            writer.WriteLine("            Header = new " + packet.Frequency.ToString() + "Header();");
-            writer.WriteLine("            Header.ID = " + packet.ID + ";");
-            writer.WriteLine("            Header.Reliable = true;"); // Turn the reliable flag on by default
-            if (packet.Encoded) { writer.WriteLine("            Header.Zerocoded = true;"); }
-            foreach (MapBlock block in packet.Blocks)
-            {
-                if (block.Name == "Header") { sanitizedName = "_" + block.Name; }
-                else { sanitizedName = block.Name; }
-
-                if (block.Count == 1)
-                {
-                    // Single count block
-                    writer.WriteLine("            " + sanitizedName + " = new " + block.Name + "Block();");
-                }
-                else if (block.Count == -1)
-                {
-                    // Variable count block
-                    writer.WriteLine("            " + sanitizedName + " = new " + block.Name + "Block[0];");
-                }
-                else
-                {
-                    // Multiple count block
-                    writer.WriteLine("            " + sanitizedName + " = new " + block.Name + "Block[" + block.Count + "];");
-                }
-            }
-            writer.WriteLine("        }" + Environment.NewLine);
-
-            // Constructor that takes a byte array and beginning position only (no prebuilt header)
-            bool seenVariable = false;
-            //writer.WriteLine("        /// <summary>Constructor that takes a byte array and beginning position (no prebuilt header)</summary>");
-            writer.WriteLine("        public " + packet.Name + "Packet(byte[] bytes, ref int i) : this()" + Environment.NewLine +
-                "        {" + Environment.NewLine +
-                "            int packetEnd = bytes.Length - 1;" + Environment.NewLine +
-                "            FromBytes(bytes, ref i, ref packetEnd, null);" + Environment.NewLine +
-                "        }" + Environment.NewLine);
-
-            writer.WriteLine("        override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)" + Environment.NewLine + "        {");
-            writer.WriteLine("            header.FromBytes(bytes, ref i, ref packetEnd);");
-            writer.WriteLine("            if (header.Zerocoded && zeroBuffer != null)");
-            writer.WriteLine("            {");
-            writer.WriteLine("                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;");
-            writer.WriteLine("                bytes = zeroBuffer;");
-            writer.WriteLine("            }");
-
-            foreach (MapBlock block in packet.Blocks)
-            {
-                if (block.Name == "Header") { sanitizedName = "_" + block.Name; }
-                else { sanitizedName = block.Name; }
-
-                if (block.Count == 1)
-                {
-                    // Single count block
-                    writer.WriteLine("            " + sanitizedName + ".FromBytes(bytes, ref i);");
-                }
-                else if (block.Count == -1)
-                {
-                    // Variable count block
-                    if (!seenVariable)
-                    {
-                        writer.WriteLine("            int count = (int)bytes[i++];");
-                        seenVariable = true;
-                    }
-                    else
-                    {
-                        writer.WriteLine("            count = (int)bytes[i++];");
-                    }
-                    writer.WriteLine("            if(" + sanitizedName + ".Length < count) {");
-                    writer.WriteLine("                " + sanitizedName + " = new " + block.Name + "Block[count];");
-                    writer.WriteLine("                for(int j = 0; j < count; j++) " + sanitizedName + "[j] = new " + block.Name + "Block();");
-                    writer.WriteLine("            }");
-                    writer.WriteLine("            for (int j = 0; j < count; j++)");
-                    writer.WriteLine("            { " + sanitizedName + "[j].FromBytes(bytes, ref i); }");
-                }
-                else
-                {
-                    // Multiple count block
-                    writer.WriteLine("            if(" + sanitizedName + ".Length < " + block.Count+") {");
-                    writer.WriteLine("                " + sanitizedName + " = new " + block.Name + "Block[" + block.Count + "];");
-                    writer.WriteLine("                for(int j = 0; j < " + block.Count + "; j++) " + sanitizedName + "[j] = new " + block.Name + "Block();");
-                    writer.WriteLine("            }");
-                    writer.WriteLine("            for (int j = 0; j < " + block.Count + "; j++)");
-                    writer.WriteLine("            { " + sanitizedName + "[j].FromBytes(bytes, ref i); }");
-                }
-            }
-            writer.WriteLine("        }" + Environment.NewLine);
-
-            seenVariable = false;
-
-            // Constructor that takes a byte array and a prebuilt header
-            //writer.WriteLine("        /// <summary>Constructor that takes a byte array and a prebuilt header</summary>");
-            writer.WriteLine("        public " + packet.Name + "Packet(Header head, byte[] bytes, ref int i): this()" + Environment.NewLine +
-                "        {" + Environment.NewLine +
-                "            int packetEnd = bytes.Length - 1;" + Environment.NewLine +
-                "            FromBytes(head, bytes, ref i, ref packetEnd, null);" + Environment.NewLine +
-                "        }" + Environment.NewLine);
-
-            writer.WriteLine("        override public void FromBytes(Header head, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)" + Environment.NewLine + "        {");
-            writer.WriteLine("            Header = head;");
-            writer.WriteLine("            if (head.Zerocoded && zeroBuffer != null)");
-            writer.WriteLine("            {");
-            writer.WriteLine("                packetEnd = Helpers.ZeroDecode(bytes, packetEnd + 1, zeroBuffer) - 1;");
-            writer.WriteLine("                bytes = zeroBuffer;");
-            writer.WriteLine("            }");
-            foreach (MapBlock block in packet.Blocks)
-            {
-                if (block.Name == "Header") { sanitizedName = "_" + block.Name; }
-                else { sanitizedName = block.Name; }
-
-                if (block.Count == 1)
-                {
-                    // Single count block
-                    writer.WriteLine("            " + sanitizedName + ".FromBytes(bytes, ref i);");
-                }
-                else if (block.Count == -1)
-                {
-                    // Variable count block
-                    if (!seenVariable)
-                    {
-                        writer.WriteLine("            int count = (int)bytes[i++];");
-                        seenVariable = true;
-                    }
-                    else
-                    {
-                        writer.WriteLine("            count = (int)bytes[i++];");
-                    }
-                    writer.WriteLine("            if(" + sanitizedName + ".Length < count) {");
-                    writer.WriteLine("                " + sanitizedName + " = new " + block.Name + "Block[count];");
-                    writer.WriteLine("                for(int j = 0; j < count; j++) " + sanitizedName + "[j] = new " + block.Name + "Block();");
-                    writer.WriteLine("            }");
-                    writer.WriteLine("            for (int j = 0; j < count; j++)");
-                    writer.WriteLine("            { " + sanitizedName + "[j].FromBytes(bytes, ref i); }");
-                }
-                else
-                {
-                    // Multiple count block
-                    writer.WriteLine("            if(" + sanitizedName + ".Length < " + block.Count+") {");
-                    writer.WriteLine("                " + sanitizedName + " = new " + block.Name + "Block[" + block.Count + "];");
-                    writer.WriteLine("                for(int j = 0; j < " + block.Count + "; j++) " + sanitizedName + "[j] = new " + block.Name + "Block();");
-                    writer.WriteLine("            }");
-                    writer.WriteLine("            for (int j = 0; j < " + block.Count + "; j++)");
-                    writer.WriteLine("            { " + sanitizedName + "[j].FromBytes(bytes, ref i); }");
-                }
-            }
-            writer.WriteLine("        }" + Environment.NewLine);
-
-            // ToBytes() function
-            //writer.WriteLine("        /// <summary>Serialize this packet to a byte array</summary><returns>A byte array containing the serialized packet</returns>");
-            writer.WriteLine("        public override byte[] ToBytes()" + Environment.NewLine + "        {");
-
-            writer.Write("            int length = ");
-            if (packet.Frequency == PacketFrequency.Low) { writer.WriteLine("10;"); }
-            else if (packet.Frequency == PacketFrequency.Medium) { writer.WriteLine("8;"); }
-            else { writer.WriteLine("7;"); }
-
-            foreach (MapBlock block in packet.Blocks)
-            {
-                if (block.Name == "Header") { sanitizedName = "_" + block.Name; }
-                else { sanitizedName = block.Name; }
-
-                if (block.Count == 1)
-                {
-                    // Single count block
-                    writer.Write("            length += " + sanitizedName + ".Length;");
-                }
-            }
-            writer.WriteLine(";");
-
-            foreach (MapBlock block in packet.Blocks)
-            {
-                if (block.Name == "Header") { sanitizedName = "_" + block.Name; }
-                else { sanitizedName = block.Name; }
-
-                if (block.Count == -1)
-                {
-                    writer.WriteLine("            length++;");
-                    writer.WriteLine("            for (int j = 0; j < " + sanitizedName +
-                        ".Length; j++) { length += " + sanitizedName + "[j].Length; }");
-                }
-                else if (block.Count > 1)
-                {
-                    writer.WriteLine("            for (int j = 0; j < " + block.Count +
-                        "; j++) { length += " + sanitizedName + "[j].Length; }");
-                }
-            }
-
-            writer.WriteLine("            if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }");
-            writer.WriteLine("            byte[] bytes = new byte[length];");
-            writer.WriteLine("            int i = 0;");
-            writer.WriteLine("            header.ToBytes(bytes, ref i);");
-            foreach (MapBlock block in packet.Blocks)
-            {
-                if (block.Name == "Header") { sanitizedName = "_" + block.Name; }
-                else { sanitizedName = block.Name; }
-
-                if (block.Count == -1)
-                {
-                    // Variable count block
-                    writer.WriteLine("            bytes[i++] = (byte)" + sanitizedName + ".Length;");
-                    writer.WriteLine("            for (int j = 0; j < " + sanitizedName +
-                        ".Length; j++) { " + sanitizedName + "[j].ToBytes(bytes, ref i); }");
-                }
-                else if (block.Count == 1)
-                {
-                    writer.WriteLine("            " + sanitizedName + ".ToBytes(bytes, ref i);");
-                }
-                else
-                {
-                    // Multiple count block
-                    writer.WriteLine("            for (int j = 0; j < " + block.Count +
-                        "; j++) { " + sanitizedName + "[j].ToBytes(bytes, ref i); }");
-                }
-            }
-
-            writer.WriteLine("            if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }");
-            writer.WriteLine("            return bytes;" + Environment.NewLine + "        }" + Environment.NewLine);
-
-            // ToString() function
-            //writer.WriteLine("        /// <summary>Serialize this packet to a string</summary><returns>A string containing the serialized packet</returns>");
-            writer.WriteLine("        public override string ToString()" + Environment.NewLine + "        {");
-            writer.WriteLine("            string output = \"--- " + packet.Name + " ---\" + Environment.NewLine;");
-
-            foreach (MapBlock block in packet.Blocks)
-            {
-                if (block.Name == "Header") { sanitizedName = "_" + block.Name; }
-                else { sanitizedName = block.Name; }
-
-                if (block.Count == -1)
-                {
-                    // Variable count block
-                    writer.WriteLine("            for (int j = 0; j < " +
-                        sanitizedName + ".Length; j++)" + Environment.NewLine + "            {");
-                    writer.WriteLine("                output += " + sanitizedName +
-                        "[j].ToString() + Environment.NewLine;" + Environment.NewLine + "            }");
-                }
-                else if (block.Count == 1)
-                {
-                    writer.WriteLine("                output += " + sanitizedName + ".ToString() + Environment.NewLine;");
-                }
-                else
-                {
-                    // Multiple count block
-                    writer.WriteLine("            for (int j = 0; j < " +
-                        block.Count + "; j++)" + Environment.NewLine + "            {");
-                    writer.WriteLine("                output += " + sanitizedName +
-                        "[j].ToString() + Environment.NewLine;" + Environment.NewLine + "            }");
-                }
-            }
-
-            writer.WriteLine("            return output;" + Environment.NewLine + "        }" + Environment.NewLine);
-
-            // Closing function bracket
-            writer.WriteLine("    }" + Environment.NewLine);
-        }
-
-        static int Main(string[] args)
-        {
-            ProtocolManager protocol;
-            List<string> unused = new List<string>();
-            TextWriter writer;
-
-            try
-            {
-                if (args.Length != 4)
-                {
-                    Console.WriteLine("Usage: [message_template.msg] [template.cs] [unusedpackets.txt] [_Packets_.cs]");
-                    return -1;
-                }
-
-                writer = new StreamWriter(args[3]);
-                protocol = new ProtocolManager(args[0]);
-
-                // Build a list of unused packets
-                using (StreamReader unusedReader = new StreamReader(args[2]))
-                {
-                    while (unusedReader.Peek() >= 0)
-                    {
-                        unused.Add(unusedReader.ReadLine().Trim());
-                    }
-                }
-
-                // Read in the template.cs file and write it to our output
-                TextReader reader = new StreamReader(args[1]);
-                writer.WriteLine(reader.ReadToEnd());
-                reader.Close();
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine(e.ToString());
-                return -2;
-            }
-
-
-            // Prune all of the unused packets out of the protocol
-            int i = 0;
-            foreach (MapPacket packet in protocol.LowMaps)
-            {
-                if (packet != null && unused.Contains(packet.Name))
-                    protocol.LowMaps[i] = null;
-                i++;
-            }
-            i = 0;
-            foreach (MapPacket packet in protocol.MediumMaps)
-            {
-                if (packet != null && unused.Contains(packet.Name))
-                    protocol.MediumMaps[i] = null;
-                i++;
-            }
-            i = 0;
-            foreach (MapPacket packet in protocol.HighMaps)
-            {
-                if (packet != null && unused.Contains(packet.Name))
-                    protocol.HighMaps[i] = null;
-                i++;
-            }
-
-
-            // Write the PacketType enum
-            writer.WriteLine("    public enum PacketType" + Environment.NewLine + "    {" + Environment.NewLine +
-                "        /// <summary>A generic value, not an actual packet type</summary>" + Environment.NewLine +
-                "        Default,");
-            foreach (MapPacket packet in protocol.LowMaps)
-                if (packet != null)
-                    writer.WriteLine("        " + packet.Name + " = " + (0x10000 | packet.ID)  + ",");
-            foreach (MapPacket packet in protocol.MediumMaps)
-                if (packet != null)
-                    writer.WriteLine("        " + packet.Name + " = " + (0x20000 | packet.ID) + ",");
-            foreach (MapPacket packet in protocol.HighMaps)
-                if (packet != null)
-                    writer.WriteLine("        " + packet.Name + " = " + (0x30000 | packet.ID) + ",");
-            writer.WriteLine("    }" + Environment.NewLine);
-
-
-            // Write all of the XmlInclude statements for the Packet class to allow packet serialization
-            //writer.WriteLine("#if PACKETSERIALIZE");
-            //foreach (MapPacket packet in protocol.LowMaps)
-            //    if (packet != null)
-            //        writer.WriteLine("    [XmlInclude(typeof(" + packet.Name + "Packet))]");
-            //foreach (MapPacket packet in protocol.MediumMaps)
-            //    if (packet != null)
-            //        writer.WriteLine("    [XmlInclude(typeof(" + packet.Name + "Packet))]");
-            //foreach (MapPacket packet in protocol.HighMaps)
-            //    if (packet != null)
-            //        writer.WriteLine("    [XmlInclude(typeof(" + packet.Name + "Packet))]");
-            //writer.WriteLine("#endif");
-
-            // Write the base Packet class
-            writer.WriteLine(
-                "    public abstract partial class Packet" + Environment.NewLine + "    {" + Environment.NewLine +
-                "        public abstract Header Header { get; set; }" + Environment.NewLine +
-                "        public abstract PacketType Type { get; }" + Environment.NewLine +
-                "        public abstract void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);" + Environment.NewLine +
-                "        public abstract void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);" + Environment.NewLine +
-                "        public int TickCount;" + Environment.NewLine + Environment.NewLine +
-                "        public abstract byte[] ToBytes();" //+ Environment.NewLine + Environment.NewLine +
-                //"        public void ToXml(XmlWriter xmlWriter)" + Environment.NewLine +
-                //"        {" + Environment.NewLine +
-                //"            XmlSerializer serializer = new XmlSerializer(typeof(Packet));" + Environment.NewLine +
-                //"            serializer.Serialize(xmlWriter, this);" + Environment.NewLine +
-                //"        }");
-            );
-
-
-            // Write the Packet.GetType() function
-            writer.WriteLine(
-                "        public static PacketType GetType(ushort id, PacketFrequency frequency)" + Environment.NewLine +
-                "        {" + Environment.NewLine +
-                "            switch (frequency)" + Environment.NewLine +
-                "            {" + Environment.NewLine +
-                "                case PacketFrequency.Low:" + Environment.NewLine +
-                "                    switch (id)" + Environment.NewLine +
-                "                    {");
-            foreach (MapPacket packet in protocol.LowMaps)
-                if (packet != null)
-                    writer.WriteLine("                        case " + packet.ID + ": return PacketType." + packet.Name + ";");
-            writer.WriteLine("                    }" + Environment.NewLine +
-                "                    break;" + Environment.NewLine +
-                "                case PacketFrequency.Medium:" + Environment.NewLine +
-                "                    switch (id)" + Environment.NewLine + "                    {");
-            foreach (MapPacket packet in protocol.MediumMaps)
-                if (packet != null)
-                    writer.WriteLine("                        case " + packet.ID + ": return PacketType." + packet.Name + ";");
-            writer.WriteLine("                    }" + Environment.NewLine +
-                "                    break;" + Environment.NewLine +
-                "                case PacketFrequency.High:" + Environment.NewLine +
-                "                    switch (id)" + Environment.NewLine + "                    {");
-            foreach (MapPacket packet in protocol.HighMaps)
-                if (packet != null)
-                    writer.WriteLine("                        case " + packet.ID + ": return PacketType." + packet.Name + ";");
-            writer.WriteLine("                    }" + Environment.NewLine +
-                "                    break;" + Environment.NewLine + "            }" + Environment.NewLine + Environment.NewLine +
-                "            return PacketType.Default;" + Environment.NewLine + "        }" + Environment.NewLine);
-
-            // TODO: Not sure if this function is useful to anyone, but if it is it needs to be
-            // rewritten to not overwrite passed in pointers and decode the entire packet just
-            // to read the header
-
-            // Write the Packet.GetType() function
-            //writer.WriteLine(
-            //    "        public static PacketType GetType(byte[] bytes, int packetEnd, byte[] zeroBuffer)" + Environment.NewLine +
-            //    "        {" + Environment.NewLine + "            ushort id; PacketFrequency freq;" + Environment.NewLine +
-            //    "            int i = 0, end = packetEnd;" + Environment.NewLine +
-            //    "            Header header = Header.BuildHeader(bytes, ref i, ref end);" + Environment.NewLine +
-            //    "            if (header.Zerocoded)" + Environment.NewLine + "            {" + Environment.NewLine +
-            //    "                end = Helpers.ZeroDecode(bytes, end + 1, zeroBuffer) - 1;" + Environment.NewLine +
-            //    "                bytes = zeroBuffer;" + Environment.NewLine + "            }" + Environment.NewLine + Environment.NewLine +
-            //    "            if (bytes[6] == 0xFF)" + Environment.NewLine + "            {" + Environment.NewLine +
-            //    "                if (bytes[7] == 0xFF)" + Environment.NewLine + "                {" + Environment.NewLine +
-            //    "                    id = (ushort)((bytes[8] << 8) + bytes[9]); freq = PacketFrequency.Low;" + Environment.NewLine +
-            //    "                }" + Environment.NewLine +
-            //    "                else" + Environment.NewLine +
-            //    "                {" + Environment.NewLine + "                    id = (ushort)bytes[7];  freq = PacketFrequency.Medium;" +
-            //    Environment.NewLine + "                }" + Environment.NewLine + "            }" + Environment.NewLine +
-            //    "            else" + Environment.NewLine + "            {" + Environment.NewLine +
-            //    "                id = (ushort)bytes[6];  freq = PacketFrequency.High;" + Environment.NewLine +
-            //    "            }" + Environment.NewLine +
-            //    "            return GetType(id, freq);" + Environment.NewLine +
-            //    "        }" + Environment.NewLine);
-
-            // Write the Packet.BuildPacket(PacketType) function
-            writer.WriteLine("        public static Packet BuildPacket(PacketType type)");
-            writer.WriteLine("        {");
-            foreach (MapPacket packet in protocol.HighMaps)
-                if (packet != null)
-                    writer.WriteLine("            if(type == PacketType." + packet.Name  + ") return new " + packet.Name +"Packet();");
-            foreach (MapPacket packet in protocol.MediumMaps)
-                if (packet != null)
-                    writer.WriteLine("            if(type == PacketType." + packet.Name  + ") return new " + packet.Name +"Packet();");
-            foreach (MapPacket packet in protocol.LowMaps)
-                if (packet != null)
-                    writer.WriteLine("            if(type == PacketType." + packet.Name  + ") return new " + packet.Name +"Packet();");
-            writer.WriteLine("            return null;" + Environment.NewLine);
-            writer.WriteLine("        }" + Environment.NewLine);
-
-            // Write the Packet.BuildPacket() function
-            writer.WriteLine(
-                "        public static Packet BuildPacket(byte[] packetBuffer, ref int packetEnd, byte[] zeroBuffer)" + Environment.NewLine +
-                "        {" + Environment.NewLine +
-                "            byte[] bytes; ushort id; PacketFrequency freq;" + Environment.NewLine +
-                "            int i = 0;" + Environment.NewLine +
-                "            Header header = Header.BuildHeader(packetBuffer, ref i, ref packetEnd);" + Environment.NewLine +
-                "            if (header.Zerocoded)" + Environment.NewLine +
-                "            {" + Environment.NewLine +
-                "                packetEnd = Helpers.ZeroDecode(packetBuffer, packetEnd + 1, zeroBuffer) - 1;" + Environment.NewLine +
-                "                bytes = zeroBuffer;" + Environment.NewLine +
-                "            }" + Environment.NewLine +
-                "            else" + Environment.NewLine +
-                "            {" + Environment.NewLine +
-                "                bytes = packetBuffer;" + Environment.NewLine +
-                "            }" + Environment.NewLine + Environment.NewLine +
-                "            if (bytes[6] == 0xFF)" + Environment.NewLine +
-                "            {" + Environment.NewLine +
-                "                if (bytes[7] == 0xFF)" + Environment.NewLine +
-                "                {" + Environment.NewLine +
-                "                    id = (ushort)((bytes[8] << 8) + bytes[9]); freq = PacketFrequency.Low;" + Environment.NewLine +
-                "                    switch (id)" + Environment.NewLine +
-                "                    {");
-            foreach (MapPacket packet in protocol.LowMaps)
-                if (packet != null)
-                    writer.WriteLine("                        case " + packet.ID + ": return new " + packet.Name + "Packet(header, bytes, ref i);");
-            writer.WriteLine("                    }" + Environment.NewLine + "                }" + Environment.NewLine +
-                "                else" + Environment.NewLine +
-                "                {" + Environment.NewLine + "                    id = (ushort)bytes[7];  freq = PacketFrequency.Medium;" + Environment.NewLine +
-                "                    switch (id)" + Environment.NewLine + "                    {");
-            foreach (MapPacket packet in protocol.MediumMaps)
-                if (packet != null)
-                    writer.WriteLine("                        case " + packet.ID + ": return new " + packet.Name + "Packet(header, bytes, ref i);");
-            writer.WriteLine("                    }" + Environment.NewLine + "                }" + Environment.NewLine + "            }" + Environment.NewLine +
-                "            else" + Environment.NewLine + "            {" + Environment.NewLine +
-                "                id = (ushort)bytes[6];  freq = PacketFrequency.High;" + Environment.NewLine +
-                "                switch (id)" + Environment.NewLine + "                    {");
-            foreach (MapPacket packet in protocol.HighMaps)
-                if (packet != null)
-                    writer.WriteLine("                        case " + packet.ID + ": return new " + packet.Name + "Packet(header, bytes, ref i);");
-            writer.WriteLine("                }" + Environment.NewLine + "            }" + Environment.NewLine + Environment.NewLine +
-                "            throw new MalformedDataException(\"Unknown packet ID \"+freq+\" \"+id);" + Environment.NewLine +
-                "        }" + Environment.NewLine + "    }" + Environment.NewLine);
-
-
-            // Write the packet classes
-            foreach (MapPacket packet in protocol.LowMaps)
-                if (packet != null) { WritePacketClass(writer, packet); }
-            foreach (MapPacket packet in protocol.MediumMaps)
-                if (packet != null) { WritePacketClass(writer, packet); }
-            foreach (MapPacket packet in protocol.HighMaps)
-                if (packet != null) { WritePacketClass(writer, packet); }
-
-
-            // Finish up
-            writer.WriteLine("}");
-            writer.Close();
-            return 0;
-        }
-    }
-}
diff --git a/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.csproj b/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.csproj
deleted file mode 100644
index 9f56834..0000000
--- a/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.csproj
+++ /dev/null
@@ -1,49 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>mapgenerator</RootNamespace>
-    <AssemblyName>mapgenerator</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\..\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="mapgenerator.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="ProtocolManager.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="unusedpackets.txt" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.sln b/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.sln
deleted file mode 100644
index afa656c..0000000
--- a/old/libsl1550/libsecondlife/mapgenerator/mapgenerator.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mapgenerator", "mapgenerator.csproj", "{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{C59B1312-57EF-4146-B6B2-1C7B6DC4638B}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/old/libsl1550/libsecondlife/mapgenerator/template.cs b/old/libsl1550/libsecondlife/mapgenerator/template.cs
deleted file mode 100644
index 4f7e2a3..0000000
--- a/old/libsl1550/libsecondlife/mapgenerator/template.cs
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Copyright (c) 2006, the libsecondlife development team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- *   of its contributors may be used to endorse or promote products derived from
- *   this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Text;
-using libsecondlife;
-
-namespace libsecondlife.Packets
-{
-    /// <summary>
-    /// Thrown when a packet could not be successfully deserialized
-    /// </summary>
-    public class MalformedDataException : ApplicationException
-    {
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        public MalformedDataException() { }
-
-        /// <summary>
-        /// Constructor that takes an additional error message
-        /// </summary>
-        /// <param name="Message">An error message to attach to this exception</param>
-        public MalformedDataException(string Message)
-            : base(Message)
-        {
-            this.Source = "Packet decoding";
-        }
-    }
-
-    /// <summary>
-    /// The Second Life header of a message template packet. Either 5, 6, or 8
-    /// bytes in length at the beginning of the packet, and encapsulates any
-    /// appended ACKs at the end of the packet as well
-    /// </summary>
-    public abstract class Header
-    {
-        /// <summary>Raw header data, does not include appended ACKs</summary>
-        public byte[] Data;
-        /// <summary>Raw value of the flags byte</summary>
-        public byte Flags
-        {
-            get { return Data[0]; }
-            set { Data[0] = value; }
-        }
-        /// <summary>Reliable flag, whether this packet requires an ACK</summary>
-        public bool Reliable
-        {
-            get { return (Data[0] & Helpers.MSG_RELIABLE) != 0; }
-            set { if (value) { Data[0] |= (byte)Helpers.MSG_RELIABLE; } else { byte mask = (byte)Helpers.MSG_RELIABLE ^ 0xFF; Data[0] &= mask; } }
-        }
-        /// <summary>Resent flag, whether this same packet has already been
-        /// sent</summary>
-        public bool Resent
-        {
-            get { return (Data[0] & Helpers.MSG_RESENT) != 0; }
-            set { if (value) { Data[0] |= (byte)Helpers.MSG_RESENT; } else { byte mask = (byte)Helpers.MSG_RESENT ^ 0xFF; Data[0] &= mask; } }
-        }
-        /// <summary>Zerocoded flag, whether this packet is compressed with
-        /// zerocoding</summary>
-        public bool Zerocoded
-        {
-            get { return (Data[0] & Helpers.MSG_ZEROCODED) != 0; }
-            set { if (value) { Data[0] |= (byte)Helpers.MSG_ZEROCODED; } else { byte mask = (byte)Helpers.MSG_ZEROCODED ^ 0xFF; Data[0] &= mask; } }
-        }
-        /// <summary>Appended ACKs flag, whether this packet has ACKs appended
-        /// to the end</summary>
-        public bool AppendedAcks
-        {
-            get { return (Data[0] & Helpers.MSG_APPENDED_ACKS) != 0; }
-            set { if (value) { Data[0] |= (byte)Helpers.MSG_APPENDED_ACKS; } else { byte mask = (byte)Helpers.MSG_APPENDED_ACKS ^ 0xFF; Data[0] &= mask; } }
-        }
-        /// <summary>Packet sequence number, three bytes long</summary>
-        public uint Sequence
-        {
-            get { return (uint)((Data[1] << 24) + (Data[2] << 16) + (Data[3] << 8) + Data[4]); }
-            set {
-			Data[1] = (byte)(value >> 24); Data[2] = (byte)(value >> 16);
-			Data[3] = (byte)(value >> 8);  Data[4] = (byte)(value % 256);
-		}
-        }
-        /// <summary>Numeric ID number of this packet</summary>
-        public abstract ushort ID { get; set; }
-        /// <summary>Frequency classification of this packet, Low Medium or
-        /// High</summary>
-        public abstract PacketFrequency Frequency { get; }
-        /// <summary>Convert this header to a byte array, not including any
-        /// appended ACKs</summary>
-        public abstract void ToBytes(byte[] bytes, ref int i);
-        /// <summary>Array containing all the appended ACKs of this packet</summary>
-        public uint[] AckList;
-
-        public abstract void FromBytes(byte[] bytes, ref int pos, ref int packetEnd);
-
-        /// <summary>
-        /// Convert the AckList to a byte array, used for packet serializing
-        /// </summary>
-        /// <param name="bytes">Reference to the target byte array</param>
-        /// <param name="i">Beginning position to start writing to in the byte
-        /// array, will be updated with the ending position of the ACK list</param>
-        public void AcksToBytes(byte[] bytes, ref int i)
-        {
-            foreach (uint ack in AckList)
-            {
-                bytes[i++] = (byte)((ack >> 24) % 256);
-                bytes[i++] = (byte)((ack >> 16) % 256);
-                bytes[i++] = (byte)((ack >> 8) % 256);
-                bytes[i++] = (byte)(ack % 256);
-            }
-            if (AckList.Length > 0) { bytes[i++] = (byte)AckList.Length; }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="packetEnd"></param>
-        /// <returns></returns>
-        public static Header BuildHeader(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            if (bytes[6] == 0xFF)
-            {
-                if (bytes[7] == 0xFF)
-                {
-                    return new LowHeader(bytes, ref pos, ref packetEnd);
-                }
-                else
-                {
-                    return new MediumHeader(bytes, ref pos, ref packetEnd);
-                }
-            }
-            else
-            {
-                return new HighHeader(bytes, ref pos, ref packetEnd);
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="packetEnd"></param>
-        protected void CreateAckList(byte[] bytes, ref int packetEnd)
-        {
-            if (AppendedAcks)
-            {
-                try
-                {
-                    int count = bytes[packetEnd--];
-                    AckList = new uint[count];
-
-                    for (int i = 0; i < count; i++)
-                    {
-                        AckList[i] = (uint)(
-                            (bytes[(packetEnd - i * 4) - 3] << 24) |
-                            (bytes[(packetEnd - i * 4) - 2] << 16) |
-                            (bytes[(packetEnd - i * 4) - 1] <<  8) |
-                            (bytes[(packetEnd - i * 4)    ]));
-                    }
-
-                    packetEnd -= (count * 4);
-                }
-                catch (Exception)
-                {
-                    AckList = new uint[0];
-                    throw new MalformedDataException();
-                }
-            }
-            else
-            {
-                AckList = new uint[0];
-            }
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class LowHeader : Header
-    {
-        /// <summary></summary>
-        public override ushort ID
-        {
-            get { return (ushort)((Data[8] << 8) + Data[9]); }
-            set { Data[8] = (byte)(value >> 8); Data[9] = (byte)(value % 256); }
-        }
-        /// <summary></summary>
-        public override PacketFrequency Frequency { get { return PacketFrequency.Low; } }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public LowHeader()
-        {
-            Data = new byte[10];
-            Data[6] = Data[7] = 0xFF;
-            AckList = new uint[0];
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="packetEnd"></param>
-        public LowHeader(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            FromBytes(bytes, ref pos, ref packetEnd);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            if (bytes.Length < 10) { throw new MalformedDataException(); }
-            Data = new byte[10];
-            Buffer.BlockCopy(bytes, 0, Data, 0, 10);
-
-            if ((bytes[0] & Helpers.MSG_ZEROCODED) != 0 && bytes[8] == 0)
-            {
-                if (bytes[9] == 1)
-                {
-                    Data[9] = bytes[10];
-                }
-                else
-                {
-                    throw new MalformedDataException();
-                }
-            }
-
-            pos = 10;
-            CreateAckList(bytes, ref packetEnd);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="i"></param>
-        public override void ToBytes(byte[] bytes, ref int i)
-        {
-            Buffer.BlockCopy(Data, 0, bytes, i, 10);
-            i += 10;
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class MediumHeader : Header
-    {
-        /// <summary></summary>
-        public override ushort ID
-        {
-            get { return (ushort)Data[7]; }
-            set { Data[7] = (byte)value; }
-        }
-        /// <summary></summary>
-        public override PacketFrequency Frequency { get { return PacketFrequency.Medium; } }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public MediumHeader()
-        {
-            Data = new byte[8];
-            Data[6] = 0xFF;
-            AckList = new uint[0];
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="packetEnd"></param>
-        public MediumHeader(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            FromBytes(bytes, ref pos, ref packetEnd);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            if (bytes.Length < 8) { throw new MalformedDataException(); }
-            Data = new byte[8];
-            Buffer.BlockCopy(bytes, 0, Data, 0, 8);
-            pos = 8;
-            CreateAckList(bytes, ref packetEnd);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="i"></param>
-        public override void ToBytes(byte[] bytes, ref int i)
-        {
-            Buffer.BlockCopy(Data, 0, bytes, i, 8);
-            i += 8;
-        }
-    }
-
-    /// <summary>
-    ///
-    /// </summary>
-    public class HighHeader : Header
-    {
-        /// <summary></summary>
-        public override ushort ID
-        {
-            get { return (ushort)Data[6]; }
-            set { Data[6] = (byte)value; }
-        }
-        /// <summary></summary>
-        public override PacketFrequency Frequency { get { return PacketFrequency.High; } }
-
-        /// <summary>
-        ///
-        /// </summary>
-        public HighHeader()
-        {
-            Data = new byte[7];
-            AckList = new uint[0];
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="pos"></param>
-        /// <param name="packetEnd"></param>
-        public HighHeader(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            FromBytes(bytes, ref pos, ref packetEnd);
-        }
-
-        override public void FromBytes(byte[] bytes, ref int pos, ref int packetEnd)
-        {
-            if (bytes.Length < 7) { throw new MalformedDataException(); }
-            Data = new byte[7];
-            Buffer.BlockCopy(bytes, 0, Data, 0, 7);
-            pos = 7;
-            CreateAckList(bytes, ref packetEnd);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <param name="i"></param>
-        public override void ToBytes(byte[] bytes, ref int i)
-        {
-            Buffer.BlockCopy(Data, 0, bytes, i, 7);
-            i += 7;
-        }
-    }
diff --git a/old/libsl1550/libsecondlife/mapgenerator/unusedpackets.txt b/old/libsl1550/libsecondlife/mapgenerator/unusedpackets.txt
deleted file mode 100644
index a81fcd0..0000000
--- a/old/libsl1550/libsecondlife/mapgenerator/unusedpackets.txt
+++ /dev/null
@@ -1,115 +0,0 @@
-AddCircuitCode
-RelayLogControl
-NeighborList
-SimulatorAssign
-SpaceServerSimulatorTimeMessage
-ClosestSimulator
-AvatarTextureUpdate
-SimulatorMapUpdate
-SimulatorSetMap
-SubscribeLoad
-UnsubscribeLoad
-SimulatorStart
-SimulatorReady
-SimulatorPresentAtLocation
-SimulatorLoad
-SimulatorShutdownRequest
-RegionPresenceRequestByRegionID
-RegionPresenceRequestByHandle
-RegionPresenceResponse
-RecordAgentPresence
-EraseAgentPresence
-AgentPresenceRequest
-AgentPresenceResponse
-UpdateSimulator
-TrackAgentSession
-ClearAgentSessions
-LogDwellTime
-FeatureDisabled
-LogFailedMoneyTransaction
-UserReportInternal
-SetSimStatusInDatabase
-SetSimPresenceInDatabase
-AvatarPickerRequestBackend
-DirFindQueryBackend
-DirPlacesQueryBackend
-DirClassifiedQueryBackend
-DirPicksQueryBackend
-DirLandQueryBackend
-DirPopularQueryBackend
-OnlineStatusRequest
-OnlineStatusReply
-GroupNoticeAdd
-DataHomeLocationRequest
-DataHomeLocationReply
-SpaceLocationTeleportRequest
-SpaceLocationTeleportReply
-CompleteLure
-AddModifyAbility
-RemoveModifyAbility
-NearestLandingRegionRequest
-NearestLandingRegionReply
-NearestLandingPointUpdated
-TeleportLandingStatusChanged
-SystemKickUser
-AvatarPropertiesRequestBackend
-RequestParcelTransfer
-UpdateParcel
-RemoveParcel
-MergeParcel
-LogParcelChanges
-CheckParcelSales
-ParcelSales
-StartAuction
-ConfirmAuctionStart
-CompleteAuction
-CancelAuction
-CheckParcelAuctions
-ParcelAuctions
-ChatPass
-EdgeDataPacket
-SimStatus
-PassObject
-AtomicPassObject
-KillChildAgents
-LogLogin
-DataServerLogout
-TransferInventory
-TransferInventoryAck
-EventLocationRequest
-EventLocationReply
-MoneyTransferBackend
-BulkMoneyTransfer
-SetStartLocation
-NetTest
-SetCPURatio
-SimCrashed
-NameValuePair
-RemoveNameValuePair
-GetNameValuePair
-UpdateAttachment
-RemoveAttachment
-EmailMessageRequest
-EmailMessageReply
-InternalScriptMail
-ScriptDataRequest
-ScriptDataReply
-InviteGroupResponse
-TallyVotes
-LogTextMessage
-StartExpungeProcess
-StartExpungeProcessAck
-StartParcelRename
-StartParcelRenameAck
-BulkParcelRename
-ParcelRename
-StartParcelRemove
-BulkParcelRemove
-RpcChannelRequest
-RpcChannelReply
-RpcScriptRequestInbound
-RpcScriptRequestInboundForward
-RpcScriptReplyInbound
-MailTaskSimRequest
-MailTaskSimReply
-ScriptMailRegistration
\ No newline at end of file
diff --git a/old/libsl1550/mapgen.bat b/old/libsl1550/mapgen.bat
deleted file mode 100644
index 2193c5a..0000000
--- a/old/libsl1550/mapgen.bat
+++ /dev/null
@@ -1 +0,0 @@
-"bin/mapgenerator.exe" data/message_template.msg libsecondlife/mapgenerator/template.cs libsecondlife/mapgenerator/unusedpackets.txt libsecondlife/_Packets_.cs
\ No newline at end of file
diff --git a/old/libsl1550/openjpeg-libsl/DllOpenJPEG.sln b/old/libsl1550/openjpeg-libsl/DllOpenJPEG.sln
deleted file mode 100644
index d553cee..0000000
--- a/old/libsl1550/openjpeg-libsl/DllOpenJPEG.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DllOpenJPEG", "DllOpenJPEG.vcproj", "{D1F3D377-653A-4B9B-B01F-C8DF3FA5C86F}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{D1F3D377-653A-4B9B-B01F-C8DF3FA5C86F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D1F3D377-653A-4B9B-B01F-C8DF3FA5C86F}.Debug|Win32.Build.0 = Debug|Win32
-		{D1F3D377-653A-4B9B-B01F-C8DF3FA5C86F}.Release|Win32.ActiveCfg = Release|Win32
-		{D1F3D377-653A-4B9B-B01F-C8DF3FA5C86F}.Release|Win32.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/old/libsl1550/openjpeg-libsl/DllOpenJPEG.vcproj b/old/libsl1550/openjpeg-libsl/DllOpenJPEG.vcproj
deleted file mode 100644
index f07b824..0000000
--- a/old/libsl1550/openjpeg-libsl/DllOpenJPEG.vcproj
+++ /dev/null
@@ -1,700 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="DllOpenJPEG"
-	ProjectGUID="{D1F3D377-653A-4B9B-B01F-C8DF3FA5C86F}"
-	RootNamespace="DllOpenJPEG"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/DllOpenJPEG.tlb"
-				HeaderFileName=""
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OPJ_EXPORTS"
-				StringPooling="true"
-				RuntimeLibrary="0"
-				EnableFunctionLevelLinking="true"
-				PrecompiledHeaderFile=".\Release/DllOpenJPEG.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1036"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="../bin/openjpeg-libsl.dll"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=""
-				ImportLibrary=".\Release/openjpeg-libsl.lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-				SuppressStartupBanner="true"
-				OutputFile=".\Release/DllOpenJPEG.bsc"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine=""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/DllOpenJPEG.tlb"
-				HeaderFileName=""
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OPJ_EXPORTS"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				PrecompiledHeaderFile=".\Debug/DllOpenJPEG.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1036"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="../bin/openjpeg-libsl.dll"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile="Debug/openjpeg-libsl.pdb"
-				ImportLibrary=".\Debug/openjpeg-libsld.lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-				SuppressStartupBanner="true"
-				OutputFile=".\Debug/DllOpenJPEG.bsc"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="copy Debug\openjpeg-libsl.dll ..\bin&#x0D;&#x0A;"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-			>
-			<File
-				RelativePath="libopenjpeg\bio.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\cio.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\dwt.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\event.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\image.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\j2k.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\j2k_lib.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\jp2.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\jpt.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath=".\libsl\libsl.cpp"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\mct.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\mqc.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\openjpeg.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\pi.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\raw.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\t1.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\t2.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\tcd.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="libopenjpeg\tgt.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl"
-			>
-			<File
-				RelativePath="libopenjpeg\bio.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\cio.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\dwt.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\event.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\fix.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\image.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\int.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\j2k.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\j2k_lib.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\jp2.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\jpt.h"
-				>
-			</File>
-			<File
-				RelativePath=".\libsl\libsl.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\mct.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\mqc.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\openjpeg.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\opj_includes.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\pi.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\raw.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\t1.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\t2.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\tcd.h"
-				>
-			</File>
-			<File
-				RelativePath="libopenjpeg\tgt.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-			>
-			<File
-				RelativePath="OpenJPEG.rc"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/old/libsl1550/openjpeg-libsl/Makefile b/old/libsl1550/openjpeg-libsl/Makefile
deleted file mode 100644
index 9912759..0000000
--- a/old/libsl1550/openjpeg-libsl/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-# Linux makefile for OpenJPEG
-
-VER_MAJOR = 2
-VER_MINOR = 1.2.0
-
-SRCS = ./libopenjpeg/bio.c ./libopenjpeg/cio.c ./libopenjpeg/dwt.c ./libopenjpeg/event.c ./libopenjpeg/image.c ./libopenjpeg/j2k.c ./libopenjpeg/j2k_lib.c ./libopenjpeg/jp2.c ./libopenjpeg/jpt.c ./libopenjpeg/mct.c ./libopenjpeg/mqc.c ./libopenjpeg/openjpeg.c ./libopenjpeg/pi.c ./libopenjpeg/raw.c ./libopenjpeg/t1.c ./libopenjpeg/t2.c ./libopenjpeg/tcd.c ./libopenjpeg/tgt.c
-CPPSRCS = ./libsl/libsl.cpp
-INCLS = ./libopenjpeg/bio.h ./libopenjpeg/cio.h ./libopenjpeg/dwt.h ./libopenjpeg/event.h ./libopenjpeg/fix.h ./libopenjpeg/image.h ./libopenjpeg/int.h ./libopenjpeg/j2k.h ./libopenjpeg/j2k_lib.h ./libopenjpeg/jp2.h ./libopenjpeg/jpt.h ./libopenjpeg/mct.h ./libopenjpeg/mqc.h ./libopenjpeg/openjpeg.h ./libopenjpeg/pi.h ./libopenjpeg/raw.h ./libopenjpeg/t1.h ./libopenjpeg/t2.h ./libopenjpeg/tcd.h ./libopenjpeg/tgt.h ./libopenjpeg/opj_includes.h ./libsl/libsl.h
-INCLUDE = -Ilibopenjpeg
-
-# General configuration variables:
-CC = gcc
-AR = ar
-
-# Converts cr/lf to just lf
-DOS2UNIX = dos2unix
-
-COMPILERFLAGS = -O3 -fPIC
-LIBRARIES = -lstdc++
-
-MODULES = $(SRCS:.c=.o)
-CPPMODULES = $(CPPSRCS:.cpp=.o)
-CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
-
-TARGET  = openjpeg-libsl
-SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
-LIBNAME = lib$(TARGET).so.$(VER_MAJOR)
-
-
-default: all
-
-all: OpenJPEG
-
-dist: OpenJPEG
-	install -d ../bin
-	cp $(SHAREDLIB) ../bin/
-
-dos2unix:
-	@$(DOS2UNIX) $(SRCS) $(INCLS)
-
-OpenJPEG: $(SHAREDLIB)
-
-$(MODULES): %.o: %.c
-	$(CC) $(CFLAGS) -c $< -o $@
-
-$(CPPMODULES): %.o: %.cpp
-	$(CC) $(CFLAGS) -c $< -o $@
-
-$(SHAREDLIB): $(MODULES) $(CPPMODULES)
-	$(CC) -s -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(CPPMODULES) $(LIBRARIES)
-
-install: OpenJPEG
-	install -d ../bin
-	cp $(SHAREDLIB) ../bin/
-
-clean:
-	rm -rf core dist/ u2dtmp* $(MODULES) $(CPPMODULES) $(SHAREDLIB) $(LIBNAME)
-
-osx:
-	make -f Makefile.osx
-
-osxinstall:
-	make -f Makefile.osx install
-
-osxclean:
-	make -f Makefile.osx clean
\ No newline at end of file
diff --git a/old/libsl1550/openjpeg-libsl/Makefile.osx b/old/libsl1550/openjpeg-libsl/Makefile.osx
deleted file mode 100644
index 5d2a5c6..0000000
--- a/old/libsl1550/openjpeg-libsl/Makefile.osx
+++ /dev/null
@@ -1,57 +0,0 @@
-# MacOSX makefile for OpenJPEG
-
-VER_MAJOR = 2
-VER_MINOR = 1.2.0
-
-SRCS = ./libopenjpeg/bio.c ./libopenjpeg/cio.c ./libopenjpeg/dwt.c ./libopenjpeg/event.c ./libopenjpeg/image.c ./libopenjpeg/j2k.c ./libopenjpeg/j2k_lib.c ./libopenjpeg/jp2.c ./libopenjpeg/jpt.c ./libopenjpeg/mct.c ./libopenjpeg/mqc.c ./libopenjpeg/openjpeg.c ./libopenjpeg/pi.c ./libopenjpeg/raw.c ./libopenjpeg/t1.c ./libopenjpeg/t2.c ./libopenjpeg/tcd.c ./libopenjpeg/tgt.c
-CPPSRCS = ./libsl/libsl.cpp
-INCLS = ./libopenjpeg/bio.h ./libopenjpeg/cio.h ./libopenjpeg/dwt.h ./libopenjpeg/event.h ./libopenjpeg/fix.h ./libopenjpeg/image.h ./libopenjpeg/int.h ./libopenjpeg/j2k.h ./libopenjpeg/j2k_lib.h ./libopenjpeg/jp2.h ./libopenjpeg/jpt.h ./libopenjpeg/mct.h ./libopenjpeg/mqc.h ./libopenjpeg/openjpeg.h ./libopenjpeg/pi.h ./libopenjpeg/raw.h ./libopenjpeg/t1.h ./libopenjpeg/t2.h ./libopenjpeg/tcd.h ./libopenjpeg/tgt.h ./libopenjpeg/opj_includes.h ./libsl/libsl.h
-INCLUDE = -Ilibopenjpeg
-
-# General configuration variables:
-CC = gcc
-
-
-LIBTOOLSTAT = libtool
-LIBTOOLDYN = gcc
-
-COMPILERFLAGS = -O3 -fPIC
-LIBRARIES = -lstdc++
-
-MODULES = $(SRCS:.c=.o)
-CPPMODULES = $(CPPSRCS:.cpp=.o)
-CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
-
-TARGET  = openjpeg-libsl
-SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).dylib
-LIBNAME = lib$(TARGET).dylib
-
-
-default: all
-
-all: OpenJPEG
-
-dist: OpenJPEG
-	install -d ../bin
-	cp $(SHAREDLIB) ../bin/
-
-dos2unix:
-	@$(DOS2UNIX) $(SRCS) $(INCLS)
-
-OpenJPEG: $(SHAREDLIB)
-
-.c.o:
-	$(CC) $(CFLAGS) -c $< -o $@
-
-.cpp.o:
-	$(CC) $(CFLAGS) -c $< -o $@
-
-$(SHAREDLIB): $(MODULES) $(CPPMODULES)
-	$(LIBTOOLDYN) -dynamiclib -o $@ $(MODULES) $(CPPMODULES) $(LIBRARIES)
-
-install:
-	install -d ../bin
-	cp $(SHAREDLIB) ../bin/
-
-clean:
-	rm -rf core dist/ u2dtmp* $(MODULES) $(CPPMODULES) $(SHAREDLIB) $(LIBNAME)
diff --git a/old/libsl1550/openjpeg-libsl/OpenJPEG.rc b/old/libsl1550/openjpeg-libsl/OpenJPEG.rc
deleted file mode 100644
index 1759eef..0000000
--- a/old/libsl1550/openjpeg-libsl/OpenJPEG.rc
+++ /dev/null
@@ -1,109 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// French (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,1,0,0
- PRODUCTVERSION 1,1,0,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "000004b0"
-        BEGIN
-            VALUE "Comments", "The OpenJPEG library is an open-source JPEG 2000 codec. \0"
-            VALUE "CompanyName", "OpenJPEG\0"
-            VALUE "FileDescription", "OpenJPEG\0"
-            VALUE "FileVersion", "1, 1, 0, 0\0"
-            VALUE "InternalName", "openjpeg-libsl\0"
-            VALUE "LegalCopyright", "Copyright © 2002-2006, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium\0"
-            VALUE "LegalTrademarks", "See http://www.openjpeg.org for details\0"
-            VALUE "OriginalFilename", "openjpeg-libsl.dll\0"
-            VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "openjpeg-libsl\0"
-            VALUE "ProductVersion", "2, 1, 2, 0\0"
-            VALUE "SpecialBuild", "\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x0, 1200
-    END
-END
-
-#endif    // !_MAC
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-#endif    // French (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
diff --git a/old/libsl1550/openjpeg-libsl/README.msvc b/old/libsl1550/openjpeg-libsl/README.msvc
deleted file mode 100644
index fc9ea89..0000000
--- a/old/libsl1550/openjpeg-libsl/README.msvc
+++ /dev/null
@@ -1,40 +0,0 @@
-How to compile the library under MS VC++ 6.0
---------------------------------------------
-
-The library comes in two versions :
-- a static library that can be linked against any C/C++ program
-- a Dynamic Link Library (Windows DLL) that can be used in any C/C++ program and in most interpreted languages (e.g. VB, C#, ...).
-
-In order to compile the library version *or* the DLL version, you will have to :
-
-1) Open the MSVC workspace named LibOpenJPEG.dsw
-2) Set the choosen target as the active project, that means :
- a) Go to the Menu 'Build -> Set Active Configuration'
- b) Choose one of the following configuration :
- - DllOpenJPEG - Win32 Release => creates a DLL in release mode named OpenJPEG.dll
- - DllOpenJPEG - Win32 Debug => creates a DLL in debug mode named OpenJPEGd.dll
- - LibOpenJPEG - Win32 Release => creates a static library in release mode named LibOpenJPEG.lib
- - LibOpenJPEG - Win32 Debug => creates a static library in debug mode named LibOpenJPEGd.lib
-3) Build the project : Menu -> Build -> Rebuild All
-
-The build process will create a directory named 'dist' that will contain all you need in order to use the library.
-
-Simple codec compilation
-------------------------
-
-Once you've built the library, you might want to test it with a basic codec. To do this, go to the codec directory and use one of the following projects to build an encoder and decoder respectively:
-- image_to_j2k.dsw
-- j2k_to_image.dsw
-
-IMPORTANT NOTE :
-----------------
-
-The encoder and decoder samples are configured to use the static version of the library. A link to the LibOpenJPEG static project is included in these projects so that you can build both a codec and the library in a single pass.
-
-However, you MUST NOTE that in order to use LibOpenJPEG as a static library in your program, you NEED to add the following compiler directive to your project : OPJ_STATIC
-Look at the menu 'Project -> Settings -> C/C++ tab -> preprocessor definition' to see how this is configured.
-When using OpenJPEG as a DLL, this compiler directive MUST NOT be used.
-
-
-
-
diff --git a/old/libsl1550/openjpeg-libsl/Resource.h b/old/libsl1550/openjpeg-libsl/Resource.h
deleted file mode 100644
index 285c3c0..0000000
--- a/old/libsl1550/openjpeg-libsl/Resource.h
+++ /dev/null
@@ -1,17 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by foob.rc
-//
-
-#define IDS_APP_TITLE			103
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE	101
-#define _APS_NEXT_COMMAND_VALUE		40001
-#define _APS_NEXT_CONTROL_VALUE		1000
-#define _APS_NEXT_SYMED_VALUE		101
-#endif
-#endif
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/bio.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/bio.c
deleted file mode 100644
index 2a305a7..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/bio.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/** @defgroup BIO BIO - Individual bit input-output stream */
-/*@{*/
-
-/** @name Local static functions */
-/*@{*/
-
-/**
-Write a bit
-@param bio BIO handle
-@param b Bit to write (0 or 1)
-*/
-static void bio_putbit(opj_bio_t *bio, int b);
-/**
-Read a bit
-@param bio BIO handle
-@return Returns the read bit
-*/
-static int bio_getbit(opj_bio_t *bio);
-/**
-Write a byte
-@param bio BIO handle
-@return Returns 0 if successful, returns 1 otherwise
-*/
-static int bio_byteout(opj_bio_t *bio);
-/**
-Read a byte
-@param bio BIO handle
-@return Returns 0 if successful, returns 1 otherwise
-*/
-static int bio_bytein(opj_bio_t *bio);
-
-/*@}*/
-
-/*@}*/
-
-/*
-==========================================================
-   local functions
-==========================================================
-*/
-
-static int bio_byteout(opj_bio_t *bio) {
-	bio->buf = (bio->buf << 8) & 0xffff;
-	bio->ct = bio->buf == 0xff00 ? 7 : 8;
-	if (bio->bp >= bio->end) {
-		return 1;
-	}
-	*bio->bp++ = bio->buf >> 8;
-	return 0;
-}
-
-static int bio_bytein(opj_bio_t *bio) {
-	bio->buf = (bio->buf << 8) & 0xffff;
-	bio->ct = bio->buf == 0xff00 ? 7 : 8;
-	if (bio->bp >= bio->end) {
-		return 1;
-	}
-	bio->buf |= *bio->bp++;
-	return 0;
-}
-
-static void bio_putbit(opj_bio_t *bio, int b) {
-	if (bio->ct == 0) {
-		bio_byteout(bio);
-	}
-	bio->ct--;
-	bio->buf |= b << bio->ct;
-}
-
-static int bio_getbit(opj_bio_t *bio) {
-	if (bio->ct == 0) {
-		bio_bytein(bio);
-	}
-	bio->ct--;
-	return (bio->buf >> bio->ct) & 1;
-}
-
-/*
-==========================================================
-   Bit Input/Output interface
-==========================================================
-*/
-
-opj_bio_t* bio_create() {
-	opj_bio_t *bio = (opj_bio_t*)opj_malloc(sizeof(opj_bio_t));
-	return bio;
-}
-
-void bio_destroy(opj_bio_t *bio) {
-	if(bio) {
-		opj_free(bio);
-	}
-}
-
-int bio_numbytes(opj_bio_t *bio) {
-	return (bio->bp - bio->start);
-}
-
-void bio_init_enc(opj_bio_t *bio, unsigned char *bp, int len) {
-	bio->start = bp;
-	bio->end = bp + len;
-	bio->bp = bp;
-	bio->buf = 0;
-	bio->ct = 8;
-}
-
-void bio_init_dec(opj_bio_t *bio, unsigned char *bp, int len) {
-	bio->start = bp;
-	bio->end = bp + len;
-	bio->bp = bp;
-	bio->buf = 0;
-	bio->ct = 0;
-}
-
-void bio_write(opj_bio_t *bio, int v, int n) {
-	int i;
-	for (i = n - 1; i >= 0; i--) {
-		bio_putbit(bio, (v >> i) & 1);
-	}
-}
-
-int bio_read(opj_bio_t *bio, int n) {
-	int i, v;
-	v = 0;
-	for (i = n - 1; i >= 0; i--) {
-		v += bio_getbit(bio) << i;
-	}
-	return v;
-}
-
-int bio_flush(opj_bio_t *bio) {
-	bio->ct = 0;
-	if (bio_byteout(bio)) {
-		return 1;
-	}
-	if (bio->ct == 7) {
-		bio->ct = 0;
-		if (bio_byteout(bio)) {
-			return 1;
-		}
-	}
-	return 0;
-}
-
-int bio_inalign(opj_bio_t *bio) {
-	bio->ct = 0;
-	if ((bio->buf & 0xff) == 0xff) {
-		if (bio_bytein(bio)) {
-			return 1;
-		}
-		bio->ct = 0;
-	}
-	return 0;
-}
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/bio.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/bio.h
deleted file mode 100644
index d0a809c..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/bio.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __BIO_H
-#define __BIO_H
-/**
-@file bio.h
-@brief Implementation of an individual bit input-output (BIO)
-
-The functions in BIO.C have for goal to realize an individual bit input - output.
-*/
-
-/** @defgroup BIO BIO - Individual bit input-output stream */
-/*@{*/
-
-/**
-Individual bit input-output stream (BIO)
-*/
-typedef struct opj_bio {
-	/** pointer to the start of the buffer */
-	unsigned char *start;
-	/** pointer to the end of the buffer */
-	unsigned char *end;
-	/** pointer to the present position in the buffer */
-	unsigned char *bp;
-	/** temporary place where each byte is read or written */
-	unsigned int buf;
-	/** coder : number of bits free to write. decoder : number of bits read */
-	int ct;
-} opj_bio_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Create a new BIO handle
-@return Returns a new BIO handle if successful, returns NULL otherwise
-*/
-opj_bio_t* bio_create();
-/**
-Destroy a previously created BIO handle
-@param bio BIO handle to destroy
-*/
-void bio_destroy(opj_bio_t *bio);
-/**
-Number of bytes written.
-@param bio BIO handle
-@return Returns the number of bytes written
-*/
-int bio_numbytes(opj_bio_t *bio);
-/**
-Init encoder
-@param bio BIO handle
-@param bp Output buffer
-@param len Output buffer length
-*/
-void bio_init_enc(opj_bio_t *bio, unsigned char *bp, int len);
-/**
-Init decoder
-@param bio BIO handle
-@param bp Input buffer
-@param len Input buffer length
-*/
-void bio_init_dec(opj_bio_t *bio, unsigned char *bp, int len);
-/**
-Write bits
-@param bio BIO handle
-@param v Value of bits
-@param n Number of bits to write
-*/
-void bio_write(opj_bio_t *bio, int v, int n);
-/**
-Read bits
-@param bio BIO handle
-@param n Number of bits to read
-@return Returns the corresponding read number
-*/
-int bio_read(opj_bio_t *bio, int n);
-/**
-Flush bits
-@param bio BIO handle
-@return Returns 1 if successful, returns 0 otherwise
-*/
-int bio_flush(opj_bio_t *bio);
-/**
-Passes the ending bits (coming from flushing)
-@param bio BIO handle
-@return Returns 1 if successful, returns 0 otherwise
-*/
-int bio_inalign(opj_bio_t *bio);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __BIO_H */
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/cio.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/cio.c
deleted file mode 100644
index 6082e9b..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/cio.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/* ----------------------------------------------------------------------- */
-
-opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length) {
-	opj_cp_t *cp = NULL;
-	opj_cio_t *cio = (opj_cio_t*)opj_malloc(sizeof(opj_cio_t));
-	if(!cio) return NULL;
-	cio->cinfo = cinfo;
-	if(buffer && length) {
-		/* wrap a user buffer containing the encoded image */
-		cio->openmode = OPJ_STREAM_READ;
-		cio->buffer = buffer;
-		cio->length = length;
-	}
-	else if(!buffer && !length && cinfo) {
-		/* allocate a buffer for the encoded image */
-		cio->openmode = OPJ_STREAM_WRITE;
-		switch(cinfo->codec_format) {
-			case CODEC_J2K:
-				cp = ((opj_j2k_t*)cinfo->j2k_handle)->cp;
-				break;
-			case CODEC_JP2:
-				cp = ((opj_jp2_t*)cinfo->jp2_handle)->j2k->cp;
-				break;
-			default:
-				opj_free(cio);
-				return NULL;
-		}
-		cio->length = (int) (1.3 * cp->img_size);
-		cio->buffer = (unsigned char *)opj_malloc(cio->length);
-		if(!cio->buffer) {
-			opj_free(cio);
-			return NULL;
-		}
-	}
-	else {
-		opj_free(cio);
-		return NULL;
-	}
-
-	/* Initialize byte IO */
-	cio->start = cio->buffer;
-	cio->end = cio->buffer + cio->length;
-	cio->bp = cio->buffer;
-
-	return cio;
-}
-
-void OPJ_CALLCONV opj_cio_close(opj_cio_t *cio) {
-	if(cio) {
-		if(cio->openmode == OPJ_STREAM_WRITE) {
-			/* destroy the allocated buffer */
-			opj_free(cio->buffer);
-		}
-		/* destroy the cio */
-		opj_free(cio);
-	}
-}
-
-
-/* ----------------------------------------------------------------------- */
-
-/*
- * Get position in byte stream.
- */
-int OPJ_CALLCONV cio_tell(opj_cio_t *cio) {
-	return cio->bp - cio->start;
-}
-
-/*
- * Set position in byte stream.
- *
- * pos : position, in number of bytes, from the beginning of the stream
- */
-void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos) {
-	cio->bp = cio->start + pos;
-}
-
-/*
- * Number of bytes left before the end of the stream.
- */
-int cio_numbytesleft(opj_cio_t *cio) {
-	return cio->end - cio->bp;
-}
-
-/*
- * Get pointer to the current position in the stream.
- */
-unsigned char *cio_getbp(opj_cio_t *cio) {
-	return cio->bp;
-}
-
-/*
- * Write a byte.
- */
-bool cio_byteout(opj_cio_t *cio, unsigned char v) {
-	if (cio->bp >= cio->end) {
-		opj_event_msg(cio->cinfo, EVT_ERROR, "write error\n");
-		return false;
-	}
-	*cio->bp++ = v;
-	return true;
-}
-
-/*
- * Read a byte.
- */
-unsigned char cio_bytein(opj_cio_t *cio) {
-	if (cio->bp >= cio->end) {
-		opj_event_msg(cio->cinfo, EVT_ERROR, "read error\n");
-		return 0;
-	}
-	return *cio->bp++;
-}
-
-/*
- * Write some bytes.
- *
- * v : value to write
- * n : number of bytes to write
- */
-unsigned int cio_write(opj_cio_t *cio, unsigned int v, int n) {
-	int i;
-	for (i = n - 1; i >= 0; i--) {
-		if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) )
-			return 0;
-	}
-	return n;
-}
-
-/*
- * Read some bytes.
- *
- * n : number of bytes to read
- *
- * return : value of the n bytes read
- */
-unsigned int cio_read(opj_cio_t *cio, int n) {
-	int i;
-	unsigned int v;
-	v = 0;
-	for (i = n - 1; i >= 0; i--) {
-		v += cio_bytein(cio) << (i << 3);
-	}
-	return v;
-}
-
-/*
- * Skip some bytes.
- *
- * n : number of bytes to skip
- */
-void cio_skip(opj_cio_t *cio, int n) {
-	cio->bp += n;
-}
-
-
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/cio.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/cio.h
deleted file mode 100644
index 580bf9c..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/cio.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __CIO_H
-#define __CIO_H
-/**
-@file cio.h
-@brief Implementation of a byte input-output process (CIO)
-
-The functions in CIO.C have for goal to realize a byte input / output process.
-*/
-
-/** @defgroup CIO CIO - byte input-output stream */
-/*@{*/
-
-/** @name Exported functions (see also openjpeg.h) */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Number of bytes left before the end of the stream
-@param cio CIO handle
-@return Returns the number of bytes before the end of the stream
-*/
-int cio_numbytesleft(opj_cio_t *cio);
-/**
-Get pointer to the current position in the stream
-@param cio CIO handle
-@return Returns a pointer to the current position
-*/
-unsigned char *cio_getbp(opj_cio_t *cio);
-/**
-Write some bytes
-@param cio CIO handle
-@param v Value to write
-@param n Number of bytes to write
-@return Returns the number of bytes written or 0 if an error occured
-*/
-unsigned int cio_write(opj_cio_t *cio, unsigned int v, int n);
-/**
-Read some bytes
-@param cio CIO handle
-@param n Number of bytes to read
-@return Returns the value of the n bytes read
-*/
-unsigned int cio_read(opj_cio_t *cio, int n);
-/**
-Skip some bytes
-@param cio CIO handle
-@param n Number of bytes to skip
-*/
-void cio_skip(opj_cio_t *cio, int n);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __CIO_H */
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/dwt.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/dwt.c
deleted file mode 100644
index e3289ff..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/dwt.c
+++ /dev/null
@@ -1,661 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include "opj_includes.h"
-
-/** @defgroup DWT DWT - Implementation of a discrete wavelet transform */
-/*@{*/
-
-#define WS(i) v->mem[(i)*2]
-#define WD(i) v->mem[(1+(i)*2)]
-
-/** @name Local data structures */
-/*@{*/
-
-typedef struct dwt_local{
-	int *	mem ;
-	int		dn ;
-	int		sn ;
-	int		cas ;
-	} dwt_t ;
-
-/*@}*/
-
-/**
-Virtual function type for wavelet transform in 1-D
-*/
-typedef void (*DWT1DFN)(dwt_t* v);
-
-/** @name Local static functions */
-/*@{*/
-
-/**
-Forward lazy transform (horizontal)
-*/
-static void dwt_deinterleave_h(int *a, int *b, int dn, int sn, int cas);
-/**
-Forward lazy transform (vertical)
-*/
-static void dwt_deinterleave_v(int *a, int *b, int dn, int sn, int x, int cas);
-/**
-Inverse lazy transform (horizontal)
-*/
-static void dwt_interleave_h(dwt_t* h, int *a);
-/**
-Inverse lazy transform (vertical)
-*/
-static void dwt_interleave_v(dwt_t* v, int *a, int x);
-/**
-Forward 5-3 wavelet tranform in 1-D
-*/
-static void dwt_encode_1(int *a, int dn, int sn, int cas);
-/**
-Inverse 5-3 wavelet tranform in 1-D
-*/
-static void dwt_decode_1(dwt_t *v);
-/**
-Forward 9-7 wavelet transform in 1-D
-*/
-static void dwt_encode_1_real(int *a, int dn, int sn, int cas);
-/**
-Inverse 9-7 wavelet transform in 1-D
-*/
-static void dwt_decode_1_real(dwt_t *v);
-/**
-FIXME : comment ???
-*/
-static void dwt_encode_stepsize(int stepsize, int numbps, opj_stepsize_t *bandno_stepsize);
-/**
-Inverse wavelet tranform in 2-D.
-*/
-static void dwt_decode_tile(opj_tcd_tilecomp_t * tilec, int stop , DWT1DFN fn);
-
-/*@}*/
-
-/*@}*/
-
-#define S(i) a[(i)*2]
-#define D(i) a[(1+(i)*2)]
-#define S_(i) ((i)<0?S(0):((i)>=sn?S(sn-1):S(i)))
-#define D_(i) ((i)<0?D(0):((i)>=dn?D(dn-1):D(i)))
-/* new */
-#define SS_(i) ((i)<0?S(0):((i)>=dn?S(dn-1):S(i)))
-#define DD_(i) ((i)<0?D(0):((i)>=sn?D(sn-1):D(i)))
-
-/* <summary>                                                              */
-/* This table contains the norms of the 5-3 wavelets for different bands. */
-/* </summary>                                                             */
-static const double dwt_norms[4][10] = {
-	{1.000, 1.500, 2.750, 5.375, 10.68, 21.34, 42.67, 85.33, 170.7, 341.3},
-	{1.038, 1.592, 2.919, 5.703, 11.33, 22.64, 45.25, 90.48, 180.9},
-	{1.038, 1.592, 2.919, 5.703, 11.33, 22.64, 45.25, 90.48, 180.9},
-	{.7186, .9218, 1.586, 3.043, 6.019, 12.01, 24.00, 47.97, 95.93}
-};
-
-/* <summary>                                                              */
-/* This table contains the norms of the 9-7 wavelets for different bands. */
-/* </summary>                                                             */
-static const double dwt_norms_real[4][10] = {
-	{1.000, 1.965, 4.177, 8.403, 16.90, 33.84, 67.69, 135.3, 270.6, 540.9},
-	{2.022, 3.989, 8.355, 17.04, 34.27, 68.63, 137.3, 274.6, 549.0},
-	{2.022, 3.989, 8.355, 17.04, 34.27, 68.63, 137.3, 274.6, 549.0},
-	{2.080, 3.865, 8.307, 17.18, 34.71, 69.59, 139.3, 278.6, 557.2}
-};
-
-/*
-==========================================================
-   local functions
-==========================================================
-*/
-
-/* <summary>			                 */
-/* Forward lazy transform (horizontal).  */
-/* </summary>                            */
-static void dwt_deinterleave_h(int *a, int *b, int dn, int sn, int cas) {
-	int i;
-    for (i=0; i<sn; i++) b[i]=a[2*i+cas];
-    for (i=0; i<dn; i++) b[sn+i]=a[(2*i+1-cas)];
-}
-
-/* <summary>                             */
-/* Forward lazy transform (vertical).    */
-/* </summary>                            */
-static void dwt_deinterleave_v(int *a, int *b, int dn, int sn, int x, int cas) {
-    int i;
-    for (i=0; i<sn; i++) b[i*x]=a[2*i+cas];
-    for (i=0; i<dn; i++) b[(sn+i)*x]=a[(2*i+1-cas)];
-}
-
-/* <summary>                             */
-/* Inverse lazy transform (horizontal).  */
-/* </summary>                            */
-static void dwt_interleave_h(dwt_t* h, int *a) {
-    int *ai = a;
-    int *bi = h->mem + h->cas;
-    int  i	= h->sn;
-    while( i-- ) {
-      *bi = *(ai++);
-	  bi += 2;
-    }
-    ai	= a + h->sn;
-    bi	= h->mem + 1 - h->cas;
-    i	= h->dn ;
-    while( i-- ) {
-      *bi = *(ai++);
-	  bi += 2;
-    }
-}
-
-/* <summary>                             */
-/* Inverse lazy transform (vertical).    */
-/* </summary>                            */
-static void dwt_interleave_v(dwt_t* v, int *a, int x) {
-    int *ai = a;
-    int *bi = v->mem + v->cas;
-    int  i = v->sn;
-    while( i-- ) {
-      *bi = *ai;
-	  bi += 2;
-	  ai += x;
-    }
-    ai = a + (v->sn * x);
-    bi = v->mem + 1 - v->cas;
-    i = v->dn ;
-    while( i-- ) {
-      *bi = *ai;
-	  bi += 2;
-	  ai += x;
-    }
-}
-
-
-/* <summary>                            */
-/* Forward 5-3 wavelet tranform in 1-D. */
-/* </summary>                           */
-static void dwt_encode_1(int *a, int dn, int sn, int cas) {
-	int i;
-
-	if (!cas) {
-		if ((dn > 0) || (sn > 1)) {	/* NEW :  CASE ONE ELEMENT */
-			for (i = 0; i < dn; i++) D(i) -= (S_(i) + S_(i + 1)) >> 1;
-			for (i = 0; i < sn; i++) S(i) += (D_(i - 1) + D_(i) + 2) >> 2;
-		}
-	} else {
-		if (!sn && dn == 1)		    /* NEW :  CASE ONE ELEMENT */
-			S(0) *= 2;
-		else {
-			for (i = 0; i < dn; i++) S(i) -= (DD_(i) + DD_(i - 1)) >> 1;
-			for (i = 0; i < sn; i++) D(i) += (SS_(i) + SS_(i + 1) + 2) >> 2;
-		}
-	}
-}
-
-/* <summary>                            */
-/* Inverse 5-3 wavelet tranform in 1-D. */
-/* </summary>                           */
-static void dwt_decode_1_(int *a, int dn, int sn, int cas) {
-	int i;
-
-	if (!cas) {
-		if ((dn > 0) || (sn > 1)) { /* NEW :  CASE ONE ELEMENT */
-			for (i = 0; i < sn; i++) S(i) -= (D_(i - 1) + D_(i) + 2) >> 2;
-			for (i = 0; i < dn; i++) D(i) += (S_(i) + S_(i + 1)) >> 1;
-		}
-	} else {
-		if (!sn  && dn == 1)          /* NEW :  CASE ONE ELEMENT */
-			S(0) /= 2;
-		else {
-			for (i = 0; i < sn; i++) D(i) -= (SS_(i) + SS_(i + 1) + 2) >> 2;
-			for (i = 0; i < dn; i++) S(i) += (DD_(i) + DD_(i - 1)) >> 1;
-		}
-	}
-}
-
-/* <summary>                            */
-/* Inverse 5-3 wavelet tranform in 1-D. */
-/* </summary>                           */
-static void dwt_decode_1(dwt_t *v) {
-	dwt_decode_1_(v->mem, v->dn, v->sn, v->cas);
-}
-
-/* <summary>                             */
-/* Forward 9-7 wavelet transform in 1-D. */
-/* </summary>                            */
-static void dwt_encode_1_real(int *a, int dn, int sn, int cas) {
-	int i;
-	if (!cas) {
-		if ((dn > 0) || (sn > 1)) {	/* NEW :  CASE ONE ELEMENT */
-			for (i = 0; i < dn; i++)
-				D(i) -= fix_mul(S_(i) + S_(i + 1), 12993);
-			for (i = 0; i < sn; i++)
-				S(i) -= fix_mul(D_(i - 1) + D_(i), 434);
-			for (i = 0; i < dn; i++)
-				D(i) += fix_mul(S_(i) + S_(i + 1), 7233);
-			for (i = 0; i < sn; i++)
-				S(i) += fix_mul(D_(i - 1) + D_(i), 3633);
-			for (i = 0; i < dn; i++)
-				D(i) = fix_mul(D(i), 5038);	/*5038 */
-			for (i = 0; i < sn; i++)
-				S(i) = fix_mul(S(i), 6659);	/*6660 */
-		}
-	} else {
-		if ((sn > 0) || (dn > 1)) {	/* NEW :  CASE ONE ELEMENT */
-			for (i = 0; i < dn; i++)
-				S(i) -= fix_mul(DD_(i) + DD_(i - 1), 12993);
-			for (i = 0; i < sn; i++)
-				D(i) -= fix_mul(SS_(i) + SS_(i + 1), 434);
-			for (i = 0; i < dn; i++)
-				S(i) += fix_mul(DD_(i) + DD_(i - 1), 7233);
-			for (i = 0; i < sn; i++)
-				D(i) += fix_mul(SS_(i) + SS_(i + 1), 3633);
-			for (i = 0; i < dn; i++)
-				S(i) = fix_mul(S(i), 5038);	/*5038 */
-			for (i = 0; i < sn; i++)
-				D(i) = fix_mul(D(i), 6659);	/*6660 */
-		}
-	}
-}
-
-static void dwt_decode_sm(dwt_t* v, int k, int n, int x) {
-	int m = k > n ? n : k;
-	int l = v->mem[1];			//D(0);
-	int j;
-	int i;
-	for (i = 0; i < m; i++) {
-		j = l;
-		WS(i) -= fix_mul( ( l = WD(i) ) + j , x);
-	}
-	if( i < k ) {
-		l = fix_mul( l + l , x );
-		for (; i < k; i++)
-			WS(i) -= l;
-	}
-}
-
-static void dwt_decode_sp(dwt_t* v, int k, int n, int x) {
-	int m = k > n ? n : k;
-	int l = v->mem[1];			//D(0);
-	int j;
-	int i;
-	for (i = 0; i < m; i++) {
-		j = l;
-		WS(i) += fix_mul( ( l = WD(i) ) + j , x);
-	}
-	if( i < k ) {
-		l = fix_mul( l + l , x );
-		for (; i < k; i++)
-			WS(i) += l;
-	}
-}
-
-static void dwt_decode_dm(dwt_t* v, int k, int n, int x) {
-	int m = k >= n ? n-1 : k;
-	int l = v->mem[0];				//S(0);
-	int i;
-	int j;
-	for (i = 0; i < m; i++) {
-		j = l;
-		WD(i) -=  fix_mul( ( l = WS(i+1) ) + j , x);
-	}
-	if( i < k ) {
-		l = fix_mul( l + l , x );
-		for (; i < k; i++)
-			WD(i) -= l;
-	}
-}
-
-static void dwt_decode_dp(dwt_t* v, int k, int n, int x) {
-	int m = k >= n ? n-1 : k;
-	int l = v->mem[0];				//S(0);
-	int i;
-	int j;
-	for (i = 0; i < m; i++) {
-		j = l;
-		WD(i) +=  fix_mul( ( l = WS(i+1) ) + j , x);
-	}
-
-	if( i < k ) {
-		l = fix_mul( l + l , x );
-		for (; i < k; i++)
-			WD(i) += l;
-	}
-}
-
-
-/* <summary>                             */
-/* Inverse 9-7 wavelet transform in 1-D. */
-/* </summary>                            */
-static void dwt_decode_1_real(dwt_t* v) {
-	int i;
-	if (!v->cas) {
-		if ((v->dn > 0) || (v->sn > 1)) {	/* NEW :  CASE ONE ELEMENT */
-			for (i = 0; i < v->sn; i++)
-				WS(i) = fix_mul(WS(i), 10078);	/* 10076 */
-			for (i = 0; i < v->dn; i++)
-				WD(i) = fix_mul(WD(i), 13318);	/* 13320 */
-			dwt_decode_sm(v, v->sn, v->dn, 3633);
-			dwt_decode_dm(v, v->dn, v->sn, 7233);
-			dwt_decode_sp(v, v->sn, v->dn, 434);
-			dwt_decode_dp(v, v->dn, v->sn, 12994);
-		}
-	} else {
-		if ((v->sn > 0) || (v->dn > 1)) {	/* NEW :  CASE ONE ELEMENT */
-			for (i = 0; i < v->sn; i++)
-				WD(i) = fix_mul(WD(i), 10078);	/* 10076 */
-			for (i = 0; i < v->dn; i++)
-				WS(i) = fix_mul(WS(i), 13318);	/* 13320 */
-			dwt_decode_dm(v, v->sn, v->dn, 3633);
-			dwt_decode_sm(v, v->dn, v->sn, 7233);
-			dwt_decode_dp(v, v->sn, v->dn, 434);
-			dwt_decode_sp(v, v->dn, v->sn, 12994);
-		}
-	}
-}
-
-static void dwt_encode_stepsize(int stepsize, int numbps, opj_stepsize_t *bandno_stepsize) {
-	int p, n;
-	p = int_floorlog2(stepsize) - 13;
-	n = 11 - int_floorlog2(stepsize);
-	bandno_stepsize->mant = (n < 0 ? stepsize >> -n : stepsize << n) & 0x7ff;
-	bandno_stepsize->expn = numbps - p;
-}
-
-/*
-==========================================================
-   DWT interface
-==========================================================
-*/
-
-/* <summary>                            */
-/* Forward 5-3 wavelet tranform in 2-D. */
-/* </summary>                           */
-void dwt_encode(opj_tcd_tilecomp_t * tilec) {
-	int i, j, k;
-	int *a = NULL;
-	int *aj = NULL;
-	int *bj = NULL;
-	int w, l;
-
-	w = tilec->x1-tilec->x0;
-	l = tilec->numresolutions-1;
-	a = tilec->data;
-
-	for (i = 0; i < l; i++) {
-		int rw;			/* width of the resolution level computed                                                           */
-		int rh;			/* heigth of the resolution level computed                                                          */
-		int rw1;		/* width of the resolution level once lower than computed one                                       */
-		int rh1;		/* height of the resolution level once lower than computed one                                      */
-		int cas_col;	/* 0 = non inversion on horizontal filtering 1 = inversion between low-pass and high-pass filtering */
-		int cas_row;	/* 0 = non inversion on vertical filtering 1 = inversion between low-pass and high-pass filtering   */
-		int dn, sn;
-
-		rw = tilec->resolutions[l - i].x1 - tilec->resolutions[l - i].x0;
-		rh = tilec->resolutions[l - i].y1 - tilec->resolutions[l - i].y0;
-		rw1= tilec->resolutions[l - i - 1].x1 - tilec->resolutions[l - i - 1].x0;
-		rh1= tilec->resolutions[l - i - 1].y1 - tilec->resolutions[l - i - 1].y0;
-
-		cas_row = tilec->resolutions[l - i].x0 % 2;
-		cas_col = tilec->resolutions[l - i].y0 % 2;
-
-		sn = rh1;
-		dn = rh - rh1;
-		bj = (int*)opj_malloc(rh * sizeof(int));
-		for (j = 0; j < rw; j++) {
-			aj = a + j;
-			for (k = 0; k < rh; k++)  bj[k] = aj[k*w];
-			dwt_encode_1(bj, dn, sn, cas_col);
-			dwt_deinterleave_v(bj, aj, dn, sn, w, cas_col);
-		}
-		opj_free(bj);
-
-		sn = rw1;
-		dn = rw - rw1;
-		bj = (int*)opj_malloc(rw * sizeof(int));
-		for (j = 0; j < rh; j++) {
-			aj = a + j * w;
-			for (k = 0; k < rw; k++)  bj[k] = aj[k];
-			dwt_encode_1(bj, dn, sn, cas_row);
-			dwt_deinterleave_h(bj, aj, dn, sn, cas_row);
-		}
-		opj_free(bj);
-	}
-}
-
-
-/* <summary>                            */
-/* Inverse 5-3 wavelet tranform in 2-D. */
-/* </summary>                           */
-void dwt_decode(opj_tcd_tilecomp_t * tilec, int stop) {
-	dwt_decode_tile(tilec, stop, &dwt_decode_1);
-}
-
-
-/* <summary>                          */
-/* Get gain of 5-3 wavelet transform. */
-/* </summary>                         */
-int dwt_getgain(int orient) {
-	if (orient == 0)
-		return 0;
-	if (orient == 1 || orient == 2)
-		return 1;
-	return 2;
-}
-
-/* <summary>                */
-/* Get norm of 5-3 wavelet. */
-/* </summary>               */
-double dwt_getnorm(int level, int orient) {
-	return dwt_norms[orient][level];
-}
-
-/* <summary>                             */
-/* Forward 9-7 wavelet transform in 2-D. */
-/* </summary>                            */
-
-void dwt_encode_real(opj_tcd_tilecomp_t * tilec) {
-	int i, j, k;
-	int *a = NULL;
-	int *aj = NULL;
-	int *bj = NULL;
-	int w, l;
-
-	w = tilec->x1-tilec->x0;
-	l = tilec->numresolutions-1;
-	a = tilec->data;
-
-	for (i = 0; i < l; i++) {
-		int rw;			/* width of the resolution level computed                                                     */
-		int rh;			/* heigth of the resolution level computed                                                    */
-		int rw1;		/* width of the resolution level once lower than computed one                                 */
-		int rh1;		/* height of the resolution level once lower than computed one                                */
-		int cas_col;	/* 0 = non inversion on horizontal filtering 1 = inversion between low-pass and high-pass filtering */
-		int cas_row;	/* 0 = non inversion on vertical filtering 1 = inversion between low-pass and high-pass filtering   */
-		int dn, sn;
-
-		rw = tilec->resolutions[l - i].x1 - tilec->resolutions[l - i].x0;
-		rh = tilec->resolutions[l - i].y1 - tilec->resolutions[l - i].y0;
-		rw1= tilec->resolutions[l - i - 1].x1 - tilec->resolutions[l - i - 1].x0;
-		rh1= tilec->resolutions[l - i - 1].y1 - tilec->resolutions[l - i - 1].y0;
-
-		cas_row = tilec->resolutions[l - i].x0 % 2;
-		cas_col = tilec->resolutions[l - i].y0 % 2;
-
-		sn = rh1;
-		dn = rh - rh1;
-		bj = (int*)opj_malloc(rh * sizeof(int));
-		for (j = 0; j < rw; j++) {
-			aj = a + j;
-			for (k = 0; k < rh; k++)  bj[k] = aj[k*w];
-			dwt_encode_1_real(bj, dn, sn, cas_col);
-			dwt_deinterleave_v(bj, aj, dn, sn, w, cas_col);
-		}
-		opj_free(bj);
-
-		sn = rw1;
-		dn = rw - rw1;
-		bj = (int*)opj_malloc(rw * sizeof(int));
-		for (j = 0; j < rh; j++) {
-			aj = a + j * w;
-			for (k = 0; k < rw; k++)  bj[k] = aj[k];
-			dwt_encode_1_real(bj, dn, sn, cas_row);
-			dwt_deinterleave_h(bj, aj, dn, sn, cas_row);
-		}
-		opj_free(bj);
-	}
-}
-
-
-/* <summary>                             */
-/* Inverse 9-7 wavelet transform in 2-D. */
-/* </summary>                            */
-void dwt_decode_real(opj_tcd_tilecomp_t * tilec, int stop) {
-	dwt_decode_tile(tilec, stop, dwt_decode_1_real);
-}
-
-
-/* <summary>                          */
-/* Get gain of 9-7 wavelet transform. */
-/* </summary>                         */
-int dwt_getgain_real(int orient) {
-	(void)orient;
-	return 0;
-}
-
-/* <summary>                */
-/* Get norm of 9-7 wavelet. */
-/* </summary>               */
-double dwt_getnorm_real(int level, int orient) {
-	return dwt_norms_real[orient][level];
-}
-
-void dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, int prec) {
-	int numbands, bandno;
-	numbands = 3 * tccp->numresolutions - 2;
-	for (bandno = 0; bandno < numbands; bandno++) {
-		double stepsize;
-		int resno, level, orient, gain;
-
-		resno = (bandno == 0) ? 0 : ((bandno - 1) / 3 + 1);
-		orient = (bandno == 0) ? 0 : ((bandno - 1) % 3 + 1);
-		level = tccp->numresolutions - 1 - resno;
-		gain = (tccp->qmfbid == 0) ? 0 : ((orient == 0) ? 0 : (((orient == 1) || (orient == 2)) ? 1 : 2));
-		if (tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) {
-			stepsize = 1.0;
-		} else {
-			double norm = dwt_norms_real[orient][level];
-			stepsize = (1 << (gain)) / norm;
-		}
-		dwt_encode_stepsize((int) floor(stepsize * 8192.0), prec + gain, &tccp->stepsizes[bandno]);
-	}
-}
-
-
-/* <summary>                             */
-/* Determine maximum computed resolution level for inverse wavelet transform */
-/* </summary>                            */
-static int dwt_decode_max_resolution(opj_tcd_resolution_t* r, int i) {
-	int mr	= 1;
-	int w;
-	while( --i ) {
-		r++;
-		if( mr < ( w = r->x1 - r->x0 ) )
-			mr = w ;
-		if( mr < ( w = r->y1 - r->y0 ) )
-			mr = w ;
-	}
-	return mr ;
-}
-
-
-/* <summary>                            */
-/* Inverse wavelet tranform in 2-D.     */
-/* </summary>                           */
-static void dwt_decode_tile(opj_tcd_tilecomp_t * tilec, int stop, DWT1DFN dwt_1D) {
-	opj_tcd_resolution_t* tr;
-	int i, j, k;
-	int *a = NULL;
-	int *aj = NULL;
-	int *m;
-	int w; //, l;
-	int rw;			/* width of the resolution level computed  */
-	int rh;			/* heigth of the resolution level computed  */
-	dwt_t h;
-	dwt_t v;
-
-	if( 1 > ( i = tilec->numresolutions - stop ) )
-		return ;
-
-	tr = tilec->resolutions;
-
-	w = tilec->x1-tilec->x0;
-	a = tilec->data;
-
-	m = (int*)opj_malloc(sizeof(int) * (dwt_decode_max_resolution(tr, i)+5));
-	h.mem = v.mem = (int*)( (uintptr_t)m + 16 - ( (uintptr_t)m % 16 ) ) ;
-
-	rw = tr->x1 - tr->x0;
-	rh = tr->y1 - tr->y0;
-
-	while( --i ) {
-		tr++;
-		h.sn = rw;
-		v.sn = rh;
-		h.dn = ( rw = tr->x1 - tr->x0 ) - h.sn;
-		v.dn = ( rh = tr->y1 - tr->y0 ) - v.sn;
-
-		h.cas = tr->x0 % 2;
-		v.cas = tr->y0 % 2;
-
-		aj = a;
-		j = rh;
-		while( j-- ) {
-			dwt_interleave_h(&h, aj);
-			(dwt_1D)(&h);
-			k = rw;
-			while( k-- )
-				aj[k] = h.mem[k];
-			aj += w;
-		}
-
-		aj = a;
-		j = rw;
-		while( j-- ) {
-			dwt_interleave_v(&v, aj, w);
-			(dwt_1D)(&v);
-			k = rh;
-			while( k-- )
-				aj[k * w] = v.mem[k];
-			aj++;
-		}
-	}
-	opj_free(m);
-}
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/dwt.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/dwt.h
deleted file mode 100644
index 5c95c76..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/dwt.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __DWT_H
-#define __DWT_H
-/**
-@file dwt.h
-@brief Implementation of a discrete wavelet transform (DWT)
-
-The functions in DWT.C have for goal to realize forward and inverse discret wavelet
-transform with filter 5-3 (reversible) and filter 9-7 (irreversible). The functions in
-DWT.C are used by some function in TCD.C.
-*/
-
-/** @defgroup DWT DWT - Implementation of a discrete wavelet transform */
-/*@{*/
-
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Forward 5-3 wavelet tranform in 2-D.
-Apply a reversible DWT transform to a component of an image.
-@param tilec Tile component information (current tile)
-*/
-void dwt_encode(opj_tcd_tilecomp_t * tilec);
-/**
-Inverse 5-3 wavelet tranform in 2-D.
-Apply a reversible inverse DWT transform to a component of an image.
-@param tilec Tile component information (current tile)
-@param stop FIXME Number of decoded resolution levels ?
-*/
-void dwt_decode(opj_tcd_tilecomp_t * tilec, int stop);
-/**
-Get the gain of a subband for the reversible 5-3 DWT.
-@param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH)
-@return Returns 0 if orient = 0, returns 1 if orient = 1 or 2, returns 2 otherwise
-*/
-int dwt_getgain(int orient);
-/**
-Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.
-@param level Level of the wavelet function
-@param orient Band of the wavelet function
-@return Returns the norm of the wavelet function
-*/
-double dwt_getnorm(int level, int orient);
-/**
-Forward 9-7 wavelet transform in 2-D.
-Apply an irreversible DWT transform to a component of an image.
-@param tilec Tile component information (current tile)
-*/
-void dwt_encode_real(opj_tcd_tilecomp_t * tilec);
-/**
-Inverse 9-7 wavelet transform in 2-D.
-Apply an irreversible inverse DWT transform to a component of an image.
-@param tilec Tile component information (current tile)
-@param stop FIXME Number of decoded resolution levels ?
-*/
-void dwt_decode_real(opj_tcd_tilecomp_t * tilec, int stop);
-/**
-Get the gain of a subband for the irreversible 9-7 DWT.
-@param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH)
-@return Returns the gain of the 9-7 wavelet transform
-*/
-int dwt_getgain_real(int orient);
-/**
-Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT
-@param level Level of the wavelet function
-@param orient Band of the wavelet function
-@return Returns the norm of the 9-7 wavelet
-*/
-double dwt_getnorm_real(int level, int orient);
-/**
-FIXME : comment ???
-@param tccp
-@param prec
-*/
-void dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, int prec);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __DWT_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/event.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/event.c
deleted file mode 100644
index 291ff58..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/event.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2005, Hervé Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/* ==========================================================
-     Utility functions
-   ==========================================================*/
-
-#if !defined(_MSC_VER) && !defined(__MINGW32__)
-static char*
-i2a(unsigned i, char *a, unsigned r) {
-	if (i/r > 0) a = i2a(i/r,a,r);
-	*a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i%r];
-	return a+1;
-}
-
-/**
- Transforms integer i into an ascii string and stores the result in a;
- string is encoded in the base indicated by r.
- @param i Number to be converted
- @param a String result
- @param r Base of value; must be in the range 2 - 36
- @return Returns a
-*/
-static char *
-_itoa(int i, char *a, int r) {
-	r = ((r < 2) || (r > 36)) ? 10 : r;
-	if(i < 0) {
-		*a = '-';
-		*i2a(-i, a+1, r) = 0;
-	}
-	else *i2a(i, a, r) = 0;
-	return a;
-}
-
-#endif /* !WIN32 */
-
-/* ----------------------------------------------------------------------- */
-
-opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context) {
-	if(cinfo) {
-		opj_event_mgr_t *previous = cinfo->event_mgr;
-		cinfo->event_mgr = event_mgr;
-		cinfo->client_data = context;
-		return previous;
-	}
-
-	return NULL;
-}
-
-bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...) {
-#define MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
-	opj_msg_callback msg_handler = NULL;
-
-	opj_event_mgr_t *event_mgr = cinfo->event_mgr;
-	if(event_mgr != NULL) {
-		switch(event_type) {
-			case EVT_ERROR:
-				msg_handler = event_mgr->error_handler;
-				break;
-			case EVT_WARNING:
-				msg_handler = event_mgr->warning_handler;
-				break;
-			case EVT_INFO:
-				msg_handler = event_mgr->info_handler;
-				break;
-			default:
-				break;
-		}
-		if(msg_handler == NULL) {
-			return false;
-		}
-	} else {
-		return false;
-	}
-
-	if ((fmt != NULL) && (event_mgr != NULL)) {
-		va_list arg;
-		int str_length/*, i, j*/; /* UniPG */
-		char message[MSG_SIZE];
-		memset(message, 0, MSG_SIZE);
-		/* initialize the optional parameter list */
-		va_start(arg, fmt);
-		/* check the length of the format string */
-		str_length = (strlen(fmt) > MSG_SIZE) ? MSG_SIZE : strlen(fmt);
-		/* parse the format string and put the result in 'message' */
-		vsprintf(message, fmt, arg); /* UniPG */
-		/* deinitialize the optional parameter list */
-		va_end(arg);
-
-		/* output the message to the user program */
-		msg_handler(message, cinfo->client_data);
-	}
-
-	return true;
-}
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/event.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/event.h
deleted file mode 100644
index 11910b0..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/event.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2005, Hervé Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __EVENT_H
-#define __EVENT_H
-/**
-@file event.h
-@brief Implementation of a event callback system
-
-The functions in EVENT.C have for goal to send output messages (errors, warnings, debug) to the user.
-*/
-
-#define EVT_ERROR	1	/**< Error event type */
-#define EVT_WARNING	2	/**< Warning event type */
-#define EVT_INFO	4	/**< Debug event type */
-
-/** @defgroup EVENT EVENT - Implementation of a event callback system */
-/*@{*/
-
-/** @name Exported functions (see also openjpeg.h) */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Write formatted data to a string and send the string to a user callback.
-@param cinfo Codec context info
-@param event_type Event type or callback to use to send the message
-@param fmt Format-control string (plus optionnal arguments)
-@return Returns true if successful, returns false otherwise
-*/
-bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __EVENT_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/fix.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/fix.h
deleted file mode 100644
index bcb2acb..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/fix.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __FIX_H
-#define __FIX_H
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-#define int64 __int64
-#else
-#define int64 long long
-#endif
-
-/**
-@file fix.h
-@brief Implementation of operations of specific multiplication (FIX)
-
-The functions in FIX.H have for goal to realize specific multiplication.
-*/
-
-/** @defgroup FIX FIX - Implementation of operations of specific multiplication */
-/*@{*/
-
-/**
-Multiply two fixed-precision rational numbers.
-@param a
-@param b
-@return Returns a * b
-*/
-static INLINE int fix_mul(int a, int b) {
-    int64 temp = (int64) a * (int64) b ;
-    temp += temp & 4096;
-    return (int) (temp >> 13) ;
-}
-
-/*@}*/
-
-#endif /* __FIX_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/image.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/image.c
deleted file mode 100644
index 84664e9..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/image.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2005, Hervé Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-opj_image_t* opj_image_create0() {
-	opj_image_t *image = (opj_image_t*)opj_malloc(sizeof(opj_image_t));
-	return image;
-}
-
-opj_image_t* OPJ_CALLCONV opj_image_create(int numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc) {
-	int compno;
-	opj_image_t *image = NULL;
-
-	image = (opj_image_t*)opj_malloc(sizeof(opj_image_t));
-	if(image) {
-		image->color_space = clrspc;
-		image->numcomps = numcmpts;
-		/* allocate memory for the per-component information */
-		image->comps = (opj_image_comp_t*)opj_malloc(image->numcomps * sizeof(opj_image_comp_t));
-		if(!image->comps) {
-			opj_image_destroy(image);
-			return NULL;
-		}
-		/* create the individual image components */
-		for(compno = 0; compno < numcmpts; compno++) {
-			opj_image_comp_t *comp = &image->comps[compno];
-			comp->dx = cmptparms[compno].dx;
-			comp->dy = cmptparms[compno].dy;
-			comp->w = cmptparms[compno].w;
-			comp->h = cmptparms[compno].h;
-			comp->x0 = cmptparms[compno].x0;
-			comp->y0 = cmptparms[compno].y0;
-			comp->prec = cmptparms[compno].prec;
-			comp->bpp = cmptparms[compno].bpp;
-			comp->sgnd = cmptparms[compno].sgnd;
-			comp->data = (int*)opj_malloc(comp->w * comp->h * sizeof(int));
-			if(!comp->data) {
-				opj_image_destroy(image);
-				return NULL;
-			}
-		}
-	}
-
-	return image;
-}
-
-void OPJ_CALLCONV opj_image_destroy(opj_image_t *image) {
-	int i;
-	if(image) {
-		if(image->comps) {
-			/* image components */
-			for(i = 0; i < image->numcomps; i++) {
-				opj_image_comp_t *image_comp = &image->comps[i];
-				if(image_comp->data) {
-					opj_free(image_comp->data);
-				}
-			}
-			opj_free(image->comps);
-		}
-		opj_free(image);
-	}
-}
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/image.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/image.h
deleted file mode 100644
index b56de4a..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/image.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2005, Hervé Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __IMAGE_H
-#define __IMAGE_H
-/**
-@file image.h
-@brief Implementation of operations on images (IMAGE)
-
-The functions in IMAGE.C have for goal to realize operations on images.
-*/
-
-/** @defgroup IMAGE IMAGE - Implementation of operations on images */
-/*@{*/
-
-/**
-Create an empty image
-@todo this function should be removed
-@return returns an empty image if successful, returns NULL otherwise
-*/
-opj_image_t* opj_image_create0();
-
-/*@}*/
-
-#endif /* __IMAGE_H */
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/int.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/int.h
deleted file mode 100644
index 4e5fe08..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/int.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __INT_H
-#define __INT_H
-/**
-@file int.h
-@brief Implementation of operations on integers (INT)
-
-The functions in INT.H have for goal to realize operations on integers.
-*/
-
-/** @defgroup INT INT - Implementation of operations on integers */
-/*@{*/
-
-/** @name Exported functions (see also openjpeg.h) */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Get the minimum of two integers
-@return Returns a if a < b else b
-*/
-static INLINE int int_min(int a, int b) {
-	return a < b ? a : b;
-}
-/**
-Get the maximum of two integers
-@return Returns a if a > b else b
-*/
-static INLINE int int_max(int a, int b) {
-	return (a > b) ? a : b;
-}
-/**
-Clamp an integer inside an interval
-@return
-<ul>
-<li>Returns a if (min < a < max)
-<li>Returns max if (a > max)
-<li>Returns min if (a < min)
-</ul>
-*/
-static INLINE int int_clamp(int a, int min, int max) {
-	if (a < min)
-		return min;
-	if (a > max)
-		return max;
-	return a;
-}
-/**
-@return Get absolute value of integer
-*/
-static INLINE int int_abs(int a) {
-	return a < 0 ? -a : a;
-}
-/**
-Divide an integer and round upwards
-@return Returns a divided by b
-*/
-static INLINE int int_ceildiv(int a, int b) {
-	return (a + b - 1) / b;
-}
-/**
-Divide an integer by a power of 2 and round upwards
-@return Returns a divided by 2^b
-*/
-static INLINE int int_ceildivpow2(int a, int b) {
-	return (a + (1 << b) - 1) >> b;
-}
-/**
-Divide an integer by a power of 2 and round downwards
-@return Returns a divided by 2^b
-*/
-static INLINE int int_floordivpow2(int a, int b) {
-	return a >> b;
-}
-/**
-Get logarithm of an integer and round downwards
-@return Returns log2(a)
-*/
-static INLINE int int_floorlog2(int a) {
-	int l;
-	for (l = 0; a > 1; l++) {
-		a >>= 1;
-	}
-	return l;
-}
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k.c
deleted file mode 100644
index 1ef653e..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k.c
+++ /dev/null
@@ -1,2630 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * Copyright (c) 2006-2007, Parvatha Elangovan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/** @defgroup J2K J2K - JPEG-2000 codestream reader/writer */
-/*@{*/
-
-/** @name Local static functions */
-/*@{*/
-
-/**
-Write the SOC marker (Start Of Codestream)
-@param j2k J2K handle
-*/
-static void j2k_write_soc(opj_j2k_t *j2k);
-/**
-Read the SOC marker (Start of Codestream)
-@param j2k J2K handle
-*/
-static void j2k_read_soc(opj_j2k_t *j2k);
-/**
-Write the SIZ marker (image and tile size)
-@param j2k J2K handle
-*/
-static void j2k_write_siz(opj_j2k_t *j2k);
-/**
-Read the SIZ marker (image and tile size)
-@param j2k J2K handle
-*/
-static void j2k_read_siz(opj_j2k_t *j2k);
-/**
-Write the COM marker (comment)
-@param j2k J2K handle
-*/
-static void j2k_write_com(opj_j2k_t *j2k);
-/**
-Read the COM marker (comment)
-@param j2k J2K handle
-*/
-static void j2k_read_com(opj_j2k_t *j2k);
-/**
-Write the value concerning the specified component in the marker COD and COC
-@param j2k J2K handle
-@param compno Number of the component concerned by the information written
-*/
-static void j2k_write_cox(opj_j2k_t *j2k, int compno);
-/**
-Read the value concerning the specified component in the marker COD and COC
-@param j2k J2K handle
-@param compno Number of the component concerned by the information read
-*/
-static void j2k_read_cox(opj_j2k_t *j2k, int compno);
-/**
-Write the COD marker (coding style default)
-@param j2k J2K handle
-*/
-static void j2k_write_cod(opj_j2k_t *j2k);
-/**
-Read the COD marker (coding style default)
-@param j2k J2K handle
-*/
-static void j2k_read_cod(opj_j2k_t *j2k);
-/**
-Write the COC marker (coding style component)
-@param j2k J2K handle
-@param compno Number of the component concerned by the information written
-*/
-static void j2k_write_coc(opj_j2k_t *j2k, int compno);
-/**
-Read the COC marker (coding style component)
-@param j2k J2K handle
-*/
-static void j2k_read_coc(opj_j2k_t *j2k);
-/**
-Write the value concerning the specified component in the marker QCD and QCC
-@param j2k J2K handle
-@param compno Number of the component concerned by the information written
-*/
-static void j2k_write_qcx(opj_j2k_t *j2k, int compno);
-/**
-Read the value concerning the specified component in the marker QCD and QCC
-@param j2k J2K handle
-@param compno Number of the component concern by the information read
-@param len Length of the information in the QCX part of the marker QCD/QCC
-*/
-static void j2k_read_qcx(opj_j2k_t *j2k, int compno, int len);
-/**
-Write the QCD marker (quantization default)
-@param j2k J2K handle
-*/
-static void j2k_write_qcd(opj_j2k_t *j2k);
-/**
-Read the QCD marker (quantization default)
-@param j2k J2K handle
-*/
-static void j2k_read_qcd(opj_j2k_t *j2k);
-/**
-Write the QCC marker (quantization component)
-@param j2k J2K handle
-@param compno Number of the component concerned by the information written
-*/
-static void j2k_write_qcc(opj_j2k_t *j2k, int compno);
-/**
-Read the QCC marker (quantization component)
-@param j2k J2K handle
-*/
-static void j2k_read_qcc(opj_j2k_t *j2k);
-/**
-Write the POC marker (progression order change)
-@param j2k J2K handle
-*/
-static void j2k_write_poc(opj_j2k_t *j2k);
-/**
-Read the POC marker (progression order change)
-@param j2k J2K handle
-*/
-static void j2k_read_poc(opj_j2k_t *j2k);
-/**
-Read the CRG marker (component registration)
-@param j2k J2K handle
-*/
-static void j2k_read_crg(opj_j2k_t *j2k);
-/**
-Read the TLM marker (tile-part lengths)
-@param j2k J2K handle
-*/
-static void j2k_read_tlm(opj_j2k_t *j2k);
-/**
-Read the PLM marker (packet length, main header)
-@param j2k J2K handle
-*/
-static void j2k_read_plm(opj_j2k_t *j2k);
-/**
-Read the PLT marker (packet length, tile-part header)
-@param j2k J2K handle
-*/
-static void j2k_read_plt(opj_j2k_t *j2k);
-/**
-Read the PPM marker (packet packet headers, main header)
-@param j2k J2K handle
-*/
-static void j2k_read_ppm(opj_j2k_t *j2k);
-/**
-Read the PPT marker (packet packet headers, tile-part header)
-@param j2k J2K handle
-*/
-static void j2k_read_ppt(opj_j2k_t *j2k);
-/**
-Write the TLM marker (Mainheader)
-@param j2k J2K handle
-*/
-static void j2k_write_tlm(opj_j2k_t *j2k);
-/**
-Write the SOT marker (start of tile-part)
-@param j2k J2K handle
-*/
-static void j2k_write_sot(opj_j2k_t *j2k);
-/**
-Read the SOT marker (start of tile-part)
-@param j2k J2K handle
-*/
-static void j2k_read_sot(opj_j2k_t *j2k);
-/**
-Write the SOD marker (start of data)
-@param j2k J2K handle
-@param tile_coder Pointer to a TCD handle
-*/
-static void j2k_write_sod(opj_j2k_t *j2k, void *tile_coder);
-/**
-Read the SOD marker (start of data)
-@param j2k J2K handle
-*/
-static void j2k_read_sod(opj_j2k_t *j2k);
-/**
-Write the RGN marker (region-of-interest)
-@param j2k J2K handle
-@param compno Number of the component concerned by the information written
-@param tileno Number of the tile concerned by the information written
-*/
-static void j2k_write_rgn(opj_j2k_t *j2k, int compno, int tileno);
-/**
-Read the RGN marker (region-of-interest)
-@param j2k J2K handle
-*/
-static void j2k_read_rgn(opj_j2k_t *j2k);
-/**
-Write the EOC marker (end of codestream)
-@param j2k J2K handle
-*/
-static void j2k_write_eoc(opj_j2k_t *j2k);
-/**
-Read the EOC marker (end of codestream)
-@param j2k J2K handle
-*/
-static void j2k_read_eoc(opj_j2k_t *j2k);
-/**
-Read an unknown marker
-@param j2k J2K handle
-*/
-static void j2k_read_unk(opj_j2k_t *j2k);
-
-/*@}*/
-
-/*@}*/
-
-/* ----------------------------------------------------------------------- */
-typedef struct j2k_prog_order{
-	OPJ_PROG_ORDER enum_prog;
-	char str_prog[4];
-}j2k_prog_order_t;
-
-j2k_prog_order_t j2k_prog_order_list[] = {
-	{CPRL, "CPRL"},
-	{LRCP, "LRCP"},
-	{PCRL, "PCRL"},
-	{RLCP, "RLCP"},
-	{RPCL, "RPCL"},
-	{-1, ""}
-};
-
-char *j2k_convert_progression_order(OPJ_PROG_ORDER prg_order){
-	j2k_prog_order_t *po;
-	for(po = j2k_prog_order_list; po->enum_prog != -1; po++ ){
-		if(po->enum_prog == prg_order){
-			break;
-		}
-	}
-	return po->str_prog;
-}
-
-static void j2k_check_poc_val(opj_cparameters_t *parameters, int numcomps, int numlayers){
-	int index, resno, compno, layno, i;
-	char loss = 0;
-	int step_c = 1;
-	int step_r = numcomps * step_c;
-	int step_l = parameters->numresolution * step_r;
-	int array_size = step_l * numlayers * sizeof(int);
-	int *packet_array = (int *) opj_malloc(array_size);
-
-	for (i = 0; i < parameters->numpocs ; i++) {
-		int layno0 = 0;
-		if(i > 0)
-			layno0 = (parameters->POC[i].layno1 > parameters->POC[i-1].layno1 )? parameters->POC[i-1].layno1 : 0;
-		for (resno = parameters->POC[i].resno0 ; resno < parameters->POC[i].resno1 ; resno++) {
-			for (compno = parameters->POC[i].compno0 ; compno < parameters->POC[i].compno1 ; compno++) {
-				for (layno = layno0; layno < parameters->POC[i].layno1 ; layno++) {
-					index = step_r * resno + step_c * compno + step_l * layno;
-					packet_array[index]= 1;
-				}
-			}
-		}
-	}
-	for (resno = 0; resno < parameters->numresolution; resno++) {
-		for (compno = 0; compno < numcomps; compno++) {
-			for (layno = 0; layno < numlayers ; layno++) {
-				index = step_r * resno + step_c * compno + step_l * layno;
-				if(!(	packet_array[index]== 1)){
-					loss = 1;
-				}
-			}
-		}
-	}
-	if(loss == 1)
-		fprintf(stdout,"Missing packets possible loss of data\n");
-	opj_free(packet_array);
-}
-
-void j2k_dump_image(FILE *fd, opj_image_t * img) {
-	int compno;
-	fprintf(fd, "image {\n");
-	fprintf(fd, "  x0=%d, y0=%d, x1=%d, y1=%d\n", img->x0, img->y0, img->x1, img->y1);
-	fprintf(fd, "  numcomps=%d\n", img->numcomps);
-	for (compno = 0; compno < img->numcomps; compno++) {
-		opj_image_comp_t *comp = &img->comps[compno];
-		fprintf(fd, "  comp %d {\n", compno);
-		fprintf(fd, "    dx=%d, dy=%d\n", comp->dx, comp->dy);
-		fprintf(fd, "    prec=%d\n", comp->prec);
-		fprintf(fd, "    sgnd=%d\n", comp->sgnd);
-		fprintf(fd, "  }\n");
-	}
-	fprintf(fd, "}\n");
-}
-
-void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp) {
-	int tileno, compno, layno, bandno, resno, numbands;
-	fprintf(fd, "coding parameters {\n");
-	fprintf(fd, "  tx0=%d, ty0=%d\n", cp->tx0, cp->ty0);
-	fprintf(fd, "  tdx=%d, tdy=%d\n", cp->tdx, cp->tdy);
-	fprintf(fd, "  tw=%d, th=%d\n", cp->tw, cp->th);
-	for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
-		opj_tcp_t *tcp = &cp->tcps[tileno];
-		fprintf(fd, "  tile %d {\n", tileno);
-		fprintf(fd, "    csty=%x\n", tcp->csty);
-		fprintf(fd, "    prg=%d\n", tcp->prg);
-		fprintf(fd, "    numlayers=%d\n", tcp->numlayers);
-		fprintf(fd, "    mct=%d\n", tcp->mct);
-		fprintf(fd, "    rates=");
-		for (layno = 0; layno < tcp->numlayers; layno++) {
-			fprintf(fd, "%.1f ", tcp->rates[layno]);
-		}
-		fprintf(fd, "\n");
-		for (compno = 0; compno < img->numcomps; compno++) {
-			opj_tccp_t *tccp = &tcp->tccps[compno];
-			fprintf(fd, "    comp %d {\n", compno);
-			fprintf(fd, "      csty=%x\n", tccp->csty);
-			fprintf(fd, "      numresolutions=%d\n", tccp->numresolutions);
-			fprintf(fd, "      cblkw=%d\n", tccp->cblkw);
-			fprintf(fd, "      cblkh=%d\n", tccp->cblkh);
-			fprintf(fd, "      cblksty=%x\n", tccp->cblksty);
-			fprintf(fd, "      qmfbid=%d\n", tccp->qmfbid);
-			fprintf(fd, "      qntsty=%d\n", tccp->qntsty);
-			fprintf(fd, "      numgbits=%d\n", tccp->numgbits);
-			fprintf(fd, "      roishift=%d\n", tccp->roishift);
-			fprintf(fd, "      stepsizes=");
-			numbands = tccp->qntsty == J2K_CCP_QNTSTY_SIQNT ? 1 : tccp->numresolutions * 3 - 2;
-			for (bandno = 0; bandno < numbands; bandno++) {
-				fprintf(fd, "(%d,%d) ", tccp->stepsizes[bandno].mant,
-					tccp->stepsizes[bandno].expn);
-			}
-			fprintf(fd, "\n");
-
-			if (tccp->csty & J2K_CCP_CSTY_PRT) {
-				fprintf(fd, "      prcw=");
-				for (resno = 0; resno < tccp->numresolutions; resno++) {
-					fprintf(fd, "%d ", tccp->prcw[resno]);
-				}
-				fprintf(fd, "\n");
-				fprintf(fd, "      prch=");
-				for (resno = 0; resno < tccp->numresolutions; resno++) {
-					fprintf(fd, "%d ", tccp->prch[resno]);
-				}
-				fprintf(fd, "\n");
-			}
-			fprintf(fd, "    }\n");
-		}
-		fprintf(fd, "  }\n");
-	}
-	fprintf(fd, "}\n");
-}
-
-/* ----------------------------------------------------------------------- */
-static int j2k_get_num_tp(opj_cp_t *cp,int pino,int tileno){
-	char *prog;
-	int i;
-	int tpnum=1,tpend=0;
-	opj_tcp_t *tcp = &cp->tcps[tileno];
-	prog = j2k_convert_progression_order(tcp->prg);
-
-	if(cp->tp_on == 1){
-		for(i=0;i<4;i++){
-			if(tpend!=1){
-				if( cp->tp_flag == prog[i] ){
-					tpend=1;cp->tp_pos=i;
-				}
-				switch(prog[i]){
-				case 'C':
-					tpnum= tpnum * tcp->pocs[pino].compE;
-					break;
-				case 'R':
-					tpnum= tpnum * tcp->pocs[pino].resE;
-					break;
-				case 'P':
-					tpnum= tpnum * tcp->pocs[pino].prcE;
-					break;
-				case 'L':
-					tpnum= tpnum * tcp->pocs[pino].layE;
-					break;
-				}
-			}
-		}
-	}else{
-		tpnum=1;
-	}
-	return tpnum;
-}
-
-/**	mem allocation for TLM marker*/
-int j2k_calculate_tp(opj_cp_t *cp,int img_numcomp,opj_image_t *image,opj_j2k_t *j2k ){
-	int pino,tileno,maxres=0,totnum_tp=0;
-	j2k->cur_totnum_tp = (int *) opj_malloc(cp->tw * cp->th * sizeof(int));
-	for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
-		int cur_totnum_tp = 0;
-		opj_tcp_t *tcp = &cp->tcps[tileno];
-		for(pino = 0; pino <= tcp->numpocs; pino++) {
-			int tp_num=0;
-			opj_pi_iterator_t *pi = pi_initialise_encode(image, cp, tileno,FINAL_PASS);
-			if(!pi) { return -1;}
-			tp_num = j2k_get_num_tp(cp,pino,tileno);
-			totnum_tp = totnum_tp + tp_num;
-			cur_totnum_tp = cur_totnum_tp + tp_num;
-			pi_destroy(pi, cp, tileno);
-		}
-		j2k->cur_totnum_tp[tileno] = cur_totnum_tp;
-	}
-	return totnum_tp;
-}
-
-static void j2k_write_soc(opj_j2k_t *j2k) {
-	opj_cio_t *cio = j2k->cio;
-	cio_write(cio, J2K_MS_SOC, 2);
-}
-
-static void j2k_read_soc(opj_j2k_t *j2k) {
-	j2k->state = J2K_STATE_MHSIZ;
-}
-
-static void j2k_write_siz(opj_j2k_t *j2k) {
-	int i;
-	int lenp, len;
-
-	opj_cio_t *cio = j2k->cio;
-	opj_image_t *image = j2k->image;
-	opj_cp_t *cp = j2k->cp;
-
-	cio_write(cio, J2K_MS_SIZ, 2);	/* SIZ */
-	lenp = cio_tell(cio);
-	cio_skip(cio, 2);
-	cio_write(cio, cp->rsiz, 2);			/* Rsiz (capabilities) */
-	cio_write(cio, image->x1, 4);	/* Xsiz */
-	cio_write(cio, image->y1, 4);	/* Ysiz */
-	cio_write(cio, image->x0, 4);	/* X0siz */
-	cio_write(cio, image->y0, 4);	/* Y0siz */
-	cio_write(cio, cp->tdx, 4);		/* XTsiz */
-	cio_write(cio, cp->tdy, 4);		/* YTsiz */
-	cio_write(cio, cp->tx0, 4);		/* XT0siz */
-	cio_write(cio, cp->ty0, 4);		/* YT0siz */
-	cio_write(cio, image->numcomps, 2);	/* Csiz */
-	for (i = 0; i < image->numcomps; i++) {
-		cio_write(cio, image->comps[i].prec - 1 + (image->comps[i].sgnd << 7), 1);	/* Ssiz_i */
-		cio_write(cio, image->comps[i].dx, 1);	/* XRsiz_i */
-		cio_write(cio, image->comps[i].dy, 1);	/* YRsiz_i */
-	}
-	len = cio_tell(cio) - lenp;
-	cio_seek(cio, lenp);
-	cio_write(cio, len, 2);		/* Lsiz */
-	cio_seek(cio, lenp + len);
-}
-
-static void j2k_read_siz(opj_j2k_t *j2k) {
-	int len, i;
-
-	opj_cio_t *cio = j2k->cio;
-	opj_image_t *image = j2k->image;
-	opj_cp_t *cp = j2k->cp;
-
-	len = cio_read(cio, 2);			/* Lsiz */
-	cio_read(cio, 2);				/* Rsiz (capabilities) */
-	image->x1 = cio_read(cio, 4);	/* Xsiz */
-	image->y1 = cio_read(cio, 4);	/* Ysiz */
-	image->x0 = cio_read(cio, 4);	/* X0siz */
-	image->y0 = cio_read(cio, 4);	/* Y0siz */
-	cp->tdx = cio_read(cio, 4);		/* XTsiz */
-	cp->tdy = cio_read(cio, 4);		/* YTsiz */
-	cp->tx0 = cio_read(cio, 4);		/* XT0siz */
-	cp->ty0 = cio_read(cio, 4);		/* YT0siz */
-
-	image->numcomps = cio_read(cio, 2);	/* Csiz */
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-		/* if JPWL is on, we check whether TX errors have damaged
-		  too much the SIZ parameters */
-		if (!(image->x1 * image->y1)) {
-			opj_event_msg(j2k->cinfo, EVT_ERROR,
-				"JPWL: bad image size (%d x %d)\n",
-				image->x1, image->y1);
-			if (!JPWL_ASSUME || JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-		}
-		if (image->numcomps != ((len - 38) / 3)) {
-			opj_event_msg(j2k->cinfo, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
-				"JPWL: Csiz is %d => space in SIZ only for %d comps.!!!\n",
-				image->numcomps, ((len - 38) / 3));
-			if (!JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-			/* we try to correct */
-			opj_event_msg(j2k->cinfo, EVT_WARNING, "- trying to adjust this\n");
-			if (image->numcomps < ((len - 38) / 3)) {
-				len = 38 + 3 * image->numcomps;
-				opj_event_msg(j2k->cinfo, EVT_WARNING, "- setting Lsiz to %d => HYPOTHESIS!!!\n",
-					len);
-			} else {
-				image->numcomps = ((len - 38) / 3);
-				opj_event_msg(j2k->cinfo, EVT_WARNING, "- setting Csiz to %d => HYPOTHESIS!!!\n",
-					image->numcomps);
-			}
-		}
-
-		/* update components number in the jpwl_exp_comps filed */
-		cp->exp_comps = image->numcomps;
-	}
-#endif /* USE_JPWL */
-
-	image->comps = (opj_image_comp_t *) opj_malloc(image->numcomps * sizeof(opj_image_comp_t));
-	for (i = 0; i < image->numcomps; i++) {
-		int tmp, w, h;
-		tmp = cio_read(cio, 1);		/* Ssiz_i */
-		image->comps[i].prec = (tmp & 0x7f) + 1;
-		image->comps[i].sgnd = tmp >> 7;
-		image->comps[i].dx = cio_read(cio, 1);	/* XRsiz_i */
-		image->comps[i].dy = cio_read(cio, 1);	/* YRsiz_i */
-
-#ifdef USE_JPWL
-		if (j2k->cp->correct) {
-		/* if JPWL is on, we check whether TX errors have damaged
-			too much the SIZ parameters, again */
-			if (!(image->comps[i].dx * image->comps[i].dy)) {
-				opj_event_msg(j2k->cinfo, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
-					"JPWL: bad XRsiz_%d/YRsiz_%d (%d x %d)\n",
-					i, i, image->comps[i].dx, image->comps[i].dy);
-				if (!JPWL_ASSUME) {
-					opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-					return;
-				}
-				/* we try to correct */
-				opj_event_msg(j2k->cinfo, EVT_WARNING, "- trying to adjust them\n");
-				if (!image->comps[i].dx) {
-					image->comps[i].dx = 1;
-					opj_event_msg(j2k->cinfo, EVT_WARNING, "- setting XRsiz_%d to %d => HYPOTHESIS!!!\n",
-						i, image->comps[i].dx);
-				}
-				if (!image->comps[i].dy) {
-					image->comps[i].dy = 1;
-					opj_event_msg(j2k->cinfo, EVT_WARNING, "- setting YRsiz_%d to %d => HYPOTHESIS!!!\n",
-						i, image->comps[i].dy);
-				}
-			}
-
-		}
-#endif /* USE_JPWL */
-
-
-		/* TODO: unused ? */
-		w = int_ceildiv(image->x1 - image->x0, image->comps[i].dx);
-		h = int_ceildiv(image->y1 - image->y0, image->comps[i].dy);
-
-		image->comps[i].resno_decoded = 0;	/* number of resolution decoded */
-		image->comps[i].factor = 0;			/* reducing factor per component */
-	}
-
-	cp->tw = int_ceildiv(image->x1 - cp->tx0, cp->tdx);
-	cp->th = int_ceildiv(image->y1 - cp->ty0, cp->tdy);
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-		/* if JPWL is on, we check whether TX errors have damaged
-		  too much the SIZ parameters */
-		if ((cp->tw < 1) || (cp->th < 1) || (cp->tw > cp->max_tiles) || (cp->th > cp->max_tiles)) {
-			opj_event_msg(j2k->cinfo, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
-				"JPWL: bad number of tiles (%d x %d)\n",
-				cp->tw, cp->th);
-			if (!JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-			/* we try to correct */
-			opj_event_msg(j2k->cinfo, EVT_WARNING, "- trying to adjust them\n");
-			if (cp->tw < 1) {
-				cp->tw= 1;
-				opj_event_msg(j2k->cinfo, EVT_WARNING, "- setting %d tiles in x => HYPOTHESIS!!!\n",
-					cp->tw);
-			}
-			if (cp->tw > cp->max_tiles) {
-				cp->tw= 1;
-				opj_event_msg(j2k->cinfo, EVT_WARNING, "- too large x, increase expectance of %d\n"
-					"- setting %d tiles in x => HYPOTHESIS!!!\n",
-					cp->max_tiles, cp->tw);
-			}
-			if (cp->th < 1) {
-				cp->th= 1;
-				opj_event_msg(j2k->cinfo, EVT_WARNING, "- setting %d tiles in y => HYPOTHESIS!!!\n",
-					cp->th);
-			}
-			if (cp->th > cp->max_tiles) {
-				cp->th= 1;
-				opj_event_msg(j2k->cinfo, EVT_WARNING, "- too large y, increase expectance of %d to continue\n",
-					"- setting %d tiles in y => HYPOTHESIS!!!\n",
-					cp->max_tiles, cp->th);
-			}
-		}
-	}
-#endif /* USE_JPWL */
-
-	cp->tcps = (opj_tcp_t *) opj_malloc(cp->tw * cp->th * sizeof(opj_tcp_t));
-	cp->tileno = (int *) opj_malloc(cp->tw * cp->th * sizeof(int));
-	cp->tileno_size = 0;
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-		if (!cp->tcps) {
-			opj_event_msg(j2k->cinfo, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
-				"JPWL: could not alloc tcps field of cp\n");
-			if (!JPWL_ASSUME || JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-		}
-	}
-#endif /* USE_JPWL */
-
-	for (i = 0; i < cp->tw * cp->th; i++) {
-		cp->tcps[i].POC = 0;
-		cp->tcps[i].numpocs = 0;
-		cp->tcps[i].first = 1;
-	}
-
-	/* Initialization for PPM marker */
-	cp->ppm = 0;
-	cp->ppm_data = NULL;
-	cp->ppm_data_first = NULL;
-	cp->ppm_previous = 0;
-	cp->ppm_store = 0;
-
-	j2k->default_tcp->tccps = (opj_tccp_t *) opj_malloc(sizeof(opj_tccp_t) * image->numcomps);
-	for (i = 0; i < cp->tw * cp->th; i++) {
-		cp->tcps[i].tccps = (opj_tccp_t *) opj_malloc(sizeof(opj_tccp_t) * image->numcomps);
-	}
-	j2k->tile_data = (unsigned char **) opj_malloc(cp->tw * cp->th * sizeof(unsigned char *));
-	j2k->tile_len = (int *) opj_malloc(cp->tw * cp->th * sizeof(int));
-	j2k->state = J2K_STATE_MH;
-}
-
-static void j2k_write_com(opj_j2k_t *j2k) {
-	unsigned int i;
-	int lenp, len;
-
-	if(j2k->cp->comment) {
-		opj_cio_t *cio = j2k->cio;
-		char *comment = j2k->cp->comment;
-
-		cio_write(cio, J2K_MS_COM, 2);
-		lenp = cio_tell(cio);
-		cio_skip(cio, 2);
-		cio_write(cio, 0, 2);
-		for (i = 0; i < strlen(comment); i++) {
-			cio_write(cio, comment[i], 1);
-		}
-		len = cio_tell(cio) - lenp;
-		cio_seek(cio, lenp);
-		cio_write(cio, len, 2);
-		cio_seek(cio, lenp + len);
-	}
-}
-
-static void j2k_read_com(opj_j2k_t *j2k) {
-	int len;
-
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);
-	cio_skip(cio, len - 2);
-}
-
-static void j2k_write_cox(opj_j2k_t *j2k, int compno) {
-	int i;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = &cp->tcps[j2k->curtileno];
-	opj_tccp_t *tccp = &tcp->tccps[compno];
-	opj_cio_t *cio = j2k->cio;
-
-	cio_write(cio, tccp->numresolutions - 1, 1);	/* SPcox (D) */
-	cio_write(cio, tccp->cblkw - 2, 1);				/* SPcox (E) */
-	cio_write(cio, tccp->cblkh - 2, 1);				/* SPcox (F) */
-	cio_write(cio, tccp->cblksty, 1);				/* SPcox (G) */
-	cio_write(cio, tccp->qmfbid, 1);				/* SPcox (H) */
-
-	if (tccp->csty & J2K_CCP_CSTY_PRT) {
-		for (i = 0; i < tccp->numresolutions; i++) {
-			cio_write(cio, tccp->prcw[i] + (tccp->prch[i] << 4), 1);	/* SPcox (I_i) */
-		}
-	}
-}
-
-static void j2k_read_cox(opj_j2k_t *j2k, int compno) {
-	int i;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = j2k->state == J2K_STATE_TPH ? &cp->tcps[j2k->curtileno] : j2k->default_tcp;
-	opj_tccp_t *tccp = &tcp->tccps[compno];
-	opj_cio_t *cio = j2k->cio;
-
-	tccp->numresolutions = cio_read(cio, 1) + 1;	/* SPcox (D) */
-
-	/* check the reduce value */
-	cp->reduce = int_min((tccp->numresolutions)-1, cp->reduce);
-	tccp->cblkw = cio_read(cio, 1) + 2;	/* SPcox (E) */
-	tccp->cblkh = cio_read(cio, 1) + 2;	/* SPcox (F) */
-	tccp->cblksty = cio_read(cio, 1);	/* SPcox (G) */
-	tccp->qmfbid = cio_read(cio, 1);	/* SPcox (H) */
-	if (tccp->csty & J2K_CP_CSTY_PRT) {
-		for (i = 0; i < tccp->numresolutions; i++) {
-			int tmp = cio_read(cio, 1);	/* SPcox (I_i) */
-			tccp->prcw[i] = tmp & 0xf;
-			tccp->prch[i] = tmp >> 4;
-		}
-	}
-}
-
-static void j2k_write_cod(opj_j2k_t *j2k) {
-	opj_cp_t *cp = NULL;
-	opj_tcp_t *tcp = NULL;
-	int lenp, len;
-
-	opj_cio_t *cio = j2k->cio;
-
-	cio_write(cio, J2K_MS_COD, 2);	/* COD */
-
-	lenp = cio_tell(cio);
-	cio_skip(cio, 2);
-
-	cp = j2k->cp;
-	tcp = &cp->tcps[j2k->curtileno];
-
-	cio_write(cio, tcp->csty, 1);		/* Scod */
-	cio_write(cio, tcp->prg, 1);		/* SGcod (A) */
-	cio_write(cio, tcp->numlayers, 2);	/* SGcod (B) */
-	cio_write(cio, tcp->mct, 1);		/* SGcod (C) */
-
-	j2k_write_cox(j2k, 0);
-	len = cio_tell(cio) - lenp;
-	cio_seek(cio, lenp);
-	cio_write(cio, len, 2);		/* Lcod */
-	cio_seek(cio, lenp + len);
-}
-
-static void j2k_read_cod(opj_j2k_t *j2k) {
-	int len, i, pos;
-
-	opj_cio_t *cio = j2k->cio;
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = j2k->state == J2K_STATE_TPH ? &cp->tcps[j2k->curtileno] : j2k->default_tcp;
-	opj_image_t *image = j2k->image;
-
-	len = cio_read(cio, 2);				/* Lcod */
-	tcp->csty = cio_read(cio, 1);		/* Scod */
-	tcp->prg = (OPJ_PROG_ORDER)cio_read(cio, 1);		/* SGcod (A) */
-	tcp->numlayers = cio_read(cio, 2);	/* SGcod (B) */
-	tcp->mct = cio_read(cio, 1);		/* SGcod (C) */
-
-	pos = cio_tell(cio);
-	for (i = 0; i < image->numcomps; i++) {
-		tcp->tccps[i].csty = tcp->csty & J2K_CP_CSTY_PRT;
-		cio_seek(cio, pos);
-		j2k_read_cox(j2k, i);
-	}
-}
-
-static void j2k_write_coc(opj_j2k_t *j2k, int compno) {
-	int lenp, len;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = &cp->tcps[j2k->curtileno];
-	opj_image_t *image = j2k->image;
-	opj_cio_t *cio = j2k->cio;
-
-	cio_write(cio, J2K_MS_COC, 2);	/* COC */
-	lenp = cio_tell(cio);
-	cio_skip(cio, 2);
-	cio_write(cio, compno, image->numcomps <= 256 ? 1 : 2);	/* Ccoc */
-	cio_write(cio, tcp->tccps[compno].csty, 1);	/* Scoc */
-	j2k_write_cox(j2k, compno);
-	len = cio_tell(cio) - lenp;
-	cio_seek(cio, lenp);
-	cio_write(cio, len, 2);			/* Lcoc */
-	cio_seek(cio, lenp + len);
-}
-
-static void j2k_read_coc(opj_j2k_t *j2k) {
-	int len, compno;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = j2k->state == J2K_STATE_TPH ? &cp->tcps[j2k->curtileno] : j2k->default_tcp;
-	opj_image_t *image = j2k->image;
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);		/* Lcoc */
-	compno = cio_read(cio, image->numcomps <= 256 ? 1 : 2);	/* Ccoc */
-	tcp->tccps[compno].csty = cio_read(cio, 1);	/* Scoc */
-	j2k_read_cox(j2k, compno);
-}
-
-static void j2k_write_qcx(opj_j2k_t *j2k, int compno) {
-	int bandno, numbands;
-	int expn, mant;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = &cp->tcps[j2k->curtileno];
-	opj_tccp_t *tccp = &tcp->tccps[compno];
-	opj_cio_t *cio = j2k->cio;
-
-	cio_write(cio, tccp->qntsty + (tccp->numgbits << 5), 1);	/* Sqcx */
-	numbands = tccp->qntsty == J2K_CCP_QNTSTY_SIQNT ? 1 : tccp->numresolutions * 3 - 2;
-
-	for (bandno = 0; bandno < numbands; bandno++) {
-		expn = tccp->stepsizes[bandno].expn;
-		mant = tccp->stepsizes[bandno].mant;
-
-		if (tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) {
-			cio_write(cio, expn << 3, 1);	/* SPqcx_i */
-		} else {
-			cio_write(cio, (expn << 11) + mant, 2);	/* SPqcx_i */
-		}
-	}
-}
-
-static void j2k_read_qcx(opj_j2k_t *j2k, int compno, int len) {
-	int tmp;
-	int bandno, numbands;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = j2k->state == J2K_STATE_TPH ? &cp->tcps[j2k->curtileno] : j2k->default_tcp;
-	opj_tccp_t *tccp = &tcp->tccps[compno];
-	opj_cio_t *cio = j2k->cio;
-
-	tmp = cio_read(cio, 1);		/* Sqcx */
-	tccp->qntsty = tmp & 0x1f;
-	tccp->numgbits = tmp >> 5;
-	numbands = (tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) ?
-		1 : ((tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) ? len - 1 : (len - 1) / 2);
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-
-		/* if JPWL is on, we check whether there are too many subbands */
-		if ((numbands < 0) || (numbands >= J2K_MAXBANDS)) {
-			opj_event_msg(j2k->cinfo, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
-				"JPWL: bad number of subbands in Sqcx (%d)\n",
-				numbands);
-			if (!JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-			/* we try to correct */
-			numbands = 1;
-			opj_event_msg(j2k->cinfo, EVT_WARNING, "- trying to adjust them\n"
-				"- setting number of bands to %d => HYPOTHESIS!!!\n",
-				numbands);
-		};
-
-	};
-#endif /* USE_JPWL */
-
-	for (bandno = 0; bandno < numbands; bandno++) {
-		int expn, mant;
-		if (tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) {
-			expn = cio_read(cio, 1) >> 3;	/* SPqcx_i */
-			mant = 0;
-		} else {
-			tmp = cio_read(cio, 2);	/* SPqcx_i */
-			expn = tmp >> 11;
-			mant = tmp & 0x7ff;
-		}
-		tccp->stepsizes[bandno].expn = expn;
-		tccp->stepsizes[bandno].mant = mant;
-	}
-
-	/* Add Antonin : if scalar_derived -> compute other stepsizes */
-	if (tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) {
-		for (bandno = 1; bandno < J2K_MAXBANDS; bandno++) {
-			tccp->stepsizes[bandno].expn =
-				((tccp->stepsizes[0].expn) - ((bandno - 1) / 3) > 0) ?
-					(tccp->stepsizes[0].expn) - ((bandno - 1) / 3) : 0;
-			tccp->stepsizes[bandno].mant = tccp->stepsizes[0].mant;
-		}
-	}
-	/* ddA */
-}
-
-static void j2k_write_qcd(opj_j2k_t *j2k) {
-	int lenp, len;
-
-	opj_cio_t *cio = j2k->cio;
-
-	cio_write(cio, J2K_MS_QCD, 2);	/* QCD */
-	lenp = cio_tell(cio);
-	cio_skip(cio, 2);
-	j2k_write_qcx(j2k, 0);
-	len = cio_tell(cio) - lenp;
-	cio_seek(cio, lenp);
-	cio_write(cio, len, 2);			/* Lqcd */
-	cio_seek(cio, lenp + len);
-}
-
-static void j2k_read_qcd(opj_j2k_t *j2k) {
-	int len, i, pos;
-
-	opj_cio_t *cio = j2k->cio;
-	opj_image_t *image = j2k->image;
-
-	len = cio_read(cio, 2);		/* Lqcd */
-	pos = cio_tell(cio);
-	for (i = 0; i < image->numcomps; i++) {
-		cio_seek(cio, pos);
-		j2k_read_qcx(j2k, i, len - 2);
-	}
-}
-
-static void j2k_write_qcc(opj_j2k_t *j2k, int compno) {
-	int lenp, len;
-
-	opj_cio_t *cio = j2k->cio;
-
-	cio_write(cio, J2K_MS_QCC, 2);	/* QCC */
-	lenp = cio_tell(cio);
-	cio_skip(cio, 2);
-	cio_write(cio, compno, j2k->image->numcomps <= 256 ? 1 : 2);	/* Cqcc */
-	j2k_write_qcx(j2k, compno);
-	len = cio_tell(cio) - lenp;
-	cio_seek(cio, lenp);
-	cio_write(cio, len, 2);			/* Lqcc */
-	cio_seek(cio, lenp + len);
-}
-
-static void j2k_read_qcc(opj_j2k_t *j2k) {
-	int len, compno;
-	int numcomp = j2k->image->numcomps;
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);	/* Lqcc */
-	compno = cio_read(cio, numcomp <= 256 ? 1 : 2);	/* Cqcc */
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-
-		static int backup_compno = 0;
-
-		/* compno is negative or larger than the number of components!!! */
-		if ((compno < 0) || (compno >= numcomp)) {
-			opj_event_msg(j2k->cinfo, EVT_ERROR,
-				"JPWL: bad component number in QCC (%d out of a maximum of %d)\n",
-				compno, numcomp);
-			if (!JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-			/* we try to correct */
-			compno = backup_compno % numcomp;
-			opj_event_msg(j2k->cinfo, EVT_WARNING, "- trying to adjust this\n"
-				"- setting component number to %d\n",
-				compno);
-		}
-
-		/* keep your private count of tiles */
-		backup_compno++;
-	};
-#endif /* USE_JPWL */
-
-	j2k_read_qcx(j2k, compno, len - 2 - (numcomp <= 256 ? 1 : 2));
-}
-
-static void j2k_write_poc(opj_j2k_t *j2k) {
-	int len, numpchgs, i;
-
-	int numcomps = j2k->image->numcomps;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = &cp->tcps[j2k->curtileno];
-	opj_tccp_t *tccp = &tcp->tccps[0];
-	opj_cio_t *cio = j2k->cio;
-
-	numpchgs = 1 + tcp->numpocs;
-	cio_write(cio, J2K_MS_POC, 2);	/* POC  */
-	len = 2 + (5 + 2 * (numcomps <= 256 ? 1 : 2)) * numpchgs;
-	cio_write(cio, len, 2);		/* Lpoc */
-	for (i = 0; i < numpchgs; i++) {
-		opj_poc_t *poc = &tcp->pocs[i];
-		cio_write(cio, poc->resno0, 1);	/* RSpoc_i */
-		cio_write(cio, poc->compno0, (numcomps <= 256 ? 1 : 2));	/* CSpoc_i */
-		cio_write(cio, poc->layno1, 2);	/* LYEpoc_i */
-		poc->layno1 = int_min(poc->layno1, tcp->numlayers);
-		cio_write(cio, poc->resno1, 1);	/* REpoc_i */
-		poc->resno1 = int_min(poc->resno1, tccp->numresolutions);
-		cio_write(cio, poc->compno1, (numcomps <= 256 ? 1 : 2));	/* CEpoc_i */
-		poc->compno1 = int_min(poc->compno1, numcomps);
-		cio_write(cio, poc->prg, 1);	/* Ppoc_i */
-	}
-}
-
-static void j2k_read_poc(opj_j2k_t *j2k) {
-	int len, numpchgs, i, old_poc;
-
-	int numcomps = j2k->image->numcomps;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = j2k->state == J2K_STATE_TPH ? &cp->tcps[j2k->curtileno] : j2k->default_tcp;
-	opj_tccp_t *tccp = &tcp->tccps[0];
-	opj_cio_t *cio = j2k->cio;
-
-	old_poc = tcp->POC ? tcp->numpocs + 1 : 0;
-	tcp->POC = 1;
-	len = cio_read(cio, 2);		/* Lpoc */
-	numpchgs = (len - 2) / (5 + 2 * (numcomps <= 256 ? 1 : 2));
-
-	for (i = old_poc; i < numpchgs + old_poc; i++) {
-		opj_poc_t *poc;
-		poc = &tcp->pocs[i];
-		poc->resno0 = cio_read(cio, 1);	/* RSpoc_i */
-		poc->compno0 = cio_read(cio, numcomps <= 256 ? 1 : 2);	/* CSpoc_i */
-		poc->layno1 = cio_read(cio, 2);    /* LYEpoc_i */
-		poc->resno1 = cio_read(cio, 1);    /* REpoc_i */
-		poc->compno1 = int_min(
-			cio_read(cio, numcomps <= 256 ? 1 : 2), (unsigned int) numcomps);	/* CEpoc_i */
-		poc->prg = (OPJ_PROG_ORDER)cio_read(cio, 1);	/* Ppoc_i */
-	}
-
-	tcp->numpocs = numpchgs + old_poc - 1;
-}
-
-static void j2k_read_crg(opj_j2k_t *j2k) {
-	int len, i, Xcrg_i, Ycrg_i;
-
-	opj_cio_t *cio = j2k->cio;
-	int numcomps = j2k->image->numcomps;
-
-	len = cio_read(cio, 2);			/* Lcrg */
-	for (i = 0; i < numcomps; i++) {
-		Xcrg_i = cio_read(cio, 2);	/* Xcrg_i */
-		Ycrg_i = cio_read(cio, 2);	/* Ycrg_i */
-	}
-}
-
-static void j2k_read_tlm(opj_j2k_t *j2k) {
-	int len, Ztlm, Stlm, ST, SP, tile_tlm, i;
-	long int Ttlm_i, Ptlm_i;
-
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);		/* Ltlm */
-	Ztlm = cio_read(cio, 1);	/* Ztlm */
-	Stlm = cio_read(cio, 1);	/* Stlm */
-	ST = ((Stlm >> 4) & 0x01) + ((Stlm >> 4) & 0x02);
-	SP = (Stlm >> 6) & 0x01;
-	tile_tlm = (len - 4) / ((SP + 1) * 2 + ST);
-	for (i = 0; i < tile_tlm; i++) {
-		Ttlm_i = cio_read(cio, ST);	/* Ttlm_i */
-		Ptlm_i = cio_read(cio, SP ? 4 : 2);	/* Ptlm_i */
-	}
-}
-
-static void j2k_read_plm(opj_j2k_t *j2k) {
-	int len, i, Zplm, Nplm, add, packet_len = 0;
-
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);		/* Lplm */
-	Zplm = cio_read(cio, 1);	/* Zplm */
-	len -= 3;
-	while (len > 0) {
-		Nplm = cio_read(cio, 4);		/* Nplm */
-		len -= 4;
-		for (i = Nplm; i > 0; i--) {
-			add = cio_read(cio, 1);
-			len--;
-			packet_len = (packet_len << 7) + add;	/* Iplm_ij */
-			if ((add & 0x80) == 0) {
-				/* New packet */
-				packet_len = 0;
-			}
-			if (len <= 0)
-				break;
-		}
-	}
-}
-
-static void j2k_read_plt(opj_j2k_t *j2k) {
-	int len, i, Zplt, packet_len = 0, add;
-
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);		/* Lplt */
-	Zplt = cio_read(cio, 1);	/* Zplt */
-	for (i = len - 3; i > 0; i--) {
-		add = cio_read(cio, 1);
-		packet_len = (packet_len << 7) + add;	/* Iplt_i */
-		if ((add & 0x80) == 0) {
-			/* New packet */
-			packet_len = 0;
-		}
-	}
-}
-
-static void j2k_read_ppm(opj_j2k_t *j2k) {
-	int len, Z_ppm, i, j;
-	int N_ppm;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);
-	cp->ppm = 1;
-
-	Z_ppm = cio_read(cio, 1);	/* Z_ppm */
-	len -= 3;
-	while (len > 0) {
-		if (cp->ppm_previous == 0) {
-			N_ppm = cio_read(cio, 4);	/* N_ppm */
-			len -= 4;
-		} else {
-			N_ppm = cp->ppm_previous;
-		}
-		j = cp->ppm_store;
-		if (Z_ppm == 0) {	/* First PPM marker */
-			cp->ppm_data = (unsigned char *) opj_malloc(N_ppm * sizeof(unsigned char));
-			cp->ppm_data_first = cp->ppm_data;
-			cp->ppm_len = N_ppm;
-		} else {			/* NON-first PPM marker */
-			cp->ppm_data = (unsigned char *) opj_realloc(cp->ppm_data, (N_ppm +	cp->ppm_store) * sizeof(unsigned char));
-
-#ifdef USE_JPWL
-			/* this memory allocation check could be done even in non-JPWL cases */
-			if (cp->correct) {
-				if (!cp->ppm_data) {
-					opj_event_msg(j2k->cinfo, EVT_ERROR,
-						"JPWL: failed memory allocation during PPM marker parsing (pos. %x)\n",
-						cio_tell(cio));
-					if (!JPWL_ASSUME || JPWL_ASSUME) {
-						free(cp->ppm_data);
-						opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-						return;
-					}
-				}
-			}
-#endif
-
-			cp->ppm_data_first = cp->ppm_data;
-			cp->ppm_len = N_ppm + cp->ppm_store;
-		}
-		for (i = N_ppm; i > 0; i--) {	/* Read packet header */
-			cp->ppm_data[j] = cio_read(cio, 1);
-			j++;
-			len--;
-			if (len == 0)
-				break;			/* Case of non-finished packet header in present marker but finished in next one */
-		}
-		cp->ppm_previous = i - 1;
-		cp->ppm_store = j;
-	}
-}
-
-static void j2k_read_ppt(opj_j2k_t *j2k) {
-	int len, Z_ppt, i, j = 0;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = cp->tcps + j2k->curtileno;
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);
-	Z_ppt = cio_read(cio, 1);
-	tcp->ppt = 1;
-	if (Z_ppt == 0) {		/* First PPT marker */
-		tcp->ppt_data = (unsigned char *) opj_malloc((len - 3) * sizeof(unsigned char));
-		tcp->ppt_data_first = tcp->ppt_data;
-		tcp->ppt_store = 0;
-		tcp->ppt_len = len - 3;
-	} else {			/* NON-first PPT marker */
-		tcp->ppt_data =	(unsigned char *) opj_realloc(tcp->ppt_data, (len - 3 + tcp->ppt_store) * sizeof(unsigned char));
-		tcp->ppt_data_first = tcp->ppt_data;
-		tcp->ppt_len = len - 3 + tcp->ppt_store;
-	}
-	j = tcp->ppt_store;
-	for (i = len - 3; i > 0; i--) {
-		tcp->ppt_data[j] = cio_read(cio, 1);
-		j++;
-	}
-	tcp->ppt_store = j;
-}
-
-static void j2k_write_tlm(opj_j2k_t *j2k){
-	int lenp;
-	opj_cio_t *cio = j2k->cio;
-	j2k->tlm_start = cio_tell(cio);
-	cio_write(cio, J2K_MS_TLM, 2);/* TLM */
-	lenp = 4 + (5*j2k->totnum_tp);
-	cio_write(cio,lenp,2);				/* Ltlm */
-	cio_write(cio, 0,1);					/* Ztlm=0*/
-	cio_write(cio,80,1);					/* Stlm ST=1(8bits-255 tiles max),SP=1(Ptlm=32bits) */
-	cio_skip(cio,5*j2k->totnum_tp);
-}
-
-static void j2k_write_sot(opj_j2k_t *j2k) {
-	int lenp, len;
-
-	opj_cio_t *cio = j2k->cio;
-
-	j2k->sot_start = cio_tell(cio);
-	cio_write(cio, J2K_MS_SOT, 2);		/* SOT */
-	lenp = cio_tell(cio);
-	cio_skip(cio, 2);					/* Lsot (further) */
-	cio_write(cio, j2k->curtileno, 2);	/* Isot */
-	cio_skip(cio, 4);					/* Psot (further in j2k_write_sod) */
-	cio_write(cio, j2k->cur_tp_num , 1);	/* TPsot */
-	cio_write(cio, j2k->cur_totnum_tp[j2k->curtileno], 1);		/* TNsot */
-	len = cio_tell(cio) - lenp;
-	cio_seek(cio, lenp);
-	cio_write(cio, len, 2);				/* Lsot */
-	cio_seek(cio, lenp + len);
-}
-
-static void j2k_read_sot(opj_j2k_t *j2k) {
-	int len, tileno, totlen, partno, numparts, i;
-	opj_tcp_t *tcp = NULL;
-	char status = 0;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_cio_t *cio = j2k->cio;
-
-	len = cio_read(cio, 2);
-	tileno = cio_read(cio, 2);
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-
-		static int backup_tileno = 0;
-
-		/* tileno is negative or larger than the number of tiles!!! */
-		if ((tileno < 0) || (tileno > (cp->tw * cp->th))) {
-			opj_event_msg(j2k->cinfo, EVT_ERROR,
-				"JPWL: bad tile number (%d out of a maximum of %d)\n",
-				tileno, (cp->tw * cp->th));
-			if (!JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-			/* we try to correct */
-			tileno = backup_tileno;
-			opj_event_msg(j2k->cinfo, EVT_WARNING, "- trying to adjust this\n"
-				"- setting tile number to %d\n",
-				tileno);
-		}
-
-		/* keep your private count of tiles */
-		backup_tileno++;
-	};
-#endif /* USE_JPWL */
-
-
-	if (cp->tileno_size == 0) {
-		cp->tileno[cp->tileno_size] = tileno;
-		cp->tileno_size++;
-	} else {
-		i = 0;
-		while (i < cp->tileno_size && status == 0) {
-			status = cp->tileno[i] == tileno ? 1 : 0;
-			i++;
-		}
-		if (status == 0) {
-			cp->tileno[cp->tileno_size] = tileno;
-			cp->tileno_size++;
-		}
-	}
-
-	totlen = cio_read(cio, 4);
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-
-		/* totlen is negative or larger than the bytes left!!! */
-		if ((totlen < 0) || (totlen > (cio_numbytesleft(cio) + 8))) {
-			opj_event_msg(j2k->cinfo, EVT_ERROR,
-				"JPWL: bad tile byte size (%d bytes against %d bytes left)\n",
-				totlen, cio_numbytesleft(cio) + 8);
-			if (!JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-			/* we try to correct */
-			totlen = 0;
-			opj_event_msg(j2k->cinfo, EVT_WARNING, "- trying to adjust this\n"
-				"- setting Psot to %d => assuming it is the last tile\n",
-				totlen);
-		}
-
-	};
-#endif /* USE_JPWL */
-
-	if (!totlen)
-		totlen = cio_numbytesleft(cio) + 8;
-
-	partno = cio_read(cio, 1);
-	numparts = cio_read(cio, 1);
-
-	j2k->curtileno = tileno;
-	j2k->eot = cio_getbp(cio) - 12 + totlen;
-	j2k->state = J2K_STATE_TPH;
-	tcp = &cp->tcps[j2k->curtileno];
-
-	if (tcp->first == 1) {
-
-		/* Initialization PPT */
-		opj_tccp_t *tmp = tcp->tccps;
-		memcpy(tcp, j2k->default_tcp, sizeof(opj_tcp_t));
-		tcp->ppt = 0;
-		tcp->ppt_data = NULL;
-		tcp->ppt_data_first = NULL;
-		tcp->tccps = tmp;
-
-		for (i = 0; i < j2k->image->numcomps; i++) {
-			tcp->tccps[i] = j2k->default_tcp->tccps[i];
-		}
-		cp->tcps[j2k->curtileno].first = 0;
-	}
-}
-
-static void j2k_write_sod(opj_j2k_t *j2k, void *tile_coder) {
-	int l, layno;
-	int totlen;
-	opj_tcp_t *tcp = NULL;
-	opj_image_info_t *image_info = NULL;
-
-	opj_tcd_t *tcd = (opj_tcd_t*)tile_coder;	/* cast is needed because of conflicts in header inclusions */
-	opj_cp_t *cp = j2k->cp;
-	opj_cio_t *cio = j2k->cio;
-
-	tcd->tp_num = j2k->tp_num ;
-	tcd->cur_tp_num = j2k->cur_tp_num;
-	tcd->cur_totnum_tp = j2k->cur_totnum_tp[j2k->curtileno];
-
-	cio_write(cio, J2K_MS_SOD, 2);
-	if (j2k->curtileno == 0) {
-		j2k->sod_start = cio_tell(cio) + j2k->pos_correction;
-	}
-
-	/* INDEX >> */
-	image_info = j2k->image_info;
-	if (image_info && image_info->index_on) {
-		image_info->tile[j2k->curtileno].end_header = cio_tell(cio) + j2k->pos_correction - 1;
-	}
-	/* << INDEX */
-
-	tcp = &cp->tcps[j2k->curtileno];
-	for (layno = 0; layno < tcp->numlayers; layno++) {
-		tcp->rates[layno] -= tcp->rates[layno] ? (j2k->sod_start / (cp->th * cp->tw)) : 0;
-	}
-	if(image_info) {
-		image_info->num = 0;
-	}
-
-	l = tcd_encode_tile(tcd, j2k->curtileno, cio_getbp(cio), cio_numbytesleft(cio) - 2, image_info);
-
-	/* Writing Psot in SOT marker */
-	totlen = cio_tell(cio) + l - j2k->sot_start;
-	cio_seek(cio, j2k->sot_start + 6);
-	cio_write(cio, totlen, 4);
-	cio_seek(cio, j2k->sot_start + totlen);
-	/* Writing Ttlm and Ptlm in TLM marker */
-	if(cp->cinema){
-		cio_seek(cio, j2k->tlm_start + 6 + (5*j2k->cur_tp_num));
-		cio_write(cio, j2k->curtileno, 1);
-		cio_write(cio, totlen, 4);
-	}
-	cio_seek(cio, j2k->sot_start + totlen);
-}
-
-static void j2k_read_sod(opj_j2k_t *j2k) {
-	int len, truncate = 0, i;
-	unsigned char *data = NULL, *data_ptr = NULL;
-
-	opj_cio_t *cio = j2k->cio;
-	int curtileno = j2k->curtileno;
-
-	len = int_min(j2k->eot - cio_getbp(cio), cio_numbytesleft(cio) + 1);
-
-	if (len == cio_numbytesleft(cio) + 1) {
-		truncate = 1;		/* Case of a truncate codestream */
-	}
-
-	data = (unsigned char *) opj_malloc((j2k->tile_len[curtileno] + len) * sizeof(unsigned char));
-
-	for (i = 0; i < j2k->tile_len[curtileno]; i++) {
-		data[i] = j2k->tile_data[curtileno][i];
-	}
-
-	data_ptr = data + j2k->tile_len[curtileno];
-	for (i = 0; i < len; i++) {
-		data_ptr[i] = cio_read(cio, 1);
-	}
-
-	j2k->tile_len[curtileno] += len;
-	opj_free(j2k->tile_data[curtileno]);
-	j2k->tile_data[curtileno] = data;
-
-	if (!truncate) {
-		j2k->state = J2K_STATE_TPHSOT;
-	} else {
-		j2k->state = J2K_STATE_NEOC;	/* RAJOUTE !! */
-	}
-}
-
-static void j2k_write_rgn(opj_j2k_t *j2k, int compno, int tileno) {
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = &cp->tcps[tileno];
-	opj_cio_t *cio = j2k->cio;
-	int numcomps = j2k->image->numcomps;
-
-	cio_write(cio, J2K_MS_RGN, 2);						/* RGN  */
-	cio_write(cio, numcomps <= 256 ? 5 : 6, 2);			/* Lrgn */
-	cio_write(cio, compno, numcomps <= 256 ? 1 : 2);	/* Crgn */
-	cio_write(cio, 0, 1);								/* Srgn */
-	cio_write(cio, tcp->tccps[compno].roishift, 1);		/* SPrgn */
-}
-
-static void j2k_read_rgn(opj_j2k_t *j2k) {
-	int len, compno, roisty;
-
-	opj_cp_t *cp = j2k->cp;
-	opj_tcp_t *tcp = j2k->state == J2K_STATE_TPH ? &cp->tcps[j2k->curtileno] : j2k->default_tcp;
-	opj_cio_t *cio = j2k->cio;
-	int numcomps = j2k->image->numcomps;
-
-	len = cio_read(cio, 2);										/* Lrgn */
-	compno = cio_read(cio, numcomps <= 256 ? 1 : 2);			/* Crgn */
-	roisty = cio_read(cio, 1);									/* Srgn */
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-		/* totlen is negative or larger than the bytes left!!! */
-		if (compno >= numcomps) {
-			opj_event_msg(j2k->cinfo, EVT_ERROR,
-				"JPWL: bad component number in RGN (%d when there are only %d)\n",
-				compno, numcomps);
-			if (!JPWL_ASSUME || JPWL_ASSUME) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: giving up\n");
-				return;
-			}
-		}
-	};
-#endif /* USE_JPWL */
-
-	tcp->tccps[compno].roishift = cio_read(cio, 1);				/* SPrgn */
-}
-
-static void j2k_write_eoc(opj_j2k_t *j2k) {
-	opj_cio_t *cio = j2k->cio;
-	/* opj_event_msg(j2k->cinfo, "%.8x: EOC\n", cio_tell(cio) + j2k->pos_correction); */
-	cio_write(cio, J2K_MS_EOC, 2);
-}
-
-static void j2k_read_eoc(opj_j2k_t *j2k) {
-	int i, tileno;
-
-	/* if packets should be decoded */
-	if (j2k->cp->limit_decoding != DECODE_ALL_BUT_PACKETS) {
-		opj_tcd_t *tcd = tcd_create(j2k->cinfo);
-		tcd_malloc_decode(tcd, j2k->image, j2k->cp);
-		for (i = 0; i < j2k->cp->tileno_size; i++) {
-			tileno = j2k->cp->tileno[i];
-			tcd_decode_tile(tcd, j2k->tile_data[tileno], j2k->tile_len[tileno], tileno);
-			opj_free(j2k->tile_data[tileno]);
-			j2k->tile_data[tileno] = NULL;
-		}
-		tcd_free_decode(tcd);
-		tcd_destroy(tcd);
-	}
-	/* if packets should not be decoded  */
-	else {
-		for (i = 0; i < j2k->cp->tileno_size; i++) {
-			tileno = j2k->cp->tileno[i];
-			opj_free(j2k->tile_data[tileno]);
-			j2k->tile_data[tileno] = NULL;
-		}
-	}
-
-	j2k->state = J2K_STATE_MT;
-}
-
-typedef struct opj_dec_mstabent {
-	/** marker value */
-	int id;
-	/** value of the state when the marker can appear */
-	int states;
-	/** action linked to the marker */
-	void (*handler) (opj_j2k_t *j2k);
-} opj_dec_mstabent_t;
-
-opj_dec_mstabent_t j2k_dec_mstab[] = {
-  {J2K_MS_SOC, J2K_STATE_MHSOC, j2k_read_soc},
-  {J2K_MS_SOT, J2K_STATE_MH | J2K_STATE_TPHSOT, j2k_read_sot},
-  {J2K_MS_SOD, J2K_STATE_TPH, j2k_read_sod},
-  {J2K_MS_EOC, J2K_STATE_TPHSOT, j2k_read_eoc},
-  {J2K_MS_SIZ, J2K_STATE_MHSIZ, j2k_read_siz},
-  {J2K_MS_COD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_cod},
-  {J2K_MS_COC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_coc},
-  {J2K_MS_RGN, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_rgn},
-  {J2K_MS_QCD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_qcd},
-  {J2K_MS_QCC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_qcc},
-  {J2K_MS_POC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_poc},
-  {J2K_MS_TLM, J2K_STATE_MH, j2k_read_tlm},
-  {J2K_MS_PLM, J2K_STATE_MH, j2k_read_plm},
-  {J2K_MS_PLT, J2K_STATE_TPH, j2k_read_plt},
-  {J2K_MS_PPM, J2K_STATE_MH, j2k_read_ppm},
-  {J2K_MS_PPT, J2K_STATE_TPH, j2k_read_ppt},
-  {J2K_MS_SOP, 0, 0},
-  {J2K_MS_CRG, J2K_STATE_MH, j2k_read_crg},
-  {J2K_MS_COM, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_com},
-
-#ifdef USE_JPWL
-  {J2K_MS_EPC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_epc},
-  {J2K_MS_EPB, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_epb},
-  {J2K_MS_ESD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_esd},
-  {J2K_MS_RED, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_red},
-#endif /* USE_JPWL */
-
-  {0, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_unk}
-};
-
-static void j2k_read_unk(opj_j2k_t *j2k) {
-	opj_event_msg(j2k->cinfo, EVT_WARNING, "Unknown marker\n");
-
-#ifdef USE_JPWL
-	if (j2k->cp->correct) {
-		int m = 0, id, i;
-		int min_id = 0, min_dist = 17, cur_dist = 0, tmp_id;
-		cio_seek(j2k->cio, cio_tell(j2k->cio) - 2);
-		id = cio_read(j2k->cio, 2);
-		opj_event_msg(j2k->cinfo, EVT_ERROR,
-			"JPWL: really don't know this marker %x\n",
-			id);
-		if (!JPWL_ASSUME) {
-			opj_event_msg(j2k->cinfo, EVT_ERROR,
-				"- possible synch loss due to uncorrectable codestream errors => giving up\n");
-			return;
-		}
-		/* OK, activate this at your own risk!!! */
-		/* we look for the marker at the minimum hamming distance from this */
-		while (j2k_dec_mstab[m].id) {
-
-			/* 1's where they differ */
-			tmp_id = j2k_dec_mstab[m].id ^ id;
-
-			/* compute the hamming distance between our id and the current */
-			cur_dist = 0;
-			for (i = 0; i < 16; i++) {
-				if ((tmp_id >> i) & 0x0001) {
-					cur_dist++;
-				}
-			}
-
-			/* if current distance is smaller, set the minimum */
-			if (cur_dist < min_dist) {
-				min_dist = cur_dist;
-				min_id = j2k_dec_mstab[m].id;
-			}
-
-			/* jump to the next marker */
-			m++;
-		}
-
-		/* do we substitute the marker? */
-		if (min_dist < JPWL_MAXIMUM_HAMMING) {
-			opj_event_msg(j2k->cinfo, EVT_ERROR,
-				"- marker %x is at distance %d from the read %x\n",
-				min_id, min_dist, id);
-			opj_event_msg(j2k->cinfo, EVT_ERROR,
-				"- trying to substitute in place and crossing fingers!\n");
-			cio_seek(j2k->cio, cio_tell(j2k->cio) - 2);
-			cio_write(j2k->cio, min_id, 2);
-
-			/* rewind */
-			cio_seek(j2k->cio, cio_tell(j2k->cio) - 2);
-
-		}
-
-	};
-#endif /* USE_JPWL */
-
-}
-
-/**
-Read the lookup table containing all the marker, status and action
-@param id Marker value
-*/
-static opj_dec_mstabent_t *j2k_dec_mstab_lookup(int id) {
-	opj_dec_mstabent_t *e;
-	for (e = j2k_dec_mstab; e->id != 0; e++) {
-		if (e->id == id) {
-			break;
-		}
-	}
-	return e;
-}
-
-/* ----------------------------------------------------------------------- */
-/* J2K / JPT decoder interface                                             */
-/* ----------------------------------------------------------------------- */
-
-opj_j2k_t* j2k_create_decompress(opj_common_ptr cinfo) {
-	opj_j2k_t *j2k = (opj_j2k_t*)opj_malloc(sizeof(opj_j2k_t));
-	if(j2k) {
-		j2k->cinfo = cinfo;
-		j2k->default_tcp = (opj_tcp_t*)opj_malloc(sizeof(opj_tcp_t));
-		if(!j2k->default_tcp) {
-			opj_free(j2k);
-			return NULL;
-		}
-	}
-	return j2k;
-}
-
-void j2k_destroy_decompress(opj_j2k_t *j2k) {
-	int i = 0;
-
-	if(j2k->tile_len != NULL) {
-		opj_free(j2k->tile_len);
-	}
-	if(j2k->tile_data != NULL) {
-		opj_free(j2k->tile_data);
-	}
-	if(j2k->default_tcp != NULL) {
-		opj_tcp_t *default_tcp = j2k->default_tcp;
-		if(default_tcp->ppt_data_first != NULL) {
-			opj_free(default_tcp->ppt_data_first);
-		}
-		if(j2k->default_tcp->tccps != NULL) {
-			opj_free(j2k->default_tcp->tccps);
-		}
-		opj_free(j2k->default_tcp);
-	}
-	if(j2k->cp != NULL) {
-		opj_cp_t *cp = j2k->cp;
-		if(cp->tcps != NULL) {
-			for(i = 0; i < cp->tw * cp->th; i++) {
-				if(cp->tcps[i].ppt_data_first != NULL) {
-					opj_free(cp->tcps[i].ppt_data_first);
-				}
-				if(cp->tcps[i].tccps != NULL) {
-					opj_free(cp->tcps[i].tccps);
-				}
-			}
-			opj_free(cp->tcps);
-		}
-		if(cp->ppm_data_first != NULL) {
-			opj_free(cp->ppm_data_first);
-		}
-		if(cp->tileno != NULL) {
-			opj_free(cp->tileno);
-		}
-		if(cp->comment != NULL) {
-			opj_free(cp->comment);
-		}
-
-		opj_free(cp);
-	}
-
-	opj_free(j2k);
-}
-
-void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters) {
-	if(j2k && parameters) {
-		/* create and initialize the coding parameters structure */
-		opj_cp_t *cp = (opj_cp_t*)opj_malloc(sizeof(opj_cp_t));
-		cp->reduce = parameters->cp_reduce;
-		cp->layer = parameters->cp_layer;
-		cp->limit_decoding = parameters->cp_limit_decoding;
-
-#ifdef USE_JPWL
-		cp->correct = parameters->jpwl_correct;
-		cp->exp_comps = parameters->jpwl_exp_comps;
-		cp->max_tiles = parameters->jpwl_max_tiles;
-#endif /* USE_JPWL */
-
-
-		/* keep a link to cp so that we can destroy it later in j2k_destroy_decompress */
-		j2k->cp = cp;
-	}
-}
-
-opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio) {
-	opj_image_t *image = NULL;
-
-	opj_common_ptr cinfo = j2k->cinfo;
-
-	j2k->cio = cio;
-
-	/* create an empty image */
-	image = opj_image_create0();
-	j2k->image = image;
-
-	j2k->state = J2K_STATE_MHSOC;
-
-	for (;;) {
-		opj_dec_mstabent_t *e;
-		int id = cio_read(cio, 2);
-
-
-#ifdef USE_JPWL
-		/* we try to honor JPWL correction power */
-		if (j2k->cp->correct) {
-
-			int orig_pos = cio_tell(cio);
-			bool status;
-
-			/* call the corrector */
-			status = jpwl_correct(j2k);
-
-			/* go back to where you were */
-			cio_seek(cio, orig_pos - 2);
-
-			/* re-read the marker */
-			id = cio_read(cio, 2);
-
-			/* check whether it begins with ff */
-			if (id >> 8 != 0xff) {
-				opj_event_msg(cinfo, EVT_ERROR,
-					"JPWL: possible bad marker %x at %d\n",
-					id, cio_tell(cio) - 2);
-				if (!JPWL_ASSUME) {
-					opj_image_destroy(image);
-					opj_event_msg(cinfo, EVT_ERROR, "JPWL: giving up\n");
-					return 0;
-				}
-				/* we try to correct */
-				id = id | 0xff00;
-				cio_seek(cio, cio_tell(cio) - 2);
-				cio_write(cio, id, 2);
-				opj_event_msg(cinfo, EVT_WARNING, "- trying to adjust this\n"
-					"- setting marker to %x\n",
-					id);
-			}
-
-		}
-#endif /* USE_JPWL */
-
-		if (id >> 8 != 0xff) {
-			opj_image_destroy(image);
-			opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id);
-			return 0;
-		}
-		e = j2k_dec_mstab_lookup(id);
-		// Check if the marker is known
-		if (!(j2k->state & e->states)) {
-			opj_image_destroy(image);
-			opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id);
-			return 0;
-		}
-		// Check if the decoding is limited to the main header
-		if (e->id == J2K_MS_SOT && j2k->cp->limit_decoding == LIMIT_TO_MAIN_HEADER) {
-			opj_event_msg(cinfo, EVT_INFO, "Main Header decoded.\n");
-			return image;
-		}
-
-		if (e->handler) {
-			(*e->handler)(j2k);
-		}
-		if (j2k->state == J2K_STATE_MT) {
-			break;
-		}
-		if (j2k->state == J2K_STATE_NEOC) {
-			break;
-		}
-	}
-	if (j2k->state == J2K_STATE_NEOC) {
-		j2k_read_eoc(j2k);
-	}
-
-	if (j2k->state != J2K_STATE_MT) {
-		opj_event_msg(cinfo, EVT_WARNING, "Incomplete bitstream\n");
-	}
-
-	return image;
-}
-
-/*
-* Read a JPT-stream and decode file
-*
-*/
-opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio) {
-	opj_image_t *image = NULL;
-	opj_jpt_msg_header_t header;
-	int position;
-
-	opj_common_ptr cinfo = j2k->cinfo;
-
-	j2k->cio = cio;
-
-	/* create an empty image */
-	image = opj_image_create0();
-
-	j2k->state = J2K_STATE_MHSOC;
-
-	/* Initialize the header */
-	jpt_init_msg_header(&header);
-	/* Read the first header of the message */
-	jpt_read_msg_header(cinfo, cio, &header);
-
-	position = cio_tell(cio);
-	if (header.Class_Id != 6) {	/* 6 : Main header data-bin message */
-		opj_image_destroy(image);
-		opj_event_msg(cinfo, EVT_ERROR, "[JPT-stream] : Expecting Main header first [class_Id %d] !\n", header.Class_Id);
-		return 0;
-	}
-
-	for (;;) {
-		opj_dec_mstabent_t *e = NULL;
-		int id;
-
-		if (!cio_numbytesleft(cio)) {
-			j2k_read_eoc(j2k);
-			return image;
-		}
-		/* data-bin read -> need to read a new header */
-		if ((unsigned int) (cio_tell(cio) - position) == header.Msg_length) {
-			jpt_read_msg_header(cinfo, cio, &header);
-			position = cio_tell(cio);
-			if (header.Class_Id != 4) {	/* 4 : Tile data-bin message */
-				opj_image_destroy(image);
-				opj_event_msg(cinfo, EVT_ERROR, "[JPT-stream] : Expecting Tile info !\n");
-				return 0;
-			}
-		}
-
-		id = cio_read(cio, 2);
-		if (id >> 8 != 0xff) {
-			opj_image_destroy(image);
-			opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id);
-			return 0;
-		}
-		e = j2k_dec_mstab_lookup(id);
-		if (!(j2k->state & e->states)) {
-			opj_image_destroy(image);
-			opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id);
-			return 0;
-		}
-		if (e->handler) {
-			(*e->handler)(j2k);
-		}
-		if (j2k->state == J2K_STATE_MT) {
-			break;
-		}
-		if (j2k->state == J2K_STATE_NEOC) {
-			break;
-		}
-	}
-	if (j2k->state == J2K_STATE_NEOC) {
-		j2k_read_eoc(j2k);
-	}
-
-	if (j2k->state != J2K_STATE_MT) {
-		opj_event_msg(cinfo, EVT_WARNING, "Incomplete bitstream\n");
-	}
-
-	return image;
-}
-
-/* ----------------------------------------------------------------------- */
-/* J2K encoder interface                                                       */
-/* ----------------------------------------------------------------------- */
-
-opj_j2k_t* j2k_create_compress(opj_common_ptr cinfo) {
-	opj_j2k_t *j2k = (opj_j2k_t*)opj_malloc(sizeof(opj_j2k_t));
-	if(j2k) {
-		j2k->cinfo = cinfo;
-	}
-	return j2k;
-}
-
-void j2k_destroy_compress(opj_j2k_t *j2k) {
-	int tileno;
-
-	if(!j2k) return;
-
-	if(j2k->image_info != NULL) {
-		opj_image_info_t *image_info = j2k->image_info;
-		if (image_info->index_on && j2k->cp) {
-			opj_cp_t *cp = j2k->cp;
-			for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
-				opj_tile_info_t *tile_info = &image_info->tile[tileno];
-				opj_free(tile_info->thresh);
-				opj_free(tile_info->packet);
-			}
-			opj_free(image_info->tile);
-		}
-		opj_free(image_info);
-	}
-	if(j2k->cp != NULL) {
-		opj_cp_t *cp = j2k->cp;
-
-		if(cp->comment) {
-			opj_free(cp->comment);
-		}
-		if(cp->matrice) {
-			opj_free(cp->matrice);
-		}
-		for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
-			opj_free(cp->tcps[tileno].tccps);
-		}
-		opj_free(cp->tcps);
-		opj_free(cp);
-	}
-
-	opj_free(j2k);
-}
-
-void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image) {
-	int i, j, tileno, numpocs_tile;
-	opj_cp_t *cp = NULL;
-
-	if(!j2k || !parameters || ! image) {
-		return;
-	}
-
-	/* create and initialize the coding parameters structure */
-	cp = (opj_cp_t*)opj_malloc(sizeof(opj_cp_t));
-
-	/* keep a link to cp so that we can destroy it later in j2k_destroy_compress */
-	j2k->cp = cp;
-
-	/* set default values for cp */
-	cp->tw = 1;
-	cp->th = 1;
-
-	/*
-	copy user encoding parameters
-	*/
-	cp->cinema = parameters->cp_cinema;
-	cp->max_comp_size =	parameters->max_comp_size;
-	cp->rsiz   = parameters->cp_rsiz;
-	cp->disto_alloc = parameters->cp_disto_alloc;
-	cp->fixed_alloc = parameters->cp_fixed_alloc;
-	cp->fixed_quality = parameters->cp_fixed_quality;
-
-	/* mod fixed_quality */
-	if(parameters->cp_matrice) {
-		size_t array_size = parameters->tcp_numlayers * parameters->numresolution * 3 * sizeof(int);
-		cp->matrice = (int *) opj_malloc(array_size);
-		memcpy(cp->matrice, parameters->cp_matrice, array_size);
-	}
-
-	/* creation of an index file ? */
-	cp->index_on = parameters->index_on;
-	if(cp->index_on) {
-		j2k->image_info = (opj_image_info_t*)opj_malloc(sizeof(opj_image_info_t));
-	}
-
-	/* tiles */
-	cp->tdx = parameters->cp_tdx;
-	cp->tdy = parameters->cp_tdy;
-
-	/* tile offset */
-	cp->tx0 = parameters->cp_tx0;
-	cp->ty0 = parameters->cp_ty0;
-
-	/* comment string */
-	if(parameters->cp_comment) {
-		cp->comment = (char*)opj_malloc(strlen(parameters->cp_comment) + 1);
-		if(cp->comment) {
-			strcpy(cp->comment, parameters->cp_comment);
-		}
-	}
-
-	/*
-	calculate other encoding parameters
-	*/
-
-	if (parameters->tile_size_on) {
-		cp->tw = int_ceildiv(image->x1 - cp->tx0, cp->tdx);
-		cp->th = int_ceildiv(image->y1 - cp->ty0, cp->tdy);
-	} else {
-		cp->tdx = image->x1 - cp->tx0;
-		cp->tdy = image->y1 - cp->ty0;
-	}
-
-	if(parameters->tp_on){
-		cp->tp_flag = parameters->tp_flag;
-		cp->tp_on = 1;
-	}
-
-	cp->img_size = 0;
-	for(i=0;i<image->numcomps ;i++){
-	cp->img_size += (image->comps[i].w *image->comps[i].h * image->comps[i].prec);
-	}
-
-
-#ifdef USE_JPWL
-	/*
-	calculate JPWL encoding parameters
-	*/
-
-	if (parameters->jpwl_epc_on) {
-		int i;
-
-		/* set JPWL on */
-		cp->epc_on = true;
-		cp->info_on = false; /* no informative technique */
-
-		/* set EPB on */
-		if ((parameters->jpwl_hprot_MH > 0) || (parameters->jpwl_hprot_TPH[0] > 0)) {
-			cp->epb_on = true;
-
-			cp->hprot_MH = parameters->jpwl_hprot_MH;
-			for (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {
-				cp->hprot_TPH_tileno[i] = parameters->jpwl_hprot_TPH_tileno[i];
-				cp->hprot_TPH[i] = parameters->jpwl_hprot_TPH[i];
-			}
-			/* if tile specs are not specified, copy MH specs */
-			if (cp->hprot_TPH[0] == -1) {
-				cp->hprot_TPH_tileno[0] = 0;
-				cp->hprot_TPH[0] = parameters->jpwl_hprot_MH;
-			}
-			for (i = 0; i < JPWL_MAX_NO_PACKSPECS; i++) {
-				cp->pprot_tileno[i] = parameters->jpwl_pprot_tileno[i];
-				cp->pprot_packno[i] = parameters->jpwl_pprot_packno[i];
-				cp->pprot[i] = parameters->jpwl_pprot[i];
-			}
-		}
-
-		/* set ESD writing */
-		if ((parameters->jpwl_sens_size == 1) || (parameters->jpwl_sens_size == 2)) {
-			cp->esd_on = true;
-
-			cp->sens_size = parameters->jpwl_sens_size;
-			cp->sens_addr = parameters->jpwl_sens_addr;
-			cp->sens_range = parameters->jpwl_sens_range;
-
-			cp->sens_MH = parameters->jpwl_sens_MH;
-			for (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {
-				cp->sens_TPH_tileno[i] = parameters->jpwl_sens_TPH_tileno[i];
-				cp->sens_TPH[i] = parameters->jpwl_sens_TPH[i];
-			}
-		}
-
-		/* always set RED writing to false: we are at the encoder */
-		cp->red_on = false;
-
-	} else {
-		cp->epc_on = false;
-	}
-#endif /* USE_JPWL */
-
-
-	/* initialize the mutiple tiles */
-	/* ---------------------------- */
-	cp->tcps = (opj_tcp_t *) opj_malloc(cp->tw * cp->th * sizeof(opj_tcp_t));
-
-	for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
-		opj_tcp_t *tcp = &cp->tcps[tileno];
-		tcp->numlayers = parameters->tcp_numlayers;
-		for (j = 0; j < tcp->numlayers; j++) {
-			if(cp->cinema){
-				if (cp->fixed_quality) {
-					tcp->distoratio[j] = parameters->tcp_distoratio[j];
-				}
-				tcp->rates[j] = parameters->tcp_rates[j];
-			}else{
-				if (cp->fixed_quality) {	/* add fixed_quality */
-					tcp->distoratio[j] = parameters->tcp_distoratio[j];
-				} else {
-					tcp->rates[j] = parameters->tcp_rates[j];
-				}
-			}
-		}
-		tcp->csty = parameters->csty;
-		tcp->prg = parameters->prog_order;
-		tcp->mct = parameters->tcp_mct;
-
-		numpocs_tile = 0;
-		tcp->POC = 0;
-		if (parameters->numpocs) {
-			/* initialisation of POC */
-			tcp->POC = 1;
-			j2k_check_poc_val(parameters, image->numcomps, tcp->numlayers);
-			for (i = 0; i < parameters->numpocs; i++) {
-				if((tileno == parameters->POC[i].tile - 1) || (parameters->POC[i].tile == -1)) {
-					opj_poc_t *tcp_poc = &tcp->pocs[numpocs_tile];
-					tcp_poc->resno0		= parameters->POC[numpocs_tile].resno0;
-					tcp_poc->compno0	= parameters->POC[numpocs_tile].compno0;
-					tcp_poc->layno1		= parameters->POC[numpocs_tile].layno1;
-					tcp_poc->resno1		= parameters->POC[numpocs_tile].resno1;
-					tcp_poc->compno1	= parameters->POC[numpocs_tile].compno1;
-					tcp_poc->prg1		= parameters->POC[numpocs_tile].prg1;
-					tcp_poc->tile		= parameters->POC[numpocs_tile].tile;
-					numpocs_tile++;
-				}
-			}
-			tcp->numpocs = numpocs_tile -1 ;
-		}else{
-			tcp->numpocs = 0;
-		}
-
-		tcp->tccps = (opj_tccp_t *) opj_malloc(image->numcomps * sizeof(opj_tccp_t));
-
-		for (i = 0; i < image->numcomps; i++) {
-			opj_tccp_t *tccp = &tcp->tccps[i];
-			tccp->csty = parameters->csty & 0x01;	/* 0 => one precinct || 1 => custom precinct  */
-			tccp->numresolutions = parameters->numresolution;
-			tccp->cblkw = int_floorlog2(parameters->cblockw_init);
-			tccp->cblkh = int_floorlog2(parameters->cblockh_init);
-			tccp->cblksty = parameters->mode;
-			tccp->qmfbid = parameters->irreversible ? 0 : 1;
-			tccp->qntsty = parameters->irreversible ? J2K_CCP_QNTSTY_SEQNT : J2K_CCP_QNTSTY_NOQNT;
-			tccp->numgbits = 2;
-			if (i == parameters->roi_compno) {
-				tccp->roishift = parameters->roi_shift;
-			} else {
-				tccp->roishift = 0;
-			}
-
-			if(parameters->cp_cinema)
-			{
-				//Precinct size for lowest frequency subband=128
-				tccp->prcw[0] = 7;
-				tccp->prch[0] = 7;
-				//Precinct size at all other resolutions = 256
-				for (j = 1; j < tccp->numresolutions; j++) {
-					tccp->prcw[j] = 8;
-					tccp->prch[j] = 8;
-				}
-			}else{
-				if (parameters->csty & J2K_CCP_CSTY_PRT) {
-					int p = 0;
-					for (j = tccp->numresolutions - 1; j >= 0; j--) {
-						if (p < parameters->res_spec) {
-
-							if (parameters->prcw_init[p] < 1) {
-								tccp->prcw[j] = 1;
-							} else {
-								tccp->prcw[j] = int_floorlog2(parameters->prcw_init[p]);
-							}
-
-							if (parameters->prch_init[p] < 1) {
-								tccp->prch[j] = 1;
-							}else {
-								tccp->prch[j] = int_floorlog2(parameters->prch_init[p]);
-							}
-
-						} else {
-							int res_spec = parameters->res_spec;
-							int size_prcw = parameters->prcw_init[res_spec - 1] >> (p - (res_spec - 1));
-							int size_prch = parameters->prch_init[res_spec - 1] >> (p - (res_spec - 1));
-
-							if (size_prcw < 1) {
-								tccp->prcw[j] = 1;
-							} else {
-								tccp->prcw[j] = int_floorlog2(size_prcw);
-							}
-
-							if (size_prch < 1) {
-								tccp->prch[j] = 1;
-							} else {
-								tccp->prch[j] = int_floorlog2(size_prch);
-							}
-						}
-						p++;
-						/*printf("\nsize precinct for level %d : %d,%d\n", j,tccp->prcw[j], tccp->prch[j]); */
-					}	//end for
-				} else {
-					for (j = 0; j < tccp->numresolutions; j++) {
-						tccp->prcw[j] = 15;
-						tccp->prch[j] = 15;
-					}
-				}
-			}
-
-			dwt_calc_explicit_stepsizes(tccp, image->comps[i].prec);
-		}
-	}
-}
-
-/**
-Create an index file
-@param j2k
-@param cio
-@param image_info
-@param index Index filename
-@return Returns 1 if successful, returns 0 otherwise
-*/
-static int j2k_create_index(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_info_t *image_info, char *index) {
-	int tileno, compno, layno, resno, precno, pack_nb, x, y;
-	FILE *stream = NULL;
-	double total_disto = 0;
-
-	image_info->codestream_size = cio_tell(cio) + j2k->pos_correction;	/* Correction 14/4/03 suite rmq de Patrick */
-
-
-#ifdef USE_JPWL
-	/* if JPWL is enabled and the name coincides with our own set
-	   then discard the creation of the file: this was just done to
-	   enable indexing, we do not want an index file
-	*/
-	if (j2k->cp->epc_on && !strcmp(index, JPWL_PRIVATEINDEX_NAME))
-		return 1;
-#endif /* USE_JPWL */
-
-
-	stream = fopen(index, "w");
-	if (!stream) {
-		opj_event_msg(j2k->cinfo, EVT_ERROR, "failed to open %s for writing\n", index);
-		return 0;
-	}
-
-	fprintf(stream, "%d %d\n", image_info->image_w, image_info->image_h);
-	fprintf(stream, "%d\n", image_info->prog);
-	fprintf(stream, "%d %d\n", image_info->tile_x, image_info->tile_y);
-	fprintf(stream, "%d %d\n", image_info->tw, image_info->th);
-	fprintf(stream, "%d\n", image_info->comp);
-	fprintf(stream, "%d\n", image_info->layer);
-	fprintf(stream, "%d\n", image_info->decomposition);
-
-	for (resno = image_info->decomposition; resno >= 0; resno--) {
-		fprintf(stream, "[%d,%d] ",
-			(1 << image_info->tile[0].pdx[resno]), (1 << image_info->tile[0].pdx[resno]));	/* based on tile 0 */
-	}
-	fprintf(stream, "\n");
-	fprintf(stream, "%d\n", image_info->main_head_end);
-	fprintf(stream, "%d\n", image_info->codestream_size);
-
-	for (tileno = 0; tileno < image_info->tw * image_info->th; tileno++) {
-		fprintf(stream, "%4d %9d %9d %9d %9e %9d %9e\n",
-			image_info->tile[tileno].num_tile,
-			image_info->tile[tileno].start_pos,
-			image_info->tile[tileno].end_header,
-			image_info->tile[tileno].end_pos,
-			image_info->tile[tileno].distotile, image_info->tile[tileno].nbpix,
-			image_info->tile[tileno].distotile / image_info->tile[tileno].nbpix);
-	}
-
-	for (tileno = 0; tileno < image_info->tw * image_info->th; tileno++) {
-		int start_pos, end_pos;
-		double disto = 0;
-		pack_nb = 0;
-
-		/*
-		fprintf(stream, "pkno tileno layerno resno compno precno start_pos   end_pos       deltaSE        \n");
-		*/
-
-		if (image_info->prog == LRCP) {	/* LRCP */
-			/*
-			fprintf(stream, "pack_nb tileno layno resno compno precno start_pos  end_pos   disto");
-			*/
-			for (layno = 0; layno < image_info->layer; layno++) {
-				for (resno = 0; resno < image_info->decomposition + 1; resno++) {
-					for (compno = 0; compno < image_info->comp; compno++) {
-						int prec_max = image_info->tile[tileno].pw[resno] * image_info->tile[tileno].ph[resno];
-						for (precno = 0; precno < prec_max; precno++) {
-							start_pos = image_info->tile[tileno].packet[pack_nb].start_pos;
-							end_pos = image_info->tile[tileno].packet[pack_nb].end_pos;
-							disto = image_info->tile[tileno].packet[pack_nb].disto;
-							fprintf(stream, "%4d %6d %7d %5d %6d %6d %9d %9d %8e\n",
-								pack_nb, tileno, layno, resno, compno, precno, start_pos, end_pos, disto);
-							total_disto += disto;
-							pack_nb++;
-						}
-					}
-				}
-			}
-		} /* LRCP */
-		else if (image_info->prog == RLCP) {	/* RLCP */
-			/*
-			fprintf(stream, "pack_nb tileno resno layno compno precno start_pos  end_pos   disto");
-			*/
-			for (resno = 0; resno < image_info->decomposition + 1; resno++) {
-				for (layno = 0; layno < image_info->layer; layno++) {
-					for (compno = 0; compno < image_info->comp; compno++) {
-						int prec_max = image_info->tile[tileno].pw[resno] * image_info->tile[tileno].ph[resno];
-						for (precno = 0; precno < prec_max; precno++) {
-							start_pos = image_info->tile[tileno].packet[pack_nb].start_pos;
-							end_pos = image_info->tile[tileno].packet[pack_nb].end_pos;
-							disto = image_info->tile[tileno].packet[pack_nb].disto;
-							fprintf(stream, "%4d %6d %5d %7d %6d %6d %9d %9d %8e\n",
-								pack_nb, tileno, resno, layno, compno, precno, start_pos, end_pos, disto);
-							total_disto += disto;
-							pack_nb++;
-						}
-					}
-				}
-			}
-		} /* RLCP */
-		else if (image_info->prog == RPCL) {	/* RPCL */
-			/*
-			fprintf(stream, "\npack_nb tileno resno precno compno layno start_pos  end_pos   disto\n");
-			*/
-			for (resno = 0; resno < image_info->decomposition + 1; resno++) {
-				/* I suppose components have same XRsiz, YRsiz */
-				int x0 = image_info->tile_Ox + tileno - (int)floor( (float)tileno/(float)image_info->tw ) * image_info->tw * image_info->tile_x;
-				int y0 = image_info->tile_Ox + (int)floor( (float)tileno/(float)image_info->tw ) * image_info->tile_y;
-				int x1 = x0 + image_info->tile_x;
-				int y1 = y0 + image_info->tile_y;
-				for(y = y0; y < y1; y++) {
-					for(x = x0; x < x1; x++) {
-						for (compno = 0; compno < image_info->comp; compno++) {
-							int prec_max = image_info->tile[tileno].pw[resno] * image_info->tile[tileno].ph[resno];
-							for (precno = 0; precno < prec_max; precno++) {
-								int pcnx = image_info->tile[tileno].pw[resno];
-								int pcx = (int) pow( 2, image_info->tile[tileno].pdx[resno] + image_info->decomposition - resno );
-								int pcy = (int) pow( 2, image_info->tile[tileno].pdy[resno] + image_info->decomposition - resno );
-								int precno_x = precno - (int) floor( (float)precno/(float)pcnx ) * pcnx;
-								int precno_y = (int) floor( (float)precno/(float)pcnx );
-								if (precno_y*pcy == y ) {
-									if (precno_x*pcx == x ) {
-										for (layno = 0; layno < image_info->layer; layno++) {
-											start_pos = image_info->tile[tileno].packet[pack_nb].start_pos;
-											end_pos = image_info->tile[tileno].packet[pack_nb].end_pos;
-											disto = image_info->tile[tileno].packet[pack_nb].disto;
-											fprintf(stream, "%4d %6d %5d %6d %6d %7d %9d %9d %8e\n",
-												pack_nb, tileno, resno, precno, compno, layno, start_pos, end_pos, disto);
-											total_disto += disto;
-											pack_nb++;
-										}
-									}
-								}
-							} /* precno */
-						} /* compno */
-					} /* x = x0..x1 */
-				} /* y = y0..y1 */
-			} /* resno */
-		} /* RPCL */
-		else if (image_info->prog == PCRL) {	/* PCRL */
-			/* I suppose components have same XRsiz, YRsiz */
-			int x0 = image_info->tile_Ox + tileno - (int)floor( (float)tileno/(float)image_info->tw ) * image_info->tw * image_info->tile_x;
-			int y0 = image_info->tile_Ox + (int)floor( (float)tileno/(float)image_info->tw ) * image_info->tile_y;
-			int x1 = x0 + image_info->tile_x;
-			int y1 = y0 + image_info->tile_y;
-			/*
-			fprintf(stream, "\npack_nb tileno precno compno resno layno start_pos  end_pos   disto\n");
-			*/
-			for(y = y0; y < y1; y++) {
-				for(x = x0; x < x1; x++) {
-					for (compno = 0; compno < image_info->comp; compno++) {
-						for (resno = 0; resno < image_info->decomposition + 1; resno++) {
-							int prec_max = image_info->tile[tileno].pw[resno] * image_info->tile[tileno].ph[resno];
-							for (precno = 0; precno < prec_max; precno++) {
-								int pcnx = image_info->tile[tileno].pw[resno];
-								int pcx = (int) pow( 2, image_info->tile[tileno].pdx[resno] + image_info->decomposition - resno );
-								int pcy = (int) pow( 2, image_info->tile[tileno].pdy[resno] + image_info->decomposition - resno );
-								int precno_x = precno - (int) floor( (float)precno/(float)pcnx ) * pcnx;
-								int precno_y = (int) floor( (float)precno/(float)pcnx );
-								if (precno_y*pcy == y ) {
-									if (precno_x*pcx == x ) {
-										for (layno = 0; layno < image_info->layer; layno++) {
-											start_pos = image_info->tile[tileno].packet[pack_nb].start_pos;
-											end_pos = image_info->tile[tileno].packet[pack_nb].end_pos;
-											disto = image_info->tile[tileno].packet[pack_nb].disto;
-											fprintf(stream, "%4d %6d %6d %6d %5d %7d %9d %9d %8e\n",
-												pack_nb, tileno, precno, compno, resno, layno, start_pos, end_pos, disto);
-											total_disto += disto;
-											pack_nb++;
-										}
-									}
-								}
-							} /* precno */
-						} /* resno */
-					} /* compno */
-				} /* x = x0..x1 */
-			} /* y = y0..y1 */
-		} /* PCRL */
-		else {	/* CPRL */
-			/*
-			fprintf(stream, "\npack_nb tileno compno precno resno layno start_pos  end_pos   disto\n");
-			*/
-			for (compno = 0; compno < image_info->comp; compno++) {
-				/* I suppose components have same XRsiz, YRsiz */
-				int x0 = image_info->tile_Ox + tileno - (int)floor( (float)tileno/(float)image_info->tw ) * image_info->tw * image_info->tile_x;
-				int y0 = image_info->tile_Ox + (int)floor( (float)tileno/(float)image_info->tw ) * image_info->tile_y;
-				int x1 = x0 + image_info->tile_x;
-				int y1 = y0 + image_info->tile_y;
-				for(y = y0; y < y1; y++) {
-					for(x = x0; x < x1; x++) {
-						for (resno = 0; resno < image_info->decomposition + 1; resno++) {
-							int prec_max = image_info->tile[tileno].pw[resno] * image_info->tile[tileno].ph[resno];
-							for (precno = 0; precno < prec_max; precno++) {
-								int pcnx = image_info->tile[tileno].pw[resno];
-								int pcx = (int) pow( 2, image_info->tile[tileno].pdx[resno] + image_info->decomposition - resno );
-								int pcy = (int) pow( 2, image_info->tile[tileno].pdy[resno] + image_info->decomposition - resno );
-								int precno_x = precno - (int) floor( (float)precno/(float)pcnx ) * pcnx;
-								int precno_y = (int) floor( (float)precno/(float)pcnx );
-								if (precno_y*pcy == y ) {
-									if (precno_x*pcx == x ) {
-										for (layno = 0; layno < image_info->layer; layno++) {
-											start_pos = image_info->tile[tileno].packet[pack_nb].start_pos;
-											end_pos = image_info->tile[tileno].packet[pack_nb].end_pos;
-											disto = image_info->tile[tileno].packet[pack_nb].disto;
-											fprintf(stream, "%4d %6d %6d %6d %5d %7d %9d %9d %8e\n",
-												pack_nb, tileno, compno, precno, resno, layno, start_pos, end_pos, disto);
-											total_disto += disto;
-											pack_nb++;
-										}
-									}
-								}
-							} /* precno */
-						} /* resno */
-					} /* x = x0..x1 */
-				} /* y = y0..y1 */
-			} /* comno */
-		} /* CPRL */
-	} /* tileno */
-
-	fprintf(stream, "%8e\n", image_info->D_max); /* SE max */
-	fprintf(stream, "%.8e\n", total_disto);	/* SE totale */
-	fclose(stream);
-
-	return 1;
-}
-
-bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, char *index) {
-	int tileno, compno;
-	opj_image_info_t *image_info = NULL;
-	opj_cp_t *cp = NULL;
-
-	opj_tcd_t *tcd = NULL;	/* TCD component */
-
-	j2k->cio = cio;
-	j2k->image = image;
-
-	cp = j2k->cp;
-
-	/* j2k_dump_cp(stdout, image, cp); */
-
-	/* INDEX >> */
-	image_info = j2k->image_info;
-	if (image_info && cp->index_on) {
-		image_info->index_on = cp->index_on;
-		image_info->tile = (opj_tile_info_t *) opj_malloc(cp->tw * cp->th * sizeof(opj_tile_info_t));
-		image_info->image_w = image->x1 - image->x0;
-		image_info->image_h = image->y1 - image->y0;
-		image_info->prog = (&cp->tcps[0])->prg;
-		image_info->tw = cp->tw;
-		image_info->th = cp->th;
-		image_info->tile_x = cp->tdx;	/* new version parser */
-		image_info->tile_y = cp->tdy;	/* new version parser */
-		image_info->tile_Ox = cp->tx0;	/* new version parser */
-		image_info->tile_Oy = cp->ty0;	/* new version parser */
-		image_info->comp = image->numcomps;
-		image_info->layer = (&cp->tcps[0])->numlayers;
-		image_info->decomposition = (&cp->tcps[0])->tccps->numresolutions - 1;
-		image_info->D_max = 0;		/* ADD Marcela */
-	}
-	/* << INDEX */
-
-	j2k_write_soc(j2k);
-	j2k_write_siz(j2k);
-	j2k_write_cod(j2k);
-	j2k_write_qcd(j2k);
-
-	if(cp->cinema){
-		for (compno = 1; compno < image->numcomps; compno++) {
-			j2k_write_coc(j2k, compno);
-			j2k_write_qcc(j2k, compno);
-		}
-	}
-
-	for (compno = 0; compno < image->numcomps; compno++) {
-		opj_tcp_t *tcp = &cp->tcps[0];
-		if (tcp->tccps[compno].roishift)
-			j2k_write_rgn(j2k, compno, 0);
-	}
-	if (cp->comment != NULL) {
-		j2k_write_com(j2k);
-	}
-	/* INDEX >> */
-	if(image_info && image_info->index_on) {
-		image_info->main_head_end = cio_tell(cio) - 1;
-	}
-	/* << INDEX */
-
-	j2k->totnum_tp = j2k_calculate_tp(cp,image->numcomps,image,j2k);
-	/*	 TLM Marker*/
-	if(cp->cinema){
-		j2k_write_tlm(j2k);
-		if (cp->cinema == CINEMA4K_24) {
-			j2k_write_poc(j2k);
-		}
-	}
-	/**** Main Header ENDS here ***/
-
-	/* create the tile encoder */
-	tcd = tcd_create(j2k->cinfo);
-
-	/* encode each tile */
-
-	for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
-		int pino;
-		int tilepartno=0;
-
-		opj_tcp_t *tcp = &cp->tcps[tileno];
-		opj_event_msg(j2k->cinfo, EVT_INFO, "tile number %d / %d\n", tileno + 1, cp->tw * cp->th);
-
-		j2k->curtileno = tileno;
-		j2k->cur_tp_num = 0;
-
-		/* initialisation before tile encoding  */
-		if (tileno == 0) {
-			tcd_malloc_encode(tcd, image, cp, j2k->curtileno);
-		} else {
-			tcd_init_encode(tcd, image, cp, j2k->curtileno);
-		}
-
-		/* INDEX >> */
-		if(image_info && image_info->index_on) {
-			image_info->tile[j2k->curtileno].num_tile = j2k->curtileno;
-			image_info->tile[j2k->curtileno].start_pos = cio_tell(cio) + j2k->pos_correction;
-		}
-		/* << INDEX */
-
-		for(pino = 0; pino <= tcp->numpocs; pino++) {
-			int tot_num_tp;
-			tcd->cur_pino=pino;
-
-			/*Get number of tile parts*/
-			tot_num_tp = j2k_get_num_tp(cp,pino,tileno);
-			tcd->tp_pos = cp->tp_pos;
-
-			for(tilepartno = 0; tilepartno < tot_num_tp ; tilepartno++){
-				j2k->tp_num = tilepartno;
-				j2k_write_sot(j2k);
-
-				if(j2k->cur_tp_num == 0 && cp->cinema == 0){
-					for (compno = 1; compno < image->numcomps; compno++) {
-						j2k_write_coc(j2k, compno);
-						j2k_write_qcc(j2k, compno);
-					}
-					if (cp->tcps[tileno].numpocs) {
-						j2k_write_poc(j2k);
-					}
-				}
-
-				j2k_write_sod(j2k, tcd);
-				j2k->cur_tp_num ++;
-			}
-
-		}
-		/* INDEX >> */
-		if(image_info && image_info->index_on) {
-			image_info->tile[j2k->curtileno].end_pos = cio_tell(cio) + j2k->pos_correction - 1;
-		}
-		/* << INDEX */
-
-
-		/*
-		if (tile->PPT) { // BAD PPT !!!
-			FILE *PPT_file;
-			int i;
-			PPT_file=fopen("PPT","rb");
-			fprintf(stderr,"%c%c%c%c",255,97,tile->len_ppt/256,tile->len_ppt%256);
-			for (i=0;i<tile->len_ppt;i++) {
-				unsigned char elmt;
-				fread(&elmt, 1, 1, PPT_file);
-				fwrite(&elmt,1,1,f);
-			}
-			fclose(PPT_file);
-			unlink("PPT");
-		}
-		*/
-
-	}
-
-	/* destroy the tile encoder */
-	tcd_free_encode(tcd);
-	tcd_destroy(tcd);
-
-	j2k_write_eoc(j2k);
-
-	/* Creation of the index file */
-	if(image_info && image_info->index_on) {
-		if(!j2k_create_index(j2k, cio, image_info, index)) {
-			opj_event_msg(j2k->cinfo, EVT_ERROR, "failed to create index file %s\n", index);
-			return false;
-		}
-	}
-
-
-#ifdef USE_JPWL
-	/*
-	preparation of JPWL marker segments: can be finalized only when the whole
-	codestream is known
-	*/
-	if(image_info && image_info->index_on && cp->epc_on) {
-
-		/* let's begin creating a marker list, according to user wishes */
-		jpwl_prepare_marks(j2k, cio, image);
-
-		/* now we dump the JPWL markers on the codestream */
-		jpwl_dump_marks(j2k, cio, image);
-
-		/* do not know exactly what is this for,
-		but it gets called during index creation */
-		j2k->pos_correction = 0;
-
-		/* Re-creation of the index file, with updated info */
-		if(image_info && image_info->index_on) {
-			if(!j2k_create_index(j2k, cio, image_info, index)) {
-				opj_event_msg(j2k->cinfo, EVT_ERROR, "failed to re-create index file %s\n", index);
-				return false;
-			}
-		}
-
-		/* now we finalize the marker contents */
-		/*jpwl_finalize_marks(j2k, cio, image);*/
-
-	}
-#endif /* USE_JPWL */
-
-
-	return true;
-}
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k.h
deleted file mode 100644
index c18f4cd..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k.h
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * Copyright (c) 2006-2007, Parvatha Elangovan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __J2K_H
-#define __J2K_H
-/**
-@file j2k.h
-@brief The JPEG-2000 Codestream Reader/Writer (J2K)
-
-The functions in J2K.C have for goal to read/write the several parts of the codestream: markers and data.
-*/
-
-/** @defgroup J2K J2K - JPEG-2000 codestream reader/writer */
-/*@{*/
-
-#define J2K_CP_CSTY_PRT 0x01
-#define J2K_CP_CSTY_SOP 0x02
-#define J2K_CP_CSTY_EPH 0x04
-#define J2K_CCP_CSTY_PRT 0x01
-#define J2K_CCP_CBLKSTY_LAZY 0x01
-#define J2K_CCP_CBLKSTY_RESET 0x02
-#define J2K_CCP_CBLKSTY_TERMALL 0x04
-#define J2K_CCP_CBLKSTY_VSC 0x08
-#define J2K_CCP_CBLKSTY_PTERM 0x10
-#define J2K_CCP_CBLKSTY_SEGSYM 0x20
-#define J2K_CCP_QNTSTY_NOQNT 0
-#define J2K_CCP_QNTSTY_SIQNT 1
-#define J2K_CCP_QNTSTY_SEQNT 2
-
-/* ----------------------------------------------------------------------- */
-
-#define J2K_MS_SOC 0xff4f	/**< SOC marker value */
-#define J2K_MS_SOT 0xff90	/**< SOT marker value */
-#define J2K_MS_SOD 0xff93	/**< SOD marker value */
-#define J2K_MS_EOC 0xffd9	/**< EOC marker value */
-#define J2K_MS_SIZ 0xff51	/**< SIZ marker value */
-#define J2K_MS_COD 0xff52	/**< COD marker value */
-#define J2K_MS_COC 0xff53	/**< COC marker value */
-#define J2K_MS_RGN 0xff5e	/**< RGN marker value */
-#define J2K_MS_QCD 0xff5c	/**< QCD marker value */
-#define J2K_MS_QCC 0xff5d	/**< QCC marker value */
-#define J2K_MS_POC 0xff5f	/**< POC marker value */
-#define J2K_MS_TLM 0xff55	/**< TLM marker value */
-#define J2K_MS_PLM 0xff57	/**< PLM marker value */
-#define J2K_MS_PLT 0xff58	/**< PLT marker value */
-#define J2K_MS_PPM 0xff60	/**< PPM marker value */
-#define J2K_MS_PPT 0xff61	/**< PPT marker value */
-#define J2K_MS_SOP 0xff91	/**< SOP marker value */
-#define J2K_MS_EPH 0xff92	/**< EPH marker value */
-#define J2K_MS_CRG 0xff63	/**< CRG marker value */
-#define J2K_MS_COM 0xff64	/**< COM marker value */
-/* UniPG>> */
-#ifdef USE_JPWL
-#define J2K_MS_EPC 0xff68	/**< EPC marker value (Part11) */
-#define J2K_MS_EPB 0xff66	/**< EPB marker value (Part11) */
-#define J2K_MS_ESD 0xff67	/**< ESD marker value (Part11) */
-#define J2K_MS_RED 0xff69	/**< RED marker value (Part11) */
-#endif /* USE_JPWL */
-/* <<UniPG */
-
-/* ----------------------------------------------------------------------- */
-
-/**
-Values that specify the status of the decoding process when decoding the main header.
-These values may be combined with a | operator.
-*/
-typedef enum J2K_STATUS {
-	J2K_STATE_MHSOC  = 0x0001, /**< a SOC marker is expected */
-	J2K_STATE_MHSIZ  = 0x0002, /**< a SIZ marker is expected */
-	J2K_STATE_MH     = 0x0004, /**< the decoding process is in the main header */
-	J2K_STATE_TPHSOT = 0x0008, /**< the decoding process is in a tile part header and expects a SOT marker */
-	J2K_STATE_TPH    = 0x0010, /**< the decoding process is in a tile part header */
-	J2K_STATE_MT     = 0x0020, /**< the EOC marker has just been read */
-	J2K_STATE_NEOC   = 0x0040  /**< the decoding process must not expect a EOC marker because the codestream is truncated */
-} J2K_STATUS;
-
-/* ----------------------------------------------------------------------- */
-
-/**
-T2 encoding mode
-*/
-typedef enum T2_MODE {
-	THRESH_CALC = 0,	/** Function called in Rate allocation process*/
-	FINAL_PASS = 1		/** Function called in Tier 2 process*/
-}J2K_T2_MODE;
-
-/**
-Quantization stepsize
-*/
-typedef struct opj_stepsize {
-	/** exponent */
-	int expn;
-	/** mantissa */
-	int mant;
-} opj_stepsize_t;
-
-/**
-Tile-component coding parameters
-*/
-typedef struct opj_tccp {
-	/** coding style */
-	int csty;
-	/** number of resolutions */
-	int numresolutions;
-	/** code-blocks width */
-	int cblkw;
-	/** code-blocks height */
-	int cblkh;
-	/** code-block coding style */
-	int cblksty;
-	/** discrete wavelet transform identifier */
-	int qmfbid;
-	/** quantisation style */
-	int qntsty;
-	/** stepsizes used for quantization */
-	opj_stepsize_t stepsizes[J2K_MAXBANDS];
-	/** number of guard bits */
-	int numgbits;
-	/** Region Of Interest shift */
-	int roishift;
-	/** precinct width */
-	int prcw[J2K_MAXRLVLS];
-	/** precinct height */
-	int prch[J2K_MAXRLVLS];
-} opj_tccp_t;
-
-/**
-Tile coding parameters :
-this structure is used to store coding/decoding parameters common to all
-tiles (information like COD, COC in main header)
-*/
-typedef struct opj_tcp {
-	/** 1 : first part-tile of a tile */
-	int first;
-	/** coding style */
-	int csty;
-	/** progression order */
-	OPJ_PROG_ORDER prg;
-	/** number of layers */
-	int numlayers;
-	/** multi-component transform identifier */
-	int mct;
-	/** rates of layers */
-	float rates[100];
-	/** number of progression order changes */
-	int numpocs;
-	/** indicates if a POC marker has been used O:NO, 1:YES */
-	int POC;
-	/** progression order changes */
-	opj_poc_t pocs[32];
-	/** packet header store there for futur use in t2_decode_packet */
-	unsigned char *ppt_data;
-	/** pointer remaining on the first byte of the first header if ppt is used */
-	unsigned char *ppt_data_first;
-	/** If ppt == 1 --> there was a PPT marker for the present tile */
-	int ppt;
-	/** used in case of multiple marker PPT (number of info already stored) */
-	int ppt_store;
-	/** ppmbug1 */
-	int ppt_len;
-	/** add fixed_quality */
-	float distoratio[100];
-	/** tile-component coding parameters */
-	opj_tccp_t *tccps;
-} opj_tcp_t;
-
-/**
-Coding parameters
-*/
-typedef struct opj_cp {
-	/** Digital cinema profile*/
-	OPJ_CINEMA_MODE cinema;
-	/** Maximum rate for each component. If == 0, component size limitation is not considered */
-	int max_comp_size;
-	/** Size of the image in bits*/
-	int img_size;
-	/** Rsiz*/
-	OPJ_RSIZ_CAPABILITIES rsiz;
-	/** Enabling Tile part generation*/
-	char tp_on;
-	/** Flag determining tile part generation*/
-	char tp_flag;
-	/** Position of tile part flag in progression order*/
-	int tp_pos;
-	/** allocation by rate/distortion */
-	int disto_alloc;
-	/** allocation by fixed layer */
-	int fixed_alloc;
-	/** add fixed_quality */
-	int fixed_quality;
-	/** if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the full resolution */
-	int reduce;
-	/** if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
-	int layer;
-	/** if == NO_LIMITATION, decode entire codestream; if == LIMIT_TO_MAIN_HEADER then only decode the main header */
-	OPJ_LIMIT_DECODING limit_decoding;
-	/** 0 = no index || 1 = index */
-	int index_on;
-	/** XTOsiz */
-	int tx0;
-	/** YTOsiz */
-	int ty0;
-	/** XTsiz */
-	int tdx;
-	/** YTsiz */
-	int tdy;
-	/** comment for coding */
-	char *comment;
-	/** number of tiles in width */
-	int tw;
-	/** number of tiles in heigth */
-	int th;
-	/** ID number of the tiles present in the codestream */
-	int *tileno;
-	/** size of the vector tileno */
-	int tileno_size;
-	/** packet header store there for futur use in t2_decode_packet */
-	unsigned char *ppm_data;
-	/** pointer remaining on the first byte of the first header if ppm is used */
-	unsigned char *ppm_data_first;
-	/** if ppm == 1 --> there was a PPM marker for the present tile */
-	int ppm;
-	/** use in case of multiple marker PPM (number of info already store) */
-	int ppm_store;
-	/** use in case of multiple marker PPM (case on non-finished previous info) */
-	int ppm_previous;
-	/** ppmbug1 */
-	int ppm_len;
-	/** tile coding parameters */
-	opj_tcp_t *tcps;
-	/** fixed layer */
-	int *matrice;
-/* UniPG>> */
-#ifdef USE_JPWL
-	/** enables writing of EPC in MH, thus activating JPWL */
-	bool epc_on;
-	/** enables writing of EPB, in case of activated JPWL */
-	bool epb_on;
-	/** enables writing of ESD, in case of activated JPWL */
-	bool esd_on;
-	/** enables writing of informative techniques of ESD, in case of activated JPWL */
-	bool info_on;
-	/** enables writing of RED, in case of activated JPWL */
-	bool red_on;
-	/** error protection method for MH (0,1,16,32,37-128) */
-	int hprot_MH;
-	/** tile number of header protection specification (>=0) */
-	int hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];
-	/** error protection methods for TPHs (0,1,16,32,37-128) */
-	int hprot_TPH[JPWL_MAX_NO_TILESPECS];
-	/** tile number of packet protection specification (>=0) */
-	int pprot_tileno[JPWL_MAX_NO_PACKSPECS];
-	/** packet number of packet protection specification (>=0) */
-	int pprot_packno[JPWL_MAX_NO_PACKSPECS];
-	/** error protection methods for packets (0,1,16,32,37-128) */
-	int pprot[JPWL_MAX_NO_PACKSPECS];
-	/** enables writing of ESD, (0/2/4 bytes) */
-	int sens_size;
-	/** sensitivity addressing size (0=auto/2/4 bytes) */
-	int sens_addr;
-	/** sensitivity range (0-3) */
-	int sens_range;
-	/** sensitivity method for MH (-1,0-7) */
-	int sens_MH;
-	/** tile number of sensitivity specification (>=0) */
-	int sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];
-	/** sensitivity methods for TPHs (-1,0-7) */
-	int sens_TPH[JPWL_MAX_NO_TILESPECS];
-	/** enables JPWL correction at the decoder */
-	bool correct;
-	/** expected number of components at the decoder */
-	int exp_comps;
-	/** maximum number of tiles at the decoder */
-	int max_tiles;
-#endif /* USE_JPWL */
-/* <<UniPG */
-} opj_cp_t;
-
-/**
-Information concerning a packet inside tile
-*/
-typedef struct opj_packet_info {
-	/** start position */
-	int start_pos;
-	/** end position */
-	int end_pos;
-	/** ADD for Marcela */
-	double disto;
-} opj_packet_info_t;
-
-/**
-Index structure : information regarding tiles inside image
-*/
-typedef struct opj_tile_info {
-	/** value of thresh for each layer by tile cfr. Marcela   */
-	double *thresh;
-	/** number of tile */
-	int num_tile;
-	/** start position */
-	int start_pos;
-	/** end position of the header */
-	int end_header;
-	/** end position */
-	int end_pos;
-	/** precinct number for each resolution level (width) */
-	int pw[33];
-	/** precinct number for each resolution level (height) */
-	int ph[33];
-	/** precinct size (in power of 2), in X for each resolution level */
-	int pdx[33];
-	/** precinct size (in power of 2), in Y for each resolution level */
-	int pdy[33];
-	/** information concerning packets inside tile */
-	opj_packet_info_t *packet;
-	/** add fixed_quality */
-	int nbpix;
-	/** add fixed_quality */
-	double distotile;
-} opj_tile_info_t;
-
-/**
-Index structure
-*/
-typedef struct opj_image_info {
-	/** 0 = no index || 1 = index */
-	int index_on;
-	/** maximum distortion reduction on the whole image (add for Marcela) */
-	double D_max;
-	/** packet number */
-	int num;
-	/** writing the packet in the index with t2_encode_packets */
-	int index_write;
-	/** image width */
-	int image_w;
-	/** image height */
-	int image_h;
-	/** progression order */
-	OPJ_PROG_ORDER prog;
-	/** tile size in x */
-	int tile_x;
-	/** tile size in y */
-	int tile_y;
-	/** */
-	int tile_Ox;
-	/** */
-	int tile_Oy;
-	/** number of tiles in X */
-	int tw;
-	/** number of tiles in Y */
-	int th;
-	/** component numbers */
-	int comp;
-	/** number of layer */
-	int layer;
-	/** number of decomposition */
-	int decomposition;
-	/** main header position */
-	int main_head_end;
-	/** codestream's size */
-	int codestream_size;
-	/** information regarding tiles inside image */
-	opj_tile_info_t *tile;
-} opj_image_info_t;
-
-/**
-JPEG-2000 codestream reader/writer
-*/
-typedef struct opj_j2k {
-	/** codec context */
-	opj_common_ptr cinfo;
-
-	/** locate in which part of the codestream the decoder is (main header, tile header, end) */
-	int state;
-	/** number of the tile curently concern by coding/decoding */
-	int curtileno;
-	/** Tile part number*/
-	int tp_num;
-	/** Tilepart number currently coding*/
-	int cur_tp_num;
-	/** Total number of tileparts of the current tile*/
-	int *cur_totnum_tp;
-	/**
-	locate the start position of the TLM marker
-	after encoding the tilepart, a jump (in j2k_write_sod) is done to the TLM marker to store the value of its length.
-	*/
-	int tlm_start;
-	/** Total num of tile parts in whole image = num tiles* num tileparts in each tile*/
-	/** used in TLMmarker*/
-	int totnum_tp;
-	/**
-	locate the position of the end of the tile in the codestream,
-	used to detect a truncated codestream (in j2k_read_sod)
-	*/
-	unsigned char *eot;
-	/**
-	locate the start position of the SOT marker of the current coded tile:
-	after encoding the tile, a jump (in j2k_write_sod) is done to the SOT marker to store the value of its length.
-	*/
-	int sot_start;
-	int sod_start;
-	/**
-	as the J2K-file is written in several parts during encoding,
-	it enables to make the right correction in position return by cio_tell
-	*/
-	int pos_correction;
-	/** array used to store the data of each tile */
-	unsigned char **tile_data;
-	/** array used to store the length of each tile */
-	int *tile_len;
-	/**
-	decompression only :
-	store decoding parameters common to all tiles (information like COD, COC in main header)
-	*/
-	opj_tcp_t *default_tcp;
-	/** pointer to the encoded / decoded image */
-	opj_image_t *image;
-	/** pointer to the coding parameters */
-	opj_cp_t *cp;
-	/** helper used to write the index file */
-	opj_image_info_t *image_info;
-	/** pointer to the byte i/o stream */
-	opj_cio_t *cio;
-} opj_j2k_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Creates a J2K decompression structure
-@param cinfo Codec context info
-@return Returns a handle to a J2K decompressor if successful, returns NULL otherwise
-*/
-opj_j2k_t* j2k_create_decompress(opj_common_ptr cinfo);
-/**
-Destroy a J2K decompressor handle
-@param j2k J2K decompressor handle to destroy
-*/
-void j2k_destroy_decompress(opj_j2k_t *j2k);
-/**
-Setup the decoder decoding parameters using user parameters.
-Decoding parameters are returned in j2k->cp.
-@param j2k J2K decompressor handle
-@param parameters decompression parameters
-*/
-void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters);
-/**
-Decode an image from a JPEG-2000 codestream
-@param j2k J2K decompressor handle
-@param cio Input buffer stream
-@return Returns a decoded image if successful, returns NULL otherwise
-*/
-opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio);
-/**
-Decode an image form a JPT-stream (JPEG 2000, JPIP)
-@param j2k J2K decompressor handle
-@param cio Input buffer stream
-@return Returns a decoded image if successful, returns NULL otherwise
-*/
-opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio);
-/**
-Creates a J2K compression structure
-@param cinfo Codec context info
-@return Returns a handle to a J2K compressor if successful, returns NULL otherwise
-*/
-opj_j2k_t* j2k_create_compress(opj_common_ptr cinfo);
-/**
-Destroy a J2K compressor handle
-@param j2k J2K compressor handle to destroy
-*/
-void j2k_destroy_compress(opj_j2k_t *j2k);
-/**
-Setup the encoder parameters using the current image and using user parameters.
-Coding parameters are returned in j2k->cp.
-@param j2k J2K compressor handle
-@param parameters compression parameters
-@param image input filled image
-*/
-void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image);
-/**
-Converts an enum type progression order to string type
-*/
-char *j2k_convert_progression_order(OPJ_PROG_ORDER prg_order);
-/**
-Encode an image into a JPEG-2000 codestream
-@param j2k J2K compressor handle
-@param cio Output buffer stream
-@param image Image to encode
-@param index Name of the index file if required, NULL otherwise
-@return Returns true if successful, returns false otherwise
-*/
-bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, char *index);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __J2K_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k_lib.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k_lib.c
deleted file mode 100644
index 69444a7..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k_lib.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2005, Hervé Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/times.h>
-#endif /* WIN32 */
-#include "opj_includes.h"
-
-double opj_clock() {
-#ifdef WIN32
-	/* WIN32: use QueryPerformance (very accurate) */
-    LARGE_INTEGER freq , t ;
-    /* freq is the clock speed of the CPU */
-    QueryPerformanceFrequency(&freq) ;
-	/* cout << "freq = " << ((double) freq.QuadPart) << endl; */
-    /* t is the high resolution performance counter (see MSDN) */
-    QueryPerformanceCounter ( & t ) ;
-    return ( t.QuadPart /(double) freq.QuadPart ) ;
-#else
-	/* Unix or Linux: use resource usage */
-    struct rusage t;
-    double procTime;
-    /* (1) Get the rusage data structure at this moment (man getrusage) */
-    getrusage(0,&t);
-    /* (2) What is the elapsed time ? - CPU time = User time + System time */
-	/* (2a) Get the seconds */
-    procTime = t.ru_utime.tv_sec + t.ru_stime.tv_sec;
-    /* (2b) More precisely! Get the microseconds part ! */
-    return ( procTime + (t.ru_utime.tv_usec + t.ru_stime.tv_usec) * 1e-6 ) ;
-#endif
-}
-
-void* opj_malloc( size_t size ) {
-	void *memblock = malloc(size);
-	if(memblock) {
-		memset(memblock, 0, size);
-	}
-	return memblock;
-}
-
-void* opj_realloc( void *memblock, size_t size ) {
-	return realloc(memblock, size);
-}
-
-void opj_free( void *memblock ) {
-	free(memblock);
-}
-
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k_lib.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k_lib.h
deleted file mode 100644
index 3d1b53c..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/j2k_lib.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2005, Hervé Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __J2K_LIB_H
-#define __J2K_LIB_H
-/**
-@file j2k_lib.h
-@brief Internal functions
-
-The functions in J2K_LIB.C are internal utilities mainly used for memory management.
-*/
-
-/** @defgroup MISC MISC - Miscellaneous internal functions */
-/*@{*/
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-
-/**
-Difference in successive opj_clock() calls tells you the elapsed time
-@return Returns time in seconds
-*/
-double opj_clock();
-
-/**
-Allocate a memory block with elements initialized to 0
-@param size Bytes to allocate
-@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
-*/
-void* opj_malloc( size_t size );
-
-/**
-Reallocate memory blocks.
-@param memblock Pointer to previously allocated memory block
-@param size New size in bytes
-@return Returns a void pointer to the reallocated (and possibly moved) memory block
-*/
-void* opj_realloc( void *memblock, size_t size );
-
-/**
-Deallocates or frees a memory block.
-@param memblock Previously allocated memory block to be freed
-*/
-void opj_free( void *memblock );
-
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __J2K_LIB_H */
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/jp2.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/jp2.c
deleted file mode 100644
index d102349..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/jp2.c
+++ /dev/null
@@ -1,700 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/** @defgroup JP2 JP2 - JPEG-2000 file format reader/writer */
-/*@{*/
-
-/** @name Local static functions */
-/*@{*/
-
-/**
-Read box headers
-@param cinfo Codec context info
-@param cio Input stream
-@param box
-@return Returns true if successful, returns false otherwise
-*/
-static bool jp2_read_boxhdr(opj_common_ptr cinfo, opj_cio_t *cio, opj_jp2_box_t *box);
-/*static void jp2_write_url(opj_cio_t *cio, char *Idx_file);*/
-/**
-Read the IHDR box - Image Header box
-@param jp2 JP2 handle
-@param cio Input buffer stream
-@return Returns true if successful, returns false otherwise
-*/
-static bool jp2_read_ihdr(opj_jp2_t *jp2, opj_cio_t *cio);
-static void jp2_write_ihdr(opj_jp2_t *jp2, opj_cio_t *cio);
-static void jp2_write_bpcc(opj_jp2_t *jp2, opj_cio_t *cio);
-static bool jp2_read_bpcc(opj_jp2_t *jp2, opj_cio_t *cio);
-static void jp2_write_colr(opj_jp2_t *jp2, opj_cio_t *cio);
-static bool jp2_read_colr(opj_jp2_t *jp2, opj_cio_t *cio);
-/**
-Write the FTYP box - File type box
-@param jp2 JP2 handle
-@param cio Output buffer stream
-*/
-static void jp2_write_ftyp(opj_jp2_t *jp2, opj_cio_t *cio);
-/**
-Read the FTYP box - File type box
-@param jp2 JP2 handle
-@param cio Input buffer stream
-@return Returns true if successful, returns false otherwise
-*/
-static bool jp2_read_ftyp(opj_jp2_t *jp2, opj_cio_t *cio);
-static int jp2_write_jp2c(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, char *index);
-static bool jp2_read_jp2c(opj_jp2_t *jp2, opj_cio_t *cio, unsigned int *j2k_codestream_length, unsigned int *j2k_codestream_offset);
-static void jp2_write_jp(opj_cio_t *cio);
-/**
-Read the JP box - JPEG 2000 signature
-@param jp2 JP2 handle
-@param cio Input buffer stream
-@return Returns true if successful, returns false otherwise
-*/
-static bool jp2_read_jp(opj_jp2_t *jp2, opj_cio_t *cio);
-/**
-Decode the structure of a JP2 file
-@param jp2 JP2 handle
-@param cio Input buffer stream
-@return Returns true if successful, returns false otherwise
-*/
-static bool jp2_read_struct(opj_jp2_t *jp2, opj_cio_t *cio);
-
-/*@}*/
-
-/*@}*/
-
-/* ----------------------------------------------------------------------- */
-
-static bool jp2_read_boxhdr(opj_common_ptr cinfo, opj_cio_t *cio, opj_jp2_box_t *box) {
-	box->init_pos = cio_tell(cio);
-	box->length = cio_read(cio, 4);
-	box->type = cio_read(cio, 4);
-	if (box->length == 1) {
-		if (cio_read(cio, 4) != 0) {
-			opj_event_msg(cinfo, EVT_ERROR, "Cannot handle box sizes higher than 2^32\n");
-			return false;
-		}
-		box->length = cio_read(cio, 4);
-		if (box->length == 0)
-			box->length = cio_numbytesleft(cio) + 12;
-	}
-	else if (box->length == 0) {
-		box->length = cio_numbytesleft(cio) + 8;
-	}
-
-	return true;
-}
-
-#if 0
-static void jp2_write_url(opj_cio_t *cio, char *Idx_file) {
-	unsigned int i;
-	opj_jp2_box_t box;
-
-	box.init_pos = cio_tell(cio);
-	cio_skip(cio, 4);
-	cio_write(cio, JP2_URL, 4);	/* DBTL */
-	cio_write(cio, 0, 1);		/* VERS */
-	cio_write(cio, 0, 3);		/* FLAG */
-
-	if(Idx_file) {
-		for (i = 0; i < strlen(Idx_file); i++) {
-			cio_write(cio, Idx_file[i], 1);
-		}
-	}
-
-	box.length = cio_tell(cio) - box.init_pos;
-	cio_seek(cio, box.init_pos);
-	cio_write(cio, box.length, 4);	/* L */
-	cio_seek(cio, box.init_pos + box.length);
-}
-#endif
-
-static bool jp2_read_ihdr(opj_jp2_t *jp2, opj_cio_t *cio) {
-	opj_jp2_box_t box;
-
-	opj_common_ptr cinfo = jp2->cinfo;
-
-	jp2_read_boxhdr(cinfo, cio, &box);
-	if (JP2_IHDR != box.type) {
-		opj_event_msg(cinfo, EVT_ERROR, "Expected IHDR Marker\n");
-		return false;
-	}
-
-	jp2->h = cio_read(cio, 4);			/* HEIGHT */
-	jp2->w = cio_read(cio, 4);			/* WIDTH */
-	jp2->numcomps = cio_read(cio, 2);	/* NC */
-	jp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t));
-
-	jp2->bpc = cio_read(cio, 1);		/* BPC */
-
-	jp2->C = cio_read(cio, 1);			/* C */
-	jp2->UnkC = cio_read(cio, 1);		/* UnkC */
-	jp2->IPR = cio_read(cio, 1);		/* IPR */
-
-	if (cio_tell(cio) - box.init_pos != box.length) {
-		opj_event_msg(cinfo, EVT_ERROR, "Error with IHDR Box\n");
-		return false;
-	}
-
-	return true;
-}
-
-static void jp2_write_ihdr(opj_jp2_t *jp2, opj_cio_t *cio) {
-	opj_jp2_box_t box;
-
-	box.init_pos = cio_tell(cio);
-	cio_skip(cio, 4);
-	cio_write(cio, JP2_IHDR, 4);		/* IHDR */
-
-	cio_write(cio, jp2->h, 4);			/* HEIGHT */
-	cio_write(cio, jp2->w, 4);			/* WIDTH */
-	cio_write(cio, jp2->numcomps, 2);	/* NC */
-
-	cio_write(cio, jp2->bpc, 1);		/* BPC */
-
-	cio_write(cio, jp2->C, 1);			/* C : Always 7 */
-	cio_write(cio, jp2->UnkC, 1);		/* UnkC, colorspace unknown */
-	cio_write(cio, jp2->IPR, 1);		/* IPR, no intellectual property */
-
-	box.length = cio_tell(cio) - box.init_pos;
-	cio_seek(cio, box.init_pos);
-	cio_write(cio, box.length, 4);	/* L */
-	cio_seek(cio, box.init_pos + box.length);
-}
-
-static void jp2_write_bpcc(opj_jp2_t *jp2, opj_cio_t *cio) {
-	unsigned int i;
-	opj_jp2_box_t box;
-
-	box.init_pos = cio_tell(cio);
-	cio_skip(cio, 4);
-	cio_write(cio, JP2_BPCC, 4);	/* BPCC */
-
-	for (i = 0; i < jp2->numcomps; i++) {
-		cio_write(cio, jp2->comps[i].bpcc, 1);
-	}
-
-	box.length = cio_tell(cio) - box.init_pos;
-	cio_seek(cio, box.init_pos);
-	cio_write(cio, box.length, 4);	/* L */
-	cio_seek(cio, box.init_pos + box.length);
-}
-
-
-static bool jp2_read_bpcc(opj_jp2_t *jp2, opj_cio_t *cio) {
-	unsigned int i;
-	opj_jp2_box_t box;
-
-	opj_common_ptr cinfo = jp2->cinfo;
-
-	jp2_read_boxhdr(cinfo, cio, &box);
-	if (JP2_BPCC != box.type) {
-		opj_event_msg(cinfo, EVT_ERROR, "Expected BPCC Marker\n");
-		return false;
-	}
-
-	for (i = 0; i < jp2->numcomps; i++) {
-		jp2->comps[i].bpcc = cio_read(cio, 1);
-	}
-
-	if (cio_tell(cio) - box.init_pos != box.length) {
-		opj_event_msg(cinfo, EVT_ERROR, "Error with BPCC Box\n");
-		return false;
-	}
-
-	return true;
-}
-
-static void jp2_write_colr(opj_jp2_t *jp2, opj_cio_t *cio) {
-	opj_jp2_box_t box;
-
-	box.init_pos = cio_tell(cio);
-	cio_skip(cio, 4);
-	cio_write(cio, JP2_COLR, 4);		/* COLR */
-
-	cio_write(cio, jp2->meth, 1);		/* METH */
-	cio_write(cio, jp2->precedence, 1);	/* PRECEDENCE */
-	cio_write(cio, jp2->approx, 1);		/* APPROX */
-
-	if (jp2->meth == 1) {
-		cio_write(cio, jp2->enumcs, 4);	/* EnumCS */
-	} else {
-		cio_write(cio, 0, 1);			/* PROFILE (??) */
-	}
-
-	box.length = cio_tell(cio) - box.init_pos;
-	cio_seek(cio, box.init_pos);
-	cio_write(cio, box.length, 4);	/* L */
-	cio_seek(cio, box.init_pos + box.length);
-}
-
-static bool jp2_read_colr(opj_jp2_t *jp2, opj_cio_t *cio) {
-	opj_jp2_box_t box;
-	int skip_len;
-
-	opj_common_ptr cinfo = jp2->cinfo;
-
-	jp2_read_boxhdr(cinfo, cio, &box);
-	do {
-		if (JP2_COLR != box.type) {
-			cio_skip(cio, box.length - 8);
-			jp2_read_boxhdr(cinfo, cio, &box);
-		}
-	} while(JP2_COLR != box.type);
-
-	jp2->meth = cio_read(cio, 1);		/* METH */
-	jp2->precedence = cio_read(cio, 1);	/* PRECEDENCE */
-	jp2->approx = cio_read(cio, 1);		/* APPROX */
-
-	if (jp2->meth == 1) {
-		jp2->enumcs = cio_read(cio, 4);	/* EnumCS */
-	} else {
-		/* skip PROFILE */
-		skip_len = box.init_pos + box.length - cio_tell(cio);
-		if (skip_len < 0) {
-			opj_event_msg(cinfo, EVT_ERROR, "Error with JP2H box size\n");
-			return false;
-		}
-		cio_skip(cio, box.init_pos + box.length - cio_tell(cio));
-	}
-
-	if (cio_tell(cio) - box.init_pos != box.length) {
-		opj_event_msg(cinfo, EVT_ERROR, "Error with BPCC Box\n");
-		return false;
-	}
-	return true;
-}
-
-void jp2_write_jp2h(opj_jp2_t *jp2, opj_cio_t *cio) {
-	opj_jp2_box_t box;
-
-	box.init_pos = cio_tell(cio);
-	cio_skip(cio, 4);
-	cio_write(cio, JP2_JP2H, 4);	/* JP2H */
-
-	jp2_write_ihdr(jp2, cio);
-
-	if (jp2->bpc == 255) {
-		jp2_write_bpcc(jp2, cio);
-	}
-	jp2_write_colr(jp2, cio);
-
-	box.length = cio_tell(cio) - box.init_pos;
-	cio_seek(cio, box.init_pos);
-	cio_write(cio, box.length, 4);	/* L */
-	cio_seek(cio, box.init_pos + box.length);
-}
-
-bool jp2_read_jp2h(opj_jp2_t *jp2, opj_cio_t *cio) {
-	opj_jp2_box_t box;
-	int skip_len;
-
-	opj_common_ptr cinfo = jp2->cinfo;
-
-	jp2_read_boxhdr(cinfo, cio, &box);
-	do {
-		if (JP2_JP2H != box.type) {
-			if (box.type == JP2_JP2C) {
-				opj_event_msg(cinfo, EVT_ERROR, "Expected JP2H Marker\n");
-				return false;
-			}
-			cio_skip(cio, box.length - 8);
-			jp2_read_boxhdr(cinfo, cio, &box);
-		}
-	} while(JP2_JP2H != box.type);
-
-	if (!jp2_read_ihdr(jp2, cio))
-		return false;
-
-	if (jp2->bpc == 255) {
-		if (!jp2_read_bpcc(jp2, cio))
-			return false;
-	}
-	if (!jp2_read_colr(jp2, cio))
-		return false;
-
-	skip_len = box.init_pos + box.length - cio_tell(cio);
-	if (skip_len < 0) {
-		opj_event_msg(cinfo, EVT_ERROR, "Error with JP2H Box\n");
-		return false;
-	}
-	cio_skip(cio, box.init_pos + box.length - cio_tell(cio));
-
-	return true;
-}
-
-static void jp2_write_ftyp(opj_jp2_t *jp2, opj_cio_t *cio) {
-	unsigned int i;
-	opj_jp2_box_t box;
-
-	box.init_pos = cio_tell(cio);
-	cio_skip(cio, 4);
-	cio_write(cio, JP2_FTYP, 4);		/* FTYP */
-
-	cio_write(cio, jp2->brand, 4);		/* BR */
-	cio_write(cio, jp2->minversion, 4);	/* MinV */
-
-	for (i = 0; i < jp2->numcl; i++) {
-		cio_write(cio, jp2->cl[i], 4);	/* CL */
-	}
-
-	box.length = cio_tell(cio) - box.init_pos;
-	cio_seek(cio, box.init_pos);
-	cio_write(cio, box.length, 4);	/* L */
-	cio_seek(cio, box.init_pos + box.length);
-}
-
-static bool jp2_read_ftyp(opj_jp2_t *jp2, opj_cio_t *cio) {
-	int i;
-	opj_jp2_box_t box;
-
-	opj_common_ptr cinfo = jp2->cinfo;
-
-	jp2_read_boxhdr(cinfo, cio, &box);
-
-	if (JP2_FTYP != box.type) {
-		opj_event_msg(cinfo, EVT_ERROR, "Expected FTYP Marker\n");
-		return false;
-	}
-
-	jp2->brand = cio_read(cio, 4);		/* BR */
-	jp2->minversion = cio_read(cio, 4);	/* MinV */
-	jp2->numcl = (box.length - 16) / 4;
-	jp2->cl = (unsigned int *) opj_malloc(jp2->numcl * sizeof(unsigned int));
-
-	for (i = 0; i < (int)jp2->numcl; i++) {
-		jp2->cl[i] = cio_read(cio, 4);	/* CLi */
-	}
-
-	if (cio_tell(cio) - box.init_pos != box.length) {
-		opj_event_msg(cinfo, EVT_ERROR, "Error with FTYP Box\n");
-		return false;
-	}
-
-	return true;
-}
-
-static int jp2_write_jp2c(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, char *index) {
-	unsigned int j2k_codestream_offset, j2k_codestream_length;
-	opj_jp2_box_t box;
-
-	opj_j2k_t *j2k = jp2->j2k;
-
-	box.init_pos = cio_tell(cio);
-	cio_skip(cio, 4);
-	cio_write(cio, JP2_JP2C, 4);	/* JP2C */
-
-	/* J2K encoding */
-	j2k_codestream_offset = cio_tell(cio);
-	if(!j2k_encode(j2k, cio, image, index)) {
-		opj_event_msg(j2k->cinfo, EVT_ERROR, "Failed to encode image\n");
-		return 0;
-	}
-	j2k_codestream_length = cio_tell(cio) - j2k_codestream_offset;
-
-	jp2->j2k_codestream_offset = j2k_codestream_offset;
-	jp2->j2k_codestream_length = j2k_codestream_length;
-
-	box.length = 8 + jp2->j2k_codestream_length;
-	cio_seek(cio, box.init_pos);
-	cio_write(cio, box.length, 4);	/* L */
-	cio_seek(cio, box.init_pos + box.length);
-
-	return box.length;
-}
-
-static bool jp2_read_jp2c(opj_jp2_t *jp2, opj_cio_t *cio, unsigned int *j2k_codestream_length, unsigned int *j2k_codestream_offset) {
-	opj_jp2_box_t box;
-
-	opj_common_ptr cinfo = jp2->cinfo;
-
-	jp2_read_boxhdr(cinfo, cio, &box);
-	do {
-		if(JP2_JP2C != box.type) {
-			cio_skip(cio, box.length - 8);
-			jp2_read_boxhdr(cinfo, cio, &box);
-		}
-	} while(JP2_JP2C != box.type);
-
-	*j2k_codestream_offset = cio_tell(cio);
-	*j2k_codestream_length = box.length - 8;
-
-	return true;
-}
-
-static void jp2_write_jp(opj_cio_t *cio) {
-	opj_jp2_box_t box;
-
-	box.init_pos = cio_tell(cio);
-	cio_skip(cio, 4);
-	cio_write(cio, JP2_JP, 4);		/* JP2 signature */
-	cio_write(cio, 0x0d0a870a, 4);
-
-	box.length = cio_tell(cio) - box.init_pos;
-	cio_seek(cio, box.init_pos);
-	cio_write(cio, box.length, 4);	/* L */
-	cio_seek(cio, box.init_pos + box.length);
-}
-
-static bool jp2_read_jp(opj_jp2_t *jp2, opj_cio_t *cio) {
-	opj_jp2_box_t box;
-
-	opj_common_ptr cinfo = jp2->cinfo;
-
-	jp2_read_boxhdr(cinfo, cio, &box);
-	if (JP2_JP != box.type) {
-		opj_event_msg(cinfo, EVT_ERROR, "Expected JP Marker\n");
-		return false;
-	}
-	if (0x0d0a870a != cio_read(cio, 4)) {
-		opj_event_msg(cinfo, EVT_ERROR, "Error with JP Marker\n");
-		return false;
-	}
-	if (cio_tell(cio) - box.init_pos != box.length) {
-		opj_event_msg(cinfo, EVT_ERROR, "Error with JP Box size\n");
-		return false;
-	}
-
-	return true;
-}
-
-
-static bool jp2_read_struct(opj_jp2_t *jp2, opj_cio_t *cio) {
-	if (!jp2_read_jp(jp2, cio))
-		return false;
-	if (!jp2_read_ftyp(jp2, cio))
-		return false;
-	if (!jp2_read_jp2h(jp2, cio))
-		return false;
-	if (!jp2_read_jp2c(jp2, cio, &jp2->j2k_codestream_length, &jp2->j2k_codestream_offset))
-		return false;
-
-	return true;
-}
-
-/* ----------------------------------------------------------------------- */
-/* JP2 decoder interface                                             */
-/* ----------------------------------------------------------------------- */
-
-opj_jp2_t* jp2_create_decompress(opj_common_ptr cinfo) {
-	opj_jp2_t *jp2 = (opj_jp2_t*)opj_malloc(sizeof(opj_jp2_t));
-	if(jp2) {
-		jp2->cinfo = cinfo;
-		/* create the J2K codec */
-		jp2->j2k = j2k_create_decompress(cinfo);
-		if(jp2->j2k == NULL) {
-			jp2_destroy_decompress(jp2);
-			return NULL;
-		}
-	}
-	return jp2;
-}
-
-void jp2_destroy_decompress(opj_jp2_t *jp2) {
-	if(jp2) {
-		/* destroy the J2K codec */
-		j2k_destroy_decompress(jp2->j2k);
-
-		if(jp2->comps) {
-			opj_free(jp2->comps);
-		}
-		if(jp2->cl) {
-			opj_free(jp2->cl);
-		}
-		opj_free(jp2);
-	}
-}
-
-void jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters) {
-	/* setup the J2K codec */
-	j2k_setup_decoder(jp2->j2k, parameters);
-	/* further JP2 initializations go here */
-}
-
-opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio) {
-	opj_common_ptr cinfo;
-	opj_image_t *image = NULL;
-
-	if(!jp2 || !cio) {
-		return NULL;
-	}
-
-	cinfo = jp2->cinfo;
-
-	/* JP2 decoding */
-	if(!jp2_read_struct(jp2, cio)) {
-		opj_event_msg(cinfo, EVT_ERROR, "Failed to decode jp2 structure\n");
-		return NULL;
-	}
-
-	/* J2K decoding */
-	image = j2k_decode(jp2->j2k, cio);
-	if(!image) {
-		opj_event_msg(cinfo, EVT_ERROR, "Failed to decode J2K image\n");
-	}
-
-	return image;
-}
-
-/* ----------------------------------------------------------------------- */
-/* JP2 encoder interface                                             */
-/* ----------------------------------------------------------------------- */
-
-opj_jp2_t* jp2_create_compress(opj_common_ptr cinfo) {
-	opj_jp2_t *jp2 = (opj_jp2_t*)opj_malloc(sizeof(opj_jp2_t));
-	if(jp2) {
-		jp2->cinfo = cinfo;
-		/* create the J2K codec */
-		jp2->j2k = j2k_create_compress(cinfo);
-		if(jp2->j2k == NULL) {
-			jp2_destroy_compress(jp2);
-			return NULL;
-		}
-	}
-	return jp2;
-}
-
-void jp2_destroy_compress(opj_jp2_t *jp2) {
-	if(jp2) {
-		/* destroy the J2K codec */
-		j2k_destroy_compress(jp2->j2k);
-
-		if(jp2->comps) {
-			opj_free(jp2->comps);
-		}
-		if(jp2->cl) {
-			opj_free(jp2->cl);
-		}
-		opj_free(jp2);
-	}
-}
-
-void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image) {
-	int i;
-	int depth_0, sign;
-
-	if(!jp2 || !parameters || !image)
-		return;
-
-	/* setup the J2K codec */
-	/* ------------------- */
-
-	/* Check if number of components respects standard */
-	if (image->numcomps < 1 || image->numcomps > 16384) {
-		opj_event_msg(jp2->cinfo, EVT_ERROR, "Invalid number of components specified while setting up JP2 encoder\n");
-		return;
-	}
-
-	j2k_setup_encoder(jp2->j2k, parameters, image);
-
-	/* setup the JP2 codec */
-	/* ------------------- */
-
-	/* Profile box */
-
-	jp2->brand = JP2_JP2;	/* BR */
-	jp2->minversion = 0;	/* MinV */
-	jp2->numcl = 1;
-	jp2->cl = (unsigned int*) opj_malloc(jp2->numcl * sizeof(unsigned int));
-	jp2->cl[0] = JP2_JP2;	/* CL0 : JP2 */
-
-	/* Image Header box */
-
-	jp2->numcomps = image->numcomps;	/* NC */
-	jp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t));
-	jp2->h = image->y1 - image->y0;		/* HEIGHT */
-	jp2->w = image->x1 - image->x0;		/* WIDTH */
-	/* BPC */
-	depth_0 = image->comps[0].prec - 1;
-	sign = image->comps[0].sgnd;
-	jp2->bpc = depth_0 + (sign << 7);
-	for (i = 1; i < image->numcomps; i++) {
-		int depth = image->comps[i].prec - 1;
-		sign = image->comps[i].sgnd;
-		if (depth_0 != depth)
-			jp2->bpc = 255;
-	}
-	jp2->C = 7;			/* C : Always 7 */
-	jp2->UnkC = 0;		/* UnkC, colorspace specified in colr box */
-	jp2->IPR = 0;		/* IPR, no intellectual property */
-
-	/* BitsPerComponent box */
-
-	for (i = 0; i < image->numcomps; i++) {
-		jp2->comps[i].bpcc = image->comps[i].prec - 1 + (image->comps[i].sgnd << 7);
-	}
-
-	/* Colour Specification box */
-
-	if ((image->numcomps == 1 || image->numcomps == 3) && (jp2->bpc != 255)) {
-		jp2->meth = 1;	/* METH: Enumerated colourspace */
-	} else {
-		jp2->meth = 2;	/* METH: Restricted ICC profile */
-	}
-	if (jp2->meth == 1) {
-		if (image->color_space == 1)
-			jp2->enumcs = 16;	/* sRGB as defined by IEC 61966–2–1 */
-		else if (image->color_space == 2)
-			jp2->enumcs = 17;	/* greyscale */
-		else if (image->color_space == 3)
-			jp2->enumcs = 18;	/* YUV */
-	} else {
-		jp2->enumcs = 0;		/* PROFILE (??) */
-	}
-	jp2->precedence = 0;	/* PRECEDENCE */
-	jp2->approx = 0;		/* APPROX */
-
-}
-
-bool jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, char *index) {
-
-	/* JP2 encoding */
-
-	/* JPEG 2000 Signature box */
-	jp2_write_jp(cio);
-	/* File Type box */
-	jp2_write_ftyp(jp2, cio);
-	/* JP2 Header box */
-	jp2_write_jp2h(jp2, cio);
-
-	/* J2K encoding */
-
-	if(!jp2_write_jp2c(jp2, cio, image, index)) {
-		opj_event_msg(jp2->cinfo, EVT_ERROR, "Failed to encode image\n");
-		return false;
-	}
-
-	return true;
-}
-
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/jp2.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/jp2.h
deleted file mode 100644
index 61fc1e4..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/jp2.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __JP2_H
-#define __JP2_H
-/**
-@file jp2.h
-@brief The JPEG-2000 file format Reader/Writer (JP2)
-
-*/
-
-/** @defgroup JP2 JP2 - JPEG-2000 file format reader/writer */
-/*@{*/
-
-#define JPIP_JPIP 0x6a706970
-
-#define JP2_JP   0x6a502020		/**< JPEG 2000 signature box */
-#define JP2_FTYP 0x66747970		/**< File type box */
-#define JP2_JP2H 0x6a703268		/**< JP2 header box */
-#define JP2_IHDR 0x69686472		/**< Image header box */
-#define JP2_COLR 0x636f6c72		/**< Colour specification box */
-#define JP2_JP2C 0x6a703263		/**< Contiguous codestream box */
-#define JP2_URL  0x75726c20		/**< URL box */
-#define JP2_DBTL 0x6474626c		/**< ??? */
-#define JP2_BPCC 0x62706363		/**< Bits per component box */
-#define JP2_JP2  0x6a703220		/**< File type fields */
-
-/* ----------------------------------------------------------------------- */
-
-/**
-JP2 component
-*/
-typedef struct opj_jp2_comps {
-  int depth;
-  int sgnd;
-  int bpcc;
-} opj_jp2_comps_t;
-
-/**
-JPEG-2000 file format reader/writer
-*/
-typedef struct opj_jp2 {
-	/** codec context */
-	opj_common_ptr cinfo;
-	/** handle to the J2K codec  */
-	opj_j2k_t *j2k;
-	unsigned int w;
-	unsigned int h;
-	unsigned int numcomps;
-	unsigned int bpc;
-	unsigned int C;
-	unsigned int UnkC;
-	unsigned int IPR;
-	unsigned int meth;
-	unsigned int approx;
-	unsigned int enumcs;
-	unsigned int precedence;
-	unsigned int brand;
-	unsigned int minversion;
-	unsigned int numcl;
-	unsigned int *cl;
-	opj_jp2_comps_t *comps;
-	unsigned int j2k_codestream_offset;
-	unsigned int j2k_codestream_length;
-} opj_jp2_t;
-
-/**
-JP2 Box
-*/
-typedef struct opj_jp2_box {
-  int length;
-  int type;
-  int init_pos;
-} opj_jp2_box_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Write the JP2H box - JP2 Header box (used in MJ2)
-@param jp2 JP2 handle
-@param cio Output buffer stream
-*/
-void jp2_write_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
-/**
-Read the JP2H box - JP2 Header box (used in MJ2)
-@param jp2 JP2 handle
-@param cio Input buffer stream
-@return Returns true if successful, returns false otherwise
-*/
-bool jp2_read_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
-/**
-Creates a JP2 decompression structure
-@param cinfo Codec context info
-@return Returns a handle to a JP2 decompressor if successful, returns NULL otherwise
-*/
-opj_jp2_t* jp2_create_decompress(opj_common_ptr cinfo);
-/**
-Destroy a JP2 decompressor handle
-@param jp2 JP2 decompressor handle to destroy
-*/
-void jp2_destroy_decompress(opj_jp2_t *jp2);
-/**
-Setup the decoder decoding parameters using user parameters.
-Decoding parameters are returned in jp2->j2k->cp.
-@param jp2 JP2 decompressor handle
-@param parameters decompression parameters
-*/
-void jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters);
-/**
-Decode an image from a JPEG-2000 file stream
-@param jp2 JP2 decompressor handle
-@param cio Input buffer stream
-@return Returns a decoded image if successful, returns NULL otherwise
-*/
-opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio);
-/**
-Creates a JP2 compression structure
-@param cinfo Codec context info
-@return Returns a handle to a JP2 compressor if successful, returns NULL otherwise
-*/
-opj_jp2_t* jp2_create_compress(opj_common_ptr cinfo);
-/**
-Destroy a JP2 compressor handle
-@param jp2 JP2 compressor handle to destroy
-*/
-void jp2_destroy_compress(opj_jp2_t *jp2);
-/**
-Setup the encoder parameters using the current image and using user parameters.
-Coding parameters are returned in jp2->j2k->cp.
-@param jp2 JP2 compressor handle
-@param parameters compression parameters
-@param image input filled image
-*/
-void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image);
-/**
-Encode an image into a JPEG-2000 file stream
-@param jp2 JP2 compressor handle
-@param cio Output buffer stream
-@param image Image to encode
-@param index Name of the index file if required, NULL otherwise
-@return Returns true if successful, returns false otherwise
-*/
-bool jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, char *index);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __JP2_H */
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/jpt.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/jpt.c
deleted file mode 100644
index a2566ea..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/jpt.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/*
- * Read the information contains in VBAS [JPP/JPT stream message header]
- * Store information (7 bits) in value
- *
- */
-unsigned int jpt_read_VBAS_info(opj_cio_t *cio, unsigned int value) {
-	unsigned char elmt;
-
-	elmt = cio_read(cio, 1);
-	while ((elmt >> 7) == 1) {
-		value = (value << 7);
-		value |= (elmt & 0x7f);
-		elmt = cio_read(cio, 1);
-	}
-	value = (value << 7);
-	value |= (elmt & 0x7f);
-
-	return value;
-}
-
-/*
- * Initialize the value of the message header structure
- *
- */
-void jpt_init_msg_header(opj_jpt_msg_header_t * header) {
-	header->Id = 0;		/* In-class Identifier    */
-	header->last_byte = 0;	/* Last byte information  */
-	header->Class_Id = 0;		/* Class Identifier       */
-	header->CSn_Id = 0;		/* CSn : index identifier */
-	header->Msg_offset = 0;	/* Message offset         */
-	header->Msg_length = 0;	/* Message length         */
-	header->Layer_nb = 0;		/* Auxiliary for JPP case */
-}
-
-/*
- * Re-initialize the value of the message header structure
- *
- * Only parameters always present in message header
- *
- */
-void jpt_reinit_msg_header(opj_jpt_msg_header_t * header) {
-	header->Id = 0;		/* In-class Identifier    */
-	header->last_byte = 0;	/* Last byte information  */
-	header->Msg_offset = 0;	/* Message offset         */
-	header->Msg_length = 0;	/* Message length         */
-}
-
-/*
- * Read the message header for a JPP/JPT - stream
- *
- */
-void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header) {
-	unsigned char elmt, Class = 0, CSn = 0;
-	jpt_reinit_msg_header(header);
-
-	/* ------------- */
-	/* VBAS : Bin-ID */
-	/* ------------- */
-	elmt = cio_read(cio, 1);
-
-	/* See for Class and CSn */
-	switch ((elmt >> 5) & 0x03) {
-		case 0:
-			opj_event_msg(cinfo, EVT_ERROR, "Forbidden value encounter in message header !!\n");
-			break;
-		case 1:
-			Class = 0;
-			CSn = 0;
-			break;
-		case 2:
-			Class = 1;
-			CSn = 0;
-			break;
-		case 3:
-			Class = 1;
-			CSn = 1;
-			break;
-		default:
-			break;
-	}
-
-	/* see information on bits 'c' [p 10 : A.2.1 general, ISO/IEC FCD 15444-9] */
-	if (((elmt >> 4) & 0x01) == 1)
-		header->last_byte = 1;
-
-	/* In-class identifier */
-	header->Id |= (elmt & 0x0f);
-	if ((elmt >> 7) == 1)
-		header->Id = jpt_read_VBAS_info(cio, header->Id);
-
-	/* ------------ */
-	/* VBAS : Class */
-	/* ------------ */
-	if (Class == 1) {
-		header->Class_Id = 0;
-		header->Class_Id = jpt_read_VBAS_info(cio, header->Class_Id);
-	}
-
-	/* ---------- */
-	/* VBAS : CSn */
-	/* ---------- */
-	if (CSn == 1) {
-		header->CSn_Id = 0;
-		header->CSn_Id = jpt_read_VBAS_info(cio, header->CSn_Id);
-	}
-
-	/* ----------------- */
-	/* VBAS : Msg_offset */
-	/* ----------------- */
-	header->Msg_offset = jpt_read_VBAS_info(cio, header->Msg_offset);
-
-	/* ----------------- */
-	/* VBAS : Msg_length */
-	/* ----------------- */
-	header->Msg_length = jpt_read_VBAS_info(cio, header->Msg_length);
-
-	/* ---------- */
-	/* VBAS : Aux */
-	/* ---------- */
-	if ((header->Class_Id & 0x01) == 1) {
-		header->Layer_nb = 0;
-		header->Layer_nb = jpt_read_VBAS_info(cio, header->Layer_nb);
-	}
-}
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/jpt.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/jpt.h
deleted file mode 100644
index eb01f98..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/jpt.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __JPT_H
-#define __JPT_H
-/**
-@file jpt.h
-@brief JPT-stream reader (JPEG 2000, JPIP)
-
-JPT-stream functions are implemented in J2K.C.
-*/
-
-/**
-Message Header JPT stream structure
-*/
-typedef struct opj_jpt_msg_header {
-	/** In-class Identifier */
-	unsigned int Id;
-	/** Last byte information */
-	unsigned int last_byte;
-	/** Class Identifier */
-	unsigned int Class_Id;
-	/** CSn : index identifier */
-	unsigned int CSn_Id;
-	/** Message offset */
-	unsigned int Msg_offset;
-	/** Message length */
-	unsigned int Msg_length;
-	/** Auxiliary for JPP case */
-	unsigned int Layer_nb;
-} opj_jpt_msg_header_t;
-
-/* ----------------------------------------------------------------------- */
-
-/**
-Initialize the value of the message header structure
-@param header Message header structure
-*/
-void jpt_init_msg_header(opj_jpt_msg_header_t * header);
-
-/**
-Read the message header for a JPP/JPT - stream
-@param cinfo Codec context info
-@param cio CIO handle
-@param header Message header structure
-*/
-void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header);
-
-#endif
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/mct.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/mct.c
deleted file mode 100644
index fad9355..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/mct.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/* <summary> */
-/* This table contains the norms of the basis function of the reversible MCT. */
-/* </summary> */
-static const double mct_norms[3] = { 1.732, .8292, .8292 };
-
-/* <summary> */
-/* This table contains the norms of the basis function of the irreversible MCT. */
-/* </summary> */
-static const double mct_norms_real[3] = { 1.732, 1.805, 1.573 };
-
-/* <summary> */
-/* Foward reversible MCT. */
-/* </summary> */
-void mct_encode(int *c0, int *c1, int *c2, int n) {
-	int i;
-	for (i = 0; i < n; i++) {
-		int r, g, b, y, u, v;
-		r = c0[i];
-		g = c1[i];
-		b = c2[i];
-		y = (r + (g << 1) + b) >> 2;
-		u = b - g;
-		v = r - g;
-		c0[i] = y;
-		c1[i] = u;
-		c2[i] = v;
-	}
-}
-
-/* <summary> */
-/* Inverse reversible MCT. */
-/* </summary> */
-void mct_decode(int *c0, int *c1, int *c2, int n) {
-	int i;
-	for (i = 0; i < n; i++) {
-		int y, u, v, r, g, b;
-		y = c0[i];
-		u = c1[i];
-		v = c2[i];
-		g = y - ((u + v) >> 2);
-		r = v + g;
-		b = u + g;
-		c0[i] = r;
-		c1[i] = g;
-		c2[i] = b;
-	}
-}
-
-/* <summary> */
-/* Get norm of basis function of reversible MCT. */
-/* </summary> */
-double mct_getnorm(int compno) {
-	return mct_norms[compno];
-}
-
-/* <summary> */
-/* Foward irreversible MCT. */
-/* </summary> */
-void mct_encode_real(int *c0, int *c1, int *c2, int n) {
-	int i;
-	for (i = 0; i < n; i++) {
-		int r, g, b, y, u, v;
-		r = c0[i];
-		g = c1[i];
-		b = c2[i];
-		y = fix_mul(r, 2449) + fix_mul(g, 4809) + fix_mul(b, 934);
-		u = -fix_mul(r, 1382) - fix_mul(g, 2714) + fix_mul(b, 4096);
-		v = fix_mul(r, 4096) - fix_mul(g, 3430) - fix_mul(b, 666);
-		c0[i] = y;
-		c1[i] = u;
-		c2[i] = v;
-	}
-}
-
-/* <summary> */
-/* Inverse irreversible MCT. */
-/* </summary> */
-void mct_decode_real(int *c0, int *c1, int *c2, int n) {
-	int i;
-	for (i = 0; i < n; i++) {
-		int y, u, v, r, g, b;
-		y = c0[i];
-		u = c1[i];
-		v = c2[i];
-		r = y + fix_mul(v, 11485);
-		g = y - fix_mul(u, 2819) - fix_mul(v, 5850);
-		b = y + fix_mul(u, 14516);
-		c0[i] = r;
-		c1[i] = g;
-		c2[i] = b;
-	}
-}
-
-/* <summary> */
-/* Get norm of basis function of irreversible MCT. */
-/* </summary> */
-double mct_getnorm_real(int compno) {
-	return mct_norms_real[compno];
-}
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/mct.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/mct.h
deleted file mode 100644
index 7596187..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/mct.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __MCT_H
-#define __MCT_H
-/**
-@file mct.h
-@brief Implementation of a multi-component transforms (MCT)
-
-The functions in MCT.C have for goal to realize reversible and irreversible multicomponent
-transform. The functions in MCT.C are used by some function in TCD.C.
-*/
-
-/** @defgroup MCT MCT - Implementation of a multi-component transform */
-/*@{*/
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Apply a reversible multi-component transform to an image
-@param c0 Samples for red component
-@param c1 Samples for green component
-@param c2 Samples blue component
-@param n Number of samples for each component
-*/
-void mct_encode(int *c0, int *c1, int *c2, int n);
-/**
-Apply a reversible multi-component inverse transform to an image
-@param c0 Samples for luminance component
-@param c1 Samples for red chrominance component
-@param c2 Samples for blue chrominance component
-@param n Number of samples for each component
-*/
-void mct_decode(int *c0, int *c1, int *c2, int n);
-/**
-Get norm of the basis function used for the reversible multi-component transform
-@param compno Number of the component (0->Y, 1->U, 2->V)
-@return
-*/
-double mct_getnorm(int compno);
-
-/**
-Apply an irreversible multi-component transform to an image
-@param c0 Samples for red component
-@param c1 Samples for green component
-@param c2 Samples blue component
-@param n Number of samples for each component
-*/
-void mct_encode_real(int *c0, int *c1, int *c2, int n);
-/**
-Apply an irreversible multi-component inverse transform to an image
-@param c0 Samples for luminance component
-@param c1 Samples for red chrominance component
-@param c2 Samples for blue chrominance component
-@param n Number of samples for each component
-*/
-void mct_decode_real(int *c0, int *c1, int *c2, int n);
-/**
-Get norm of the basis function used for the irreversible multi-component transform
-@param compno Number of the component (0->Y, 1->U, 2->V)
-@return
-*/
-double mct_getnorm_real(int compno);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __MCT_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/mqc.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/mqc.c
deleted file mode 100644
index e6dd007..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/mqc.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/** @defgroup MQC MQC - Implementation of an MQ-Coder */
-/*@{*/
-
-/** @name Local static functions */
-/*@{*/
-
-/**
-Output a byte, doing bit-stuffing if necessary.
-After a 0xff byte, the next byte must be smaller than 0x90.
-@param mqc MQC handle
-*/
-static void mqc_byteout(opj_mqc_t *mqc);
-/**
-Renormalize mqc->a and mqc->c while encoding, so that mqc->a stays between 0x8000 and 0x10000
-@param mqc MQC handle
-*/
-static void mqc_renorme(opj_mqc_t *mqc);
-/**
-Encode the most probable symbol
-@param mqc MQC handle
-*/
-static void mqc_codemps(opj_mqc_t *mqc);
-/**
-Encode the most least symbol
-@param mqc MQC handle
-*/
-static void mqc_codelps(opj_mqc_t *mqc);
-/**
-Fill mqc->c with 1's for flushing
-@param mqc MQC handle
-*/
-static void mqc_setbits(opj_mqc_t *mqc);
-/**
-FIXME: documentation ???
-@param mqc MQC handle
-@return
-*/
-static int mqc_mpsexchange(opj_mqc_t *mqc);
-/**
-FIXME: documentation ???
-@param mqc MQC handle
-@return
-*/
-static int mqc_lpsexchange(opj_mqc_t *mqc);
-/**
-Input a byte
-@param mqc MQC handle
-*/
-static void mqc_bytein(opj_mqc_t *mqc);
-/**
-Renormalize mqc->a and mqc->c while decoding
-@param mqc MQC handle
-*/
-static void mqc_renormd(opj_mqc_t *mqc);
-
-/*@}*/
-
-/*@}*/
-
-/* <summary> */
-/* This array defines all the possible states for a context. */
-/* </summary> */
-static opj_mqc_state_t mqc_states[47 * 2] = {
-	{0x5601, 0, &mqc_states[2], &mqc_states[3]},
-	{0x5601, 1, &mqc_states[3], &mqc_states[2]},
-	{0x3401, 0, &mqc_states[4], &mqc_states[12]},
-	{0x3401, 1, &mqc_states[5], &mqc_states[13]},
-	{0x1801, 0, &mqc_states[6], &mqc_states[18]},
-	{0x1801, 1, &mqc_states[7], &mqc_states[19]},
-	{0x0ac1, 0, &mqc_states[8], &mqc_states[24]},
-	{0x0ac1, 1, &mqc_states[9], &mqc_states[25]},
-	{0x0521, 0, &mqc_states[10], &mqc_states[58]},
-	{0x0521, 1, &mqc_states[11], &mqc_states[59]},
-	{0x0221, 0, &mqc_states[76], &mqc_states[66]},
-	{0x0221, 1, &mqc_states[77], &mqc_states[67]},
-	{0x5601, 0, &mqc_states[14], &mqc_states[13]},
-	{0x5601, 1, &mqc_states[15], &mqc_states[12]},
-	{0x5401, 0, &mqc_states[16], &mqc_states[28]},
-	{0x5401, 1, &mqc_states[17], &mqc_states[29]},
-	{0x4801, 0, &mqc_states[18], &mqc_states[28]},
-	{0x4801, 1, &mqc_states[19], &mqc_states[29]},
-	{0x3801, 0, &mqc_states[20], &mqc_states[28]},
-	{0x3801, 1, &mqc_states[21], &mqc_states[29]},
-	{0x3001, 0, &mqc_states[22], &mqc_states[34]},
-	{0x3001, 1, &mqc_states[23], &mqc_states[35]},
-	{0x2401, 0, &mqc_states[24], &mqc_states[36]},
-	{0x2401, 1, &mqc_states[25], &mqc_states[37]},
-	{0x1c01, 0, &mqc_states[26], &mqc_states[40]},
-	{0x1c01, 1, &mqc_states[27], &mqc_states[41]},
-	{0x1601, 0, &mqc_states[58], &mqc_states[42]},
-	{0x1601, 1, &mqc_states[59], &mqc_states[43]},
-	{0x5601, 0, &mqc_states[30], &mqc_states[29]},
-	{0x5601, 1, &mqc_states[31], &mqc_states[28]},
-	{0x5401, 0, &mqc_states[32], &mqc_states[28]},
-	{0x5401, 1, &mqc_states[33], &mqc_states[29]},
-	{0x5101, 0, &mqc_states[34], &mqc_states[30]},
-	{0x5101, 1, &mqc_states[35], &mqc_states[31]},
-	{0x4801, 0, &mqc_states[36], &mqc_states[32]},
-	{0x4801, 1, &mqc_states[37], &mqc_states[33]},
-	{0x3801, 0, &mqc_states[38], &mqc_states[34]},
-	{0x3801, 1, &mqc_states[39], &mqc_states[35]},
-	{0x3401, 0, &mqc_states[40], &mqc_states[36]},
-	{0x3401, 1, &mqc_states[41], &mqc_states[37]},
-	{0x3001, 0, &mqc_states[42], &mqc_states[38]},
-	{0x3001, 1, &mqc_states[43], &mqc_states[39]},
-	{0x2801, 0, &mqc_states[44], &mqc_states[38]},
-	{0x2801, 1, &mqc_states[45], &mqc_states[39]},
-	{0x2401, 0, &mqc_states[46], &mqc_states[40]},
-	{0x2401, 1, &mqc_states[47], &mqc_states[41]},
-	{0x2201, 0, &mqc_states[48], &mqc_states[42]},
-	{0x2201, 1, &mqc_states[49], &mqc_states[43]},
-	{0x1c01, 0, &mqc_states[50], &mqc_states[44]},
-	{0x1c01, 1, &mqc_states[51], &mqc_states[45]},
-	{0x1801, 0, &mqc_states[52], &mqc_states[46]},
-	{0x1801, 1, &mqc_states[53], &mqc_states[47]},
-	{0x1601, 0, &mqc_states[54], &mqc_states[48]},
-	{0x1601, 1, &mqc_states[55], &mqc_states[49]},
-	{0x1401, 0, &mqc_states[56], &mqc_states[50]},
-	{0x1401, 1, &mqc_states[57], &mqc_states[51]},
-	{0x1201, 0, &mqc_states[58], &mqc_states[52]},
-	{0x1201, 1, &mqc_states[59], &mqc_states[53]},
-	{0x1101, 0, &mqc_states[60], &mqc_states[54]},
-	{0x1101, 1, &mqc_states[61], &mqc_states[55]},
-	{0x0ac1, 0, &mqc_states[62], &mqc_states[56]},
-	{0x0ac1, 1, &mqc_states[63], &mqc_states[57]},
-	{0x09c1, 0, &mqc_states[64], &mqc_states[58]},
-	{0x09c1, 1, &mqc_states[65], &mqc_states[59]},
-	{0x08a1, 0, &mqc_states[66], &mqc_states[60]},
-	{0x08a1, 1, &mqc_states[67], &mqc_states[61]},
-	{0x0521, 0, &mqc_states[68], &mqc_states[62]},
-	{0x0521, 1, &mqc_states[69], &mqc_states[63]},
-	{0x0441, 0, &mqc_states[70], &mqc_states[64]},
-	{0x0441, 1, &mqc_states[71], &mqc_states[65]},
-	{0x02a1, 0, &mqc_states[72], &mqc_states[66]},
-	{0x02a1, 1, &mqc_states[73], &mqc_states[67]},
-	{0x0221, 0, &mqc_states[74], &mqc_states[68]},
-	{0x0221, 1, &mqc_states[75], &mqc_states[69]},
-	{0x0141, 0, &mqc_states[76], &mqc_states[70]},
-	{0x0141, 1, &mqc_states[77], &mqc_states[71]},
-	{0x0111, 0, &mqc_states[78], &mqc_states[72]},
-	{0x0111, 1, &mqc_states[79], &mqc_states[73]},
-	{0x0085, 0, &mqc_states[80], &mqc_states[74]},
-	{0x0085, 1, &mqc_states[81], &mqc_states[75]},
-	{0x0049, 0, &mqc_states[82], &mqc_states[76]},
-	{0x0049, 1, &mqc_states[83], &mqc_states[77]},
-	{0x0025, 0, &mqc_states[84], &mqc_states[78]},
-	{0x0025, 1, &mqc_states[85], &mqc_states[79]},
-	{0x0015, 0, &mqc_states[86], &mqc_states[80]},
-	{0x0015, 1, &mqc_states[87], &mqc_states[81]},
-	{0x0009, 0, &mqc_states[88], &mqc_states[82]},
-	{0x0009, 1, &mqc_states[89], &mqc_states[83]},
-	{0x0005, 0, &mqc_states[90], &mqc_states[84]},
-	{0x0005, 1, &mqc_states[91], &mqc_states[85]},
-	{0x0001, 0, &mqc_states[90], &mqc_states[86]},
-	{0x0001, 1, &mqc_states[91], &mqc_states[87]},
-	{0x5601, 0, &mqc_states[92], &mqc_states[92]},
-	{0x5601, 1, &mqc_states[93], &mqc_states[93]},
-};
-
-/*
-==========================================================
-   local functions
-==========================================================
-*/
-
-static void mqc_byteout(opj_mqc_t *mqc) {
-	if (*mqc->bp == 0xff) {
-		mqc->bp++;
-		*mqc->bp = mqc->c >> 20;
-		mqc->c &= 0xfffff;
-		mqc->ct = 7;
-	} else {
-		if ((mqc->c & 0x8000000) == 0) {	/* ((mqc->c&0x8000000)==0) CHANGE */
-			mqc->bp++;
-			*mqc->bp = mqc->c >> 19;
-			mqc->c &= 0x7ffff;
-			mqc->ct = 8;
-		} else {
-			(*mqc->bp)++;
-			if (*mqc->bp == 0xff) {
-				mqc->c &= 0x7ffffff;
-				mqc->bp++;
-				*mqc->bp = mqc->c >> 20;
-				mqc->c &= 0xfffff;
-				mqc->ct = 7;
-			} else {
-				mqc->bp++;
-				*mqc->bp = mqc->c >> 19;
-				mqc->c &= 0x7ffff;
-				mqc->ct = 8;
-			}
-		}
-	}
-}
-
-static void mqc_renorme(opj_mqc_t *mqc) {
-	do {
-		mqc->a <<= 1;
-		mqc->c <<= 1;
-		mqc->ct--;
-		if (mqc->ct == 0) {
-			mqc_byteout(mqc);
-		}
-	} while ((mqc->a & 0x8000) == 0);
-}
-
-static void mqc_codemps(opj_mqc_t *mqc) {
-	mqc->a -= (*mqc->curctx)->qeval;
-	if ((mqc->a & 0x8000) == 0) {
-		if (mqc->a < (*mqc->curctx)->qeval) {
-			mqc->a = (*mqc->curctx)->qeval;
-		} else {
-			mqc->c += (*mqc->curctx)->qeval;
-		}
-		*mqc->curctx = (*mqc->curctx)->nmps;
-		mqc_renorme(mqc);
-	} else {
-		mqc->c += (*mqc->curctx)->qeval;
-	}
-}
-
-static void mqc_codelps(opj_mqc_t *mqc) {
-	mqc->a -= (*mqc->curctx)->qeval;
-	if (mqc->a < (*mqc->curctx)->qeval) {
-		mqc->c += (*mqc->curctx)->qeval;
-	} else {
-		mqc->a = (*mqc->curctx)->qeval;
-	}
-	*mqc->curctx = (*mqc->curctx)->nlps;
-	mqc_renorme(mqc);
-}
-
-static void mqc_setbits(opj_mqc_t *mqc) {
-	unsigned int tempc = mqc->c + mqc->a;
-	mqc->c |= 0xffff;
-	if (mqc->c >= tempc) {
-		mqc->c -= 0x8000;
-	}
-}
-
-static int mqc_mpsexchange(opj_mqc_t *mqc) {
-	int d;
-	if (mqc->a < (*mqc->curctx)->qeval) {
-		d = 1 - (*mqc->curctx)->mps;
-		*mqc->curctx = (*mqc->curctx)->nlps;
-	} else {
-		d = (*mqc->curctx)->mps;
-		*mqc->curctx = (*mqc->curctx)->nmps;
-	}
-
-	return d;
-}
-
-static int mqc_lpsexchange(opj_mqc_t *mqc) {
-	int d;
-	if (mqc->a < (*mqc->curctx)->qeval) {
-		mqc->a = (*mqc->curctx)->qeval;
-		d = (*mqc->curctx)->mps;
-		*mqc->curctx = (*mqc->curctx)->nmps;
-	} else {
-		mqc->a = (*mqc->curctx)->qeval;
-		d = 1 - (*mqc->curctx)->mps;
-		*mqc->curctx = (*mqc->curctx)->nlps;
-	}
-
-	return d;
-}
-
-static void mqc_bytein(opj_mqc_t *mqc) {
-	if (mqc->bp != mqc->end) {
-		unsigned int c;
-		if (mqc->bp + 1 != mqc->end) {
-			c = *(mqc->bp + 1);
-		} else {
-			c = 0xff;
-		}
-		if (*mqc->bp == 0xff) {
-			if (c > 0x8f) {
-				mqc->c += 0xff00;
-				mqc->ct = 8;
-			} else {
-				mqc->bp++;
-				mqc->c += c << 9;
-				mqc->ct = 7;
-			}
-		} else {
-			mqc->bp++;
-			mqc->c += c << 8;
-			mqc->ct = 8;
-		}
-	} else {
-		mqc->c += 0xff00;
-		mqc->ct = 8;
-	}
-}
-
-static void mqc_renormd(opj_mqc_t *mqc) {
-	do {
-		if (mqc->ct == 0) {
-			mqc_bytein(mqc);
-		}
-		mqc->a <<= 1;
-		mqc->c <<= 1;
-		mqc->ct--;
-	} while (mqc->a < 0x8000);
-}
-
-/*
-==========================================================
-   MQ-Coder interface
-==========================================================
-*/
-
-opj_mqc_t* mqc_create() {
-	opj_mqc_t *mqc = (opj_mqc_t*)opj_malloc(sizeof(opj_mqc_t));
-	return mqc;
-}
-
-void mqc_destroy(opj_mqc_t *mqc) {
-	if(mqc) {
-		opj_free(mqc);
-	}
-}
-
-int mqc_numbytes(opj_mqc_t *mqc) {
-	return mqc->bp - mqc->start;
-}
-
-void mqc_init_enc(opj_mqc_t *mqc, unsigned char *bp) {
-	mqc_setcurctx(mqc, 0);
-	mqc->a = 0x8000;
-	mqc->c = 0;
-	mqc->bp = bp - 1;
-	mqc->ct = 12;
-	if (*mqc->bp == 0xff) {
-		mqc->ct = 13;
-	}
-	mqc->start = bp;
-}
-
-void mqc_setcurctx(opj_mqc_t *mqc, int ctxno) {
-	mqc->curctx = &mqc->ctxs[ctxno];
-}
-
-void mqc_encode(opj_mqc_t *mqc, int d) {
-	if ((*mqc->curctx)->mps == d) {
-		mqc_codemps(mqc);
-	} else {
-		mqc_codelps(mqc);
-	}
-}
-
-void mqc_flush(opj_mqc_t *mqc) {
-	mqc_setbits(mqc);
-	mqc->c <<= mqc->ct;
-	mqc_byteout(mqc);
-	mqc->c <<= mqc->ct;
-	mqc_byteout(mqc);
-
-	if (*mqc->bp != 0xff) {
-		mqc->bp++;
-	}
-}
-
-void mqc_bypass_init_enc(opj_mqc_t *mqc) {
-	mqc->c = 0;
-	mqc->ct = 8;
-	/*if (*mqc->bp == 0xff) {
-	mqc->ct = 7;
-     } */
-}
-
-void mqc_bypass_enc(opj_mqc_t *mqc, int d) {
-	mqc->ct--;
-	mqc->c = mqc->c + (d << mqc->ct);
-	if (mqc->ct == 0) {
-		mqc->bp++;
-		*mqc->bp = mqc->c;
-		mqc->ct = 8;
-		if (*mqc->bp == 0xff) {
-			mqc->ct = 7;
-		}
-		mqc->c = 0;
-	}
-}
-
-int mqc_bypass_flush_enc(opj_mqc_t *mqc) {
-	unsigned char bit_padding;
-
-	bit_padding = 0;
-
-	if (mqc->ct != 0) {
-		while (mqc->ct > 0) {
-			mqc->ct--;
-			mqc->c += bit_padding << mqc->ct;
-			bit_padding = (bit_padding + 1) & 0x01;
-		}
-		mqc->bp++;
-		*mqc->bp = mqc->c;
-		mqc->ct = 8;
-		mqc->c = 0;
-	}
-
-	return 1;
-}
-
-void mqc_reset_enc(opj_mqc_t *mqc) {
-	mqc_resetstates(mqc);
-	mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);
-	mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);
-	mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);
-}
-
-int mqc_restart_enc(opj_mqc_t *mqc) {
-	int correction = 1;
-
-	/* <flush part> */
-	int n = 27 - 15 - mqc->ct;
-	mqc->c <<= mqc->ct;
-	while (n > 0) {
-		mqc_byteout(mqc);
-		n -= mqc->ct;
-		mqc->c <<= mqc->ct;
-	}
-	mqc_byteout(mqc);
-
-	return correction;
-}
-
-void mqc_restart_init_enc(opj_mqc_t *mqc) {
-	/* <Re-init part> */
-	mqc_setcurctx(mqc, 0);
-	mqc->a = 0x8000;
-	mqc->c = 0;
-	mqc->ct = 12;
-	mqc->bp--;
-	if (*mqc->bp == 0xff) {
-		mqc->ct = 13;
-	}
-}
-
-void mqc_erterm_enc(opj_mqc_t *mqc) {
-	int k = 11 - mqc->ct + 1;
-
-	while (k > 0) {
-		mqc->c <<= mqc->ct;
-		mqc->ct = 0;
-		mqc_byteout(mqc);
-		k -= mqc->ct;
-	}
-
-	if (*mqc->bp != 0xff) {
-		mqc_byteout(mqc);
-	}
-}
-
-void mqc_segmark_enc(opj_mqc_t *mqc) {
-	int i;
-	mqc_setcurctx(mqc, 18);
-
-	for (i = 1; i < 5; i++) {
-		mqc_encode(mqc, i % 2);
-	}
-}
-
-void mqc_init_dec(opj_mqc_t *mqc, unsigned char *bp, int len) {
-	mqc_setcurctx(mqc, 0);
-	mqc->start = bp;
-	mqc->end = bp + len;
-	mqc->bp = bp;
-	if (len==0) mqc->c = 0xff << 16;
-	else mqc->c = *mqc->bp << 16;
-	mqc_bytein(mqc);
-	mqc->c <<= 7;
-	mqc->ct -= 7;
-	mqc->a = 0x8000;
-}
-
-int mqc_decode(opj_mqc_t *mqc) {
-	int d;
-	mqc->a -= (*mqc->curctx)->qeval;
-	if ((mqc->c >> 16) < (*mqc->curctx)->qeval) {
-		d = mqc_lpsexchange(mqc);
-		mqc_renormd(mqc);
-	} else {
-		mqc->c -= (*mqc->curctx)->qeval << 16;
-		if ((mqc->a & 0x8000) == 0) {
-			d = mqc_mpsexchange(mqc);
-			mqc_renormd(mqc);
-		} else {
-			d = (*mqc->curctx)->mps;
-		}
-	}
-
-	return d;
-}
-
-void mqc_resetstates(opj_mqc_t *mqc) {
-	int i;
-	for (i = 0; i < MQC_NUMCTXS; i++) {
-		mqc->ctxs[i] = mqc_states;
-	}
-}
-
-void mqc_setstate(opj_mqc_t *mqc, int ctxno, int msb, int prob) {
-	mqc->ctxs[ctxno] = &mqc_states[msb + (prob << 1)];
-}
-
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/mqc.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/mqc.h
deleted file mode 100644
index 67f38c1..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/mqc.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __MQC_H
-#define __MQC_H
-/**
-@file mqc.h
-@brief Implementation of an MQ-Coder (MQC)
-
-The functions in MQC.C have for goal to realize the MQ-coder operations. The functions
-in MQC.C are used by some function in T1.C.
-*/
-
-/** @defgroup MQC MQC - Implementation of an MQ-Coder */
-/*@{*/
-
-/**
-This struct defines the state of a context.
-*/
-typedef struct opj_mqc_state {
-	/** the probability of the Least Probable Symbol (0.75->0x8000, 1.5->0xffff) */
-	unsigned int qeval;
-	/** the Most Probable Symbol (0 or 1) */
-	int mps;
-	/** next state if the next encoded symbol is the MPS */
-	struct opj_mqc_state *nmps;
-	/** next state if the next encoded symbol is the LPS */
-	struct opj_mqc_state *nlps;
-} opj_mqc_state_t;
-
-#define MQC_NUMCTXS 32
-
-/**
-MQ coder
-*/
-typedef struct opj_mqc {
-	unsigned int c;
-	unsigned int a;
-	unsigned int ct;
-	unsigned char *bp;
-	unsigned char *start;
-	unsigned char *end;
-	opj_mqc_state_t *ctxs[MQC_NUMCTXS];
-	opj_mqc_state_t **curctx;
-} opj_mqc_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Create a new MQC handle
-@return Returns a new MQC handle if successful, returns NULL otherwise
-*/
-opj_mqc_t* mqc_create();
-/**
-Destroy a previously created MQC handle
-@param mqc MQC handle to destroy
-*/
-void mqc_destroy(opj_mqc_t *mqc);
-/**
-Return the number of bytes written/read since initialisation
-@param mqc MQC handle
-@return Returns the number of bytes already encoded
-*/
-int mqc_numbytes(opj_mqc_t *mqc);
-/**
-Reset the states of all the context of the coder/decoder
-(each context is set to a state where 0 and 1 are more or less equiprobable)
-@param mqc MQC handle
-*/
-void mqc_resetstates(opj_mqc_t *mqc);
-/**
-Set the state of a particular context
-@param mqc MQC handle
-@param ctxno Number that identifies the context
-@param msb The MSB of the new state of the context
-@param prob Number that identifies the probability of the symbols for the new state of the context
-*/
-void mqc_setstate(opj_mqc_t *mqc, int ctxno, int msb, int prob);
-/**
-Initialize the encoder
-@param mqc MQC handle
-@param bp Pointer to the start of the buffer where the bytes will be written
-*/
-void mqc_init_enc(opj_mqc_t *mqc, unsigned char *bp);
-/**
-Set the current context used for coding/decoding
-@param mqc MQC handle
-@param ctxno Number that identifies the context
-*/
-void mqc_setcurctx(opj_mqc_t *mqc, int ctxno);
-/**
-Encode a symbol using the MQ-coder
-@param mqc MQC handle
-@param d The symbol to be encoded (0 or 1)
-*/
-void mqc_encode(opj_mqc_t *mqc, int d);
-/**
-Flush the encoder, so that all remaining data is written
-@param mqc MQC handle
-*/
-void mqc_flush(opj_mqc_t *mqc);
-/**
-BYPASS mode switch, initialization operation.
-JPEG 2000 p 505.
-<h2>Not fully implemented and tested !!</h2>
-@param mqc MQC handle
-*/
-void mqc_bypass_init_enc(opj_mqc_t *mqc);
-/**
-BYPASS mode switch, coding operation.
-JPEG 2000 p 505.
-<h2>Not fully implemented and tested !!</h2>
-@param mqc MQC handle
-@param d The symbol to be encoded (0 or 1)
-*/
-void mqc_bypass_enc(opj_mqc_t *mqc, int d);
-/**
-BYPASS mode switch, flush operation
-<h2>Not fully implemented and tested !!</h2>
-@param mqc MQC handle
-@return Returns 1 (always)
-*/
-int mqc_bypass_flush_enc(opj_mqc_t *mqc);
-/**
-RESET mode switch
-@param mqc MQC handle
-*/
-void mqc_reset_enc(opj_mqc_t *mqc);
-/**
-RESTART mode switch (TERMALL)
-@param mqc MQC handle
-@return Returns 1 (always)
-*/
-int mqc_restart_enc(opj_mqc_t *mqc);
-/**
-RESTART mode switch (TERMALL) reinitialisation
-@param mqc MQC handle
-*/
-void mqc_restart_init_enc(opj_mqc_t *mqc);
-/**
-ERTERM mode switch (PTERM)
-@param mqc MQC handle
-*/
-void mqc_erterm_enc(opj_mqc_t *mqc);
-/**
-SEGMARK mode switch (SEGSYM)
-@param mqc MQC handle
-*/
-void mqc_segmark_enc(opj_mqc_t *mqc);
-/**
-Initialize the decoder
-@param mqc MQC handle
-@param bp Pointer to the start of the buffer from which the bytes will be read
-@param len Length of the input buffer
-*/
-void mqc_init_dec(opj_mqc_t *mqc, unsigned char *bp, int len);
-/**
-Decode a symbol
-@param mqc MQC handle
-@return Returns the decoded symbol (0 or 1)
-*/
-int mqc_decode(opj_mqc_t *mqc);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __MQC_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/openjpeg.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/openjpeg.c
deleted file mode 100644
index 6f12ff0..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/openjpeg.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Copyright (c) 2005, Hervé Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef WIN32
-#include <windows.h>
-#endif /* WIN32 */
-
-#include "opj_includes.h"
-
-/* ---------------------------------------------------------------------- */
-#ifdef WIN32
-#ifndef OPJ_STATIC
-BOOL APIENTRY
-DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
-	switch (ul_reason_for_call) {
-		case DLL_PROCESS_ATTACH :
-			break;
-		case DLL_PROCESS_DETACH :
-			break;
-		case DLL_THREAD_ATTACH :
-		case DLL_THREAD_DETACH :
-			break;
-    }
-
-    return TRUE;
-}
-#endif /* OPJ_STATIC */
-#endif /* WIN32 */
-
-/* ---------------------------------------------------------------------- */
-
-
-const char* OPJ_CALLCONV opj_version() {
-    return OPENJPEG_VERSION;
-}
-
-opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format) {
-	opj_dinfo_t *dinfo = (opj_dinfo_t*)opj_malloc(sizeof(opj_dinfo_t));
-	if(!dinfo) return NULL;
-	dinfo->is_decompressor = true;
-	switch(format) {
-		case CODEC_J2K:
-		case CODEC_JPT:
-			/* get a J2K decoder handle */
-			dinfo->j2k_handle = (void*)j2k_create_decompress((opj_common_ptr)dinfo);
-			if(!dinfo->j2k_handle) {
-				opj_free(dinfo);
-				return NULL;
-			}
-			break;
-		case CODEC_JP2:
-			/* get a JP2 decoder handle */
-			dinfo->jp2_handle = (void*)jp2_create_decompress((opj_common_ptr)dinfo);
-			if(!dinfo->jp2_handle) {
-				opj_free(dinfo);
-				return NULL;
-			}
-			break;
-		case CODEC_UNKNOWN:
-		default:
-			opj_free(dinfo);
-			return NULL;
-	}
-
-	dinfo->codec_format = format;
-
-	return dinfo;
-}
-
-void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo) {
-	if(dinfo) {
-		/* destroy the codec */
-		switch(dinfo->codec_format) {
-			case CODEC_J2K:
-			case CODEC_JPT:
-				j2k_destroy_decompress((opj_j2k_t*)dinfo->j2k_handle);
-				break;
-			case CODEC_JP2:
-				jp2_destroy_decompress((opj_jp2_t*)dinfo->jp2_handle);
-				break;
-			case CODEC_UNKNOWN:
-			default:
-				break;
-		}
-		/* destroy the decompressor */
-		opj_free(dinfo);
-	}
-}
-
-void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters) {
-	if(parameters) {
-		memset(parameters, 0, sizeof(opj_dparameters_t));
-		/* default decoding parameters */
-		parameters->cp_layer = 0;
-		parameters->cp_reduce = 0;
-		parameters->cp_limit_decoding = NO_LIMITATION;
-
-		parameters->decod_format = -1;
-		parameters->cod_format = -1;
-/* UniPG>> */
-#ifdef USE_JPWL
-		parameters->jpwl_correct = false;
-		parameters->jpwl_exp_comps = JPWL_EXPECTED_COMPONENTS;
-		parameters->jpwl_max_tiles = JPWL_MAXIMUM_TILES;
-#endif /* USE_JPWL */
-/* <<UniPG */
-	}
-}
-
-void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters) {
-	if(dinfo && parameters) {
-		switch(dinfo->codec_format) {
-			case CODEC_J2K:
-			case CODEC_JPT:
-				j2k_setup_decoder((opj_j2k_t*)dinfo->j2k_handle, parameters);
-				break;
-			case CODEC_JP2:
-				jp2_setup_decoder((opj_jp2_t*)dinfo->jp2_handle, parameters);
-				break;
-			case CODEC_UNKNOWN:
-			default:
-				break;
-		}
-	}
-}
-
-opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio) {
-	if(dinfo && cio) {
-		switch(dinfo->codec_format) {
-			case CODEC_J2K:
-				return j2k_decode((opj_j2k_t*)dinfo->j2k_handle, cio);
-			case CODEC_JPT:
-				return j2k_decode_jpt_stream((opj_j2k_t*)dinfo->j2k_handle, cio);
-			case CODEC_JP2:
-				return jp2_decode((opj_jp2_t*)dinfo->jp2_handle, cio);
-			case CODEC_UNKNOWN:
-			default:
-				break;
-		}
-	}
-
-	return NULL;
-}
-
-opj_cinfo_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format) {
-	opj_cinfo_t *cinfo = (opj_cinfo_t*)opj_malloc(sizeof(opj_cinfo_t));
-	if(!cinfo) return NULL;
-	cinfo->is_decompressor = false;
-	switch(format) {
-		case CODEC_J2K:
-			/* get a J2K coder handle */
-			cinfo->j2k_handle = (void*)j2k_create_compress((opj_common_ptr)cinfo);
-			if(!cinfo->j2k_handle) {
-				opj_free(cinfo);
-				return NULL;
-			}
-			break;
-		case CODEC_JP2:
-			/* get a JP2 coder handle */
-			cinfo->jp2_handle = (void*)jp2_create_compress((opj_common_ptr)cinfo);
-			if(!cinfo->jp2_handle) {
-				opj_free(cinfo);
-				return NULL;
-			}
-			break;
-		case CODEC_JPT:
-		case CODEC_UNKNOWN:
-		default:
-			opj_free(cinfo);
-			return NULL;
-	}
-
-	cinfo->codec_format = format;
-
-	return cinfo;
-}
-
-void OPJ_CALLCONV opj_destroy_compress(opj_cinfo_t *cinfo) {
-	if(cinfo) {
-		/* destroy the codec */
-		switch(cinfo->codec_format) {
-			case CODEC_J2K:
-				j2k_destroy_decompress((opj_j2k_t*)cinfo->j2k_handle);
-				break;
-			case CODEC_JP2:
-				jp2_destroy_decompress((opj_jp2_t*)cinfo->jp2_handle);
-				break;
-			case CODEC_JPT:
-			case CODEC_UNKNOWN:
-			default:
-				break;
-		}
-		/* destroy the decompressor */
-		opj_free(cinfo);
-	}
-}
-
-void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters) {
-	if(parameters) {
-		memset(parameters, 0, sizeof(opj_cparameters_t));
-		/* default coding parameters */
-		parameters->cp_cinema = OFF;
-		parameters->max_comp_size = 0;
-		parameters->numresolution = 6;
-		parameters->cp_rsiz = STD_RSIZ;
-		parameters->cblockw_init = 64;
-		parameters->cblockh_init = 64;
-		parameters->prog_order = LRCP;
-		parameters->roi_compno = -1;		/* no ROI */
-		parameters->subsampling_dx = 1;
-		parameters->subsampling_dy = 1;
-		parameters->tp_on = 0;
-		parameters->decod_format = -1;
-		parameters->cod_format = -1;
-/* UniPG>> */
-#ifdef USE_JPWL
-		parameters->jpwl_epc_on = false;
-		parameters->jpwl_hprot_MH = -1; /* -1 means unassigned */
-		{
-			int i;
-			for (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {
-				parameters->jpwl_hprot_TPH_tileno[i] = -1; /* unassigned */
-				parameters->jpwl_hprot_TPH[i] = 0; /* absent */
-			}
-		};
-		{
-			int i;
-			for (i = 0; i < JPWL_MAX_NO_PACKSPECS; i++) {
-				parameters->jpwl_pprot_tileno[i] = -1; /* unassigned */
-				parameters->jpwl_pprot_packno[i] = -1; /* unassigned */
-				parameters->jpwl_pprot[i] = 0; /* absent */
-			}
-		};
-		parameters->jpwl_sens_size = 0; /* 0 means no ESD */
-		parameters->jpwl_sens_addr = 0; /* 0 means auto */
-		parameters->jpwl_sens_range = 0; /* 0 means packet */
-		parameters->jpwl_sens_MH = -1; /* -1 means unassigned */
-		{
-			int i;
-			for (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {
-				parameters->jpwl_sens_TPH_tileno[i] = -1; /* unassigned */
-				parameters->jpwl_sens_TPH[i] = -1; /* absent */
-			}
-		};
-#endif /* USE_JPWL */
-/* <<UniPG */
-	}
-}
-
-void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image) {
-	if(cinfo && parameters && image) {
-		switch(cinfo->codec_format) {
-			case CODEC_J2K:
-				j2k_setup_encoder((opj_j2k_t*)cinfo->j2k_handle, parameters, image);
-				break;
-			case CODEC_JP2:
-				jp2_setup_encoder((opj_jp2_t*)cinfo->jp2_handle, parameters, image);
-				break;
-			case CODEC_JPT:
-			case CODEC_UNKNOWN:
-			default:
-				break;
-		}
-	}
-}
-
-bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index) {
-	if(cinfo && cio && image) {
-		switch(cinfo->codec_format) {
-			case CODEC_J2K:
-				return j2k_encode((opj_j2k_t*)cinfo->j2k_handle, cio, image, index);
-			case CODEC_JP2:
-				return jp2_encode((opj_jp2_t*)cinfo->jp2_handle, cio, image, index);
-			case CODEC_JPT:
-			case CODEC_UNKNOWN:
-			default:
-				break;
-		}
-	}
-
-	return false;
-}
-
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/openjpeg.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/openjpeg.h
deleted file mode 100644
index e74c90e..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/openjpeg.h
+++ /dev/null
@@ -1,751 +0,0 @@
- /*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * Copyright (c) 2006-2007, Parvatha Elangovan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef OPENJPEG_H
-#define OPENJPEG_H
-
-#define OPENJPEG_VERSION "1.2.0"
-
-/*
-==========================================================
-   Compiler directives
-==========================================================
-*/
-
-#if defined(OPJ_STATIC) || !(defined(WIN32) || defined(__WIN32__))
-#define OPJ_API
-#define OPJ_CALLCONV
-#else
-#define OPJ_CALLCONV __stdcall
-/*
-The following ifdef block is the standard way of creating macros which make exporting
-from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
-symbol defined on the command line. this symbol should not be defined on any project
-that uses this DLL. This way any other project whose source files include this file see
-OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
-defined with this macro as being exported.
-*/
-#ifdef OPJ_EXPORTS
-#define OPJ_API __declspec(dllexport)
-#else
-#define OPJ_API __declspec(dllimport)
-#endif /* OPJ_EXPORTS */
-#endif /* !OPJ_STATIC || !WIN32 */
-
-#ifndef __cplusplus
-#if defined(HAVE_STDBOOL_H)
-/*
-The C language implementation does correctly provide the standard header
-file "stdbool.h".
- */
-#include <stdbool.h>
-#else
-/*
-The C language implementation does not provide the standard header file
-"stdbool.h" as required by ISO/IEC 9899:1999.  Try to compensate for this
-braindamage below.
-*/
-#if !defined(bool)
-#define	bool	int
-#endif
-#if !defined(true)
-#define true	1
-#endif
-#if !defined(false)
-#define	false	0
-#endif
-#endif
-#endif /* __cplusplus */
-
-/*
-==========================================================
-   Useful constant definitions
-==========================================================
-*/
-
-#define OPJ_PATH_LEN 4096 /**< Maximum allowed size for filenames */
-
-#define J2K_MAXRLVLS 33					/**< Number of maximum resolution level authorized */
-#define J2K_MAXBANDS (3*J2K_MAXRLVLS-2)	/**< Number of maximum sub-band linked to number of resolution level */
-
-/* UniPG>> */
-#define JPWL_MAX_NO_TILESPECS	16 /**< Maximum number of tile parts expected by JPWL: increase at your will */
-#define JPWL_MAX_NO_PACKSPECS	16 /**< Maximum number of packet parts expected by JPWL: increase at your will */
-#define JPWL_MAX_NO_MARKERS	512 /**< Maximum number of JPWL markers: increase at your will */
-#define JPWL_PRIVATEINDEX_NAME "jpwl_index_privatefilename" /**< index file name used when JPWL is on */
-#define JPWL_EXPECTED_COMPONENTS 3 /**< Expect this number of components, so you'll find better the first EPB */
-#define JPWL_MAXIMUM_TILES 8192 /**< Expect this maximum number of tiles, to avoid some crashes */
-#define JPWL_MAXIMUM_HAMMING 2 /**< Expect this maximum number of bit errors in marker id's */
-/* <<UniPG */
-
-/*
-==========================================================
-   enum definitions
-==========================================================
-*/
-/**
-Rsiz Capabilities
-*/
-typedef enum RSIZ_CAPABILITIES {
-	STD_RSIZ = 0,		/** Standard JPEG2000 profile*/
-	CINEMA2K = 3,		/** Profile name for a 2K image*/
-	CINEMA4K = 4		/** Profile name for a 4K image*/
-} OPJ_RSIZ_CAPABILITIES;
-
-/**
-Digital cinema operation mode
-*/
-typedef enum CINEMA_MODE {
-	OFF = 0,					/** Not Digital Cinema*/
-	CINEMA2K_24 = 1,	/** 2K Digital Cinema at 24 fps*/
-	CINEMA2K_48 = 2,	/** 2K Digital Cinema at 48 fps*/
-	CINEMA4K_24 = 3		/** 4K Digital Cinema at 24 fps*/
-}OPJ_CINEMA_MODE;
-
-/**
-Progression order
-*/
-typedef enum PROG_ORDER {
-	PROG_UNKNOWN = -1,	/**< place-holder */
-	LRCP = 0,		/**< layer-resolution-component-precinct order */
-	RLCP = 1,		/**< resolution-layer-component-precinct order */
-	RPCL = 2,		/**< resolution-precinct-component-layer order */
-	PCRL = 3,		/**< precinct-component-resolution-layer order */
-	CPRL = 4		/**< component-precinct-resolution-layer order */
-} OPJ_PROG_ORDER;
-
-/**
-Supported image color spaces
-*/
-typedef enum COLOR_SPACE {
-	CLRSPC_UNKNOWN = -1,	/**< place-holder */
-	CLRSPC_SRGB = 1,		/**< sRGB */
-	CLRSPC_GRAY = 2,		/**< grayscale */
-	CLRSPC_SYCC = 3			/**< YUV */
-} OPJ_COLOR_SPACE;
-
-/**
-Supported codec
-*/
-typedef enum CODEC_FORMAT {
-	CODEC_UNKNOWN = -1,	/**< place-holder */
-	CODEC_J2K = 0,		/**< JPEG-2000 codestream : read/write */
-	CODEC_JPT = 1,		/**< JPT-stream (JPEG 2000, JPIP) : read only */
-	CODEC_JP2 = 2		/**< JPEG-2000 file format : read/write */
-} OPJ_CODEC_FORMAT;
-
-/**
-Limit decoding to certain portions of the codestream.
-*/
-typedef enum LIMIT_DECODING {
-	NO_LIMITATION = 0,				  /**< No limitation for the decoding. The entire codestream will de decoded */
-	LIMIT_TO_MAIN_HEADER = 1,		/**< The decoding is limited to the Main Header */
-	DECODE_ALL_BUT_PACKETS = 2	/**< Decode everything except the JPEG 2000 packets */
-} OPJ_LIMIT_DECODING;
-
-/*
-==========================================================
-   event manager typedef definitions
-==========================================================
-*/
-
-/**
-Callback function prototype for events
-@param msg Event message
-@param client_data
-*/
-typedef void (*opj_msg_callback) (const char *msg, void *client_data);
-
-/**
-Message handler object
-used for
-<ul>
-<li>Error messages
-<li>Warning messages
-<li>Debugging messages
-</ul>
-*/
-typedef struct opj_event_mgr {
-	/** Error message callback if available, NULL otherwise */
-	opj_msg_callback error_handler;
-	/** Warning message callback if available, NULL otherwise */
-	opj_msg_callback warning_handler;
-	/** Debug message callback if available, NULL otherwise */
-	opj_msg_callback info_handler;
-} opj_event_mgr_t;
-
-
-/*
-==========================================================
-   codec typedef definitions
-==========================================================
-*/
-
-/**
-Progression order changes
-*/
-typedef struct opj_poc {
-	/** Resolution num start, Component num start, given by POC */
-	int resno0, compno0;
-	/** Layer num end,Resolution num end, Component num end, given by POC */
-	int layno1, resno1, compno1;
-	/** Layer num start,Precinct num start, Precinct num end */
-	int layno0, precno0, precno1;
-	/** Progression order enum*/
-	OPJ_PROG_ORDER prg1,prg;
-	/** Progression order string*/
-	char progorder[5];
-	/** Tile number */
-	int tile;
-	/** Start and end values for Tile width and height*/
-	int tx0,tx1,ty0,ty1;
-	/** Start value, initialised in pi_initialise_encode*/
-	int layS, resS, compS, prcS;
-	/** End value, initialised in pi_initialise_encode */
-	int layE, resE, compE, prcE;
-	/** Start and end values of Tile width and height, initialised in pi_initialise_encode*/
-	int txS,txE,tyS,tyE,dx,dy;
-	/** Temporary values for Tile parts, initialised in pi_create_encode */
-	int lay_t, res_t, comp_t, prc_t,tx0_t,ty0_t;
-} opj_poc_t;
-
-/**
-Compression parameters
-*/
-typedef struct opj_cparameters {
-	/** size of tile: tile_size_on = false (not in argument) or = true (in argument) */
-	bool tile_size_on;
-	/** XTOsiz */
-	int cp_tx0;
-	/** YTOsiz */
-	int cp_ty0;
-	/** XTsiz */
-	int cp_tdx;
-	/** YTsiz */
-	int cp_tdy;
-	/** allocation by rate/distortion */
-	int cp_disto_alloc;
-	/** allocation by fixed layer */
-	int cp_fixed_alloc;
-	/** add fixed_quality */
-	int cp_fixed_quality;
-	/** fixed layer */
-	int *cp_matrice;
-	/** comment for coding */
-	char *cp_comment;
-	/** csty : coding style */
-	int csty;
-	/** progression order (default LRCP) */
-	OPJ_PROG_ORDER prog_order;
-	/** progression order changes */
-	opj_poc_t POC[32];
-	/** number of progression order changes (POC), default to 0 */
-	int numpocs;
-	/** number of layers */
-	int tcp_numlayers;
-	/** rates of layers */
-	float tcp_rates[100];
-	/** different psnr for successive layers */
-	float tcp_distoratio[100];
-	/** number of resolutions */
-	int numresolution;
-	/** initial code block width, default to 64 */
- 	int cblockw_init;
-	/** initial code block height, default to 64 */
-	int cblockh_init;
-	/** mode switch (cblk_style) */
-	int mode;
-	/** 1 : use the irreversible DWT 9-7, 0 : use lossless compression (default) */
-	int irreversible;
-	/** region of interest: affected component in [0..3], -1 means no ROI */
-	int roi_compno;
-	/** region of interest: upshift value */
-	int roi_shift;
-	/* number of precinct size specifications */
-	int res_spec;
-	/** initial precinct width */
-	int prcw_init[J2K_MAXRLVLS];
-	/** initial precinct height */
-	int prch_init[J2K_MAXRLVLS];
-
-	/**@name command line encoder parameters (not used inside the library) */
-	/*@{*/
-	/** input file name */
-	char infile[OPJ_PATH_LEN];
-	/** output file name */
-	char outfile[OPJ_PATH_LEN];
-	/** creation of an index file, default to 0 (false) */
-	int index_on;
-	/** index file name */
-	char index[OPJ_PATH_LEN];
-	/** subimage encoding: origin image offset in x direction */
-	int image_offset_x0;
-	/** subimage encoding: origin image offset in y direction */
-	int image_offset_y0;
-	/** subsampling value for dx */
-	int subsampling_dx;
-	/** subsampling value for dy */
-	int subsampling_dy;
-	/** input file format 0: PGX, 1: PxM, 2: BMP 3:TIF*/
-	int decod_format;
-	/** output file format 0: J2K, 1: JP2, 2: JPT */
-	int cod_format;
-	/*@}*/
-
-/* UniPG>> */
-	/**@name JPWL encoding parameters */
-	/*@{*/
-	/** enables writing of EPC in MH, thus activating JPWL */
-	bool jpwl_epc_on;
-	/** error protection method for MH (0,1,16,32,37-128) */
-	int jpwl_hprot_MH;
-	/** tile number of header protection specification (>=0) */
-	int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];
-	/** error protection methods for TPHs (0,1,16,32,37-128) */
-	int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS];
-	/** tile number of packet protection specification (>=0) */
-	int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS];
-	/** packet number of packet protection specification (>=0) */
-	int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS];
-	/** error protection methods for packets (0,1,16,32,37-128) */
-	int jpwl_pprot[JPWL_MAX_NO_PACKSPECS];
-	/** enables writing of ESD, (0=no/1/2 bytes) */
-	int jpwl_sens_size;
-	/** sensitivity addressing size (0=auto/2/4 bytes) */
-	int jpwl_sens_addr;
-	/** sensitivity range (0-3) */
-	int jpwl_sens_range;
-	/** sensitivity method for MH (-1=no,0-7) */
-	int jpwl_sens_MH;
-	/** tile number of sensitivity specification (>=0) */
-	int jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];
-	/** sensitivity methods for TPHs (-1=no,0-7) */
-	int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];
-	/*@}*/
-/* <<UniPG */
-
-	/** Digital Cinema compliance 0-not compliant, 1-compliant*/
-	OPJ_CINEMA_MODE cp_cinema;
-	/** Maximum rate for each component. If == 0, component size limitation is not considered */
-	int max_comp_size;
-	/** Profile name*/
-	OPJ_RSIZ_CAPABILITIES cp_rsiz;
-	/** Tile part generation*/
-	char tp_on;
-	/** Flag for Tile part generation*/
-	char tp_flag;
-	/** MCT (multiple component transform) */
-	char tcp_mct;
-} opj_cparameters_t;
-
-/**
-Decompression parameters
-*/
-typedef struct opj_dparameters {
-	/**
-	Set the number of highest resolution levels to be discarded.
-	The image resolution is effectively divided by 2 to the power of the number of discarded levels.
-	The reduce factor is limited by the smallest total number of decomposition levels among tiles.
-	if != 0, then original dimension divided by 2^(reduce);
-	if == 0 or not used, image is decoded to the full resolution
-	*/
-	int cp_reduce;
-	/**
-	Set the maximum number of quality layers to decode.
-	If there are less quality layers than the specified number, all the quality layers are decoded.
-	if != 0, then only the first "layer" layers are decoded;
-	if == 0 or not used, all the quality layers are decoded
-	*/
-	int cp_layer;
-
-	/**@name command line encoder parameters (not used inside the library) */
-	/*@{*/
-	/** input file name */
-	char infile[OPJ_PATH_LEN];
-	/** output file name */
-	char outfile[OPJ_PATH_LEN];
-	/** input file format 0: J2K, 1: JP2, 2: JPT */
-	int decod_format;
-	/** output file format 0: PGX, 1: PxM, 2: BMP */
-	int cod_format;
-	/*@}*/
-
-/* UniPG>> */
-	/**@name JPWL decoding parameters */
-	/*@{*/
-	/** activates the JPWL correction capabilities */
-	bool jpwl_correct;
-	/** expected number of components */
-	int jpwl_exp_comps;
-	/** maximum number of tiles */
-	int jpwl_max_tiles;
-	/*@}*/
-/* <<UniPG */
-
-	/**
-	Specify whether the decoding should be done on the entire codestream, or be limited to the main header
-	Limiting the decoding to the main header makes it possible to extract the characteristics of the codestream
-	if == NO_LIMITATION, the entire codestream is decoded;
-	if == LIMIT_TO_MAIN_HEADER, only the main header is decoded;
-	*/
-	OPJ_LIMIT_DECODING cp_limit_decoding;
-
-} opj_dparameters_t;
-
-/** Common fields between JPEG-2000 compression and decompression master structs. */
-
-#define opj_common_fields \
-	opj_event_mgr_t *event_mgr;	/**< pointer to the event manager */\
-	void * client_data;			/**< Available for use by application */\
-	bool is_decompressor;		/**< So common code can tell which is which */\
-	OPJ_CODEC_FORMAT codec_format;	/**< selected codec */\
-	void *j2k_handle;			/**< pointer to the J2K codec */\
-	void *jp2_handle;			/**< pointer to the JP2 codec */\
-	void *mj2_handle			/**< pointer to the MJ2 codec */
-
-/* Routines that are to be used by both halves of the library are declared
- * to receive a pointer to this structure.  There are no actual instances of
- * opj_common_struct_t, only of opj_cinfo_t and opj_dinfo_t.
- */
-typedef struct opj_common_struct {
-  opj_common_fields;		/* Fields common to both master struct types */
-  /* Additional fields follow in an actual opj_cinfo_t or
-   * opj_dinfo_t.  All three structs must agree on these
-   * initial fields!  (This would be a lot cleaner in C++.)
-   */
-} opj_common_struct_t;
-
-typedef opj_common_struct_t * opj_common_ptr;
-
-/**
-Compression context info
-*/
-typedef struct opj_cinfo {
-	/** Fields shared with opj_dinfo_t */
-	opj_common_fields;
-	/* other specific fields go here */
-} opj_cinfo_t;
-
-/**
-Decompression context info
-*/
-typedef struct opj_dinfo {
-	/** Fields shared with opj_cinfo_t */
-	opj_common_fields;
-	/* other specific fields go here */
-} opj_dinfo_t;
-
-/*
-==========================================================
-   I/O stream typedef definitions
-==========================================================
-*/
-
-/*
- * Stream open flags.
- */
-/** The stream was opened for reading. */
-#define OPJ_STREAM_READ	0x0001
-/** The stream was opened for writing. */
-#define OPJ_STREAM_WRITE 0x0002
-
-/**
-Byte input-output stream (CIO)
-*/
-typedef struct opj_cio {
-	/** codec context */
-	opj_common_ptr cinfo;
-
-	/** open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE */
-	int openmode;
-	/** pointer to the start of the buffer */
-	unsigned char *buffer;
-	/** buffer size in bytes */
-	int length;
-
-	/** pointer to the start of the stream */
-	unsigned char *start;
-	/** pointer to the end of the stream */
-	unsigned char *end;
-	/** pointer to the current position */
-	unsigned char *bp;
-} opj_cio_t;
-
-/*
-==========================================================
-   image typedef definitions
-==========================================================
-*/
-
-/**
-Defines a single image component
-*/
-typedef struct opj_image_comp {
-	/** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */
-	int dx;
-	/** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */
-	int dy;
-	/** data width */
-	int w;
-	/** data height */
-	int h;
-	/** x component offset compared to the whole image */
-	int x0;
-	/** y component offset compared to the whole image */
-	int y0;
-	/** precision */
-	int prec;
-	/** image depth in bits */
-	int bpp;
-	/** signed (1) / unsigned (0) */
-	int sgnd;
-	/** number of decoded resolution */
-	int resno_decoded;
-	/** number of division by 2 of the out image compared to the original size of image */
-	int factor;
-	/** image component data */
-	int *data;
-} opj_image_comp_t;
-
-/**
-Defines image data and characteristics
-*/
-typedef struct opj_image {
-	/** XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area */
-	int x0;
-	/** YOsiz: vertical offset from the origin of the reference grid to the top side of the image area */
-	int y0;
-	/** Xsiz: width of the reference grid */
-	int x1;
-	/** Ysiz: height of the reference grid */
-	int y1;
-	/** number of components in the image */
-	int numcomps;
-	/** color space: sRGB, Greyscale or YUV */
-	OPJ_COLOR_SPACE color_space;
-	/** image components */
-	opj_image_comp_t *comps;
-} opj_image_t;
-
-/**
-Component parameters structure used by the opj_image_create function
-*/
-typedef struct opj_image_comptparm {
-	/** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */
-	int dx;
-	/** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */
-	int dy;
-	/** data width */
-	int w;
-	/** data height */
-	int h;
-	/** x component offset compared to the whole image */
-	int x0;
-	/** y component offset compared to the whole image */
-	int y0;
-	/** precision */
-	int prec;
-	/** image depth in bits */
-	int bpp;
-	/** signed (1) / unsigned (0) */
-	int sgnd;
-} opj_image_cmptparm_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
-==========================================================
-   openjpeg version
-==========================================================
-*/
-
-OPJ_API const char * OPJ_CALLCONV opj_version();
-
-/*
-==========================================================
-   image functions definitions
-==========================================================
-*/
-
-/**
-Create an image
-@param numcmpts number of components
-@param cmptparms components parameters
-@param clrspc image color space
-@return returns a new image structure if successful, returns NULL otherwise
-*/
-OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(int numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
-
-/**
-Deallocate any resources associated with an image
-@param image image to be destroyed
-*/
-OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);
-
-/*
-==========================================================
-   stream functions definitions
-==========================================================
-*/
-
-/**
-Open and allocate a memory stream for read / write.
-On reading, the user must provide a buffer containing encoded data. The buffer will be
-wrapped by the returned CIO handle.
-On writing, buffer parameters must be set to 0: a buffer will be allocated by the library
-to contain encoded data.
-@param cinfo Codec context info
-@param buffer Reading: buffer address. Writing: NULL
-@param length Reading: buffer length. Writing: 0
-@return Returns a CIO handle if successful, returns NULL otherwise
-*/
-OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
-
-/**
-Close and free a CIO handle
-@param cio CIO handle to free
-*/
-OPJ_API void OPJ_CALLCONV opj_cio_close(opj_cio_t *cio);
-
-/**
-Get position in byte stream
-@param cio CIO handle
-@return Returns the position in bytes
-*/
-OPJ_API int OPJ_CALLCONV cio_tell(opj_cio_t *cio);
-/**
-Set position in byte stream
-@param cio CIO handle
-@param pos Position, in number of bytes, from the beginning of the stream
-*/
-OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
-
-/*
-==========================================================
-   event manager functions definitions
-==========================================================
-*/
-
-OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context);
-
-/*
-==========================================================
-   codec functions definitions
-==========================================================
-*/
-/**
-Creates a J2K/JPT/JP2 decompression structure
-@param format Decoder to select
-@return Returns a handle to a decompressor if successful, returns NULL otherwise
-*/
-OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
-/**
-Destroy a decompressor handle
-@param dinfo decompressor handle to destroy
-*/
-OPJ_API void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo);
-/**
-Set decoding parameters to default values
-@param parameters Decompression parameters
-*/
-OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
-/**
-Setup the decoder decoding parameters using user parameters.
-Decoding parameters are returned in j2k->cp.
-@param dinfo decompressor handle
-@param parameters decompression parameters
-*/
-OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
-/**
-Decode an image from a JPEG-2000 codestream
-@param dinfo decompressor handle
-@param cio Input buffer stream
-@return Returns a decoded image if successful, returns NULL otherwise
-*/
-OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio);
-/**
-Creates a J2K/JP2 compression structure
-@param format Coder to select
-@return Returns a handle to a compressor if successful, returns NULL otherwise
-*/
-OPJ_API opj_cinfo_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format);
-/**
-Destroy a compressor handle
-@param cinfo compressor handle to destroy
-*/
-OPJ_API void OPJ_CALLCONV opj_destroy_compress(opj_cinfo_t *cinfo);
-/**
-Set encoding parameters to default values, that means :
-<ul>
-<li>Lossless
-<li>1 tile
-<li>Size of precinct : 2^15 x 2^15 (means 1 precinct)
-<li>Size of code-block : 64 x 64
-<li>Number of resolutions: 6
-<li>No SOP marker in the codestream
-<li>No EPH marker in the codestream
-<li>No sub-sampling in x or y direction
-<li>No mode switch activated
-<li>Progression order: LRCP
-<li>No index file
-<li>No ROI upshifted
-<li>No offset of the origin of the image
-<li>No offset of the origin of the tiles
-<li>Reversible DWT 5-3
-</ul>
-@param parameters Compression parameters
-*/
-OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
-/**
-Setup the encoder parameters using the current image and using user parameters.
-@param cinfo compressor handle
-@param parameters compression parameters
-@param image input filled image
-*/
-OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image);
-/**
-Encode an image into a JPEG-2000 codestream
-@param cinfo compressor handle
-@param cio Output buffer stream
-@param image Image to encode
-@param index Name of the index file if required, NULL otherwise
-@return Returns true if successful, returns false otherwise
-*/
-OPJ_API bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* OPENJPEG_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/opj_includes.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/opj_includes.h
deleted file mode 100644
index efc7515..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/opj_includes.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2005, Hervé Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef OPJ_INCLUDES_H
-#define OPJ_INCLUDES_H
-
-/*
- ==========================================================
-   Standard includes used by the library
- ==========================================================
-*/
-#include <memory.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <float.h>
-#include <time.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <ctype.h>
-
-/*
-inttypes.h is part of C99 which MSVC doesn't properly support
-*/
-#ifndef _MSC_VER
-#include <inttypes.h>
-#endif
-
-/*
- ==========================================================
-   OpenJPEG interface
- ==========================================================
- */
-#include "openjpeg.h"
-
-/*
- ==========================================================
-   OpenJPEG modules
- ==========================================================
-*/
-
-/*
-The inline keyword is supported by C99 but not by C90.
-Most compilers implement their own version of this keyword ...
-*/
-#ifndef INLINE
-	#if defined(_MSC_VER)
-		#define INLINE __inline
-	#elif defined(__GNUC__)
-		#define INLINE __inline__
-	#elif defined(__MWERKS__)
-		#define INLINE inline
-	#else
-		/* add other compilers here ... */
-		#define INLINE
-	#endif /* defined(<Compiler>) */
-#endif /* INLINE */
-
-#include "j2k_lib.h"
-#include "event.h"
-#include "cio.h"
-
-#include "image.h"
-#include "j2k.h"
-#include "jp2.h"
-#include "jpt.h"
-
-#include "mqc.h"
-#include "raw.h"
-#include "bio.h"
-#include "tgt.h"
-#include "pi.h"
-#include "tcd.h"
-#include "t1.h"
-#include "dwt.h"
-#include "t2.h"
-#include "mct.h"
-#include "int.h"
-#include "fix.h"
-
-/* JPWL>> */
-#ifdef USE_JPWL
-#include "../jpwl/jpwl.h"
-#endif /* USE_JPWL */
-/* <<JPWL */
-
-#endif /* OPJ_INCLUDES_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/pi.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/pi.c
deleted file mode 100644
index a012f51..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/pi.c
+++ /dev/null
@@ -1,1078 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * Copyright (c) 2006-2007, Parvatha Elangovan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/** @defgroup PI PI - Implementation of a packet iterator */
-/*@{*/
-
-/** @name Local static functions */
-/*@{*/
-
-/**
-Get next packet in layer-resolution-component-precinct order.
-@param pi packet iterator to modify
-@return returns false if pi pointed to the last packet or else returns true
-*/
-static bool pi_next_lrcp(opj_pi_iterator_t * pi);
-/**
-Get next packet in resolution-layer-component-precinct order.
-@param pi packet iterator to modify
-@return returns false if pi pointed to the last packet or else returns true
-*/
-static bool pi_next_rlcp(opj_pi_iterator_t * pi);
-/**
-Get next packet in resolution-precinct-component-layer order.
-@param pi packet iterator to modify
-@return returns false if pi pointed to the last packet or else returns true
-*/
-static bool pi_next_rpcl(opj_pi_iterator_t * pi);
-/**
-Get next packet in precinct-component-resolution-layer order.
-@param pi packet iterator to modify
-@return returns false if pi pointed to the last packet or else returns true
-*/
-static bool pi_next_pcrl(opj_pi_iterator_t * pi);
-/**
-Get next packet in component-precinct-resolution-layer order.
-@param pi packet iterator to modify
-@return returns false if pi pointed to the last packet or else returns true
-*/
-static bool pi_next_cprl(opj_pi_iterator_t * pi);
-
-/*@}*/
-
-/*@}*/
-
-/*
-==========================================================
-   local functions
-==========================================================
-*/
-
-static bool pi_next_lrcp(opj_pi_iterator_t * pi) {
-	opj_pi_comp_t *comp = NULL;
-	opj_pi_resolution_t *res = NULL;
-	long index = 0;
-
-	if (!pi->first) {
-		comp = &pi->comps[pi->compno];
-		res = &comp->resolutions[pi->resno];
-		goto LABEL_SKIP;
-	} else {
-		pi->first = 0;
-	}
-
-	for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
-		for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1;
-		pi->resno++) {
-			for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
-				comp = &pi->comps[pi->compno];
-				if (pi->resno >= comp->numresolutions) {
-					continue;
-				}
-				res = &comp->resolutions[pi->resno];
-				if (!pi->tp_on){
-					pi->poc.precno1 = res->pw * res->ph;
-				}
-				for (pi->precno = pi->poc.precno0; pi->precno < pi->poc.precno1; pi->precno++) {
-					index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
-					if (!pi->include[index]) {
-						pi->include[index] = 1;
-						return true;
-					}
-LABEL_SKIP:;
-				}
-			}
-		}
-	}
-
-	return false;
-}
-
-static bool pi_next_rlcp(opj_pi_iterator_t * pi) {
-	opj_pi_comp_t *comp = NULL;
-	opj_pi_resolution_t *res = NULL;
-	long index = 0;
-
-	if (!pi->first) {
-		comp = &pi->comps[pi->compno];
-		res = &comp->resolutions[pi->resno];
-		goto LABEL_SKIP;
-	} else {
-		pi->first = 0;
-	}
-
-	for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1; pi->resno++) {
-		for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
-			for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
-				comp = &pi->comps[pi->compno];
-				if (pi->resno >= comp->numresolutions) {
-					continue;
-				}
-				res = &comp->resolutions[pi->resno];
-				if(!pi->tp_on){
-					pi->poc.precno1 = res->pw * res->ph;
-				}
-				for (pi->precno = pi->poc.precno0; pi->precno < pi->poc.precno1; pi->precno++) {
-					index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
-					if (!pi->include[index]) {
-						pi->include[index] = 1;
-						return true;
-					}
-LABEL_SKIP:;
-				}
-			}
-		}
-	}
-
-	return false;
-}
-
-static bool pi_next_rpcl(opj_pi_iterator_t * pi) {
-	opj_pi_comp_t *comp = NULL;
-	opj_pi_resolution_t *res = NULL;
-	long index = 0;
-
-	if (!pi->first) {
-		goto LABEL_SKIP;
-	} else {
-		int compno, resno;
-		pi->first = 0;
-		pi->dx = 0;
-		pi->dy = 0;
-		for (compno = 0; compno < pi->numcomps; compno++) {
-			comp = &pi->comps[compno];
-			for (resno = 0; resno < comp->numresolutions; resno++) {
-				int dx, dy;
-				res = &comp->resolutions[resno];
-				dx = comp->dx * (1 << (res->pdx + comp->numresolutions - 1 - resno));
-				dy = comp->dy * (1 << (res->pdy + comp->numresolutions - 1 - resno));
-				pi->dx = !pi->dx ? dx : int_min(pi->dx, dx);
-				pi->dy = !pi->dy ? dy : int_min(pi->dy, dy);
-			}
-		}
-	}
-if (!pi->tp_on){
-			pi->poc.ty0 = pi->ty0;
-			pi->poc.tx0 = pi->tx0;
-			pi->poc.ty1 = pi->ty1;
-			pi->poc.tx1 = pi->tx1;
-		}
-	for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1; pi->resno++) {
-		for (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += pi->dy - (pi->y % pi->dy)) {
-			for (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += pi->dx - (pi->x % pi->dx)) {
-				for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
-					int levelno;
-					int trx0, try0;
-					int trx1, try1;
-					int rpx, rpy;
-					int prci, prcj;
-					comp = &pi->comps[pi->compno];
-					if (pi->resno >= comp->numresolutions) {
-						continue;
-					}
-					res = &comp->resolutions[pi->resno];
-					levelno = comp->numresolutions - 1 - pi->resno;
-					trx0 = int_ceildiv(pi->tx0, comp->dx << levelno);
-					try0 = int_ceildiv(pi->ty0, comp->dy << levelno);
-					trx1 = int_ceildiv(pi->tx1, comp->dx << levelno);
-					try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
-					rpx = res->pdx + levelno;
-					rpy = res->pdy + levelno;
-					if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
-						continue;
-					}
-					if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
-						continue;
-					}
-
-					if ((res->pw==0)||(res->pw==0)) continue;
-
-					if ((trx0==trx1)||(try0==try1)) continue;
-
-					prci = int_floordivpow2(int_ceildiv(pi->x, comp->dx << levelno), res->pdx)
-						 - int_floordivpow2(trx0, res->pdx);
-					prcj = int_floordivpow2(int_ceildiv(pi->y, comp->dy << levelno), res->pdy)
-						 - int_floordivpow2(try0, res->pdy);
-					pi->precno = prci + prcj * res->pw;
-					for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
-						index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
-						if (!pi->include[index]) {
-							pi->include[index] = 1;
-							return true;
-						}
-LABEL_SKIP:;
-					}
-				}
-			}
-		}
-	}
-
-	return false;
-}
-
-static bool pi_next_pcrl(opj_pi_iterator_t * pi) {
-	opj_pi_comp_t *comp = NULL;
-	opj_pi_resolution_t *res = NULL;
-	long index = 0;
-
-	if (!pi->first) {
-		comp = &pi->comps[pi->compno];
-		goto LABEL_SKIP;
-	} else {
-		int compno, resno;
-		pi->first = 0;
-		pi->dx = 0;
-		pi->dy = 0;
-		for (compno = 0; compno < pi->numcomps; compno++) {
-			comp = &pi->comps[compno];
-			for (resno = 0; resno < comp->numresolutions; resno++) {
-				int dx, dy;
-				res = &comp->resolutions[resno];
-				dx = comp->dx * (1 << (res->pdx + comp->numresolutions - 1 - resno));
-				dy = comp->dy * (1 << (res->pdy + comp->numresolutions - 1 - resno));
-				pi->dx = !pi->dx ? dx : int_min(pi->dx, dx);
-				pi->dy = !pi->dy ? dy : int_min(pi->dy, dy);
-			}
-		}
-	}
-	if (!pi->tp_on){
-			pi->poc.ty0 = pi->ty0;
-			pi->poc.tx0 = pi->tx0;
-			pi->poc.ty1 = pi->ty1;
-			pi->poc.tx1 = pi->tx1;
-		}
-	for (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += pi->dy - (pi->y % pi->dy)) {
-		for (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += pi->dx - (pi->x % pi->dx)) {
-			for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
-				comp = &pi->comps[pi->compno];
-				for (pi->resno = pi->poc.resno0; pi->resno < int_min(pi->poc.resno1, comp->numresolutions); pi->resno++) {
-					int levelno;
-					int trx0, try0;
-					int trx1, try1;
-					int rpx, rpy;
-					int prci, prcj;
-					res = &comp->resolutions[pi->resno];
-					levelno = comp->numresolutions - 1 - pi->resno;
-					trx0 = int_ceildiv(pi->tx0, comp->dx << levelno);
-					try0 = int_ceildiv(pi->ty0, comp->dy << levelno);
-					trx1 = int_ceildiv(pi->tx1, comp->dx << levelno);
-					try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
-					rpx = res->pdx + levelno;
-					rpy = res->pdy + levelno;
-					if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
-						continue;
-					}
-					if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
-						continue;
-					}
-
-					if ((res->pw==0)||(res->pw==0)) continue;
-
-					if ((trx0==trx1)||(try0==try1)) continue;
-
-					prci = int_floordivpow2(int_ceildiv(pi->x, comp->dx << levelno), res->pdx)
-						 - int_floordivpow2(trx0, res->pdx);
-					prcj = int_floordivpow2(int_ceildiv(pi->y, comp->dy << levelno), res->pdy)
-						 - int_floordivpow2(try0, res->pdy);
-					pi->precno = prci + prcj * res->pw;
-					for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
-						index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
-						if (!pi->include[index]) {
-							pi->include[index] = 1;
-							return true;
-						}
-LABEL_SKIP:;
-					}
-				}
-			}
-		}
-	}
-
-	return false;
-}
-
-static bool pi_next_cprl(opj_pi_iterator_t * pi) {
-	opj_pi_comp_t *comp = NULL;
-	opj_pi_resolution_t *res = NULL;
-	long index = 0;
-
-	if (!pi->first) {
-		comp = &pi->comps[pi->compno];
-		goto LABEL_SKIP;
-	} else {
-		pi->first = 0;
-	}
-
-	for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
-		int resno;
-		comp = &pi->comps[pi->compno];
-		pi->dx = 0;
-		pi->dy = 0;
-		for (resno = 0; resno < comp->numresolutions; resno++) {
-			int dx, dy;
-			res = &comp->resolutions[resno];
-			dx = comp->dx * (1 << (res->pdx + comp->numresolutions - 1 - resno));
-			dy = comp->dy * (1 << (res->pdy + comp->numresolutions - 1 - resno));
-			pi->dx = !pi->dx ? dx : int_min(pi->dx, dx);
-			pi->dy = !pi->dy ? dy : int_min(pi->dy, dy);
-		}
-		if (!pi->tp_on){
-			pi->poc.ty0 = pi->ty0;
-			pi->poc.tx0 = pi->tx0;
-			pi->poc.ty1 = pi->ty1;
-			pi->poc.tx1 = pi->tx1;
-		}
-		for (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += pi->dy - (pi->y % pi->dy)) {
-			for (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += pi->dx - (pi->x % pi->dx)) {
-				for (pi->resno = pi->poc.resno0; pi->resno < int_min(pi->poc.resno1, comp->numresolutions); pi->resno++) {
-					int levelno;
-					int trx0, try0;
-					int trx1, try1;
-					int rpx, rpy;
-					int prci, prcj;
-					res = &comp->resolutions[pi->resno];
-					levelno = comp->numresolutions - 1 - pi->resno;
-					trx0 = int_ceildiv(pi->tx0, comp->dx << levelno);
-					try0 = int_ceildiv(pi->ty0, comp->dy << levelno);
-					trx1 = int_ceildiv(pi->tx1, comp->dx << levelno);
-					try1 = int_ceildiv(pi->ty1, comp->dy << levelno);
-					rpx = res->pdx + levelno;
-					rpy = res->pdy + levelno;
-					if (!((pi->y % (comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpx))))){
-						continue;
-					}
-					if (!((pi->x % (comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
-						continue;
-					}
-
-					if ((res->pw==0)||(res->pw==0)) continue;
-
-					if ((trx0==trx1)||(try0==try1)) continue;
-
-					prci = int_floordivpow2(int_ceildiv(pi->x, comp->dx << levelno), res->pdx)
-						 - int_floordivpow2(trx0, res->pdx);
-					prcj = int_floordivpow2(int_ceildiv(pi->y, comp->dy << levelno), res->pdy)
-						 - int_floordivpow2(try0, res->pdy);
-					pi->precno = prci + prcj * res->pw;
-					for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
-						index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
-						if (!pi->include[index]) {
-							pi->include[index] = 1;
-							return true;
-						}
-LABEL_SKIP:;
-					}
-				}
-			}
-		}
-	}
-
-	return false;
-}
-
-/*
-==========================================================
-   Packet iterator interface
-==========================================================
-*/
-
-opj_pi_iterator_t *pi_create_decode(opj_image_t *image, opj_cp_t *cp, int tileno) {
-	int p, q;
-	int compno, resno, pino;
-	opj_pi_iterator_t *pi = NULL;
-	opj_tcp_t *tcp = NULL;
-	opj_tccp_t *tccp = NULL;
-	size_t array_size;
-
-	tcp = &cp->tcps[tileno];
-
-	array_size = (tcp->numpocs + 1) * sizeof(opj_pi_iterator_t);
-	pi = (opj_pi_iterator_t *) opj_malloc(array_size);
-	if(!pi) {
-		/* TODO: throw an error */
-		return NULL;
-	}
-
-	for (pino = 0; pino < tcp->numpocs + 1; pino++) {	/* change */
-		int maxres = 0;
-		int maxprec = 0;
-		p = tileno % cp->tw;
-		q = tileno / cp->tw;
-
-		pi[pino].tx0 = int_max(cp->tx0 + p * cp->tdx, image->x0);
-		pi[pino].ty0 = int_max(cp->ty0 + q * cp->tdy, image->y0);
-		pi[pino].tx1 = int_min(cp->tx0 + (p + 1) * cp->tdx, image->x1);
-		pi[pino].ty1 = int_min(cp->ty0 + (q + 1) * cp->tdy, image->y1);
-		pi[pino].numcomps = image->numcomps;
-
-		array_size = image->numcomps * sizeof(opj_pi_comp_t);
-		pi[pino].comps = (opj_pi_comp_t *) opj_malloc(array_size);
-		if(!pi[pino].comps) {
-			/* TODO: throw an error */
-			pi_destroy(pi, cp, tileno);
-			return NULL;
-		}
-		memset(pi[pino].comps, 0, array_size);
-
-		for (compno = 0; compno < pi->numcomps; compno++) {
-			int tcx0, tcy0, tcx1, tcy1;
-			opj_pi_comp_t *comp = &pi[pino].comps[compno];
-			tccp = &tcp->tccps[compno];
-			comp->dx = image->comps[compno].dx;
-			comp->dy = image->comps[compno].dy;
-			comp->numresolutions = tccp->numresolutions;
-
-			array_size = comp->numresolutions * sizeof(opj_pi_resolution_t);
-			comp->resolutions =	(opj_pi_resolution_t *) opj_malloc(array_size);
-			if(!comp->resolutions) {
-				/* TODO: throw an error */
-				pi_destroy(pi, cp, tileno);
-				return NULL;
-			}
-
-			tcx0 = int_ceildiv(pi->tx0, comp->dx);
-			tcy0 = int_ceildiv(pi->ty0, comp->dy);
-			tcx1 = int_ceildiv(pi->tx1, comp->dx);
-			tcy1 = int_ceildiv(pi->ty1, comp->dy);
-			if (comp->numresolutions > maxres) {
-				maxres = comp->numresolutions;
-			}
-
-			for (resno = 0; resno < comp->numresolutions; resno++) {
-				int levelno;
-				int rx0, ry0, rx1, ry1;
-				int px0, py0, px1, py1;
-				opj_pi_resolution_t *res = &comp->resolutions[resno];
-				if (tccp->csty & J2K_CCP_CSTY_PRT) {
-					res->pdx = tccp->prcw[resno];
-					res->pdy = tccp->prch[resno];
-				} else {
-					res->pdx = 15;
-					res->pdy = 15;
-				}
-				levelno = comp->numresolutions - 1 - resno;
-				rx0 = int_ceildivpow2(tcx0, levelno);
-				ry0 = int_ceildivpow2(tcy0, levelno);
-				rx1 = int_ceildivpow2(tcx1, levelno);
-				ry1 = int_ceildivpow2(tcy1, levelno);
-				px0 = int_floordivpow2(rx0, res->pdx) << res->pdx;
-				py0 = int_floordivpow2(ry0, res->pdy) << res->pdy;
-				px1 = int_ceildivpow2(rx1, res->pdx) << res->pdx;
-				py1 = int_ceildivpow2(ry1, res->pdy) << res->pdy;
-				res->pw = (rx0==rx1)?0:((px1 - px0) >> res->pdx);
-				res->ph = (ry0==ry1)?0:((py1 - py0) >> res->pdy);
-
-				if (res->pw*res->ph > maxprec) {
-					maxprec = res->pw*res->ph;
-				}
-
-			}
-		}
-
-		tccp = &tcp->tccps[0];
-		pi[pino].step_p = 1;
-		pi[pino].step_c = maxprec * pi[pino].step_p;
-		pi[pino].step_r = image->numcomps * pi[pino].step_c;
-		pi[pino].step_l = maxres * pi[pino].step_r;
-
-		if (pino == 0) {
-			array_size = image->numcomps * maxres * tcp->numlayers * maxprec * sizeof(short int);
-			pi[pino].include = (short int *) opj_malloc(array_size);
-			if(!pi[pino].include) {
-				/* TODO: throw an error */
-				pi_destroy(pi, cp, tileno);
-				return NULL;
-			}
-		}
-		else {
-			pi[pino].include = pi[pino - 1].include;
-		}
-
-		if (tcp->POC == 0) {
-			pi[pino].first = 1;
-			pi[pino].poc.resno0 = 0;
-			pi[pino].poc.compno0 = 0;
-			pi[pino].poc.layno1 = tcp->numlayers;
-			pi[pino].poc.resno1 = maxres;
-			pi[pino].poc.compno1 = image->numcomps;
-			pi[pino].poc.prg = tcp->prg;
-		} else {
-			pi[pino].first = 1;
-			pi[pino].poc.resno0 = tcp->pocs[pino].resno0;
-			pi[pino].poc.compno0 = tcp->pocs[pino].compno0;
-			pi[pino].poc.layno1 = tcp->pocs[pino].layno1;
-			pi[pino].poc.resno1 = tcp->pocs[pino].resno1;
-			pi[pino].poc.compno1 = tcp->pocs[pino].compno1;
-			pi[pino].poc.prg = tcp->pocs[pino].prg;
-		}
-		pi[pino].poc.layno0  = 0;
-		pi[pino].poc.precno0 = 0;
-		pi[pino].poc.precno1 = maxprec;
-
-	}
-
-	return pi;
-}
-
-
-opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int tileno, J2K_T2_MODE t2_mode){
-	int p, q, pino;
-	int compno, resno;
-	int maxres = 0;
-	int maxprec = 0;
-	opj_pi_iterator_t *pi = NULL;
-	opj_tcp_t *tcp = NULL;
-	opj_tccp_t *tccp = NULL;
-	size_t array_size;
-
-	tcp = &cp->tcps[tileno];
-
-	array_size = (tcp->numpocs + 1) * sizeof(opj_pi_iterator_t);
-	pi = (opj_pi_iterator_t *) opj_malloc(array_size);
-	if(!pi) {	return NULL;}
-	pi->tp_on = cp->tp_on;
-
-	for(pino = 0;pino < tcp->numpocs+1 ; pino ++){
-		p = tileno % cp->tw;
-		q = tileno / cp->tw;
-
-		pi[pino].tx0 = int_max(cp->tx0 + p * cp->tdx, image->x0);
-		pi[pino].ty0 = int_max(cp->ty0 + q * cp->tdy, image->y0);
-		pi[pino].tx1 = int_min(cp->tx0 + (p + 1) * cp->tdx, image->x1);
-		pi[pino].ty1 = int_min(cp->ty0 + (q + 1) * cp->tdy, image->y1);
-		pi[pino].numcomps = image->numcomps;
-
-		array_size = image->numcomps * sizeof(opj_pi_comp_t);
-		pi[pino].comps = (opj_pi_comp_t *) opj_malloc(array_size);
-		if(!pi[pino].comps) {
-			pi_destroy(pi, cp, tileno);
-			return NULL;
-		}
-		memset(pi[pino].comps, 0, array_size);
-
-		for (compno = 0; compno < pi[pino].numcomps; compno++) {
-			int tcx0, tcy0, tcx1, tcy1;
-			opj_pi_comp_t *comp = &pi[pino].comps[compno];
-			tccp = &tcp->tccps[compno];
-			comp->dx = image->comps[compno].dx;
-			comp->dy = image->comps[compno].dy;
-			comp->numresolutions = tccp->numresolutions;
-
-			array_size = comp->numresolutions * sizeof(opj_pi_resolution_t);
-			comp->resolutions =	(opj_pi_resolution_t *) opj_malloc(array_size);
-			if(!comp->resolutions) {
-				pi_destroy(pi, cp, tileno);
-				return NULL;
-			}
-
-			tcx0 = int_ceildiv(pi[pino].tx0, comp->dx);
-			tcy0 = int_ceildiv(pi[pino].ty0, comp->dy);
-			tcx1 = int_ceildiv(pi[pino].tx1, comp->dx);
-			tcy1 = int_ceildiv(pi[pino].ty1, comp->dy);
-			if (comp->numresolutions > maxres) {
-				maxres = comp->numresolutions;
-			}
-
-			for (resno = 0; resno < comp->numresolutions; resno++) {
-				int levelno;
-				int rx0, ry0, rx1, ry1;
-				int px0, py0, px1, py1;
-				opj_pi_resolution_t *res = &comp->resolutions[resno];
-				if (tccp->csty & J2K_CCP_CSTY_PRT) {
-					res->pdx = tccp->prcw[resno];
-					res->pdy = tccp->prch[resno];
-				} else {
-					res->pdx = 15;
-					res->pdy = 15;
-				}
-				levelno = comp->numresolutions - 1 - resno;
-				rx0 = int_ceildivpow2(tcx0, levelno);
-				ry0 = int_ceildivpow2(tcy0, levelno);
-				rx1 = int_ceildivpow2(tcx1, levelno);
-				ry1 = int_ceildivpow2(tcy1, levelno);
-				px0 = int_floordivpow2(rx0, res->pdx) << res->pdx;
-				py0 = int_floordivpow2(ry0, res->pdy) << res->pdy;
-				px1 = int_ceildivpow2(rx1, res->pdx) << res->pdx;
-				py1 = int_ceildivpow2(ry1, res->pdy) << res->pdy;
-				res->pw = (rx0==rx1)?0:((px1 - px0) >> res->pdx);
-				res->ph = (ry0==ry1)?0:((py1 - py0) >> res->pdy);
-
-				if (res->pw*res->ph > maxprec) {
-					maxprec = res->pw * res->ph;
-				}
-			}
-		}
-
-		tccp = &tcp->tccps[0];
-		pi[pino].step_p = 1;
-		pi[pino].step_c = maxprec * pi[pino].step_p;
-		pi[pino].step_r = image->numcomps * pi[pino].step_c;
-		pi[pino].step_l = maxres * pi[pino].step_r;
-
-		for (compno = 0; compno < pi->numcomps; compno++) {
-			opj_pi_comp_t *comp = &pi->comps[compno];
-			for (resno = 0; resno < comp->numresolutions; resno++) {
-				int dx, dy;
-				opj_pi_resolution_t *res = &comp->resolutions[resno];
-				dx = comp->dx * (1 << (res->pdx + comp->numresolutions - 1 - resno));
-				dy = comp->dy * (1 << (res->pdy + comp->numresolutions - 1 - resno));
-				pi[pino].dx = !pi->dx ? dx : int_min(pi->dx, dx);
-				pi[pino].dy = !pi->dy ? dy : int_min(pi->dy, dy);
-			}
-		}
-
-		if (pino == 0) {
-			array_size = tcp->numlayers * pi[pino].step_l * sizeof(short int);
-			pi[pino].include = (short int *) opj_malloc(array_size);
-			if(!pi[pino].include) {
-				pi_destroy(pi, cp, tileno);
-				return NULL;
-			}
-		}
-		else {
-			pi[pino].include = pi[pino - 1].include;
-		}
-
-		/* Generation of boundaries for each prog flag*/
-			if(tcp->POC & (t2_mode == FINAL_PASS)){
-				tcp->pocs[pino].compS= tcp->pocs[pino].compno0;
-				tcp->pocs[pino].compE= tcp->pocs[pino].compno1;
-				tcp->pocs[pino].resS = tcp->pocs[pino].resno0;
-				tcp->pocs[pino].resE = tcp->pocs[pino].resno1;
-				tcp->pocs[pino].layE = tcp->pocs[pino].layno1;
-				tcp->pocs[pino].prg  = tcp->pocs[pino].prg1;
-				if (pino > 0)
-					tcp->pocs[pino].layS = (tcp->pocs[pino].layE > tcp->pocs[pino - 1].layE) ? tcp->pocs[pino - 1].layE : 0;
-			}else {
-				tcp->pocs[pino].compS= 0;
-				tcp->pocs[pino].compE= image->numcomps;
-				tcp->pocs[pino].resS = 0;
-				tcp->pocs[pino].resE = maxres;
-				tcp->pocs[pino].layS = 0;
-				tcp->pocs[pino].layE = tcp->numlayers;
-				tcp->pocs[pino].prg  = tcp->prg;
-			}
-			tcp->pocs[pino].prcS = 0;
-			tcp->pocs[pino].prcE = maxprec;;
-			tcp->pocs[pino].txS = pi[pino].tx0;
-			tcp->pocs[pino].txE = pi[pino].tx1;
-			tcp->pocs[pino].tyS = pi[pino].ty0;
-			tcp->pocs[pino].tyE = pi[pino].ty1;
-			tcp->pocs[pino].dx = pi[pino].dx;
-			tcp->pocs[pino].dy = pi[pino].dy;
-		}
-			return pi;
-	}
-
-
-
-void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno) {
-	int compno, pino;
-	opj_tcp_t *tcp = &cp->tcps[tileno];
-	if(pi) {
-		for (pino = 0; pino < tcp->numpocs + 1; pino++) {
-			if(pi[pino].comps) {
-				for (compno = 0; compno < pi->numcomps; compno++) {
-					opj_pi_comp_t *comp = &pi[pino].comps[compno];
-					if(comp->resolutions) {
-						opj_free(comp->resolutions);
-					}
-				}
-				opj_free(pi[pino].comps);
-			}
-		}
-		if(pi->include) {
-			opj_free(pi->include);
-		}
-		opj_free(pi);
-	}
-}
-
-bool pi_next(opj_pi_iterator_t * pi) {
-	switch (pi->poc.prg) {
-		case LRCP:
-			return pi_next_lrcp(pi);
-		case RLCP:
-			return pi_next_rlcp(pi);
-		case RPCL:
-			return pi_next_rpcl(pi);
-		case PCRL:
-			return pi_next_pcrl(pi);
-		case CPRL:
-			return pi_next_cprl(pi);
-		case PROG_UNKNOWN:
-			return false;
-	}
-
-	return false;
-}
-
-int pi_check_next_level(int pos,opj_cp_t *cp,int tileno, int pino, char *prog){
-	int i,l;
-	opj_tcp_t *tcps =&cp->tcps[tileno];
-	opj_poc_t *tcp = &tcps->pocs[pino];
-	if(pos>=0){
-		for(i=pos;pos>=0;i--){
-			switch(prog[i]){
-		case 'R':
-			if(tcp->res_t==tcp->resE){
-				l=pi_check_next_level(pos-1,cp,tileno,pino,prog);
-				if(l==1){
-					return 1;
-				}else{
-					return 0;
-				}
-			}else{
-				return 1;
-			}
-			break;
-		case 'C':
-			if(tcp->comp_t==tcp->compE){
-				l=pi_check_next_level(pos-1,cp,tileno,pino,prog);
-				if(l==1){
-					return 1;
-				}else{
-					return 0;
-				}
-			}else{
-				return 1;
-			}
-			break;
-		case 'L':
-			if(tcp->lay_t==tcp->layE){
-				l=pi_check_next_level(pos-1,cp,tileno,pino,prog);
-				if(l==1){
-					return 1;
-				}else{
-					return 0;
-				}
-			}else{
-				return 1;
-			}
-			break;
-		case 'P':
-			switch(tcp->prg){
-				case LRCP||RLCP:
-					if(tcp->prc_t == tcp->prcE){
-						l=pi_check_next_level(i-1,cp,tileno,pino,prog);
-						if(l==1){
-							return 1;
-						}else{
-							return 0;
-						}
-					}else{
-						return 1;
-					}
-					break;
-			default:
-				if(tcp->tx0_t == tcp->txE){
-					//TY
-					if(tcp->ty0_t == tcp->tyE){
-						l=pi_check_next_level(i-1,cp,tileno,pino,prog);
-						if(l==1){
-							return 1;
-						}else{
-							return 0;
-						}
-					}else{
-						return 1;
-					}//TY
-				}else{
-					return 1;
-				}
-				break;
-			}//end case P
-		}//end switch
-		}//end for
-	}//end if
-	return 0;
-}
-
-
-void pi_create_encode( opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos){
-	char *prog;
-	int i,l;
-	int incr_top=1,resetX=0;
-	opj_tcp_t *tcps =&cp->tcps[tileno];
-	opj_poc_t *tcp= &tcps->pocs[pino];
-	prog = j2k_convert_progression_order(tcp->prg);
-
-	pi[pino].first = 1;
-	pi[pino].poc.prg = tcp->prg;
-
-	if(!(cp->tp_on)){
-		pi[pino].poc.resno0 = tcp->resS;
-		pi[pino].poc.resno1 = tcp->resE;
-		pi[pino].poc.compno0 = tcp->compS;
-		pi[pino].poc.compno1 = tcp->compE;
-		pi[pino].poc.layno0 = tcp->layS;
-		pi[pino].poc.layno1 = tcp->layE;
-		pi[pino].poc.precno0 = tcp->prcS;
-		pi[pino].poc.precno1 = tcp->prcE;
-		pi[pino].poc.tx0 = tcp->txS;
-		pi[pino].poc.ty0 = tcp->tyS;
-		pi[pino].poc.tx1 = tcp->txE;
-		pi[pino].poc.ty1 = tcp->tyE;
-	}else {
-		for(i=tppos+1;i<4;i++){
-			switch(prog[i]){
-			case 'R':
-				pi[pino].poc.resno0 = tcp->resS;
-				pi[pino].poc.resno1 = tcp->resE;
-				break;
-			case 'C':
-				pi[pino].poc.compno0 = tcp->compS;
-				pi[pino].poc.compno1 = tcp->compE;
-				break;
-			case 'L':
-				pi[pino].poc.layno0 = tcp->layS;
-				pi[pino].poc.layno1 = tcp->layE;
-				break;
-			case 'P':
-				switch(tcp->prg){
-					case LRCP:
-					case RLCP:
-						pi[pino].poc.precno0 = tcp->prcS;
-						pi[pino].poc.precno1 = tcp->prcE;
-						break;
-					default:
-						pi[pino].poc.tx0 = tcp->txS;
-						pi[pino].poc.ty0 = tcp->tyS;
-						pi[pino].poc.tx1 = tcp->txE;
-						pi[pino].poc.ty1 = tcp->tyE;
-						break;
-				}
-				break;
-			}
-		}
-
-		if(tpnum==0){
-			for(i=tppos;i>=0;i--){
-				switch(prog[i]){
-						case 'C':
-							tcp->comp_t = tcp->compS;
-							pi[pino].poc.compno0 = tcp->comp_t;
-							pi[pino].poc.compno1 = tcp->comp_t+1;
-							tcp->comp_t+=1;
-							break;
-						case 'R':
-							tcp->res_t = tcp->resS;
-							pi[pino].poc.resno0 = tcp->res_t;
-							pi[pino].poc.resno1 = tcp->res_t+1;
-							tcp->res_t+=1;
-							break;
-						case 'L':
-							tcp->lay_t = tcp->layS;
-							pi[pino].poc.layno0 = tcp->lay_t;
-							pi[pino].poc.layno1 = tcp->lay_t+1;
-							tcp->lay_t+=1;
-							break;
-						case 'P':
-							switch(tcp->prg){
-								case LRCP:
-								case RLCP:
-									tcp->prc_t = tcp->prcS;
-									pi[pino].poc.precno0 = tcp->prc_t;
-									pi[pino].poc.precno1 = tcp->prc_t+1;
-									tcp->prc_t+=1;
-									break;
-								default:
-									tcp->tx0_t = tcp->txS;
-									tcp->ty0_t = tcp->tyS;
-									pi[pino].poc.tx0 = tcp->tx0_t;
-									pi[pino].poc.tx1 = tcp->tx0_t + tcp->dx - (tcp->tx0_t % tcp->dx);
-									pi[pino].poc.ty0 = tcp->ty0_t;
-									pi[pino].poc.ty1 = tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy);
-									tcp->tx0_t = pi[pino].poc.tx1;
-									tcp->ty0_t = pi[pino].poc.ty1;
-									break;
-							}
-							break;
-				}
-			}
-			incr_top=1;
-		}else{
-			for(i=tppos;i>=0;i--){
-				switch(prog[i]){
-						case 'C':
-							pi[pino].poc.compno0 = tcp->comp_t-1;
-							pi[pino].poc.compno1 = tcp->comp_t;
-							break;
-						case 'R':
-							pi[pino].poc.resno0 = tcp->res_t-1;
-							pi[pino].poc.resno1 = tcp->res_t;
-							break;
-						case 'L':
-							pi[pino].poc.layno0 = tcp->lay_t-1;
-							pi[pino].poc.layno1 = tcp->lay_t;
-							break;
-						case 'P':
-							switch(tcp->prg){
-								case LRCP:
-								case RLCP:
-									pi[pino].poc.precno0 = tcp->prc_t-1;
-									pi[pino].poc.precno1 = tcp->prc_t;
-									break;
-								default:
-									pi[pino].poc.tx0 = tcp->tx0_t - tcp->dx - (tcp->tx0_t % tcp->dx);
-									pi[pino].poc.tx1 = tcp->tx0_t ;
-									pi[pino].poc.ty0 = tcp->ty0_t - tcp->dy - (tcp->ty0_t % tcp->dy);
-									pi[pino].poc.ty1 = tcp->ty0_t ;
-									break;
-							}
-							break;
-				}
-				if(incr_top==1){
-					switch(prog[i]){
-							case 'R':
-								if(tcp->res_t==tcp->resE){
-									l=pi_check_next_level(i-1,cp,tileno,pino,prog);
-									if(l==1){
-										tcp->res_t = tcp->resS;
-										pi[pino].poc.resno0 = tcp->res_t;
-										pi[pino].poc.resno1 = tcp->res_t+1;
-										tcp->res_t+=1;
-										incr_top=1;
-									}else{
-										incr_top=0;
-									}
-								}else{
-									pi[pino].poc.resno0 = tcp->res_t;
-									pi[pino].poc.resno1 = tcp->res_t+1;
-									tcp->res_t+=1;
-									incr_top=0;
-								}
-								break;
-							case 'C':
-								if(tcp->comp_t ==tcp->compE){
-									l=pi_check_next_level(i-1,cp,tileno,pino,prog);
-									if(l==1){
-										tcp->comp_t = tcp->compS;
-										pi[pino].poc.compno0 = tcp->comp_t;
-										pi[pino].poc.compno1 = tcp->comp_t+1;
-										tcp->comp_t+=1;
-										incr_top=1;
-									}else{
-										incr_top=0;
-									}
-								}else{
-									pi[pino].poc.compno0 = tcp->comp_t;
-									pi[pino].poc.compno1 = tcp->comp_t+1;
-									tcp->comp_t+=1;
-									incr_top=0;
-								}
-								break;
-							case 'L':
-								if(tcp->lay_t == tcp->layE){
-									l=pi_check_next_level(i-1,cp,tileno,pino,prog);
-									if(l==1){
-										tcp->lay_t = tcp->layS;
-										pi[pino].poc.layno0 = tcp->lay_t;
-										pi[pino].poc.layno1 = tcp->lay_t+1;
-										tcp->lay_t+=1;
-										incr_top=1;
-									}else{
-										incr_top=0;
-									}
-								}else{
-									pi[pino].poc.layno0 = tcp->lay_t;
-									pi[pino].poc.layno1 = tcp->lay_t+1;
-									tcp->lay_t+=1;
-									incr_top=0;
-								}
-								break;
-							case 'P':
-								switch(tcp->prg){
-									case LRCP:
-									case RLCP:
-										if(tcp->prc_t == tcp->prcE){
-											l=pi_check_next_level(i-1,cp,tileno,pino,prog);
-											if(l==1){
-												tcp->prc_t = tcp->prcS;
-												pi[pino].poc.precno0 = tcp->prc_t;
-												pi[pino].poc.precno1 = tcp->prc_t+1;
-												tcp->prc_t+=1;
-												incr_top=1;
-											}else{
-												incr_top=0;
-											}
-										}else{
-											pi[pino].poc.precno0 = tcp->prc_t;
-											pi[pino].poc.precno1 = tcp->prc_t+1;
-											tcp->prc_t+=1;
-											incr_top=0;
-										}
-										break;
-									default:
-										if(tcp->tx0_t >= tcp->txE){
-											if(tcp->ty0_t >= tcp->tyE){
-												l=pi_check_next_level(i-1,cp,tileno,pino,prog);
-												if(l==1){
-													tcp->ty0_t = tcp->tyS;
-													pi[pino].poc.ty0 = tcp->ty0_t;
-													pi[pino].poc.ty1 = tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy);
-													tcp->ty0_t = pi[pino].poc.ty1;
-													incr_top=1;resetX=1;
-												}else{
-													incr_top=0;resetX=0;
-												}
-											}else{
-												pi[pino].poc.ty0 = tcp->ty0_t;
-												pi[pino].poc.ty1 = tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy);
-												tcp->ty0_t = pi[pino].poc.ty1;
-												incr_top=0;resetX=1;
-											}
-											if(resetX==1){
-												tcp->tx0_t = tcp->txS;
-												pi[pino].poc.tx0 = tcp->tx0_t;
-												pi[pino].poc.tx1 = tcp->tx0_t + tcp->dx- (tcp->tx0_t % tcp->dx);
-												tcp->tx0_t = pi[pino].poc.tx1;
-											}
-										}else{
-											pi[pino].poc.tx0 = tcp->tx0_t;
-											pi[pino].poc.tx1 = tcp->tx0_t + tcp->dx- (tcp->tx0_t % tcp->dx);
-											tcp->tx0_t = pi[pino].poc.tx1;
-											incr_top=0;
-										}
-										break;
-								}
-								break;
-					}
-				}
-			}
-		}
-	}
-}
-
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/pi.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/pi.h
deleted file mode 100644
index fc99329..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/pi.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __PI_H
-#define __PI_H
-/**
-@file pi.h
-@brief Implementation of a packet iterator (PI)
-
-The functions in PI.C have for goal to realize a packet iterator that permits to get the next
-packet following the progression order and change of it. The functions in PI.C are used
-by some function in T2.C.
-*/
-
-/** @defgroup PI PI - Implementation of a packet iterator */
-/*@{*/
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_pi_resolution {
-  int pdx, pdy;
-  int pw, ph;
-} opj_pi_resolution_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_pi_comp {
-  int dx, dy;
-  /** number of resolution levels */
-  int numresolutions;
-  opj_pi_resolution_t *resolutions;
-} opj_pi_comp_t;
-
-/**
-Packet iterator
-*/
-typedef struct opj_pi_iterator {
-	/** Enabling Tile part generation*/
-	char tp_on;
-	/** precise if the packet has been already used (usefull for progression order change) */
-	short int *include;
-	/** layer step used to localize the packet in the include vector */
-	int step_l;
-	/** resolution step used to localize the packet in the include vector */
-	int step_r;
-	/** component step used to localize the packet in the include vector */
-	int step_c;
-	/** precinct step used to localize the packet in the include vector */
-	int step_p;
-	/** component that identify the packet */
-	int compno;
-	/** resolution that identify the packet */
-	int resno;
-	/** precinct that identify the packet */
-	int precno;
-	/** layer that identify the packet */
-	int layno;
-	/** 0 if the first packet */
-	int first;
-	/** progression order change information */
-	opj_poc_t poc;
-	/** number of components in the image */
-	int numcomps;
-	/** Components*/
-	opj_pi_comp_t *comps;
-	int tx0, ty0, tx1, ty1;
-	int x, y, dx, dy;
-} opj_pi_iterator_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Create a packet iterator for Encoder
-@param image Raw image for which the packets will be listed
-@param cp Coding parameters
-@param tileno Number that identifies the tile for which to list the packets
-@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
-@return Returns a packet iterator that points to the first packet of the tile
-@see pi_destroy
-*/
-opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int tileno,J2K_T2_MODE t2_mode);
-/**
-Modify the packet iterator for enabling tile part generation
-@param pi Handle to the packet iterator generated in pi_initialise_encode
-@param cp Coding parameters
-@param tileno Number that identifies the tile for which to list the packets
-@param tpnum Tile part number of the current tile
-@param tppos The position of the tile part flag in the progression order
-*/
-void pi_create_encode( opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos);
-/**
-Create a packet iterator for Decoder
-@param image Raw image for which the packets will be listed
-@param cp Coding parameters
-@param tileno Number that identifies the tile for which to list the packets
-@return Returns a packet iterator that points to the first packet of the tile
-@see pi_destroy
-*/
-opj_pi_iterator_t *pi_create_decode(opj_image_t * image, opj_cp_t * cp, int tileno);
-
-/**
-Destroy a packet iterator
-@param pi Previously created packet iterator
-@param cp Coding parameters
-@param tileno Number that identifies the tile for which the packets were listed
-@see pi_create
-*/
-void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno);
-
-/**
-Modify the packet iterator to point to the next packet
-@param pi Packet iterator to modify
-@return Returns false if pi pointed to the last packet or else returns true
-*/
-bool pi_next(opj_pi_iterator_t * pi);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __PI_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/raw.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/raw.c
deleted file mode 100644
index 808a468..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/raw.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/*
-==========================================================
-   local functions
-==========================================================
-*/
-
-
-/*
-==========================================================
-   RAW encoding interface
-==========================================================
-*/
-
-opj_raw_t* raw_create() {
-	opj_raw_t *raw = (opj_raw_t*)opj_malloc(sizeof(opj_raw_t));
-	return raw;
-}
-
-void raw_destroy(opj_raw_t *raw) {
-	if(raw) {
-		opj_free(raw);
-	}
-}
-
-int raw_numbytes(opj_raw_t *raw) {
-	return raw->bp - raw->start;
-}
-
-void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len) {
-	raw->start = bp;
-	raw->lenmax = len;
-	raw->len = 0;
-	raw->c = 0;
-	raw->ct = 0;
-}
-
-int raw_decode(opj_raw_t *raw) {
-	int d;
-	if (raw->ct == 0) {
-		raw->ct = 8;
-		if (raw->len == raw->lenmax) {
-			raw->c = 0xff;
-		} else {
-			if (raw->c == 0xff) {
-				raw->ct = 7;
-			}
-			raw->c = *(raw->start + raw->len);
-			raw->len++;
-		}
-	}
-	raw->ct--;
-	d = (raw->c >> raw->ct) & 0x01;
-
-	return d;
-}
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/raw.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/raw.h
deleted file mode 100644
index c4ff9b3..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/raw.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __RAW_H
-#define __RAW_H
-/**
-@file raw.h
-@brief Implementation of operations for raw encoding (RAW)
-
-The functions in RAW.C have for goal to realize the operation of raw encoding linked
-with the corresponding mode switch.
-*/
-
-/** @defgroup RAW RAW - Implementation of operations for raw encoding */
-/*@{*/
-
-/**
-RAW encoding operations
-*/
-typedef struct opj_raw {
-	/** temporary buffer where bits are coded or decoded */
-	unsigned char c;
-	/** number of bits already read or free to write */
-	unsigned int ct;
-	/** maximum length to decode */
-	unsigned int lenmax;
-	/** length decoded */
-	unsigned int len;
-	/** pointer to the current position in the buffer */
-	unsigned char *bp;
-	/** pointer to the start of the buffer */
-	unsigned char *start;
-	/** pointer to the end of the buffer */
-	unsigned char *end;
-} opj_raw_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Create a new RAW handle
-@return Returns a new RAW handle if successful, returns NULL otherwise
-*/
-opj_raw_t* raw_create();
-/**
-Destroy a previously created RAW handle
-@param raw RAW handle to destroy
-*/
-void raw_destroy(opj_raw_t *raw);
-/**
-Return the number of bytes written/read since initialisation
-@param raw RAW handle to destroy
-@return Returns the number of bytes already encoded
-*/
-int raw_numbytes(opj_raw_t *raw);
-/**
-Initialize the decoder
-@param raw RAW handle
-@param bp Pointer to the start of the buffer from which the bytes will be read
-@param len Length of the input buffer
-*/
-void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len);
-/**
-Decode a symbol using raw-decoder. Cfr p.506 TAUBMAN
-@param raw RAW handle
-@return Returns the decoded symbol (0 or 1)
-*/
-int raw_decode(opj_raw_t *raw);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __RAW_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/t1.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/t1.c
deleted file mode 100644
index b5d9599..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/t1.c
+++ /dev/null
@@ -1,1210 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-#include "t1_luts.h"
-
-/** @defgroup T1 T1 - Implementation of the tier-1 coding */
-/*@{*/
-
-/** @name Local static functions */
-/*@{*/
-
-static char t1_getctxno_zc(int f, int orient);
-static char t1_getctxno_sc(int f);
-static char t1_getctxno_mag(int f);
-static char t1_getspb(int f);
-static short t1_getnmsedec_sig(int x, int bitpos);
-static short t1_getnmsedec_ref(int x, int bitpos);
-static void t1_updateflags(flag_t *flagsp, int s, int stride);
-/**
-Encode significant pass
-*/
-static void t1_enc_sigpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int orient,
-		int bpno,
-		int one,
-		int *nmsedec,
-		char type,
-		int vsc);
-/**
-Decode significant pass
-*/
-static void t1_dec_sigpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int orient,
-		int oneplushalf,
-		char type,
-		int vsc);
-/**
-Encode significant pass
-*/
-static void t1_enc_sigpass(
-		opj_t1_t *t1,
-		int bpno,
-		int orient,
-		int *nmsedec,
-		char type,
-		int cblksty);
-/**
-Decode significant pass
-*/
-static void t1_dec_sigpass(
-		opj_t1_t *t1,
-		int bpno,
-		int orient,
-		char type,
-		int cblksty);
-/**
-Encode refinement pass
-*/
-static void t1_enc_refpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int bpno,
-		int one,
-		int *nmsedec,
-		char type,
-		int vsc);
-/**
-Decode refinement pass
-*/
-static void t1_dec_refpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int poshalf,
-		int neghalf,
-		char type,
-		int vsc);
-/**
-Encode refinement pass
-*/
-static void t1_enc_refpass(
-		opj_t1_t *t1,
-		int bpno,
-		int *nmsedec,
-		char type,
-		int cblksty);
-/**
-Decode refinement pass
-*/
-static void t1_dec_refpass(
-		opj_t1_t *t1,
-		int bpno,
-		char type,
-		int cblksty);
-/**
-Encode clean-up pass
-*/
-static void t1_enc_clnpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int orient,
-		int bpno,
-		int one,
-		int *nmsedec,
-		int partial,
-		int vsc);
-/**
-Decode clean-up pass
-*/
-static void t1_dec_clnpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int orient,
-		int oneplushalf,
-		int partial,
-		int vsc);
-/**
-Encode clean-up pass
-*/
-static void t1_enc_clnpass(
-		opj_t1_t *t1,
-		int bpno,
-		int orient,
-		int *nmsedec,
-		int cblksty);
-/**
-Decode clean-up pass
-*/
-static void t1_dec_clnpass(
-		opj_t1_t *t1,
-		int bpno,
-		int orient,
-		int cblksty);
-static double t1_getwmsedec(
-		int nmsedec,
-		int compno,
-		int level,
-		int orient,
-		int bpno,
-		int qmfbid,
-		double stepsize,
-		int numcomps);
-/**
-Encode 1 code-block
-@param t1 T1 handle
-@param cblk Code-block coding parameters
-@param orient
-@param compno Component number
-@param level
-@param qmfbid
-@param stepsize
-@param cblksty Code-block style
-@param numcomps
-@param tile
-*/
-static void t1_encode_cblk(
-		opj_t1_t *t1,
-		opj_tcd_cblk_t * cblk,
-		int orient,
-		int compno,
-		int level,
-		int qmfbid,
-		double stepsize,
-		int cblksty,
-		int numcomps,
-		opj_tcd_tile_t * tile);
-/**
-Decode 1 code-block
-@param t1 T1 handle
-@param cblk Code-block coding parameters
-@param orient
-@param roishift Region of interest shifting value
-@param cblksty Code-block style
-*/
-static void t1_decode_cblk(
-		opj_t1_t *t1,
-		opj_tcd_cblk_t * cblk,
-		int orient,
-		int roishift,
-		int cblksty);
-
-/*@}*/
-
-/*@}*/
-
-/* ----------------------------------------------------------------------- */
-
-static char t1_getctxno_zc(int f, int orient) {
-	return lut_ctxno_zc[(orient << 8) | (f & T1_SIG_OTH)];
-}
-
-static char t1_getctxno_sc(int f) {
-	return lut_ctxno_sc[(f & (T1_SIG_PRIM | T1_SGN)) >> 4];
-}
-
-static char t1_getctxno_mag(int f) {
-	return lut_ctxno_mag[(f & T1_SIG_OTH) | (((f & T1_REFINE) != 0) << 11)];
-}
-
-static char t1_getspb(int f) {
-	return lut_spb[(f & (T1_SIG_PRIM | T1_SGN)) >> 4];
-}
-
-static short t1_getnmsedec_sig(int x, int bitpos) {
-	if (bitpos > T1_NMSEDEC_FRACBITS) {
-		return lut_nmsedec_sig[(x >> (bitpos - T1_NMSEDEC_FRACBITS)) & ((1 << T1_NMSEDEC_BITS) - 1)];
-	}
-
-	return lut_nmsedec_sig0[x & ((1 << T1_NMSEDEC_BITS) - 1)];
-}
-
-static short t1_getnmsedec_ref(int x, int bitpos) {
-	if (bitpos > T1_NMSEDEC_FRACBITS) {
-		return lut_nmsedec_ref[(x >> (bitpos - T1_NMSEDEC_FRACBITS)) & ((1 << T1_NMSEDEC_BITS) - 1)];
-	}
-
-    return lut_nmsedec_ref0[x & ((1 << T1_NMSEDEC_BITS) - 1)];
-}
-
-static void t1_updateflags(flag_t *flagsp, int s, int stride) {
-	flag_t *np = flagsp - stride;
-	flag_t *sp = flagsp + stride;
-
-	static const flag_t mod[] = {
-		T1_SIG_S,            T1_SIG_N,            T1_SIG_E,            T1_SIG_W,
-		T1_SIG_S | T1_SGN_S, T1_SIG_N | T1_SGN_N, T1_SIG_E | T1_SGN_E, T1_SIG_W | T1_SGN_W
-	};
-
-	s <<= 2;
-
-	np[-1] |= T1_SIG_SE;
-	np[0]  |= mod[s];
-	np[1]  |= T1_SIG_SW;
-
-	flagsp[-1] |= mod[s+2];
-	flagsp[1]  |= mod[s+3];
-
-	sp[-1] |= T1_SIG_NE;
-	sp[0]  |= mod[s+1];
-	sp[1]  |= T1_SIG_NW;
-}
-
-static void t1_enc_sigpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int orient,
-		int bpno,
-		int one,
-		int *nmsedec,
-		char type,
-		int vsc)
-{
-	int v, flag;
-
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
-	if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {
-		v = int_abs(*datap) & one ? 1 : 0;
-		if (type == T1_TYPE_RAW) {	/* BYPASS/LAZY MODE */
-			mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient));	/* ESSAI */
-			mqc_bypass_enc(mqc, v);
-		} else {
-			mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient));
-			mqc_encode(mqc, v);
-		}
-		if (v) {
-			v = *datap < 0 ? 1 : 0;
-			*nmsedec +=	t1_getnmsedec_sig(int_abs(*datap), bpno + T1_NMSEDEC_FRACBITS);
-			if (type == T1_TYPE_RAW) {	/* BYPASS/LAZY MODE */
-				mqc_setcurctx(mqc, t1_getctxno_sc(flag));	/* ESSAI */
-				mqc_bypass_enc(mqc, v);
-			} else {
-				mqc_setcurctx(mqc, t1_getctxno_sc(flag));
-				mqc_encode(mqc, v ^ t1_getspb(flag));
-			}
-			t1_updateflags(flagsp, v, t1->flags_stride);
-			*flagsp |= T1_SIG;
-		}
-		*flagsp |= T1_VISIT;
-	}
-}
-
-static void t1_dec_sigpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int orient,
-		int oneplushalf,
-		char type,
-		int vsc)
-{
-	int v, flag;
-
-	opj_raw_t *raw = t1->raw;	/* RAW component */
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
-	if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {
-		if (type == T1_TYPE_RAW) {
-			if (raw_decode(raw)) {
-				v = raw_decode(raw);	/* ESSAI */
-				*datap = v ? -oneplushalf : oneplushalf;
-				t1_updateflags(flagsp, v, t1->flags_stride);
-				*flagsp |= T1_SIG;
-			}
-		} else {
-			mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient));
-			if (mqc_decode(mqc)) {
-				mqc_setcurctx(mqc, t1_getctxno_sc(flag));
-				v = mqc_decode(mqc) ^ t1_getspb(flag);
-				*datap = v ? -oneplushalf : oneplushalf;
-				t1_updateflags(flagsp, v, t1->flags_stride);
-				*flagsp |= T1_SIG;
-			}
-		}
-		*flagsp |= T1_VISIT;
-	}
-}				/* VSC and  BYPASS by Antonin */
-
-static void t1_enc_sigpass(
-		opj_t1_t *t1,
-		int bpno,
-		int orient,
-		int *nmsedec,
-		char type,
-		int cblksty)
-{
-	int i, j, k, one, vsc;
-	*nmsedec = 0;
-	one = 1 << (bpno + T1_NMSEDEC_FRACBITS);
-	for (k = 0; k < t1->h; k += 4) {
-		for (i = 0; i < t1->w; ++i) {
-			for (j = k; j < k + 4 && j < t1->h; ++j) {
-				vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
-				t1_enc_sigpass_step(
-						t1,
-						&t1->flags[((j+1) * t1->flags_stride) + i + 1],
-						&t1->data[(j * t1->w) + i],
-						orient,
-						bpno,
-						one,
-						nmsedec,
-						type,
-						vsc);
-			}
-		}
-	}
-}
-
-static void t1_dec_sigpass(
-		opj_t1_t *t1,
-		int bpno,
-		int orient,
-		char type,
-		int cblksty)
-{
-	int i, j, k, one, half, oneplushalf, vsc;
-	one = 1 << bpno;
-	half = one >> 1;
-	oneplushalf = one | half;
-	for (k = 0; k < t1->h; k += 4) {
-		for (i = 0; i < t1->w; ++i) {
-			for (j = k; j < k + 4 && j < t1->h; ++j) {
-				vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
-				t1_dec_sigpass_step(
-						t1,
-						&t1->flags[((j+1) * t1->flags_stride) + i + 1],
-						&t1->data[(j * t1->w) + i],
-						orient,
-						oneplushalf,
-						type,
-						vsc);
-			}
-		}
-	}
-}				/* VSC and  BYPASS by Antonin */
-
-static void t1_enc_refpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int bpno,
-		int one,
-		int *nmsedec,
-		char type,
-		int vsc)
-{
-	int v, flag;
-
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
-	if ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {
-		*nmsedec += t1_getnmsedec_ref(int_abs(*datap), bpno + T1_NMSEDEC_FRACBITS);
-		v = int_abs(*datap) & one ? 1 : 0;
-		if (type == T1_TYPE_RAW) {	/* BYPASS/LAZY MODE */
-			mqc_setcurctx(mqc, t1_getctxno_mag(flag));	/* ESSAI */
-			mqc_bypass_enc(mqc, v);
-		} else {
-			mqc_setcurctx(mqc, t1_getctxno_mag(flag));
-			mqc_encode(mqc, v);
-		}
-		*flagsp |= T1_REFINE;
-	}
-}
-
-static void t1_dec_refpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int poshalf,
-		int neghalf,
-		char type,
-		int vsc)
-{
-	int v, t, flag;
-
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-	opj_raw_t *raw = t1->raw;	/* RAW component */
-
-	flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
-	if ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {
-		if (type == T1_TYPE_RAW) {
-			mqc_setcurctx(mqc, t1_getctxno_mag(flag));	/* ESSAI */
-			v = raw_decode(raw);
-		} else {
-			mqc_setcurctx(mqc, t1_getctxno_mag(flag));
-			v = mqc_decode(mqc);
-		}
-		t = v ? poshalf : neghalf;
-		*datap += *datap < 0 ? -t : t;
-		*flagsp |= T1_REFINE;
-	}
-}				/* VSC and  BYPASS by Antonin  */
-
-static void t1_enc_refpass(
-		opj_t1_t *t1,
-		int bpno,
-		int *nmsedec,
-		char type,
-		int cblksty)
-{
-	int i, j, k, one, vsc;
-	*nmsedec = 0;
-	one = 1 << (bpno + T1_NMSEDEC_FRACBITS);
-	for (k = 0; k < t1->h; k += 4) {
-		for (i = 0; i < t1->w; ++i) {
-			for (j = k; j < k + 4 && j < t1->h; ++j) {
-				vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
-				t1_enc_refpass_step(
-						t1,
-						&t1->flags[((j+1) * t1->flags_stride) + i + 1],
-						&t1->data[(j * t1->w) + i],
-						bpno,
-						one,
-						nmsedec,
-						type,
-						vsc);
-			}
-		}
-	}
-}
-
-static void t1_dec_refpass(
-		opj_t1_t *t1,
-		int bpno,
-		char type,
-		int cblksty)
-{
-	int i, j, k, one, poshalf, neghalf;
-	int vsc;
-	one = 1 << bpno;
-	poshalf = one >> 1;
-	neghalf = bpno > 0 ? -poshalf : -1;
-	for (k = 0; k < t1->h; k += 4) {
-		for (i = 0; i < t1->w; ++i) {
-			for (j = k; j < k + 4 && j < t1->h; ++j) {
-				vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
-				t1_dec_refpass_step(
-						t1,
-						&t1->flags[((j+1) * t1->flags_stride) + i + 1],
-						&t1->data[(j * t1->w) + i],
-						poshalf,
-						neghalf,
-						type,
-						vsc);
-			}
-		}
-	}
-}				/* VSC and  BYPASS by Antonin */
-
-static void t1_enc_clnpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int orient,
-		int bpno,
-		int one,
-		int *nmsedec,
-		int partial,
-		int vsc)
-{
-	int v, flag;
-
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
-	if (partial) {
-		goto LABEL_PARTIAL;
-	}
-	if (!(*flagsp & (T1_SIG | T1_VISIT))) {
-		mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient));
-		v = int_abs(*datap) & one ? 1 : 0;
-		mqc_encode(mqc, v);
-		if (v) {
-LABEL_PARTIAL:
-			*nmsedec += t1_getnmsedec_sig(int_abs(*datap), bpno + T1_NMSEDEC_FRACBITS);
-			mqc_setcurctx(mqc, t1_getctxno_sc(flag));
-			v = *datap < 0 ? 1 : 0;
-			mqc_encode(mqc, v ^ t1_getspb(flag));
-			t1_updateflags(flagsp, v, t1->flags_stride);
-			*flagsp |= T1_SIG;
-		}
-	}
-	*flagsp &= ~T1_VISIT;
-}
-
-static void t1_dec_clnpass_step(
-		opj_t1_t *t1,
-		flag_t *flagsp,
-		int *datap,
-		int orient,
-		int oneplushalf,
-		int partial,
-		int vsc)
-{
-	int v, flag;
-
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
-	if (partial) {
-		goto LABEL_PARTIAL;
-	}
-	if (!(flag & (T1_SIG | T1_VISIT))) {
-		mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient));
-		if (mqc_decode(mqc)) {
-LABEL_PARTIAL:
-			mqc_setcurctx(mqc, t1_getctxno_sc(flag));
-			v = mqc_decode(mqc) ^ t1_getspb(flag);
-			*datap = v ? -oneplushalf : oneplushalf;
-			t1_updateflags(flagsp, v, t1->flags_stride);
-			*flagsp |= T1_SIG;
-		}
-	}
-	*flagsp &= ~T1_VISIT;
-}				/* VSC and  BYPASS by Antonin */
-
-static void t1_enc_clnpass(
-		opj_t1_t *t1,
-		int bpno,
-		int orient,
-		int *nmsedec,
-		int cblksty)
-{
-	int i, j, k, one, agg, runlen, vsc;
-
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	*nmsedec = 0;
-	one = 1 << (bpno + T1_NMSEDEC_FRACBITS);
-	for (k = 0; k < t1->h; k += 4) {
-		for (i = 0; i < t1->w; ++i) {
-			if (k + 3 < t1->h) {
-				if (cblksty & J2K_CCP_CBLKSTY_VSC) {
-					agg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| (MACRO_t1_flags(1 + k + 3,1 + i)
-						& (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW |	T1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
-				} else {
-					agg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 3,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
-				}
-			} else {
-				agg = 0;
-			}
-			if (agg) {
-				for (runlen = 0; runlen < 4; ++runlen) {
-					if (int_abs(t1->data[((k + runlen)*t1->w) + i]) & one)
-						break;
-				}
-				mqc_setcurctx(mqc, T1_CTXNO_AGG);
-				mqc_encode(mqc, runlen != 4);
-				if (runlen == 4) {
-					continue;
-				}
-				mqc_setcurctx(mqc, T1_CTXNO_UNI);
-				mqc_encode(mqc, runlen >> 1);
-				mqc_encode(mqc, runlen & 1);
-			} else {
-				runlen = 0;
-			}
-			for (j = k + runlen; j < k + 4 && j < t1->h; ++j) {
-				vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
-				t1_enc_clnpass_step(
-						t1,
-						&t1->flags[((j+1) * t1->flags_stride) + i + 1],
-						&t1->data[(j * t1->w) + i],
-						orient,
-						bpno,
-						one,
-						nmsedec,
-						agg && (j == k + runlen),
-						vsc);
-			}
-		}
-	}
-}
-
-static void t1_dec_clnpass(
-		opj_t1_t *t1,
-		int bpno,
-		int orient,
-		int cblksty)
-{
-	int i, j, k, one, half, oneplushalf, agg, runlen, vsc;
-	int segsym = cblksty & J2K_CCP_CBLKSTY_SEGSYM;
-
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	one = 1 << bpno;
-	half = one >> 1;
-	oneplushalf = one | half;
-	for (k = 0; k < t1->h; k += 4) {
-		for (i = 0; i < t1->w; ++i) {
-			if (k + 3 < t1->h) {
-				if (cblksty & J2K_CCP_CBLKSTY_VSC) {
-					agg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| (MACRO_t1_flags(1 + k + 3,1 + i)
-						& (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW |	T1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
-				} else {
-					agg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
-						|| MACRO_t1_flags(1 + k + 3,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
-				}
-			} else {
-				agg = 0;
-			}
-			if (agg) {
-				mqc_setcurctx(mqc, T1_CTXNO_AGG);
-				if (!mqc_decode(mqc)) {
-					continue;
-				}
-				mqc_setcurctx(mqc, T1_CTXNO_UNI);
-				runlen = mqc_decode(mqc);
-				runlen = (runlen << 1) | mqc_decode(mqc);
-			} else {
-				runlen = 0;
-			}
-			for (j = k + runlen; j < k + 4 && j < t1->h; ++j) {
-				vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
-				t1_dec_clnpass_step(
-						t1,
-						&t1->flags[((j+1) * t1->flags_stride) + i + 1],
-						&t1->data[(j * t1->w) + i],
-						orient,
-						oneplushalf,
-						agg && (j == k + runlen),
-						vsc);
-			}
-		}
-	}
-	if (segsym) {
-		int v = 0;
-		mqc_setcurctx(mqc, T1_CTXNO_UNI);
-		v = mqc_decode(mqc);
-		v = (v << 1) | mqc_decode(mqc);
-		v = (v << 1) | mqc_decode(mqc);
-		v = (v << 1) | mqc_decode(mqc);
-		/*
-		if (v!=0xa) {
-			opj_event_msg(t1->cinfo, EVT_WARNING, "Bad segmentation symbol %x\n", v);
-		}
-		*/
-	}
-}				/* VSC and  BYPASS by Antonin */
-
-
-/** mod fixed_quality */
-static double t1_getwmsedec(
-		int nmsedec,
-		int compno,
-		int level,
-		int orient,
-		int bpno,
-		int qmfbid,
-		double stepsize,
-		int numcomps)
-{
-	double w1, w2, wmsedec;
-	if (qmfbid == 1) {
-		w1 = (numcomps > 1) ? mct_getnorm(compno) : 1.0;
-		w2 = dwt_getnorm(level, orient);
-	} else {			/* if (qmfbid == 0) */
-		w1 = (numcomps > 1) ? mct_getnorm_real(compno) : 1.0;
-		w2 = dwt_getnorm_real(level, orient);
-	}
-	wmsedec = w1 * w2 * stepsize * (1 << bpno);
-	wmsedec *= wmsedec * nmsedec / 8192.0;
-
-	return wmsedec;
-}
-
-static void allocate_buffers(
-		opj_t1_t *t1,
-		int w,
-		int h)
-{
-	int datasize;
-	int flagssize;
-
-	datasize=w * h;
-	//fprintf(stderr,"w=%i h=%i datasize=%i flagssize=%i\n",w,h,datasize,flagssize);
-
-	if(datasize > t1->datasize){
-		//fprintf(stderr,"Allocating t1->data: datasize=%i\n",datasize);
-		free(t1->data);
-		t1->data=malloc(datasize * sizeof(int));
-		if(!t1->data){
-			return;
-		}
-		t1->datasize=datasize;
-	}
-	//memset(t1->data,0xff,t1->datasize);
-	memset(t1->data,0,datasize * sizeof(int));
-
-	t1->flags_stride=w+2;
-	flagssize=t1->flags_stride * (h+2);
-
-	if(flagssize > t1->flagssize){
-		//fprintf(stderr,"Allocating t1->flags: flagssize=%i\n",flagssize);
-		free(t1->flags);
-		t1->flags=malloc(flagssize * sizeof(flag_t));
-		if(!t1->flags){
-			fprintf(stderr,"Allocating t1->flags FAILED!\n");
-			return;
-		}
-		t1->flagssize=flagssize;
-	}
-	//memset(t1->flags,0xff,t1->flagssize);
-	memset(t1->flags,0,flagssize * sizeof(flag_t));
-
-	t1->w=w;
-	t1->h=h;
-}
-
-/** mod fixed_quality */
-static void t1_encode_cblk(
-		opj_t1_t *t1,
-		opj_tcd_cblk_t * cblk,
-		int orient,
-		int compno,
-		int level,
-		int qmfbid,
-		double stepsize,
-		int cblksty,
-		int numcomps,
-		opj_tcd_tile_t * tile)
-{
-	int i, j;
-	int passno;
-	int bpno, passtype;
-	int max;
-	int nmsedec = 0;
-	double cumwmsedec = 0.0;
-	char type = T1_TYPE_MQ;
-
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	max = 0;
-	for (j = 0; j < t1->h; ++j) {
-		for (i = 0; i < t1->w; ++i) {
-			max = int_max(max, int_abs(t1->data[(j * t1->w) + i]));
-		}
-	}
-
-	cblk->numbps = max ? (int_floorlog2(max) + 1) - T1_NMSEDEC_FRACBITS : 0;
-
-	bpno = cblk->numbps - 1;
-	passtype = 2;
-
-	mqc_resetstates(mqc);
-	mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);
-	mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);
-	mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);
-	mqc_init_enc(mqc, cblk->data);
-
-	for (passno = 0; bpno >= 0; ++passno) {
-		opj_tcd_pass_t *pass = &cblk->passes[passno];
-		int correction = 3;
-		type = ((bpno < (cblk->numbps - 4)) && (passtype < 2) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
-
-		switch (passtype) {
-			case 0:
-				t1_enc_sigpass(t1, bpno, orient, &nmsedec, type, cblksty);
-				break;
-			case 1:
-				t1_enc_refpass(t1, bpno, &nmsedec, type, cblksty);
-				break;
-			case 2:
-				t1_enc_clnpass(t1, bpno, orient, &nmsedec, cblksty);
-				/* code switch SEGMARK (i.e. SEGSYM) */
-				if (cblksty & J2K_CCP_CBLKSTY_SEGSYM)
-					mqc_segmark_enc(mqc);
-				break;
-		}
-
-		/* fixed_quality */
-		cumwmsedec += t1_getwmsedec(nmsedec, compno, level, orient, bpno, qmfbid, stepsize, numcomps);
-		tile->distotile += t1_getwmsedec(nmsedec, compno, level, orient, bpno, qmfbid, stepsize, numcomps);
-
-		/* Code switch "RESTART" (i.e. TERMALL) */
-		if ((cblksty & J2K_CCP_CBLKSTY_TERMALL)	&& !((passtype == 2) && (bpno - 1 < 0))) {
-			if (type == T1_TYPE_RAW) {
-				mqc_flush(mqc);
-				correction = 1;
-				/* correction = mqc_bypass_flush_enc(); */
-			} else {			/* correction = mqc_restart_enc(); */
-				mqc_flush(mqc);
-				correction = 1;
-			}
-			pass->term = 1;
-		} else {
-			if (((bpno < (cblk->numbps - 4) && (passtype > 0))
-				|| ((bpno == (cblk->numbps - 4)) && (passtype == 2))) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) {
-				if (type == T1_TYPE_RAW) {
-					mqc_flush(mqc);
-					correction = 1;
-					/* correction = mqc_bypass_flush_enc(); */
-				} else {		/* correction = mqc_restart_enc(); */
-					mqc_flush(mqc);
-					correction = 1;
-				}
-				pass->term = 1;
-			} else {
-				pass->term = 0;
-			}
-		}
-
-		if (++passtype == 3) {
-			passtype = 0;
-			bpno--;
-		}
-
-		if (pass->term && bpno > 0) {
-			type = ((bpno < (cblk->numbps - 4)) && (passtype < 2) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
-			if (type == T1_TYPE_RAW)
-				mqc_bypass_init_enc(mqc);
-			else
-				mqc_restart_init_enc(mqc);
-		}
-
-		pass->distortiondec = cumwmsedec;
-		pass->rate = mqc_numbytes(mqc) + correction;	/* FIXME */
-
-		/* Code-switch "RESET" */
-		if (cblksty & J2K_CCP_CBLKSTY_RESET)
-			mqc_reset_enc(mqc);
-	}
-
-	/* Code switch "ERTERM" (i.e. PTERM) */
-	if (cblksty & J2K_CCP_CBLKSTY_PTERM)
-		mqc_erterm_enc(mqc);
-	else /* Default coding */ if (!(cblksty & J2K_CCP_CBLKSTY_LAZY))
-		mqc_flush(mqc);
-
-	cblk->totalpasses = passno;
-
-	for (passno = 0; passno<cblk->totalpasses; passno++) {
-		opj_tcd_pass_t *pass = &cblk->passes[passno];
-		if (pass->rate > mqc_numbytes(mqc))
-			pass->rate = mqc_numbytes(mqc);
-		/*Preventing generation of FF as last data byte of a pass*/
-		if((pass->rate>1) && (cblk->data[pass->rate - 1] == 0xFF)){
-			pass->rate--;
-		}
-		pass->len = pass->rate - (passno == 0 ? 0 : cblk->passes[passno - 1].rate);
-	}
-}
-
-static void t1_decode_cblk(
-		opj_t1_t *t1,
-		opj_tcd_cblk_t * cblk,
-		int orient,
-		int roishift,
-		int cblksty)
-{
-	int bpno, passtype;
-	int segno, passno;
-	char type = T1_TYPE_MQ; /* BYPASS mode */
-
-	opj_raw_t *raw = t1->raw;	/* RAW component */
-	opj_mqc_t *mqc = t1->mqc;	/* MQC component */
-
-	allocate_buffers(
-			t1,
-			cblk->x1 - cblk->x0,
-			cblk->y1 - cblk->y0);
-
-	bpno = roishift + cblk->numbps - 1;
-	passtype = 2;
-
-	mqc_resetstates(mqc);
-	mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);
-	mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);
-	mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);
-
-	for (segno = 0; segno < cblk->numsegs; ++segno) {
-		opj_tcd_seg_t *seg = &cblk->segs[segno];
-
-		/* BYPASS mode */
-		type = ((bpno <= (cblk->numbps - 1) - 4) && (passtype < 2) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
-		if (type == T1_TYPE_RAW) {
-			raw_init_dec(raw, seg->data, seg->len);
-		} else {
-			mqc_init_dec(mqc, seg->data, seg->len);
-		}
-
-		for (passno = 0; passno < seg->numpasses; ++passno) {
-			switch (passtype) {
-				case 0:
-					t1_dec_sigpass(t1, bpno+1, orient, type, cblksty);
-					break;
-				case 1:
-					t1_dec_refpass(t1, bpno+1, type, cblksty);
-					break;
-				case 2:
-					t1_dec_clnpass(t1, bpno+1, orient, cblksty);
-					break;
-			}
-
-			if ((cblksty & J2K_CCP_CBLKSTY_RESET) && type == T1_TYPE_MQ) {
-				mqc_resetstates(mqc);
-				mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);
-				mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);
-				mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);
-			}
-			if (++passtype == 3) {
-				passtype = 0;
-				bpno--;
-			}
-		}
-	}
-}
-
-/* ----------------------------------------------------------------------- */
-
-opj_t1_t* t1_create(opj_common_ptr cinfo) {
-	opj_t1_t *t1 = (opj_t1_t*) malloc(sizeof(opj_t1_t));
-	if(!t1)
-		return NULL;
-
-		t1->cinfo = cinfo;
-		/* create MQC and RAW handles */
-		t1->mqc = mqc_create();
-		t1->raw = raw_create();
-
-	t1->datasize=0;
-	t1->data=NULL;
-	t1->flagssize=0;
-	t1->flags=NULL;
-
-	return t1;
-}
-
-void t1_destroy(opj_t1_t *t1) {
-	if(t1) {
-		/* destroy MQC and RAW handles */
-		mqc_destroy(t1->mqc);
-		raw_destroy(t1->raw);
-		free(t1->data);
-		free(t1->flags);
-		free(t1);
-	}
-}
-
-void t1_encode_cblks(
-		opj_t1_t *t1,
-		opj_tcd_tile_t *tile,
-		opj_tcp_t *tcp)
-{
-	int compno, resno, bandno, precno, cblkno;
-
-	tile->distotile = 0;		/* fixed_quality */
-
-	for (compno = 0; compno < tile->numcomps; ++compno) {
-		opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-
-		for (resno = 0; resno < tilec->numresolutions; ++resno) {
-			opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-			for (bandno = 0; bandno < res->numbands; ++bandno) {
-				opj_tcd_band_t *band = &res->bands[bandno];
-
-				for (precno = 0; precno < res->pw * res->ph; ++precno) {
-					opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-					for (cblkno = 0; cblkno < prc->cw * prc->ch; ++cblkno) {
-						int x, y, w, i, j, orient;
-						opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-
-						x = cblk->x0 - band->x0;
-						y = cblk->y0 - band->y0;
-						if (band->bandno & 1) {
-							opj_tcd_resolution_t *pres = &tilec->resolutions[resno - 1];
-							x += pres->x1 - pres->x0;
-						}
-						if (band->bandno & 2) {
-							opj_tcd_resolution_t *pres = &tilec->resolutions[resno - 1];
-							y += pres->y1 - pres->y0;
-						}
-
-						allocate_buffers(
-								t1,
-								cblk->x1 - cblk->x0,
-								cblk->y1 - cblk->y0);
-
-						w = tilec->x1 - tilec->x0;
-						if (tcp->tccps[compno].qmfbid == 1) {
-							for (j = 0; j < t1->h; ++j) {
-								for (i = 0; i < t1->w; ++i) {
-									t1->data[(j * t1->w) + i] =
-										tilec->data[(x + i) + (y + j) * w] << T1_NMSEDEC_FRACBITS;
-								}
-							}
-						} else {		/* if (tcp->tccps[compno].qmfbid == 0) */
-							for (j = 0; j < t1->h; ++j) {
-								for (i = 0; i < t1->w; ++i) {
-									t1->data[(j * t1->w) + i] =
-										fix_mul(
-										tilec->data[x + i + (y + j) * w],
-										8192 * 8192 / ((int) floor(band->stepsize * 8192))) >> (11 - T1_NMSEDEC_FRACBITS);
-								}
-							}
-						}
-						orient = band->bandno;	/* FIXME */
-						if (orient == 2) {
-							orient = 1;
-						} else if (orient == 1) {
-							orient = 2;
-						}
-
-						t1_encode_cblk(
-								t1,
-								cblk,
-								orient,
-								compno,
-								tilec->numresolutions - 1 - resno,
-								tcp->tccps[compno].qmfbid,
-								band->stepsize,
-								tcp->tccps[compno].cblksty,
-								tile->numcomps,
-								tile);
-
-					} /* cblkno */
-				} /* precno */
-			} /* bandno */
-		} /* resno  */
-	} /* compno  */
-}
-
-void t1_decode_cblks(
-		opj_t1_t *t1,
-		opj_tcd_tile_t *tile,
-		opj_tcp_t *tcp)
-{
-	int compno, resno, bandno, precno, cblkno;
-
-	for (compno = 0; compno < tile->numcomps; ++compno) {
-		opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-
-		for (resno = 0; resno < tilec->numresolutions; ++resno) {
-			opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-			for (bandno = 0; bandno < res->numbands; ++bandno) {
-				opj_tcd_band_t *band = &res->bands[bandno];
-
-				for (precno = 0; precno < res->pw * res->ph; ++precno) {
-					opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-					for (cblkno = 0; cblkno < prc->cw * prc->ch; ++cblkno) {
-						int x, y, w, i, j, orient, cblk_w, cblk_h;
-						opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-
-						orient = band->bandno;	/* FIXME */
-						if (orient == 2) {
-							orient = 1;
-						} else if (orient == 1) {
-							orient = 2;
-						}
-
-						t1_decode_cblk(
-								t1,
-								cblk,
-								orient,
-								tcp->tccps[compno].roishift,
-								tcp->tccps[compno].cblksty);
-
-						x = cblk->x0 - band->x0;
-						y = cblk->y0 - band->y0;
-						if (band->bandno & 1) {
-							opj_tcd_resolution_t *pres = &tilec->resolutions[resno - 1];
-							x += pres->x1 - pres->x0;
-						}
-						if (band->bandno & 2) {
-							opj_tcd_resolution_t *pres = &tilec->resolutions[resno - 1];
-							y += pres->y1 - pres->y0;
-						}
-
-						cblk_w = cblk->x1 - cblk->x0;
-						cblk_h = cblk->y1 - cblk->y0;
-
-						if (tcp->tccps[compno].roishift) {
-							int thresh = 1 << tcp->tccps[compno].roishift;
-							for (j = 0; j < cblk_h; ++j) {
-								for (i = 0; i < cblk_w; ++i) {
-									int val = t1->data[(j * t1->w) + i];
-									int mag = int_abs(val);
-									if (mag >= thresh) {
-										mag >>= tcp->tccps[compno].roishift;
-										t1->data[(j * t1->w) + i] = val < 0 ? -mag : mag;
-									}
-								}
-							}
-						}
-
-						w = tilec->x1 - tilec->x0;
-						if (tcp->tccps[compno].qmfbid == 1) {
-							for (j = 0; j < cblk_h; ++j) {
-								for (i = 0; i < cblk_w; ++i) {
-									tilec->data[x + i + (y + j) * w] = t1->data[(j * t1->w) + i]/2;
-								}
-							}
-						} else {		/* if (tcp->tccps[compno].qmfbid == 0) */
-							for (j = 0; j < cblk_h; ++j) {
-								for (i = 0; i < cblk_w; ++i) {
-									if (t1->data[(j * t1->w) + i] >> 1 == 0) {
-										tilec->data[x + i + (y + j) * w] = 0;
-									} else {
-										double tmp = (double)(t1->data[(j * t1->w) + i] * band->stepsize * 4096.0);
-										int tmp2 = ((int) (floor(fabs(tmp)))) + ((int) floor(fabs(tmp*2))%2);
-										tilec->data[x + i + (y + j) * w] = ((tmp<0)?-tmp2:tmp2);
-									}
-								}
-							}
-						}
-					} /* cblkno */
-				} /* precno */
-			} /* bandno */
-		} /* resno */
-	} /* compno */
-}
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/t1.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/t1.h
deleted file mode 100644
index 1b6cdb7..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/t1.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __T1_H
-#define __T1_H
-/**
-@file t1.h
-@brief Implementation of the tier-1 coding (coding of code-block coefficients) (T1)
-
-The functions in T1.C have for goal to realize the tier-1 coding operation. The functions
-in T1.C are used by some function in TCD.C.
-*/
-
-/** @defgroup T1 T1 - Implementation of the tier-1 coding */
-/*@{*/
-
-/* ----------------------------------------------------------------------- */
-#define T1_NMSEDEC_BITS 7
-
-#define T1_SIG_NE 0x0001	/**< Context orientation : North-East direction */
-#define T1_SIG_SE 0x0002	/**< Context orientation : South-East direction */
-#define T1_SIG_SW 0x0004	/**< Context orientation : South-West direction */
-#define T1_SIG_NW 0x0008	/**< Context orientation : North-West direction */
-#define T1_SIG_N 0x0010		/**< Context orientation : North direction */
-#define T1_SIG_E 0x0020		/**< Context orientation : East direction */
-#define T1_SIG_S 0x0040		/**< Context orientation : South direction */
-#define T1_SIG_W 0x0080		/**< Context orientation : West direction */
-#define T1_SIG_OTH (T1_SIG_N|T1_SIG_NE|T1_SIG_E|T1_SIG_SE|T1_SIG_S|T1_SIG_SW|T1_SIG_W|T1_SIG_NW)
-#define T1_SIG_PRIM (T1_SIG_N|T1_SIG_E|T1_SIG_S|T1_SIG_W)
-
-#define T1_SGN_N 0x0100
-#define T1_SGN_E 0x0200
-#define T1_SGN_S 0x0400
-#define T1_SGN_W 0x0800
-#define T1_SGN (T1_SGN_N|T1_SGN_E|T1_SGN_S|T1_SGN_W)
-
-#define T1_SIG 0x1000
-#define T1_REFINE 0x2000
-#define T1_VISIT 0x4000
-
-#define T1_NUMCTXS_ZC 9
-#define T1_NUMCTXS_SC 5
-#define T1_NUMCTXS_MAG 3
-#define T1_NUMCTXS_AGG 1
-#define T1_NUMCTXS_UNI 1
-
-#define T1_CTXNO_ZC 0
-#define T1_CTXNO_SC (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
-#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
-#define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
-#define T1_CTXNO_UNI (T1_CTXNO_AGG+T1_NUMCTXS_AGG)
-#define T1_NUMCTXS (T1_CTXNO_UNI+T1_NUMCTXS_UNI)
-
-#define T1_NMSEDEC_FRACBITS (T1_NMSEDEC_BITS-1)
-
-#define T1_TYPE_MQ 0	/**< Normal coding using entropy coder */
-#define T1_TYPE_RAW 1	/**< No encoding the information is store under raw format in codestream (mode switch RAW)*/
-
-/* ----------------------------------------------------------------------- */
-
-typedef short flag_t;
-
-/**
-Tier-1 coding (coding of code-block coefficients)
-*/
-typedef struct opj_t1 {
-	/** codec context */
-	opj_common_ptr cinfo;
-
-	/** MQC component */
-	opj_mqc_t *mqc;
-	/** RAW component */
-	opj_raw_t *raw;
-
-	int *data;
-	flag_t *flags;
-	int w;
-	int h;
-	int datasize;
-	int flagssize;
-	int flags_stride;
-} opj_t1_t;
-
-#define MACRO_t1_flags(x,y) t1->flags[((x)*(t1->flags_stride))+(y)]
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Create a new T1 handle
-and initialize the look-up tables of the Tier-1 coder/decoder
-@return Returns a new T1 handle if successful, returns NULL otherwise
-@see t1_init_luts
-*/
-opj_t1_t* t1_create(opj_common_ptr cinfo);
-/**
-Destroy a previously created T1 handle
-@param t1 T1 handle to destroy
-*/
-void t1_destroy(opj_t1_t *t1);
-/**
-Encode the code-blocks of a tile
-@param t1 T1 handle
-@param tile The tile to encode
-@param tcp Tile coding parameters
-*/
-void t1_encode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp);
-/**
-Decode the code-blocks of a tile
-@param t1 T1 handle
-@param tile The tile to decode
-@param tcp Tile coding parameters
-*/
-void t1_decode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __T1_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/t1_generate_luts.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/t1_generate_luts.c
deleted file mode 100644
index 62cb158..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/t1_generate_luts.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-#include <math.h>
-
-static int t1_init_ctxno_zc(int f, int orient) {
-	int h, v, d, n, t, hv;
-	n = 0;
-	h = ((f & T1_SIG_W) != 0) + ((f & T1_SIG_E) != 0);
-	v = ((f & T1_SIG_N) != 0) + ((f & T1_SIG_S) != 0);
-	d = ((f & T1_SIG_NW) != 0) + ((f & T1_SIG_NE) != 0) + ((f & T1_SIG_SE) != 0) + ((f & T1_SIG_SW) != 0);
-
-	switch (orient) {
-		case 2:
-			t = h;
-			h = v;
-			v = t;
-		case 0:
-		case 1:
-			if (!h) {
-				if (!v) {
-					if (!d)
-						n = 0;
-					else if (d == 1)
-						n = 1;
-					else
-						n = 2;
-				} else if (v == 1) {
-					n = 3;
-				} else {
-					n = 4;
-				}
-			} else if (h == 1) {
-				if (!v) {
-					if (!d)
-						n = 5;
-					else
-						n = 6;
-				} else {
-					n = 7;
-				}
-			} else
-				n = 8;
-			break;
-		case 3:
-			hv = h + v;
-			if (!d) {
-				if (!hv) {
-					n = 0;
-				} else if (hv == 1) {
-					n = 1;
-				} else {
-					n = 2;
-				}
-			} else if (d == 1) {
-				if (!hv) {
-					n = 3;
-				} else if (hv == 1) {
-					n = 4;
-				} else {
-					n = 5;
-				}
-			} else if (d == 2) {
-				if (!hv) {
-					n = 6;
-				} else {
-					n = 7;
-				}
-			} else {
-				n = 8;
-			}
-			break;
-	}
-
-	return (T1_CTXNO_ZC + n);
-}
-
-static int t1_init_ctxno_sc(int f) {
-	int hc, vc, n;
-	n = 0;
-
-	hc = int_min(((f & (T1_SIG_E | T1_SGN_E)) ==
-				T1_SIG_E) + ((f & (T1_SIG_W | T1_SGN_W)) == T1_SIG_W),
-			1) - int_min(((f & (T1_SIG_E | T1_SGN_E)) ==
-					(T1_SIG_E | T1_SGN_E)) +
-				((f & (T1_SIG_W | T1_SGN_W)) ==
-				 (T1_SIG_W | T1_SGN_W)), 1);
-
-	vc = int_min(((f & (T1_SIG_N | T1_SGN_N)) ==
-				T1_SIG_N) + ((f & (T1_SIG_S | T1_SGN_S)) == T1_SIG_S),
-			1) - int_min(((f & (T1_SIG_N | T1_SGN_N)) ==
-					(T1_SIG_N | T1_SGN_N)) +
-				((f & (T1_SIG_S | T1_SGN_S)) ==
-				 (T1_SIG_S | T1_SGN_S)), 1);
-
-	if (hc < 0) {
-		hc = -hc;
-		vc = -vc;
-	}
-	if (!hc) {
-		if (vc == -1)
-			n = 1;
-		else if (!vc)
-			n = 0;
-		else
-			n = 1;
-	} else if (hc == 1) {
-		if (vc == -1)
-			n = 2;
-		else if (!vc)
-			n = 3;
-		else
-			n = 4;
-	}
-
-	return (T1_CTXNO_SC + n);
-}
-
-static int t1_init_ctxno_mag(int f) {
-	int n;
-	if (!(f & T1_REFINE))
-		n = (f & (T1_SIG_OTH)) ? 1 : 0;
-	else
-		n = 2;
-
-	return (T1_CTXNO_MAG + n);
-}
-
-static int t1_init_spb(int f) {
-	int hc, vc, n;
-
-	hc = int_min(((f & (T1_SIG_E | T1_SGN_E)) ==
-				T1_SIG_E) + ((f & (T1_SIG_W | T1_SGN_W)) == T1_SIG_W),
-			1) - int_min(((f & (T1_SIG_E | T1_SGN_E)) ==
-					(T1_SIG_E | T1_SGN_E)) +
-				((f & (T1_SIG_W | T1_SGN_W)) ==
-				 (T1_SIG_W | T1_SGN_W)), 1);
-
-	vc = int_min(((f & (T1_SIG_N | T1_SGN_N)) ==
-				T1_SIG_N) + ((f & (T1_SIG_S | T1_SGN_S)) == T1_SIG_S),
-			1) - int_min(((f & (T1_SIG_N | T1_SGN_N)) ==
-					(T1_SIG_N | T1_SGN_N)) +
-				((f & (T1_SIG_S | T1_SGN_S)) ==
-				 (T1_SIG_S | T1_SGN_S)), 1);
-
-	if (!hc && !vc)
-		n = 0;
-	else
-		n = (!(hc > 0 || (!hc && vc > 0)));
-
-	return n;
-}
-
-void dump_array16(int array[],int size){
-	int i;
-	--size;
-	for (i = 0; i < size; ++i) {
-		printf("0x%04x, ", array[i]);
-		if(!((i+1)&0x7))
-			printf("\n  ");
-	}
-	printf("0x%04x\n};\n\n", array[size]);
-}
-
-int main(){
-	int i, j;
-	double u, v, t;
-
-	int lut_ctxno_zc[1024];
-	int lut_ctxno_mag[4096];
-	int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];
-	int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];
-	int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];
-	int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS];
-
-	printf("/* This file was automatically generated by t1_generate_luts.c */\n\n");
-
-	// lut_ctxno_zc
-	for (j = 0; j < 4; ++j) {
-		for (i = 0; i < 256; ++i) {
-			lut_ctxno_zc[(j << 8) | i] = t1_init_ctxno_zc(i, j);
-		}
-	}
-
-	printf("static int8_t lut_ctxno_zc[1024] = {\n  ");
-	for (i = 0; i < 1023; ++i) {
-		printf("%i, ", lut_ctxno_zc[i]);
-		if(!((i+1)&0x1f))
-			printf("\n  ");
-	}
-	printf("%i\n};\n\n", lut_ctxno_zc[1023]);
-
-	// lut_ctxno_sc
-	printf("static int8_t lut_ctxno_sc[256] = {\n  ");
-	for (i = 0; i < 255; ++i) {
-		printf("0x%x, ", t1_init_ctxno_sc(i << 4));
-		if(!((i+1)&0xf))
-			printf("\n  ");
-	}
-	printf("0x%x\n};\n\n", t1_init_ctxno_sc(255 << 4));
-
-	// lut_ctxno_mag
-	for (j = 0; j < 2; ++j) {
-		for (i = 0; i < 2048; ++i) {
-			lut_ctxno_mag[(j << 11) + i] = t1_init_ctxno_mag((j ? T1_REFINE : 0) | i);
-		}
-	}
-
-	printf("static int8_t lut_ctxno_mag[4096] = {\n  ");
-	for (i = 0; i < 4095; ++i) {
-		printf("%i, ", lut_ctxno_mag[i]);
-		if(!((i+1)&0xf))
-			printf("\n  ");
-	}
-	printf("%i\n};\n\n", lut_ctxno_mag[4095]);
-
-	// lut_spb
-	printf("static int8_t lut_spb[256] = {\n  ");
-	for (i = 0; i < 255; ++i) {
-		printf("%i, ", t1_init_spb(i << 4));
-		if(!((i+1)&0x1f))
-			printf("\n  ");
-	}
-	printf("%i\n};\n\n", t1_init_spb(255 << 4));
-
-	/* FIXME FIXME FIXME */
-	/* fprintf(stdout,"nmsedec luts:\n"); */
-	for (i = 0; i < (1 << T1_NMSEDEC_BITS); ++i) {
-		t = i / pow(2, T1_NMSEDEC_FRACBITS);
-		u = t;
-		v = t - 1.5;
-		lut_nmsedec_sig[i] =
-			int_max(0,
-					(int) (floor((u * u - v * v) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));
-		lut_nmsedec_sig0[i] =
-			int_max(0,
-					(int) (floor((u * u) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));
-		u = t - 1.0;
-		if (i & (1 << (T1_NMSEDEC_BITS - 1))) {
-			v = t - 1.5;
-		} else {
-			v = t - 0.5;
-		}
-		lut_nmsedec_ref[i] =
-			int_max(0,
-					(int) (floor((u * u - v * v) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));
-		lut_nmsedec_ref0[i] =
-			int_max(0,
-					(int) (floor((u * u) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));
-	}
-
-	printf("static int16_t lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {\n  ");
-	dump_array16(&lut_nmsedec_sig, 1 << T1_NMSEDEC_BITS);
-
-	printf("static int16_t lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {\n  ");
-	dump_array16(&lut_nmsedec_sig0, 1 << T1_NMSEDEC_BITS);
-
-	printf("static int16_t lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {\n  ");
-	dump_array16(&lut_nmsedec_ref, 1 << T1_NMSEDEC_BITS);
-
-	printf("static int16_t lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {\n  ");
-	dump_array16(&lut_nmsedec_ref0, 1 << T1_NMSEDEC_BITS);
-
-	return 0;
-}
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/t1_luts.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/t1_luts.h
deleted file mode 100644
index 3f957f3..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/t1_luts.h
+++ /dev/null
@@ -1,402 +0,0 @@
-/* This file was automatically generated by t1_generate_luts.c */
-
-static char lut_ctxno_zc[1024] = {
-  0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-  0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-  0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-  0, 3, 3, 6, 3, 6, 6, 8, 3, 6, 6, 8, 6, 8, 8, 8, 1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8,
-  1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
-  1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
-  2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
-  1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
-  2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
-  2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
-  2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8
-};
-
-static char lut_ctxno_sc[256] = {
-  0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xd, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd,
-  0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xb, 0xc, 0xb, 0xd, 0xc, 0xd, 0xc,
-  0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xd, 0x9, 0xa, 0xd, 0xd, 0xa, 0xa,
-  0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xb, 0x9, 0xa, 0xd, 0xc, 0xa, 0x9,
-  0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xd, 0xc, 0xd, 0xb, 0xc, 0xb, 0xc,
-  0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xb, 0xc, 0xb, 0xb, 0xb, 0xb, 0xb,
-  0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xd, 0x9, 0xa, 0xb, 0xc, 0xa, 0x9,
-  0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xb, 0x9, 0xa, 0xb, 0xb, 0xa, 0xa,
-  0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xb, 0x9, 0xa, 0xb, 0xb, 0xa, 0xa,
-  0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xd, 0x9, 0xa, 0xb, 0xc, 0xa, 0x9,
-  0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xb, 0xc, 0xb, 0xb, 0xb, 0xb, 0xb,
-  0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xd, 0xc, 0xd, 0xb, 0xc, 0xb, 0xc,
-  0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xb, 0x9, 0xa, 0xd, 0xc, 0xa, 0x9,
-  0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xd, 0x9, 0xa, 0xd, 0xd, 0xa, 0xa,
-  0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xb, 0xc, 0xb, 0xd, 0xc, 0xd, 0xc,
-  0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xd, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd
-};
-
-static char lut_ctxno_mag[4096] = {
-  14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
-};
-
-static char lut_spb[256] = {
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0,
-  0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1,
-  0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0,
-  0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1,
-  0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-};
-
-static short lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0180, 0x0300, 0x0480, 0x0600, 0x0780, 0x0900, 0x0a80,
-  0x0c00, 0x0d80, 0x0f00, 0x1080, 0x1200, 0x1380, 0x1500, 0x1680,
-  0x1800, 0x1980, 0x1b00, 0x1c80, 0x1e00, 0x1f80, 0x2100, 0x2280,
-  0x2400, 0x2580, 0x2700, 0x2880, 0x2a00, 0x2b80, 0x2d00, 0x2e80,
-  0x3000, 0x3180, 0x3300, 0x3480, 0x3600, 0x3780, 0x3900, 0x3a80,
-  0x3c00, 0x3d80, 0x3f00, 0x4080, 0x4200, 0x4380, 0x4500, 0x4680,
-  0x4800, 0x4980, 0x4b00, 0x4c80, 0x4e00, 0x4f80, 0x5100, 0x5280,
-  0x5400, 0x5580, 0x5700, 0x5880, 0x5a00, 0x5b80, 0x5d00, 0x5e80,
-  0x6000, 0x6180, 0x6300, 0x6480, 0x6600, 0x6780, 0x6900, 0x6a80,
-  0x6c00, 0x6d80, 0x6f00, 0x7080, 0x7200, 0x7380, 0x7500, 0x7680
-};
-
-static short lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0080,
-  0x0080, 0x0080, 0x0100, 0x0100, 0x0100, 0x0180, 0x0180, 0x0200,
-  0x0200, 0x0280, 0x0280, 0x0300, 0x0300, 0x0380, 0x0400, 0x0400,
-  0x0480, 0x0500, 0x0580, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780,
-  0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b80, 0x0c00,
-  0x0c80, 0x0d00, 0x0e00, 0x0e80, 0x0f00, 0x1000, 0x1080, 0x1180,
-  0x1200, 0x1300, 0x1380, 0x1480, 0x1500, 0x1600, 0x1700, 0x1780,
-  0x1880, 0x1980, 0x1a80, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00,
-  0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2680, 0x2780,
-  0x2880, 0x2980, 0x2b00, 0x2c00, 0x2d00, 0x2e80, 0x2f80, 0x3100,
-  0x3200, 0x3380, 0x3480, 0x3600, 0x3700, 0x3880, 0x3a00, 0x3b00,
-  0x3c80, 0x3e00, 0x3f80, 0x4080, 0x4200, 0x4380, 0x4500, 0x4680,
-  0x4800, 0x4980, 0x4b00, 0x4c80, 0x4e00, 0x4f80, 0x5180, 0x5300,
-  0x5480, 0x5600, 0x5800, 0x5980, 0x5b00, 0x5d00, 0x5e80, 0x6080,
-  0x6200, 0x6400, 0x6580, 0x6780, 0x6900, 0x6b00, 0x6d00, 0x6e80,
-  0x7080, 0x7280, 0x7480, 0x7600, 0x7800, 0x7a00, 0x7c00, 0x7e00
-};
-
-static short lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {
-  0x1800, 0x1780, 0x1700, 0x1680, 0x1600, 0x1580, 0x1500, 0x1480,
-  0x1400, 0x1380, 0x1300, 0x1280, 0x1200, 0x1180, 0x1100, 0x1080,
-  0x1000, 0x0f80, 0x0f00, 0x0e80, 0x0e00, 0x0d80, 0x0d00, 0x0c80,
-  0x0c00, 0x0b80, 0x0b00, 0x0a80, 0x0a00, 0x0980, 0x0900, 0x0880,
-  0x0800, 0x0780, 0x0700, 0x0680, 0x0600, 0x0580, 0x0500, 0x0480,
-  0x0400, 0x0380, 0x0300, 0x0280, 0x0200, 0x0180, 0x0100, 0x0080,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0080, 0x0100, 0x0180, 0x0200, 0x0280, 0x0300, 0x0380,
-  0x0400, 0x0480, 0x0500, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780,
-  0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b00, 0x0b80,
-  0x0c00, 0x0c80, 0x0d00, 0x0d80, 0x0e00, 0x0e80, 0x0f00, 0x0f80,
-  0x1000, 0x1080, 0x1100, 0x1180, 0x1200, 0x1280, 0x1300, 0x1380,
-  0x1400, 0x1480, 0x1500, 0x1580, 0x1600, 0x1680, 0x1700, 0x1780
-};
-
-static short lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {
-  0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x1b00, 0x1a80, 0x1980,
-  0x1880, 0x1780, 0x1700, 0x1600, 0x1500, 0x1480, 0x1380, 0x1300,
-  0x1200, 0x1180, 0x1080, 0x1000, 0x0f00, 0x0e80, 0x0e00, 0x0d00,
-  0x0c80, 0x0c00, 0x0b80, 0x0a80, 0x0a00, 0x0980, 0x0900, 0x0880,
-  0x0800, 0x0780, 0x0700, 0x0680, 0x0600, 0x0580, 0x0580, 0x0500,
-  0x0480, 0x0400, 0x0400, 0x0380, 0x0300, 0x0300, 0x0280, 0x0280,
-  0x0200, 0x0200, 0x0180, 0x0180, 0x0100, 0x0100, 0x0100, 0x0080,
-  0x0080, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0080,
-  0x0080, 0x0080, 0x0100, 0x0100, 0x0100, 0x0180, 0x0180, 0x0200,
-  0x0200, 0x0280, 0x0280, 0x0300, 0x0300, 0x0380, 0x0400, 0x0400,
-  0x0480, 0x0500, 0x0580, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780,
-  0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b80, 0x0c00,
-  0x0c80, 0x0d00, 0x0e00, 0x0e80, 0x0f00, 0x1000, 0x1080, 0x1180,
-  0x1200, 0x1300, 0x1380, 0x1480, 0x1500, 0x1600, 0x1700, 0x1780,
-  0x1880, 0x1980, 0x1a80, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00
-};
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/t2.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/t2.c
deleted file mode 100644
index dc8e24e..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/t2.c
+++ /dev/null
@@ -1,721 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/** @defgroup T2 T2 - Implementation of a tier-2 coding */
-/*@{*/
-
-/** @name Local static functions */
-/*@{*/
-
-static void t2_putcommacode(opj_bio_t *bio, int n);
-static int t2_getcommacode(opj_bio_t *bio);
-/**
-Variable length code for signalling delta Zil (truncation point)
-@param bio Bit Input/Output component
-@param n delta Zil
-*/
-static void t2_putnumpasses(opj_bio_t *bio, int n);
-static int t2_getnumpasses(opj_bio_t *bio);
-/**
-Encode a packet of a tile to a destination buffer
-@param tile Tile for which to write the packets
-@param tcp Tile coding parameters
-@param pi Packet identity
-@param dest Destination buffer
-@param len Length of the destination buffer
-@param image_info Structure to create an index file
-@param tileno Number of the tile encoded
-@return
-*/
-static int t2_encode_packet(opj_tcd_tile_t *tile, opj_tcp_t *tcp, opj_pi_iterator_t *pi, unsigned char *dest, int len, opj_image_info_t *image_info, int tileno);
-/**
-@param seg
-@param cblksty
-@param first
-*/
-static void t2_init_seg(opj_tcd_seg_t *seg, int cblksty, int first);
-/**
-Decode a packet of a tile from a source buffer
-@param t2 T2 handle
-@param src Source buffer
-@param len Length of the source buffer
-@param tile Tile for which to write the packets
-@param tcp Tile coding parameters
-@param pi Packet identity
-@return
-*/
-static int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_tile_t *tile, opj_tcp_t *tcp, opj_pi_iterator_t *pi);
-
-/*@}*/
-
-/*@}*/
-
-/* ----------------------------------------------------------------------- */
-
-/* #define RESTART 0x04 */
-
-static void t2_putcommacode(opj_bio_t *bio, int n) {
-	while (--n >= 0) {
-		bio_write(bio, 1, 1);
-	}
-	bio_write(bio, 0, 1);
-}
-
-static int t2_getcommacode(opj_bio_t *bio) {
-	int n;
-	for (n = 0; bio_read(bio, 1); n++) {
-		;
-	}
-	return n;
-}
-
-static void t2_putnumpasses(opj_bio_t *bio, int n) {
-	if (n == 1) {
-		bio_write(bio, 0, 1);
-	} else if (n == 2) {
-		bio_write(bio, 2, 2);
-	} else if (n <= 5) {
-		bio_write(bio, 0xc | (n - 3), 4);
-	} else if (n <= 36) {
-		bio_write(bio, 0x1e0 | (n - 6), 9);
-	} else if (n <= 164) {
-		bio_write(bio, 0xff80 | (n - 37), 16);
-	}
-}
-
-static int t2_getnumpasses(opj_bio_t *bio) {
-	int n;
-	if (!bio_read(bio, 1))
-		return 1;
-	if (!bio_read(bio, 1))
-		return 2;
-	if ((n = bio_read(bio, 2)) != 3)
-		return (3 + n);
-	if ((n = bio_read(bio, 5)) != 31)
-		return (6 + n);
-	return (37 + bio_read(bio, 7));
-}
-
-static int t2_encode_packet(opj_tcd_tile_t * tile, opj_tcp_t * tcp, opj_pi_iterator_t *pi, unsigned char *dest, int length, opj_image_info_t * image_info, int tileno) {
-	int bandno, cblkno;
-	unsigned char *sop = 0, *eph = 0;
-	unsigned char *c = dest;
-
-	int compno = pi->compno;	/* component value */
-	int resno  = pi->resno;		/* resolution level value */
-	int precno = pi->precno;	/* precinct value */
-	int layno  = pi->layno;		/* quality layer value */
-
-	opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-	opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-	opj_bio_t *bio = NULL;	/* BIO component */
-
-	/* <SOP 0xff91> */
-	if (tcp->csty & J2K_CP_CSTY_SOP) {
-		sop = (unsigned char *) opj_malloc(6 * sizeof(unsigned char));
-		sop[0] = 255;
-		sop[1] = 145;
-		sop[2] = 0;
-		sop[3] = 4;
-		sop[4] = (image_info->num % 65536) / 256;
-		sop[5] = (image_info->num % 65536) % 256;
-		memcpy(c, sop, 6);
-		opj_free(sop);
-		c += 6;
-	}
-	/* </SOP> */
-
-	if (!layno) {
-		for (bandno = 0; bandno < res->numbands; bandno++) {
-			opj_tcd_band_t *band = &res->bands[bandno];
-			opj_tcd_precinct_t *prc = &band->precincts[precno];
-			tgt_reset(prc->incltree);
-			tgt_reset(prc->imsbtree);
-			for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-				opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-				cblk->numpasses = 0;
-				tgt_setvalue(prc->imsbtree, cblkno, band->numbps - cblk->numbps);
-			}
-		}
-	}
-
-	bio = bio_create();
-	bio_init_enc(bio, c, length);
-	bio_write(bio, 1, 1);		/* Empty header bit */
-
-	/* Writing Packet header */
-	for (bandno = 0; bandno < res->numbands; bandno++) {
-		opj_tcd_band_t *band = &res->bands[bandno];
-		opj_tcd_precinct_t *prc = &band->precincts[precno];
-		for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-			opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-			opj_tcd_layer_t *layer = &cblk->layers[layno];
-			if (!cblk->numpasses && layer->numpasses) {
-				tgt_setvalue(prc->incltree, cblkno, layno);
-			}
-		}
-		for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-			opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-			opj_tcd_layer_t *layer = &cblk->layers[layno];
-			int increment = 0;
-			int nump = 0;
-			int len = 0, passno;
-			/* cblk inclusion bits */
-			if (!cblk->numpasses) {
-				tgt_encode(bio, prc->incltree, cblkno, layno + 1);
-			} else {
-				bio_write(bio, layer->numpasses != 0, 1);
-			}
-			/* if cblk not included, go to the next cblk  */
-			if (!layer->numpasses) {
-				continue;
-			}
-			/* if first instance of cblk --> zero bit-planes information */
-			if (!cblk->numpasses) {
-				cblk->numlenbits = 3;
-				tgt_encode(bio, prc->imsbtree, cblkno, 999);
-			}
-			/* number of coding passes included */
-			t2_putnumpasses(bio, layer->numpasses);
-
-			/* computation of the increase of the length indicator and insertion in the header     */
-			for (passno = cblk->numpasses; passno < cblk->numpasses + layer->numpasses; passno++) {
-				opj_tcd_pass_t *pass = &cblk->passes[passno];
-				nump++;
-				len += pass->len;
-				if (pass->term || passno == (cblk->numpasses + layer->numpasses) - 1) {
-					increment = int_max(increment, int_floorlog2(len) + 1 - (cblk->numlenbits + int_floorlog2(nump)));
-					len = 0;
-					nump = 0;
-				}
-			}
-			t2_putcommacode(bio, increment);
-
-			/* computation of the new Length indicator */
-			cblk->numlenbits += increment;
-
-			/* insertion of the codeword segment length */
-			for (passno = cblk->numpasses; passno < cblk->numpasses + layer->numpasses; passno++) {
-				opj_tcd_pass_t *pass = &cblk->passes[passno];
-				nump++;
-				len += pass->len;
-				if (pass->term || passno == (cblk->numpasses + layer->numpasses) - 1) {
-					bio_write(bio, len, cblk->numlenbits + int_floorlog2(nump));
-					len = 0;
-					nump = 0;
-				}
-			}
-		}
-	}
-
-	if (bio_flush(bio)) {
-		return -999;		/* modified to eliminate longjmp !! */
-	}
-
-	c += bio_numbytes(bio);
-
-	bio_destroy(bio);
-
-	/* <EPH 0xff92> */
-	if (tcp->csty & J2K_CP_CSTY_EPH) {
-		eph = (unsigned char *) opj_malloc(2 * sizeof(unsigned char));
-		eph[0] = 255;
-		eph[1] = 146;
-		memcpy(c, eph, 2);
-		opj_free(eph);
-		c += 2;
-	}
-	/* </EPH> */
-
-	/* Writing the packet body */
-
-	for (bandno = 0; bandno < res->numbands; bandno++) {
-		opj_tcd_band_t *band = &res->bands[bandno];
-		opj_tcd_precinct_t *prc = &band->precincts[precno];
-		for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-			opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-			opj_tcd_layer_t *layer = &cblk->layers[layno];
-			if (!layer->numpasses) {
-				continue;
-			}
-			if (c + layer->len > dest + length) {
-				return -999;
-			}
-
-			memcpy(c, layer->data, layer->len);
-			cblk->numpasses += layer->numpasses;
-			c += layer->len;
-			/* ADD for index Cfr. Marcela --> delta disto by packet */
-			if(image_info && image_info->index_write && image_info->index_on) {
-				opj_tile_info_t *info_TL = &image_info->tile[tileno];
-				opj_packet_info_t *info_PK = &info_TL->packet[image_info->num];
-				info_PK->disto += layer->disto;
-				if (image_info->D_max < info_PK->disto) {
-					image_info->D_max = info_PK->disto;
-				}
-			}
-			/* </ADD> */
-		}
-	}
-
-	return (c - dest);
-}
-
-static void t2_init_seg(opj_tcd_seg_t * seg, int cblksty, int first) {
-	seg->numpasses = 0;
-	seg->len = 0;
-	if (cblksty & J2K_CCP_CBLKSTY_TERMALL) {
-		seg->maxpasses = 1;
-	}
-	else if (cblksty & J2K_CCP_CBLKSTY_LAZY) {
-		if (first) {
-			seg->maxpasses = 10;
-		} else {
-			seg->maxpasses = (((seg - 1)->maxpasses == 1) || ((seg - 1)->maxpasses == 10)) ? 2 : 1;
-		}
-	} else {
-		seg->maxpasses = 109;
-	}
-}
-
-static int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_tile_t *tile, opj_tcp_t *tcp, opj_pi_iterator_t *pi) {
-	int bandno, cblkno;
-	unsigned char *c = src;
-
-	opj_cp_t *cp = t2->cp;
-
-	int compno = pi->compno;	/* component value */
-	int resno  = pi->resno;		/* resolution level value */
-	int precno = pi->precno;	/* precinct value */
-	int layno  = pi->layno;		/* quality layer value */
-
-	opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-	opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-	unsigned char *hd = NULL;
-	int present;
-
-	opj_bio_t *bio = NULL;	/* BIO component */
-
-	if (layno == 0) {
-		for (bandno = 0; bandno < res->numbands; bandno++) {
-			opj_tcd_band_t *band = &res->bands[bandno];
-			opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-			if ((band->x1-band->x0 == 0)||(band->y1-band->y0 == 0)) continue;
-
-			tgt_reset(prc->incltree);
-			tgt_reset(prc->imsbtree);
-			for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-				opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-				cblk->numsegs = 0;
-			}
-		}
-	}
-
-	/* SOP markers */
-
-	if (tcp->csty & J2K_CP_CSTY_SOP) {
-		if ((*c) != 0xff || (*(c + 1) != 0x91)) {
-			opj_event_msg(t2->cinfo, EVT_WARNING, "Expected SOP marker\n");
-		} else {
-			c += 6;
-		}
-
-		/** TODO : check the Nsop value */
-	}
-
-	/*
-	When the marker PPT/PPM is used the packet header are store in PPT/PPM marker
-	This part deal with this caracteristic
-	step 1: Read packet header in the saved structure
-	step 2: Return to codestream for decoding
-	*/
-
-	bio = bio_create();
-
-	if (cp->ppm == 1) {		/* PPM */
-		hd = cp->ppm_data;
-		bio_init_dec(bio, hd, cp->ppm_len);
-	} else if (tcp->ppt == 1) {	/* PPT */
-		hd = tcp->ppt_data;
-		bio_init_dec(bio, hd, tcp->ppt_len);
-	} else {			/* Normal Case */
-		hd = c;
-		bio_init_dec(bio, hd, src+len-hd);
-	}
-
-	present = bio_read(bio, 1);
-
-	if (!present) {
-		bio_inalign(bio);
-		hd += bio_numbytes(bio);
-		bio_destroy(bio);
-
-		/* EPH markers */
-
-		if (tcp->csty & J2K_CP_CSTY_EPH) {
-			if ((*hd) != 0xff || (*(hd + 1) != 0x92)) {
-				printf("Error : expected EPH marker\n");
-			} else {
-				hd += 2;
-			}
-		}
-
-		if (cp->ppm == 1) {		/* PPM case */
-			cp->ppm_len += cp->ppm_data-hd;
-			cp->ppm_data = hd;
-			return (c - src);
-		}
-		if (tcp->ppt == 1) {	/* PPT case */
-			tcp->ppt_len+=tcp->ppt_data-hd;
-			tcp->ppt_data = hd;
-			return (c - src);
-		}
-
-		return (hd - src);
-	}
-
-	for (bandno = 0; bandno < res->numbands; bandno++) {
-		opj_tcd_band_t *band = &res->bands[bandno];
-		opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-		if ((band->x1-band->x0 == 0)||(band->y1-band->y0 == 0)) continue;
-
-		for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-			int included, increment, n;
-			opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-			opj_tcd_seg_t *seg = NULL;
-			/* if cblk not yet included before --> inclusion tagtree */
-			if (!cblk->numsegs) {
-				included = tgt_decode(bio, prc->incltree, cblkno, layno + 1);
-				/* else one bit */
-			} else {
-				included = bio_read(bio, 1);
-			}
-			/* if cblk not included */
-			if (!included) {
-				cblk->numnewpasses = 0;
-				continue;
-			}
-			/* if cblk not yet included --> zero-bitplane tagtree */
-			if (!cblk->numsegs) {
-				int i, numimsbs;
-				for (i = 0; !tgt_decode(bio, prc->imsbtree, cblkno, i); i++) {
-					;
-				}
-				numimsbs = i - 1;
-				cblk->numbps = band->numbps - numimsbs;
-				cblk->numlenbits = 3;
-			}
-			/* number of coding passes */
-			cblk->numnewpasses = t2_getnumpasses(bio);
-			increment = t2_getcommacode(bio);
-			/* length indicator increment */
-			cblk->numlenbits += increment;
-			if (!cblk->numsegs) {
-				seg = &cblk->segs[0];
-				t2_init_seg(seg, tcp->tccps[compno].cblksty, 1);
-			} else {
-				seg = &cblk->segs[cblk->numsegs - 1];
-				if (seg->numpasses == seg->maxpasses) {
-					t2_init_seg(++seg, tcp->tccps[compno].cblksty, 0);
-				}
-			}
-			n = cblk->numnewpasses;
-
-			do {
-				seg->numnewpasses = int_min(seg->maxpasses - seg->numpasses, n);
-				seg->newlen = bio_read(bio, cblk->numlenbits + int_floorlog2(seg->numnewpasses));
-				n -= seg->numnewpasses;
-				if (n > 0) {
-					t2_init_seg(++seg, tcp->tccps[compno].cblksty, 0);
-				}
-			} while (n > 0);
-		}
-	}
-
-	if (bio_inalign(bio)) {
-		bio_destroy(bio);
-		return -999;
-	}
-
-	hd += bio_numbytes(bio);
-	bio_destroy(bio);
-
-	/* EPH markers */
-	if (tcp->csty & J2K_CP_CSTY_EPH) {
-		if ((*hd) != 0xff || (*(hd + 1) != 0x92)) {
-			opj_event_msg(t2->cinfo, EVT_ERROR, "Expected EPH marker\n");
-		} else {
-			hd += 2;
-		}
-	}
-
-	if (cp->ppm==1) {
-		cp->ppm_len+=cp->ppm_data-hd;
-		cp->ppm_data = hd;
-	} else if (tcp->ppt == 1) {
-		tcp->ppt_len+=tcp->ppt_data-hd;
-		tcp->ppt_data = hd;
-	} else {
-		c=hd;
-	}
-
-	for (bandno = 0; bandno < res->numbands; bandno++) {
-		opj_tcd_band_t *band = &res->bands[bandno];
-		opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-		if ((band->x1-band->x0 == 0)||(band->y1-band->y0 == 0)) continue;
-
-		for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-			opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-			opj_tcd_seg_t *seg = NULL;
-			if (!cblk->numnewpasses)
-				continue;
-			if (!cblk->numsegs) {
-				seg = &cblk->segs[0];
-				cblk->numsegs++;
-				cblk->len = 0;
-			} else {
-				seg = &cblk->segs[cblk->numsegs - 1];
-				if (seg->numpasses == seg->maxpasses) {
-					seg++;
-					cblk->numsegs++;
-				}
-			}
-
-			do {
-				if (c + seg->newlen > src + len) {
-					return -999;
-				}
-
-#ifdef USE_JPWL
-			/* we need here a j2k handle to verify if making a check to
-			the validity of cblocks parameters is selected from user (-W) */
-
-				/* let's check that we are not exceeding */
-				if ((cblk->len + seg->newlen) > 8192) {
-					opj_event_msg(t2->cinfo, EVT_WARNING,
-						"JPWL: segment too long (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
-						seg->newlen, cblkno, precno, bandno, resno, compno);
-					if (!JPWL_ASSUME) {
-						opj_event_msg(t2->cinfo, EVT_ERROR, "JPWL: giving up\n");
-						return -999;
-					}
-					seg->newlen = 8192 - cblk->len;
-					opj_event_msg(t2->cinfo, EVT_WARNING, "      - truncating segment to %d\n", seg->newlen);
-					break;
-				};
-
-#endif /* USE_JPWL */
-
-				memcpy(cblk->data + cblk->len, c, seg->newlen);
-				if (seg->numpasses == 0) {
-					seg->data = cblk->data + cblk->len;
-				}
-				c += seg->newlen;
-				cblk->len += seg->newlen;
-				seg->len += seg->newlen;
-				seg->numpasses += seg->numnewpasses;
-				cblk->numnewpasses -= seg->numnewpasses;
-				if (cblk->numnewpasses > 0) {
-					seg++;
-					cblk->numsegs++;
-				}
-			} while (cblk->numnewpasses > 0);
-		}
-	}
-
-	return (c - src);
-}
-
-/* ----------------------------------------------------------------------- */
-
-int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_image_info_t *image_info,int tpnum, int tppos,int pino, J2K_T2_MODE t2_mode){
-	unsigned char *c = dest;
-	int e = 0;
-	int compno;
-	int comp_len = 0;
-	opj_pi_iterator_t *pi = NULL;
-	int poc;
-	opj_image_t *image = t2->image;
-	opj_cp_t *cp = t2->cp;
-	int pocno = cp->cinema == CINEMA4K_24? 2: 1;
-	int maxcomp = cp->max_comp_size > 0 ? image->numcomps : 1;
-
-	pi = pi_initialise_encode(image, cp, tileno, t2_mode);
-	if(!pi) {
-		/* TODO: throw an error */
-		return -999;
-	}
-
-	if(image_info) {
-		image_info->num = 0;
-	}
-
-	if(t2_mode == THRESH_CALC ){
-		for(compno = 0; compno < maxcomp; compno++ ){
-			for(poc = 0; poc < pocno ; poc++){
-				int comp_len = 0;
-				int tpnum = compno;
-				pi_create_encode(pi, cp,tileno,poc,tpnum,tppos);
-				while (pi_next(&pi[poc])) {
-					if (pi[poc].layno < maxlayers) {
-						e = t2_encode_packet(tile, &cp->tcps[tileno], &pi[poc], c, dest + len - c, image_info, tileno);
-						comp_len = comp_len + e;
-						if (e == -999) {
-							break;
-						} else {
-							c += e;
-						}
-					}
-				}
-				if (e == -999) break;
-				if (cp->max_comp_size){
-					if (comp_len > cp->max_comp_size){
-								e = -999;
-								break;
-					}
-				}
-			}
-			if (e == -999)  break;
-		}
-	}else{
-		pi_create_encode(pi, cp,tileno,pino,tpnum,tppos);
-		while (pi_next(&pi[pino])) {
-			if (pi[pino].layno < maxlayers) {
-				e = t2_encode_packet(tile, &cp->tcps[tileno], &pi[pino], c, dest + len - c, image_info, tileno);
-				if (e == -999) {
-					break;
-				} else {
-					c += e;
-				}
-			}
-		}
-	}
-
-		/* INDEX >> */
-		if(image_info && image_info->index_on) {
-				if(image_info->index_write) {
-					opj_tile_info_t *info_TL = &image_info->tile[tileno];
-					opj_packet_info_t *info_PK = &info_TL->packet[image_info->num];
-					if (!image_info->num) {
-						info_PK->start_pos = info_TL->end_header + 1;
-					} else {
-						info_PK->start_pos = info_TL->packet[image_info->num - 1].end_pos + 1;
-					}
-					info_PK->end_pos = info_PK->start_pos + e - 1;
-				}
-
-				image_info->num++;
-			}
-		/* << INDEX */
-		pi_destroy(pi, cp, tileno);
-
-	if (e == -999) {
-		return e;
-	}
-
-    return (c - dest);
-}
-
-int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile) {
-	unsigned char *c = src;
-	opj_pi_iterator_t *pi;
-	int pino, e = 0;
-	int n = 0;
-
-	opj_image_t *image = t2->image;
-	opj_cp_t *cp = t2->cp;
-
-	/* create a packet iterator */
-	pi = pi_create_decode(image, cp, tileno);
-	if(!pi) {
-		/* TODO: throw an error */
-		return -999;
-	}
-
-	for (pino = 0; pino <= cp->tcps[tileno].numpocs; pino++) {
-		while (pi_next(&pi[pino])) {
-			if ((cp->layer==0) || (cp->layer>=((pi[pino].layno)+1))) {
-				e = t2_decode_packet(t2, c, src + len - c, tile, &cp->tcps[tileno], &pi[pino]);
-			} else {
-				e = 0;
-			}
-
-			/* progression in resolution */
-			image->comps[pi[pino].compno].resno_decoded =
-				(e > 0) ?
-				int_max(pi[pino].resno, image->comps[pi[pino].compno].resno_decoded)
-				: image->comps[pi[pino].compno].resno_decoded;
-			n++;
-
-			if (e == -999) {		/* ADD */
-				break;
-			} else {
-				c += e;
-			}
-		}
-	}
-
-	/* don't forget to release pi */
-	pi_destroy(pi, cp, tileno);
-
-	if (e == -999) {
-		return e;
-	}
-
-    return (c - src);
-}
-
-/* ----------------------------------------------------------------------- */
-
-opj_t2_t* t2_create(opj_common_ptr cinfo, opj_image_t *image, opj_cp_t *cp) {
-	/* create the tcd structure */
-	opj_t2_t *t2 = (opj_t2_t*)opj_malloc(sizeof(opj_t2_t));
-	if(!t2) return NULL;
-	t2->cinfo = cinfo;
-	t2->image = image;
-	t2->cp = cp;
-
-	return t2;
-}
-
-void t2_destroy(opj_t2_t *t2) {
-	if(t2) {
-		opj_free(t2);
-	}
-}
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/t2.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/t2.h
deleted file mode 100644
index 87ed2d2..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/t2.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __T2_H
-#define __T2_H
-/**
-@file t2.h
-@brief Implementation of a tier-2 coding (packetization of code-block data) (T2)
-
-*/
-
-/** @defgroup T2 T2 - Implementation of a tier-2 coding */
-/*@{*/
-
-/**
-Tier-2 coding
-*/
-typedef struct opj_t2 {
-	/** codec context */
-	opj_common_ptr cinfo;
-
-	/** Encoding: pointer to the src image. Decoding: pointer to the dst image. */
-	opj_image_t *image;
-	/** pointer to the image coding parameters */
-	opj_cp_t *cp;
-} opj_t2_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-
-/**
-Encode the packets of a tile to a destination buffer
-@param t2 T2 handle
-@param tileno number of the tile encoded
-@param tile the tile for which to write the packets
-@param maxlayers maximum number of layers
-@param dest the destination buffer
-@param len the length of the destination buffer
-@param image_info structure to create an index file
-@param tpnum Tile part number of the current tile
-@param tppos The position of the tile part flag in the progression order
-@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
-*/
-int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_image_info_t *image_info,int tpnum, int tppos,int pino,J2K_T2_MODE t2_mode);
-/**
-Decode the packets of a tile from a source buffer
-@param t2 T2 handle
-@param src the source buffer
-@param len length of the source buffer
-@param tileno number that identifies the tile for which to decode the packets
-@param tile tile for which to decode the packets
- */
-int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile);
-
-/**
-Create a T2 handle
-@param cinfo Codec context info
-@param image Source or destination image
-@param cp Image coding parameters
-@return Returns a new T2 handle if successful, returns NULL otherwise
-*/
-opj_t2_t* t2_create(opj_common_ptr cinfo, opj_image_t *image, opj_cp_t *cp);
-/**
-Destroy a T2 handle
-@param t2 T2 handle to destroy
-*/
-void t2_destroy(opj_t2_t *t2);
-
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __T2_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/tcd.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/tcd.c
deleted file mode 100644
index 525ec91..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/tcd.c
+++ /dev/null
@@ -1,1409 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * Copyright (c) 2006-2007, Parvatha Elangovan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t * img) {
-	int tileno, compno, resno, bandno, precno, cblkno;
-
-	fprintf(fd, "image {\n");
-	fprintf(fd, "  tw=%d, th=%d x0=%d x1=%d y0=%d y1=%d\n",
-		img->tw, img->th, tcd->image->x0, tcd->image->x1, tcd->image->y0, tcd->image->y1);
-
-	for (tileno = 0; tileno < img->th * img->tw; tileno++) {
-		opj_tcd_tile_t *tile = &tcd->tcd_image->tiles[tileno];
-		fprintf(fd, "  tile {\n");
-		fprintf(fd, "    x0=%d, y0=%d, x1=%d, y1=%d, numcomps=%d\n",
-			tile->x0, tile->y0, tile->x1, tile->y1, tile->numcomps);
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-			fprintf(fd, "    tilec {\n");
-			fprintf(fd,
-				"      x0=%d, y0=%d, x1=%d, y1=%d, numresolutions=%d\n",
-				tilec->x0, tilec->y0, tilec->x1, tilec->y1, tilec->numresolutions);
-			for (resno = 0; resno < tilec->numresolutions; resno++) {
-				opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-				fprintf(fd, "\n   res {\n");
-				fprintf(fd,
-					"          x0=%d, y0=%d, x1=%d, y1=%d, pw=%d, ph=%d, numbands=%d\n",
-					res->x0, res->y0, res->x1, res->y1, res->pw, res->ph, res->numbands);
-				for (bandno = 0; bandno < res->numbands; bandno++) {
-					opj_tcd_band_t *band = &res->bands[bandno];
-					fprintf(fd, "        band {\n");
-					fprintf(fd,
-						"          x0=%d, y0=%d, x1=%d, y1=%d, stepsize=%f, numbps=%d\n",
-						band->x0, band->y0, band->x1, band->y1, band->stepsize, band->numbps);
-					for (precno = 0; precno < res->pw * res->ph; precno++) {
-						opj_tcd_precinct_t *prec = &band->precincts[precno];
-						fprintf(fd, "          prec {\n");
-						fprintf(fd,
-							"            x0=%d, y0=%d, x1=%d, y1=%d, cw=%d, ch=%d\n",
-							prec->x0, prec->y0, prec->x1, prec->y1, prec->cw, prec->ch);
-						for (cblkno = 0; cblkno < prec->cw * prec->ch; cblkno++) {
-							opj_tcd_cblk_t *cblk = &prec->cblks[cblkno];
-							fprintf(fd, "            cblk {\n");
-							fprintf(fd,
-								"              x0=%d, y0=%d, x1=%d, y1=%d\n",
-								cblk->x0, cblk->y0, cblk->x1, cblk->y1);
-							fprintf(fd, "            }\n");
-						}
-						fprintf(fd, "          }\n");
-					}
-					fprintf(fd, "        }\n");
-				}
-				fprintf(fd, "      }\n");
-			}
-			fprintf(fd, "    }\n");
-		}
-		fprintf(fd, "  }\n");
-	}
-	fprintf(fd, "}\n");
-}
-
-/* ----------------------------------------------------------------------- */
-
-/**
-Create a new TCD handle
-*/
-opj_tcd_t* tcd_create(opj_common_ptr cinfo) {
-	/* create the tcd structure */
-	opj_tcd_t *tcd = (opj_tcd_t*)opj_malloc(sizeof(opj_tcd_t));
-	if(!tcd) return NULL;
-	tcd->cinfo = cinfo;
-	tcd->tcd_image = (opj_tcd_image_t*)opj_malloc(sizeof(opj_tcd_image_t));
-	if(!tcd->tcd_image) {
-		opj_free(tcd);
-		return NULL;
-	}
-
-	return tcd;
-}
-
-/**
-Destroy a previously created TCD handle
-*/
-void tcd_destroy(opj_tcd_t *tcd) {
-	if(tcd) {
-		opj_free(tcd->tcd_image);
-		opj_free(tcd);
-	}
-}
-
-/* ----------------------------------------------------------------------- */
-
-void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno) {
-	int tileno, compno, resno, bandno, precno, cblkno;
-
-	tcd->image = image;
-	tcd->cp = cp;
-	tcd->tcd_image->tw = cp->tw;
-	tcd->tcd_image->th = cp->th;
-	tcd->tcd_image->tiles = (opj_tcd_tile_t *) opj_malloc(sizeof(opj_tcd_tile_t));
-
-	for (tileno = 0; tileno < 1; tileno++) {
-		opj_tcp_t *tcp = &cp->tcps[curtileno];
-		int j;
-
-		/* cfr p59 ISO/IEC FDIS15444-1 : 2000 (18 august 2000) */
-		int p = curtileno % cp->tw;	/* si numerotation matricielle .. */
-		int q = curtileno / cp->tw;	/* .. coordonnees de la tile (q,p) q pour ligne et p pour colonne */
-
-		/* opj_tcd_tile_t *tile=&tcd->tcd_image->tiles[tileno]; */
-		opj_tcd_tile_t *tile = tcd->tcd_image->tiles;
-
-		/* 4 borders of the tile rescale on the image if necessary */
-		tile->x0 = int_max(cp->tx0 + p * cp->tdx, image->x0);
-		tile->y0 = int_max(cp->ty0 + q * cp->tdy, image->y0);
-		tile->x1 = int_min(cp->tx0 + (p + 1) * cp->tdx, image->x1);
-		tile->y1 = int_min(cp->ty0 + (q + 1) * cp->tdy, image->y1);
-		tile->numcomps = image->numcomps;
-		/* tile->PPT=image->PPT;  */
-
-		/* Modification of the RATE >> */
-		for (j = 0; j < tcp->numlayers; j++) {
-			tcp->rates[j] = tcp->rates[j] ?
-				((float) (tile->numcomps
-					* (tile->x1 - tile->x0)
-					* (tile->y1 - tile->y0)
-					* image->comps[0].prec))/
-					(tcp->rates[j] * 8 * image->comps[0].dx * image->comps[0].dy)
-					: 0;
-
-			if (tcp->rates[j]) {
-				if (j && tcp->rates[j] < tcp->rates[j - 1] + 10) {
-					tcp->rates[j] = tcp->rates[j - 1] + 20;
-				} else {
-					if (!j && tcp->rates[j] < 30)
-						tcp->rates[j] = 30;
-				}
-			}
-		}
-		/* << Modification of the RATE */
-
-		tile->comps = (opj_tcd_tilecomp_t *) opj_malloc(image->numcomps * sizeof(opj_tcd_tilecomp_t));
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			opj_tccp_t *tccp = &tcp->tccps[compno];
-
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-
-			/* border of each tile component (global) */
-			tilec->x0 = int_ceildiv(tile->x0, image->comps[compno].dx);
-			tilec->y0 = int_ceildiv(tile->y0, image->comps[compno].dy);
-			tilec->x1 = int_ceildiv(tile->x1, image->comps[compno].dx);
-			tilec->y1 = int_ceildiv(tile->y1, image->comps[compno].dy);
-
-			tilec->data = (int *) opj_malloc((tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0) * sizeof(int));
-			tilec->numresolutions = tccp->numresolutions;
-
-			tilec->resolutions = (opj_tcd_resolution_t *) opj_malloc(tilec->numresolutions * sizeof(opj_tcd_resolution_t));
-
-			for (resno = 0; resno < tilec->numresolutions; resno++) {
-				int pdx, pdy;
-				int levelno = tilec->numresolutions - 1 - resno;
-				int tlprcxstart, tlprcystart, brprcxend, brprcyend;
-				int tlcbgxstart, tlcbgystart, brcbgxend, brcbgyend;
-				int cbgwidthexpn, cbgheightexpn;
-				int cblkwidthexpn, cblkheightexpn;
-
-				opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-				/* border for each resolution level (global) */
-				res->x0 = int_ceildivpow2(tilec->x0, levelno);
-				res->y0 = int_ceildivpow2(tilec->y0, levelno);
-				res->x1 = int_ceildivpow2(tilec->x1, levelno);
-				res->y1 = int_ceildivpow2(tilec->y1, levelno);
-
-				res->numbands = resno == 0 ? 1 : 3;
-				/* p. 35, table A-23, ISO/IEC FDIS154444-1 : 2000 (18 august 2000) */
-				if (tccp->csty & J2K_CCP_CSTY_PRT) {
-					pdx = tccp->prcw[resno];
-					pdy = tccp->prch[resno];
-				} else {
-					pdx = 15;
-					pdy = 15;
-				}
-				/* p. 64, B.6, ISO/IEC FDIS15444-1 : 2000 (18 august 2000)  */
-				tlprcxstart = int_floordivpow2(res->x0, pdx) << pdx;
-				tlprcystart = int_floordivpow2(res->y0, pdy) << pdy;
-
-				brprcxend = int_ceildivpow2(res->x1, pdx) << pdx;
-				brprcyend = int_ceildivpow2(res->y1, pdy) << pdy;
-
-				res->pw = (brprcxend - tlprcxstart) >> pdx;
-				res->ph = (brprcyend - tlprcystart) >> pdy;
-
-				if (resno == 0) {
-					tlcbgxstart = tlprcxstart;
-					tlcbgystart = tlprcystart;
-					brcbgxend = brprcxend;
-					brcbgyend = brprcyend;
-					cbgwidthexpn = pdx;
-					cbgheightexpn = pdy;
-				} else {
-					tlcbgxstart = int_ceildivpow2(tlprcxstart, 1);
-					tlcbgystart = int_ceildivpow2(tlprcystart, 1);
-					brcbgxend = int_ceildivpow2(brprcxend, 1);
-					brcbgyend = int_ceildivpow2(brprcyend, 1);
-					cbgwidthexpn = pdx - 1;
-					cbgheightexpn = pdy - 1;
-				}
-
-				cblkwidthexpn = int_min(tccp->cblkw, cbgwidthexpn);
-				cblkheightexpn = int_min(tccp->cblkh, cbgheightexpn);
-
-				for (bandno = 0; bandno < res->numbands; bandno++) {
-					int x0b, y0b, i;
-					int gain, numbps;
-					opj_stepsize_t *ss = NULL;
-
-					opj_tcd_band_t *band = &res->bands[bandno];
-
-					band->bandno = resno == 0 ? 0 : bandno + 1;
-					x0b = (band->bandno == 1) || (band->bandno == 3) ? 1 : 0;
-					y0b = (band->bandno == 2) || (band->bandno == 3) ? 1 : 0;
-
-					if (band->bandno == 0) {
-						/* band border (global) */
-						band->x0 = int_ceildivpow2(tilec->x0, levelno);
-						band->y0 = int_ceildivpow2(tilec->y0, levelno);
-						band->x1 = int_ceildivpow2(tilec->x1, levelno);
-						band->y1 = int_ceildivpow2(tilec->y1, levelno);
-					} else {
-						/* band border (global) */
-						band->x0 = int_ceildivpow2(tilec->x0 - (1 << levelno) * x0b, levelno + 1);
-						band->y0 = int_ceildivpow2(tilec->y0 - (1 << levelno) * y0b, levelno + 1);
-						band->x1 = int_ceildivpow2(tilec->x1 - (1 << levelno) * x0b, levelno + 1);
-						band->y1 = int_ceildivpow2(tilec->y1 - (1 << levelno) * y0b, levelno + 1);
-					}
-
-					ss = &tccp->stepsizes[resno == 0 ? 0 : 3 * (resno - 1) + bandno + 1];
-					gain = tccp->qmfbid == 0 ? dwt_getgain_real(band->bandno) : dwt_getgain(band->bandno);
-					numbps = image->comps[compno].prec + gain;
-
-					band->stepsize = (float)((1.0 + ss->mant / 2048.0) * pow(2.0, numbps - ss->expn));
-					band->numbps = ss->expn + tccp->numgbits - 1;	/* WHY -1 ? */
-
-					band->precincts = (opj_tcd_precinct_t *) opj_malloc(3 * res->pw * res->ph * sizeof(opj_tcd_precinct_t));
-
-					for (i = 0; i < res->pw * res->ph * 3; i++) {
-						band->precincts[i].imsbtree = NULL;
-						band->precincts[i].incltree = NULL;
-					}
-
-					for (precno = 0; precno < res->pw * res->ph; precno++) {
-						int tlcblkxstart, tlcblkystart, brcblkxend, brcblkyend;
-
-						int cbgxstart = tlcbgxstart + (precno % res->pw) * (1 << cbgwidthexpn);
-						int cbgystart = tlcbgystart + (precno / res->pw) * (1 << cbgheightexpn);
-						int cbgxend = cbgxstart + (1 << cbgwidthexpn);
-						int cbgyend = cbgystart + (1 << cbgheightexpn);
-
-						opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-						/* precinct size (global) */
-						prc->x0 = int_max(cbgxstart, band->x0);
-						prc->y0 = int_max(cbgystart, band->y0);
-						prc->x1 = int_min(cbgxend, band->x1);
-						prc->y1 = int_min(cbgyend, band->y1);
-
-						tlcblkxstart = int_floordivpow2(prc->x0, cblkwidthexpn) << cblkwidthexpn;
-						tlcblkystart = int_floordivpow2(prc->y0, cblkheightexpn) << cblkheightexpn;
-						brcblkxend = int_ceildivpow2(prc->x1, cblkwidthexpn) << cblkwidthexpn;
-						brcblkyend = int_ceildivpow2(prc->y1, cblkheightexpn) << cblkheightexpn;
-						prc->cw = (brcblkxend - tlcblkxstart) >> cblkwidthexpn;
-						prc->ch = (brcblkyend - tlcblkystart) >> cblkheightexpn;
-
-						prc->cblks = (opj_tcd_cblk_t *) opj_malloc((prc->cw * prc->ch) * sizeof(opj_tcd_cblk_t));
-						prc->incltree = tgt_create(prc->cw, prc->ch);
-						prc->imsbtree = tgt_create(prc->cw, prc->ch);
-
-						for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-							int cblkxstart = tlcblkxstart + (cblkno % prc->cw) * (1 << cblkwidthexpn);
-							int cblkystart = tlcblkystart + (cblkno / prc->cw) * (1 << cblkheightexpn);
-							int cblkxend = cblkxstart + (1 << cblkwidthexpn);
-							int cblkyend = cblkystart + (1 << cblkheightexpn);
-
-							opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-
-							/* code-block size (global) */
-							cblk->x0 = int_max(cblkxstart, prc->x0);
-							cblk->y0 = int_max(cblkystart, prc->y0);
-							cblk->x1 = int_min(cblkxend, prc->x1);
-							cblk->y1 = int_min(cblkyend, prc->y1);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	/* tcd_dump(stdout, tcd, &tcd->tcd_image); */
-}
-
-void tcd_free_encode(opj_tcd_t *tcd) {
-	int tileno, compno, resno, bandno, precno;
-
-	for (tileno = 0; tileno < 1; tileno++) {
-		opj_tcd_tile_t *tile = tcd->tcd_image->tiles;
-
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-
-			for (resno = 0; resno < tilec->numresolutions; resno++) {
-				opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-				for (bandno = 0; bandno < res->numbands; bandno++) {
-					opj_tcd_band_t *band = &res->bands[bandno];
-
-					for (precno = 0; precno < res->pw * res->ph; precno++) {
-						opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-						if (prc->incltree != NULL) {
-							tgt_destroy(prc->incltree);
-							prc->incltree = NULL;
-						}
-						if (prc->imsbtree != NULL) {
-							tgt_destroy(prc->imsbtree);
-							prc->imsbtree = NULL;
-						}
-						opj_free(prc->cblks);
-						prc->cblks = NULL;
-					} /* for (precno */
-					opj_free(band->precincts);
-					band->precincts = NULL;
-				} /* for (bandno */
-			} /* for (resno */
-			opj_free(tilec->resolutions);
-			tilec->resolutions = NULL;
-		} /* for (compno */
-		opj_free(tile->comps);
-		tile->comps = NULL;
-	} /* for (tileno */
-	opj_free(tcd->tcd_image->tiles);
-	tcd->tcd_image->tiles = NULL;
-}
-
-void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno) {
-	int tileno, compno, resno, bandno, precno, cblkno;
-
-	for (tileno = 0; tileno < 1; tileno++) {
-		opj_tcp_t *tcp = &cp->tcps[curtileno];
-		int j;
-		/* cfr p59 ISO/IEC FDIS15444-1 : 2000 (18 august 2000) */
-		int p = curtileno % cp->tw;
-		int q = curtileno / cp->tw;
-
-		opj_tcd_tile_t *tile = tcd->tcd_image->tiles;
-
-		/* 4 borders of the tile rescale on the image if necessary */
-		tile->x0 = int_max(cp->tx0 + p * cp->tdx, image->x0);
-		tile->y0 = int_max(cp->ty0 + q * cp->tdy, image->y0);
-		tile->x1 = int_min(cp->tx0 + (p + 1) * cp->tdx, image->x1);
-		tile->y1 = int_min(cp->ty0 + (q + 1) * cp->tdy, image->y1);
-
-		tile->numcomps = image->numcomps;
-		/* tile->PPT=image->PPT; */
-
-		/* Modification of the RATE >> */
-		for (j = 0; j < tcp->numlayers; j++) {
-			tcp->rates[j] = tcp->rates[j] ?
-						((float) (tile->numcomps
-								* (tile->x1 - tile->x0)
-								* (tile->y1 - tile->y0)
-								* image->comps[0].prec))/
-						(tcp->rates[j] * 8 * image->comps[0].dx * image->comps[0].dy)
-						: 0;
-
-			if (tcp->rates[j]) {
-				if (j && tcp->rates[j] < tcp->rates[j - 1] + 10) {
-					tcp->rates[j] = tcp->rates[j - 1] + 20;
-				} else {
-					if (!j && tcp->rates[j] < 30)
-						tcp->rates[j] = 30;
-				}
-			}
-		}
-		/* << Modification of the RATE */
-
-		/* tile->comps=(opj_tcd_tilecomp_t*)opj_realloc(tile->comps,image->numcomps*sizeof(opj_tcd_tilecomp_t)); */
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			opj_tccp_t *tccp = &tcp->tccps[compno];
-
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-
-			/* border of each tile component (global) */
-			tilec->x0 = int_ceildiv(tile->x0, image->comps[compno].dx);
-			tilec->y0 = int_ceildiv(tile->y0, image->comps[compno].dy);
-			tilec->x1 = int_ceildiv(tile->x1, image->comps[compno].dx);
-			tilec->y1 = int_ceildiv(tile->y1, image->comps[compno].dy);
-
-			tilec->data = (int *) opj_malloc((tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0) * sizeof(int));
-			tilec->numresolutions = tccp->numresolutions;
-			/* tilec->resolutions=(opj_tcd_resolution_t*)opj_realloc(tilec->resolutions,tilec->numresolutions*sizeof(opj_tcd_resolution_t)); */
-			for (resno = 0; resno < tilec->numresolutions; resno++) {
-				int pdx, pdy;
-
-				int levelno = tilec->numresolutions - 1 - resno;
-				int tlprcxstart, tlprcystart, brprcxend, brprcyend;
-				int tlcbgxstart, tlcbgystart, brcbgxend, brcbgyend;
-				int cbgwidthexpn, cbgheightexpn;
-				int cblkwidthexpn, cblkheightexpn;
-
-				opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-				/* border for each resolution level (global) */
-				res->x0 = int_ceildivpow2(tilec->x0, levelno);
-				res->y0 = int_ceildivpow2(tilec->y0, levelno);
-				res->x1 = int_ceildivpow2(tilec->x1, levelno);
-				res->y1 = int_ceildivpow2(tilec->y1, levelno);
-				res->numbands = resno == 0 ? 1 : 3;
-
-				/* p. 35, table A-23, ISO/IEC FDIS154444-1 : 2000 (18 august 2000) */
-				if (tccp->csty & J2K_CCP_CSTY_PRT) {
-					pdx = tccp->prcw[resno];
-					pdy = tccp->prch[resno];
-				} else {
-					pdx = 15;
-					pdy = 15;
-				}
-				/* p. 64, B.6, ISO/IEC FDIS15444-1 : 2000 (18 august 2000)  */
-				tlprcxstart = int_floordivpow2(res->x0, pdx) << pdx;
-				tlprcystart = int_floordivpow2(res->y0, pdy) << pdy;
-				brprcxend = int_ceildivpow2(res->x1, pdx) << pdx;
-				brprcyend = int_ceildivpow2(res->y1, pdy) << pdy;
-
-				res->pw = (brprcxend - tlprcxstart) >> pdx;
-				res->ph = (brprcyend - tlprcystart) >> pdy;
-
-				if (resno == 0) {
-					tlcbgxstart = tlprcxstart;
-					tlcbgystart = tlprcystart;
-					brcbgxend = brprcxend;
-					brcbgyend = brprcyend;
-					cbgwidthexpn = pdx;
-					cbgheightexpn = pdy;
-				} else {
-					tlcbgxstart = int_ceildivpow2(tlprcxstart, 1);
-					tlcbgystart = int_ceildivpow2(tlprcystart, 1);
-					brcbgxend = int_ceildivpow2(brprcxend, 1);
-					brcbgyend = int_ceildivpow2(brprcyend, 1);
-					cbgwidthexpn = pdx - 1;
-					cbgheightexpn = pdy - 1;
-				}
-
-				cblkwidthexpn = int_min(tccp->cblkw, cbgwidthexpn);
-				cblkheightexpn = int_min(tccp->cblkh, cbgheightexpn);
-
-				for (bandno = 0; bandno < res->numbands; bandno++) {
-					int x0b, y0b;
-					int gain, numbps;
-					opj_stepsize_t *ss = NULL;
-
-					opj_tcd_band_t *band = &res->bands[bandno];
-
-					band->bandno = resno == 0 ? 0 : bandno + 1;
-					x0b = (band->bandno == 1) || (band->bandno == 3) ? 1 : 0;
-					y0b = (band->bandno == 2) || (band->bandno == 3) ? 1 : 0;
-
-					if (band->bandno == 0) {
-						/* band border */
-						band->x0 = int_ceildivpow2(tilec->x0, levelno);
-						band->y0 = int_ceildivpow2(tilec->y0, levelno);
-						band->x1 = int_ceildivpow2(tilec->x1, levelno);
-						band->y1 = int_ceildivpow2(tilec->y1, levelno);
-					} else {
-						band->x0 = int_ceildivpow2(tilec->x0 - (1 << levelno) * x0b, levelno + 1);
-						band->y0 = int_ceildivpow2(tilec->y0 - (1 << levelno) * y0b, levelno + 1);
-						band->x1 = int_ceildivpow2(tilec->x1 - (1 << levelno) * x0b, levelno + 1);
-						band->y1 = int_ceildivpow2(tilec->y1 - (1 << levelno) * y0b, levelno + 1);
-					}
-
-					ss = &tccp->stepsizes[resno == 0 ? 0 : 3 * (resno - 1) + bandno + 1];
-					gain = tccp->qmfbid == 0 ? dwt_getgain_real(band->bandno) : dwt_getgain(band->bandno);
-					numbps = image->comps[compno].prec + gain;
-					band->stepsize = (float)((1.0 + ss->mant / 2048.0) * pow(2.0, numbps - ss->expn));
-					band->numbps = ss->expn + tccp->numgbits - 1;	/* WHY -1 ? */
-
-					for (precno = 0; precno < res->pw * res->ph; precno++) {
-						int tlcblkxstart, tlcblkystart, brcblkxend, brcblkyend;
-
-						int cbgxstart = tlcbgxstart + (precno % res->pw) * (1 << cbgwidthexpn);
-						int cbgystart = tlcbgystart + (precno / res->pw) * (1 << cbgheightexpn);
-						int cbgxend = cbgxstart + (1 << cbgwidthexpn);
-						int cbgyend = cbgystart + (1 << cbgheightexpn);
-
-						opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-						/* precinct size (global) */
-						prc->x0 = int_max(cbgxstart, band->x0);
-						prc->y0 = int_max(cbgystart, band->y0);
-						prc->x1 = int_min(cbgxend, band->x1);
-						prc->y1 = int_min(cbgyend, band->y1);
-
-						tlcblkxstart = int_floordivpow2(prc->x0, cblkwidthexpn) << cblkwidthexpn;
-						tlcblkystart = int_floordivpow2(prc->y0, cblkheightexpn) << cblkheightexpn;
-						brcblkxend = int_ceildivpow2(prc->x1, cblkwidthexpn) << cblkwidthexpn;
-						brcblkyend = int_ceildivpow2(prc->y1, cblkheightexpn) << cblkheightexpn;
-						prc->cw = (brcblkxend - tlcblkxstart) >> cblkwidthexpn;
-						prc->ch = (brcblkyend - tlcblkystart) >> cblkheightexpn;
-
-						opj_free(prc->cblks);
-						prc->cblks = (opj_tcd_cblk_t *) opj_malloc(prc->cw * prc->ch * sizeof(opj_tcd_cblk_t));
-
-						if (prc->incltree != NULL) {
-							tgt_destroy(prc->incltree);
-						}
-						if (prc->imsbtree != NULL) {
-							tgt_destroy(prc->imsbtree);
-						}
-
-						prc->incltree = tgt_create(prc->cw, prc->ch);
-						prc->imsbtree = tgt_create(prc->cw, prc->ch);
-
-						for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-							int cblkxstart = tlcblkxstart + (cblkno % prc->cw) * (1 << cblkwidthexpn);
-							int cblkystart = tlcblkystart + (cblkno / prc->cw) * (1 << cblkheightexpn);
-							int cblkxend = cblkxstart + (1 << cblkwidthexpn);
-							int cblkyend = cblkystart + (1 << cblkheightexpn);
-
-							opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-
-							/* code-block size (global) */
-							cblk->x0 = int_max(cblkxstart, prc->x0);
-							cblk->y0 = int_max(cblkystart, prc->y0);
-							cblk->x1 = int_min(cblkxend, prc->x1);
-							cblk->y1 = int_min(cblkyend, prc->y1);
-						}
-					} /* precno */
-				} /* bandno */
-			} /* resno */
-		} /* compno */
-	} /* tileno */
-
-	/* tcd_dump(stdout, tcd, &tcd->tcd_image); */
-}
-
-void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp) {
-	int tileno, compno, resno, bandno, precno, cblkno, i, j, p, q;
-	unsigned int x0 = 0, y0 = 0, x1 = 0, y1 = 0, w, h;
-
-	tcd->image = image;
-	tcd->cp = cp;
-	tcd->tcd_image->tw = cp->tw;
-	tcd->tcd_image->th = cp->th;
-	tcd->tcd_image->tiles = (opj_tcd_tile_t *) opj_malloc(cp->tw * cp->th * sizeof(opj_tcd_tile_t));
-
-	for (i = 0; i < cp->tileno_size; i++) {
-		opj_tcp_t *tcp = &(cp->tcps[cp->tileno[i]]);
-		opj_tcd_tile_t *tile = &(tcd->tcd_image->tiles[cp->tileno[i]]);
-
-		/* cfr p59 ISO/IEC FDIS15444-1 : 2000 (18 august 2000) */
-		tileno = cp->tileno[i];
-		p = tileno % cp->tw;	/* si numerotation matricielle .. */
-		q = tileno / cp->tw;	/* .. coordonnees de la tile (q,p) q pour ligne et p pour colonne */
-
-		/* 4 borders of the tile rescale on the image if necessary */
-		tile->x0 = int_max(cp->tx0 + p * cp->tdx, image->x0);
-		tile->y0 = int_max(cp->ty0 + q * cp->tdy, image->y0);
-		tile->x1 = int_min(cp->tx0 + (p + 1) * cp->tdx, image->x1);
-		tile->y1 = int_min(cp->ty0 + (q + 1) * cp->tdy, image->y1);
-
-		tile->numcomps = image->numcomps;
-		tile->comps = (opj_tcd_tilecomp_t *) opj_malloc(image->numcomps * sizeof(opj_tcd_tilecomp_t));
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			opj_tccp_t *tccp = &tcp->tccps[compno];
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-
-			/* border of each tile component (global) */
-			tilec->x0 = int_ceildiv(tile->x0, image->comps[compno].dx);
-			tilec->y0 = int_ceildiv(tile->y0, image->comps[compno].dy);
-			tilec->x1 = int_ceildiv(tile->x1, image->comps[compno].dx);
-			tilec->y1 = int_ceildiv(tile->y1, image->comps[compno].dy);
-
-			tilec->data = (int *) opj_malloc((tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0) * sizeof(int));
-			tilec->numresolutions = tccp->numresolutions;
-			tilec->resolutions = (opj_tcd_resolution_t *) opj_malloc(tilec->numresolutions * sizeof(opj_tcd_resolution_t));
-
-			for (resno = 0; resno < tilec->numresolutions; resno++) {
-				int pdx, pdy;
-				int levelno = tilec->numresolutions - 1 - resno;
-				int tlprcxstart, tlprcystart, brprcxend, brprcyend;
-				int tlcbgxstart, tlcbgystart, brcbgxend, brcbgyend;
-				int cbgwidthexpn, cbgheightexpn;
-				int cblkwidthexpn, cblkheightexpn;
-
-				opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-				/* border for each resolution level (global) */
-				res->x0 = int_ceildivpow2(tilec->x0, levelno);
-				res->y0 = int_ceildivpow2(tilec->y0, levelno);
-				res->x1 = int_ceildivpow2(tilec->x1, levelno);
-				res->y1 = int_ceildivpow2(tilec->y1, levelno);
-				res->numbands = resno == 0 ? 1 : 3;
-
-				/* p. 35, table A-23, ISO/IEC FDIS154444-1 : 2000 (18 august 2000) */
-				if (tccp->csty & J2K_CCP_CSTY_PRT) {
-					pdx = tccp->prcw[resno];
-					pdy = tccp->prch[resno];
-				} else {
-					pdx = 15;
-					pdy = 15;
-				}
-
-				/* p. 64, B.6, ISO/IEC FDIS15444-1 : 2000 (18 august 2000)  */
-				tlprcxstart = int_floordivpow2(res->x0, pdx) << pdx;
-				tlprcystart = int_floordivpow2(res->y0, pdy) << pdy;
-				brprcxend = int_ceildivpow2(res->x1, pdx) << pdx;
-				brprcyend = int_ceildivpow2(res->y1, pdy) << pdy;
-
-				res->pw = (res->x0 == res->x1) ? 0 : ((brprcxend - tlprcxstart) >> pdx);
-				res->ph = (res->y0 == res->y1) ? 0 : ((brprcyend - tlprcystart) >> pdy);
-
-				if (resno == 0) {
-					tlcbgxstart = tlprcxstart;
-					tlcbgystart = tlprcystart;
-					brcbgxend = brprcxend;
-					brcbgyend = brprcyend;
-					cbgwidthexpn = pdx;
-					cbgheightexpn = pdy;
-				} else {
-					tlcbgxstart = int_ceildivpow2(tlprcxstart, 1);
-					tlcbgystart = int_ceildivpow2(tlprcystart, 1);
-					brcbgxend = int_ceildivpow2(brprcxend, 1);
-					brcbgyend = int_ceildivpow2(brprcyend, 1);
-					cbgwidthexpn = pdx - 1;
-					cbgheightexpn = pdy - 1;
-				}
-
-				cblkwidthexpn = int_min(tccp->cblkw, cbgwidthexpn);
-				cblkheightexpn = int_min(tccp->cblkh, cbgheightexpn);
-
-				for (bandno = 0; bandno < res->numbands; bandno++) {
-					int x0b, y0b;
-					int gain, numbps;
-					opj_stepsize_t *ss = NULL;
-
-					opj_tcd_band_t *band = &res->bands[bandno];
-					band->bandno = resno == 0 ? 0 : bandno + 1;
-					x0b = (band->bandno == 1) || (band->bandno == 3) ? 1 : 0;
-					y0b = (band->bandno == 2) || (band->bandno == 3) ? 1 : 0;
-
-					if (band->bandno == 0) {
-						/* band border (global) */
-						band->x0 = int_ceildivpow2(tilec->x0, levelno);
-						band->y0 = int_ceildivpow2(tilec->y0, levelno);
-						band->x1 = int_ceildivpow2(tilec->x1, levelno);
-						band->y1 = int_ceildivpow2(tilec->y1, levelno);
-					} else {
-						/* band border (global) */
-						band->x0 = int_ceildivpow2(tilec->x0 - (1 << levelno) * x0b, levelno + 1);
-						band->y0 = int_ceildivpow2(tilec->y0 - (1 << levelno) * y0b, levelno + 1);
-						band->x1 = int_ceildivpow2(tilec->x1 - (1 << levelno) * x0b, levelno + 1);
-						band->y1 = int_ceildivpow2(tilec->y1 - (1 << levelno) * y0b, levelno + 1);
-					}
-
-					ss = &tccp->stepsizes[resno == 0 ? 0 : 3 * (resno - 1) + bandno + 1];
-					gain = tccp->qmfbid == 0 ? dwt_getgain_real(band->bandno) : dwt_getgain(band->bandno);
-					numbps = image->comps[compno].prec + gain;
-					band->stepsize = (float)((1.0 + ss->mant / 2048.0) * pow(2.0, numbps - ss->expn));
-					band->numbps = ss->expn + tccp->numgbits - 1;	/* WHY -1 ? */
-
-					band->precincts = (opj_tcd_precinct_t *) opj_malloc(res->pw * res->ph * sizeof(opj_tcd_precinct_t));
-
-					for (precno = 0; precno < res->pw * res->ph; precno++) {
-						int tlcblkxstart, tlcblkystart, brcblkxend, brcblkyend;
-						int cbgxstart = tlcbgxstart + (precno % res->pw) * (1 << cbgwidthexpn);
-						int cbgystart = tlcbgystart + (precno / res->pw) * (1 << cbgheightexpn);
-						int cbgxend = cbgxstart + (1 << cbgwidthexpn);
-						int cbgyend = cbgystart + (1 << cbgheightexpn);
-
-						opj_tcd_precinct_t *prc = &band->precincts[precno];
-						/* precinct size (global) */
-						prc->x0 = int_max(cbgxstart, band->x0);
-						prc->y0 = int_max(cbgystart, band->y0);
-						prc->x1 = int_min(cbgxend, band->x1);
-						prc->y1 = int_min(cbgyend, band->y1);
-
-						tlcblkxstart = int_floordivpow2(prc->x0, cblkwidthexpn) << cblkwidthexpn;
-						tlcblkystart = int_floordivpow2(prc->y0, cblkheightexpn) << cblkheightexpn;
-						brcblkxend = int_ceildivpow2(prc->x1, cblkwidthexpn) << cblkwidthexpn;
-						brcblkyend = int_ceildivpow2(prc->y1, cblkheightexpn) << cblkheightexpn;
-						prc->cw = (brcblkxend - tlcblkxstart) >> cblkwidthexpn;
-						prc->ch = (brcblkyend - tlcblkystart) >> cblkheightexpn;
-
-						prc->cblks = (opj_tcd_cblk_t *) opj_malloc(prc->cw * prc->ch * sizeof(opj_tcd_cblk_t));
-
-						prc->incltree = tgt_create(prc->cw, prc->ch);
-						prc->imsbtree = tgt_create(prc->cw, prc->ch);
-
-						for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-							int cblkxstart = tlcblkxstart + (cblkno % prc->cw) * (1 << cblkwidthexpn);
-							int cblkystart = tlcblkystart + (cblkno / prc->cw) * (1 << cblkheightexpn);
-							int cblkxend = cblkxstart + (1 << cblkwidthexpn);
-							int cblkyend = cblkystart + (1 << cblkheightexpn);
-
-							/* code-block size (global) */
-							opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-							cblk->x0 = int_max(cblkxstart, prc->x0);
-							cblk->y0 = int_max(cblkystart, prc->y0);
-							cblk->x1 = int_min(cblkxend, prc->x1);
-							cblk->y1 = int_min(cblkyend, prc->y1);
-						}
-					} /* precno */
-				} /* bandno */
-			} /* resno */
-		} /* compno */
-	} /* i = 0..cp->tileno_size */
-
-	/* tcd_dump(stdout, tcd, &tcd->tcd_image); */
-
-	/*
-	Allocate place to store the decoded data = final image
-	Place limited by the tile really present in the codestream
-	*/
-
-	for (i = 0; i < image->numcomps; i++) {
-		for (j = 0; j < cp->tileno_size; j++) {
-			tileno = cp->tileno[j];
-			x0 = j == 0 ? tcd->tcd_image->tiles[tileno].comps[i].x0 : int_min(x0,
-				(unsigned int) tcd->tcd_image->tiles[tileno].comps[i].x0);
-			y0 = j == 0 ? tcd->tcd_image->tiles[tileno].comps[i].y0 : int_min(y0,
-				(unsigned int) tcd->tcd_image->tiles[tileno].comps[i].y0);
-			x1 = j == 0 ? tcd->tcd_image->tiles[tileno].comps[i].x1 : int_max(x1,
-				(unsigned int) tcd->tcd_image->tiles[tileno].comps[i].x1);
-			y1 = j == 0 ? tcd->tcd_image->tiles[tileno].comps[i].y1 : int_max(y1,
-				(unsigned int) tcd->tcd_image->tiles[tileno].comps[i].y1);
-		}
-
-		w = x1 - x0;
-		h = y1 - y0;
-
-		image->comps[i].data = (int *) opj_malloc(w * h * sizeof(int));
-		image->comps[i].w = w;
-		image->comps[i].h = h;
-		image->comps[i].x0 = x0;
-		image->comps[i].y0 = y0;
-	}
-}
-
-void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final) {
-	int compno, resno, bandno, precno, cblkno;
-	int value;			/*, matrice[tcd_tcp->numlayers][tcd_tile->comps[0].numresolutions][3]; */
-	int matrice[10][10][3];
-	int i, j, k;
-
-	opj_cp_t *cp = tcd->cp;
-	opj_tcd_tile_t *tcd_tile = tcd->tcd_tile;
-	opj_tcp_t *tcd_tcp = tcd->tcp;
-
-	/*matrice=(int*)opj_malloc(tcd_tcp->numlayers*tcd_tile->comps[0].numresolutions*3*sizeof(int)); */
-
-	for (compno = 0; compno < tcd_tile->numcomps; compno++) {
-		opj_tcd_tilecomp_t *tilec = &tcd_tile->comps[compno];
-		for (i = 0; i < tcd_tcp->numlayers; i++) {
-			for (j = 0; j < tilec->numresolutions; j++) {
-				for (k = 0; k < 3; k++) {
-					matrice[i][j][k] =
-						(int) (cp->matrice[i * tilec->numresolutions * 3 + j * 3 + k]
-						* (float) (tcd->image->comps[compno].prec / 16.0));
-				}
-			}
-		}
-
-		for (resno = 0; resno < tilec->numresolutions; resno++) {
-			opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-			for (bandno = 0; bandno < res->numbands; bandno++) {
-				opj_tcd_band_t *band = &res->bands[bandno];
-				for (precno = 0; precno < res->pw * res->ph; precno++) {
-					opj_tcd_precinct_t *prc = &band->precincts[precno];
-					for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-						opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-						opj_tcd_layer_t *layer = &cblk->layers[layno];
-						int n;
-						int imsb = tcd->image->comps[compno].prec - cblk->numbps;	/* number of bit-plan equal to zero */
-						/* Correction of the matrix of coefficient to include the IMSB information */
-						if (layno == 0) {
-							value = matrice[layno][resno][bandno];
-							if (imsb >= value) {
-								value = 0;
-							} else {
-								value -= imsb;
-							}
-						} else {
-							value =	matrice[layno][resno][bandno] -	matrice[layno - 1][resno][bandno];
-							if (imsb >= matrice[layno - 1][resno][bandno]) {
-								value -= (imsb - matrice[layno - 1][resno][bandno]);
-								if (value < 0) {
-									value = 0;
-								}
-							}
-						}
-
-						if (layno == 0) {
-							cblk->numpassesinlayers = 0;
-						}
-
-						n = cblk->numpassesinlayers;
-						if (cblk->numpassesinlayers == 0) {
-							if (value != 0) {
-								n = 3 * value - 2 + cblk->numpassesinlayers;
-							} else {
-								n = cblk->numpassesinlayers;
-							}
-						} else {
-							n = 3 * value + cblk->numpassesinlayers;
-						}
-
-						layer->numpasses = n - cblk->numpassesinlayers;
-
-						if (!layer->numpasses)
-							continue;
-
-						if (cblk->numpassesinlayers == 0) {
-							layer->len = cblk->passes[n - 1].rate;
-							layer->data = cblk->data;
-						} else {
-							layer->len = cblk->passes[n - 1].rate - cblk->passes[cblk->numpassesinlayers - 1].rate;
-							layer->data = cblk->data + cblk->passes[cblk->numpassesinlayers - 1].rate;
-						}
-						if (final)
-							cblk->numpassesinlayers = n;
-					}
-				}
-			}
-		}
-	}
-}
-
-void tcd_rateallocate_fixed(opj_tcd_t *tcd) {
-	int layno;
-	for (layno = 0; layno < tcd->tcp->numlayers; layno++) {
-		tcd_makelayer_fixed(tcd, layno, 1);
-	}
-}
-
-void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final) {
-	int compno, resno, bandno, precno, cblkno, passno;
-
-	opj_tcd_tile_t *tcd_tile = tcd->tcd_tile;
-
-	tcd_tile->distolayer[layno] = 0;	/* fixed_quality */
-
-	for (compno = 0; compno < tcd_tile->numcomps; compno++) {
-		opj_tcd_tilecomp_t *tilec = &tcd_tile->comps[compno];
-		for (resno = 0; resno < tilec->numresolutions; resno++) {
-			opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-			for (bandno = 0; bandno < res->numbands; bandno++) {
-				opj_tcd_band_t *band = &res->bands[bandno];
-				for (precno = 0; precno < res->pw * res->ph; precno++) {
-					opj_tcd_precinct_t *prc = &band->precincts[precno];
-					for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-						opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-						opj_tcd_layer_t *layer = &cblk->layers[layno];
-
-						int n;
-						if (layno == 0) {
-							cblk->numpassesinlayers = 0;
-						}
-						n = cblk->numpassesinlayers;
-						for (passno = cblk->numpassesinlayers; passno < cblk->totalpasses; passno++) {
-							int dr;
-							double dd;
-							opj_tcd_pass_t *pass = &cblk->passes[passno];
-							if (n == 0) {
-								dr = pass->rate;
-								dd = pass->distortiondec;
-							} else {
-								dr = pass->rate - cblk->passes[n - 1].rate;
-								dd = pass->distortiondec - cblk->passes[n - 1].distortiondec;
-							}
-							if (!dr) {
-								if (dd != 0)
-									n = passno + 1;
-								continue;
-							}
-							if (dd / dr >= thresh)
-								n = passno + 1;
-						}
-						layer->numpasses = n - cblk->numpassesinlayers;
-
-						if (!layer->numpasses) {
-							layer->disto = 0;
-							continue;
-						}
-						if (cblk->numpassesinlayers == 0) {
-							layer->len = cblk->passes[n - 1].rate;
-							layer->data = cblk->data;
-							layer->disto = cblk->passes[n - 1].distortiondec;
-						} else {
-							layer->len = cblk->passes[n - 1].rate -	cblk->passes[cblk->numpassesinlayers - 1].rate;
-							layer->data = cblk->data + cblk->passes[cblk->numpassesinlayers - 1].rate;
-							layer->disto = cblk->passes[n - 1].distortiondec - cblk->passes[cblk->numpassesinlayers - 1].distortiondec;
-						}
-
-						tcd_tile->distolayer[layno] += layer->disto;	/* fixed_quality */
-
-						if (final)
-							cblk->numpassesinlayers = n;
-					}
-				}
-			}
-		}
-	}
-}
-
-bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_image_info_t * image_info) {
-	int compno, resno, bandno, precno, cblkno, passno, layno;
-	double min, max;
-	double cumdisto[100];	/* fixed_quality */
-	const double K = 1;		/* 1.1; fixed_quality */
-	double maxSE = 0;
-
-	opj_cp_t *cp = tcd->cp;
-	opj_tcd_tile_t *tcd_tile = tcd->tcd_tile;
-	opj_tcp_t *tcd_tcp = tcd->tcp;
-
-	min = DBL_MAX;
-	max = 0;
-
-	tcd_tile->nbpix = 0;		/* fixed_quality */
-
-	for (compno = 0; compno < tcd_tile->numcomps; compno++) {
-		opj_tcd_tilecomp_t *tilec = &tcd_tile->comps[compno];
-		tilec->nbpix = 0;
-
-		for (resno = 0; resno < tilec->numresolutions; resno++) {
-			opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
-			for (bandno = 0; bandno < res->numbands; bandno++) {
-				opj_tcd_band_t *band = &res->bands[bandno];
-
-				for (precno = 0; precno < res->pw * res->ph; precno++) {
-					opj_tcd_precinct_t *prc = &band->precincts[precno];
-
-					for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {
-						opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
-
-						for (passno = 0; passno < cblk->totalpasses; passno++) {
-							opj_tcd_pass_t *pass = &cblk->passes[passno];
-							int dr;
-							double dd, rdslope;
-							if (passno == 0) {
-								dr = pass->rate;
-								dd = pass->distortiondec;
-							} else {
-								dr = pass->rate - cblk->passes[passno - 1].rate;
-								dd = pass->distortiondec - cblk->passes[passno - 1].distortiondec;
-							}
-							if (dr == 0) {
-								continue;
-							}
-							rdslope = dd / dr;
-							if (rdslope < min) {
-								min = rdslope;
-							}
-							if (rdslope > max) {
-								max = rdslope;
-							}
-						} /* passno */
-
-						/* fixed_quality */
-						tcd_tile->nbpix += ((cblk->x1 - cblk->x0) * (cblk->y1 - cblk->y0));
-						tilec->nbpix += ((cblk->x1 - cblk->x0) * (cblk->y1 - cblk->y0));
-					} /* cbklno */
-				} /* precno */
-			} /* bandno */
-		} /* resno */
-
-		maxSE += (((double)(1 << tcd->image->comps[compno].prec) - 1.0)
-			* ((double)(1 << tcd->image->comps[compno].prec) -1.0))
-			* ((double)(tilec->nbpix));
-	} /* compno */
-
-	/* index file */
-	if(image_info && image_info->index_on) {
-		opj_tile_info_t *tile_info = &image_info->tile[tcd->tcd_tileno];
-		tile_info->nbpix = tcd_tile->nbpix;
-		tile_info->distotile = tcd_tile->distotile;
-		tile_info->thresh = (double *) opj_malloc(tcd_tcp->numlayers * sizeof(double));
-	}
-
-	for (layno = 0; layno < tcd_tcp->numlayers; layno++) {
-		double lo = min;
-		double hi = max;
-		int success = 0;
-		/* TODO: remove maxlen */
-		int maxlen = tcd_tcp->rates[layno] ? int_min(((int) ceil(tcd_tcp->rates[layno])), len) : len;
-		double goodthresh = 0;
-		double stable_thresh = 0;
-		int i;
-		double distotarget;		/* fixed_quality */
-
-		/* fixed_quality */
-		distotarget = tcd_tile->distotile - ((K * maxSE) / pow((float)10, tcd_tcp->distoratio[layno] / 10));
-
-		if ((tcd_tcp->rates[layno]) || (cp->disto_alloc == 0)) {
-			opj_t2_t *t2 = t2_create(tcd->cinfo, tcd->image, cp);
-
-			for (i = 0; i < 32; i++) {
-				double thresh = (lo + hi) / 2;
-				int l = 0;
-				double distoachieved = 0;	/* fixed_quality */
-
-				tcd_makelayer(tcd, layno, thresh, 0);
-
-				if (cp->fixed_quality) {	/* fixed_quality */
-					if(cp->cinema){
-						l = t2_encode_packets(t2,tcd->tcd_tileno, tcd_tile, layno + 1, dest, maxlen, image_info,tcd->cur_tp_num,tcd->tp_pos,tcd->cur_pino,THRESH_CALC);
-						if (l == -999) {
-							lo = thresh;
-							continue;
-						}else{
-           		distoachieved =	layno == 0 ?
-							tcd_tile->distolayer[0]	: cumdisto[layno - 1] + tcd_tile->distolayer[layno];
-							if (distoachieved < distotarget) {
-								hi=thresh;
-								stable_thresh = thresh;
-								continue;
-							}else{
-								lo=thresh;
-							}
-						}
-					}else{
-						distoachieved =	(layno == 0) ?
-							tcd_tile->distolayer[0]	: (cumdisto[layno - 1] + tcd_tile->distolayer[layno]);
-						if (distoachieved < distotarget) {
-							hi = thresh;
-							stable_thresh = thresh;
-							continue;
-						}
-						lo = thresh;
-					}
-				} else {
-					l = t2_encode_packets(t2, tcd->tcd_tileno, tcd_tile, layno + 1, dest, maxlen, image_info,tcd->cur_tp_num,tcd->tp_pos,tcd->cur_pino,THRESH_CALC);
-					/* TODO: what to do with l ??? seek / tell ??? */
-					/* opj_event_msg(tcd->cinfo, EVT_INFO, "rate alloc: len=%d, max=%d\n", l, maxlen); */
-					if (l == -999) {
-						lo = thresh;
-						continue;
-					}
-					hi = thresh;
-					stable_thresh = thresh;
-				}
-			}
-			success = 1;
-			goodthresh = stable_thresh;
-			t2_destroy(t2);
-		} else {
-			success = 1;
-			goodthresh = min;
-		}
-
-		if (!success) {
-			return false;
-		}
-
-		if(image_info && image_info->index_on) {	/* Threshold for Marcela Index */
-			image_info->tile[tcd->tcd_tileno].thresh[layno] = goodthresh;
-		}
-		tcd_makelayer(tcd, layno, goodthresh, 1);
-
-		/* fixed_quality */
-		cumdisto[layno] = (layno == 0) ? tcd_tile->distolayer[0] : (cumdisto[layno - 1] + tcd_tile->distolayer[layno]);
-	}
-
-	return true;
-}
-
-int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_image_info_t * image_info) {
-	int compno;
-	int l, i, npck = 0;
-	opj_tcd_tile_t *tile = NULL;
-	opj_tcp_t *tcd_tcp = NULL;
-	opj_cp_t *cp = NULL;
-
-	opj_tcp_t *tcp = &tcd->cp->tcps[0];
-	opj_tccp_t *tccp = &tcp->tccps[0];
-	opj_image_t *image = tcd->image;
-
-	opj_t1_t *t1 = NULL;		/* T1 component */
-	opj_t2_t *t2 = NULL;		/* T2 component */
-
-	tcd->tcd_tileno = tileno;
-	tcd->tcd_tile = tcd->tcd_image->tiles;
-	tcd->tcp = &tcd->cp->tcps[tileno];
-
-	tile = tcd->tcd_tile;
-	tcd_tcp = tcd->tcp;
-	cp = tcd->cp;
-
-	if(tcd->cur_tp_num == 0){
-		tcd->encoding_time = opj_clock();	/* time needed to encode a tile */
-		/* INDEX >> "Precinct_nb_X et Precinct_nb_Y" */
-		if(image_info && image_info->index_on) {
-			opj_tcd_tilecomp_t *tilec_idx = &tile->comps[0];	/* based on component 0 */
-			for (i = 0; i < tilec_idx->numresolutions; i++) {
-				opj_tcd_resolution_t *res_idx = &tilec_idx->resolutions[i];
-
-				image_info->tile[tileno].pw[i] = res_idx->pw;
-				image_info->tile[tileno].ph[i] = res_idx->ph;
-
-				npck += res_idx->pw * res_idx->ph;
-
-				image_info->tile[tileno].pdx[i] = tccp->prcw[i];
-				image_info->tile[tileno].pdy[i] = tccp->prch[i];
-			}
-			image_info->tile[tileno].packet = (opj_packet_info_t *) opj_malloc(image_info->comp * image_info->layer * npck * sizeof(opj_packet_info_t));
-		}
-		/* << INDEX */
-
-		/*---------------TILE-------------------*/
-
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			int x, y;
-
-			int adjust = image->comps[compno].sgnd ? 0 : 1 << (image->comps[compno].prec - 1);
-			int offset_x = int_ceildiv(image->x0, image->comps[compno].dx);
-			int offset_y = int_ceildiv(image->y0, image->comps[compno].dy);
-
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-			int tw = tilec->x1 - tilec->x0;
-			int w = int_ceildiv(image->x1 - image->x0, image->comps[compno].dx);
-
-			/* extract tile data */
-
-			if (tcd_tcp->tccps[compno].qmfbid == 1) {
-				for (y = tilec->y0; y < tilec->y1; y++) {
-					/* start of the src tile scanline */
-					int *data = &image->comps[compno].data[(tilec->x0 - offset_x) + (y - offset_y) * w];
-					/* start of the dst tile scanline */
-					int *tile_data = &tilec->data[(y - tilec->y0) * tw];
-					for (x = tilec->x0; x < tilec->x1; x++) {
-						*tile_data++ = *data++ - adjust;
-					}
-				}
-			} else if (tcd_tcp->tccps[compno].qmfbid == 0) {
-				for (y = tilec->y0; y < tilec->y1; y++) {
-					/* start of the src tile scanline */
-					int *data = &image->comps[compno].data[(tilec->x0 - offset_x) + (y - offset_y) * w];
-					/* start of the dst tile scanline */
-					int *tile_data = &tilec->data[(y - tilec->y0) * tw];
-					for (x = tilec->x0; x < tilec->x1; x++) {
-						*tile_data++ = (*data++ - adjust) << 11;
-					}
-
-				}
-			}
-		}
-
-		/*----------------MCT-------------------*/
-		if (tcd_tcp->mct) {
-			int samples = (tile->comps[0].x1 - tile->comps[0].x0) * (tile->comps[0].y1 - tile->comps[0].y0);
-			if (tcd_tcp->tccps[0].qmfbid == 0) {
-				mct_encode_real(tile->comps[0].data, tile->comps[1].data, tile->comps[2].data, samples);
-			} else {
-				mct_encode(tile->comps[0].data, tile->comps[1].data, tile->comps[2].data, samples);
-			}
-		}
-
-		/*----------------DWT---------------------*/
-
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-			if (tcd_tcp->tccps[compno].qmfbid == 1) {
-				dwt_encode(tilec);
-			} else if (tcd_tcp->tccps[compno].qmfbid == 0) {
-				dwt_encode_real(tilec);
-			}
-		}
-
-		/*------------------TIER1-----------------*/
-		t1 = t1_create(tcd->cinfo);
-		t1_encode_cblks(t1, tile, tcd_tcp);
-		t1_destroy(t1);
-
-		/*-----------RATE-ALLOCATE------------------*/
-
-		/* INDEX */
-		if(image_info) {
-			image_info->index_write = 0;
-		}
-		if (cp->disto_alloc || cp->fixed_quality) {	/* fixed_quality */
-			/* Normal Rate/distortion allocation */
-			tcd_rateallocate(tcd, dest, len, image_info);
-		} else {
-			/* Fixed layer allocation */
-			tcd_rateallocate_fixed(tcd);
-		}
-	}
-	/*--------------TIER2------------------*/
-
-	/* INDEX */
-	if(image_info) {
-		image_info->index_write = 1;
-	}
-
-	t2 = t2_create(tcd->cinfo, image, cp);
-	l = t2_encode_packets(t2,tileno, tile, tcd_tcp->numlayers, dest, len, image_info,tcd->tp_num,tcd->tp_pos,tcd->cur_pino,FINAL_PASS);
-	t2_destroy(t2);
-
-	/*---------------CLEAN-------------------*/
-
-
-	if(tcd->cur_tp_num == tcd->cur_totnum_tp - 1){
-		tcd->encoding_time = opj_clock() - tcd->encoding_time;
-		opj_event_msg(tcd->cinfo, EVT_INFO, "- tile encoded in %f s\n", tcd->encoding_time);
-
-		/* cleaning memory */
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-			opj_free(tilec->data);
-		}
-	}
-
-	return l;
-}
-
-bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno) {
-	int l;
-	int compno;
-	int eof = 0;
-	double tile_time, t1_time, dwt_time;
-	opj_tcd_tile_t *tile = NULL;
-
-	opj_t1_t *t1 = NULL;		/* T1 component */
-	opj_t2_t *t2 = NULL;		/* T2 component */
-
-	tcd->tcd_tileno = tileno;
-	tcd->tcd_tile = &(tcd->tcd_image->tiles[tileno]);
-	tcd->tcp = &(tcd->cp->tcps[tileno]);
-	tile = tcd->tcd_tile;
-
-	tile_time = opj_clock();	/* time needed to decode a tile */
-	opj_event_msg(tcd->cinfo, EVT_INFO, "tile %d of %d\n", tileno + 1, tcd->cp->tw * tcd->cp->th);
-
-	/*--------------TIER2------------------*/
-
-	t2 = t2_create(tcd->cinfo, tcd->image, tcd->cp);
-	l = t2_decode_packets(t2, src, len, tileno, tile);
-	t2_destroy(t2);
-
-	if (l == -999) {
-		eof = 1;
-		opj_event_msg(tcd->cinfo, EVT_ERROR, "tcd_decode: incomplete bistream\n");
-	}
-
-	/*------------------TIER1-----------------*/
-
-	t1_time = opj_clock();	/* time needed to decode a tile */
-	t1 = t1_create(tcd->cinfo);
-	t1_decode_cblks(t1, tile, tcd->tcp);
-	t1_destroy(t1);
-	t1_time = opj_clock() - t1_time;
-	opj_event_msg(tcd->cinfo, EVT_INFO, "- tiers-1 took %f s\n", t1_time);
-
-	/*----------------DWT---------------------*/
-
-	dwt_time = opj_clock();	/* time needed to decode a tile */
-	for (compno = 0; compno < tile->numcomps; compno++) {
-		opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-		if (tcd->cp->reduce != 0) {
-			tcd->image->comps[compno].resno_decoded =
-				tile->comps[compno].numresolutions - tcd->cp->reduce - 1;
-		}
-
-		if (tcd->tcp->tccps[compno].qmfbid == 1) {
-			dwt_decode(tilec, tilec->numresolutions - 1 - tcd->image->comps[compno].resno_decoded);
-		} else {
-			dwt_decode_real(tilec, tilec->numresolutions - 1 - tcd->image->comps[compno].resno_decoded);
-		}
-
-		if (tile->comps[compno].numresolutions > 0) {
-			tcd->image->comps[compno].factor = tile->comps[compno].numresolutions - (tcd->image->comps[compno].resno_decoded + 1);
-		}
-	}
-	dwt_time = opj_clock() - dwt_time;
-	opj_event_msg(tcd->cinfo, EVT_INFO, "- dwt took %f s\n", dwt_time);
-
-	/*----------------MCT-------------------*/
-
-	if (tcd->tcp->mct) {
-		if (tcd->tcp->tccps[0].qmfbid == 1) {
-			mct_decode(tile->comps[0].data, tile->comps[1].data, tile->comps[2].data,
-				(tile->comps[0].x1 - tile->comps[0].x0) * (tile->comps[0].y1 - tile->comps[0].y0));
-		} else {
-			mct_decode_real(tile->comps[0].data, tile->comps[1].data, tile->comps[2].data,
-				(tile->comps[0].x1 - tile->comps[0].x0) * (tile->comps[0].y1 - tile->comps[0].y0));
-		}
-	}
-
-	/*---------------TILE-------------------*/
-
-	for (compno = 0; compno < tile->numcomps; compno++) {
-		opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-		opj_tcd_resolution_t *res =	&tilec->resolutions[tcd->image->comps[compno].resno_decoded];
-		int adjust = tcd->image->comps[compno].sgnd ? 0 : 1 << (tcd->image->comps[compno].prec - 1);
-		int min = tcd->image->comps[compno].sgnd ?
-			-(1 << (tcd->image->comps[compno].prec - 1)) : 0;
-		int max = tcd->image->comps[compno].sgnd ?
-			(1 << (tcd->image->comps[compno].prec - 1)) - 1 : (1 << tcd->image->comps[compno].prec) - 1;
-
-		int tw = tilec->x1 - tilec->x0;
-		int w = tcd->image->comps[compno].w;
-
-		int i, j;
-		int offset_x = int_ceildivpow2(tcd->image->comps[compno].x0, tcd->image->comps[compno].factor);
-		int offset_y = int_ceildivpow2(tcd->image->comps[compno].y0, tcd->image->comps[compno].factor);
-
-		for (j = res->y0; j < res->y1; j++) {
-			for (i = res->x0; i < res->x1; i++) {
-				int v;
-				float tmp = (float)((tilec->data[i - res->x0 + (j - res->y0) * tw]) / 8192.0);
-
-				if (tcd->tcp->tccps[compno].qmfbid == 1) {
-					v = tilec->data[i - res->x0 + (j - res->y0) * tw];
-				} else {
-					int tmp2 = ((int) (floor(fabs(tmp)))) + ((int) floor(fabs(tmp*2))%2);
-					v = ((tmp < 0) ? -tmp2:tmp2);
-				}
-				v += adjust;
-
-				tcd->image->comps[compno].data[(i - offset_x) + (j - offset_y) * w] = int_clamp(v, min, max);
-			}
-		}
-	}
-
-	tile_time = opj_clock() - tile_time;	/* time needed to decode a tile */
-	opj_event_msg(tcd->cinfo, EVT_INFO, "- tile decoded in %f s\n", tile_time);
-
-	for (compno = 0; compno < tile->numcomps; compno++) {
-		opj_free(tcd->tcd_image->tiles[tileno].comps[compno].data);
-		tcd->tcd_image->tiles[tileno].comps[compno].data = NULL;
-	}
-
-	if (eof) {
-		return false;
-	}
-
-	return true;
-}
-
-void tcd_free_decode(opj_tcd_t *tcd) {
-	int tileno,compno,resno,bandno,precno;
-
-	opj_tcd_image_t *tcd_image = tcd->tcd_image;
-
-	for (tileno = 0; tileno < tcd_image->tw * tcd_image->th; tileno++) {
-		opj_tcd_tile_t *tile = &tcd_image->tiles[tileno];
-		for (compno = 0; compno < tile->numcomps; compno++) {
-			opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
-			for (resno = 0; resno < tilec->numresolutions; resno++) {
-				opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-				for (bandno = 0; bandno < res->numbands; bandno++) {
-					opj_tcd_band_t *band = &res->bands[bandno];
-					for (precno = 0; precno < res->ph * res->pw; precno++) {
-						opj_tcd_precinct_t *prec = &band->precincts[precno];
-						if (prec->cblks != NULL) opj_free(prec->cblks);
-						if (prec->imsbtree != NULL) tgt_destroy(prec->imsbtree);
-						if (prec->incltree != NULL) tgt_destroy(prec->incltree);
-					}
-					if (band->precincts != NULL) opj_free(band->precincts);
-				}
-			}
-			if (tilec->resolutions != NULL) opj_free(tilec->resolutions);
-		}
-		if (tile->comps != NULL) opj_free(tile->comps);
-	}
-
-	if (tcd_image->tiles != NULL) opj_free(tcd_image->tiles);
-}
-
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/tcd.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/tcd.h
deleted file mode 100644
index ae66709..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/tcd.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __TCD_H
-#define __TCD_H
-/**
-@file tcd.h
-@brief Implementation of a tile coder/decoder (TCD)
-
-The functions in TCD.C have for goal to encode or decode each tile independently from
-each other. The functions in TCD.C are used by some function in J2K.C.
-*/
-
-/** @defgroup TCD TCD - Implementation of a tile coder/decoder */
-/*@{*/
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_seg {
-  int numpasses;
-  int len;
-  unsigned char *data;
-  int maxpasses;
-  int numnewpasses;
-  int newlen;
-} opj_tcd_seg_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_pass {
-  int rate;
-  double distortiondec;
-  int term, len;
-} opj_tcd_pass_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_layer {
-  int numpasses;		/* Number of passes in the layer */
-  int len;			/* len of information */
-  double disto;			/* add for index (Cfr. Marcela) */
-  unsigned char *data;		/* data */
-} opj_tcd_layer_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_cblk {
-  int x0, y0, x1, y1;		/* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
-  int numbps;
-  int numlenbits;
-  int len;			/* length */
-  int numpasses;		/* number of pass already done for the code-blocks */
-  int numnewpasses;		/* number of pass added to the code-blocks */
-  int numsegs;			/* number of segments */
-  opj_tcd_seg_t segs[100];		/* segments informations */
-  unsigned char data[8192];	/* Data */
-  int numpassesinlayers;	/* number of passes in the layer */
-  opj_tcd_layer_t layers[100];	/* layer information */
-  int totalpasses;		/* total number of passes */
-  opj_tcd_pass_t passes[100];	/* information about the passes */
-} opj_tcd_cblk_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_precinct {
-  int x0, y0, x1, y1;		/* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
-  int cw, ch;			/* number of precinct in width and heigth */
-  opj_tcd_cblk_t *cblks;		/* code-blocks informations */
-  opj_tgt_tree_t *incltree;		/* inclusion tree */
-  opj_tgt_tree_t *imsbtree;		/* IMSB tree */
-} opj_tcd_precinct_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_band {
-  int x0, y0, x1, y1;		/* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
-  int bandno;
-  opj_tcd_precinct_t *precincts;	/* precinct information */
-  int numbps;
-  float stepsize;
-} opj_tcd_band_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_resolution {
-  int x0, y0, x1, y1;		/* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
-  int pw, ph;
-  int numbands;			/* number sub-band for the resolution level */
-  opj_tcd_band_t bands[3];		/* subband information */
-} opj_tcd_resolution_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_tilecomp {
-  int x0, y0, x1, y1;		/* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
-  int numresolutions;		/* number of resolutions level */
-  opj_tcd_resolution_t *resolutions;	/* resolutions information */
-  int *data;			/* data of the component */
-  int nbpix;			/* add fixed_quality */
-} opj_tcd_tilecomp_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_tile {
-  int x0, y0, x1, y1;		/* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
-  int numcomps;			/* number of components in tile */
-  opj_tcd_tilecomp_t *comps;	/* Components information */
-  int nbpix;			/* add fixed_quality */
-  double distotile;		/* add fixed_quality */
-  double distolayer[100];	/* add fixed_quality */
-} opj_tcd_tile_t;
-
-/**
-FIXME: documentation
-*/
-typedef struct opj_tcd_image {
-  int tw, th;			/* number of tiles in width and heigth */
-  opj_tcd_tile_t *tiles;		/* Tiles information */
-} opj_tcd_image_t;
-
-/**
-Tile coder/decoder
-*/
-typedef struct opj_tcd {
-	/** Position of the tilepart flag in Progression order*/
-	int tp_pos;
-	/** Tile part number*/
-	int tp_num;
-	/** Current tile part number*/
-	int cur_tp_num;
-	/** Total number of tileparts of the current tile*/
-	int cur_totnum_tp;
-	/** Current Packet iterator number */
-	int cur_pino;
-	/** codec context */
-	opj_common_ptr cinfo;
-
-	/** info on each image tile */
-	opj_tcd_image_t *tcd_image;
-	/** image */
-	opj_image_t *image;
-	/** coding parameters */
-	opj_cp_t *cp;
-	/** pointer to the current encoded/decoded tile */
-	opj_tcd_tile_t *tcd_tile;
-	/** coding/decoding parameters common to all tiles */
-	opj_tcp_t *tcp;
-	/** current encoded/decoded tile */
-	int tcd_tileno;
-	/** Time taken to encode a tile*/
-	double encoding_time;
-} opj_tcd_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-
-/**
-Dump the content of a tcd structure
-*/
-void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);
-/**
-Create a new TCD handle
-@param cinfo Codec context info
-@return Returns a new TCD handle if successful returns NULL otherwise
-*/
-opj_tcd_t* tcd_create(opj_common_ptr cinfo);
-/**
-Destroy a previously created TCD handle
-@param tcd TCD handle to destroy
-*/
-void tcd_destroy(opj_tcd_t *tcd);
-/**
-Initialize the tile coder (allocate the memory)
-@param tcd TCD handle
-@param image Raw image
-@param cp Coding parameters
-@param curtileno Number that identifies the tile that will be encoded
-*/
-void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
-/**
-Free the memory allocated for encoding
-@param tcd TCD handle
-*/
-void tcd_free_encode(opj_tcd_t *tcd);
-/**
-Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)
-@param tcd TCD handle
-@param image Raw image
-@param cp Coding parameters
-@param curtileno Number that identifies the tile that will be encoded
-*/
-void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
-/**
-Initialize the tile decoder
-@param tcd TCD handle
-@param image Raw image
-@param cp Coding parameters
-*/
-void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp);
-void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final);
-void tcd_rateallocate_fixed(opj_tcd_t *tcd);
-void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final);
-bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_image_info_t * image_info);
-/**
-Encode a tile from the raw image into a buffer
-@param tcd TCD handle
-@param tileno Number that identifies one of the tiles to be encoded
-@param dest Destination buffer
-@param len Length of destination buffer
-@param image_info Creation of index file
-@return
-*/
-int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_image_info_t * image_info);
-/**
-Decode a tile from a buffer into a raw image
-@param tcd TCD handle
-@param src Source buffer
-@param len Length of source buffer
-@param tileno Number that identifies one of the tiles to be decoded
-*/
-bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno);
-/**
-Free the memory allocated for decoding
-@param tcd TCD handle
-*/
-void tcd_free_decode(opj_tcd_t *tcd);
-
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __TCD_H */
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/tgt.c b/old/libsl1550/openjpeg-libsl/libopenjpeg/tgt.c
deleted file mode 100644
index 30b0aee..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/tgt.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opj_includes.h"
-
-/*
-==========================================================
-   Tag-tree coder interface
-==========================================================
-*/
-
-opj_tgt_tree_t *tgt_create(int numleafsh, int numleafsv) {
-	int nplh[32];
-	int nplv[32];
-	opj_tgt_node_t *node = NULL;
-	opj_tgt_node_t *parentnode = NULL;
-	opj_tgt_node_t *parentnode0 = NULL;
-	opj_tgt_tree_t *tree = NULL;
-	int i, j, k;
-	int numlvls;
-	int n;
-
-	tree = (opj_tgt_tree_t *) opj_malloc(sizeof(opj_tgt_tree_t));
-	if(!tree) return NULL;
-	tree->numleafsh = numleafsh;
-	tree->numleafsv = numleafsv;
-
-	numlvls = 0;
-	nplh[0] = numleafsh;
-	nplv[0] = numleafsv;
-	tree->numnodes = 0;
-	do {
-		n = nplh[numlvls] * nplv[numlvls];
-		nplh[numlvls + 1] = (nplh[numlvls] + 1) / 2;
-		nplv[numlvls + 1] = (nplv[numlvls] + 1) / 2;
-		tree->numnodes += n;
-		++numlvls;
-	} while (n > 1);
-
-	/* ADD */
-	if (tree->numnodes == 0) {
-		opj_free(tree);
-		return NULL;
-	}
-
-	tree->nodes = (opj_tgt_node_t *) opj_malloc(tree->numnodes * sizeof(opj_tgt_node_t));
-	if(!tree->nodes) {
-		opj_free(tree);
-		return NULL;
-	}
-
-	node = tree->nodes;
-	parentnode = &tree->nodes[tree->numleafsh * tree->numleafsv];
-	parentnode0 = parentnode;
-
-	for (i = 0; i < numlvls - 1; ++i) {
-		for (j = 0; j < nplv[i]; ++j) {
-			k = nplh[i];
-			while (--k >= 0) {
-				node->parent = parentnode;
-				++node;
-				if (--k >= 0) {
-					node->parent = parentnode;
-					++node;
-				}
-				++parentnode;
-			}
-			if ((j & 1) || j == nplv[i] - 1) {
-				parentnode0 = parentnode;
-			} else {
-				parentnode = parentnode0;
-				parentnode0 += nplh[i];
-			}
-		}
-	}
-	node->parent = 0;
-
-	tgt_reset(tree);
-
-	return tree;
-}
-
-void tgt_destroy(opj_tgt_tree_t *tree) {
-	opj_free(tree->nodes);
-	opj_free(tree);
-}
-
-void tgt_reset(opj_tgt_tree_t *tree) {
-	int i;
-
-	if (NULL == tree)
-		return;
-
-	for (i = 0; i < tree->numnodes; i++) {
-		tree->nodes[i].value = 999;
-		tree->nodes[i].low = 0;
-		tree->nodes[i].known = 0;
-	}
-}
-
-void tgt_setvalue(opj_tgt_tree_t *tree, int leafno, int value) {
-	opj_tgt_node_t *node;
-	node = &tree->nodes[leafno];
-	while (node && node->value > value) {
-		node->value = value;
-		node = node->parent;
-	}
-}
-
-void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold) {
-	opj_tgt_node_t *stk[31];
-	opj_tgt_node_t **stkptr;
-	opj_tgt_node_t *node;
-	int low;
-
-	stkptr = stk;
-	node = &tree->nodes[leafno];
-	while (node->parent) {
-		*stkptr++ = node;
-		node = node->parent;
-	}
-
-	low = 0;
-	for (;;) {
-		if (low > node->low) {
-			node->low = low;
-		} else {
-			low = node->low;
-		}
-
-		while (low < threshold) {
-			if (low >= node->value) {
-				if (!node->known) {
-					bio_write(bio, 1, 1);
-					node->known = 1;
-				}
-				break;
-			}
-			bio_write(bio, 0, 1);
-			++low;
-		}
-
-		node->low = low;
-		if (stkptr == stk)
-			break;
-		node = *--stkptr;
-	}
-}
-
-int tgt_decode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold) {
-	opj_tgt_node_t *stk[31];
-	opj_tgt_node_t **stkptr;
-	opj_tgt_node_t *node;
-	int low;
-
-	stkptr = stk;
-	node = &tree->nodes[leafno];
-	while (node->parent) {
-		*stkptr++ = node;
-		node = node->parent;
-	}
-
-	low = 0;
-	for (;;) {
-		if (low > node->low) {
-			node->low = low;
-		} else {
-			low = node->low;
-		}
-		while (low < threshold && low < node->value) {
-			if (bio_read(bio, 1)) {
-				node->value = low;
-			} else {
-				++low;
-			}
-		}
-		node->low = low;
-		if (stkptr == stk) {
-			break;
-		}
-		node = *--stkptr;
-	}
-
-	return (node->value < threshold) ? 1 : 0;
-}
diff --git a/old/libsl1550/openjpeg-libsl/libopenjpeg/tgt.h b/old/libsl1550/openjpeg-libsl/libopenjpeg/tgt.h
deleted file mode 100644
index c08c8da..0000000
--- a/old/libsl1550/openjpeg-libsl/libopenjpeg/tgt.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __TGT_H
-#define __TGT_H
-/**
-@file tgt.h
-@brief Implementation of a tag-tree coder (TGT)
-
-The functions in TGT.C have for goal to realize a tag-tree coder. The functions in TGT.C
-are used by some function in T2.C.
-*/
-
-/** @defgroup TGT TGT - Implementation of a tag-tree coder */
-/*@{*/
-
-/**
-Tag node
-*/
-typedef struct opj_tgt_node {
-  struct opj_tgt_node *parent;
-  int value;
-  int low;
-  int known;
-} opj_tgt_node_t;
-
-/**
-Tag tree
-*/
-typedef struct opj_tgt_tree {
-  int numleafsh;
-  int numleafsv;
-  int numnodes;
-  opj_tgt_node_t *nodes;
-} opj_tgt_tree_t;
-
-/** @name Exported functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Create a tag-tree
-@param numleafsh Width of the array of leafs of the tree
-@param numleafsv Height of the array of leafs of the tree
-@return Returns a new tag-tree if successful, returns NULL otherwise
-*/
-opj_tgt_tree_t *tgt_create(int numleafsh, int numleafsv);
-/**
-Destroy a tag-tree, liberating memory
-@param tree Tag-tree to destroy
-*/
-void tgt_destroy(opj_tgt_tree_t *tree);
-/**
-Reset a tag-tree (set all leaves to 0)
-@param tree Tag-tree to reset
-*/
-void tgt_reset(opj_tgt_tree_t *tree);
-/**
-Set the value of a leaf of a tag-tree
-@param tree Tag-tree to modify
-@param leafno Number that identifies the leaf to modify
-@param value New value of the leaf
-*/
-void tgt_setvalue(opj_tgt_tree_t *tree, int leafno, int value);
-/**
-Encode the value of a leaf of the tag-tree up to a given threshold
-@param bio Pointer to a BIO handle
-@param tree Tag-tree to modify
-@param leafno Number that identifies the leaf to encode
-@param threshold Threshold to use when encoding value of the leaf
-*/
-void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
-/**
-Decode the value of a leaf of the tag-tree up to a given threshold
-@param bio Pointer to a BIO handle
-@param tree Tag-tree to decode
-@param leafno Number that identifies the leaf to decode
-@param threshold Threshold to use when decoding value of the leaf
-@return Returns 1 if the node's value < threshold, returns 0 otherwise
-*/
-int tgt_decode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
-/*@}*/
-
-#endif /* __TGT_H */
diff --git a/old/libsl1550/openjpeg-libsl/libsl/libsl.cpp b/old/libsl1550/openjpeg-libsl/libsl/libsl.cpp
deleted file mode 100644
index 4064e76..0000000
--- a/old/libsl1550/openjpeg-libsl/libsl/libsl.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-// This is the main DLL file.
-
-#include "libsl.h"
-extern "C" {
-#include "../libopenjpeg/openjpeg.h"
-}
-#include <algorithm>
-
-
-struct image_wrapper
-{
-	opj_image* image;
-
-	image_wrapper(int numcmpts, opj_image_cmptparm_t* cmptparms, OPJ_COLOR_SPACE clrspc)
-	{
-		image = opj_image_create(numcmpts, cmptparms, clrspc);
-
-		if (image == NULL)
-			throw "opj_image_create failed";
-	}
-
-	image_wrapper(opj_dinfo* dinfo, opj_cio* cio)
-	{
-		image = opj_decode(dinfo,cio);
-
-		if (image == NULL)
-			throw "opj_decode failed";
-	}
-
-	~image_wrapper()
-	{
-		opj_image_destroy(image);
-	}
-};
-
-struct cinfo_wrapper
-{
-	opj_cinfo* cinfo;
-
-	cinfo_wrapper(CODEC_FORMAT format)
-	{
-		cinfo = opj_create_compress(format);
-
-		if (cinfo == NULL)
-			throw "opj_create_compress failed";
-	}
-
-	~cinfo_wrapper()
-	{
-		opj_destroy_compress(cinfo);
-	}
-};
-
-struct dinfo_wrapper
-{
-	opj_dinfo* dinfo;
-
-	dinfo_wrapper(CODEC_FORMAT format)
-	{
-		dinfo = opj_create_decompress(format);
-
-		if (dinfo == NULL)
-			throw "opj_create_decompress failed";
-	}
-
-	~dinfo_wrapper()
-	{
-		opj_destroy_decompress(dinfo);
-	}
-};
-
-struct cio_wrapper
-{
-	opj_cio* cio;
-
-	cio_wrapper(opj_cinfo* cinfo, unsigned char* buffer, int length)
-	{
-		cio = opj_cio_open((opj_common_ptr)cinfo,buffer,length);
-
-		if (cio == NULL)
-			throw "opj_cio_open failed";
-	}
-
-	cio_wrapper(opj_dinfo* dinfo, unsigned char* buffer, int length)
-	{
-		cio = opj_cio_open((opj_common_ptr)dinfo,buffer,length);
-
-		if (cio == NULL)
-			throw "opj_cio_open failed";
-	}
-
-	~cio_wrapper()
-	{
-		opj_cio_close(cio);
-	}
-};
-
-bool LibslAllocEncoded(MarshalledImage* image)
-{
-	try
-	{
-		image->encoded = new unsigned char[image->length];
-		image->decoded = 0;
-	}
-
-	catch (...)
-	{
-		return false;
-	}
-
-	return true;
-}
-
-bool LibslAllocDecoded(MarshalledImage* image)
-{
-	try
-	{
-		image->decoded = new unsigned char[image->width * image->height * image->components];
-		image->encoded = 0;
-	}
-
-	catch (...)
-	{
-		return false;
-	}
-
-	return true;
-}
-
-void LibslFree(MarshalledImage* image)
-{
-	if (image->encoded != 0) delete[] image->encoded;
-	if (image->decoded != 0) delete[] image->decoded;
-}
-
-
-bool LibslEncode(MarshalledImage* image, bool lossless)
-{
-	try
-	{
-		opj_cparameters cparameters;
-		opj_set_default_encoder_parameters(&cparameters);
-		cparameters.cp_disto_alloc = 1;
-
-		if (lossless)
-		{
-			cparameters.tcp_numlayers = 1;
-			cparameters.tcp_rates[0] = 0;
-		}
-		else
-		{
-			cparameters.tcp_numlayers = 6;
-			cparameters.tcp_rates[0] = 1280;
-			cparameters.tcp_rates[1] = 640;
-			cparameters.tcp_rates[2] = 320;
-			cparameters.tcp_rates[3] = 160;
-			cparameters.tcp_rates[4] = 80;
-			cparameters.tcp_rates[5] = 40;
-		}
-
-		cparameters.cp_comment = "LL_RGBHM";
-		opj_image_comptparm comptparm[5];
-
-		for (int i = 0; i < image->components; i++)
-		{
-			comptparm[i].bpp = 8;
-			comptparm[i].prec = 8;
-			comptparm[i].sgnd = 0;
-			comptparm[i].dx = 1;
-			comptparm[i].dy = 1;
-			comptparm[i].x0 = 0;
-			comptparm[i].y0 = 0;
-			comptparm[i].w = image->width;
-			comptparm[i].h = image->height;
-		}
-
-		image_wrapper cimage(image->components,comptparm,CLRSPC_SRGB);
-		cimage.image->x0 = 0;
-		cimage.image->y0 = 0;
-		cimage.image->x1 = image->width;
-		cimage.image->y1 = image->height;
-		int n = image->width * image->height;
-
-		for (int i = 0; i < image->components; i++)
-			std::copy(image->decoded+i*n,image->decoded+(i+1)*n,cimage.image->comps[i].data);
-
-		cinfo_wrapper cinfo(CODEC_J2K);
-		opj_setup_encoder(cinfo.cinfo,&cparameters,cimage.image);
-		cio_wrapper cio(cinfo.cinfo,NULL,0);
-
-		if (!opj_encode(cinfo.cinfo,cio.cio,cimage.image,cparameters.index))
-			return false;
-
-		image->length = cio_tell(cio.cio);
-		image->encoded = new unsigned char[image->length];
-		std::copy(cio.cio->buffer,cio.cio->buffer+image->length,image->encoded);
-
-		return true;
-	}
-
-	catch (...)
-	{
-		return false;
-	}
-}
-
-bool LibslDecode(MarshalledImage* image)
-{
-	opj_dparameters dparameters;
-
-	try
-	{
-		opj_set_default_decoder_parameters(&dparameters);
-		dinfo_wrapper dinfo(CODEC_J2K);
-		opj_setup_decoder(dinfo.dinfo, &dparameters);
-		cio_wrapper cio(dinfo.dinfo,image->encoded,image->length);
-		image_wrapper cimage(dinfo.dinfo, cio.cio); // decode happens here
-
-		image->width = cimage.image->x1 - cimage.image->x0;
-		image->height = cimage.image->y1 - cimage.image->y0;
-		image->components = cimage.image->numcomps;
-		int n = image->width * image->height;
-		image->decoded = new unsigned char[n*image->components];
-
-		for (int i = 0; i < image->components; i++)
-			std::copy(cimage.image->comps[i].data,cimage.image->comps[i].data+n,image->decoded+i*n);
-
-		return true;
-	}
-
-	catch (...)
-	{
-		return false;
-	}
-}
diff --git a/old/libsl1550/openjpeg-libsl/libsl/libsl.h b/old/libsl1550/openjpeg-libsl/libsl/libsl.h
deleted file mode 100644
index 33fa9ed..0000000
--- a/old/libsl1550/openjpeg-libsl/libsl/libsl.h
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-#ifndef LIBSL_H
-#define LIBSL_H
-
-struct MarshalledImage
-{
-	unsigned char* encoded;
-	int length;
-	int dummy; // padding for 64-bit alignment
-
-	unsigned char* decoded;
-	int width;
-	int height;
-	int components;
-};
-
-#ifdef WIN32
-#define DLLEXPORT extern "C" __declspec(dllexport)
-#else
-#define DLLEXPORT extern "C"
-#endif
-
-// uncompresed images are raw RGBA 8bit/channel
-DLLEXPORT bool LibslEncode(MarshalledImage* image, bool lossless);
-DLLEXPORT bool LibslDecode(MarshalledImage* image);
-DLLEXPORT bool LibslAllocEncoded(MarshalledImage* image);
-DLLEXPORT bool LibslAllocDecoded(MarshalledImage* image);
-DLLEXPORT void LibslFree(MarshalledImage* image);
-
-
-#endif
diff --git a/old/libsl1550/openjpeg-libsl/license.txt b/old/libsl1550/openjpeg-libsl/license.txt
deleted file mode 100644
index d1e5b6a..0000000
--- a/old/libsl1550/openjpeg-libsl/license.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
\ No newline at end of file
diff --git a/old/nhibernate-1.2.1-patches/Makefile b/old/nhibernate-1.2.1-patches/Makefile
deleted file mode 100644
index a444a7d..0000000
--- a/old/nhibernate-1.2.1-patches/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-BUILD=nhibernate-build
-DRIVER=$(BUILD)/nhibernate/src/NHibernate/Driver/SqliteClientDriver.cs
-MONO1=$(BUILD)/nhibernate/lib/mono/1.0
-MONO2=$(BUILD)/nhibernate/lib/mono/2.0
-OUTDIR=$(BUILD)/nhibernate/build/NHibernate-1.2.1.GA/bin/mono-2.0/
-NHIB=$(OUTDIR)/NHibernate.dll
-
-all: $(NHIB)
-	mkdir nhibernate-dll
-	cp $(NHIB) $(OUTDIR)/NHibernate.Mapping.Attributes.dll $(OUTDIR)/Castle.DynamicProxy.dll $(OUTDIR)/Iesi.Collections.dll nhibernate-dll
-
-$(NHIB): $(MONO2) $(DRIVER)
-	cd $(BUILD)/nhibernate && nant -D:project.config=release clean build
-
-$(MONO2): $(BUILD)
-	cp -a $(MONO1) $(MONO2)
-
-$(DRIVER): $(BUILD)
-	cd $(BUILD) && patch -p0 < ../sqlite-driver-mono-1.2.x.patch
-
-$(BUILD):
-	svn co https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/tags/1.2.1.GA $(BUILD)
-
-clean:
-	rm -rf $(BUILD) nhibernate-dll
diff --git a/old/nhibernate-1.2.1-patches/sqlite-driver-mono-1.2.x.patch b/old/nhibernate-1.2.1-patches/sqlite-driver-mono-1.2.x.patch
deleted file mode 100644
index 7314013..0000000
--- a/old/nhibernate-1.2.1-patches/sqlite-driver-mono-1.2.x.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-Index: nhibernate/default.build
-===================================================================
---- nhibernate/default.build	(revision 3416)
-+++ nhibernate/default.build	(working copy)
-@@ -23,8 +23,8 @@
- 		<include name="Iesi.Collections.Test/Iesi.Collections.Test.build" />
- 		<include name="NHibernate/NHibernate.build" />
- 		<include name="NHibernate.DomainModel/NHibernate.DomainModel.build" />
--		<include name="NHibernate.Test/NHibernate.Test.build" />
--		<include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" />
-+		<!-- <include name="NHibernate.Test/NHibernate.Test.build" />
-+		<include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" /> -->
- 		<include name="NHibernate.Examples/NHibernate.Examples.build" />
- 		<include name="NHibernate.Caches.SysCache/NHibernate.Caches.SysCache.build" />
- 		<include name="NHibernate.Caches.SysCache2/NHibernate.Caches.SysCache2.build" />
-Index: nhibernate/build-common/common.xml
-===================================================================
---- nhibernate/build-common/common.xml	(revision 3416)
-+++ nhibernate/build-common/common.xml	(working copy)
-@@ -22,7 +22,7 @@
- 		It generates Visual Studio.NET 2003 documentation.
- 	-->
- 	<property name="vshik.installed" value="false" overwrite="false" />
--	<property name="vshik.path" value="${environment::get-folder-path('ProgramFiles')}/Microsoft Help 2.0 SDK" />
-+	<!-- <property name="vshik.path" value="${environment::get-folder-path('ProgramFiles')}/Microsoft Help 2.0 SDK" /> -->
-
- 	<!--
- 		if nunit2report tasks from http://nunit2report.sourceforge.net/ has been installed
-@@ -41,7 +41,7 @@
- 	<property name="clover.framework" value=".NET 2.0" if="${nant.settings.currentframework == 'net-2.0'}" />
- 	<property name="clover.framework" value=".NET 1.1" if="${nant.settings.currentframework == 'mono-1.0'}" />
-
--	<property name="clover.home" value="${environment::get-folder-path('ProgramFiles')}/Cenqua/Clover.NET 2.0 for ${clover.framework}" />
-+	<!-- <property name="clover.home" value="${environment::get-folder-path('ProgramFiles')}/Cenqua/Clover.NET 2.0 for ${clover.framework}" /> -->
- 	<property name="clover.assembly" value="CloverNAnt-0.85.dll" />
-
- 	<if test="${clover.enabled}">
-@@ -194,6 +194,11 @@
- 		<property name="current.build.defines" value="${build.defines}MONO,MONO_1_0" />
- 		<property name="link.sdkdoc.version" value="MsdnOnline" />
- 	</target>
-+	<target name="set-mono-2.0-framework-configuration">
-+		<property name="nant.settings.currentframework" value="mono-2.0" />
-+		<property name="current.build.defines" value="${build.defines}MONO,MONO_1_0,MONO_2_0" />
-+		<property name="link.sdkdoc.version" value="MsdnOnline" />
-+	</target>
-
- 	<target name="display-current-runtime">
- 		<echo message="" />
-Index: nhibernate/src/NHibernate/NHibernate.build
-===================================================================
---- nhibernate/src/NHibernate/NHibernate.build	(revision 3416)
-+++ nhibernate/src/NHibernate/NHibernate.build	(working copy)
-@@ -18,6 +18,8 @@
- 			<include name="System.dll" />
- 			<include name="System.XML.dll" />
- 			<include name="System.Data.dll" />
-+			<include name="Mono.Data.dll" />
-+			<include name="Mono.Data.SqliteClient.dll" />
- 			<include name="System.Data.OracleClient" if="${nant.settings.currentframework == 'net-2.0'}" />
- 			<include name="System.Web.dll" />
- 			<include name="Iesi.Collections.dll" />
-Index: nhibernate/src/NHibernate/Driver/SqliteClientDriver.cs
-===================================================================
---- nhibernate/src/NHibernate/Driver/SqliteClientDriver.cs	(revision 0)
-+++ nhibernate/src/NHibernate/Driver/SqliteClientDriver.cs	(revision 0)
-@@ -0,0 +1,56 @@
-+using Mono.Data;
-+using Mono.Data.SqliteClient;
-+
-+namespace NHibernate.Driver
-+{
-+	/// <summary>
-+	/// NHibernate driver for the SQLite.NET data provider.
-+	/// <p>
-+	/// Author: <a href="mailto:ib@stalker.ro"> Ioan Bizau </a>
-+	/// </p>
-+	/// </summary>
-+	/// <remarks>
-+	/// <p>
-+	/// In order to use this Driver you must have the SQLite.NET.dll Assembly available for NHibernate to load it.
-+	/// You must also have the SQLite.dll and SQLite3.dll libraries.
-+	/// </p>
-+	/// <p>
-+	/// Please check <a href="http://www.sqlite.org/"> http://www.sqlite.org/ </a> for more information regarding SQLite.
-+	/// </p>
-+	/// </remarks>
-+	public class SqliteClientDriver : ReflectionBasedDriver
-+	{
-+		/// <summary>
-+		/// Initializes a new instance of <see cref="SQLiteDriver"/>.
-+		/// </summary>
-+		/// <exception cref="HibernateException">
-+		/// Thrown when the <c>SQLite.NET</c> assembly can not be loaded.
-+		/// </exception>
-+		public SqliteClientDriver() : base(
-+			"Mono.Data.SqliteClient",
-+			"Mono.Data.SqliteClient.SqliteConnection",
-+			"Mono.Data.SqliteClient.SqliteCommand")
-+		{
-+		}
-+
-+		public override bool UseNamedPrefixInSql
-+		{
-+			get { return true; }
-+		}
-+
-+		public override bool UseNamedPrefixInParameter
-+		{
-+			get { return true; }
-+		}
-+
-+		public override string NamedPrefix
-+		{
-+			get { return ":"; }
-+		}
-+
-+		public override bool SupportsMultipleOpenReaders
-+		{
-+			get { return false; }
-+		}
-+	}
-+}
-\ No newline at end of file
-Index: nhibernate/src/NHibernate/Driver/ReflectionBasedDriver.cs
-===================================================================
---- nhibernate/src/NHibernate/Driver/ReflectionBasedDriver.cs	(revision 3416)
-+++ nhibernate/src/NHibernate/Driver/ReflectionBasedDriver.cs	(working copy)
-@@ -19,8 +19,8 @@
- 		public ReflectionBasedDriver(string driverAssemblyName, string connectionTypeName, string commandTypeName)
- 		{
- 			// Try to get the types from an already loaded assembly
--			connectionType = ReflectHelper.TypeFromAssembly(connectionTypeName, driverAssemblyName, false);
--			commandType = ReflectHelper.TypeFromAssembly(commandTypeName, driverAssemblyName, false);
-+			connectionType = ReflectHelper.TypeFromAssembly(connectionTypeName, driverAssemblyName, true);
-+			commandType = ReflectHelper.TypeFromAssembly(commandTypeName, driverAssemblyName, true);
-
- 			if (connectionType == null || commandType == null)
- 			{
diff --git a/trunk/managed/MonoCecil/README.md b/trunk/managed/MonoCecil/README.md
index bfd74e9..bb7d8f5 100644
--- a/trunk/managed/MonoCecil/README.md
+++ b/trunk/managed/MonoCecil/README.md
@@ -1,4 +1,4 @@
-=OpenSimulator=
+# OpenSimulator

 OpenSimulator version > 0.9.3.0 uses the libraries included in mono-addins
ViewGit