Re-added respawnATS

This commit is contained in:
bm01
2012-06-12 05:32:56 +02:00
parent 0034226fa7
commit c382c95d24
5 changed files with 36 additions and 13 deletions

View File

@ -462,7 +462,7 @@ public class Combat {
Player defender = (Player) target;
if (defender.getHealth() >= 1) {
if (System.currentTimeMillis() >= Users.getProfile(defender).getRespawnATS() + 5) {
baseXP = 20 * configInstance.getPlayerVersusPlayerXP();
}
}

View File

@ -40,8 +40,9 @@ public class Users {
* Add a new user.
*
* @param player The player to create a user record for
* @return the player's profile
*/
public static void addUser(Player player) {
public static PlayerProfile addUser(Player player) {
String playerName = player.getName();
for (Iterator<PlayerProfile> it = profiles.iterator() ; it.hasNext() ; ) {
@ -50,12 +51,15 @@ public class Users {
if (playerProfile.getPlayerName().equals(playerName)) {
//The player object is different on each reconnection and must be updated
playerProfile.setPlayer(player);
return;
return playerProfile;
}
}
//New player, or already removed from the list
profiles.add(new PlayerProfile(player, true));
PlayerProfile playerProfile = new PlayerProfile(player, true);
profiles.add(playerProfile);
return playerProfile;
}
/**