Skip to content

Commit 2fcf503

Browse files
authored
Call finalizeLogin to release identity lock (#2)
1 parent 9c7fc9a commit 2fcf503

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

plugin/src/main/java/net/elytrium/limboapi/injection/login/LoginTasksQueue.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,16 @@ private void connectToServer(Logger logger, ConnectedPlayer player, MinecraftCon
284284
this.plugin.setActiveSessionHandler(connection, StateRegistry.CONFIG, configHandler);
285285
}
286286

287-
this.server.getEventManager().fire(new PostLoginEvent(this.player)).thenAccept(postLoginEvent -> {
288-
try {
289-
MC_CONNECTION_SETTER.accept(this.handler, connection);
290-
CONNECT_TO_INITIAL_SERVER_METHOD.invoke((AuthSessionHandler) this.handler, this.player);
291-
} catch (Throwable e) {
292-
throw new ReflectionException(e);
293-
}
294-
});
287+
this.server.getEventManager().fire(new PostLoginEvent(this.player))
288+
.whenComplete((ignored, throwable) -> this.server.getPlayerRegistry().finalizeLogin(player))
289+
.thenAccept(postLoginEvent -> {
290+
try {
291+
MC_CONNECTION_SETTER.accept(this.handler, connection);
292+
CONNECT_TO_INITIAL_SERVER_METHOD.invoke((AuthSessionHandler) this.handler, this.player);
293+
} catch (Throwable e) {
294+
throw new ReflectionException(e);
295+
}
296+
});
295297
}
296298

297299
static {

0 commit comments

Comments
 (0)