Class BridgeProxyPlayerServerSwitchEvent
java.lang.Object
eu.cloudnetservice.driver.event.Event
eu.cloudnetservice.modules.bridge.event.BridgeProxyPlayerServerSwitchEvent
public final class BridgeProxyPlayerServerSwitchEvent
extends eu.cloudnetservice.driver.event.Event
Called after the cloud player switched its downstream service to another one. At this point
CloudPlayer.connectedService() returns the new service. This event is called both on all nodes in the cluster
and all services running the bridge.- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBridgeProxyPlayerServerSwitchEvent(@NonNull CloudPlayer player, @Nullable NetworkServiceInfo previous) Constructs a new server switch event with the given cloud player and the previous service. -
Method Summary
-
Field Details
-
cloudPlayer
-
previous
-
-
Constructor Details
-
BridgeProxyPlayerServerSwitchEvent
public BridgeProxyPlayerServerSwitchEvent(@NonNull @NonNull CloudPlayer player, @Nullable @Nullable NetworkServiceInfo previous) Constructs a new server switch event with the given cloud player and the previous service.- Parameters:
player- the cloud player that switched the server.previous- the network service the player was connected to previously.- Throws:
NullPointerException- if the given player is null.
-
-
Method Details
-
cloudPlayer
Gets the cloud player that switched servers.- Returns:
- the player that switched servers.
-
target
Gets the network service info that the cloud player is now connected to.- Returns:
- the target network service info
-
previous
Gets the network service info that the cloud player was connected to previously.- Returns:
- the previous network service info, null if the player was not connected to any service previously.
-