Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Add PRE_SERVER_JOIN to DisconnectEvent#LoginStatus (#346)
Dieser Commit ist enthalten in:
Ursprung
87bff1a123
Commit
76173e4145
@ -2,6 +2,7 @@ package com.velocitypowered.api.event.connection;
|
|||||||
|
|
||||||
import static com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus.CANCELLED_BY_PROXY;
|
import static com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus.CANCELLED_BY_PROXY;
|
||||||
import static com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus.CONFLICTING_LOGIN;
|
import static com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus.CONFLICTING_LOGIN;
|
||||||
|
import static com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus.PRE_SERVER_JOIN;
|
||||||
import static com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus.SUCCESSFUL_LOGIN;
|
import static com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus.SUCCESSFUL_LOGIN;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
@ -59,6 +60,7 @@ public final class DisconnectEvent {
|
|||||||
CONFLICTING_LOGIN,
|
CONFLICTING_LOGIN,
|
||||||
CANCELLED_BY_USER,
|
CANCELLED_BY_USER,
|
||||||
CANCELLED_BY_PROXY,
|
CANCELLED_BY_PROXY,
|
||||||
CANCELLED_BY_USER_BEFORE_COMPLETE
|
CANCELLED_BY_USER_BEFORE_COMPLETE,
|
||||||
|
PRE_SERVER_JOIN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -695,8 +695,12 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
|
|
||||||
DisconnectEvent.LoginStatus status;
|
DisconnectEvent.LoginStatus status;
|
||||||
if (connectedPlayer.isPresent()) {
|
if (connectedPlayer.isPresent()) {
|
||||||
status = connectedPlayer.get() == this ? LoginStatus.SUCCESSFUL_LOGIN
|
if (!connectedPlayer.get().getCurrentServer().isPresent()) {
|
||||||
: LoginStatus.CONFLICTING_LOGIN;
|
status = LoginStatus.PRE_SERVER_JOIN;
|
||||||
|
} else {
|
||||||
|
status = connectedPlayer.get() == this ? LoginStatus.SUCCESSFUL_LOGIN
|
||||||
|
: LoginStatus.CONFLICTING_LOGIN;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
status = connection.isKnownDisconnect() ? LoginStatus.CANCELLED_BY_PROXY :
|
status = connection.isKnownDisconnect() ? LoginStatus.CANCELLED_BY_PROXY :
|
||||||
LoginStatus.CANCELLED_BY_USER;
|
LoginStatus.CANCELLED_BY_USER;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren