aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/EstateSettings.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/EstateSettings.cs')
-rw-r--r--OpenSim/Framework/EstateSettings.cs43
1 files changed, 35 insertions, 8 deletions
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index 7134cbf..8c8270a 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -572,14 +572,41 @@ namespace OpenSim.Framework
572 572
573 // EstateBans are special 573 // EstateBans are special
574 if (map.ContainsKey("EstateBans")) 574 if (map.ContainsKey("EstateBans"))
575 { 575 {
576 var banData = ((Dictionary<string, object>)map["EstateBans"]).Values; 576 if(map["EstateBans"] is string)
577 EstateBan[] bans = new EstateBan[banData.Count]; 577 {
578 int b = 0; 578 // JSON encoded bans map
579 foreach (Dictionary<string, object> ban in banData) 579 Dictionary<string, EstateBan> bdata = new Dictionary<string, EstateBan>();
580 bans[b++] = new EstateBan(ban); 580 try
581 PropertyInfo bansProperty = this.GetType().GetProperty("EstateBans", BindingFlags.Public | BindingFlags.Instance); 581 {
582 bansProperty.SetValue(this, bans, null); 582 // bypass libovm, we dont need even more useless high level maps
583 // this should only be called once.. but no problem, i hope
584 // (other uses may need more..)
585 LitJson.JsonMapper.RegisterImporter<string, UUID>((input) => new UUID(input));
586 bdata = LitJson.JsonMapper.ToObject<Dictionary<string,EstateBan>>((string)map["EstateBans"]);
587 }
588 // catch(Exception e)
589 catch
590 {
591 return;
592 }
593 EstateBan[] jbans = new EstateBan[bdata.Count];
594 bdata.Values.CopyTo(jbans,0);
595
596 PropertyInfo jbansProperty = this.GetType().GetProperty("EstateBans", BindingFlags.Public | BindingFlags.Instance);
597 jbansProperty.SetValue(this, jbans, null);
598 }
599 else
600 {
601 var banData = ((Dictionary<string, object>)map["EstateBans"]).Values;
602 EstateBan[] bans = new EstateBan[banData.Count];
603
604 int b = 0;
605 foreach (Dictionary<string, object> ban in banData)
606 bans[b++] = new EstateBan(ban);
607 PropertyInfo bansProperty = this.GetType().GetProperty("EstateBans", BindingFlags.Public | BindingFlags.Instance);
608 bansProperty.SetValue(this, bans, null);
609 }
583 } 610 }
584 } 611 }
585 } 612 }