Latest packet handling, parsing, enums, generators, etc..

This commit is contained in:
Casper Warden
2017-11-24 17:45:34 +00:00
parent ec300e33ac
commit 261f28698a
496 changed files with 30448 additions and 57 deletions

View File

@@ -19,4 +19,32 @@ export class ReportAutosaveCrashPacket implements Packet
return 8;
}
writeToBuffer(buf: Buffer, pos: number): number
{
const startPos = pos;
buf.writeInt32LE(this.AutosaveData['PID'], pos);
pos += 4;
buf.writeInt32LE(this.AutosaveData['Status'], pos);
pos += 4;
return pos - startPos;
}
readFromBuffer(buf: Buffer, pos: number): number
{
const startPos = pos;
const newObjAutosaveData: {
PID: number,
Status: number
} = {
PID: 0,
Status: 0
};
newObjAutosaveData['PID'] = buf.readInt32LE(pos);
pos += 4;
newObjAutosaveData['Status'] = buf.readInt32LE(pos);
pos += 4;
this.AutosaveData = newObjAutosaveData;
return pos - startPos;
}
}