Interface IPlayerManager

    • 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.
        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 with onlinePlayers()
        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.
        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.
        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 with onlinePlayers()
        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.
        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 cloud
        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.

        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)
        Connects an online player to a specific service.
        Parameters:
        cloudPlayer - the player to be connected
        serviceName - 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 connected
        serviceName - 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)
        Kicks an online player from the network with a specific reason.
        Parameters:
        cloudPlayer - the player to be kicked
        message - 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 kicked
        message - 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)
        Sends a message to a specific online player.
        Parameters:
        cloudPlayer - the player to send the message to
        message - 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 to
        message - 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)
        Sends a plugin message to a specific online player.
        Parameters:
        cloudPlayer - the player to send the message to
        tag - the tag of the plugin message
        data - 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 to
        tag - the tag of the plugin message
        data - the data of the plugin message
      • broadcastMessage

        @Deprecated
        void broadcastMessage​(@NotNull
                              @NotNull java.lang.String message)
        Deprecated.
        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.
        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 permission
        permission - the permission to check for