Packet descriptions
This commit is contained in:
41
lib/classes/packets/GenericMessage.ts
Normal file
41
lib/classes/packets/GenericMessage.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
// This file has been automatically generated by writePacketClasses.js
|
||||
|
||||
import {UUID} from '../UUID';
|
||||
import {MessageFlags} from '../../enums/MessageFlags';
|
||||
import {Packet} from '../Packet';
|
||||
|
||||
export class GenericMessagePacket implements Packet
|
||||
{
|
||||
name = 'GenericMessage';
|
||||
flags = MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
||||
id = 4294902021;
|
||||
|
||||
AgentData: {
|
||||
AgentID: UUID;
|
||||
SessionID: UUID;
|
||||
TransactionID: UUID;
|
||||
};
|
||||
MethodData: {
|
||||
Method: string;
|
||||
Invoice: UUID;
|
||||
};
|
||||
ParamList: {
|
||||
Parameter: string;
|
||||
}[];
|
||||
|
||||
getSize(): number
|
||||
{
|
||||
return (this.MethodData['Method'].length + 1) + ((this.calculateVarVarSize(this.ParamList, 'Parameter', 1)) * this.ParamList.length) + 65;
|
||||
}
|
||||
|
||||
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number
|
||||
{
|
||||
let size = 0;
|
||||
block.forEach((bl: any) =>
|
||||
{
|
||||
size += bl[paramName].length + extraPerVar;
|
||||
});
|
||||
return size;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user