public Deserialize ( OSDMap map ) : void | ||
map | OSDMap | An |
리턴 | void |
public void ParcelPropertiesUpdateMessage() { ParcelPropertiesUpdateMessage s = new ParcelPropertiesUpdateMessage(); s.AuthBuyerID = UUID.Random(); s.Category = ParcelCategory.Gaming; s.Desc = "Example Description"; s.GroupID = UUID.Random(); s.Landing = LandingType.LandingPoint; s.LocalID = 160; s.MediaAutoScale = true; s.MediaDesc = "Example Media Description"; s.MediaHeight = 600; s.MediaID = UUID.Random(); s.MediaLoop = false; s.MediaType = "image/jpeg"; s.MediaURL = "http://www.openmetaverse.co/test.jpeg"; s.MediaWidth = 800; s.MusicURL = "http://scfire-ntc-aa04.stream.aol.com:80/stream/1075"; s.Name = "Example Parcel Description"; s.ObscureMedia = true; s.ObscureMusic = true; s.ParcelFlags = ParcelFlags.AllowVoiceChat | ParcelFlags.ContributeWithDeed; s.PassHours = 5.5f; s.PassPrice = 100; s.SalePrice = 99; s.SnapshotID = UUID.Random(); s.UserLocation = Vector3.Parse("<128,128,128>"); s.UserLookAt = Vector3.Parse("<256,256,256>"); OSDMap map = s.Serialize(); ParcelPropertiesUpdateMessage t = new ParcelPropertiesUpdateMessage(); t.Deserialize(map); Assert.AreEqual(s.AuthBuyerID, t.AuthBuyerID); Assert.AreEqual(s.Category, t.Category); Assert.AreEqual(s.Desc, t.Desc); Assert.AreEqual(s.GroupID, t.GroupID); Assert.AreEqual(s.Landing, t.Landing); Assert.AreEqual(s.LocalID, t.LocalID); 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.ParcelFlags, t.ParcelFlags); Assert.AreEqual(s.PassHours, t.PassHours); Assert.AreEqual(s.PassPrice, t.PassPrice); Assert.AreEqual(s.SalePrice, t.SalePrice); Assert.AreEqual(s.SnapshotID, t.SnapshotID); Assert.AreEqual(s.UserLocation, t.UserLocation); Assert.AreEqual(s.UserLookAt, t.UserLookAt); }
private byte[] ProcessPropertiesUpdate(Stream request, UUID agentID) { IClientAPI client; if (!m_scene.ClientManager.TryGetValue(agentID, out client)) { MainConsole.Instance.WarnFormat("[LAND] unable to retrieve IClientAPI for {0}", agentID.ToString()); return new byte[0]; } ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage(); OSDMap args = (OSDMap) OSDParser.DeserializeLLSDXml(request); properties.Deserialize(args); LandUpdateArgs land_update = new LandUpdateArgs(); int parcelID = properties.LocalID; land_update.AuthBuyerID = properties.AuthBuyerID; land_update.Category = properties.Category; land_update.Desc = properties.Desc; land_update.GroupID = properties.GroupID; land_update.LandingType = (byte) properties.Landing; land_update.MediaAutoScale = (byte) Convert.ToInt32(properties.MediaAutoScale); land_update.MediaID = properties.MediaID; land_update.MediaURL = properties.MediaURL; land_update.MusicURL = properties.MusicURL; land_update.Name = properties.Name; land_update.ParcelFlags = (uint) properties.ParcelFlags; land_update.PassHours = (int) properties.PassHours; land_update.PassPrice = (int) properties.PassPrice; land_update.Privacy = properties.Privacy; land_update.SalePrice = (int) properties.SalePrice; land_update.SnapshotID = properties.SnapshotID; land_update.UserLocation = properties.UserLocation; land_update.UserLookAt = properties.UserLookAt; land_update.MediaDescription = properties.MediaDesc; land_update.MediaType = properties.MediaType; land_update.MediaWidth = properties.MediaWidth; land_update.MediaHeight = properties.MediaHeight; land_update.MediaLoop = properties.MediaLoop; land_update.ObscureMusic = properties.ObscureMusic; land_update.ObscureMedia = properties.ObscureMedia; ILandObject land = GetLandObject(parcelID); if (land != null) land.UpdateLandProperties(land_update, client); else MainConsole.Instance.WarnFormat("[LAND] unable to find parcelID {0}", parcelID); return OSDParser.SerializeLLSDXmlBytes(new OSDMap()); }
private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) { IClientAPI client; if (!m_scene.TryGetClient(agentID, out client)) { m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to retrieve IClientAPI for {0}", agentID); return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); } ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage(); OpenMetaverse.StructuredData.OSDMap args = (OpenMetaverse.StructuredData.OSDMap) OSDParser.DeserializeLLSDXml(request); properties.Deserialize(args); LandUpdateArgs land_update = new LandUpdateArgs(); int parcelID = properties.LocalID; land_update.AuthBuyerID = properties.AuthBuyerID; land_update.Category = properties.Category; land_update.Desc = properties.Desc; land_update.GroupID = properties.GroupID; land_update.LandingType = (byte) properties.Landing; land_update.MediaAutoScale = (byte) Convert.ToInt32(properties.MediaAutoScale); land_update.MediaID = properties.MediaID; land_update.MediaURL = properties.MediaURL; land_update.MusicURL = properties.MusicURL; land_update.Name = properties.Name; land_update.ParcelFlags = (uint) properties.ParcelFlags; land_update.PassHours = (int) properties.PassHours; land_update.PassPrice = (int) properties.PassPrice; land_update.SalePrice = (int) properties.SalePrice; land_update.SnapshotID = properties.SnapshotID; land_update.UserLocation = properties.UserLocation; land_update.UserLookAt = properties.UserLookAt; land_update.MediaDescription = properties.MediaDesc; land_update.MediaType = properties.MediaType; land_update.MediaWidth = properties.MediaWidth; land_update.MediaHeight = properties.MediaHeight; land_update.MediaLoop = properties.MediaLoop; land_update.ObscureMusic = properties.ObscureMusic; land_update.ObscureMedia = properties.ObscureMedia; ILandObject land; lock (m_landList) { m_landList.TryGetValue(parcelID, out land); } if (land != null) { land.UpdateLandProperties(land_update, client); m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); } else { m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to find parcelID {0}", parcelID); } return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); }