42 lines
1.0 KiB
TypeScript
42 lines
1.0 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 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;
|
|
}
|
|
|
|
}
|