Patch 7 of the region patches. Finish off the region parts of the estate dialog. Full user functionality. Terrain textures, heights, water, avatar counts, prim bonus, debug settings and region toggles can now be set from the dialog on a per-region basis. Estate stuff defaults to sane values where there are no defaults, to estate_settings.xml otherwise. Sun still b0rked :(
0.6.0-stable
Melanie Thielker 2008-07-14 01:39:36 +00:00
parent eaf9383b59
commit 07bd749ac5
10 changed files with 117 additions and 119 deletions

View File

@ -58,11 +58,6 @@ namespace OpenSim.Framework
private int m_pricePerMeter;
private int m_redirectGridX;
private int m_redirectGridY;
private float m_sunHour;
private LLVector3 m_sunPosition;
private string m_terrainFile;
private LLUUID m_terrainImageID;
private double m_terrainMultiplier;
public EstateSettings()
{
@ -126,25 +121,6 @@ namespace OpenSim.Framework
}
}
public float sunHour
{
get { return m_sunHour; }
set
{
m_sunHour = value;
}
}
public LLVector3 sunPosition
{
get { return m_sunPosition; }
set
{
//Just set - does not need to be written to settings file
m_sunPosition = value;
}
}
public int pricePerMeter
{
get { return m_pricePerMeter; }
@ -155,45 +131,6 @@ namespace OpenSim.Framework
}
}
// First quad - each point is bilinearly interpolated at each meter of terrain
// Terrain Default (Must be in F32 Format!)
public string terrainFile
{
get { return m_terrainFile; }
set
{
m_terrainFile = value;
configMember.forceSetConfigurationOption("terrain_file", m_terrainFile.ToString());
}
}
public double terrainMultiplier
{
get { return m_terrainMultiplier; }
set
{
m_terrainMultiplier = value;
configMember.forceSetConfigurationOption("terrain_multiplier", m_terrainMultiplier.ToString());
}
}
public LLUUID terrainImageID
{
get { return m_terrainImageID; }
set
{
m_terrainImageID = value;
// I don't think there is a reason that this actually
// needs to be written back to the estate settings
// file.
// configMember.forceSetConfigurationOption("terrain_image_id", m_terrainImageID.ToString());
}
}
// Estate name
public string estateName
@ -461,22 +398,11 @@ namespace OpenSim.Framework
"0", true);
configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty,
"0", true);
configMember.addConfigurationOption("sun_hour", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "0",
true);
configMember.addConfigurationOption("use_fixed_sun", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, String.Empty,
"false", true);
configMember.addConfigurationOption("price_per_meter", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
String.Empty, "1", true);
configMember.addConfigurationOption("terrain_file",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, String.Empty,
"default.r32", true);
configMember.addConfigurationOption("terrain_multiplier", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
String.Empty, "60.0", true);
configMember.addConfigurationOption("water_height", ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, String.Empty,
"20.0", true);
configMember.addConfigurationOption("terrain_image_id", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
String.Empty, "TestEstate", true);
@ -521,26 +447,13 @@ namespace OpenSim.Framework
case "redirect_grid_y":
m_redirectGridY = (int) configuration_result;
break;
case "sun_hour":
m_sunHour = (float) configuration_result;
break;
case "price_per_meter":
m_pricePerMeter = Convert.ToInt32(configuration_result);
break;
case "terrain_file":
m_terrainFile = (string) configuration_result;
break;
case "estate_name":
m_estateName = (string) configuration_result;
break;
case "terrain_multiplier":
m_terrainMultiplier = Convert.ToDouble(configuration_result);
break;
case "terrain_image_id":
m_terrainImageID = (LLUUID) configuration_result;
break;
case "estate_manager_0":
m_estateManager0 = (LLUUID) configuration_result;
break;

View File

@ -474,6 +474,22 @@ namespace OpenSim.Framework
set { m_UseEstateSun = value; }
}
private LLVector3 m_SunVector;
public LLVector3 SunVector
{
get { return m_SunVector; }
set { m_SunVector = value; }
}
private LLUUID m_TerrainImageID;
public LLUUID TerrainImageID
{
get { return m_TerrainImageID; }
set { m_TerrainImageID = value; }
}
private bool m_FixedSun = false;
public bool FixedSun

View File

