Merge branch 'login' into 'master'

Small login corrections

See merge request 2009scape/2009scape!2195
This commit is contained in:
Player Name 2025-11-28 13:30:40 +00:00
commit a37abb7444
2 changed files with 20 additions and 26 deletions

View file

@ -326,7 +326,6 @@ public class Player extends Entity {
public void init() { public void init() {
if (!artificial) { if (!artificial) {
log(this.getClass(), Log.INFO, getUsername() + " initialising..."); log(this.getClass(), Log.INFO, getUsername() + " initialising...");
getDetails().getSession().setObject(this);
} }
super.init(); super.init();
LoginConfiguration.configureLobby(this); LoginConfiguration.configureLobby(this);

View file

@ -33,33 +33,28 @@ class LoginParser(val details: PlayerDetails) {
Repository.removePlayer(player) Repository.removePlayer(player)
flag(AuthResponse.ErrorLoadingProfile) flag(AuthResponse.ErrorLoadingProfile)
} }
GameWorld.Pulser.submit(object : Pulse(1) { try {
override fun pulse(): Boolean { if (details.session.isActive) {
try { player.properties.spawnLocation = getAttribute(player, "/save:spawnLocation", ServerConstants.HOME_LOCATION)
if (details.session.isActive) { loginListeners.forEach(Consumer { listener: LoginListener -> listener.login(player) }) //Run our login hooks
player.properties.spawnLocation = getAttribute(player, "/save:spawnLocation", ServerConstants.HOME_LOCATION) parser.runContentHooks() //Run our saved-content-parsing hooks
loginListeners.forEach(Consumer { listener: LoginListener -> listener.login(player) }) //Run our login hooks player.details.session.setObject(player)
parser.runContentHooks() //Run our saved-content-parsing hooks player.details.accountInfo.lastUsedIp = player.details.ipAddress
player.details.session.setObject(player) if (reconnect) {
player.getDetails().accountInfo.lastUsedIp = player.getDetails().getIpAddress() reconnect(player)
if (reconnect) { } else {
reconnect(player) flag(AuthResponse.Success)
} else { player.init()
flag(AuthResponse.Success) reinitVarps(player)
player.init()
reinitVarps(player)
}
} else {
Repository.removePlayer(player)
}
} catch (t: Throwable) {
t.printStackTrace()
Repository.removePlayer(player)
flag(AuthResponse.ErrorLoadingProfile)
} }
return true } else {
Repository.removePlayer(player)
} }
}) } catch (t: Throwable) {
t.printStackTrace()
Repository.removePlayer(player)
flag(AuthResponse.ErrorLoadingProfile)
}
} }
/** /**