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
|
|
@ -4,7 +4,7 @@ class Ase extends Core {
|
|||
async run(state) {
|
||||
const buffer = await this.udpSend('s',(buffer) => {
|
||||
const reader = this.reader(buffer);
|
||||
const header = reader.string({length: 4});
|
||||
const header = reader.string(4);
|
||||
if (header === 'EYE1') return reader.rest();
|
||||
});
|
||||
|
||||
|
|
@ -40,8 +40,7 @@ class Ase extends Core {
|
|||
}
|
||||
|
||||
readString(reader) {
|
||||
const len = reader.uint(1);
|
||||
return reader.string({length:len-1});
|
||||
return reader.pascalString(1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue