GMs can now get the accountId of the target (getplayerid)

This commit is contained in:
Waverunner
2014-04-06 17:42:08 -04:00
parent 87db82f6fa
commit 494bd4a8ad
3 changed files with 33 additions and 18 deletions
+19 -1
View File
@@ -564,7 +564,25 @@ public class CharacterService implements INetworkDispatch {
return false;
}
/**
* Checks the database for the Account ID associated with the Object ID.
* Intended for GM use only!
* @param objectId Object ID of the player, used to obtain the Account ID.
* @return Returns Account ID
*/
public int getAccountId(long objectId) {
try {
PreparedStatement ps = databaseConnection.preparedStatement("SELECT * FROM characters WHERE id=?");
ps.setLong(1, objectId);
ResultSet resultSet = ps.executeQuery();
resultSet.next();
return resultSet.getInt("accountId");
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}
private void createStarterClothing(CreatureObject creature, String raceTemplate, String profession) {
try {
ProfessionTemplateVisitor visitor = ClientFileManager.loadFile("creation/profession_defaults_" + profession + ".iff", ProfessionTemplateVisitor.class);