mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Add my friends category to my world in navigator
This commit is contained in:
parent
5943d1f060
commit
ae555d29fb
@ -153,6 +153,9 @@ public class NavigatorManager {
|
|||||||
case "categories":
|
case "categories":
|
||||||
rooms = Emulator.getGameEnvironment().getRoomManager().getRoomsPromoted();
|
rooms = Emulator.getGameEnvironment().getRoomManager().getRoomsPromoted();
|
||||||
break;
|
break;
|
||||||
|
case "with_friends":
|
||||||
|
rooms = Emulator.getGameEnvironment().getRoomManager().getRoomsWithFriendsIn(habbo, 25);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,12 @@ public class NavigatorUserFilter extends NavigatorFilter {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Room> friendRooms = Emulator.getGameEnvironment().getNavigatorManager().getRoomsForCategory("with_friends", habbo);
|
||||||
|
if (!friendRooms.isEmpty()) {
|
||||||
|
resultLists.add(new SearchResultList(i, "with_friends", "", SearchAction.NONE, habbo.getHabboStats().navigatorWindowSettings.getListModeForCategory("with_friends"), habbo.getHabboStats().navigatorWindowSettings.getDisplayModeForCategory("with_friends"), friendRooms, true, true, DisplayOrder.ORDER_NUM, i));
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
List<Room> rightRooms = Emulator.getGameEnvironment().getNavigatorManager().getRoomsForCategory("with_rights", habbo);
|
List<Room> rightRooms = Emulator.getGameEnvironment().getNavigatorManager().getRoomsForCategory("with_rights", habbo);
|
||||||
if (!rightRooms.isEmpty()) {
|
if (!rightRooms.isEmpty()) {
|
||||||
resultLists.add(new SearchResultList(i, "with_rights", "", SearchAction.NONE, habbo.getHabboStats().navigatorWindowSettings.getListModeForCategory("with_rights"), habbo.getHabboStats().navigatorWindowSettings.getDisplayModeForCategory("with_rights"), rightRooms, true, true, DisplayOrder.ORDER_NUM, i));
|
resultLists.add(new SearchResultList(i, "with_rights", "", SearchAction.NONE, habbo.getHabboStats().navigatorWindowSettings.getListModeForCategory("with_rights"), habbo.getHabboStats().navigatorWindowSettings.getDisplayModeForCategory("with_rights"), rightRooms, true, true, DisplayOrder.ORDER_NUM, i));
|
||||||
|
@ -54,6 +54,7 @@ import gnu.trove.set.hash.THashSet;
|
|||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class RoomManager {
|
public class RoomManager {
|
||||||
private static final int page = 0;
|
private static final int page = 0;
|
||||||
@ -1271,6 +1272,25 @@ public class RoomManager {
|
|||||||
return rooms;
|
return rooms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<Room> getRoomsWithFriendsIn(Habbo habbo, int limit) {
|
||||||
|
final ArrayList<Room> rooms = new ArrayList<>();
|
||||||
|
|
||||||
|
for (MessengerBuddy buddy : habbo.getMessenger().getFriends().values()) {
|
||||||
|
Habbo friend = Emulator.getGameEnvironment().getHabboManager().getHabbo(buddy.getId());
|
||||||
|
|
||||||
|
if (friend == null || friend.getHabboInfo() == null) continue;
|
||||||
|
|
||||||
|
Room room = friend.getHabboInfo().getCurrentRoom();
|
||||||
|
if (room != null) rooms.add(room);
|
||||||
|
|
||||||
|
if (rooms.size() >= limit) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Collections.sort(rooms);
|
||||||
|
|
||||||
|
return rooms;
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<Room> getRoomsWithAdminRights(Habbo habbo) {
|
public ArrayList<Room> getRoomsWithAdminRights(Habbo habbo) {
|
||||||
ArrayList<Room> rooms = new ArrayList<>();
|
ArrayList<Room> rooms = new ArrayList<>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user