aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/EstateSettings.cs31
1 files changed, 19 insertions, 12 deletions
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index 328fca4..4df7860 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -443,11 +443,15 @@ namespace OpenSim.Framework
443 } 443 }
444 444
445 // EstateBans are special 445 // EstateBans are special
446 Dictionary<string, object> bans = new Dictionary<string, object>(); 446 if (EstateBans.Length > 0)
447 int i = 0; 447 {
448 foreach (EstateBan ban in EstateBans) 448 Dictionary<string, object> bans = new Dictionary<string, object>();
449 bans["ban" + i++] = ban.ToMap(); 449 int i = 0;
450 map["EstateBans"] = bans; 450 foreach (EstateBan ban in EstateBans)
451 bans["ban" + i++] = ban.ToMap();
452 map["EstateBans"] = bans;
453 }
454
451 return map; 455 return map;
452 } 456 }
453 457
@@ -511,13 +515,16 @@ namespace OpenSim.Framework
511 } 515 }
512 516
513 // EstateBans are special 517 // EstateBans are special
514 var banData = ((Dictionary<string, object>)map["EstateBans"]).Values; 518 if (map.ContainsKey("EstateBans"))
515 EstateBan[] bans = new EstateBan[banData.Count]; 519 {
516 int b = 0; 520 var banData = ((Dictionary<string, object>)map["EstateBans"]).Values;
517 foreach (Dictionary<string, object> ban in banData) 521 EstateBan[] bans = new EstateBan[banData.Count];
518 bans[b++] = new EstateBan(ban); 522 int b = 0;
519 PropertyInfo bansProperty = this.GetType().GetProperty("EstateBans", BindingFlags.Public | BindingFlags.Instance); 523 foreach (Dictionary<string, object> ban in banData)
520 bansProperty.SetValue(this, bans, null); 524 bans[b++] = new EstateBan(ban);
525 PropertyInfo bansProperty = this.GetType().GetProperty("EstateBans", BindingFlags.Public | BindingFlags.Instance);
526 bansProperty.SetValue(this, bans, null);
527 }
521 } 528 }
522 } 529 }
523} 530}