mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-17 17:25:19 +01:00
Fix title encoding for fivem fixes #83
This commit is contained in:
parent
e2c734577a
commit
52ad7b1fd5
2 changed files with 3 additions and 2 deletions
|
@ -5,6 +5,7 @@ class FiveM extends require('./quake2') {
|
|||
super();
|
||||
this.sendHeader = 'getinfo xxx';
|
||||
this.responseHeader = 'infoResponse';
|
||||
this.encoding = 'utf8';
|
||||
}
|
||||
|
||||
finish(state) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue