diff --git a/protocols/fivem.js b/protocols/fivem.js index 595346f..a7c708d 100644 --- a/protocols/fivem.js +++ b/protocols/fivem.js @@ -5,6 +5,7 @@ class FiveM extends require('./quake2') { super(); this.sendHeader = 'getinfo xxx'; this.responseHeader = 'infoResponse'; + this.encoding = 'utf8'; } finish(state) { diff --git a/protocols/quake2.js b/protocols/quake2.js index 0f5678d..4550cda 100644 --- a/protocols/quake2.js +++ b/protocols/quake2.js @@ -12,14 +12,14 @@ class Quake2 extends require('./core') { this.udpSend('\xff\xff\xff\xff'+this.sendHeader+'\x00', (buffer) => { const reader = this.reader(buffer); - const header = reader.string({length:4}); + const header = reader.string({length:4,encoding:'latin1'}); if(header !== '\xff\xff\xff\xff') return; let response; if(this.isQuake1) { response = reader.string({length:this.responseHeader.length}); } else { - response = reader.string(); + response = reader.string({encoding:'latin1'}); } if(response !== this.responseHeader) return;