diff --git a/Common/OpenSim.Framework/Types/EstateSettings.cs b/Common/OpenSim.Framework/Types/EstateSettings.cs index 1bd18d02d6..b34a1ac6ba 100644 --- a/Common/OpenSim.Framework/Types/EstateSettings.cs +++ b/Common/OpenSim.Framework/Types/EstateSettings.cs @@ -37,6 +37,26 @@ namespace OpenSim.Framework.Types public class EstateSettings { //Settings to this island + public float billableFactor = (float)0.0; + public uint estateID = 0; + public uint parentEstateID = 0; + + public byte maxAgents = 40; + public float objectBonusFactor = (float)1.0; + + public int redirectGridX = 0; //?? + public int redirectGridY = 0; //?? + public uint regionFlags = 0; //?? + + public byte simAccess = 0; //?? + public float sunHour = 0; + + public float terrainRaiseLimit = 0; + public float terrainLowerLimit = 0; + + public bool useEstateSun = false; + public int pricePerMeter = 1; + public ushort regionWaterHeight = 20; public bool regionAllowTerraform = true; @@ -70,5 +90,8 @@ namespace OpenSim.Framework.Types // Terrain Default (Must be in F32 Format!) public string terrainFile = "default.r32"; public double terrainMultiplier = 60.0; + public float waterHeight = (float)20.0; + + } } diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs index b07749ee9d..306bf630d2 100644 --- a/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs +++ b/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs @@ -91,7 +91,6 @@ namespace OpenSim.RegionServer.Client protected override void ProcessInPacket(Packet Pack) { ack_pack(Pack); - debug = true; if (debug) { if (Pack.Type != PacketType.AgentUpdate) @@ -490,6 +489,11 @@ namespace OpenSim.RegionServer.Client break; #endregion + #region Estate Packets + case PacketType.EstateOwnerMessage: + this.m_world.estateManager.handleEstateOwnerMessage((EstateOwnerMessagePacket)Pack, this); + break; + #endregion #region unimplemented handlers case PacketType.AgentIsNowWearing: // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack; diff --git a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs index 5dab08025c..33996d04c4 100644 --- a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs +++ b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs @@ -3,14 +3,62 @@ using System.Collections.Generic; using System.Text; using OpenSim.Framework.Types; +using OpenSim.RegionServer.Simulator; +using OpenSim.RegionServer.Client; + +using libsecondlife; +using libsecondlife.Packets; namespace OpenSim.RegionServer.Estate { + /// /// Processes requests regarding estates. Refer to EstateSettings.cs in OpenSim.Framework. Types for all of the core settings /// public class EstateManager { + private World m_world; + public EstateManager(World world) + { + m_world = world; //Estate settings found at world.m_regInfo.estateSettings + } + + public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, ClientView remote_client) + { + if (remote_client.AgentID == m_world.m_regInfo.MasterAvatarAssignedUUID) + { + switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) + { + case "getinfo": + Console.WriteLine("GETINFO Requested"); + RegionInfoPacket regionInfoPacket = new RegionInfoPacket(); + regionInfoPacket.AgentData.AgentID = remote_client.AgentID; + regionInfoPacket.AgentData.SessionID = remote_client.SessionID; + regionInfoPacket.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor; + regionInfoPacket.RegionInfo.EstateID = m_world.m_regInfo.estateSettings.estateID; + regionInfoPacket.RegionInfo.MaxAgents = m_world.m_regInfo.estateSettings.maxAgents; + regionInfoPacket.RegionInfo.ObjectBonusFactor = m_world.m_regInfo.estateSettings.objectBonusFactor; + regionInfoPacket.RegionInfo.ParentEstateID = m_world.m_regInfo.estateSettings.parentEstateID; + regionInfoPacket.RegionInfo.PricePerMeter = m_world.m_regInfo.estateSettings.pricePerMeter; + regionInfoPacket.RegionInfo.RedirectGridX = m_world.m_regInfo.estateSettings.redirectGridX; + regionInfoPacket.RegionInfo.RedirectGridY = m_world.m_regInfo.estateSettings.redirectGridY; + regionInfoPacket.RegionInfo.RegionFlags = m_world.m_regInfo.estateSettings.regionFlags; + regionInfoPacket.RegionInfo.SimAccess = m_world.m_regInfo.estateSettings.simAccess; + regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_world.m_regInfo.RegionName); + regionInfoPacket.RegionInfo.SunHour = m_world.m_regInfo.estateSettings.sunHour; + regionInfoPacket.RegionInfo.TerrainLowerLimit = m_world.m_regInfo.estateSettings.terrainLowerLimit; + regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_world.m_regInfo.estateSettings.terrainRaiseLimit; + regionInfoPacket.RegionInfo.UseEstateSun = m_world.m_regInfo.estateSettings.useEstateSun; + regionInfoPacket.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight; + + remote_client.OutPacket(regionInfoPacket); + break; + default: + OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); + break; + } + } + } } } diff --git a/OpenSim/OpenSim.RegionServer/Simulator/World.cs b/OpenSim/OpenSim.RegionServer/Simulator/World.cs index b4e4f49bdf..dda8ac457e 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/World.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/World.cs @@ -66,6 +66,7 @@ namespace OpenSim.RegionServer.Simulator private Mutex updateLock; public string m_datastore; public OpenSim.RegionServer.Simulator.ParcelManager parcelManager; + public OpenSim.RegionServer.Estate.EstateManager estateManager; #region Properties public PhysicsScene PhysScene @@ -621,6 +622,7 @@ namespace OpenSim.RegionServer.Simulator agentClient.OnParcelDivideRequest += new OpenSim.RegionServer.Simulator.ParcelDivideRequest(ParcelDivideRequest); agentClient.OnParcelJoinRequest+=new OpenSim.RegionServer.Simulator.ParcelJoinRequest(ParcelJoinRequest); agentClient.OnParcelPropertiesUpdateRequest += new OpenSim.RegionServer.Simulator.ParcelPropertiesUpdateRequest(ParcelPropertiesUpdateRequest); + Avatar newAvatar = null; try { diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs index a310deda7c..c6ee7e9ca8 100644 --- a/OpenSim/OpenSim/OpenSimMain.cs +++ b/OpenSim/OpenSim/OpenSimMain.cs @@ -210,7 +210,10 @@ namespace OpenSim m_console.Warn("Main.cs:Startup() - Grid Mode; Do not know how to get the user's master key yet!"); } - m_console.Notice("Creating ParcelManager"); + m_console.Notice("Creating Estate Manager"); + LocalWorld.estateManager = new OpenSim.RegionServer.Estate.EstateManager(this.LocalWorld); + + m_console.Notice("Creating Parcel Manager"); LocalWorld.parcelManager = new OpenSim.RegionServer.Simulator.ParcelManager(this.LocalWorld); m_console.Notice("Loading Parcels from DB...");