Class NodePlayerManager
- java.lang.Object
-
- de.dytanic.cloudnet.ext.bridge.player.DefaultPlayerManager
-
- de.dytanic.cloudnet.ext.bridge.node.player.NodePlayerManager
-
- All Implemented Interfaces:
IPlayerManager
@Internal public final class NodePlayerManager extends DefaultPlayerManager implements IPlayerManager
-
-
Constructor Summary
Constructors Constructor Description NodePlayerManager(java.lang.String databaseName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddeleteCloudOfflinePlayer(@NotNull ICloudOfflinePlayer cloudOfflinePlayer)Deletes the given player from the database and notifies all connected components.voiddeleteCloudOfflinePlayer0(@NotNull ICloudOfflinePlayer cloudOfflinePlayer)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.de.dytanic.cloudnet.driver.database.DatabasegetDatabase()java.lang.StringgetDatabaseName()@Nullable ICloudOfflinePlayergetFirstOfflinePlayer(@NotNull java.lang.String name)Gets the first registered player found by its name.@Nullable CloudPlayergetFirstOnlinePlayer(@NotNull java.lang.String name)Gets the first online player found by its name.static NodePlayerManagergetInstance()Deprecated.IPlayerManager should be accessed through theIServicesRegistryICloudOfflinePlayergetOfflinePlayer(@NotNull java.util.UUID uniqueId)Gets a registered player by its UUID out of the cloud@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.java.util.Map<java.util.UUID,CloudPlayer>getOnlineCloudPlayers()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 network@Nullable CloudPlayergetOnlinePlayer(@NotNull java.util.UUID uniqueId)Gets an online player by its UUID.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudPlayer>getOnlinePlayerAsync(@NotNull java.util.UUID uniqueId)Gets an online player by its UUID.@NotNull java.util.List<CloudPlayer>getOnlinePlayers()Gets a list of all online players on the whole network.@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()Gets a list of all online players on the whole network.@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.ICloudOfflinePlayergetOrRegisterOfflinePlayer(NetworkConnectionInfo networkConnectionInfo)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()Gets a list of all registered players in the network.@NotNull PlayerProvidergroupOnlinePlayers(@NotNull java.lang.String group)Gets a PlayerProvider which returns a list of all online players on a specific group.voidhandleOfflinePlayerUpdate(ICloudOfflinePlayer player)voidhandleOnlinePlayerUpdate(ICloudPlayer cloudPlayer)voidloginPlayer(NetworkConnectionInfo networkConnectionInfo, NetworkPlayerServerInfo networkPlayerServerInfo)voidlogoutPlayer(CloudPlayer cloudPlayer)voidlogoutPlayer(NetworkConnectionInfo networkConnectionInfo)voidlogoutPlayer(java.util.UUID uniqueId, java.lang.String name, NetworkServiceInfo proxy)@NotNull PlayerProvideronlinePlayers()Gets a PlayerProvider which returns a list of all online players on the whole network.protected voidprocessLogin(@NotNull CloudPlayer cloudPlayer)voidprocessLoginMessage(@NotNull CloudPlayer cloudPlayer)<T> @NotNull de.dytanic.cloudnet.common.concurrent.ITask<T>schedule(java.util.concurrent.Callable<T> callable)protected CloudPlayerselectPlayerForLogin(NetworkConnectionInfo connectionInfo, NetworkPlayerServerInfo networkPlayerServerInfo)@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.voidupdateOfflinePlayer0(ICloudOfflinePlayer cloudOfflinePlayer)voidupdateOnlinePlayer(@NotNull ICloudPlayer cloudPlayer)Updates the given player to the database of the cloud and calls the player update event.voidupdateOnlinePlayer0(ICloudPlayer cloudPlayer)protected voidupdateOnlinePlayerInCache(ICloudPlayer cloudPlayer)-
Methods inherited from class de.dytanic.cloudnet.ext.bridge.player.DefaultPlayerManager
broadcastMessage, broadcastMessage, getGlobalPlayerExecutor, getPlayerExecutor, messageBuilder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.dytanic.cloudnet.ext.bridge.player.IPlayerManager
broadcastMessage, broadcastMessage, getFirstOfflinePlayerAsync, getFirstOnlinePlayerAsync, getGlobalPlayerExecutor, getOfflinePlayer, getOfflinePlayerAsync, getOnlinePlayer, getOnlinePlayerAsync, getPlayerExecutor, getPlayerExecutor, proxyKickPlayer, proxyKickPlayer, proxySendPlayer, proxySendPlayer, proxySendPlayerMessage, proxySendPlayerMessage, proxySendPluginMessage, proxySendPluginMessage
-
-
-
-
Method Detail
-
getInstance
@Deprecated public static NodePlayerManager getInstance()
Deprecated.IPlayerManager should be accessed through theIServicesRegistry
-
getDatabase
public de.dytanic.cloudnet.driver.database.Database getDatabase()
-
getOnlineCount
public int getOnlineCount()
Description copied from interface:IPlayerManagerGets the amount of online players on the network- Specified by:
getOnlineCountin interfaceIPlayerManager- Returns:
- the online count as an int
-
getRegisteredCount
public long getRegisteredCount()
Description copied from interface:IPlayerManagerGets the amount of registered players in the database.- Specified by:
getRegisteredCountin interfaceIPlayerManager- Returns:
- the registered player count as an int
-
getOnlinePlayer
@Nullable public @Nullable CloudPlayer getOnlinePlayer(@NotNull @NotNull java.util.UUID uniqueId)
Description copied from interface:IPlayerManagerGets an online player by its UUID.- Specified by:
getOnlinePlayerin interfaceIPlayerManager- Parameters:
uniqueId- the UUID of the player- Returns:
- the player if he is online or null if not
-
getFirstOnlinePlayer
@Nullable public @Nullable CloudPlayer getFirstOnlinePlayer(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPlayerManagerGets the first online player found by its name.- Specified by:
getFirstOnlinePlayerin interfaceIPlayerManager- 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
-
getOnlinePlayers
@NotNull public @NotNull java.util.List<? extends ICloudPlayer> getOnlinePlayers(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPlayerManagerGets a list of all online players with the given name. (case-insensitive).- Specified by:
getOnlinePlayersin interfaceIPlayerManager- Parameters:
name- the name of the player(s)- Returns:
- a list containing all online players in the cloud with the given name
-
getOnlinePlayers
@NotNull public @NotNull java.util.List<? extends ICloudPlayer> getOnlinePlayers(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceEnvironmentType environment)
Description copied from interface:IPlayerManagerGets a list of all online players on a specific environment.- Specified by:
getOnlinePlayersin interfaceIPlayerManager- Parameters:
environment- the environment to get all players from- Returns:
- a list containing all players that are online on the given environment
-
getOnlinePlayers
@NotNull public @NotNull java.util.List<CloudPlayer> getOnlinePlayers()
Description copied from interface:IPlayerManagerGets a list of all online players on the whole network.- Specified by:
getOnlinePlayersin interfaceIPlayerManager- Returns:
- a list containing all players that are online on the network
-
onlinePlayers
@NotNull public @NotNull PlayerProvider onlinePlayers()
Description copied from interface:IPlayerManagerGets a PlayerProvider which returns a list of all online players on the whole network.- Specified by:
onlinePlayersin interfaceIPlayerManager
-
taskOnlinePlayers
@NotNull public @NotNull PlayerProvider taskOnlinePlayers(@NotNull @NotNull java.lang.String task)
Description copied from interface:IPlayerManagerGets a PlayerProvider which returns a list of all online players on a specific task.- Specified by:
taskOnlinePlayersin interfaceIPlayerManager- Returns:
- a list containing all players that are online on that task
-
groupOnlinePlayers
@NotNull public @NotNull PlayerProvider groupOnlinePlayers(@NotNull @NotNull java.lang.String group)
Description copied from interface:IPlayerManagerGets a PlayerProvider which returns a list of all online players on a specific group.- Specified by:
groupOnlinePlayersin interfaceIPlayerManager
-
getOfflinePlayer
public ICloudOfflinePlayer getOfflinePlayer(@NotNull @NotNull java.util.UUID uniqueId)
Description copied from interface:IPlayerManagerGets a registered player by its UUID out of the cloud- Specified by:
getOfflinePlayerin interfaceIPlayerManager- Parameters:
uniqueId- the UUID of the player- Returns:
- the player if he is registered in the cloud or null if not
-
getFirstOfflinePlayer
@Nullable public @Nullable ICloudOfflinePlayer getFirstOfflinePlayer(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPlayerManagerGets the first registered player found by its name.- Specified by:
getFirstOfflinePlayerin interfaceIPlayerManager- 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
-
getOfflinePlayers
@NotNull public @NotNull java.util.List<? extends ICloudOfflinePlayer> getOfflinePlayers(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPlayerManagerGets a list of all registered players with the given name. (case-sensitive)- Specified by:
getOfflinePlayersin interfaceIPlayerManager- Parameters:
name- the name of the player(s)- Returns:
- a list containing all players registered in the cloud with the given name
-
getRegisteredPlayers
public java.util.List<? extends ICloudOfflinePlayer> getRegisteredPlayers()
Description copied from interface:IPlayerManagerGets 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
- Specified by:
getRegisteredPlayersin interfaceIPlayerManager- Returns:
- the list with every registered player in the cloud
-
getOnlineCountAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Integer> getOnlineCountAsync()
Description copied from interface:IPlayerManagerGets the amount of online players on the network- Specified by:
getOnlineCountAsyncin interfaceIPlayerManager- Returns:
- the online count as an int
-
getRegisteredCountAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Long> getRegisteredCountAsync()
Description copied from interface:IPlayerManagerGets the amount of registered players in the database.- Specified by:
getRegisteredCountAsyncin interfaceIPlayerManager- Returns:
- the registered player count as an int
-
getOnlinePlayerAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudPlayer> getOnlinePlayerAsync(@NotNull @NotNull java.util.UUID uniqueId)
Description copied from interface:IPlayerManagerGets an online player by its UUID.- Specified by:
getOnlinePlayerAsyncin interfaceIPlayerManager- Parameters:
uniqueId- the UUID of the player- Returns:
- the player if he is online or null if not
-
getOnlinePlayersAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>> getOnlinePlayersAsync(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPlayerManagerGets a list of all online players with the given name. (case-insensitive).- Specified by:
getOnlinePlayersAsyncin interfaceIPlayerManager- Parameters:
name- the name of the player(s)- Returns:
- a list containing all online players in the cloud with the given name
-
getOnlinePlayersAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>> getOnlinePlayersAsync(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceEnvironmentType environment)
Description copied from interface:IPlayerManagerGets a list of all online players on a specific environment.- Specified by:
getOnlinePlayersAsyncin interfaceIPlayerManager- Parameters:
environment- the environment to get all players from- Returns:
- a list containing all players that are online on the given environment
-
getOnlinePlayersAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudPlayer>> getOnlinePlayersAsync()
Description copied from interface:IPlayerManagerGets a list of all online players on the whole network.- Specified by:
getOnlinePlayersAsyncin interfaceIPlayerManager- Returns:
- a list containing all players that are online on the network
-
getOfflinePlayerAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ICloudOfflinePlayer> getOfflinePlayerAsync(@NotNull @NotNull java.util.UUID uniqueId)
Description copied from interface:IPlayerManagerGets a list of all online players on the whole network.- Specified by:
getOfflinePlayerAsyncin interfaceIPlayerManager- Returns:
- a list containing all players that are online on the network
-
getOfflinePlayersAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudOfflinePlayer>> getOfflinePlayersAsync(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPlayerManagerGets a list of all online players with the given name. (case-insensitive)- Specified by:
getOfflinePlayersAsyncin interfaceIPlayerManager- Parameters:
name- the name of the player(s)- Returns:
- a list containing all players registered in the cloud with the given name
-
getRegisteredPlayersAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<? extends ICloudOfflinePlayer>> getRegisteredPlayersAsync()
Description copied from interface:IPlayerManagerGets 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.
- Specified by:
getRegisteredPlayersAsyncin interfaceIPlayerManager- Returns:
- the list with every registered player in the cloud
-
updateOfflinePlayer
public void updateOfflinePlayer(@NotNull @NotNull ICloudOfflinePlayer cloudOfflinePlayer)Description copied from interface:IPlayerManagerUpdates the given player to the database of the cloud and calls an update event on the whole network.- Specified by:
updateOfflinePlayerin interfaceIPlayerManager- Parameters:
cloudOfflinePlayer- the player to be updated
-
updateOfflinePlayer0
public void updateOfflinePlayer0(ICloudOfflinePlayer cloudOfflinePlayer)
-
handleOfflinePlayerUpdate
public void handleOfflinePlayerUpdate(ICloudOfflinePlayer player)
-
updateOnlinePlayer
public void updateOnlinePlayer(@NotNull @NotNull ICloudPlayer cloudPlayer)Description copied from interface:IPlayerManagerUpdates the given player to the database of the cloud and calls the player update event.- Specified by:
updateOnlinePlayerin interfaceIPlayerManager- Parameters:
cloudPlayer- the player to be updated
-
deleteCloudOfflinePlayer
public void deleteCloudOfflinePlayer(@NotNull @NotNull ICloudOfflinePlayer cloudOfflinePlayer)Description copied from interface:IPlayerManagerDeletes the given player from the database and notifies all connected components.- Specified by:
deleteCloudOfflinePlayerin interfaceIPlayerManager- Parameters:
cloudOfflinePlayer- the player to be deleted
-
deleteCloudOfflinePlayer0
public void deleteCloudOfflinePlayer0(@NotNull @NotNull ICloudOfflinePlayer cloudOfflinePlayer)
-
deleteCloudOfflinePlayerAsync
public de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> deleteCloudOfflinePlayerAsync(@NotNull @NotNull ICloudOfflinePlayer cloudOfflinePlayer)Description copied from interface:IPlayerManagerDeletes the given player from the database async and notifies all connected components.- Specified by:
deleteCloudOfflinePlayerAsyncin interfaceIPlayerManager- Parameters:
cloudOfflinePlayer- the player to be deleted
-
updateOnlinePlayer0
public void updateOnlinePlayer0(ICloudPlayer cloudPlayer)
-
handleOnlinePlayerUpdate
public void handleOnlinePlayerUpdate(ICloudPlayer cloudPlayer)
-
updateOnlinePlayerInCache
protected void updateOnlinePlayerInCache(ICloudPlayer cloudPlayer)
-
schedule
@NotNull public <T> @NotNull de.dytanic.cloudnet.common.concurrent.ITask<T> schedule(java.util.concurrent.Callable<T> callable)
-
getOnlineCloudPlayers
public java.util.Map<java.util.UUID,CloudPlayer> getOnlineCloudPlayers()
-
getDatabaseName
public java.lang.String getDatabaseName()
-
loginPlayer
public void loginPlayer(NetworkConnectionInfo networkConnectionInfo, NetworkPlayerServerInfo networkPlayerServerInfo)
-
selectPlayerForLogin
protected CloudPlayer selectPlayerForLogin(NetworkConnectionInfo connectionInfo, NetworkPlayerServerInfo networkPlayerServerInfo)
-
processLogin
protected void processLogin(@NotNull @NotNull CloudPlayer cloudPlayer)
-
processLoginMessage
public void processLoginMessage(@NotNull @NotNull CloudPlayer cloudPlayer)
-
getOrRegisterOfflinePlayer
public ICloudOfflinePlayer getOrRegisterOfflinePlayer(NetworkConnectionInfo networkConnectionInfo)
-
logoutPlayer
public void logoutPlayer(CloudPlayer cloudPlayer)
-
logoutPlayer
public void logoutPlayer(NetworkConnectionInfo networkConnectionInfo)
-
logoutPlayer
public void logoutPlayer(java.util.UUID uniqueId, java.lang.String name, NetworkServiceInfo proxy)
-
-