Browse Source

login crash bug

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
c6c4a128a2
  1. 2
      src/engine/db/handlers/dbPlayerCharacterHandler.java
  2. 5
      src/engine/objects/PlayerCharacter.java
  3. 5
      src/engine/server/login/LoginServerMsgHandler.java

2
src/engine/db/handlers/dbPlayerCharacterHandler.java

@ -52,7 +52,7 @@ public class dbPlayerCharacterHandler extends dbHandlerBase { @@ -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());

5
src/engine/objects/PlayerCharacter.java

@ -1260,8 +1260,6 @@ public class PlayerCharacter extends AbstractCharacter { @@ -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 { @@ -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);

5
src/engine/server/login/LoginServerMsgHandler.java

@ -373,6 +373,11 @@ public class LoginServerMsgHandler implements NetMsgHandler { @@ -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) {

Loading…
Cancel
Save