diff --git a/src/engine/db/handlers/dbPlayerCharacterHandler.java b/src/engine/db/handlers/dbPlayerCharacterHandler.java index 505c5e1f..59b48a78 100644 --- a/src/engine/db/handlers/dbPlayerCharacterHandler.java +++ b/src/engine/db/handlers/dbPlayerCharacterHandler.java @@ -52,7 +52,7 @@ public class dbPlayerCharacterHandler extends dbHandlerBase { preparedStatement.setInt(8, toAdd.getConMod()); preparedStatement.setInt(9, toAdd.getIntMod()); preparedStatement.setInt(10, toAdd.getSpiMod()); - preparedStatement.setInt(11, 109350); // auto level 10 + preparedStatement.setInt(11, toAdd.getExp()); preparedStatement.setInt(12, toAdd.getSkinColor()); preparedStatement.setInt(13, toAdd.getHairColor()); preparedStatement.setByte(14, toAdd.getHairStyle()); diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index ec4f41fc..6687683a 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -1260,8 +1260,6 @@ public class PlayerCharacter extends AbstractCharacter { //get level based on experience player.level = (short) Experience.getLevel(player.exp); - if(player.level < 10) - player.setLevel((short)10); player.setHealth(999999f); player.mana.set(999999f); player.stamina.set(999999f); @@ -4801,6 +4799,9 @@ public class PlayerCharacter extends AbstractCharacter { //if(this.isBoxed && this.containsEffect(429611355) == false) {//pathfinding // PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 429611355, 40, false); //} + if(this.isEnteredWorld() && this.isActive() && this.getLevel() < 10){ + this.setLevel((short) 10); + } } catch (Exception e) { Logger.error(e); diff --git a/src/engine/server/login/LoginServerMsgHandler.java b/src/engine/server/login/LoginServerMsgHandler.java index 48bc2158..7102883c 100644 --- a/src/engine/server/login/LoginServerMsgHandler.java +++ b/src/engine/server/login/LoginServerMsgHandler.java @@ -373,6 +373,11 @@ public class LoginServerMsgHandler implements NetMsgHandler { clientConnection); return; } + if (DbManager.PlayerCharacterQueries.IS_CHARACTER_NAME_UNIQUE(firstName) == false) { + LoginServerMsgHandler.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_FIRSTNAME_UNAVAILABLE, + clientConnection); + return; + } PlayerCharacter pc = PlayerCharacter.generatePCFromCommitNewCharacterMsg(session.getAccount(), commitNewCharacterMessage, clientConnection); if (pc == null) {