From a12a495c22817f901792fd9e11c2a4b4a5c628a8 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 7 Jun 2007 00:04:50 +0000 Subject: *Added support to change most of a parcel's settings and flags (from the about land box) *Added the rest of the member variables relating to parcels in the ParcelData class --- .../ClientView.ProcessPackets.cs | 6 +++ .../OpenSim.RegionServer/world/ParcelManager.cs | 51 +++++++++++++++++----- .../world/World.PacketHandlers.cs | 7 +++ OpenSim/OpenSim.RegionServer/world/World.cs | 3 ++ .../LocalStorageDb4o/Db4LocalStorage.cs | 12 ++++- 5 files changed, 66 insertions(+), 13 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs index e329f09..e3d875f 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs @@ -83,9 +83,11 @@ namespace OpenSim public event UpdatePrimRotation OnUpdatePrimRotation; public event UpdatePrimVector OnUpdatePrimScale; public event StatusChange OnChildAgentStatus; + public event ParcelPropertiesRequest OnParcelPropertiesRequest; public event ParcelDivideRequest OnParcelDivideRequest; public event ParcelJoinRequest OnParcelJoinRequest; + public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; protected override void ProcessInPacket(Packet Pack) { @@ -482,6 +484,10 @@ namespace OpenSim ParcelJoinPacket parcelJoin = (ParcelJoinPacket)Pack; OnParcelJoinRequest((int)Math.Round(parcelJoin.ParcelData.West), (int)Math.Round(parcelJoin.ParcelData.South), (int)Math.Round(parcelJoin.ParcelData.East), (int)Math.Round(parcelJoin.ParcelData.North), this); break; + case PacketType.ParcelPropertiesUpdate: + ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket)Pack; + OnParcelPropertiesUpdateRequest(updatePacket, this); + break; #endregion #region unimplemented handlers diff --git a/OpenSim/OpenSim.RegionServer/world/ParcelManager.cs b/OpenSim/OpenSim.RegionServer/world/ParcelManager.cs index c3de54e..fe977bc 100644 --- a/OpenSim/OpenSim.RegionServer/world/ParcelManager.cs +++ b/OpenSim/OpenSim.RegionServer/world/ParcelManager.cs @@ -39,6 +39,7 @@ namespace OpenSim.RegionServer.world public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, ClientView remote_client); public delegate void ParcelDivideRequest(int west, int south, int east, int north, ClientView remote_client); public delegate void ParcelJoinRequest(int west, int south, int east, int north, ClientView remote_client); + public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, ClientView remote_client); #region ParcelManager Class /// @@ -526,13 +527,13 @@ namespace OpenSim.RegionServer.world updatePacket.ParcelData.GroupID = parcelData.groupID; updatePacket.ParcelData.GroupPrims = parcelData.groupPrims; updatePacket.ParcelData.IsGroupOwned = parcelData.isGroupOwned; - updatePacket.ParcelData.LandingType = (byte)0; //unemplemented + updatePacket.ParcelData.LandingType = (byte)parcelData.landingType; updatePacket.ParcelData.LocalID = parcelData.localID; updatePacket.ParcelData.MaxPrims = 1000; //unemplemented - updatePacket.ParcelData.MediaAutoScale = (byte)0; //unemplemented - updatePacket.ParcelData.MediaID = LLUUID.Zero; //unemplemented - updatePacket.ParcelData.MediaURL = Helpers.StringToField(""); //unemplemented - updatePacket.ParcelData.MusicURL = Helpers.StringToField(""); //unemplemented + updatePacket.ParcelData.MediaAutoScale = parcelData.mediaAutoScale; + updatePacket.ParcelData.MediaID = parcelData.mediaID; + updatePacket.ParcelData.MediaURL = Helpers.StringToField(parcelData.mediaURL); + updatePacket.ParcelData.MusicURL = Helpers.StringToField(parcelData.musicURL); updatePacket.ParcelData.Name = Helpers.StringToField(parcelData.parcelName); updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented updatePacket.ParcelData.OtherCount = 0; //unemplemented @@ -541,8 +542,8 @@ namespace OpenSim.RegionServer.world updatePacket.ParcelData.OwnerPrims = 0; //unemplemented updatePacket.ParcelData.ParcelFlags = (uint)parcelData.parcelFlags; //unemplemented updatePacket.ParcelData.ParcelPrimBonus = (float)1.0; //unemplemented - updatePacket.ParcelData.PassHours = (float)0.0; //unemplemented - updatePacket.ParcelData.PassPrice = 0; //unemeplemented + updatePacket.ParcelData.PassHours = parcelData.passHours; + updatePacket.ParcelData.PassPrice = parcelData.passPrice; updatePacket.ParcelData.PublicCount = 0; //unemplemented updatePacket.ParcelData.RegionDenyAnonymous = false; //unemplemented updatePacket.ParcelData.RegionDenyIdentified = false; //unemplemented @@ -556,15 +557,41 @@ namespace OpenSim.RegionServer.world updatePacket.ParcelData.SequenceID = sequence_id; updatePacket.ParcelData.SimWideMaxPrims = 15000; //unemplemented updatePacket.ParcelData.SimWideTotalPrims = 0; //unemplemented - updatePacket.ParcelData.SnapSelection = snap_selection; //Bleh - not important yet - updatePacket.ParcelData.SnapshotID = LLUUID.Zero; //Unemplemented - updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; //?? + updatePacket.ParcelData.SnapSelection = snap_selection; + updatePacket.ParcelData.SnapshotID = parcelData.snapshotID; + updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; updatePacket.ParcelData.TotalPrims = 0; //unemplemented - updatePacket.ParcelData.UserLocation = LLVector3.Zero; //unemplemented - updatePacket.ParcelData.UserLookAt = LLVector3.Zero; //unemeplemented + updatePacket.ParcelData.UserLocation = parcelData.userLocation; + updatePacket.ParcelData.UserLookAt = parcelData.userLookAt; remote_client.OutPacket((Packet)updatePacket); } + + public void updateParcelProperties(ParcelPropertiesUpdatePacket packet, ClientView remote_client) + { + if (remote_client.AgentID == parcelData.ownerID) + { + //Needs later group support + Console.WriteLine("Request for update - parcel #" + parcelData.localID); + parcelData.authBuyerID = packet.ParcelData.AuthBuyerID; + parcelData.category = (libsecondlife.Parcel.ParcelCategory)packet.ParcelData.Category; + parcelData.parcelDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc); + parcelData.groupID = packet.ParcelData.GroupID; + parcelData.landingType = packet.ParcelData.LandingType; + parcelData.mediaAutoScale = packet.ParcelData.MediaAutoScale; + parcelData.mediaID = packet.ParcelData.MediaID; + parcelData.mediaURL = Helpers.FieldToUTF8String(packet.ParcelData.MediaURL); + parcelData.musicURL = Helpers.FieldToUTF8String(packet.ParcelData.MusicURL); + parcelData.parcelName = libsecondlife.Helpers.FieldToUTF8String(packet.ParcelData.Name); + parcelData.parcelFlags = (libsecondlife.Parcel.ParcelFlags)packet.ParcelData.ParcelFlags; + parcelData.passHours = packet.ParcelData.PassHours; + parcelData.passPrice = packet.ParcelData.PassPrice; + parcelData.salePrice = packet.ParcelData.SalePrice; + parcelData.snapshotID = packet.ParcelData.SnapshotID; + parcelData.userLocation = packet.ParcelData.UserLocation; + parcelData.userLookAt = packet.ParcelData.UserLookAt; + } + } #endregion diff --git a/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs b/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs index 8513e30..d2abec2 100644 --- a/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs +++ b/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs @@ -365,6 +365,13 @@ namespace OpenSim.world { parcelManager.join(west, south, east, north, remote_client.AgentID); } + void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, ClientView remote_client) + { + if (parcelManager.parcelList.ContainsKey(packet.ParcelData.LocalID)) + { + parcelManager.parcelList[packet.ParcelData.LocalID].updateParcelProperties(packet, remote_client); + } + } #endregion /* diff --git a/OpenSim/OpenSim.RegionServer/world/World.cs b/OpenSim/OpenSim.RegionServer/world/World.cs index 8b26ecd..69f3fda 100644 --- a/OpenSim/OpenSim.RegionServer/world/World.cs +++ b/OpenSim/OpenSim.RegionServer/world/World.cs @@ -618,6 +618,7 @@ namespace OpenSim.world agentClient.OnParcelPropertiesRequest += new OpenSim.RegionServer.world.ParcelPropertiesRequest(ParcelPropertiesRequest); agentClient.OnParcelDivideRequest += new OpenSim.RegionServer.world.ParcelDivideRequest(ParcelDivideRequest); agentClient.OnParcelJoinRequest+=new OpenSim.RegionServer.world.ParcelJoinRequest(ParcelJoinRequest); + agentClient.OnParcelPropertiesUpdateRequest += new OpenSim.RegionServer.world.ParcelPropertiesUpdateRequest(ParcelPropertiesUpdateRequest); Avatar newAvatar = null; try { @@ -667,6 +668,8 @@ namespace OpenSim.world + + public override void RemoveViewerAgent(ClientView agentClient) diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs index d7b9f38..46fecd0 100644 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs +++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs @@ -179,15 +179,25 @@ namespace OpenSim.Storage.LocalStorageDb4o updateParcel.groupID = parcel.groupID; updateParcel.groupPrims = parcel.groupPrims; updateParcel.isGroupOwned = parcel.isGroupOwned; + updateParcel.landingType = parcel.landingType; + updateParcel.mediaAutoScale = parcel.mediaAutoScale; + updateParcel.mediaID = parcel.mediaID; + updateParcel.mediaURL = parcel.mediaURL; + updateParcel.musicURL = parcel.musicURL; updateParcel.localID = parcel.localID; updateParcel.ownerID = parcel.ownerID; + updateParcel.passHours = parcel.passHours; + updateParcel.passPrice = parcel.passPrice; updateParcel.parcelBitmapByteArray = (byte[])parcel.parcelBitmapByteArray.Clone(); updateParcel.parcelDesc = parcel.parcelDesc; updateParcel.parcelFlags = parcel.parcelFlags; updateParcel.parcelName = parcel.parcelName; updateParcel.parcelStatus = parcel.parcelStatus; updateParcel.salePrice = parcel.salePrice; - + updateParcel.snapshotID = parcel.snapshotID; + updateParcel.userLocation = parcel.userLocation; + updateParcel.userLookAt = parcel.userLookAt; + db.Set(updateParcel); } else -- cgit v1.1