forked from MagicBane/Server
login crash bug
This commit is contained in:
@@ -753,36 +753,6 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
|
||||
public static PlayerCharacter generatePCFromCommitNewCharacterMsg(Account a, CommitNewCharacterMsg msg, ClientConnection clientConnection) {
|
||||
|
||||
String firstName = msg.getFirstName().trim();
|
||||
String lastName = msg.getLastName().trim();
|
||||
|
||||
if (firstName.length() < 3) {
|
||||
LoginServerMsgHandler.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_FIRSTNAME_MUST_BE_LONGER,
|
||||
clientConnection);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Ensure names are below required length
|
||||
if (firstName.length() > 15 || lastName.length() > 15) {
|
||||
LoginServerMsgHandler.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_FIRSTANDLAST_MUST_BE_SHORTER,
|
||||
clientConnection);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if firstname is valid
|
||||
if (MiscUtils.checkIfFirstNameInvalid(firstName)) {
|
||||
LoginServerMsgHandler.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_PLEASE_CHOOSE_ANOTHER_FIRSTNAME,
|
||||
clientConnection);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if last name is valid
|
||||
if (MiscUtils.checkIfLastNameInvalid(lastName)) {
|
||||
LoginServerMsgHandler.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_LASTNAME_UNAVAILABLE,
|
||||
clientConnection);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Verify Race
|
||||
int raceID = msg.getRace();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user