diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 79 |
1 files changed, 55 insertions, 24 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index db6c26f..96f3049 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -143,6 +143,8 @@ namespace OpenSim.Framework | |||
143 | public string RemotingAddress; | 143 | public string RemotingAddress; |
144 | public UUID ScopeID = UUID.Zero; | 144 | public UUID ScopeID = UUID.Zero; |
145 | 145 | ||
146 | private Dictionary<String, String> m_otherSettings = new Dictionary<string, string>(); | ||
147 | |||
146 | 148 | ||
147 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. | 149 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. |
148 | 150 | ||
@@ -445,6 +447,18 @@ namespace OpenSim.Framework | |||
445 | m_internalEndPoint = tmpEPE; | 447 | m_internalEndPoint = tmpEPE; |
446 | } | 448 | } |
447 | 449 | ||
450 | public string GetOtherSetting(string key) | ||
451 | { | ||
452 | string val; | ||
453 | m_otherSettings.TryGetValue(key, out val); | ||
454 | return val; | ||
455 | } | ||
456 | |||
457 | public void SetOtherSetting(string key, string value) | ||
458 | { | ||
459 | m_otherSettings[key] = value; | ||
460 | } | ||
461 | |||
448 | private void ReadNiniConfig(IConfigSource source, string name) | 462 | private void ReadNiniConfig(IConfigSource source, string name) |
449 | { | 463 | { |
450 | // bool creatingNew = false; | 464 | // bool creatingNew = false; |
@@ -473,30 +487,39 @@ namespace OpenSim.Framework | |||
473 | if (source.Configs[name] == null) | 487 | if (source.Configs[name] == null) |
474 | { | 488 | { |
475 | source.AddConfig(name); | 489 | source.AddConfig(name); |
476 | |||
477 | // creatingNew = true; | ||
478 | } | 490 | } |
479 | 491 | ||
492 | RegionName = name; | ||
480 | IConfig config = source.Configs[name]; | 493 | IConfig config = source.Configs[name]; |
481 | 494 | ||
482 | // UUID | 495 | // Track all of the keys in this config and remove as they are processed |
496 | // The remaining keys will be added to generic key-value storage for | ||
497 | // whoever might need it | ||
498 | HashSet<String> allKeys = new HashSet<String>(); | ||
499 | foreach (string s in config.GetKeys()) | ||
500 | { | ||
501 | allKeys.Add(s.ToLower()); | ||
502 | } | ||
503 | |||
504 | // RegionUUID | ||
483 | // | 505 | // |
506 | allKeys.Remove(("RegionUUID").ToLower()); | ||
484 | string regionUUID = config.GetString("RegionUUID", string.Empty); | 507 | string regionUUID = config.GetString("RegionUUID", string.Empty); |
485 | |||
486 | if (regionUUID == String.Empty) | 508 | if (regionUUID == String.Empty) |
487 | { | 509 | { |
488 | UUID newID = UUID.Random(); | 510 | UUID newID = UUID.Random(); |
489 | 511 | ||
490 | regionUUID = MainConsole.Instance.CmdPrompt("Region UUID", newID.ToString()); | 512 | regionUUID = MainConsole.Instance.CmdPrompt("RegionUUID", newID.ToString()); |
491 | config.Set("RegionUUID", regionUUID); | 513 | config.Set("RegionUUID", regionUUID); |
492 | } | 514 | } |
493 | 515 | ||
494 | RegionID = new UUID(regionUUID); | 516 | RegionID = new UUID(regionUUID); |
495 | originRegionID = RegionID; // What IS this?! | 517 | originRegionID = RegionID; // What IS this?! (Needed for RegionCombinerModule?) |
496 | 518 | ||
497 | RegionName = name; | 519 | // Location |
520 | // | ||
521 | allKeys.Remove(("Location").ToLower()); | ||
498 | string location = config.GetString("Location", String.Empty); | 522 | string location = config.GetString("Location", String.Empty); |
499 | |||
500 | if (location == String.Empty) | 523 | if (location == String.Empty) |
501 | { | 524 | { |
502 | location = MainConsole.Instance.CmdPrompt("Region Location", "1000,1000"); | 525 | location = MainConsole.Instance.CmdPrompt("Region Location", "1000,1000"); |
@@ -508,13 +531,10 @@ namespace OpenSim.Framework | |||
508 | m_regionLocX = Convert.ToUInt32(locationElements[0]); | 531 | m_regionLocX = Convert.ToUInt32(locationElements[0]); |
509 | m_regionLocY = Convert.ToUInt32(locationElements[1]); | 532 | m_regionLocY = Convert.ToUInt32(locationElements[1]); |
510 | 533 | ||
511 | 534 | // InternalAddress | |
512 | // Datastore (is this implemented? Omitted from example!) | 535 | // |
513 | DataStore = config.GetString("Datastore", String.Empty); | ||
514 | |||
515 | // Internal IP | ||
516 | IPAddress address; | 536 | IPAddress address; |
517 | 537 | allKeys.Remove(("InternalAddress").ToLower()); | |
518 | if (config.Contains("InternalAddress")) | 538 | if (config.Contains("InternalAddress")) |
519 | { | 539 | { |
520 | address = IPAddress.Parse(config.GetString("InternalAddress", String.Empty)); | 540 | address = IPAddress.Parse(config.GetString("InternalAddress", String.Empty)); |
@@ -525,8 +545,10 @@ namespace OpenSim.Framework | |||
525 | config.Set("InternalAddress", address.ToString()); | 545 | config.Set("InternalAddress", address.ToString()); |
526 | } | 546 | } |
527 | 547 | ||
548 | // InternalPort | ||
549 | // | ||
528 | int port; | 550 | int port; |
529 | 551 | allKeys.Remove(("InternalPort").ToLower()); | |
530 | if (config.Contains("InternalPort")) | 552 | if (config.Contains("InternalPort")) |
531 | { | 553 | { |
532 | port = config.GetInt("InternalPort", 9000); | 554 | port = config.GetInt("InternalPort", 9000); |
@@ -536,9 +558,11 @@ namespace OpenSim.Framework | |||
536 | port = Convert.ToInt32(MainConsole.Instance.CmdPrompt("Internal port", "9000")); | 558 | port = Convert.ToInt32(MainConsole.Instance.CmdPrompt("Internal port", "9000")); |
537 | config.Set("InternalPort", port); | 559 | config.Set("InternalPort", port); |
538 | } | 560 | } |
539 | |||
540 | m_internalEndPoint = new IPEndPoint(address, port); | 561 | m_internalEndPoint = new IPEndPoint(address, port); |
541 | 562 | ||
563 | // AllowAlternatePorts | ||
564 | // | ||
565 | allKeys.Remove(("AllowAlternatePorts").ToLower()); | ||
542 | if (config.Contains("AllowAlternatePorts")) | 566 | if (config.Contains("AllowAlternatePorts")) |
543 | { | 567 | { |
544 | m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true); | 568 | m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true); |
@@ -550,10 +574,10 @@ namespace OpenSim.Framework | |||
550 | config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString()); | 574 | config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString()); |
551 | } | 575 | } |
552 | 576 | ||
553 | // External IP | 577 | // ExternalHostName |
554 | // | 578 | // |
579 | allKeys.Remove(("ExternalHostName").ToLower()); | ||
555 | string externalName; | 580 | string externalName; |
556 | |||
557 | if (config.Contains("ExternalHostName")) | 581 | if (config.Contains("ExternalHostName")) |
558 | { | 582 | { |
559 | externalName = config.GetString("ExternalHostName", "SYSTEMIP"); | 583 | externalName = config.GetString("ExternalHostName", "SYSTEMIP"); |
@@ -563,7 +587,6 @@ namespace OpenSim.Framework | |||
563 | externalName = MainConsole.Instance.CmdPrompt("External host name", "SYSTEMIP"); | 587 | externalName = MainConsole.Instance.CmdPrompt("External host name", "SYSTEMIP"); |
564 | config.Set("ExternalHostName", externalName); | 588 | config.Set("ExternalHostName", externalName); |
565 | } | 589 | } |
566 | |||
567 | if (externalName == "SYSTEMIP") | 590 | if (externalName == "SYSTEMIP") |
568 | { | 591 | { |
569 | m_externalHostName = Util.GetLocalHost().ToString(); | 592 | m_externalHostName = Util.GetLocalHost().ToString(); |
@@ -576,24 +599,32 @@ namespace OpenSim.Framework | |||
576 | m_externalHostName = externalName; | 599 | m_externalHostName = externalName; |
577 | } | 600 | } |
578 | 601 | ||
602 | // RegionType | ||
579 | m_regionType = config.GetString("RegionType", String.Empty); | 603 | m_regionType = config.GetString("RegionType", String.Empty); |
604 | allKeys.Remove(("RegionType").ToLower()); | ||
580 | 605 | ||
581 | // Prim stuff | 606 | // Prim stuff |
582 | // | 607 | // |
583 | m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 256); | 608 | m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 256); |
584 | 609 | allKeys.Remove(("NonphysicalPrimMax").ToLower()); | |
585 | m_physPrimMax = config.GetInt("PhysicalPrimMax", 10); | 610 | m_physPrimMax = config.GetInt("PhysicalPrimMax", 10); |
586 | 611 | allKeys.Remove(("PhysicalPrimMax").ToLower()); | |
587 | m_clampPrimSize = config.GetBoolean("ClampPrimSize", false); | 612 | m_clampPrimSize = config.GetBoolean("ClampPrimSize", false); |
588 | 613 | allKeys.Remove(("ClampPrimSize").ToLower()); | |
589 | m_objectCapacity = config.GetInt("MaxPrims", 15000); | 614 | m_objectCapacity = config.GetInt("MaxPrims", 15000); |
590 | 615 | allKeys.Remove(("MaxPrims").ToLower()); | |
591 | m_agentCapacity = config.GetInt("MaxAgents", 100); | 616 | m_agentCapacity = config.GetInt("MaxAgents", 100); |
592 | 617 | allKeys.Remove(("MaxAgents").ToLower()); | |
593 | 618 | ||
594 | // Multi-tenancy | 619 | // Multi-tenancy |
595 | // | 620 | // |
596 | ScopeID = new UUID(config.GetString("ScopeID", UUID.Zero.ToString())); | 621 | ScopeID = new UUID(config.GetString("ScopeID", UUID.Zero.ToString())); |
622 | allKeys.Remove(("ScopeID").ToLower()); | ||
623 | |||
624 | foreach (String s in allKeys) | ||
625 | { | ||
626 | m_otherSettings.Add(s, config.GetString(s)); | ||
627 | } | ||
597 | } | 628 | } |
598 | 629 | ||
599 | private void WriteNiniConfig(IConfigSource source) | 630 | private void WriteNiniConfig(IConfigSource source) |