new RCONConnection(options)
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
options |
Object |
The initialization options.
|
Extends
- EventEmitter
Members
-
authTokenstring null
-
-
client
-
-
consecutiveTimeoutsnumber
-
-
hoststring
-
-
maxConsecutiveTimeoutsnumber
-
-
maxMessagesInAirnumber
-
-
messagesInAirnumber
-
-
passwordstring
-
-
portnumber
-
-
receiveBufferBuffer
-
-
requestCacheRecord.<number, RequestCacheItem>
-
-
socketnet.Socket
-
-
transmitMessageIndexnumber
-
-
xorKeyBuffer null
-
Methods
-
disconnect()
-
Closes the socket.
-
flushPendingRequests(error)
-
Resolves all pending requests with an error.
Name Type Description errorstring -
asyncsend(message, options){Promise.<ResponseMessage>}
-
Constructs and sends a RequestMessage to the RCON server.
Name Type Description messageObject The message payload.
Name Type Description namestring The command or action name.
contentBodyObject | string optional The body content of the message.
optionsObject optional Transmission configuration.
Name Type Default Description encryptboolean true optional Whether to send the buffer encrypted.
timeoutnumber 10000 optional Message timeout.
Returns:
Type Description Promise.<ResponseMessage> The resolved response from the server.