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
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder.Mutable<S extends eu.cloudnetservice.driver.document.property.DocPropertyHolder.Mutable<S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected longprotected NetworkPlayerProxyInfoprotected final Stringprotected eu.cloudnetservice.driver.document.Document -
Constructor Summary
ConstructorsConstructorDescriptionCloudOfflinePlayer(@NonNull String name, long firstLoginTimeMillis, long lastLoginTimeMillis, @NonNull NetworkPlayerProxyInfo proxyInfo, @NonNull eu.cloudnetservice.driver.document.Document properties) Constructs a new cloud offline player. -
Method Summary
Modifier and TypeMethodDescriptionclone()longGets the time-stamp when the player connected for the first time.longGets the time-stamp when the player connected last time.Gets the last known proxy player info for this player.voidlastNetworkPlayerProxyInfo(@NonNull NetworkPlayerProxyInfo lastNetworkPlayerProxyInfo) Sets the last known proxy player info of this player.name()Gets the name of this cloud player.static @NonNull CloudOfflinePlayerofflineCopy(@NonNull CloudPlayer onlineVariant) Creates an offline copy from the given cloud online player.@NonNull eu.cloudnetservice.driver.document.DocumentuniqueId()Gets the unique id of this cloud player from the last proxy info.xBoxId()Gets the xbox id of the player, null if the player does not have a xbox id.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow
-
Field Details
-
name
-
firstLoginTimeMillis
protected long firstLoginTimeMillis -
lastLoginTimeMillis
protected long lastLoginTimeMillis -
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 playerfirstLoginTimeMillis- 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
-
name
-
xBoxId
-
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
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
-
clone
-