From 5caf2faa24120f48522608c74b34c5ba4ce74ed5 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 7 Jun 2007 19:24:04 +0000 Subject: *Added basic support for EstateOwnerMessage **Added support for 'getinfo' method --- .../Client/ClientView.ProcessPackets.cs | 6 ++- .../OpenSim.RegionServer/Estate/EstateManager.cs | 48 ++++++++++++++++++++++ OpenSim/OpenSim.RegionServer/Simulator/World.cs | 2 + OpenSim/OpenSim/OpenSimMain.cs | 5 ++- 4 files changed, 59 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs index b07749e..306bf63 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 5dab080..33996d0 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 b4e4f49..dda8ac4 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 a310ded..c6ee7e9 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..."); -- cgit v1.1