Skip to content

Commit

Permalink
Merge pull request #261 from ect0s/RconPasswordLogging
Browse files Browse the repository at this point in the history
Do Not Log Password in RCON unless Logger verbosity is 4
  • Loading branch information
werewolfboy13 committed Nov 1, 2023
2 parents 31aad28 + 519dab9 commit bb41ce0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/rcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ export default class Rcon extends EventEmitter {
return;
}

Logger.verbose('RCON', 2, `Writing packet with type "${type}" and body "${body}".`);

const encodedPacket = this.encodePacket(
type,
type !== SERVERDATA_AUTH ? MID_PACKET_ID : END_PACKET_ID,
Expand All @@ -290,6 +288,8 @@ export default class Rcon extends EventEmitter {

// the auth packet also sends a normal response, so we add an extra empty action to ignore it
if (type === SERVERDATA_AUTH) {
Logger.verbose('RCON', 2, `Writing Auth Packet`);
Logger.verbose('RCON', 4, `Writing packet with type "${type}" and body "${body}".`);
this.responseCallbackQueue.push(() => {});
this.responseCallbackQueue.push((decodedPacket) => {
this.client.removeListener('error', onError);
Expand All @@ -302,6 +302,7 @@ export default class Rcon extends EventEmitter {
}
});
} else {
Logger.verbose('RCON', 2, `Writing packet with type "${type}" and body "${body}".`);
this.responseCallbackQueue.push((response) => {
this.client.removeListener('error', onError);

Expand Down

0 comments on commit bb41ce0

Please sign in to comment.