Packet descriptions
This commit is contained in:
49
lib/classes/packets/GroupActiveProposalItemReply.ts
Normal file
49
lib/classes/packets/GroupActiveProposalItemReply.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
// This file has been automatically generated by writePacketClasses.js
|
||||
|
||||
import {UUID} from '../UUID';
|
||||
import {MessageFlags} from '../../enums/MessageFlags';
|
||||
import {Packet} from '../Packet';
|
||||
|
||||
export class GroupActiveProposalItemReplyPacket implements Packet
|
||||
{
|
||||
name = 'GroupActiveProposalItemReply';
|
||||
flags = MessageFlags.Trusted | MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
||||
id = 4294902120;
|
||||
|
||||
AgentData: {
|
||||
AgentID: UUID;
|
||||
GroupID: UUID;
|
||||
};
|
||||
TransactionData: {
|
||||
TransactionID: UUID;
|
||||
TotalNumItems: number;
|
||||
};
|
||||
ProposalData: {
|
||||
VoteID: UUID;
|
||||
VoteInitiator: UUID;
|
||||
TerseDateID: string;
|
||||
StartDateTime: string;
|
||||
EndDateTime: string;
|
||||
AlreadyVoted: boolean;
|
||||
VoteCast: string;
|
||||
Majority: number;
|
||||
Quorum: number;
|
||||
ProposalText: string;
|
||||
}[];
|
||||
|
||||
getSize(): number
|
||||
{
|
||||
return ((this.calculateVarVarSize(this.ProposalData, 'TerseDateID', 1) + this.calculateVarVarSize(this.ProposalData, 'StartDateTime', 1) + this.calculateVarVarSize(this.ProposalData, 'EndDateTime', 1) + this.calculateVarVarSize(this.ProposalData, 'VoteCast', 1) + this.calculateVarVarSize(this.ProposalData, 'ProposalText', 1) + 41) * this.ProposalData.length) + 53;
|
||||
}
|
||||
|
||||
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