public static OSD ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage)
 {
     OSDMap message = new OSDMap {{"message", OSD.FromString("ParcelProperties")}};
     OSD message_body = parcelPropertiesMessage.Serialize();
     message.Add("body", message_body);
     return message;
 }
        /// <summary>
        /// Return a decoded capabilities message as a strongly typed object
        /// </summary>
        /// <param name="eventName">A string containing the name of the capabilities message key</param>
        /// <param name="map">An <see cref="OSDMap"/> to decode</param>
        /// <returns>A strongly typed object containing the decoded information from the capabilities message, or null
        /// if no existing Message object exists for the specified event</returns>
        public static IMessage DecodeEvent(string eventName, OSDMap map)
        {
            IMessage message = null;

            switch (eventName)
            {
                case "AgentGroupDataUpdate": message = new AgentGroupDataUpdateMessage(); break;
                case "AvatarGroupsReply": message = new AgentGroupDataUpdateMessage(); break; // OpenSim sends the above with the wrong? key
                case "ParcelProperties": message = new ParcelPropertiesMessage(); break;
                case "ParcelObjectOwnersReply": message = new ParcelObjectOwnersReplyMessage(); break;
                case "TeleportFinish": message = new TeleportFinishMessage(); break;
                case "EnableSimulator": message = new EnableSimulatorMessage(); break;
                case "ParcelPropertiesUpdate": message = new ParcelPropertiesUpdateMessage(); break;
                case "EstablishAgentCommunication": message = new EstablishAgentCommunicationMessage(); break;
                case "ChatterBoxInvitation": message = new ChatterBoxInvitationMessage(); break;
                case "ChatterBoxSessionEventReply": message = new ChatterboxSessionEventReplyMessage(); break;
                case "ChatterBoxSessionStartReply": message = new ChatterBoxSessionStartReplyMessage(); break;
                case "ChatterBoxSessionAgentListUpdates": message = new ChatterBoxSessionAgentListUpdatesMessage(); break;
                case "RequiredVoiceVersion": message = new RequiredVoiceVersionMessage(); break;
                case "MapLayer": message = new MapLayerMessage(); break;
                case "ChatSessionRequest": message = new ChatSessionRequestMessage(); break;
                case "CopyInventoryFromNotecard": message = new CopyInventoryFromNotecardMessage(); break;
                case "ProvisionVoiceAccountRequest": message = new ProvisionVoiceAccountRequestMessage(); break;
                case "Viewerstats": message = new ViewerStatsMessage(); break;
                case "UpdateAgentLanguage": message = new UpdateAgentLanguageMessage(); break;
                case "RemoteParcelRequest": message = new RemoteParcelRequestMessage(); break;
                case "UpdateScriptTask": message = new UpdateScriptTaskMessage(); break;
                case "UpdateScriptAgent": message = new UpdateScriptAgentMessage(); break;
                case "SendPostcard": message = new SendPostcardMessage(); break;
                case "UpdateGestureAgentInventory": message = new UpdateGestureAgentInventoryMessage(); break;
                case "UpdateNotecardAgentInventory": message = new UpdateNotecardAgentInventoryMessage(); break;
                case "LandStatReply": message = new LandStatReplyMessage(); break;
                case "ParcelVoiceInfoRequest": message = new ParcelVoiceInfoRequestMessage(); break;
                case "ViewerStats": message = new ViewerStatsMessage(); break;
                case "EventQueueGet": message = new EventQueueGetMessage(); break;
                case "CrossedRegion": message = new CrossedRegionMessage(); break;
                case "TeleportFailed": message = new TeleportFailedMessage(); break;
                case "PlacesReply": message = new PlacesReplyMessage(); break;
                case "UpdateAgentInformation": message = new UpdateAgentInformationMessage(); break;
                case "DirLandReply": message = new DirLandReplyMessage(); break;
                case "ScriptRunningReply": message = new ScriptRunningReplyMessage(); break;
                case "SearchStatRequest": message = new SearchStatRequestMessage(); break;
                case "AgentDropGroup": message = new AgentDropGroupMessage(); break;
                case "AgentStateUpdate": message = new AgentStateUpdateMessage(); break;
                case "ForceCloseChatterBoxSession": message = new ForceCloseChatterBoxSessionMessage(); break;
                case "UploadBakedTexture": message = new UploadBakedTextureMessage(); break;
                case "RegionInfo": message = new RegionInfoMessage(); break;
                case "ObjectMediaNavigate": message = new ObjectMediaNavigateMessage(); break;
                case "ObjectMedia": message = new ObjectMediaMessage(); break;
                case "AttachmentResources": message = AttachmentResourcesMessage.GetMessageHandler(map); break;
                case "LandResources": message = LandResourcesMessage.GetMessageHandler(map); break;
                case "GetDisplayNames": message = new GetDisplayNamesMessage(); break;
                case "SetDisplayName": message = new SetDisplayNameMessage(); break;
                case "SetDisplayNameReply": message = new SetDisplayNameReplyMessage(); break;
                case "DisplayNameUpdate": message = new DisplayNameUpdateMessage(); break;
                //case "ProductInfoRequest": message = new ProductInfoRequestMessage(); break;
                case "ObjectPhysicsProperties": message = new ObjectPhysicsPropertiesMessage(); break;
                case "BulkUpdateInventory": message = new BulkUpdateInventoryMessage(); break;
                case "RenderMaterials": message = new RenderMaterialsMessage(); break;
                case "GetObjectCost": message = GetObjectCostMessage.GetMessageHandler(map); break;

                // Capabilities TODO:
                // DispatchRegionInfo
                // EstateChangeInfo
                // EventQueueGet
                // FetchInventoryDescendents
                // GroupProposalBallot
                // MapLayerGod
                // NewFileAgentInventory
                // RequestTextureDownload
                // SearchStatTracking
                // SendUserReport
                // SendUserReportWithScreenshot
                // ServerReleaseNotes
                // StartGroupProposal
                // UpdateGestureTaskInventory
                // UpdateNotecardTaskInventory
                // ViewerStartAuction
                // UntrustedSimulatorMessage
            }

            if (message != null)
            {
                try
                {
                    message.Deserialize(map);
                    return message;
                }
                catch (Exception e)
                {
                    Logger.Log("Exception while trying to Deserialize " + eventName + ":" + e.Message + ": " + e.StackTrace, Helpers.LogLevel.Error);
                }

                return null;
            }
            else
            {
                return null;
            }
        }
 public virtual void ParcelProperties(ParcelPropertiesMessage parcelPropertiesPacket, UUID avatarID,
     UUID regionID)
 {
     OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesPacket);
     Enqueue(item, avatarID, regionID);
 }
 public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
 {
     OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage);
     Enqueue(item, avatarID);
 }
        public void ParcelPropertiesMessage()
        {
            ParcelPropertiesMessage s = new ParcelPropertiesMessage();
            s.AABBMax = Vector3.Parse("<1,2,3>");
            s.AABBMin = Vector3.Parse("<2,3,1>");
            s.Area = 1024;
            s.AuctionID = uint.MaxValue;
            s.AuthBuyerID = UUID.Random();
            s.Bitmap = Utils.EmptyBytes;
            s.Category = ParcelCategory.Educational;
            s.ClaimDate = new DateTime(2008, 12, 25, 3, 15, 22);
            s.ClaimPrice = 1000;
            s.Desc = "Test Description";
            s.GroupID = UUID.Random();
            s.GroupPrims = 50;
            s.IsGroupOwned = false;
            s.LandingType = LandingType.None;
            s.LocalID = 1;
            s.MaxPrims = 234;
            s.MediaAutoScale = false;
            s.MediaDesc = "Example Media Description";
            s.MediaHeight = 480;
            s.MediaID = UUID.Random();
            s.MediaLoop = false;
            s.MediaType = "text/html";
            s.MediaURL = "http://www.openmetaverse.co";
            s.MediaWidth = 640;
            s.MusicURL = "http://scfire-ntc-aa04.stream.aol.com:80/stream/1075"; // Yee Haw
            s.Name = "Test Name";
            s.ObscureMedia = false;
            s.ObscureMusic = false;
            s.OtherCleanTime = 5;
            s.OtherCount = 200;
            s.OtherPrims = 300;
            s.OwnerID = UUID.Random();
            s.OwnerPrims = 0;
            s.ParcelFlags = ParcelFlags.AllowDamage | ParcelFlags.AllowGroupScripts | ParcelFlags.AllowVoiceChat;
            s.ParcelPrimBonus = 0f;
            s.PassHours = 1.5f;
            s.PassPrice = 10;
            s.PublicCount = 20;
            s.RegionDenyAgeUnverified = false;
            s.RegionDenyAnonymous = false;
            s.RegionPushOverride = true;
            s.RentPrice = 0;
            s.RequestResult = ParcelResult.Single;
            s.SalePrice = 9999;
            s.SelectedPrims = 1;
            s.SelfCount = 2;
            s.SequenceID = -4000;
            s.SimWideMaxPrims = 937;
            s.SimWideTotalPrims = 117;
            s.SnapSelection = false;
            s.SnapshotID = UUID.Random();
            s.Status = ParcelStatus.Leased;
            s.TotalPrims = 219;
            s.UserLocation = Vector3.Parse("<3,4,5>");
            s.UserLookAt = Vector3.Parse("<5,4,3>");

            OSDMap map = s.Serialize();
            ParcelPropertiesMessage t = new ParcelPropertiesMessage();

            t.Deserialize(map);

            Assert.AreEqual(s.AABBMax, t.AABBMax);
            Assert.AreEqual(s.AABBMin, t.AABBMin);
            Assert.AreEqual(s.Area, t.Area);
            Assert.AreEqual(s.AuctionID, t.AuctionID);
            Assert.AreEqual(s.AuthBuyerID, t.AuthBuyerID);
            Assert.AreEqual(s.Bitmap, t.Bitmap);
            Assert.AreEqual(s.Category, t.Category);
            Assert.AreEqual(s.ClaimDate, t.ClaimDate);
            Assert.AreEqual(s.ClaimPrice, t.ClaimPrice);
            Assert.AreEqual(s.Desc, t.Desc);
            Assert.AreEqual(s.GroupID, t.GroupID);
            Assert.AreEqual(s.GroupPrims, t.GroupPrims);
            Assert.AreEqual(s.IsGroupOwned, t.IsGroupOwned);
            Assert.AreEqual(s.LandingType, t.LandingType);
            Assert.AreEqual(s.LocalID, t.LocalID);
            Assert.AreEqual(s.MaxPrims, t.MaxPrims);
            Assert.AreEqual(s.MediaAutoScale, t.MediaAutoScale);
            Assert.AreEqual(s.MediaDesc, t.MediaDesc);
            Assert.AreEqual(s.MediaHeight, t.MediaHeight);
            Assert.AreEqual(s.MediaID, t.MediaID);
            Assert.AreEqual(s.MediaLoop, t.MediaLoop);
            Assert.AreEqual(s.MediaType, t.MediaType);
            Assert.AreEqual(s.MediaURL, t.MediaURL);
            Assert.AreEqual(s.MediaWidth, t.MediaWidth);
            Assert.AreEqual(s.MusicURL, t.MusicURL);
            Assert.AreEqual(s.Name, t.Name);
            Assert.AreEqual(s.ObscureMedia, t.ObscureMedia);
            Assert.AreEqual(s.ObscureMusic, t.ObscureMusic);
            Assert.AreEqual(s.OtherCleanTime, t.OtherCleanTime);
            Assert.AreEqual(s.OtherCount, t.OtherCount);
            Assert.AreEqual(s.OtherPrims, t.OtherPrims);
            Assert.AreEqual(s.OwnerID, t.OwnerID);
            Assert.AreEqual(s.OwnerPrims, t.OwnerPrims);
            Assert.AreEqual(s.ParcelFlags, t.ParcelFlags);
            Assert.AreEqual(s.ParcelPrimBonus, t.ParcelPrimBonus);
            Assert.AreEqual(s.PassHours, t.PassHours);
            Assert.AreEqual(s.PassPrice, t.PassPrice);
            Assert.AreEqual(s.PublicCount, t.PublicCount);
            Assert.AreEqual(s.RegionDenyAgeUnverified, t.RegionDenyAgeUnverified);
            Assert.AreEqual(s.RegionDenyAnonymous, t.RegionDenyAnonymous);
            Assert.AreEqual(s.RegionPushOverride, t.RegionPushOverride);
            Assert.AreEqual(s.RentPrice, t.RentPrice);
            Assert.AreEqual(s.RequestResult, t.RequestResult);
            Assert.AreEqual(s.SalePrice, t.SalePrice);
            Assert.AreEqual(s.SelectedPrims, t.SelectedPrims);
            Assert.AreEqual(s.SelfCount, t.SelfCount);
            Assert.AreEqual(s.SequenceID, t.SequenceID);
            Assert.AreEqual(s.SimWideMaxPrims, t.SimWideMaxPrims);
            Assert.AreEqual(s.SimWideTotalPrims, t.SimWideTotalPrims);
            Assert.AreEqual(s.SnapSelection, t.SnapSelection);
            Assert.AreEqual(s.SnapshotID, t.SnapshotID);
            Assert.AreEqual(s.Status, t.Status);
            Assert.AreEqual(s.TotalPrims, t.TotalPrims);
            Assert.AreEqual(s.UserLocation, t.UserLocation);
            Assert.AreEqual(s.UserLookAt, t.UserLookAt);
        }
        public void ReflectionPerformanceParcelProperties()
        {
            DateTime messageTestTime = DateTime.UtcNow;
            for (int x = 0; x < TEST_ITER; x++)
            {
                ParcelPropertiesMessage s = new ParcelPropertiesMessage();
                s.AABBMax = Vector3.Parse("<1,2,3>");
                s.AABBMin = Vector3.Parse("<2,3,1>");
                s.Area = 1024;
                s.AuctionID = uint.MaxValue;
                s.AuthBuyerID = UUID.Random();
                s.Bitmap = Utils.EmptyBytes;
                s.Category = ParcelCategory.Educational;
                s.ClaimDate = new DateTime(2008, 12, 25, 3, 15, 22);
                s.ClaimPrice = 1000;
                s.Desc = "Test Description";
                s.GroupID = UUID.Random();
                s.GroupPrims = 50;
                s.IsGroupOwned = false;
                s.LandingType = LandingType.None;
                s.LocalID = 1;
                s.MaxPrims = 234;
                s.MediaAutoScale = false;
                s.MediaDesc = "Example Media Description";
                s.MediaHeight = 480;
                s.MediaID = UUID.Random();
                s.MediaLoop = false;
                s.MediaType = "text/html";
                s.MediaURL = "http://www.openmetaverse.co";
                s.MediaWidth = 640;
                s.MusicURL = "http://scfire-ntc-aa04.stream.aol.com:80/stream/1075"; // Yee Haw
                s.Name = "Test Name";
                s.ObscureMedia = false;
                s.ObscureMusic = false;
                s.OtherCleanTime = 5;
                s.OtherCount = 200;
                s.OtherPrims = 300;
                s.OwnerID = UUID.Random();
                s.OwnerPrims = 0;
                s.ParcelFlags = ParcelFlags.AllowDamage | ParcelFlags.AllowGroupScripts | ParcelFlags.AllowVoiceChat;
                s.ParcelPrimBonus = 0f;
                s.PassHours = 1.5f;
                s.PassPrice = 10;
                s.PublicCount = 20;
                s.RegionDenyAgeUnverified = false;
                s.RegionDenyAnonymous = false;
                s.RegionPushOverride = true;
                s.RentPrice = 0;
                s.RequestResult = ParcelResult.Single;
                s.SalePrice = 9999;
                s.SelectedPrims = 1;
                s.SelfCount = 2;
                s.SequenceID = -4000;
                s.SimWideMaxPrims = 937;
                s.SimWideTotalPrims = 117;
                s.SnapSelection = false;
                s.SnapshotID = UUID.Random();
                s.Status = ParcelStatus.Leased;
                s.TotalPrims = 219;
                s.UserLocation = Vector3.Parse("<3,4,5>");
                s.UserLookAt = Vector3.Parse("<5,4,3>");

                OSDMap map = s.Serialize();
                ParcelPropertiesMessage t = new ParcelPropertiesMessage();

                t.Deserialize(map);

                Assert.AreEqual(s.AABBMax, t.AABBMax);
                Assert.AreEqual(s.AABBMin, t.AABBMin);
                Assert.AreEqual(s.Area, t.Area);
                Assert.AreEqual(s.AuctionID, t.AuctionID);
                Assert.AreEqual(s.AuthBuyerID, t.AuthBuyerID);
                Assert.AreEqual(s.Bitmap, t.Bitmap);
                Assert.AreEqual(s.Category, t.Category);
                Assert.AreEqual(s.ClaimDate, t.ClaimDate);
                Assert.AreEqual(s.ClaimPrice, t.ClaimPrice);
                Assert.AreEqual(s.Desc, t.Desc);
                Assert.AreEqual(s.GroupID, t.GroupID);
                Assert.AreEqual(s.GroupPrims, t.GroupPrims);
                Assert.AreEqual(s.IsGroupOwned, t.IsGroupOwned);
                Assert.AreEqual(s.LandingType, t.LandingType);
                Assert.AreEqual(s.LocalID, t.LocalID);
                Assert.AreEqual(s.MaxPrims, t.MaxPrims);
                Assert.AreEqual(s.MediaAutoScale, t.MediaAutoScale);
                Assert.AreEqual(s.MediaDesc, t.MediaDesc);
                Assert.AreEqual(s.MediaHeight, t.MediaHeight);
                Assert.AreEqual(s.MediaID, t.MediaID);
                Assert.AreEqual(s.MediaLoop, t.MediaLoop);
                Assert.AreEqual(s.MediaType, t.MediaType);
                Assert.AreEqual(s.MediaURL, t.MediaURL);
                Assert.AreEqual(s.MediaWidth, t.MediaWidth);
                Assert.AreEqual(s.MusicURL, t.MusicURL);
                Assert.AreEqual(s.Name, t.Name);
                Assert.AreEqual(s.ObscureMedia, t.ObscureMedia);
                Assert.AreEqual(s.ObscureMusic, t.ObscureMusic);
                Assert.AreEqual(s.OtherCleanTime, t.OtherCleanTime);
                Assert.AreEqual(s.OtherCount, t.OtherCount);
                Assert.AreEqual(s.OtherPrims, t.OtherPrims);
                Assert.AreEqual(s.OwnerID, t.OwnerID);
                Assert.AreEqual(s.OwnerPrims, t.OwnerPrims);
                Assert.AreEqual(s.ParcelFlags, t.ParcelFlags);
                Assert.AreEqual(s.ParcelPrimBonus, t.ParcelPrimBonus);
                Assert.AreEqual(s.PassHours, t.PassHours);
                Assert.AreEqual(s.PassPrice, t.PassPrice);
                Assert.AreEqual(s.PublicCount, t.PublicCount);
                Assert.AreEqual(s.RegionDenyAgeUnverified, t.RegionDenyAgeUnverified);
                Assert.AreEqual(s.RegionDenyAnonymous, t.RegionDenyAnonymous);
                Assert.AreEqual(s.RegionPushOverride, t.RegionPushOverride);
                Assert.AreEqual(s.RentPrice, t.RentPrice);
                Assert.AreEqual(s.RequestResult, t.RequestResult);
                Assert.AreEqual(s.SalePrice, t.SalePrice);
                Assert.AreEqual(s.SelectedPrims, t.SelectedPrims);
                Assert.AreEqual(s.SelfCount, t.SelfCount);
                Assert.AreEqual(s.SequenceID, t.SequenceID);
                Assert.AreEqual(s.SimWideMaxPrims, t.SimWideMaxPrims);
                Assert.AreEqual(s.SimWideTotalPrims, t.SimWideTotalPrims);
                Assert.AreEqual(s.SnapSelection, t.SnapSelection);
                Assert.AreEqual(s.SnapshotID, t.SnapshotID);
                Assert.AreEqual(s.Status, t.Status);
                Assert.AreEqual(s.TotalPrims, t.TotalPrims);
                Assert.AreEqual(s.UserLocation, t.UserLocation);
                Assert.AreEqual(s.UserLookAt, t.UserLookAt);
            }

            TimeSpan duration = DateTime.UtcNow - messageTestTime;
            Console.WriteLine("ParcelPropertiesMessage: OMV Message System Serialization/Deserialization Passes: {0} Total time: {1}", TEST_ITER, duration);

            BinaryFormatter formatter = new BinaryFormatter();

            DateTime xmlTestTime = DateTime.UtcNow;
            for (int x = 0; x < TEST_ITER; x++)
            {
                ParcelPropertiesMessage s = new ParcelPropertiesMessage();
                s.AABBMax = Vector3.Parse("<1,2,3>");
                s.AABBMin = Vector3.Parse("<2,3,1>");
                s.Area = 1024;
                s.AuctionID = uint.MaxValue;
                s.AuthBuyerID = UUID.Random();
                s.Bitmap = Utils.EmptyBytes;
                s.Category = ParcelCategory.Educational;
                s.ClaimDate = new DateTime(2008, 12, 25, 3, 15, 22);
                s.ClaimPrice = 1000;
                s.Desc = "Test Description";
                s.GroupID = UUID.Random();
                s.GroupPrims = 50;
                s.IsGroupOwned = false;
                s.LandingType = LandingType.None;
                s.LocalID = 1;
                s.MaxPrims = 234;
                s.MediaAutoScale = false;
                s.MediaDesc = "Example Media Description";
                s.MediaHeight = 480;
                s.MediaID = UUID.Random();
                s.MediaLoop = false;
                s.MediaType = "text/html";
                s.MediaURL = "http://www.openmetaverse.co";
                s.MediaWidth = 640;
                s.MusicURL = "http://scfire-ntc-aa04.stream.aol.com:80/stream/1075"; // Yee Haw
                s.Name = "Test Name";
                s.ObscureMedia = false;
                s.ObscureMusic = false;
                s.OtherCleanTime = 5;
                s.OtherCount = 200;
                s.OtherPrims = 300;
                s.OwnerID = UUID.Random();
                s.OwnerPrims = 0;
                s.ParcelFlags = ParcelFlags.AllowDamage | ParcelFlags.AllowGroupScripts | ParcelFlags.AllowVoiceChat;
                s.ParcelPrimBonus = 0f;
                s.PassHours = 1.5f;
                s.PassPrice = 10;
                s.PublicCount = 20;
                s.RegionDenyAgeUnverified = false;
                s.RegionDenyAnonymous = false;
                s.RegionPushOverride = true;
                s.RentPrice = 0;
                s.RequestResult = ParcelResult.Single;
                s.SalePrice = 9999;
                s.SelectedPrims = 1;
                s.SelfCount = 2;
                s.SequenceID = -4000;
                s.SimWideMaxPrims = 937;
                s.SimWideTotalPrims = 117;
                s.SnapSelection = false;
                s.SnapshotID = UUID.Random();
                s.Status = ParcelStatus.Leased;
                s.TotalPrims = 219;
                s.UserLocation = Vector3.Parse("<3,4,5>");
                s.UserLookAt = Vector3.Parse("<5,4,3>");

                MemoryStream stream = new MemoryStream();

                formatter.Serialize(stream, s);

                stream.Seek(0, SeekOrigin.Begin);

                ParcelPropertiesMessage t = (ParcelPropertiesMessage)formatter.Deserialize(stream);

                Assert.AreEqual(s.AABBMax, t.AABBMax);
                Assert.AreEqual(s.AABBMin, t.AABBMin);
                Assert.AreEqual(s.Area, t.Area);
                Assert.AreEqual(s.AuctionID, t.AuctionID);
                Assert.AreEqual(s.AuthBuyerID, t.AuthBuyerID);
                Assert.AreEqual(s.Bitmap, t.Bitmap);
                Assert.AreEqual(s.Category, t.Category);
                Assert.AreEqual(s.ClaimDate, t.ClaimDate);
                Assert.AreEqual(s.ClaimPrice, t.ClaimPrice);
                Assert.AreEqual(s.Desc, t.Desc);
                Assert.AreEqual(s.GroupID, t.GroupID);
                Assert.AreEqual(s.GroupPrims, t.GroupPrims);
                Assert.AreEqual(s.IsGroupOwned, t.IsGroupOwned);
                Assert.AreEqual(s.LandingType, t.LandingType);
                Assert.AreEqual(s.LocalID, t.LocalID);
                Assert.AreEqual(s.MaxPrims, t.MaxPrims);
                Assert.AreEqual(s.MediaAutoScale, t.MediaAutoScale);
                Assert.AreEqual(s.MediaDesc, t.MediaDesc);
                Assert.AreEqual(s.MediaHeight, t.MediaHeight);
                Assert.AreEqual(s.MediaID, t.MediaID);
                Assert.AreEqual(s.MediaLoop, t.MediaLoop);
                Assert.AreEqual(s.MediaType, t.MediaType);
                Assert.AreEqual(s.MediaURL, t.MediaURL);
                Assert.AreEqual(s.MediaWidth, t.MediaWidth);
                Assert.AreEqual(s.MusicURL, t.MusicURL);
                Assert.AreEqual(s.Name, t.Name);
                Assert.AreEqual(s.ObscureMedia, t.ObscureMedia);
                Assert.AreEqual(s.ObscureMusic, t.ObscureMusic);
                Assert.AreEqual(s.OtherCleanTime, t.OtherCleanTime);
                Assert.AreEqual(s.OtherCount, t.OtherCount);
                Assert.AreEqual(s.OtherPrims, t.OtherPrims);
                Assert.AreEqual(s.OwnerID, t.OwnerID);
                Assert.AreEqual(s.OwnerPrims, t.OwnerPrims);
                Assert.AreEqual(s.ParcelFlags, t.ParcelFlags);
                Assert.AreEqual(s.ParcelPrimBonus, t.ParcelPrimBonus);
                Assert.AreEqual(s.PassHours, t.PassHours);
                Assert.AreEqual(s.PassPrice, t.PassPrice);
                Assert.AreEqual(s.PublicCount, t.PublicCount);
                Assert.AreEqual(s.RegionDenyAgeUnverified, t.RegionDenyAgeUnverified);
                Assert.AreEqual(s.RegionDenyAnonymous, t.RegionDenyAnonymous);
                Assert.AreEqual(s.RegionPushOverride, t.RegionPushOverride);
                Assert.AreEqual(s.RentPrice, t.RentPrice);
                Assert.AreEqual(s.RequestResult, t.RequestResult);
                Assert.AreEqual(s.SalePrice, t.SalePrice);
                Assert.AreEqual(s.SelectedPrims, t.SelectedPrims);
                Assert.AreEqual(s.SelfCount, t.SelfCount);
                Assert.AreEqual(s.SequenceID, t.SequenceID);
                Assert.AreEqual(s.SimWideMaxPrims, t.SimWideMaxPrims);
                Assert.AreEqual(s.SimWideTotalPrims, t.SimWideTotalPrims);
                Assert.AreEqual(s.SnapSelection, t.SnapSelection);
                Assert.AreEqual(s.SnapshotID, t.SnapshotID);
                Assert.AreEqual(s.Status, t.Status);
                Assert.AreEqual(s.TotalPrims, t.TotalPrims);
                Assert.AreEqual(s.UserLocation, t.UserLocation);
                Assert.AreEqual(s.UserLookAt, t.UserLookAt);
            }

            TimeSpan durationxml = DateTime.UtcNow - xmlTestTime;
            Console.WriteLine("ParcelPropertiesMessage: .NET BinarySerialization/Deserialization Passes: {0} Total time: {1}", TEST_ITER, durationxml);
        }
Example #7
0
 public virtual void ParcelProperties(ParcelPropertiesMessage parcelPropertiesPacket, UUID avatarID,
                                      ulong RegionHandle)
 {
     OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesPacket);
     Enqueue(item, avatarID, RegionHandle);
 }
        public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
        {
            if (m_log.IsDebugEnabled) {
                m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod ().Name);
            }

            OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage);
            Enqueue(item, avatarID);
        }
Example #9
0
        private void SendParcelProperties(int parcelID, int sequenceID, bool snapSelection, ParcelResult result,
            LLAgent agent)
        {
            SceneParcel parcel;
            if (m_parcels.TryGetParcel(parcelID, out parcel))
            {
                // Owner sanity check
                if (parcel.OwnerID == UUID.Zero)
                {
                    m_log.Warn("Assigning parcel " + parcel.Name + " to " + agent.Name);
                    parcel.OwnerID = agent.ID;
                    m_parcels.AddOrUpdateParcel(parcel);
                }

                // Claim date sanity check
                if (parcel.ClaimDate <= Utils.Epoch)
                {
                    m_log.Warn("Resetting invalid parcel claim date");
                    parcel.ClaimDate = DateTime.UtcNow;
                    m_parcels.AddOrUpdateParcel(parcel);
                }

                ParcelPropertiesMessage properties = new ParcelPropertiesMessage();
                properties.Area = ParcelManager.GetParcelArea(parcel, out properties.AABBMin, out properties.AABBMax);
                properties.AuctionID = 0; // Unused
                properties.AuthBuyerID = parcel.AuthBuyerID;
                properties.Bitmap = parcel.Bitmap;
                properties.Category = parcel.Category;
                properties.ClaimDate = parcel.ClaimDate;
                properties.ClaimPrice = 0; // Deprecated
                properties.Desc = parcel.Desc;
                properties.GroupID = parcel.GroupID;
                properties.IsGroupOwned = parcel.IsGroupOwned;
                properties.LandingType = parcel.Landing;
                properties.LocalID = parcel.LocalID;
                properties.MaxPrims = parcel.MaxPrims;
                properties.MediaAutoScale = parcel.Media.MediaAutoScale;
                properties.MediaDesc = parcel.Media.MediaDesc;
                properties.MediaHeight = parcel.Media.MediaHeight;
                properties.MediaID = parcel.Media.MediaID;
                properties.MediaLoop = parcel.Media.MediaLoop;
                properties.MediaType = parcel.Media.MediaType;
                properties.MediaURL = parcel.Media.MediaURL;
                properties.MediaWidth = parcel.Media.MediaWidth;
                properties.MusicURL = parcel.Media.MediaURL;
                properties.Name = parcel.Name;
                properties.ObscureMedia = parcel.ObscureMedia;
                properties.ObscureMusic = parcel.ObscureMusic;
                properties.OtherCleanTime = parcel.AutoReturnTime;
                properties.OwnerID = parcel.OwnerID;
                properties.ParcelFlags = parcel.Flags;
                properties.ParcelPrimBonus = 1f;
                properties.PassHours = parcel.PassHours;
                properties.PassPrice = parcel.PassPrice;
                properties.RegionDenyAgeUnverified = parcel.DenyAgeUnverified;
                properties.RegionDenyAnonymous = parcel.DenyAnonymous;
                properties.RegionDenyIdentified = false;
                properties.RegionDenyTransacted = false;
                properties.RegionPushOverride = parcel.PushOverride;
                properties.RentPrice = 0; // Deprecated
                properties.RequestResult = result;
                properties.SalePrice = parcel.SalePrice;
                properties.SequenceID = sequenceID;
                properties.SnapSelection = snapSelection;
                properties.SnapshotID = parcel.SnapshotID;
                properties.Status = parcel.Status;
                properties.UserLocation = parcel.LandingLocation;
                properties.UserLookAt = parcel.LandingLookAt;

                int ownerPrims = 0;
                int groupPrims = 0;
                int otherPrims = 0;
                int selectedPrims = 0;

                lock (parcel.ParcelEntities)
                {
                    foreach (ISceneEntity entity in parcel.ParcelEntities.Values)
                    {
                        // TODO: We don't currently track whether objects have been shared/deeded to group?
                        if (entity.OwnerID == parcel.OwnerID)
                            ++ownerPrims;
                        else
                            ++otherPrims;

                        // TODO: We don't currently track selected prims
                    }
                }

                properties.OwnerPrims = ownerPrims;
                properties.GroupPrims = groupPrims;
                properties.OtherPrims = otherPrims;
                properties.TotalPrims = ownerPrims + groupPrims + otherPrims;
                properties.SelectedPrims = selectedPrims;

                // TODO: Implement these
                properties.SimWideMaxPrims = 0;
                properties.SimWideTotalPrims = 0;

                // TODO: What are these?
                properties.SelfCount = 0;
                properties.PublicCount = 0;
                properties.OtherCount = 0;

                agent.EventQueue.QueueEvent("ParcelProperties", properties.Serialize());
            }
            else
            {
                m_log.Warn("SendParcelProperties() called for unknown parcel " + parcelID);
            }
        }