|
|
@ -20,7 +20,6 @@ import java.sql.Connection; |
|
|
|
import java.sql.PreparedStatement; |
|
|
|
import java.sql.PreparedStatement; |
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class dbContractHandler extends dbHandlerBase { |
|
|
|
public class dbContractHandler extends dbHandlerBase { |
|
|
|
|
|
|
|
|
|
|
@ -29,24 +28,6 @@ public class dbContractHandler extends dbHandlerBase { |
|
|
|
this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName()); |
|
|
|
this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void UPDATE_CONTRACTS() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Contract> contracts = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
|
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_contract`;")) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ResultSet rs = preparedStatement.executeQuery(); |
|
|
|
|
|
|
|
contracts = getObjectsFromRs(rs, 1000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
|
|
|
Logger.error(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Contract contract : contracts) |
|
|
|
|
|
|
|
DbManager.ContractQueries.updateAllowedBuildings(contract); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Contract GET_CONTRACT(final int objectUUID) { |
|
|
|
public Contract GET_CONTRACT(final int objectUUID) { |
|
|
|
|
|
|
|
|
|
|
|
Contract contract = (Contract) DbManager.getFromCache(mbEnums.GameObjectType.Contract, objectUUID); |
|
|
|
Contract contract = (Contract) DbManager.getFromCache(mbEnums.GameObjectType.Contract, objectUUID); |
|
|
|