Class BridgePlayerManager

    • Constructor Detail

      • BridgePlayerManager

        public BridgePlayerManager()
    • Method Detail

      • getInstance

        @Deprecated
        public static IPlayerManager getInstance()
        Deprecated.
        IPlayerManager should be accessed through the IServicesRegistry
      • 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 ICloudPlayer 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<? extends ICloudPlayer> 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
      • taskOnlinePlayers

        @NotNull
        public @NotNull PlayerProvider taskOnlinePlayers​(@NotNull
                                                         @NotNull java.lang.String task)
        Description copied from interface: IPlayerManager
        Gets a PlayerProvider which returns a list of all online players on a specific task.
        Specified by:
        taskOnlinePlayers in interface IPlayerManager
        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: IPlayerManager
        Gets a PlayerProvider which returns a list of all online players on a specific group.
        Specified by:
        groupOnlinePlayers in interface IPlayerManager
      • 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

        public java.util.List<? extends ICloudOfflinePlayer> getRegisteredPlayers()
        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.

        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:
        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<? extends 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
      • updateOfflinePlayer

        public void updateOfflinePlayer​(@NotNull
                                        @NotNull ICloudOfflinePlayer cloudOfflinePlayer)
        Description copied from interface: IPlayerManager
        Updates the given player to the database of the cloud and calls an update event on the whole network.
        Specified by:
        updateOfflinePlayer in interface IPlayerManager
        Parameters:
        cloudOfflinePlayer - the player to be updated
      • updateOnlinePlayer

        public void updateOnlinePlayer​(@NotNull
                                       @NotNull ICloudPlayer cloudPlayer)
        Description copied from interface: IPlayerManager
        Updates the given player to the database of the cloud and calls the player update event.
        Specified by:
        updateOnlinePlayer in interface IPlayerManager
        Parameters:
        cloudPlayer - the player to be updated
      • deleteCloudOfflinePlayer

        public void deleteCloudOfflinePlayer​(@NotNull
                                             @NotNull ICloudOfflinePlayer cloudOfflinePlayer)
        Description copied from interface: IPlayerManager
        Deletes the given player from the database and notifies all connected components.
        Specified by:
        deleteCloudOfflinePlayer in interface IPlayerManager
        Parameters:
        cloudOfflinePlayer - the player to be deleted
      • deleteCloudOfflinePlayerAsync

        public de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> deleteCloudOfflinePlayerAsync​(@NotNull
                                                                                                         @NotNull ICloudOfflinePlayer cloudOfflinePlayer)
        Description copied from interface: IPlayerManager
        Deletes the given player from the database async and notifies all connected components.
        Specified by:
        deleteCloudOfflinePlayerAsync in interface IPlayerManager
        Parameters:
        cloudOfflinePlayer - the player to be deleted