|
|
@ -127,15 +127,13 @@ public class dbMobHandler extends dbHandlerBase { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean ADD_TO_GUARDS(final long captainUID, final int mobBaseID, final String name, final int slot) { |
|
|
|
public boolean ADD_TO_GUARDS(final long captainUID, final String name) { |
|
|
|
|
|
|
|
|
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_guards` (`captainUID`, `mobBaseID`,`name`, `slot`) VALUES (?,?,?,?)")) { |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_guards` (`captainUID`, `name`) VALUES (?,?)")) { |
|
|
|
|
|
|
|
|
|
|
|
preparedStatement.setLong(1, captainUID); |
|
|
|
preparedStatement.setLong(1, captainUID); |
|
|
|
preparedStatement.setInt(2, mobBaseID); |
|
|
|
preparedStatement.setString(2, name); |
|
|
|
preparedStatement.setString(3, name); |
|
|
|
|
|
|
|
preparedStatement.setInt(4, slot); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (preparedStatement.executeUpdate() > 0); |
|
|
|
return (preparedStatement.executeUpdate() > 0); |
|
|
|
|
|
|
|
|
|
|
@ -145,14 +143,13 @@ public class dbMobHandler extends dbHandlerBase { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean REMOVE_FROM_GUARDS(final long captainUID, final int mobBaseID, final int slot) { |
|
|
|
public boolean REMOVE_FROM_GUARDS(final long captainUID, final String minionName) { |
|
|
|
|
|
|
|
|
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM `dyn_guards` WHERE `captainUID`=? AND `mobBaseID`=? AND `slot` =?")) { |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM `dyn_guards` WHERE `captainUID`=? AND `minionName`=? LIMIT 1;")) { |
|
|
|
|
|
|
|
|
|
|
|
preparedStatement.setLong(1, captainUID); |
|
|
|
preparedStatement.setLong(1, captainUID); |
|
|
|
preparedStatement.setInt(2, mobBaseID); |
|
|
|
preparedStatement.setString(2, minionName); |
|
|
|
preparedStatement.setInt(3, slot); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (preparedStatement.executeUpdate() > 0); |
|
|
|
return (preparedStatement.executeUpdate() > 0); |
|
|
|
|
|
|
|
|
|
|
|