RequestMessage

RequestMessage

Represents a message to be sent to the server.

Constructor

new RequestMessage(connection, options)

Parameters:
Name Type Description
connection RCONConnection The connection this message belongs to.
options Object The message configuration.
Name Type Attributes Description
name string The RCON command name.
contentBody string <optional>
The RCON command body if applicable.
id number Internal request id.

Members

connection :RCONConnection

Type:

contentBody :string

Type:
  • string

id :number

Type:
  • number

name :string

Type:
  • string

version :number

Type:
  • number

Methods

toBuffer() → {Buffer}

Wraps this RequestMessage in an encrypted buffer to be directly sent through the socket.
Throws:
Throws if the XOR key is missing.
Type
Error
Returns:
Type:
Buffer
The encrypted buffer ready for transmission.

toUnencryptedBuffer() → {Buffer}

Wraps this RequestMessage in an unencrypted buffer to be directly sent through the socket.
Returns:
Type:
Buffer
The formatted unencrypted buffer.