Browse Source

Load collection from db

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
6fb1e2e5f1
  1. 6
      src/engine/db/handlers/dbBuildingHandler.java

6
src/engine/db/handlers/dbBuildingHandler.java

@ -28,6 +28,7 @@ import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
public class dbBuildingHandler extends dbHandlerBase { public class dbBuildingHandler extends dbHandlerBase {
@ -435,6 +436,11 @@ public class dbBuildingHandler extends dbHandlerBase {
while (rs.next()) { while (rs.next()) {
BuildingFriends friend = new BuildingFriends(rs); BuildingFriends friend = new BuildingFriends(rs);
// Create map if it does not yet exist
if (!BuildingManager._buildingFriends.containsKey(friend.buildingUID))
BuildingManager._buildingFriends.put(friend.buildingUID, new ConcurrentHashMap<>());
switch (friend.friendType) { switch (friend.friendType) {
case 7: case 7:
BuildingManager._buildingFriends.get(friend.buildingUID).put(friend.playerUID, friend); BuildingManager._buildingFriends.get(friend.buildingUID).put(friend.playerUID, friend);

Loading…
Cancel
Save