38 lines
974 B
TypeScript
38 lines
974 B
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 SystemMessagePacket implements Packet
|
||
|
|
{
|
||
|
|
name = 'SystemMessage';
|
||
|
|
flags = MessageFlags.Trusted | MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
||
|
|
id = 4294902164;
|
||
|
|
|
||
|
|
MethodData: {
|
||
|
|
Method: string;
|
||
|
|
Invoice: UUID;
|
||
|
|
Digest: Buffer;
|
||
|
|
};
|
||
|
|
ParamList: {
|
||
|
|
Parameter: string;
|
||
|
|
}[];
|
||
|
|
|
||
|
|
getSize(): number
|
||
|
|
{
|
||
|
|
return (this.MethodData['Method'].length + 1) + ((this.calculateVarVarSize(this.ParamList, 'Parameter', 1)) * this.ParamList.length) + 49;
|
||
|
|
}
|
||
|
|
|
||
|
|
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number
|
||
|
|
{
|
||
|
|
let size = 0;
|
||
|
|
block.forEach((bl: any) =>
|
||
|
|
{
|
||
|
|
size += bl[paramName].length + extraPerVar;
|
||
|
|
});
|
||
|
|
return size;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|