Class CloudOfflinePlayer

java.lang.Object
eu.cloudnetservice.modules.bridge.player.CloudOfflinePlayer
All Implemented Interfaces:
eu.cloudnetservice.driver.base.Named, eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder, eu.cloudnetservice.driver.document.property.DocPropertyHolder, Cloneable
Direct Known Subclasses:
CloudPlayer

public class CloudOfflinePlayer extends Object implements eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder, Cloneable, eu.cloudnetservice.driver.base.Named
The offline player represents a player who was either already connected on one of the proxies or was created manually.

Obtain an offline player using PlayerManager.offlinePlayer(UUID).

Since:
4.0
  • Field Details

    • name

      protected final String name
    • firstLoginTimeMillis

      protected long firstLoginTimeMillis
    • lastLoginTimeMillis

      protected long lastLoginTimeMillis
    • lastNetworkPlayerProxyInfo

      protected NetworkPlayerProxyInfo lastNetworkPlayerProxyInfo
    • properties

      protected eu.cloudnetservice.driver.document.Document properties
  • Constructor Details

    • CloudOfflinePlayer

      public CloudOfflinePlayer(@NonNull @NonNull String name, long firstLoginTimeMillis, long lastLoginTimeMillis, @NonNull @NonNull NetworkPlayerProxyInfo proxyInfo, @NonNull @NonNull eu.cloudnetservice.driver.document.Document properties)
      Constructs a new cloud offline player.
      Parameters:
      name - the name of the cloud player
      firstLoginTimeMillis - the time-stamp the player connected the first time.
      lastLoginTimeMillis - the time-stamp the player connected the last time.
      proxyInfo - the player proxy info given information about the last connection to the proxy.
      properties - properties belonging to the player.
      Throws:
      NullPointerException - if the given name, proxy info or properties is null.
  • Method Details

    • offlineCopy

      @NonNull public static @NonNull CloudOfflinePlayer offlineCopy(@NonNull @NonNull CloudPlayer onlineVariant)
      Creates an offline copy from the given cloud online player.
      Parameters:
      onlineVariant - the online player to create a copy from.
      Returns:
      the new offline player copy.
      Throws:
      NullPointerException - if the given online player is null.
    • uniqueId

      @NonNull public @NonNull UUID uniqueId()
      Gets the unique id of this cloud player from the last proxy info.
      Returns:
      the unique id of the player.
    • name

      @NonNull public @NonNull String name()
      Gets the name of this cloud player.
      Specified by:
      name in interface eu.cloudnetservice.driver.base.Named
      Returns:
      the name of the player.
    • xBoxId

      @Nullable public @Nullable String xBoxId()
      Gets the xbox id of the player, null if the player does not have a xbox id.
      Returns:
      the xbox id of the player, null no xbox id was found.
    • firstLoginTimeMillis

      public long firstLoginTimeMillis()
      Gets the time-stamp when the player connected for the first time.
      Returns:
      the time-stamp for the fist connection.
    • lastLoginTimeMillis

      public long lastLoginTimeMillis()
      Gets the time-stamp when the player connected last time.
      Returns:
      the time-stamp for the last connection.
    • lastNetworkPlayerProxyInfo

      @NonNull public @NonNull NetworkPlayerProxyInfo lastNetworkPlayerProxyInfo()
      Gets the last known proxy player info for this player.
      Returns:
      the proxy player info for this player.
    • lastNetworkPlayerProxyInfo

      public void lastNetworkPlayerProxyInfo(@NonNull @NonNull NetworkPlayerProxyInfo lastNetworkPlayerProxyInfo)
      Sets the last known proxy player info of this player.
      Parameters:
      lastNetworkPlayerProxyInfo - the proxy info to set.
      Throws:
      NullPointerException - if the given proxy info is null.
    • propertyHolder

      @NonNull public @NonNull eu.cloudnetservice.driver.document.Document propertyHolder()
      Specified by:
      propertyHolder in interface eu.cloudnetservice.driver.document.property.DocPropertyHolder
    • clone

      Overrides:
      clone in class Object