Packet descriptions
This commit is contained in:
39
lib/classes/packets/AlertMessage.ts
Normal file
39
lib/classes/packets/AlertMessage.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
// This file has been automatically generated by writePacketClasses.js
|
||||
|
||||
import {UUID} from '../UUID';
|
||||
import {MessageFlags} from '../../enums/MessageFlags';
|
||||
import {Packet} from '../Packet';
|
||||
|
||||
export class AlertMessagePacket implements Packet
|
||||
{
|
||||
name = 'AlertMessage';
|
||||
flags = MessageFlags.Trusted | MessageFlags.FrequencyLow;
|
||||
id = 4294901894;
|
||||
|
||||
AlertData: {
|
||||
Message: string;
|
||||
};
|
||||
AlertInfo: {
|
||||
Message: string;
|
||||
ExtraParams: string;
|
||||
}[];
|
||||
AgentInfo: {
|
||||
AgentID: UUID;
|
||||
}[];
|
||||
|
||||
getSize(): number
|
||||
{
|
||||
return (this.AlertData['Message'].length + 1) + ((this.calculateVarVarSize(this.AlertInfo, 'Message', 1) + this.calculateVarVarSize(this.AlertInfo, 'ExtraParams', 1)) * this.AlertInfo.length) + ((16) * this.AgentInfo.length) + 2;
|
||||
}
|
||||
|
||||
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