UDP Circuit basics, message changes
This commit is contained in:
53
lib/classes/messages/DetachAttachmentIntoInv.ts
Normal file
53
lib/classes/messages/DetachAttachmentIntoInv.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
// This file has been automatically generated by writeMessageClasses.js
|
||||
|
||||
import {UUID} from '../UUID';
|
||||
import {MessageFlags} from '../../enums/MessageFlags';
|
||||
import {MessageBase} from '../MessageBase';
|
||||
import {Message} from '../../enums/Message';
|
||||
|
||||
export class DetachAttachmentIntoInvMessage implements MessageBase
|
||||
{
|
||||
name = 'DetachAttachmentIntoInv';
|
||||
messageFlags = MessageFlags.FrequencyLow;
|
||||
id = Message.DetachAttachmentIntoInv;
|
||||
|
||||
ObjectData: {
|
||||
AgentID: UUID;
|
||||
ItemID: UUID;
|
||||
};
|
||||
|
||||
getSize(): number
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
writeToBuffer(buf: Buffer, pos: number): number
|
||||
{
|
||||
const startPos = pos;
|
||||
this.ObjectData['AgentID'].writeToBuffer(buf, pos);
|
||||
pos += 16;
|
||||
this.ObjectData['ItemID'].writeToBuffer(buf, pos);
|
||||
pos += 16;
|
||||
return pos - startPos;
|
||||
}
|
||||
|
||||
readFromBuffer(buf: Buffer, pos: number): number
|
||||
{
|
||||
const startPos = pos;
|
||||
let varLength = 0;
|
||||
const newObjObjectData: {
|
||||
AgentID: UUID,
|
||||
ItemID: UUID
|
||||
} = {
|
||||
AgentID: UUID.zero(),
|
||||
ItemID: UUID.zero()
|
||||
};
|
||||
newObjObjectData['AgentID'] = new UUID(buf, pos);
|
||||
pos += 16;
|
||||
newObjObjectData['ItemID'] = new UUID(buf, pos);
|
||||
pos += 16;
|
||||
this.ObjectData = newObjObjectData;
|
||||
return pos - startPos;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user