diff options
author | UbitUmarov | 2017-12-30 15:28:26 +0000 |
---|---|---|
committer | UbitUmarov | 2017-12-30 15:28:26 +0000 |
commit | 803289877307ce0016627f58af382b68a1905327 (patch) | |
tree | ad7cdd3026322ba20e9c608332c6578909e2d996 /OpenSim/Framework | |
parent | add missing entry on prebuid.xml for mutelist service (diff) | |
download | opensim-SC-803289877307ce0016627f58af382b68a1905327.zip opensim-SC-803289877307ce0016627f58af382b68a1905327.tar.gz opensim-SC-803289877307ce0016627f58af382b68a1905327.tar.bz2 opensim-SC-803289877307ce0016627f58af382b68a1905327.tar.xz |
mantis 8271: work around missing encoding of estate bans on the pseudo url encode used on POST, without changing the xml also used elsewhere. Possible this can be used in other case
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/EstateSettings.cs | 43 |
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 | } |