You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 15:36:17 +00:00
🆙 Fix in habbomanager
The getCloneAccounts query had an operator-precedence bug: WHERE ip_register = ? OR ip_current = ? AND id != ? -- parsed as: WHERE ip_register = ? OR (ip_current = ? AND id != ?) So a user whose ip_register matched themselves would show up in their own clone list. Added parentheses: WHERE (ip_register = ? OR ip_current = ?) AND id != ? So please run the 006_HabboManager_fix before you run the update Emulator !
This commit is contained in:
@@ -198,7 +198,7 @@ public class HabboManager {
|
||||
public ArrayList<HabboInfo> getCloneAccounts(Habbo habbo, int limit) {
|
||||
ArrayList<HabboInfo> habboInfo = new ArrayList<>();
|
||||
|
||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM users WHERE ip_register = ? OR ip_current = ? AND id != ? ORDER BY id DESC LIMIT ?")) {
|
||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM users WHERE (ip_register = ? OR ip_current = ?) AND id != ? ORDER BY id DESC LIMIT ?")) {
|
||||
statement.setString(1, habbo.getHabboInfo().getIpRegister());
|
||||
statement.setString(2, habbo.getHabboInfo().getIpLogin());
|
||||
statement.setInt(3, habbo.getHabboInfo().getId());
|
||||
|
||||
Reference in New Issue
Block a user