<commit_before>#include <string.h>
#include "ShipBlockPacket.h"

ShipBlockPacket::ShipBlockPacket(uint8_t ip1, uint8_t ip2, uint8_t ip3, uint8_t ip4, uint16_t port) {
    uint8_t ipBits[] = { ip1, ip2, ip3, ip4 };
    memcpy(this->ipaddr, ipBits, sizeof(ipBits));
    this->port = port;
}

ShipBlockPacket::~ShipBlockPacket() {}

PacketData ShipBlockPacket::build() {
    PacketData data;
    PacketHeader header(0x90, 0x11, 0x2C, 0x0, 0x0);
    data.appendData(&header, sizeof(header));

    data.appendBytes(0, 0x64 - sizeof(header));

    // Offset 0x64
    data.appendData(&ipaddr, 4);

    // Offset 0x68
    data.appendData(&port, 2);

    data.appendBytes(0, 0x90 - 0x6A);
<commit_msg>About that data size...<commit_after>#include <string.h>
#include "ShipBlockPacket.h"

ShipBlockPacket::ShipBlockPacket(uint8_t ip1, uint8_t ip2, uint8_t ip3, uint8_t ip4, uint16_t port) {
    uint8_t ipBits[] = { ip1, ip2, ip3, ip4 };
    memcpy(this->ipaddr, ipBits, sizeof(ipBits));
    this->port = port;
}

ShipBlockPacket::~ShipBlockPacket() {}

PacketData ShipBlockPacket::build() {
    PacketData data(0x90);
    PacketHeader header(0x90, 0x11, 0x2C, 0x0, 0x0);
    data.appendData(&header, sizeof(header));

    data.appendBytes(0, 0x64 - sizeof(header));

    // Offset 0x64
    data.appendData(&ipaddr, 4);

    // Offset 0x68
    data.appendData(&port, 2);

    data.appendBytes(0, 0x90 - 0x6A);

{'fraction_non_alphanumeric': 0.14785714285714285, 'fraction_numerical': 0.06642857142857143, 'mean_word_length': 4.094545454545455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4436670', 'n_tokens_mistral': 584, 'n_tokens_neox': 542, 'n_words': 107}