@ -5884,21 +5884,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case "texturebase":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
{
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
{
string s = Helpers.FieldToUTF8String(block.Parameter);
string[] splitField = s.Split(' ');
if (splitField.Length == 2)
{
LLUUID tempUUID = new LLUUID(splitField[1]);
OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID);
}
}
}
break;
// case "texturebase":
// if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
// {
// foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
// {
// string s = Helpers.FieldToUTF8String(block.Parameter);
// string[] splitField = s.Split(' ');
// if (splitField.Length == 2)
// {
// LLUUID tempUUID = new LLUUID(splitField[1]);
// OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID);
// }
// }
// }
// break;
case "texturedetail":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
{

View File

@ -208,7 +208,7 @@ namespace OpenSim.Region.Communications.Local
map.X = (ushort) regInfo.RegionLocX;
map.Y = (ushort) regInfo.RegionLocY;
map.WaterHeight = (byte) regInfo.RegionSettings.WaterHeight;
map.MapImageId = regInfo.EstateSettings.terrainImageID;
map.MapImageId = regInfo.RegionSettings.TerrainImageID;
map.Agents = 1;
map.RegionFlags = 72458694;
map.Access = 13;

View File

@ -118,7 +118,7 @@ namespace OpenSim.Region.Communications.OGS1
GridParams["sim_name"] = regionInfo.RegionName;
GridParams["http_port"] = serversInfo.HttpListenerPort.ToString();
GridParams["remoting_port"] = NetworkServersInfo.RemotingListenerPort.ToString();
GridParams["map-image-id"] = regionInfo.EstateSettings.terrainImageID.ToString();
GridParams["map-image-id"] = regionInfo.RegionSettings.TerrainImageID.ToString();
GridParams["originUUID"] = regionInfo.originRegionID.ToString();
GridParams["server_uri"] = regionInfo.ServerURI;
GridParams["region_secret"] = regionInfo.regionSecret;

View File

@ -118,6 +118,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
m_scene.RegionInfo.RegionSettings.TerrainTexture4 = texture;
break;
}
m_scene.RegionInfo.RegionSettings.Save();
}
public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue)
@ -141,6 +142,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
m_scene.RegionInfo.RegionSettings.Elevation2NE = highValue;
break;
}
m_scene.RegionInfo.RegionSettings.Save();
}
private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient)
@ -160,10 +162,13 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
// Time of day / fixed sun
m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
m_scene.RegionInfo.EstateSettings.sunHour = SunHour;
m_scene.RegionInfo.RegionSettings.SunPosition = SunHour;
m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseFixedSun, SunHour);
//m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
//m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString());
sendRegionInfoPacketToAll();
m_scene.RegionInfo.RegionSettings.Save();
}
@ -368,7 +373,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
args.simAccess = mature;
if (m_scene.RegionInfo.RegionSettings.FixedSun)
args.sunHour = m_scene.RegionInfo.EstateSettings.sunHour;
args.sunHour = (float)m_scene.RegionInfo.RegionSettings.SunPosition;
else
args.sunHour = m_scene.EventManager.GetSunLindenHour();
@ -586,8 +591,12 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
public void changeWaterHeight(float height)
{
setRegionTerrainSettings(height, (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit, (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit,
m_scene.RegionInfo.RegionSettings.FixedSun, m_scene.RegionInfo.EstateSettings.sunHour);
setRegionTerrainSettings(height,
(float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit,
(float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit,
m_scene.RegionInfo.RegionSettings.FixedSun,
(float)m_scene.RegionInfo.RegionSettings.SunPosition);
sendRegionInfoPacketToAll();
}
@ -597,7 +606,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
{
client.OnDetailedEstateDataRequest += sendDetailedEstateData;
client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler;
client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture;
// client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture;
client.OnSetEstateTerrainDetailTexture += setEstateTerrainBaseTexture;
client.OnSetEstateTerrainTextureHeights += setEstateTerrainTextureHeights;
client.OnCommitEstateTerrainTextureRequest += handleCommitEstateTerrainTextureRequest;
client.OnSetRegionTerrainSettings += setRegionTerrainSettings;
@ -618,7 +628,66 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
public uint GetRegionFlags()
{
Simulator.RegionFlags flags = Simulator.RegionFlags.None;
//m_scene.RegionInfo.RegionSettings.
// Fully implemented
//
if(m_scene.RegionInfo.RegionSettings.AllowDamage)
flags |= Simulator.RegionFlags.AllowDamage;
if(m_scene.RegionInfo.RegionSettings.BlockTerraform)
flags |= Simulator.RegionFlags.BlockTerraform;
if(!m_scene.RegionInfo.RegionSettings.AllowLandResell)
flags |= Simulator.RegionFlags.BlockLandResell;
if(m_scene.RegionInfo.RegionSettings.DisableCollisions)
flags |= Simulator.RegionFlags.SkipCollisions;
if(m_scene.RegionInfo.RegionSettings.DisableScripts)
flags |= Simulator.RegionFlags.SkipScripts;
if(m_scene.RegionInfo.RegionSettings.DisablePhysics)
flags |= Simulator.RegionFlags.SkipPhysics;
if(m_scene.RegionInfo.RegionSettings.BlockFly)
flags |= Simulator.RegionFlags.NoFly;
if(m_scene.RegionInfo.RegionSettings.RestrictPushing)
flags |= Simulator.RegionFlags.RestrictPushObject;
if(m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide)
flags |= Simulator.RegionFlags.AllowParcelChanges;
if(m_scene.RegionInfo.RegionSettings.BlockShowInSearch)
flags |= (Simulator.RegionFlags)(1 << 29);
// Partially implemented
//
if(m_scene.RegionInfo.RegionSettings.FixedSun)
flags |= Simulator.RegionFlags.SunFixed;
// Not implemented
//
// TODO: ExternallyVisible
flags |= Simulator.RegionFlags.ExternallyVisible;
// TODO: PublicAllowed
flags |= Simulator.RegionFlags.PublicAllowed;
// TODO: AllowDirectTeleport
flags |= Simulator.RegionFlags.AllowDirectTeleport;
// TODO: AllowVoice
flags |= Simulator.RegionFlags.AllowVoice;
// TDOD: AllowLandmark
// TDOD: AllowSetHome
// TODO: ResetHomeOnTeleport
// TODO: TaxFree ? (Linden-ism)
// TODO: Sandbox ?
// TODO: SkipUpdateInterestList
// TODO: ExternallyVisible
// TODO: DenyAnonymous
// TODO: DenyIdentified
// TODO: DenyTransacted
// TODO: AbuseEmailToEstateOwner
// TODO: BlockDwell
// TODO: EstateSkipScripts
// Omitted
//
// Omitted: NullLayer (what is that?)
// Omitted: SkipAgentAction (what does it do?)
// Omitted: MainlandVisible (Do we need it)
return (uint)flags;
}
}

View File

@ -301,7 +301,7 @@ namespace OpenSim.Region.Environment.Modules
}
// set estate settings for region access to sun position
m_scene.RegionInfo.EstateSettings.sunPosition = Position;
m_scene.RegionInfo.RegionSettings.SunVector = Position;
//m_scene.RegionInfo.EstateSettings.sunHour = GetLindenEstateHourFromCurrentTime();
}
public void ForceSunUpdateToAllClients()
@ -316,8 +316,8 @@ namespace OpenSim.Region.Environment.Modules
}
// set estate settings for region access to sun position
m_scene.RegionInfo.EstateSettings.sunPosition = Position;
m_scene.RegionInfo.EstateSettings.sunHour = GetLindenEstateHourFromCurrentTime();
m_scene.RegionInfo.RegionSettings.SunVector = Position;
m_scene.RegionInfo.RegionSettings.SunPosition = GetLindenEstateHourFromCurrentTime();
}
/// <summary>
/// Calculate the sun's orbital position and its velocity.

