mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
add parameter to sql back
This commit is contained in:
parent
c638e60936
commit
c0e718ec92
@ -14,6 +14,7 @@ import com.eu.habbo.habbohotel.games.wired.WiredGame;
|
||||
import com.eu.habbo.habbohotel.guilds.Guild;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionWired;
|
||||
import com.eu.habbo.habbohotel.messenger.MessengerBuddy;
|
||||
import com.eu.habbo.habbohotel.navigation.NavigatorFilterComparator;
|
||||
import com.eu.habbo.habbohotel.navigation.NavigatorFilterField;
|
||||
import com.eu.habbo.habbohotel.navigation.NavigatorManager;
|
||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||
@ -152,6 +153,7 @@ public class RoomManager {
|
||||
THashMap<Integer, List<Room>> rooms = new THashMap<>();
|
||||
String query = filterField.getDatabaseQuery() + " AND rooms.state NOT LIKE " + (showInvisible ? "''" : "'invisible'") + (category >= 0 ? "AND rooms.category = '" + category + "'" : "") + " ORDER BY rooms.users, rooms.id DESC LIMIT " + NavigatorManager.MAXIMUM_RESULTS_PER_PAGE;
|
||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement(query)) {
|
||||
statement.setString(1, (filterField.getComparator() == NavigatorFilterComparator.EQUALS ? value : "%" + value + "%"));
|
||||
try (ResultSet set = statement.executeQuery()) {
|
||||
while (set.next()) {
|
||||
Room room = this.activeRooms.get(set.getInt("id"));
|
||||
|
Loading…
Reference in New Issue
Block a user