From 458c6b6f1687a63c7b443a8e76ee31da75c99247 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 7 Jun 2007 16:29:10 +0000 Subject: *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 --- .../OpenSim.RegionServer/Estate/EstateManager.cs | 5 ++++ .../OpenSim.RegionServer.csproj | 32 ++++++++++---------- .../OpenSim.RegionServer.dll.build | 12 ++++---- OpenSim/OpenSim.RegionServer/RegionInfo.cs | 12 ++++---- OpenSim/OpenSim.RegionServer/RegionInfoBase.cs | 33 ++------------------- OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs | 34 +++++++++++----------- .../Simulator/ParcelManager.cs | 3 -- .../OpenSim.RegionServer/Simulator/SceneObject.cs | 5 +--- OpenSim/OpenSim.RegionServer/Simulator/World.cs | 6 ++-- 9 files changed, 57 insertions(+), 85 deletions(-) (limited to 'OpenSim/OpenSim.RegionServer') diff --git a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs index 7ddfcd2..5dab080 100644 --- a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs +++ b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs @@ -2,8 +2,13 @@ using System; using System.Collections.Generic; using System.Text; +using OpenSim.Framework.Types; + 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 { diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj index aa7ce5d..4f16f2c 100644 --- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj +++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj @@ -142,15 +142,9 @@ Code - - Code - Code - - Code - Code @@ -163,13 +157,16 @@ Code - + Code - + Code - + + Code + + Code @@ -181,25 +178,28 @@ Code - + Code - + Code - + Code - + Code - + Code - + Code - + + Code + + Code diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build index 204796e..702c90c 100644 --- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build +++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build @@ -17,26 +17,26 @@ - - + + - - - - + + + + diff --git a/OpenSim/OpenSim.RegionServer/RegionInfo.cs b/OpenSim/OpenSim.RegionServer/RegionInfo.cs index f14fd3f..de1750c 100644 --- a/OpenSim/OpenSim.RegionServer/RegionInfo.cs +++ b/OpenSim/OpenSim.RegionServer/RegionInfo.cs @@ -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 = ""; diff --git a/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs b/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs index 8622857..a18c05f 100644 --- a/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs +++ b/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs @@ -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() { diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs index 0135e26..65a9a63 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs @@ -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"); diff --git a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs index a9d4eea..6d432f1 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs @@ -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); diff --git a/OpenSim/OpenSim.RegionServer/Simulator/SceneObject.cs b/OpenSim/OpenSim.RegionServer/Simulator/SceneObject.cs index 1ef91c9..ce2b50d 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/SceneObject.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/SceneObject.cs @@ -41,11 +41,8 @@ namespace OpenSim.RegionServer.Simulator { public class SceneObject : Entity { - private LLUUID rootUUID; private Dictionary ChildPrimitives = new Dictionary(); - private Dictionary m_clientThreads; - private World m_world; - + public SceneObject() { diff --git a/OpenSim/OpenSim.RegionServer/Simulator/World.cs b/OpenSim/OpenSim.RegionServer/Simulator/World.cs index 150a092..b4e4f49 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/World.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/World.cs @@ -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) { -- cgit v1.1