12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016 |
- /*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the OpenSim Project nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- using System;
- using System.IO;
- using System.Reflection;
- using libsecondlife;
- using log4net;
- namespace OpenSim.Framework
- {
- public class EstateSettings
- {
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private ConfigurationMember configMember;
- //Settings to this island
- private float m_billableFactor;
- private uint m_estateID;
- private LLUUID m_estateManager0;
- private LLUUID m_estateManager1;
- private LLUUID m_estateManager2;
- private LLUUID m_estateManager3;
- private LLUUID m_estateManager4;
- private LLUUID m_estateManager5;
- private LLUUID m_estateManager6;
- private LLUUID m_estateManager7;
- private LLUUID m_estateManager8;
- private LLUUID m_estateManager9;
- private string m_estateName;
- private byte m_maxAgents;
- private float m_objectBonusFactor;
- private uint m_parentEstateID;
- private int m_pricePerMeter;
- private int m_redirectGridX;
- private int m_redirectGridY;
- private bool m_regionAllowTerraform;
- private Simulator.RegionFlags m_regionFlags;
- private ushort m_regionWaterHeight;
- private Simulator.SimAccess m_simAccess;
- private float m_sunHour;
- private LLVector3 m_sunPosition;
- private LLUUID m_terrainBase0;
- private LLUUID m_terrainBase1;
- private LLUUID m_terrainBase2;
- private LLUUID m_terrainBase3;
- private LLUUID m_terrainDetail0;
- private LLUUID m_terrainDetail1;
- private LLUUID m_terrainDetail2;
- private LLUUID m_terrainDetail3;
- private string m_terrainFile;
- private float m_terrainHeightRange0;
- private float m_terrainHeightRange1;
- private float m_terrainHeightRange2;
- private float m_terrainHeightRange3;
- private LLUUID m_terrainImageID;
- private float m_terrainLowerLimit;
- private double m_terrainMultiplier;
- private float m_terrainRaiseLimit;
- private float m_terrainStartHeight0;
- private float m_terrainStartHeight1;
- private float m_terrainStartHeight2;
- private float m_terrainStartHeight3;
- private bool m_useFixedSun;
- private float m_waterHeight;
- public EstateSettings()
- {
- // Temporary hack to prevent multiple loadings.
- if (configMember == null)
- {
- configMember =
- new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS",
- loadConfigurationOptions, handleIncomingConfiguration, true);
- configMember.performConfigurationRetrieve();
- }
- }
- public float billableFactor
- {
- get { return m_billableFactor; }
- set
- {
- m_billableFactor = value;
- configMember.forceSetConfigurationOption("billable_factor", m_billableFactor.ToString());
- }
- }
- public uint estateID
- {
- get { return m_estateID; }
- set
- {
- m_estateID = value;
- configMember.forceSetConfigurationOption("estate_id", m_estateID.ToString());
- }
- }
- public uint parentEstateID
- {
- get { return m_parentEstateID; }
- set
- {
- m_parentEstateID = value;
- configMember.forceSetConfigurationOption("parent_estate_id", m_parentEstateID.ToString());
- }
- }
- public byte maxAgents
- {
- get { return m_maxAgents; }
- set
- {
- m_maxAgents = value;
- configMember.forceSetConfigurationOption("max_agents", m_maxAgents.ToString());
- }
- }
- public float objectBonusFactor
- {
- get { return m_objectBonusFactor; }
- set
- {
- m_objectBonusFactor = value;
- configMember.forceSetConfigurationOption("object_bonus_factor", m_objectBonusFactor.ToString());
- }
- }
- public int redirectGridX
- {
- get { return m_redirectGridX; }
- set
- {
- m_redirectGridX = value;
- configMember.forceSetConfigurationOption("redirect_grid_x", m_redirectGridX.ToString());
- }
- }
- public int redirectGridY
- {
- get { return m_redirectGridY; }
- set
- {
- m_redirectGridY = value;
- configMember.forceSetConfigurationOption("redirect_grid_y", m_redirectGridY.ToString());
- }
- }
- public Simulator.RegionFlags regionFlags
- {
- get { return m_regionFlags; }
- set
- {
- //m_regionFlags = (Simulator.RegionFlags)0x400000;
- m_regionFlags = value;
- configMember.forceSetConfigurationOption("region_flags", ((uint) m_regionFlags).ToString());
- }
- }
- public Simulator.SimAccess simAccess
- {
- get { return m_simAccess; }
- set
- {
- m_simAccess = value;
- configMember.forceSetConfigurationOption("sim_access", ((byte) m_simAccess).ToString());
- }
- }
- public float sunHour
- {
- get { return m_sunHour; }
- set
- {
- m_sunHour = value;
- if (useFixedSun)
- configMember.forceSetConfigurationOption("sun_hour", m_sunHour.ToString());
- }
- }
- public LLVector3 sunPosition
- {
- get { return m_sunPosition; }
- set
- {
- //Just set - does not need to be written to settings file
- m_sunPosition = value;
- }
- }
- public float terrainRaiseLimit
- {
- get { return m_terrainRaiseLimit; }
- set
- {
- m_terrainRaiseLimit = value;
- configMember.forceSetConfigurationOption("terrain_raise_limit", m_terrainRaiseLimit.ToString());
- }
- }
- public float terrainLowerLimit
- {
- get { return m_terrainLowerLimit; }
- set
- {
- m_terrainLowerLimit = value;
- configMember.forceSetConfigurationOption("terrain_lower_limit", m_terrainLowerLimit.ToString());
- }
- }
- public bool useFixedSun
- {
- get { return m_useFixedSun; }
- set
- {
- m_useFixedSun = value;
- configMember.forceSetConfigurationOption("use_fixed_sun", m_useFixedSun.ToString());
- }
- }
- public int pricePerMeter
- {
- get { return m_pricePerMeter; }
- set
- {
- m_pricePerMeter = value;
- configMember.forceSetConfigurationOption("price_per_meter", m_pricePerMeter.ToString());
- }
- }
- public ushort regionWaterHeight
- {
- get { return m_regionWaterHeight; }
- set
- {
- m_regionWaterHeight = value;
- configMember.forceSetConfigurationOption("region_water_height", m_regionWaterHeight.ToString());
- }
- }
- public bool regionAllowTerraform
- {
- get { return m_regionAllowTerraform; }
- set
- {
- m_regionAllowTerraform = value;
- configMember.forceSetConfigurationOption("region_allow_terraform", m_regionAllowTerraform.ToString());
- }
- }
- // Region Information
- // Low resolution 'base' textures. No longer used.
- public LLUUID terrainBase0
- {
- get { return m_terrainBase0; }
- set
- {
- m_terrainBase0 = value;
- configMember.forceSetConfigurationOption("terrain_base_0", m_terrainBase0.ToString());
- }
- }
- public LLUUID terrainBase1
- {
- get { return m_terrainBase1; }
- set
- {
- m_terrainBase1 = value;
- configMember.forceSetConfigurationOption("terrain_base_1", m_terrainBase1.ToString());
- }
- }
- public LLUUID terrainBase2
- {
- get { return m_terrainBase2; }
- set
- {
- m_terrainBase2 = value;
- configMember.forceSetConfigurationOption("terrain_base_2", m_terrainBase2.ToString());
- }
- }
- public LLUUID terrainBase3
- {
- get { return m_terrainBase3; }
- set
- {
- m_terrainBase3 = value;
- configMember.forceSetConfigurationOption("terrain_base_3", m_terrainBase3.ToString());
- }
- }
- // Higher resolution terrain textures
- public LLUUID terrainDetail0
- {
- get { return m_terrainDetail0; }
- set
- {
- m_terrainDetail0 = value;
- configMember.forceSetConfigurationOption("terrain_detail_0", m_terrainDetail0.ToString());
- }
- }
- public LLUUID terrainDetail1
- {
- get { return m_terrainDetail1; }
- set
- {
- m_terrainDetail1 = value;
- configMember.forceSetConfigurationOption("terrain_detail_1", m_terrainDetail1.ToString());
- }
- }
- public LLUUID terrainDetail2
- {
- get { return m_terrainDetail2; }
- set
- {
- m_terrainDetail2 = value;
- configMember.forceSetConfigurationOption("terrain_detail_2", m_terrainDetail2.ToString());
- }
- }
- public LLUUID terrainDetail3
- {
- get { return m_terrainDetail3; }
- set
- {
- m_terrainDetail3 = value;
- configMember.forceSetConfigurationOption("terrain_detail_3", m_terrainDetail3.ToString());
- }
- }
- // First quad - each point is bilinearly interpolated at each meter of terrain
- public float terrainStartHeight0
- {
- get { return m_terrainStartHeight0; }
- set
- {
- m_terrainStartHeight0 = value;
- configMember.forceSetConfigurationOption("terrain_start_height_0", m_terrainStartHeight0.ToString());
- }
- }
- public float terrainStartHeight1
- {
- get { return m_terrainStartHeight1; }
- set
- {
- m_terrainStartHeight1 = value;
- configMember.forceSetConfigurationOption("terrain_start_height_1", m_terrainStartHeight1.ToString());
- }
- }
- public float terrainStartHeight2
- {
- get { return m_terrainStartHeight2; }
- set
- {
- m_terrainStartHeight2 = value;
- configMember.forceSetConfigurationOption("terrain_start_height_2", m_terrainStartHeight2.ToString());
- }
- }
- public float terrainStartHeight3
- {
- get { return m_terrainStartHeight3; }
- set
- {
- m_terrainStartHeight3 = value;
- configMember.forceSetConfigurationOption("terrain_start_height_3", m_terrainStartHeight3.ToString());
- }
- }
- // 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 terrainHeightRange0
- {
- get { return m_terrainHeightRange0; }
- set
- {
- m_terrainHeightRange0 = value;
- configMember.forceSetConfigurationOption("terrain_height_range_0", m_terrainHeightRange0.ToString());
- }
- }
- public float terrainHeightRange1
- {
- get { return m_terrainHeightRange1; }
- set
- {
- m_terrainHeightRange1 = value;
- configMember.forceSetConfigurationOption("terrain_height_range_1", m_terrainHeightRange1.ToString());
- }
- }
- public float terrainHeightRange2
- {
- get { return m_terrainHeightRange2; }
- set
- {
- m_terrainHeightRange2 = value;
- configMember.forceSetConfigurationOption("terrain_height_range_2", m_terrainHeightRange2.ToString());
- }
- }
- public float terrainHeightRange3
- {
- get { return m_terrainHeightRange3; }
- set
- {
- m_terrainHeightRange3 = value;
- configMember.forceSetConfigurationOption("terrain_height_range_3", m_terrainHeightRange3.ToString());
- }
- }
- // 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 float waterHeight
- {
- get { return m_waterHeight; }
- set
- {
- m_waterHeight = value;
- configMember.forceSetConfigurationOption("water_height", m_waterHeight.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
- {
- get { return m_estateName; }
- set
- {
- m_estateName = value;
- configMember.forceSetConfigurationOption("estate_name", m_estateName.ToString());
- }
- }
- public LLUUID[] estateManagers
- {
- get
- {
- // returns a condensed array of LLUUIDs
- return GetEstateManagers();
- }
- set
- {
- // Sets a Condensed array of LLUUIDS
- int i = 0;
- for (i = 0; i < value.Length; i++)
- {
- switch (i)
- {
- case 0:
- m_estateManager0 = value[i];
- break;
- case 1:
- m_estateManager1 = value[i];
- break;
- case 2:
- m_estateManager2 = value[i];
- break;
- case 3:
- m_estateManager3 = value[i];
- break;
- case 4:
- m_estateManager4 = value[i];
- break;
- case 5:
- m_estateManager5 = value[i];
- break;
- case 6:
- m_estateManager6 = value[i];
- break;
- case 7:
- m_estateManager7 = value[i];
- break;
- case 8:
- m_estateManager8 = value[i];
- break;
- case 9:
- m_estateManager9 = value[i];
- break;
- }
- }
- // Clear the rest of them.. as they're no longer valid
- for (int j = i; j < 10; j++)
- {
- switch (j)
- {
- case 0:
- m_estateManager0 = LLUUID.Zero;
- break;
- case 1:
- m_estateManager1 = LLUUID.Zero;
- break;
- case 2:
- m_estateManager2 = LLUUID.Zero;
- break;
- case 3:
- m_estateManager3 = LLUUID.Zero;
- break;
- case 4:
- m_estateManager4 = LLUUID.Zero;
- break;
- case 5:
- m_estateManager5 = LLUUID.Zero;
- break;
- case 6:
- m_estateManager6 = LLUUID.Zero;
- break;
- case 7:
- m_estateManager7 = LLUUID.Zero;
- break;
- case 8:
- m_estateManager8 = LLUUID.Zero;
- break;
- case 9:
- m_estateManager9 = LLUUID.Zero;
- break;
- }
- }
- for (i = 0; i < 10; i++)
- {
- // Writes out the Estate managers to the XML file.
- configMember.forceSetConfigurationOption("estate_manager_" + i, (GetEstateManagerAtPos(i)).ToString());
- }
- }
- }
- #region EstateManager Get Methods to sort out skipped spots in the XML (suser error)
- private LLUUID GetEstateManagerAtPos(int pos)
- {
- // This is a helper for writing them out to the xml file
- switch (pos)
- {
- case 0:
- return m_estateManager0;
- case 1:
- return m_estateManager1;
- case 2:
- return m_estateManager2;
- case 3:
- return m_estateManager3;
- case 4:
- return m_estateManager4;
- case 5:
- return m_estateManager5;
- case 6:
- return m_estateManager6;
- case 7:
- return m_estateManager7;
- case 8:
- return m_estateManager8;
- case 9:
- return m_estateManager9;
- default:
- return LLUUID.Zero;
- }
- }
- private LLUUID[] GetEstateManagers()
- {
- int numEstateManagers = GetNumberOfEstateManagers();
- LLUUID[] rEstateManagers = new LLUUID[numEstateManagers];
- int pos = 0;
- for (int i = 0; i < numEstateManagers; i++)
- {
- pos = GetNextEstateManager(pos);
- rEstateManagers[i] = GetEstateManagerAtPos(pos);
- pos++;
- }
- return rEstateManagers;
- }
- private int GetNextEstateManager(int startpos)
- {
- // This is a utility function that skips over estate managers set to LLUUID.Zero
- int i = startpos;
- for (i = startpos; i < 10; i++)
- {
- if (GetEstateManagerAtPos(i) != LLUUID.Zero) return i;
- }
- return i;
- }
- private int GetNumberOfEstateManagers()
- {
- // This function returns the number of estate managers set
- // Regardless of whether there is a skipped spot
- int numEstateManagers = 0;
- if (m_estateManager0 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager1 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager2 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager3 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager4 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager5 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager6 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager7 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager8 != LLUUID.Zero) numEstateManagers++;
- if (m_estateManager9 != LLUUID.Zero) numEstateManagers++;
- return numEstateManagers;
- }
- public void AddEstateManager(LLUUID avatarID)
- {
- LLUUID[] testateManagers = GetEstateManagers();
- LLUUID[] nestateManagers = new LLUUID[testateManagers.Length + 1];
- int i = 0;
- for (i = 0; i < testateManagers.Length; i++)
- {
- nestateManagers[i] = testateManagers[i];
- }
- nestateManagers[i] = avatarID;
- //Saves it to the estate settings file
- estateManagers = nestateManagers;
- }
- public void RemoveEstateManager(LLUUID avatarID)
- {
- int notfoundparam = 11; // starting high so the condense routine (max ten) doesn't run if we don't find it.
- LLUUID[] testateManagers = GetEstateManagers(); // temporary estate managers list
- int i = 0;
- int foundpos = notfoundparam;
- // search for estate manager.
- for (i = 0; i < testateManagers.Length; i++)
- {
- if (testateManagers[i] == avatarID)
- {
- foundpos = i;
- break;
- }
- }
- if (foundpos < notfoundparam)
- {
- LLUUID[] restateManagers = new LLUUID[testateManagers.Length - 1];
- // fill new estate managers array up to the found spot
- for (int j = 0; j < foundpos; j++)
- restateManagers[j] = testateManagers[j];
- // skip over the estate manager we're removing and compress
- for (int j = foundpos + 1; j < testateManagers.Length; j++)
- restateManagers[j - 1] = testateManagers[j];
- estateManagers = restateManagers;
- }
- else
- {
- m_log.Error("[ESTATESETTINGS]: Unable to locate estate manager : " + avatarID.ToString() + " for removal");
- }
- }
- #endregion
- public void loadConfigurationOptions()
- {
- configMember.addConfigurationOption("billable_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty,
- "0.0", true);
- configMember.addConfigurationOption("estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty, "100",
- true);
- configMember.addConfigurationOption("parent_estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
- String.Empty, "1", true);
- configMember.addConfigurationOption("max_agents", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "40",
- true);
- configMember.addConfigurationOption("object_bonus_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
- String.Empty, "1.0", true);
- configMember.addConfigurationOption("redirect_grid_x", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty,
- "0", true);
- configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty,
- "0", true);
- configMember.addConfigurationOption("region_flags", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty,
- "336723974", true); //Taken from a Linden sim for the moment.
- configMember.addConfigurationOption("sim_access", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "21",
- true);
- configMember.addConfigurationOption("sun_hour", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "0",
- true);
- configMember.addConfigurationOption("terrain_raise_limit", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
- String.Empty, "4.0", true); //4 is the LL default
- configMember.addConfigurationOption("terrain_lower_limit", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
- String.Empty, "-4.0", true); //-4.0 is the LL default
- 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("region_water_height",
- ConfigurationOption.ConfigurationTypes.TYPE_UINT16, String.Empty, "20", true);
- configMember.addConfigurationOption("region_allow_terraform",
- ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, String.Empty, "true", true);
- configMember.addConfigurationOption("terrain_base_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
- "b8d3965a-ad78-bf43-699b-bff8eca6c975", true);
- configMember.addConfigurationOption("terrain_base_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
- "abb783e6-3e93-26c0-248a-247666855da3", true);
- configMember.addConfigurationOption("terrain_base_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
- "179cdabd-398a-9b6b-1391-4dc333ba321f", true);
- configMember.addConfigurationOption("terrain_base_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
- "beb169c7-11ea-fff2-efe5-0f24dc881df2", true);
- configMember.addConfigurationOption("terrain_detail_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("terrain_detail_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("terrain_detail_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("terrain_detail_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("terrain_start_height_0",
- ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "10.0", true);
- configMember.addConfigurationOption("terrain_start_height_1",
- ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "10.0", true);
- configMember.addConfigurationOption("terrain_start_height_2",
- ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "10.0", true);
- configMember.addConfigurationOption("terrain_start_height_3",
- ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "10.0", true);
- configMember.addConfigurationOption("terrain_height_range_0",
- ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "60.0", true);
- configMember.addConfigurationOption("terrain_height_range_1",
- ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "60.0", true);
- configMember.addConfigurationOption("terrain_height_range_2",
- ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "60.0", true);
- configMember.addConfigurationOption("terrain_height_range_3",
- ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "60.0", 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);
- configMember.addConfigurationOption("estate_manager_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_4", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_5", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_6", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_7", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_8", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- configMember.addConfigurationOption("estate_manager_9", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
- String.Empty, "00000000-0000-0000-0000-000000000000", true);
- }
- public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
- {
- switch (configuration_key)
- {
- case "billable_factor":
- m_billableFactor = (float) configuration_result;
- break;
- case "estate_id":
- m_estateID = (uint) configuration_result;
- break;
- case "parent_estate_id":
- m_parentEstateID = (uint) configuration_result;
- break;
- case "max_agents":
- m_maxAgents = (byte) configuration_result;
- break;
- case "object_bonus_factor":
- m_objectBonusFactor = (float) configuration_result;
- break;
- case "redirect_grid_x":
- m_redirectGridX = (int) configuration_result;
- break;
- case "redirect_grid_y":
- m_redirectGridY = (int) configuration_result;
- break;
- case "region_flags":
- m_regionFlags = (Simulator.RegionFlags) ((uint) configuration_result);
- break;
- case "sim_access":
- m_simAccess = (Simulator.SimAccess) ((byte) configuration_result);
- break;
- case "sun_hour":
- m_sunHour = (float) configuration_result;
- break;
- case "terrain_raise_limit":
- m_terrainRaiseLimit = (float) configuration_result;
- break;
- case "terrain_lower_limit":
- m_terrainLowerLimit = (float) configuration_result;
- break;
- case "use_fixed_sun":
- m_useFixedSun = (bool) configuration_result;
- break;
- case "price_per_meter":
- m_pricePerMeter = Convert.ToInt32(configuration_result);
- break;
- case "region_water_height":
- m_regionWaterHeight = (ushort) configuration_result;
- break;
- case "region_allow_terraform":
- m_regionAllowTerraform = (bool) configuration_result;
- break;
- case "terrain_base_0":
- m_terrainBase0 = (LLUUID) configuration_result;
- break;
- case "terrain_base_1":
- m_terrainBase1 = (LLUUID) configuration_result;
- break;
- case "terrain_base_2":
- m_terrainBase2 = (LLUUID) configuration_result;
- break;
- case "terrain_base_3":
- m_terrainBase3 = (LLUUID) configuration_result;
- break;
- case "terrain_detail_0":
- m_terrainDetail0 = (LLUUID) configuration_result;
- break;
- case "terrain_detail_1":
- m_terrainDetail1 = (LLUUID) configuration_result;
- break;
- case "terrain_detail_2":
- m_terrainDetail2 = (LLUUID) configuration_result;
- break;
- case "terrain_detail_3":
- m_terrainDetail3 = (LLUUID) configuration_result;
- break;
- case "terrain_start_height_0":
- m_terrainStartHeight0 = (float) configuration_result;
- break;
- case "terrain_start_height_1":
- m_terrainStartHeight1 = (float) configuration_result;
- break;
- case "terrain_start_height_2":
- m_terrainStartHeight2 = (float) configuration_result;
- break;
- case "terrain_start_height_3":
- m_terrainStartHeight3 = (float) configuration_result;
- break;
- case "terrain_height_range_0":
- m_terrainHeightRange0 = (float) configuration_result;
- break;
- case "terrain_height_range_1":
- m_terrainHeightRange1 = (float) configuration_result;
- break;
- case "terrain_height_range_2":
- m_terrainHeightRange2 = (float) configuration_result;
- break;
- case "terrain_height_range_3":
- m_terrainHeightRange3 = (float) 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 "water_height":
- double tmpVal = (double) configuration_result;
- m_waterHeight = (float) tmpVal;
- break;
- case "terrain_image_id":
- m_terrainImageID = (LLUUID) configuration_result;
- break;
- case "estate_manager_0":
- m_estateManager0 = (LLUUID) configuration_result;
- break;
- case "estate_manager_1":
- m_estateManager1 = (LLUUID) configuration_result;
- break;
- case "estate_manager_2":
- m_estateManager2 = (LLUUID) configuration_result;
- break;
- case "estate_manager_3":
- m_estateManager3 = (LLUUID) configuration_result;
- break;
- case "estate_manager_4":
- m_estateManager4 = (LLUUID) configuration_result;
- break;
- case "estate_manager_5":
- m_estateManager5 = (LLUUID) configuration_result;
- break;
- case "estate_manager_6":
- m_estateManager6 = (LLUUID) configuration_result;
- break;
- case "estate_manager_7":
- m_estateManager7 = (LLUUID) configuration_result;
- break;
- case "estate_manager_8":
- m_estateManager8 = (LLUUID) configuration_result;
- break;
- case "estate_manager_9":
- m_estateManager9 = (LLUUID) configuration_result;
- break;
- }
- return true;
- }
- }
- }
|