View File

@ -1354,10 +1354,10 @@ namespace OpenSim.Region.Environment.Scenes
m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID");
}
m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID;
m_regInfo.RegionSettings.TerrainImageID = TerrainImageLLUUID;
AssetBase asset = new AssetBase();
asset.FullID = m_regInfo.EstateSettings.terrainImageID;
asset.FullID = m_regInfo.RegionSettings.TerrainImageID;
asset.Data = data;
asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
asset.Description = RegionInfo.RegionName;
@ -1405,10 +1405,10 @@ namespace OpenSim.Region.Environment.Scenes
TerrainImageLLUUID = lastMapRegionUUID;
}
m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID;
m_regInfo.RegionSettings.TerrainImageID = TerrainImageLLUUID;
AssetBase asset = new AssetBase();
asset.FullID = m_regInfo.EstateSettings.terrainImageID;
asset.FullID = m_regInfo.RegionSettings.TerrainImageID;
asset.Data = data;
asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
asset.Description = RegionInfo.RegionName;

View File

@ -3274,7 +3274,7 @@ namespace OpenSim.Region.ScriptEngine.Common
// sunPosition estate setting is set in OpenSim.Region.Environment.Modules.SunModule
// have to convert from LLVector3 (float) to LSL_Types.Vector3 (double)
SunFloatVector3 = World.RegionInfo.EstateSettings.sunPosition;
SunFloatVector3 = World.RegionInfo.RegionSettings.SunVector;
SunDoubleVector3.x = (double)SunFloatVector3.X;
SunDoubleVector3.y = (double)SunFloatVector3.Y;
SunDoubleVector3.z = (double)SunFloatVector3.Z;

View File

@ -3214,7 +3214,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// sunPosition estate setting is set in OpenSim.Region.Environment.Modules.SunModule
// have to convert from LLVector3 (float) to LSL_Types.Vector3 (double)
SunFloatVector3 = World.RegionInfo.EstateSettings.sunPosition;
SunFloatVector3 = World.RegionInfo.RegionSettings.SunVector;
SunDoubleVector3.x = (double)SunFloatVector3.X;
SunDoubleVector3.y = (double)SunFloatVector3.Y;
SunDoubleVector3.z = (double)SunFloatVector3.Z;