Class RemotePlayer
java.lang.Object
net.ME1312.SubServers.Client.Common.Network.API.RemotePlayer
- Direct Known Subclasses:
CachedPlayer
Simplified RemotePlayer Data Class
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
RemotePlayer Static Implementation Class -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionRemotePlayer
(ObjectMap<String> raw) Create an API representation of a Remote Playerprotected
RemotePlayer
(DataClient client, ObjectMap<String> raw) Create an API representation of a Remote Player -
Method Summary
Modifier and TypeMethodDescriptionstatic void
broadcastMessage
(String... messages) Sends messages to all playersstatic void
broadcastMessage
(String[] messages, IntConsumer response) Sends messages to all playersstatic void
broadcastMessage
(String message, IntConsumer response) Sends a message to all playersstatic void
broadcastRawMessage
(String... messages) Sends JSON format messages to all playersstatic void
broadcastRawMessage
(String[] messages, IntConsumer response) Sends JSON format messages to all playersstatic void
broadcastRawMessage
(String message, IntConsumer response) Sends a JSON format message to all playersvoid
Disconnects this player from the networkvoid
disconnect
(String reason) Disconnects this player from the networkvoid
disconnect
(String reason, IntConsumer response) Disconnects this player from the networkvoid
disconnect
(IntConsumer response) Disconnects this player from the networkstatic void
disconnect
(UUID... players) Disconnects these players from the networkstatic void
disconnect
(UUID[] players, String reason) Disconnects these players from the networkstatic void
disconnect
(UUID[] players, String reason, IntConsumer response) Disconnects these players from the networkstatic void
disconnect
(UUID[] players, IntConsumer response) Disconnects these players from the networkboolean
Gets the remote address of this connection.getName()
Get the unique name of this player.void
Gets the proxy this player is connected to.Gets the proxy this player is connected to.getRaw()
Get the raw representation of the Servervoid
Gets the server this player is connected to.Gets the server this player is connected to.long
Get the Timestamp for when the data was last refreshedGet the UUID of this player.void
refresh()
Download a new copy of the data from SubDatavoid
sendMessage
(String... messages) Sends messages to this playervoid
sendMessage
(String[] messages, IntConsumer response) Sends messages to this playervoid
sendMessage
(String message, IntConsumer response) Sends a message to this playerstatic void
sendMessage
(UUID[] players, String... messages) Sends messages to these playersstatic void
sendMessage
(UUID[] players, String[] messages, IntConsumer response) Sends messages to these playersstatic void
sendMessage
(UUID[] players, String message, IntConsumer response) Sends a message to these playersvoid
sendRawMessage
(String... messages) Sends JSON format messages to this playervoid
sendRawMessage
(String[] message, IntConsumer response) Sends JSON format messages to this playervoid
sendRawMessage
(String message, IntConsumer response) Sends a JSON format message to this playerstatic void
sendRawMessage
(UUID[] players, String... messages) Sends JSON format messages to these playersstatic void
sendRawMessage
(UUID[] players, String[] messages, IntConsumer response) Sends JSON format messages to these playersstatic void
sendRawMessage
(UUID[] players, String message, IntConsumer response) Sends a JSON format message to these playersvoid
Transfers this player to another servervoid
transfer
(String server, IntConsumer response) Transfers this player to another serverstatic void
Transfers these players to another serverstatic void
transfer
(UUID[] players, String server, IntConsumer response) Transfers these players to another server
-
Field Details
-
instance
-
-
Constructor Details
-
RemotePlayer
Create an API representation of a Remote Player- Parameters:
raw
- Raw representation of the Remote Player
-
RemotePlayer
Create an API representation of a Remote Player- Parameters:
client
- SubData connectionraw
- Raw representation of the Remote Player
-
-
Method Details
-
equals
-
refresh
public void refresh()Download a new copy of the data from SubData -
getUniqueId
Get the UUID of this player.- Returns:
- the UUID
-
getName
Get the unique name of this player.- Returns:
- the player's username
-
getAddress
Gets the remote address of this connection.- Returns:
- the remote address
-
getProxyName
Gets the proxy this player is connected to.- Returns:
- the proxy this player is connected to
-
getProxy
Gets the proxy this player is connected to.- Parameters:
callback
- the proxy this player is connected to
-
getServerName
Gets the server this player is connected to.- Returns:
- the server this player is connected to
-
getServer
Gets the server this player is connected to.- Parameters:
callback
- the server this player is connected to
-
broadcastMessage
Sends messages to all players- Parameters:
messages
- Messages to send
-
broadcastMessage
Sends a message to all players- Parameters:
message
- Message to sendresponse
- Success Status
-
broadcastMessage
Sends messages to all players- Parameters:
messages
- Messages to sendresponse
- Success Status
-
sendMessage
Sends messages to this player- Parameters:
messages
- Messages to send
-
sendMessage
Sends a message to this player- Parameters:
message
- Message to sendresponse
- Success Status
-
sendMessage
Sends messages to this player- Parameters:
messages
- Messages to sendresponse
- Success Status
-
sendMessage
Sends messages to these players- Parameters:
players
- Players to selectmessages
- Messages to send
-
sendMessage
Sends a message to these players- Parameters:
players
- Players to selectmessage
- Message to sendresponse
- Success Status
-
sendMessage
Sends messages to these players- Parameters:
players
- Players to selectmessages
- Messages to sendresponse
- Success Status
-
broadcastRawMessage
Sends JSON format messages to all players- Parameters:
messages
- Messages to send
-
broadcastRawMessage
Sends a JSON format message to all players- Parameters:
message
- Message to sendresponse
- Success Status
-
broadcastRawMessage
Sends JSON format messages to all players- Parameters:
messages
- Messages to sendresponse
- Success Status
-
sendRawMessage
Sends JSON format messages to this player- Parameters:
messages
- Messages to send
-
sendRawMessage
Sends a JSON format message to this player- Parameters:
message
- Message to sendresponse
- Success Status
-
sendRawMessage
Sends JSON format messages to this player- Parameters:
message
- Message to sendresponse
- Success Status
-
sendRawMessage
Sends JSON format messages to these players- Parameters:
players
- Players to selectmessages
- Messages to send
-
sendRawMessage
Sends a JSON format message to these players- Parameters:
players
- Players to selectmessage
- Message to sendresponse
- Success Status
-
sendRawMessage
Sends JSON format messages to these players- Parameters:
players
- Players to selectmessages
- Messages to sendresponse
- Success Status
-
transfer
Transfers this player to another server- Parameters:
server
- Target server
-
transfer
Transfers this player to another server- Parameters:
server
- Target serverresponse
- Success status
-
transfer
Transfers these players to another server- Parameters:
players
- Players to selectserver
- Target server
-
transfer
Transfers these players to another server- Parameters:
players
- Players to selectserver
- Target serverresponse
- Success status
-
disconnect
public void disconnect()Disconnects this player from the network -
disconnect
Disconnects this player from the network- Parameters:
response
- Success status
-
disconnect
Disconnects this player from the network- Parameters:
reason
- Disconnect Reason
-
disconnect
Disconnects this player from the network- Parameters:
reason
- Disconnect Reasonresponse
- Success status
-
disconnect
Disconnects these players from the network- Parameters:
players
- Players to select
-
disconnect
Disconnects these players from the network- Parameters:
players
- Players to selectresponse
- Success status
-
disconnect
Disconnects these players from the network- Parameters:
players
- Players to selectreason
- Disconnect Reason
-
disconnect
Disconnects these players from the network- Parameters:
players
- Players to selectreason
- Disconnect Reasonresponse
- Success status
-
getTimestamp
public long getTimestamp()Get the Timestamp for when the data was last refreshed- Returns:
- Data Timestamp
-
getRaw
Get the raw representation of the Server- Returns:
- Raw Server
-