Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void barrackBuilderCommanderList(uint64_t accountId, zmsg_t *replyMsg) {
- int commandersCount = 1;
- #pragma pack(push, 1)
- struct {
- VariableSizePacketHeader variableSizeHeader;
- uint64_t accountId;
- uint8_t unk1;
- uint8_t commandersCount;
- CommanderPkt commanders[commandersCount];
- } replyPacket;
- #pragma pack(pop)
- PacketType packetType = BC_COMMANDER_LIST;
- CHECK_SERVER_PACKET_SIZE(replyPacket, packetType);
- BUILD_REPLY_PACKET(replyPacket, replyMsg)
- {
- variableSizePacketHeaderInit(&replyPacket.variableSizeHeader, packetType, sizeof(replyPacket));
- replyPacket.accountId = accountId;
- replyPacket.unk1 = 1; // ICBT - equal to 1 or 4
- replyPacket.commandersCount = commandersCount;
- /*----------------------
- Test Code
- ------------------------*/
- for (int commanderIndex = 0; commanderIndex < replyPacket.commandersCount; commanderIndex++) {
- CommanderPkt *currentCommander = &replyPacket.commanders[commanderIndex];
- commanderInit(currentCommander);
- // Set some info
- strncpy(currentCommander->familyName, "MyTeamName", sizeof(currentCommander->familyName));
- strncpy(currentCommander->commanderName, "Fulanito", sizeof(currentCommander->commanderName));
- currentCommander->accountId = accountId;
- }
- /*----------------------------
- End test code
- ----------------------------*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement