*Added basic support for EstateOwnerMessage

**Added support for 'getinfo' method
zircon^2
mingchen 2007-06-07 19:24:04 +00:00
parent a5d0f02132
commit 5caf2faa24
5 changed files with 82 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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
{
/// <summary>
/// Processes requests regarding estates. Refer to EstateSettings.cs in OpenSim.Framework. Types for all of the core settings
/// </summary>
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;
}
}
}
}
}

View File

@ -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
{

View File

@ -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...");