mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-14 00:02:07 -04:00
Added cleanup method for creature ODB.
This commit is contained in:
@@ -535,6 +535,29 @@ public class CharacterService implements INetworkDispatch {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the database for if the object ID of the player exists.
|
||||
* @param objectId Object ID to check for in the database
|
||||
* @return Returns True if the player exists
|
||||
*/
|
||||
public boolean playerExists(long objectId) {
|
||||
|
||||
try {
|
||||
PreparedStatement ps = databaseConnection.preparedStatement("SELECT id FROM characters WHERE id=?");
|
||||
ps.setLong(1, objectId);
|
||||
ResultSet resultSet = ps.executeQuery();
|
||||
|
||||
boolean isDuplicate = resultSet.next();
|
||||
resultSet.getStatement().close();
|
||||
if (isDuplicate) { return true; }
|
||||
else { return false; }
|
||||
}
|
||||
|
||||
catch (SQLException e) { e.printStackTrace(); }
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private void createStarterClothing(CreatureObject creature, String raceTemplate, String profession) {
|
||||
try {
|
||||
ProfessionTemplateVisitor visitor = ClientFileManager.loadFile("creation/profession_defaults_" + profession + ".iff", ProfessionTemplateVisitor.class);
|
||||
|
||||
Reference in New Issue
Block a user