aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2014-06-01 12:01:49 -0700
committerDiva Canto2014-06-01 12:01:49 -0700
commit14a31c3e9b868cb29c55bcfb6c5b8555bf9aae9f (patch)
tree1a2b6209069fda56a4fabc9cdca889a9e4fb21e4
parentThis may fix mantis #7200, but I am unable to test because I don't have any o... (diff)
downloadopensim-SC-14a31c3e9b868cb29c55bcfb6c5b8555bf9aae9f.zip
opensim-SC-14a31c3e9b868cb29c55bcfb6c5b8555bf9aae9f.tar.gz
opensim-SC-14a31c3e9b868cb29c55bcfb6c5b8555bf9aae9f.tar.bz2
opensim-SC-14a31c3e9b868cb29c55bcfb6c5b8555bf9aae9f.tar.xz
Correct minor bug regarding packing of estate bans
-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}