Trok
19th February 2010, 23:22
Hi, I have a trouble during the logging by gg protocol from http://toxygen.net/libgadu/protocol/. I connect with server and receive seed, but after sent packet and structure to login, don't receive any message(even package with any wrong communique). That my code:
struct gg_header {
int type; /* typ pakietu */
int length; /* długość reszty pakietu */
};
struct gg_login80 {
int uin; /* numer Gadu-Gadu */ (gg number)
char* language; /* język: "pl" */
char hash_type; /* rodzaj funkcji skrótu hasła */
char* hash; /* skrót hasła dopełniony \0 */
int status; /* początkowy status połączenia */
int flags; /* początkowe flagi połączenia */
int features; /* opcje protokołu (0x00000007)*/(protocol option)
int local_ip; /* lokalny adres połączeń bezpośrednich (nieużywany) */
short local_port; /* lokalny port połączeń bezpośrednich (nieużywany) */
int external_ip; /* zewnętrzny adres (nieużywany) */
short external_port; /* zewnętrzny port (nieużywany) */
char image_size; /* maksymalny rozmiar grafiki w KB */
char unknown2; /* 0x64 */(idk)
int version_len; /* długość ciągu z wersją (0x21) */
char* version; /* "Gadu-Gadu Client build 8.0.0.7669" (bez \0) */
int description_size; /* rozmiar opisu */
};
void MainWindow::login_GG(){
gg_login80 *login = new gg_login80();
//example structure
login->uin = 1234567;
login->language = "pl";
login->hash_type = GG_LOGIN_HASH_GG32;
login->hash = "";
login->status = GG_STATUS_AVAIL;
login->flags = 0;
login->features = 0x7;
login->local_ip = 0;
login->local_port = 0;
login->external_ip = 0;
login->external_port = 0;
login->image_size = 0;
login->unknown2 = 0x64;
login->version_len = sizeof(login->version);
login->version = "";
login->description_size = 0;
gg_header *header = new gg_header;
header->type = GG_LOGIN80;
header->length = sizeof(GG_LOGIN80);
connect(socket, SIGNAL(readyRead()), this, SLOT(s_read()));
socket->write((char*)header, sizeof(gg_header));
socket->write((char*)login, sizeof(gg_login80));
}
void MainWindow::s_read(){
//That function doesn't call forth because server doesn't receive any package to read
qDebug () << "Receive packet.";
}
I test by tcpdump and appropriate functons in Qt, that packages are sending to server, unfortunately i don't recive anything (size of packet is 0).
struct gg_header {
int type; /* typ pakietu */
int length; /* długość reszty pakietu */
};
struct gg_login80 {
int uin; /* numer Gadu-Gadu */ (gg number)
char* language; /* język: "pl" */
char hash_type; /* rodzaj funkcji skrótu hasła */
char* hash; /* skrót hasła dopełniony \0 */
int status; /* początkowy status połączenia */
int flags; /* początkowe flagi połączenia */
int features; /* opcje protokołu (0x00000007)*/(protocol option)
int local_ip; /* lokalny adres połączeń bezpośrednich (nieużywany) */
short local_port; /* lokalny port połączeń bezpośrednich (nieużywany) */
int external_ip; /* zewnętrzny adres (nieużywany) */
short external_port; /* zewnętrzny port (nieużywany) */
char image_size; /* maksymalny rozmiar grafiki w KB */
char unknown2; /* 0x64 */(idk)
int version_len; /* długość ciągu z wersją (0x21) */
char* version; /* "Gadu-Gadu Client build 8.0.0.7669" (bez \0) */
int description_size; /* rozmiar opisu */
};
void MainWindow::login_GG(){
gg_login80 *login = new gg_login80();
//example structure
login->uin = 1234567;
login->language = "pl";
login->hash_type = GG_LOGIN_HASH_GG32;
login->hash = "";
login->status = GG_STATUS_AVAIL;
login->flags = 0;
login->features = 0x7;
login->local_ip = 0;
login->local_port = 0;
login->external_ip = 0;
login->external_port = 0;
login->image_size = 0;
login->unknown2 = 0x64;
login->version_len = sizeof(login->version);
login->version = "";
login->description_size = 0;
gg_header *header = new gg_header;
header->type = GG_LOGIN80;
header->length = sizeof(GG_LOGIN80);
connect(socket, SIGNAL(readyRead()), this, SLOT(s_read()));
socket->write((char*)header, sizeof(gg_header));
socket->write((char*)login, sizeof(gg_login80));
}
void MainWindow::s_read(){
//That function doesn't call forth because server doesn't receive any package to read
qDebug () << "Receive packet.";
}
I test by tcpdump and appropriate functons in Qt, that packages are sending to server, unfortunately i don't recive anything (size of packet is 0).