- Kod: Zaznacz cały
vector<char> buff(sizeof(gg_header) + sizeof(gg_send_msg80));
gg_header* gg_hdr = (gg_header*) &buff[0];
gg_send_msg80* gg_send = (gg_send_msg80*)(gg_hdr + 1);
string msg = "blablabla";
gg_hdr->type = GG_SEND_MSG80;
msg.append(1,'\0');
time_t sekundy;
sekundy = time (NULL);
gg_send->recipient = 18199693;
gg_send->seq = sekundy;
gg_send->clas = 0x0008;
gg_send->offset_plain = sizeof(gg_send_msg80) + 1;
gg_send->offset_attributes = gg_send->offset_plain + msg.size();
buff.push_back('\0');
buff.insert(buff.end(),msg.begin(),msg.end());
char tab[] = { 2, 6, 0, 0, 0, 8, 0, 0, 0 };
buff.insert(buff.end(),tab,tab + sizeof(tab));
gg_hdr = (gg_header*) &buff[0];
gg_hdr->length = buff.size() - sizeof(gg_header);
Client->Socket->SendBuf(&buff[0],buff.size());
Rezultat ten sam przychodzi pusta wiadomość.