|
|
@ -13,6 +13,7 @@ import engine.Enum; |
|
|
|
import engine.Enum.DbObjectType; |
|
|
|
import engine.Enum.DbObjectType; |
|
|
|
import engine.Enum.ProtectionState; |
|
|
|
import engine.Enum.ProtectionState; |
|
|
|
import engine.Enum.TaxType; |
|
|
|
import engine.Enum.TaxType; |
|
|
|
|
|
|
|
import engine.gameManager.BuildingManager; |
|
|
|
import engine.gameManager.DbManager; |
|
|
|
import engine.gameManager.DbManager; |
|
|
|
import engine.math.Vector3fImmutable; |
|
|
|
import engine.math.Vector3fImmutable; |
|
|
|
import engine.objects.*; |
|
|
|
import engine.objects.*; |
|
|
@ -423,6 +424,34 @@ public class dbBuildingHandler extends dbHandlerBase { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void LOAD_BUILDING_FRIENDS() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
|
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_building_friends`")) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ResultSet rs = preparedStatement.executeQuery(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (rs.next()) { |
|
|
|
|
|
|
|
BuildingFriends friend = new BuildingFriends(rs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (friend.friendType) { |
|
|
|
|
|
|
|
case 7: |
|
|
|
|
|
|
|
BuildingManager._buildingFriends.get(friend.buildingUID).put(friend.playerUID, friend); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 8: |
|
|
|
|
|
|
|
case 9: |
|
|
|
|
|
|
|
BuildingManager._buildingFriends.get(friend.buildingUID).put(friend.guildUID, friend); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
|
|
|
Logger.error(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void LOAD_ALL_FRIENDS_FOR_BUILDING(Building building) { |
|
|
|
public void LOAD_ALL_FRIENDS_FOR_BUILDING(Building building) { |
|
|
|
|
|
|
|
|
|
|
|
if (building == null) |
|
|
|
if (building == null) |
|
|
@ -436,13 +465,13 @@ public class dbBuildingHandler extends dbHandlerBase { |
|
|
|
|
|
|
|
|
|
|
|
while (rs.next()) { |
|
|
|
while (rs.next()) { |
|
|
|
BuildingFriends friend = new BuildingFriends(rs); |
|
|
|
BuildingFriends friend = new BuildingFriends(rs); |
|
|
|
switch (friend.getFriendType()) { |
|
|
|
switch (friend.friendType) { |
|
|
|
case 7: |
|
|
|
case 7: |
|
|
|
building.getFriends().put(friend.getPlayerUID(), friend); |
|
|
|
building.getFriends().put(friend.playerUID, friend); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 8: |
|
|
|
case 8: |
|
|
|
case 9: |
|
|
|
case 9: |
|
|
|
building.getFriends().put(friend.getGuildUID(), friend); |
|
|
|
building.getFriends().put(friend.guildUID, friend); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|