Class NodePlayerExecutor

java.lang.Object
eu.cloudnetservice.modules.bridge.node.player.NodePlayerExecutor
All Implemented Interfaces:
PlayerExecutor

public class NodePlayerExecutor extends Object implements PlayerExecutor
  • Field Details

    • GLOBAL

      protected static final PlayerExecutor GLOBAL
    • targetUniqueId

      protected final UUID targetUniqueId
    • playerManager

      protected final PlayerManager playerManager
  • Constructor Details

  • Method Details

    • uniqueId

      @NonNull public @NonNull UUID uniqueId()
      Description copied from interface: PlayerExecutor
      Gets the unique id of this player executor. The ID of the player executor equals the unique id of the player this executor is for.

      A global player executor that performs the action for all players is identified by the PlayerExecutor.GLOBAL_UNIQUE_ID.

      Specified by:
      uniqueId in interface PlayerExecutor
      Returns:
      the unique id of the player executor.
    • connect

      public void connect(@NonNull @NonNull String serviceName)
      Description copied from interface: PlayerExecutor
      Connects the player associated with this player executor to the given service.
      Specified by:
      connect in interface PlayerExecutor
      Parameters:
      serviceName - the service to connect the player to.
    • connectSelecting

      public void connectSelecting(@NonNull @NonNull ServerSelectorType selectorType)
      Description copied from interface: PlayerExecutor
      Connects the player associated with this player executor to any service running the cluster. The service is chosen by the given server selector.
      Specified by:
      connectSelecting in interface PlayerExecutor
      Parameters:
      selectorType - the selector used for the service selection.
    • connectToFallback

      public void connectToFallback()
      Description copied from interface: PlayerExecutor
      Connects the player associated with this player executor to the best matching fallback.
      Specified by:
      connectToFallback in interface PlayerExecutor
    • connectToGroup

      public void connectToGroup(@NonNull @NonNull String group, @NonNull @NonNull ServerSelectorType selectorType)
      Description copied from interface: PlayerExecutor
      Connects the player associated with this player executor to any service having the given group assigned. The service is chosen by the given server selector.
      Specified by:
      connectToGroup in interface PlayerExecutor
      Parameters:
      group - the group a service has to have.
      selectorType - the selector used for the service selection.
    • connectToTask

      public void connectToTask(@NonNull @NonNull String task, @NonNull @NonNull ServerSelectorType selectorType)
      Description copied from interface: PlayerExecutor
      Connects the player associated with this player executor to any service having the given task assigned. The service is chosen by the given server selector.
      Specified by:
      connectToTask in interface PlayerExecutor
      Parameters:
      task - the task the service has to have.
      selectorType - the selector used for the service selection.
    • kick

      public void kick(@NonNull @NonNull Component message)
      Description copied from interface: PlayerExecutor
      Kicks the player associated with this player executor and the component as reason.
      Specified by:
      kick in interface PlayerExecutor
      Parameters:
      message - the message to display in the disconnect screen.
    • sendTitle

      public void sendTitle(@NonNull @NonNull Title title)
      Description copied from interface: PlayerExecutor
      Sends the given title to the player associated with this player executor.
      Specified by:
      sendTitle in interface PlayerExecutor
      Parameters:
      title - the title to display to the player.
    • sendChatMessage

      public void sendChatMessage(@NonNull @NonNull Component message, @Nullable @Nullable String permission)
      Description copied from interface: PlayerExecutor
      Sends the given message component as chat message to the player associated with this player executor.

      If a permission is given the player is required to have the permission, otherwise the message is not sent.

      Specified by:
      sendChatMessage in interface PlayerExecutor
      Parameters:
      message - the message to send to the player.
      permission - the permission required to get the message.
    • sendPluginMessage

      public void sendPluginMessage(@NonNull @NonNull String key, byte[] data)
      Description copied from interface: PlayerExecutor
      Sends a plugin channel message to the player associated with this player executor using the given channel and data. The channel used has to be registered on the service software.
      Specified by:
      sendPluginMessage in interface PlayerExecutor
      Parameters:
      key - the channel to send the plugin message in.
      data - the data to send to the player.
    • spoofCommandExecution

      public void spoofCommandExecution(@NonNull @NonNull String command, boolean redirectToServer)
      Description copied from interface: PlayerExecutor
      Spoofs the command execution for the player associated with this player executor. The given command input should not contain a leading slash as it is added on the fly.

      If redirecting to the downstream service is desired the command is executed on the proxy first, if no command was found it is redirected to the downstream service the player is connected to.

      Specified by:
      spoofCommandExecution in interface PlayerExecutor
      Parameters:
      command - the command to execute for the player.
      redirectToServer - whether to command should get redirected to the downstream.
    • toProxy

      @NonNull protected eu.cloudnetservice.driver.channel.ChannelMessage.Builder toProxy()