52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
// This file has been automatically generated by writePacketClasses.js
|
|
|
|
import {UUID} from '../UUID';
|
|
import {MessageFlags} from '../../enums/MessageFlags';
|
|
import {Packet} from '../Packet';
|
|
|
|
export class TransferInventoryAckPacket implements Packet
|
|
{
|
|
name = 'TransferInventoryAck';
|
|
flags = MessageFlags.Trusted | MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
|
id = 4294902056;
|
|
|
|
InfoBlock: {
|
|
TransactionID: UUID;
|
|
InventoryID: UUID;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return 32;
|
|
}
|
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
this.InfoBlock['TransactionID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.InfoBlock['InventoryID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
return pos - startPos;
|
|
}
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
const newObjInfoBlock: {
|
|
TransactionID: UUID,
|
|
InventoryID: UUID
|
|
} = {
|
|
TransactionID: UUID.zero(),
|
|
InventoryID: UUID.zero()
|
|
};
|
|
newObjInfoBlock['TransactionID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjInfoBlock['InventoryID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
this.InfoBlock = newObjInfoBlock;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|