*Added EstateSettings.cs and moved many relevant variables from RegionInfoBase to EstateSettings class and added an EstateSettings objection to RegionInfoBase

*Added a few missed copyright headers
*Fixed a filename typo
This commit is contained in:
mingchen
2007-06-07 16:29:10 +00:00
parent 3fa76db3be
commit 458c6b6f16
23 changed files with 440 additions and 219 deletions

View File

@@ -2,8 +2,13 @@ using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Types;
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
{

View File

@@ -142,15 +142,9 @@
<Compile Include="Grid.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RegionInfoBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="PacketServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RegionInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="AuthenticateSessionsBase.cs">
<SubType>Code</SubType>
</Compile>
@@ -163,15 +157,18 @@
<Compile Include="RegionServerBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RegionInfoBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RegionInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\Avatar.Client.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\Entity.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\Avatar.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\World.PacketHandlers.cs">
<SubType>Code</SubType>
</Compile>
@@ -181,18 +178,9 @@
<Compile Include="Simulator\AvatarAnimations.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\ParcelManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\WorldBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\SceneObject.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\World.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\Primitive.cs">
<SubType>Code</SubType>
</Compile>
@@ -202,6 +190,18 @@
<Compile Include="Simulator\Primitive2.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\Avatar.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\World.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\SceneObject.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Simulator\ParcelManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Estate\EstateManager.cs">
<SubType>Code</SubType>
</Compile>

View File

@@ -17,26 +17,26 @@
<include name="AuthenticateSessionsRemote.cs" />
<include name="OpenSimNetworkHandler.cs" />
<include name="Grid.cs" />
<include name="RegionInfoBase.cs" />
<include name="PacketServer.cs" />
<include name="RegionInfo.cs" />
<include name="AuthenticateSessionsBase.cs" />
<include name="VersionInfo.cs" />
<include name="AgentAssetUpload.cs" />
<include name="RegionServerBase.cs" />
<include name="RegionInfoBase.cs" />
<include name="RegionInfo.cs" />
<include name="Simulator/Avatar.Client.cs" />
<include name="Simulator/Entity.cs" />
<include name="Simulator/Avatar.cs" />
<include name="Simulator/World.PacketHandlers.cs" />
<include name="Simulator/Avatar.Update.cs" />
<include name="Simulator/AvatarAnimations.cs" />
<include name="Simulator/ParcelManager.cs" />
<include name="Simulator/WorldBase.cs" />
<include name="Simulator/SceneObject.cs" />
<include name="Simulator/World.cs" />
<include name="Simulator/Primitive.cs" />
<include name="Simulator/World.Scripting.cs" />
<include name="Simulator/Primitive2.cs" />
<include name="Simulator/Avatar.cs" />
<include name="Simulator/World.cs" />
<include name="Simulator/SceneObject.cs" />
<include name="Simulator/ParcelManager.cs" />
<include name="Estate/EstateManager.cs" />
<include name="CAPS/AdminWebFront.cs" />
<include name="Assets/InventoryCache.cs" />

View File

@@ -232,12 +232,12 @@ namespace OpenSim.RegionServer
attri = configData.GetAttribute("TerrainFile");
if (attri == "")
{
this.TerrainFile = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32");
configData.SetAttribute("TerrainFile", this.TerrainFile);
this.estateSettings.terrainFile = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32");
configData.SetAttribute("TerrainFile", this.estateSettings.terrainFile);
}
else
{
this.TerrainFile = attri;
this.estateSettings.terrainFile = attri;
}
attri = "";
@@ -245,12 +245,12 @@ namespace OpenSim.RegionServer
if (attri == "")
{
string re = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0");
this.TerrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture);
configData.SetAttribute("TerrainMultiplier", this.TerrainMultiplier.ToString());
this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture);
configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString());
}
else
{
this.TerrainMultiplier = Convert.ToDouble(attri);
this.estateSettings.terrainMultiplier = Convert.ToDouble(attri);
}
attri = "";

View File

@@ -33,6 +33,7 @@ using System.Web;
using System.IO;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Types;
using libsecondlife;
namespace OpenSim.RegionServer
@@ -44,41 +45,13 @@ namespace OpenSim.RegionServer
public uint RegionLocX;
public uint RegionLocY;
public ulong RegionHandle;
public ushort RegionWaterHeight = 20;
public bool RegionTerraform = true;
public LLUUID RegionOwner = new LLUUID();
public int IPListenPort;
public string IPListenAddr;
// Region Information
// Low resolution 'base' textures. No longer used.
public LLUUID TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default
public LLUUID TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default
public LLUUID TerrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default
public LLUUID TerrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default
// Higher resolution terrain textures
public LLUUID TerrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID TerrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID TerrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID TerrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000");
// First quad - each point is bilinearly interpolated at each meter of terrain
public float TerrainStartHeight00 = 10.0f; // NW Corner ( I think )
public float TerrainStartHeight01 = 10.0f; // NE Corner ( I think )
public float TerrainStartHeight10 = 10.0f; // SW Corner ( I think )
public float TerrainStartHeight11 = 10.0f; // SE Corner ( I think )
// Second quad - also bilinearly interpolated.
// Terrain texturing is done that:
// 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y]
public float TerrainHeightRange00 = 60.0f;
public float TerrainHeightRange01 = 60.0f;
public float TerrainHeightRange10 = 60.0f;
public float TerrainHeightRange11 = 60.0f;
// Terrain Default (Must be in F32 Format!)
public string TerrainFile = "default.r32";
public double TerrainMultiplier = 60.0;
public EstateSettings estateSettings;
public RegionInfoBase()
{

View File

@@ -425,14 +425,14 @@ namespace OpenSim.RegionServer.Simulator
OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
handshake.RegionInfo.BillableFactor = 0;
handshake.RegionInfo.IsEstateManager = false;
handshake.RegionInfo.TerrainHeightRange00 = regionInfo.m_regInfo.TerrainHeightRange00;
handshake.RegionInfo.TerrainHeightRange01 = regionInfo.m_regInfo.TerrainHeightRange01;
handshake.RegionInfo.TerrainHeightRange10 = regionInfo.m_regInfo.TerrainHeightRange10;
handshake.RegionInfo.TerrainHeightRange11 = regionInfo.m_regInfo.TerrainHeightRange11;
handshake.RegionInfo.TerrainStartHeight00 = regionInfo.m_regInfo.TerrainStartHeight00;
handshake.RegionInfo.TerrainStartHeight01 = regionInfo.m_regInfo.TerrainStartHeight01;
handshake.RegionInfo.TerrainStartHeight10 = regionInfo.m_regInfo.TerrainStartHeight10;
handshake.RegionInfo.TerrainStartHeight11 = regionInfo.m_regInfo.TerrainStartHeight11;
handshake.RegionInfo.TerrainHeightRange00 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeNW;
handshake.RegionInfo.TerrainHeightRange01 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeNE;
handshake.RegionInfo.TerrainHeightRange10 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeSW;
handshake.RegionInfo.TerrainHeightRange11 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeSE;
handshake.RegionInfo.TerrainStartHeight00 = regionInfo.m_regInfo.estateSettings.terrainStartHeightNW;
handshake.RegionInfo.TerrainStartHeight01 = regionInfo.m_regInfo.estateSettings.terrainStartHeightNE;
handshake.RegionInfo.TerrainStartHeight10 = regionInfo.m_regInfo.estateSettings.terrainStartHeightSW;
handshake.RegionInfo.TerrainStartHeight11 = regionInfo.m_regInfo.estateSettings.terrainStartHeightSE;
handshake.RegionInfo.SimAccess = 13;
handshake.RegionInfo.WaterHeight = m_regionWaterHeight;
uint regionFlags = 72458694;
@@ -442,15 +442,15 @@ namespace OpenSim.RegionServer.Simulator
}
handshake.RegionInfo.RegionFlags = regionFlags;
handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0");
handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
handshake.RegionInfo.TerrainBase0 = regionInfo.m_regInfo.TerrainBase0;
handshake.RegionInfo.TerrainBase1 = regionInfo.m_regInfo.TerrainBase1;
handshake.RegionInfo.TerrainBase2 = regionInfo.m_regInfo.TerrainBase2;
handshake.RegionInfo.TerrainBase3 = regionInfo.m_regInfo.TerrainBase3;
handshake.RegionInfo.TerrainDetail0 = regionInfo.m_regInfo.TerrainDetail0;
handshake.RegionInfo.TerrainDetail1 = regionInfo.m_regInfo.TerrainDetail1;
handshake.RegionInfo.TerrainDetail2 = regionInfo.m_regInfo.TerrainDetail2;
handshake.RegionInfo.TerrainDetail3 = regionInfo.m_regInfo.TerrainDetail3;
handshake.RegionInfo.SimOwner = regionInfo.m_regInfo.MasterAvatarAssignedUUID;
handshake.RegionInfo.TerrainBase0 = regionInfo.m_regInfo.estateSettings.terrainBase0;
handshake.RegionInfo.TerrainBase1 = regionInfo.m_regInfo.estateSettings.terrainBase1;
handshake.RegionInfo.TerrainBase2 = regionInfo.m_regInfo.estateSettings.terrainBase2;
handshake.RegionInfo.TerrainBase3 = regionInfo.m_regInfo.estateSettings.terrainBase3;
handshake.RegionInfo.TerrainDetail0 = regionInfo.m_regInfo.estateSettings.terrainDetail0;
handshake.RegionInfo.TerrainDetail1 = regionInfo.m_regInfo.estateSettings.terrainDetail1;
handshake.RegionInfo.TerrainDetail2 = regionInfo.m_regInfo.estateSettings.terrainDetail2;
handshake.RegionInfo.TerrainDetail3 = regionInfo.m_regInfo.estateSettings.terrainDetail3;
handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet");

