Class NodePlayerManager

    • Constructor Detail

      • NodePlayerManager

        public NodePlayerManager​(java.lang.String databaseName)
    • Method Detail

      • getInstance

        @Deprecated
        public static NodePlayerManager getInstance()
        Deprecated.
        IPlayerManager should be accessed through the IServicesRegistry
      • getDatabase

        public de.dytanic.cloudnet.database.IDatabase getDatabase()
      • getOnlineCount

        public int getOnlineCount()
        Description copied from interface: IPlayerManager
        Gets the amount of online players on the network
        Specified by:
        getOnlineCount in interface IPlayerManager
        Returns:
        the online count as an int
      • getRegisteredCount

        public long getRegisteredCount()
        Description copied from interface: IPlayerManager
        Gets the amount of registered players in the database.
        Specified by:
        getRegisteredCount in interface IPlayerManager
        Returns:
        the registered player count as an int
      • getOnlinePlayer

        @Nullable
        public @Nullable CloudPlayer getOnlinePlayer​(@NotNull
                                                     @NotNull java.util.UUID uniqueId)
        Description copied from interface: IPlayerManager
        Gets an online player by its UUID.
        Specified by:
        getOnlinePlayer in interface IPlayerManager
        Parameters:
        uniqueId - the UUID of the player
        Returns:
        the player if he is online or null if not
      • getOnlinePlayers

        @NotNull
        public @NotNull java.util.List<? extends ICloudPlayer> getOnlinePlayers​(@NotNull
                                                                                @NotNull java.lang.String name)
        Description copied from interface: IPlayerManager
        Gets a list of all online players with the given name. (case-insensitive).
        Specified by:
        getOnlinePlayers in interface IPlayerManager
        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: IPlayerManager
        Gets a list of all online players on a specific environment.
        Specified by:
        getOnlinePlayers in interface IPlayerManager
        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: IPlayerManager
        Gets a list of all online players on the whole network.
        Specified by:
        getOnlinePlayers in interface IPlayerManager
        Returns:
        a list containing all players that are online on the network
      • getOfflinePlayer

        public ICloudOfflinePlayer getOfflinePlayer​(@NotNull
                                                    @NotNull java.util.UUID uniqueId)
        Description copied from interface: IPlayerManager
        Gets a registered player by its UUID out of the cloud
        Specified by:
        getOfflinePlayer in interface IPlayerManager
        Parameters:
        uniqueId - the UUID of the player
        Returns:
        the player if he is registered in the cloud or null if not
      • getOfflinePlayers

        @NotNull
        public @NotNull java.util.List<? extends ICloudOfflinePlayer> getOfflinePlayers​(@NotNull
                                                                                        @NotNull java.lang.String name)
        Description copied from interface: IPlayerManager
        Gets a list of all registered players with the given name. (case-sensitive)
        Specified by:
        getOfflinePlayers in interface IPlayerManager
        Parameters:
        name - the name of the player(s)
        Returns:
        a list containing all players registered in the cloud with the given name
      • getRegisteredPlayers

        @Deprecated
        public java.util.List<? extends ICloudOfflinePlayer> getRegisteredPlayers()
        Deprecated.
        Description copied from interface: IPlayerManager
        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.

        Specified by:
        getRegisteredPlayers in interface IPlayerManager
        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: IPlayerManager
        Gets the amount of online players on the network
        Specified by:
        getOnlineCountAsync in interface IPlayerManager
        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: IPlayerManager
        Gets the amount of registered players in the database.
        Specified by:
        getRegisteredCountAsync in interface IPlayerManager
        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: IPlayerManager
        Gets an online player by its UUID.
        Specified by:
        getOnlinePlayerAsync in interface IPlayerManager
        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: IPlayerManager
        Gets a list of all online players with the given name. (case-insensitive).
        Specified by:
        getOnlinePlayersAsync in interface IPlayerManager
        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: IPlayerManager
        Gets a list of all online players on a specific environment.
        Specified by:
        getOnlinePlayersAsync in interface IPlayerManager
        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: IPlayerManager
        Gets a list of all online players on the whole network.
        Specified by:
        getOnlinePlayersAsync in interface IPlayerManager
        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: IPlayerManager
        Gets a list of all online players on the whole network.
        Specified by:
        getOfflinePlayerAsync in interface IPlayerManager
        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: IPlayerManager
        Gets a list of all online players with the given name. (case-insensitive)
        Specified by:
        getOfflinePlayersAsync in interface IPlayerManager
        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: IPlayerManager
        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.

        Specified by:
        getRegisteredPlayersAsync in interface IPlayerManager
        Returns:
        the list with every registered player in the cloud
      • updateOfflinePlayer0

        public void updateOfflinePlayer0​(ICloudOfflinePlayer cloudOfflinePlayer)
      • updateOnlinePlayer0

        public void updateOnlinePlayer0​(ICloudPlayer cloudPlayer)
      • getPlayerExecutor

        @NotNull
        public @NotNull PlayerExecutor getPlayerExecutor​(@NotNull
                                                         @NotNull java.util.UUID uniqueId)
        Description copied from interface: IPlayerManager
        Creates a new player executor to interact with the given player.
        Specified by:
        getPlayerExecutor in interface IPlayerManager
        Parameters:
        uniqueId - the uniqueId of the player to interact with
        Returns:
        a new PlayerExecutor
      • broadcastMessage

        public void broadcastMessage​(@NotNull
                                     @NotNull java.lang.String message)
        Description copied from interface: IPlayerManager
        Broadcasts a specific message over the whole network.
        Specified by:
        broadcastMessage in interface IPlayerManager
        Parameters:
        message - the message to be sent to all online players
      • broadcastMessage

        public void broadcastMessage​(@NotNull
                                     @NotNull java.lang.String message,
                                     @NotNull
                                     @NotNull java.lang.String permission)
        Description copied from interface: IPlayerManager
        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.
        Specified by:
        broadcastMessage in interface IPlayerManager
        Parameters:
        message - the message to be sent to all online players with the given permission
        permission - the permission to check for
      • getOnlineCloudPlayers

        public java.util.Map<java.util.UUID,​CloudPlayer> getOnlineCloudPlayers()
      • getDatabaseName

        public java.lang.String getDatabaseName()
      • logoutPlayer

        public void logoutPlayer​(CloudPlayer cloudPlayer)
      • logoutPlayer

        public void logoutPlayer​(java.util.UUID uniqueId,
                                 java.lang.String name)