mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 15:17:36 +00:00
Clean up reader.string
This commit is contained in:
parent
6189d2fa62
commit
fc5975bf0c
12 changed files with 58 additions and 61 deletions
|
|
@ -16,10 +16,10 @@ class Doom3 extends Core {
|
|||
if(header !== 0xffff) return;
|
||||
const header2 = reader.string();
|
||||
if(header2 !== 'infoResponse') return;
|
||||
const challengePart1 = reader.string({length:4});
|
||||
const challengePart1 = reader.string(4);
|
||||
if (challengePart1 !== "PiNG") return;
|
||||
// some doom3 implementations only return the first 4 bytes of the challenge
|
||||
const challengePart2 = reader.string({length:4});
|
||||
const challengePart2 = reader.string(4);
|
||||
if (challengePart2 !== 'PoNg') reader.skip(-4);
|
||||
return reader.rest();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue