Interface IPlayerManager
-
- All Known Implementing Classes:
BridgePlayerManager,DefaultPlayerManager,NodePlayerManager
public interface IPlayerManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidbroadcastMessage(@NotNull java.lang.String message)Deprecated.replace withgetGlobalPlayerExecutor()voidbroadcastMessage(@NotNull java.lang.String message, @Nullable java.lang.String permission)Deprecated.replace withgetGlobalPlayerExecutor()voiddeleteCloudOfflinePlayer(@NotNull ICloudOfflinePlayer cloudOfflinePlayer)Deletes the given player from the database and notifies all connected components.de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>deleteCloudOfflinePlayerAsync(@NotNull ICloudOfflinePlayer cloudOfflinePlayer)Deletes the given player from the database async and notifies all connected components.default @Nullable ICloudOfflinePlayergetFirstOfflinePlayer(@NotNull java.lang.String name)Gets the first registered player found by its name.default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudOfflinePlayer>getFirstOfflinePlayerAsync(@NotNull java.lang.String name)Gets the first registered player found by its name.default @Nullable ICloudPlayergetFirstOnlinePlayer(@NotNull java.lang.String name)Gets the first online player found by its name.default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudPlayer>getFirstOnlinePlayerAsync(@NotNull java.lang.String name)Gets the first online player found by its name.PlayerExecutorgetGlobalPlayerExecutor()Gets the player executor which will execute the methods as every player that is online on the proxies.default java.util.List<? extends ICloudOfflinePlayer>getOfflinePlayer(@NotNull java.lang.String name)Deprecated.Moved togetOfflinePlayers(String)@Nullable ICloudOfflinePlayergetOfflinePlayer(@NotNull java.util.UUID uniqueId)Gets a registered player by its UUID out of the clouddefault @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudOfflinePlayer>>getOfflinePlayerAsync(@NotNull java.lang.String name)Deprecated.Moved togetOfflinePlayersAsync(String)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudOfflinePlayer>getOfflinePlayerAsync(@NotNull java.util.UUID uniqueId)Gets a list of all online players on the whole network.@NotNull java.util.List<? extends ICloudOfflinePlayer>getOfflinePlayers(@NotNull java.lang.String name)Gets a list of all registered players with the given name.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudOfflinePlayer>>getOfflinePlayersAsync(@NotNull java.lang.String name)Gets a list of all online players with the given name.intgetOnlineCount()Gets the amount of online players on the network@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Integer>getOnlineCountAsync()Gets the amount of online players on the networkdefault java.util.List<? extends ICloudPlayer>getOnlinePlayer(@NotNull java.lang.String name)Deprecated.Moved togetOnlinePlayers(String)@Nullable ICloudPlayergetOnlinePlayer(@NotNull java.util.UUID uniqueId)Gets an online player by its UUID.default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>>getOnlinePlayerAsync(@NotNull java.lang.String name)Deprecated.Moved togetOnlinePlayersAsync(String)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<? extends ICloudPlayer>getOnlinePlayerAsync(@NotNull java.util.UUID uniqueId)Gets an online player by its UUID.@NotNull java.util.List<? extends ICloudPlayer>getOnlinePlayers()Deprecated.Replace withonlinePlayers()@NotNull java.util.List<? extends ICloudPlayer>getOnlinePlayers(@NotNull de.dytanic.cloudnet.driver.service.ServiceEnvironmentType environment)Gets a list of all online players on a specific environment.@NotNull java.util.List<? extends ICloudPlayer>getOnlinePlayers(@NotNull java.lang.String name)Gets a list of all online players with the given name.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>>getOnlinePlayersAsync()Deprecated.Replace withonlinePlayers()@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>>getOnlinePlayersAsync(@NotNull de.dytanic.cloudnet.driver.service.ServiceEnvironmentType environment)Gets a list of all online players on a specific environment.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>>getOnlinePlayersAsync(@NotNull java.lang.String name)Gets a list of all online players with the given name.default @NotNull PlayerExecutorgetPlayerExecutor(@NotNull ICloudPlayer cloudPlayer)Creates a new player executor to interact with the given player.@NotNull PlayerExecutorgetPlayerExecutor(@NotNull java.util.UUID uniqueId)Creates a new player executor to interact with the given player.longgetRegisteredCount()Gets the amount of registered players in the database.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Long>getRegisteredCountAsync()Gets the amount of registered players in the database.java.util.List<? extends ICloudOfflinePlayer>getRegisteredPlayers()Gets a list of all registered players in the network.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudOfflinePlayer>>getRegisteredPlayersAsync()Deprecated.This shouldn't be used when you have many players in your database, because it can cause major problems in the cloud@NotNull PlayerProvidergroupOnlinePlayers(@NotNull java.lang.String group)Gets a PlayerProvider which returns a list of all online players on a specific group.@NotNull PlayerProvideronlinePlayers()Gets a PlayerProvider which returns a list of all online players on the whole network.default voidproxyKickPlayer(@NotNull ICloudPlayer cloudPlayer, @NotNull java.lang.String message)Deprecated.default voidproxyKickPlayer(@NotNull java.util.UUID uniqueId, @NotNull java.lang.String message)Deprecated.default voidproxySendPlayer(@NotNull ICloudPlayer cloudPlayer, @NotNull java.lang.String serviceName)Deprecated.default voidproxySendPlayer(@NotNull java.util.UUID uniqueId, @NotNull java.lang.String serviceName)Deprecated.default voidproxySendPlayerMessage(@NotNull ICloudPlayer cloudPlayer, @NotNull java.lang.String message)Deprecated.default voidproxySendPlayerMessage(@NotNull java.util.UUID uniqueId, @NotNull java.lang.String message)Deprecated.default voidproxySendPluginMessage(ICloudPlayer cloudPlayer, java.lang.String tag, byte[] data)Deprecated.default voidproxySendPluginMessage(java.util.UUID uniqueId, java.lang.String tag, byte[] data)Deprecated.@NotNull PlayerProvidertaskOnlinePlayers(@NotNull java.lang.String task)Gets a PlayerProvider which returns a list of all online players on a specific task.voidupdateOfflinePlayer(@NotNull ICloudOfflinePlayer cloudOfflinePlayer)Updates the given player to the database of the cloud and calls an update event on the whole network.voidupdateOnlinePlayer(@NotNull ICloudPlayer cloudPlayer)Updates the given player to the database of the cloud and calls the player update event.
-
-
-
Method Detail
-
getOnlineCount
int getOnlineCount()
Gets the amount of online players on the network- Returns:
- the online count as an int
-
getRegisteredCount
long getRegisteredCount()
Gets the amount of registered players in the database.- Returns:
- the registered player count as an int
-
getOnlinePlayer
@Nullable @Nullable ICloudPlayer getOnlinePlayer(@NotNull @NotNull java.util.UUID uniqueId)
Gets an online player by its UUID.- Parameters:
uniqueId- the UUID of the player- Returns:
- the player if he is online or null if not
-
getFirstOnlinePlayer
@Nullable default @Nullable ICloudPlayer getFirstOnlinePlayer(@NotNull @NotNull java.lang.String name)
Gets the first online player found by its name.- Parameters:
name- the name of the player- Returns:
- the online player if there is at least one player with the given name online or null if there is no player with that name online
-
getOnlinePlayer
@Deprecated @ScheduledForRemoval(inVersion="3.6") default java.util.List<? extends ICloudPlayer> getOnlinePlayer(@NotNull @NotNull java.lang.String name)
Deprecated.Moved togetOnlinePlayers(String)Gets a list of all online players with the given name (case-insensitive).- Parameters:
name- the name of the player(s)- Returns:
- a list containing all online players in the cloud with the given name
-
getOnlinePlayers
@NotNull @NotNull java.util.List<? extends ICloudPlayer> getOnlinePlayers(@NotNull @NotNull java.lang.String name)
Gets a list of all online players with the given name. (case-insensitive).- Parameters:
name- the name of the player(s)- Returns:
- a list containing all online players in the cloud with the given name
-
getOnlinePlayers
@NotNull @NotNull java.util.List<? extends ICloudPlayer> getOnlinePlayers(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceEnvironmentType environment)
Gets a list of all online players on a specific environment.- Parameters:
environment- the environment to get all players from- Returns:
- a list containing all players that are online on the given environment
-
getOnlinePlayers
@NotNull @Deprecated @NotNull java.util.List<? extends ICloudPlayer> getOnlinePlayers()
Deprecated.Replace withonlinePlayers()Gets a list of all online players on the whole network.- Returns:
- a list containing all players that are online on the network
-
onlinePlayers
@NotNull @NotNull PlayerProvider onlinePlayers()
Gets a PlayerProvider which returns a list of all online players on the whole network.
-
taskOnlinePlayers
@NotNull @NotNull PlayerProvider taskOnlinePlayers(@NotNull @NotNull java.lang.String task)
Gets a PlayerProvider which returns a list of all online players on a specific task.- Returns:
- a list containing all players that are online on that task
-
groupOnlinePlayers
@NotNull @NotNull PlayerProvider groupOnlinePlayers(@NotNull @NotNull java.lang.String group)
Gets a PlayerProvider which returns a list of all online players on a specific group.
-
getOfflinePlayer
@Nullable @Nullable ICloudOfflinePlayer getOfflinePlayer(@NotNull @NotNull java.util.UUID uniqueId)
Gets a registered player by its UUID out of the cloud- Parameters:
uniqueId- the UUID of the player- Returns:
- the player if he is registered in the cloud or null if not
-
getFirstOfflinePlayer
@Nullable default @Nullable ICloudOfflinePlayer getFirstOfflinePlayer(@NotNull @NotNull java.lang.String name)
Gets the first registered player found by its name.- Parameters:
name- the name of the player- Returns:
- the registered player if there is at least one player with the given name registered or null if there is no player with that name registered
-
getOfflinePlayer
@Deprecated @ScheduledForRemoval(inVersion="3.6") default java.util.List<? extends ICloudOfflinePlayer> getOfflinePlayer(@NotNull @NotNull java.lang.String name)
Deprecated.Moved togetOfflinePlayers(String)Gets a list of all registered players with the given name. (case-sensitive)- Parameters:
name- the name of the player(s)- Returns:
- a list containing all players registered in the cloud with the given name
-
getOfflinePlayers
@NotNull @NotNull java.util.List<? extends ICloudOfflinePlayer> getOfflinePlayers(@NotNull @NotNull java.lang.String name)
Gets a list of all registered players with the given name. (case-sensitive)- Parameters:
name- the name of the player(s)- Returns:
- a list containing all players registered in the cloud with the given name
-
getRegisteredPlayers
@Experimental java.util.List<? extends ICloudOfflinePlayer> getRegisteredPlayers()
Gets a list of all registered players in the network.Depending on the amount of registered players, this method might take a bit longer or won't even work, because it takes too much memory to keep the whole list loaded.
NOTE: This shouldn't be used when you have many players in your database, because it can cause major problems in the cloud
- Returns:
- the list with every registered player in the cloud
-
getOnlineCountAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Integer> getOnlineCountAsync()
Gets the amount of online players on the network- Returns:
- the online count as an int
-
getRegisteredCountAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Long> getRegisteredCountAsync()
Gets the amount of registered players in the database.- Returns:
- the registered player count as an int
-
getOnlinePlayerAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<? extends ICloudPlayer> getOnlinePlayerAsync(@NotNull @NotNull java.util.UUID uniqueId)
Gets an online player by its UUID.- Parameters:
uniqueId- the UUID of the player- Returns:
- the player if he is online or null if not
-
getFirstOnlinePlayerAsync
@NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudPlayer> getFirstOnlinePlayerAsync(@NotNull @NotNull java.lang.String name)
Gets the first online player found by its name.- Parameters:
name- the name of the player- Returns:
- the online player if there is at least one player with the given name online or null if there is no player with that name online
-
getOnlinePlayerAsync
@Deprecated @ScheduledForRemoval(inVersion="3.6") @NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>> getOnlinePlayerAsync(@NotNull @NotNull java.lang.String name)
Deprecated.Moved togetOnlinePlayersAsync(String)Gets a list of all online players with the given name (case-insensitive).- Parameters:
name- the name of the player(s)- Returns:
- a list containing all online players in the cloud with the given name
-
getOnlinePlayersAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>> getOnlinePlayersAsync(@NotNull @NotNull java.lang.String name)
Gets a list of all online players with the given name. (case-insensitive).- Parameters:
name- the name of the player(s)- Returns:
- a list containing all online players in the cloud with the given name
-
getOnlinePlayersAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>> getOnlinePlayersAsync(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceEnvironmentType environment)
Gets a list of all online players on a specific environment.- Parameters:
environment- the environment to get all players from- Returns:
- a list containing all players that are online on the given environment
-
getOnlinePlayersAsync
@NotNull @Deprecated @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>> getOnlinePlayersAsync()
Deprecated.Replace withonlinePlayers()Gets a list of all online players on the whole network.- Returns:
- a list containing all players that are online on the network
-
getOfflinePlayerAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudOfflinePlayer> getOfflinePlayerAsync(@NotNull @NotNull java.util.UUID uniqueId)
Gets a list of all online players on the whole network.- Returns:
- a list containing all players that are online on the network
-
getOfflinePlayerAsync
@Deprecated @ScheduledForRemoval(inVersion="3.6") @NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudOfflinePlayer>> getOfflinePlayerAsync(@NotNull @NotNull java.lang.String name)
Deprecated.Moved togetOfflinePlayersAsync(String)Gets a list of all registered players with the given name. (case-insensitive)- Parameters:
name- the name of the player(s)- Returns:
- a list containing all players registered in the cloud with the given name
-
getFirstOfflinePlayerAsync
@NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudOfflinePlayer> getFirstOfflinePlayerAsync(@NotNull @NotNull java.lang.String name)
Gets the first registered player found by its name.- Parameters:
name- the name of the player- Returns:
- the registered player if there is at least one player with the given name registered or null if there is no player with that name registered
-
getOfflinePlayersAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudOfflinePlayer>> getOfflinePlayersAsync(@NotNull @NotNull java.lang.String name)
Gets a list of all online players with the given name. (case-insensitive)- Parameters:
name- the name of the player(s)- Returns:
- a list containing all players registered in the cloud with the given name
-
getRegisteredPlayersAsync
@Deprecated @ScheduledForRemoval(inVersion="3.6") @NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudOfflinePlayer>> getRegisteredPlayersAsync()
Deprecated.This shouldn't be used when you have many players in your database, because it can cause major problems in the cloudGets a list of all registered players in the network.Depending on the amount of registered players, this method might take a bit longer or won't even work, because it takes too much memory to keep the whole list loaded.
- Returns:
- the list with every registered player in the cloud
-
updateOfflinePlayer
void updateOfflinePlayer(@NotNull @NotNull ICloudOfflinePlayer cloudOfflinePlayer)Updates the given player to the database of the cloud and calls an update event on the whole network.- Parameters:
cloudOfflinePlayer- the player to be updated
-
updateOnlinePlayer
void updateOnlinePlayer(@NotNull @NotNull ICloudPlayer cloudPlayer)Updates the given player to the database of the cloud and calls the player update event.- Parameters:
cloudPlayer- the player to be updated
-
deleteCloudOfflinePlayer
void deleteCloudOfflinePlayer(@NotNull @NotNull ICloudOfflinePlayer cloudOfflinePlayer)Deletes the given player from the database and notifies all connected components.- Parameters:
cloudOfflinePlayer- the player to be deleted
-
deleteCloudOfflinePlayerAsync
de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> deleteCloudOfflinePlayerAsync(@NotNull @NotNull ICloudOfflinePlayer cloudOfflinePlayer)Deletes the given player from the database async and notifies all connected components.- Parameters:
cloudOfflinePlayer- the player to be deleted
-
getGlobalPlayerExecutor
PlayerExecutor getGlobalPlayerExecutor()
Gets the player executor which will execute the methods as every player that is online on the proxies.- Returns:
- the constant
PlayerExecutor
-
getPlayerExecutor
@NotNull default @NotNull PlayerExecutor getPlayerExecutor(@NotNull @NotNull ICloudPlayer cloudPlayer)
Creates a new player executor to interact with the given player.- Parameters:
cloudPlayer- the player to interact with- Returns:
- a new
PlayerExecutor
-
getPlayerExecutor
@NotNull @NotNull PlayerExecutor getPlayerExecutor(@NotNull @NotNull java.util.UUID uniqueId)
Creates a new player executor to interact with the given player.- Parameters:
uniqueId- the uniqueId of the player to interact with- Returns:
- a new
PlayerExecutor
-
proxySendPlayer
@Deprecated @ScheduledForRemoval(inVersion="3.6") default void proxySendPlayer(@NotNull @NotNull ICloudPlayer cloudPlayer, @NotNull @NotNull java.lang.String serviceName)Deprecated.Connects an online player to a specific service.- Parameters:
cloudPlayer- the player to be connectedserviceName- the name of the service the player should be sent to
-
proxySendPlayer
@Deprecated @ScheduledForRemoval(inVersion="3.6") default void proxySendPlayer(@NotNull @NotNull java.util.UUID uniqueId, @NotNull @NotNull java.lang.String serviceName)Deprecated.Connects an online player to a specific service.- Parameters:
uniqueId- the uuid of the player to be connectedserviceName- the name of the service the player should be sent to
-
proxyKickPlayer
@Deprecated @ScheduledForRemoval(inVersion="3.6") default void proxyKickPlayer(@NotNull @NotNull ICloudPlayer cloudPlayer, @NotNull @NotNull java.lang.String message)Deprecated.Kicks an online player from the network with a specific reason.- Parameters:
cloudPlayer- the player to be kickedmessage- the reason for the kick which will be displayed in the players client
-
proxyKickPlayer
@Deprecated @ScheduledForRemoval(inVersion="3.6") default void proxyKickPlayer(@NotNull @NotNull java.util.UUID uniqueId, @NotNull @NotNull java.lang.String message)Deprecated.Kicks an online player from the network with a specific reason.- Parameters:
uniqueId- the uuid of the player to be kickedmessage- the reason for the kick which will be displayed in the players client
-
proxySendPlayerMessage
@Deprecated @ScheduledForRemoval(inVersion="3.6") default void proxySendPlayerMessage(@NotNull @NotNull ICloudPlayer cloudPlayer, @NotNull @NotNull java.lang.String message)Deprecated.Sends a message to a specific online player.- Parameters:
cloudPlayer- the player to send the message tomessage- the message to be sent to the player
-
proxySendPlayerMessage
@Deprecated @ScheduledForRemoval(inVersion="3.6") default void proxySendPlayerMessage(@NotNull @NotNull java.util.UUID uniqueId, @NotNull @NotNull java.lang.String message)Deprecated.Sends a plugin message to a specific online player.- Parameters:
uniqueId- the uuid of the player to send the message tomessage- the message to be sent to the player
-
proxySendPluginMessage
@Deprecated @ScheduledForRemoval(inVersion="3.6") default void proxySendPluginMessage(ICloudPlayer cloudPlayer, java.lang.String tag, byte[] data)
Deprecated.Sends a plugin message to a specific online player.- Parameters:
cloudPlayer- the player to send the message totag- the tag of the plugin messagedata- the data of the plugin message
-
proxySendPluginMessage
@Deprecated @ScheduledForRemoval(inVersion="3.6") default void proxySendPluginMessage(java.util.UUID uniqueId, java.lang.String tag, byte[] data)Deprecated.Sends a message to a specific online player.- Parameters:
uniqueId- the uuid of the player to send the message totag- the tag of the plugin messagedata- the data of the plugin message
-
broadcastMessage
@Deprecated void broadcastMessage(@NotNull @NotNull java.lang.String message)Deprecated.replace withgetGlobalPlayerExecutor()Broadcasts a specific message over the whole network.- Parameters:
message- the message to be sent to all online players
-
broadcastMessage
@Deprecated void broadcastMessage(@NotNull @NotNull java.lang.String message, @Nullable @Nullable java.lang.String permission)Deprecated.replace withgetGlobalPlayerExecutor()Broadcasts a specific message to all online players that have the given permission. If the given permission is null, no permission is checked and the message is sent to all online players.- Parameters:
message- the message to be sent to all online players with the given permissionpermission- the permission to check for
-
-