mc_rcon_dart library

Properties

rconSck Socket?
The socket that is used to communicate with the RCON server. Generated when createSocket() is run.
getter/setter pair
requestID int
The randomly generated request ID that is sent with every message to the RCON server. Used to ensure that the commands sent to and received from the server are ours, and not another user's.
getter/setter pair

Functions

close() bool
Closes the socket to the RCON server. Returns a bool that specified whether the socket was successfully destroyed.
createSocket(String host, {int port = 25575}) Future<void>
Creates and stores a socket connected to the RCON server with the given host (IP/FQDN) and port.
listen(Function onData) bool
Starts listening on the socket for packets sent by the RCON server. Returns a boolean that specifies if the socket has started listening. Note: onData must accept a Uint8List as the only parameter. The payload of the message starts at element 12.
login(String password) bool
Log in to the RCON server using the given socket and password. Returns a boolean that specifies if the command was successful.
sendCommand(String message) bool
Send the provided command to the RCON server using the Returns a boolean that specifies if the command was successful.
sendMsg(int msgID, String msg) bool
Send a message with the given message ID and message payload. Returns a boolean that specifies if the command was successful.