Commit e03a76f3 authored by Harmony's avatar Harmony

Merge branch 'fix-ban-empty-machine-id' into 'dev'

fix ban behavior for empty machine id/ip address

See merge request !398
parents a1bb93a7 35f81f96
Pipeline #1700 passed with stage
in 15 seconds
......@@ -428,6 +428,16 @@ public class ModToolManager {
return bans;
}
//if machine id is empty, downgrade ban type to IP ban
if( (type == ModToolBanType.MACHINE || type == ModToolBanType.SUPER) && (offlineInfo == null || offlineInfo.getMachineID().isEmpty())) {
type = ModToolBanType.IP;
}
//if ip address is empty, downgrade ban type to account ban
if( (type == ModToolBanType.IP || type == ModToolBanType.SUPER) && (offlineInfo == null || offlineInfo.getIpLogin().isEmpty())) {
type = ModToolBanType.ACCOUNT;
}
ModToolBan ban = new ModToolBan(targetUserId, offlineInfo != null ? offlineInfo.getIpLogin() : "offline", offlineInfo != null ? offlineInfo.getMachineID() : "offline", moderator.getHabboInfo().getId(), Emulator.getIntUnixTimestamp() + duration, reason, type, cfhTopic);
Emulator.getPluginManager().fireEvent(new SupportUserBannedEvent(moderator, target, ban));
Emulator.getThreading().run(ban);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment