1515import net .kyori .adventure .text .serializer .gson .GsonComponentSerializer ;
1616
1717import java .time .Duration ;
18+ import java .util .Collections ;
19+ import java .util .HashMap ;
20+ import java .util .Map ;
1821import java .util .UUID ;
1922import java .util .concurrent .CompletableFuture ;
2023
@@ -32,26 +35,48 @@ public class CloudPlayerImpl implements CloudPlayer, ForwardingAudience.Single {
3235 private final UUID uniqueId ;
3336 private final String name ;
3437 private final String displayName ;
35- private final String connectedProxyId ;
36- private final String connectedServerId ;
38+ private final String connectedProxyName ;
39+ private final String connectedServerName ;
40+ private final boolean online ;
41+ private final long onlineTimeSeconds ;
42+ private final String sessionId ;
43+ private final String firstSeen ;
44+ private final String lastSeen ;
45+ private final Map <String , String > properties ;
3746
3847 public CloudPlayerImpl (
3948 Connection natsConnection ,
4049 String networkId ,
4150 UUID uniqueId ,
4251 String name ,
4352 String displayName ,
44- String connectedProxyId ,
45- String connectedServerId
53+ String connectedProxyName ,
54+ String connectedServerName ,
55+ boolean online ,
56+ long onlineTimeSeconds ,
57+ String sessionId ,
58+ String firstSeen ,
59+ String lastSeen ,
60+ Map <String , String > properties
4661 ) {
4762 this .natsConnection = natsConnection ;
4863 this .networkId = networkId ;
4964 this .audience = RemoteAudience .builder (natsConnection , networkId ).forPlayer (uniqueId );
5065 this .uniqueId = uniqueId ;
5166 this .name = name ;
5267 this .displayName = displayName ;
53- this .connectedProxyId = connectedProxyId ;
54- this .connectedServerId = connectedServerId ;
68+ this .connectedProxyName = connectedProxyName ;
69+ this .connectedServerName = connectedServerName ;
70+ this .online = online ;
71+ this .onlineTimeSeconds = onlineTimeSeconds ;
72+ this .sessionId = sessionId ;
73+ this .firstSeen = firstSeen ;
74+ this .lastSeen = lastSeen ;
75+ if (properties == null || properties .isEmpty ()) {
76+ this .properties = Collections .emptyMap ();
77+ } else {
78+ this .properties = Collections .unmodifiableMap (new HashMap <>(properties ));
79+ }
5580 }
5681
5782 @ Override
@@ -77,13 +102,43 @@ public String getDisplayName() {
77102 }
78103
79104 @ Override
80- public String getConnectedProxyId () {
81- return connectedProxyId ;
105+ public String getConnectedProxyName () {
106+ return connectedProxyName ;
82107 }
83108
84109 @ Override
85- public String getConnectedServerId () {
86- return connectedServerId ;
110+ public String getConnectedServerName () {
111+ return connectedServerName ;
112+ }
113+
114+ @ Override
115+ public boolean isOnline () {
116+ return online ;
117+ }
118+
119+ @ Override
120+ public long getOnlineTimeSeconds () {
121+ return onlineTimeSeconds ;
122+ }
123+
124+ @ Override
125+ public String getSessionId () {
126+ return sessionId ;
127+ }
128+
129+ @ Override
130+ public String getFirstSeen () {
131+ return firstSeen ;
132+ }
133+
134+ @ Override
135+ public String getLastSeen () {
136+ return lastSeen ;
137+ }
138+
139+ @ Override
140+ public Map <String , String > getProperties () {
141+ return properties ;
87142 }
88143
89144 @ Override
0 commit comments