View File

@@ -284,7 +284,6 @@ namespace OpenSim.RegionServer.Simulator
{
end_x -= 4;
end_y -= 4;
Console.WriteLine("Joining Parcels between (" + start_x + ", " + start_y + ") and (" + end_x + ", " + end_y + ")");
//NOTE: The following only connects the parcels in each corner and not all the parcels that are within the selection box!
//This should be fixed later -- somewhat "incomplete code" --Ming
@@ -315,7 +314,6 @@ namespace OpenSim.RegionServer.Simulator
return false;
}
Console.WriteLine("Performing Join on parcel: " + startParcel.parcelData.parcelName + " - " + startParcel.parcelData.area + "sqm and " + endParcel.parcelData.parcelName + " - " + endParcel.parcelData.area + "sqm");
//Same owners! Lets join them
//Merge them to startParcel
parcelList[startParcel.parcelData.localID].setParcelBitmap(Parcel.mergeParcelBitmaps(startParcel.getParcelBitmap(), endParcel.getParcelBitmap()));
@@ -573,7 +571,6 @@ namespace OpenSim.RegionServer.Simulator
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);

View File

@@ -41,11 +41,8 @@ namespace OpenSim.RegionServer.Simulator
{
public class SceneObject : Entity
{
private LLUUID rootUUID;
private Dictionary<LLUUID, Primitive2> ChildPrimitives = new Dictionary<LLUUID, Primitive2>();
private Dictionary<uint, ClientView> m_clientThreads;
private World m_world;
public SceneObject()
{

View File

@@ -463,7 +463,7 @@ namespace OpenSim.RegionServer.Simulator
float[] map = this.localStorage.LoadWorld();
if (map == null)
{
if (string.IsNullOrEmpty(this.m_regInfo.TerrainFile))
if (string.IsNullOrEmpty(this.m_regInfo.estateSettings.terrainFile))
{
Console.WriteLine("No default terrain, procedurally generating...");
this.Terrain.hills();
@@ -474,8 +474,8 @@ namespace OpenSim.RegionServer.Simulator
{
try
{
this.Terrain.loadFromFileF32(this.m_regInfo.TerrainFile);
this.Terrain *= this.m_regInfo.TerrainMultiplier;
this.Terrain.loadFromFileF32(this.m_regInfo.estateSettings.terrainFile);
this.Terrain *= this.m_regInfo.estateSettings.terrainMultiplier;
}
catch (Exception e)
{