diff options
Diffstat (limited to 'OpenSim/Framework/RegionSettings.cs')
-rw-r--r-- | OpenSim/Framework/RegionSettings.cs | 198 |
1 files changed, 0 insertions, 198 deletions
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 8d1212b..673cf20 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs | |||
@@ -33,8 +33,6 @@ namespace OpenSim.Framework | |||
33 | { | 33 | { |
34 | public class RegionSettings | 34 | public class RegionSettings |
35 | { | 35 | { |
36 | private ConfigurationMember configMember; | ||
37 | |||
38 | public delegate void SaveDelegate(RegionSettings rs); | 36 | public delegate void SaveDelegate(RegionSettings rs); |
39 | 37 | ||
40 | public event SaveDelegate OnSave; | 38 | public event SaveDelegate OnSave; |
@@ -47,202 +45,6 @@ namespace OpenSim.Framework | |||
47 | public static readonly UUID DEFAULT_TERRAIN_TEXTURE_3 = new UUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); | 45 | public static readonly UUID DEFAULT_TERRAIN_TEXTURE_3 = new UUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); |
48 | public static readonly UUID DEFAULT_TERRAIN_TEXTURE_4 = new UUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); | 46 | public static readonly UUID DEFAULT_TERRAIN_TEXTURE_4 = new UUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); |
49 | 47 | ||
50 | public RegionSettings() | ||
51 | { | ||
52 | if (configMember == null) | ||
53 | { | ||
54 | try | ||
55 | { | ||
56 | configMember = new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", LoadConfigurationOptions, HandleIncomingConfiguration, true); | ||
57 | configMember.performConfigurationRetrieve(); | ||
58 | } | ||
59 | catch (Exception) | ||
60 | { | ||
61 | } | ||
62 | } | ||
63 | } | ||
64 | |||
65 | public void LoadConfigurationOptions() | ||
66 | { | ||
67 | configMember.addConfigurationOption("region_flags", | ||
68 | ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
69 | String.Empty, "336723974", true); | ||
70 | |||
71 | configMember.addConfigurationOption("max_agents", | ||
72 | ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
73 | String.Empty, "40", true); | ||
74 | |||
75 | configMember.addConfigurationOption("object_bonus_factor", | ||
76 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
77 | String.Empty, "1.0", true); | ||
78 | |||
79 | configMember.addConfigurationOption("sim_access", | ||
80 | ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
81 | String.Empty, "21", true); | ||
82 | |||
83 | configMember.addConfigurationOption("terrain_base_0", | ||
84 | ConfigurationOption.ConfigurationTypes.TYPE_UUID, | ||
85 | String.Empty, DEFAULT_TERRAIN_TEXTURE_1.ToString(), true); | ||
86 | |||
87 | configMember.addConfigurationOption("terrain_base_1", | ||
88 | ConfigurationOption.ConfigurationTypes.TYPE_UUID, | ||
89 | String.Empty, DEFAULT_TERRAIN_TEXTURE_2.ToString(), true); | ||
90 | |||
91 | configMember.addConfigurationOption("terrain_base_2", | ||
92 | ConfigurationOption.ConfigurationTypes.TYPE_UUID, | ||
93 | String.Empty, DEFAULT_TERRAIN_TEXTURE_3.ToString(), true); | ||
94 | |||
95 | configMember.addConfigurationOption("terrain_base_3", | ||
96 | ConfigurationOption.ConfigurationTypes.TYPE_UUID, | ||
97 | String.Empty, DEFAULT_TERRAIN_TEXTURE_4.ToString(), true); | ||
98 | |||
99 | configMember.addConfigurationOption("terrain_start_height_0", | ||
100 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
101 | String.Empty, "10.0", true); | ||
102 | |||
103 | configMember.addConfigurationOption("terrain_start_height_1", | ||
104 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
105 | String.Empty, "10.0", true); | ||
106 | |||
107 | configMember.addConfigurationOption("terrain_start_height_2", | ||
108 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
109 | String.Empty, "10.0", true); | ||
110 | |||
111 | configMember.addConfigurationOption("terrain_start_height_3", | ||
112 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
113 | String.Empty, "10.0", true); | ||
114 | |||
115 | configMember.addConfigurationOption("terrain_height_range_0", | ||
116 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
117 | String.Empty, "60.0", true); | ||
118 | |||
119 | configMember.addConfigurationOption("terrain_height_range_1", | ||
120 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
121 | String.Empty, "60.0", true); | ||
122 | |||
123 | configMember.addConfigurationOption("terrain_height_range_2", | ||
124 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
125 | String.Empty, "60.0", true); | ||
126 | |||
127 | configMember.addConfigurationOption("terrain_height_range_3", | ||
128 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
129 | String.Empty, "60.0", true); | ||
130 | |||
131 | configMember.addConfigurationOption("region_water_height", | ||
132 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
133 | String.Empty, "20.0", true); | ||
134 | |||
135 | configMember.addConfigurationOption("terrain_raise_limit", | ||
136 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
137 | String.Empty, "100.0", true); | ||
138 | |||
139 | configMember.addConfigurationOption("terrain_lower_limit", | ||
140 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
141 | String.Empty, "-100.0", true); | ||
142 | |||
143 | configMember.addConfigurationOption("sun_hour", | ||
144 | ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, | ||
145 | String.Empty, "0.0", true); | ||
146 | } | ||
147 | |||
148 | public bool HandleIncomingConfiguration(string key, object value) | ||
149 | { | ||
150 | switch (key) | ||
151 | { | ||
152 | case "region_flags": | ||
153 | RegionFlags flags = (RegionFlags)(uint)value; | ||
154 | |||
155 | m_BlockTerraform = | ||
156 | (flags & RegionFlags.BlockTerraform) != 0; | ||
157 | m_BlockFly = | ||
158 | (flags & RegionFlags.NoFly) != 0; | ||
159 | m_AllowDamage = | ||
160 | (flags & RegionFlags.AllowDamage) != 0; | ||
161 | m_RestrictPushing = | ||
162 | (flags & RegionFlags.RestrictPushObject) != 0; | ||
163 | m_AllowLandResell = | ||
164 | (flags & RegionFlags.BlockLandResell) == 0; | ||
165 | m_AllowLandJoinDivide = | ||
166 | (flags & RegionFlags.AllowParcelChanges) != 0; | ||
167 | m_BlockShowInSearch = | ||
168 | ((uint)flags & (1 << 29)) != 0; | ||
169 | m_DisableScripts = | ||
170 | (flags & RegionFlags.SkipScripts) != 0; | ||
171 | m_DisableCollisions = | ||
172 | (flags & RegionFlags.SkipCollisions) != 0; | ||
173 | m_DisablePhysics = | ||
174 | (flags & RegionFlags.SkipPhysics) != 0; | ||
175 | m_FixedSun = | ||
176 | (flags & RegionFlags.SunFixed) != 0; | ||
177 | m_Sandbox = | ||
178 | (flags & RegionFlags.Sandbox) != 0; | ||
179 | break; | ||
180 | case "max_agents": | ||
181 | m_AgentLimit = (int)value; | ||
182 | break; | ||
183 | case "object_bonus_factor": | ||
184 | m_ObjectBonus = (double)value; | ||
185 | break; | ||
186 | case "sim_access": | ||
187 | int access = (int)value; | ||
188 | if (access <= 13) | ||
189 | m_Maturity = 0; | ||
190 | else | ||
191 | m_Maturity = 1; | ||
192 | break; | ||
193 | case "terrain_base_0": | ||
194 | m_TerrainTexture1 = (UUID)value; | ||
195 | break; | ||
196 | case "terrain_base_1": | ||
197 | m_TerrainTexture2 = (UUID)value; | ||
198 | break; | ||
199 | case "terrain_base_2": | ||
200 | m_TerrainTexture3 = (UUID)value; | ||
201 | break; | ||
202 | case "terrain_base_3": | ||
203 | m_TerrainTexture4 = (UUID)value; | ||
204 | break; | ||
205 | case "terrain_start_height_0": | ||
206 | m_Elevation1SW = (double)value; | ||
207 | break; | ||
208 | case "terrain_start_height_1": | ||
209 | m_Elevation1NW = (double)value; | ||
210 | break; | ||
211 | case "terrain_start_height_2": | ||
212 | m_Elevation1SE = (double)value; | ||
213 | break; | ||
214 | case "terrain_start_height_3": | ||
215 | m_Elevation1NE = (double)value; | ||
216 | break; | ||
217 | case "terrain_height_range_0": | ||
218 | m_Elevation2SW = (double)value; | ||
219 | break; | ||
220 | case "terrain_height_range_1": | ||
221 | m_Elevation2NW = (double)value; | ||
222 | break; | ||
223 | case "terrain_height_range_2": | ||
224 | m_Elevation2SE = (double)value; | ||
225 | break; | ||
226 | case "terrain_height_range_3": | ||
227 | m_Elevation2NE = (double)value; | ||
228 | break; | ||
229 | case "region_water_height": | ||
230 | m_WaterHeight = (double)value; | ||
231 | break; | ||
232 | case "terrain_raise_limit": | ||
233 | m_TerrainRaiseLimit = (double)value; | ||
234 | break; | ||
235 | case "terrain_lower_limit": | ||
236 | m_TerrainLowerLimit = (double)value; | ||
237 | break; | ||
238 | case "sun_hour": | ||
239 | m_SunPosition = (double)value; | ||
240 | break; | ||
241 | } | ||
242 | |||
243 | return true; | ||
244 | } | ||
245 | |||
246 | public void Save() | 48 | public void Save() |
247 | { | 49 | { |
248 | if (OnSave != null) | 50 | if (OnSave != null) |