Class: RequestMessage

RequestMessage

Represents a message to be sent to the server.

new RequestMessage(connection, options)

Name Type Description
connection RCONConnection

The connection this message belongs to.

options Object

The message configuration.

Name Type Description
name string

The RCON command name.

contentBody string | Object optional

The RCON command body if applicable.

id number

Internal request id.

Members

connectionRCONConnection

contentBodystring

idnumber

namestring

versionnumber

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 Description
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 Description
Buffer The formatted unencrypted buffer.