aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/EstateSettings.cs
diff options
context:
space:
mode:
authorMelanie2010-03-22 18:49:56 +0000
committerMelanie2010-03-22 18:49:56 +0000
commit70b0e07d1ea99f8bd88f2be12bf9b53a39187f60 (patch)
tree0093de7003392ff5edd246e82fa3fcb2b216cff1 /OpenSim/Framework/EstateSettings.cs
parentFix a nullref in permissions when returning objects via right-click (diff)
downloadopensim-SC-70b0e07d1ea99f8bd88f2be12bf9b53a39187f60.zip
opensim-SC-70b0e07d1ea99f8bd88f2be12bf9b53a39187f60.tar.gz
opensim-SC-70b0e07d1ea99f8bd88f2be12bf9b53a39187f60.tar.bz2
opensim-SC-70b0e07d1ea99f8bd88f2be12bf9b53a39187f60.tar.xz
Remove the reading of estate_settings.xml and the associated processing of
defaults. Adding code to facilitate estate creation / managemment as part of first time start up
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/EstateSettings.cs194
1 files changed, 7 insertions, 187 deletions
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index b4b5808..2a495b0 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -35,7 +35,6 @@ namespace OpenSim.Framework
35 public class EstateSettings 35 public class EstateSettings
36 { 36 {
37 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 37 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
38 private readonly ConfigurationMember configMember;
39 38
40 public delegate void SaveDelegate(EstateSettings rs); 39 public delegate void SaveDelegate(EstateSettings rs);
41 40
@@ -43,7 +42,7 @@ namespace OpenSim.Framework
43 42
44 // Only the client uses these 43 // Only the client uses these
45 // 44 //
46 private uint m_EstateID = 100; 45 private uint m_EstateID = 0;
47 46
48 public uint EstateID 47 public uint EstateID
49 { 48 {
@@ -51,7 +50,7 @@ namespace OpenSim.Framework
51 set { m_EstateID = value; } 50 set { m_EstateID = value; }
52 } 51 }
53 52
54 private string m_EstateName; 53 private string m_EstateName = "My Estate";
55 54
56 public string EstateName 55 public string EstateName
57 { 56 {
@@ -59,7 +58,7 @@ namespace OpenSim.Framework
59 set { m_EstateName = value; } 58 set { m_EstateName = value; }
60 } 59 }
61 60
62 private uint m_ParentEstateID = 100; 61 private uint m_ParentEstateID = 1;
63 62
64 public uint ParentEstateID 63 public uint ParentEstateID
65 { 64 {
@@ -67,7 +66,7 @@ namespace OpenSim.Framework
67 set { m_ParentEstateID = value; } 66 set { m_ParentEstateID = value; }
68 } 67 }
69 68
70 private float m_BillableFactor; 69 private float m_BillableFactor = 0.0f;
71 70
72 public float BillableFactor 71 public float BillableFactor
73 { 72 {
@@ -75,7 +74,7 @@ namespace OpenSim.Framework
75 set { m_BillableFactor = value; } 74 set { m_BillableFactor = value; }
76 } 75 }
77 76
78 private int m_PricePerMeter; 77 private int m_PricePerMeter = 1;
79 78
80 public int PricePerMeter 79 public int PricePerMeter
81 { 80 {
@@ -83,7 +82,7 @@ namespace OpenSim.Framework
83 set { m_PricePerMeter = value; } 82 set { m_PricePerMeter = value; }
84 } 83 }
85 84
86 private int m_RedirectGridX; 85 private int m_RedirectGridX = 0;
87 86
88 public int RedirectGridX 87 public int RedirectGridX
89 { 88 {
@@ -91,7 +90,7 @@ namespace OpenSim.Framework
91 set { m_RedirectGridX = value; } 90 set { m_RedirectGridX = value; }
92 } 91 }
93 92
94 private int m_RedirectGridY; 93 private int m_RedirectGridY = 0;
95 94
96 public int RedirectGridY 95 public int RedirectGridY
97 { 96 {
@@ -273,25 +272,6 @@ namespace OpenSim.Framework
273 272
274 public EstateSettings() 273 public EstateSettings()
275 { 274 {
276 if (configMember == null)
277 {
278 try
279 {
280 // Load legacy defaults
281 //
282 configMember =
283 new ConfigurationMember(Path.Combine(Util.configDir(),
284 "estate_settings.xml"), "ESTATE SETTINGS",
285 loadConfigurationOptions,
286 handleIncomingConfiguration, true);
287
288 l_EstateManagers.Clear();
289 configMember.performConfigurationRetrieve();
290 }
291 catch (Exception)
292 {
293 }
294 }
295 } 275 }
296 276
297 public void Save() 277 public void Save()
@@ -393,165 +373,5 @@ namespace OpenSim.Framework
393 373
394 return l_EstateAccess.Contains(user); 374 return l_EstateAccess.Contains(user);
395 } 375 }
396
397 public void loadConfigurationOptions()
398 {
399 configMember.addConfigurationOption("billable_factor",
400 ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
401 String.Empty, "0.0", true);
402
403// configMember.addConfigurationOption("estate_id",
404// ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
405// String.Empty, "100", true);
406
407// configMember.addConfigurationOption("parent_estate_id",
408// ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
409// String.Empty, "1", true);
410
411 configMember.addConfigurationOption("redirect_grid_x",
412 ConfigurationOption.ConfigurationTypes.TYPE_INT32,
413 String.Empty, "0", true);
414
415 configMember.addConfigurationOption("redirect_grid_y",
416 ConfigurationOption.ConfigurationTypes.TYPE_INT32,
417 String.Empty, "0", true);
418
419 configMember.addConfigurationOption("price_per_meter",
420 ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
421 String.Empty, "1", true);
422
423 configMember.addConfigurationOption("estate_name",
424 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
425 String.Empty, "My Estate", true);
426
427 configMember.addConfigurationOption("estate_manager_0",
428 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
429 String.Empty, "00000000-0000-0000-0000-000000000000", true);
430
431 configMember.addConfigurationOption("estate_manager_1",
432 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
433 String.Empty, "00000000-0000-0000-0000-000000000000", true);
434
435 configMember.addConfigurationOption("estate_manager_2",
436 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
437 String.Empty, "00000000-0000-0000-0000-000000000000", true);
438
439 configMember.addConfigurationOption("estate_manager_3",
440 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
441 String.Empty, "00000000-0000-0000-0000-000000000000", true);
442
443 configMember.addConfigurationOption("estate_manager_4",
444 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
445 String.Empty, "00000000-0000-0000-0000-000000000000", true);
446
447 configMember.addConfigurationOption("estate_manager_5",
448 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
449 String.Empty, "00000000-0000-0000-0000-000000000000", true);
450
451 configMember.addConfigurationOption("estate_manager_6",
452 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
453 String.Empty, "00000000-0000-0000-0000-000000000000", true);
454
455 configMember.addConfigurationOption("estate_manager_7",
456 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
457 String.Empty, "00000000-0000-0000-0000-000000000000", true);
458
459 configMember.addConfigurationOption("estate_manager_8",
460 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
461 String.Empty, "00000000-0000-0000-0000-000000000000", true);
462
463 configMember.addConfigurationOption("estate_manager_9",
464 ConfigurationOption.ConfigurationTypes.TYPE_UUID,
465 String.Empty, "00000000-0000-0000-0000-000000000000", true);
466
467 configMember.addConfigurationOption("region_flags",
468 ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
469 String.Empty, "336723974", true);
470 }
471
472 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
473 {
474 switch (configuration_key)
475 {
476 case "region_flags":
477 RegionFlags flags = (RegionFlags)(uint)configuration_result;
478 if ((flags & (RegionFlags)(1<<29)) != 0)
479 m_AllowVoice = true;
480 if ((flags & RegionFlags.AllowDirectTeleport) != 0)
481 m_AllowDirectTeleport = true;
482 if ((flags & RegionFlags.DenyAnonymous) != 0)
483 m_DenyAnonymous = true;
484 if ((flags & RegionFlags.DenyIdentified) != 0)
485 m_DenyIdentified = true;
486 if ((flags & RegionFlags.DenyTransacted) != 0)
487 m_DenyTransacted = true;
488 if ((flags & RegionFlags.AbuseEmailToEstateOwner) != 0)
489 m_AbuseEmailToEstateOwner = true;
490 if ((flags & RegionFlags.BlockDwell) != 0)
491 m_BlockDwell = true;
492 if ((flags & RegionFlags.EstateSkipScripts) != 0)
493 m_EstateSkipScripts = true;
494 if ((flags & RegionFlags.ResetHomeOnTeleport) != 0)
495 m_ResetHomeOnTeleport = true;
496 if ((flags & RegionFlags.TaxFree) != 0)
497 m_TaxFree = true;
498 if ((flags & RegionFlags.PublicAllowed) != 0)
499 m_PublicAccess = true;
500 break;
501 case "billable_factor":
502 m_BillableFactor = (float) configuration_result;
503 break;
504// case "estate_id":
505// m_EstateID = (uint) configuration_result;
506// break;
507// case "parent_estate_id":
508// m_ParentEstateID = (uint) configuration_result;
509// break;
510 case "redirect_grid_x":
511 m_RedirectGridX = (int) configuration_result;
512 break;
513 case "redirect_grid_y":
514 m_RedirectGridY = (int) configuration_result;
515 break;
516 case "price_per_meter":
517 m_PricePerMeter = Convert.ToInt32(configuration_result);
518 break;
519 case "estate_name":
520 m_EstateName = (string) configuration_result;
521 break;
522 case "estate_manager_0":
523 AddEstateManager((UUID)configuration_result);
524 break;
525 case "estate_manager_1":
526 AddEstateManager((UUID)configuration_result);
527 break;
528 case "estate_manager_2":
529 AddEstateManager((UUID)configuration_result);
530 break;
531 case "estate_manager_3":
532 AddEstateManager((UUID)configuration_result);
533 break;
534 case "estate_manager_4":
535 AddEstateManager((UUID)configuration_result);
536 break;
537 case "estate_manager_5":
538 AddEstateManager((UUID)configuration_result);
539 break;
540 case "estate_manager_6":
541 AddEstateManager((UUID)configuration_result);
542 break;
543 case "estate_manager_7":
544 AddEstateManager((UUID)configuration_result);
545 break;
546 case "estate_manager_8":
547 AddEstateManager((UUID)configuration_result);
548 break;
549 case "estate_manager_9":
550 AddEstateManager((UUID)configuration_result);
551 break;
552 }
553
554 return true;
555 }
556 } 376 }
557} 377}