Use LoginState everywhere
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
package net.server.handlers.login;
|
||||
|
||||
import client.Client;
|
||||
import client.LoginState;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.coordinator.session.SessionCoordinator;
|
||||
@@ -58,7 +59,7 @@ public final class AfterLoginHandler extends AbstractPacketHandler {
|
||||
}
|
||||
} else if (c2 == 0 && c3 == 5) {
|
||||
SessionCoordinator.getInstance().closeSession(c, false);
|
||||
c.updateLoginState(Client.LOGIN_NOTLOGGEDIN);
|
||||
c.updateLoginState(LoginState.NOT_LOGGED_IN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ package net.server.handlers.login;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.DefaultDates;
|
||||
import client.LoginState;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import database.account.Account;
|
||||
@@ -110,7 +111,7 @@ public final class LoginPasswordHandler implements PacketHandler {
|
||||
|
||||
c.setAccount(account);
|
||||
|
||||
if (c.getLoginState(account) > Client.LOGIN_NOTLOGGEDIN) {
|
||||
if (c.getLoginState(account) > LoginState.NOT_LOGGED_IN) {
|
||||
c.sendPacket(PacketCreator.getLoginFailed(7));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package net.server.handlers.login;
|
||||
|
||||
import client.Client;
|
||||
import client.LoginState;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.coordinator.session.SessionCoordinator;
|
||||
@@ -44,7 +45,7 @@ public final class RegisterPinHandler extends AbstractPacketHandler {
|
||||
boolean cancel = p.readByte() == 0;
|
||||
if (cancel) {
|
||||
SessionCoordinator.getInstance().closeSession(c, false);
|
||||
c.updateLoginState(Client.LOGIN_NOTLOGGEDIN);
|
||||
c.updateLoginState(LoginState.NOT_LOGGED_IN);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -54,6 +55,6 @@ public final class RegisterPinHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.pinRegistered());
|
||||
|
||||
SessionCoordinator.getInstance().closeSession(c, false);
|
||||
c.updateLoginState(Client.LOGIN_NOTLOGGEDIN);
|
||||
c.updateLoginState(LoginState.NOT_LOGGED_IN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ package net.server.handlers.login;
|
||||
|
||||
import client.Client;
|
||||
import client.Gender;
|
||||
import client.LoginState;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.Server;
|
||||
@@ -73,7 +74,7 @@ public class SetGenderHandler extends AbstractPacketHandler {
|
||||
|
||||
private void close(Client c) {
|
||||
SessionCoordinator.getInstance().closeSession(c, false);
|
||||
c.updateLoginState(Client.LOGIN_NOTLOGGEDIN);
|
||||
c.updateLoginState(LoginState.NOT_LOGGED_IN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user