Set in transition on log in, now able to enter the game

The state is not set properly on logout though, so once you log out you can't log back in
This commit is contained in:
P0nk
2024-09-29 08:22:26 +02:00
parent 0bb14e415e
commit da4a467453
13 changed files with 88 additions and 38 deletions

View File

@@ -220,19 +220,27 @@ public class AccountService {
return false;
}
setLoginStateMysql(c.getAccID(), newState);
setLoginStatePostgres(c.getAccID(), newState);
c.setLoginState(newState);
setLoginState(c, newState);
return true;
}
public void logOut(Client c) {
SessionCoordinator.getInstance().closeSession(c, false);
byte newState = LoginState.NOT_LOGGED_IN;
int accountId = c.getAccID();
setLoginState(c, LoginState.NOT_LOGGED_IN);
}
public void setInTransition(Client c) {
setLoginState(c, LoginState.SERVER_TRANSITION);
}
private void setLoginState(Client c, byte newState) {
saveLoginState(c.getAccID(), newState);
c.setLoginState(newState);
}
private void saveLoginState(int accountId, byte newState) {
setLoginStateMysql(accountId, newState);
setLoginStatePostgres(accountId, newState);
c.setLoginState(newState);
}
private void setLoginStateMysql(int accountId, byte newState) {