pushrax/node-rcon

Get console messages

KSti56 opened this issue · 4 comments

Is it possible to get console messages when they are sent through RCON?

Anything sent by the server should show up in the response callback. Are you running into a specific issue?

Anything sent by the server should show up in the response callback. Are you running into a specific issue?

No, that's only when it's a response. I tried the server callback but it doesn't seem to work.

There are no other documented packet types https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Requests_and_Responses.

Could you try adding a debug log to a new else condition in this codepath to see if you're getting back packets of an undocumented type?

node-rcon/node-rcon.js

Lines 148 to 162 in 9c05be5

if (!this.hasAuthed && type == PacketType.RESPONSE_AUTH) {
this.hasAuthed = true;
this.emit('auth');
} else if (type == PacketType.RESPONSE_VALUE) {
// Read just the body of the packet (truncate the last null byte)
// See https://developer.valvesoftware.com/wiki/Source_RCON_Protocol for details
var str = data.toString('utf8', 12, 12 + len - 10);
if (str.charAt(str.length - 1) === '\n') {
// Emit the response without the newline.
str = str.substring(0, str.length - 1);
}
this.emit('response', str);
}

Never mind, I realised that the server doesn't send those over RCON