Add safe-usermap-names option to control usermap key sanitisation

This is necessary to stop players with Chinese characters in their username losing their balances.
This commit is contained in:
md678685 2019-05-30 18:50:51 +01:00
parent e9833d1cd2
commit c97918df24
4 changed files with 25 additions and 7 deletions

View file

@ -543,6 +543,7 @@ public class Settings implements net.ess3.api.ISettings {
itemDbType = _getItemDbType();
forceEnableRecipe = _isForceEnableRecipe();
allowOldIdSigns = _allowOldIdSigns();
isSafeUsermap = _isSafeUsermap();
}
void _lateLoadItemSpawnBlacklist() {
@ -1540,4 +1541,15 @@ public class Settings implements net.ess3.api.ISettings {
public boolean allowOldIdSigns() {
return allowOldIdSigns;
}
private boolean isSafeUsermap;
private boolean _isSafeUsermap() {
return config.getBoolean("safe-usermap-names", true);
}
@Override
public boolean isSafeUsermap() {
return isSafeUsermap;
}
}