Methods moved out of old login handler

This commit is contained in:
2024-03-31 10:37:03 -04:00
parent f62f11a66c
commit 4e5e49606c
9 changed files with 88 additions and 100 deletions
+5 -6
View File
@@ -38,7 +38,6 @@ import engine.net.client.msg.login.CommitNewCharacterMsg;
import engine.powers.EffectsBase;
import engine.server.MBServerStatics;
import engine.server.login.LoginServer;
import engine.server.login.LoginServerMsgHandler;
import engine.server.world.WorldServer;
import engine.util.MiscUtils;
import org.joda.time.DateTime;
@@ -740,28 +739,28 @@ public class PlayerCharacter extends AbstractCharacter {
String lastName = msg.getLastName().trim();
if (firstName.length() < 3) {
LoginServerMsgHandler.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_FIRSTNAME_MUST_BE_LONGER,
LoginServer.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,
LoginServer.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,
LoginServer.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,
LoginServer.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_LASTNAME_UNAVAILABLE,
clientConnection);
return null;
}
@@ -1136,7 +1135,7 @@ public class PlayerCharacter extends AbstractCharacter {
// This must be the very last check before calling the
// DB to create the character record
if (DbManager.PlayerCharacterQueries.IS_CHARACTER_NAME_UNIQUE(firstName) == false) {
LoginServerMsgHandler.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_FIRSTNAME_UNAVAILABLE,
LoginServer.sendInvalidNameMsg(firstName, lastName, MBServerStatics.INVALIDNAME_FIRSTNAME_UNAVAILABLE,
clientConnection);
return null;
}