Sun, 16 Mar 2003 00:01:49 +0000
[gaim-migrate @ 5113]
this removes all the remaining deprecated glib, gdk, gdk-pixbuf, and gtk
function calls. Hopefully I didn't break anything.
Most of this is due to the deprecation of g_strcasecmp and g_strncasecmp.
Two functions I never thought would be deprecated, but apparently they're
no good at comparing utf8 text. g_ascii_str{,n}casecmp is OK when you're
sure that it's ASCII. Otherwise, we're supposed to use g_utf8_collate(),
except that it is case sensitive. Since glib doesn't currently have a
case-insensitive one, I wrote one. If you need to compare utf8 text, you
can use gaim_utf8_strcasecmp().
I have to go do dishes now.
| 2393 | 1 | --------------------------------------------------------------------------- |
| 2 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
3 | Protokół G*du-G*du 4.x |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
4 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
5 | (C) Copyright 2001 by Wojtek Kaniewski <wojtekka@irc.pl>, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
6 | Robert J. Woźny <speedy@atman.pl>, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
7 | Tomasz Jarzynka <tomee@cpi.pl>, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
8 | Adam Ludwikowski <adam.ludwikowski@wp.pl>, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
9 | Marek Kozina <klith@hybrid.art.pl>, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
10 | Rafał Florek <raf@regionet.regionet.pl>, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
11 | Igor Popik <igipop@wsfiz.edu.pl> |
| 2393 | 12 | |
| 13 | --- 0) disclaimer --------------------------------------------------------- | |
| 14 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
15 | opis protokołu bazują na doświadczeniach przeprowadzonych na moim |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
16 | domowym komputerze oraz informacjach przysłanych do mnie przez różnych |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
17 | ludzi. żaden klient g*du-g*du nie został skrzywdzony podczas |
| 2393 | 18 | przeprowadzania badań, blabla. |
| 19 | ||
| 20 | --- 1) transmisja, format wszystkich pakietów ----------------------------- | |
| 21 | ||
| 22 | w przeciwieństwie do zabawek typu icq, g*du-g*du korzysta z protokołu tcp. | |
| 23 | każdy pakiet zawiera dwa stałe pola: | |
| 24 | ||
| 25 | struct gg_header { | |
| 26 | int type; /* typ pakietu */ | |
| 27 | int length; /* długość reszty pakietu */ | |
| 28 | }; | |
| 29 | ||
| 30 | dla ułatwienia przyjmuję następujące długości zmiennych: sizeof(char) = 1, | |
| 31 | sizeof(short) = 2, sizeof(int) = 4. oczywiście wszystkie liczby są zgodnie | |
| 32 | z intelowym endianem. zakładam też, że wszystkie zmienne są bez znaku. nie | |
| 33 | chce mi się wszędzie pisać `unsigned'. | |
| 34 | ||
| 35 | pola, co do których znaczenia nie mam pewności, lub w ogóle nie mam pojęcia, | |
| 36 | skąd się tam wzięły, oznaczam `dunno'. | |
| 37 | ||
| 38 | --- 2) zanim się połączymy ------------------------------------------------- | |
| 39 | ||
| 40 | żeby wiedzieć, z jakim serwerem mamy się połączyć, należy poudawać przez | |
| 41 | chwilę Internet Explorera, połączyć się z hostem `appmsg.gadu-gadu.pl'. | |
| 42 | ||
| 43 | GET /appsvc/appmsg.asp?fmnumber=<tutaj_numerek_gg> HTTP/1.0 | |
| 44 | Host: appmsg.gadu-gadu.pl | |
| 45 | User-Agent: Mozilla/4.7 [en] (Win98; I) | |
| 46 | Pragma: no-cache | |
| 47 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
48 | oryginalny klient może wysłać jeden z podanych identyfikatorów przeglądarki: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
49 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
50 | Mozilla/4.04 [en] (Win95; I ;Nav) |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
51 | Mozilla/4.7 [en] (Win98; I) |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
52 | Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
53 | Mozilla/4.0 (compatible; MSIE 5.0; Windows NT) |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
54 | Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt) |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
55 | Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
56 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
57 | nowsze wersje klienta do zapytania dodają również `version=...' opisujące, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
58 | z jakim klientem serwer ma do czynienia. jednak ze względu na możliwe |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
59 | różnice w protokole, lepiej pomijać ten parametr i uwagać GG 4.0. w każdym |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
60 | razie na to zapytanie serwer powinien odpowiedzieć: |
| 2393 | 61 | |
| 62 | HTTP/1.0 200 OK | |
| 63 | ||
| 64 | 0 1 0 217.17.33.21:8074 217.17.33.21 217.17.33.21 | |
| 65 | ||
| 66 | co to oznacza? nie mam pojęcia ;) wygląda na to, że cały g*du-g*du jest | |
| 67 | przemyślany i w przyszłości będzie można używać różnych serwerów do różnych | |
| 68 | rzeczy, typu szukanie, obsługa klientów itd. póki co, łączyć się trzeba na | |
| 69 | pierwszy adres (tak, ten z portem). | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
70 | Jeżeli połączenie z portem 8074 nie wyjdzie z jakiś specyficznych powodów - |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
71 | można się łączyć na port 443. |
| 2393 | 72 | |
| 73 | --- 3) logowanie się ------------------------------------------------------- | |
| 74 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
75 | po połączeniu się portem serwera g*du-g*du, dostajemy pakiet typu 0x0001, |
| 2393 | 76 | który na potrzeby tego dokumentu nazwiemy: |
| 77 | ||
| 78 | #define GG_WELCOME 0x0001 | |
| 79 | ||
| 80 | reszta pakietu zawiera liczbę, na podstawie której liczony jest hash z hasła | |
| 81 | klienta: | |
| 82 | ||
| 83 | struct gg_welcome { | |
| 84 | int key; /* klucz szyfrowania hasła */ | |
| 85 | }; | |
| 86 | ||
| 87 | kiedy mamy już tą wartość możemy odesłać pakiet logowania | |
| 88 | ||
| 89 | #define GG_LOGIN 0x000c | |
| 90 | ||
| 91 | musimy podać kilka informacji: | |
| 92 | ||
| 93 | struct gg_login { | |
| 94 | int uin; /* twój numerek */ | |
| 95 | int hash; /* hash hasła */ | |
| 96 | int status; /* status na dzień dobry */ | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
97 | int version; /* wersja klienta */ |
| 2393 | 98 | int local_ip; /* mój adres ip */ |
| 99 | short local_port; /* port, na którym słucham */ | |
| 100 | }; | |
| 101 | ||
| 102 | jak obliczyć hash hasła? hmm... nic prostszego. do każdej literki hasła | |
| 103 | dodaje się jedynkę, mnoży wszystko razem, a potem przez liczbę podaną przez | |
| 104 | serwer. | |
| 105 | ||
| 106 | for (hash = 1; *passwd; passwd++) | |
| 107 | hash *= (*passwd) + 1; | |
| 108 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
109 | zrozumiałe, racja? liczba oznaczająca wersję może być jedną z poniższych: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
110 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
111 | 0x11 - 4.6.1 |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
112 | 0x10 - 4.5.22, 4.5.21, 4.5.19, 4.5.17, 4.5.15 |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
113 | 0x0f - 4.5.12 |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
114 | 0x0b - 4.0.30, 4.0.29, 4.0.28, 4.0.25 |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
115 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
116 | oczywiście nie są to wszystkie możliwe wersje klientów, lecz te, które |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
117 | udało się sprawdzić. najbezpieczniej będzie przedstawiać się jako ta |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
118 | wersja, której ficzerów używamy. wiadomo, że 4.0.x nie obsługiwały trybu |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
119 | ukrytego, ani tylko dla znajomych itd. |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
120 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
121 | jeśli wszystko się powiedzie, dostaniemy w odpowiedzi pakiet typu |
| 2393 | 122 | |
| 123 | #define GG_LOGIN_OK 0x0003 | |
| 124 | ||
| 125 | z polem header->length = 0, lub pakiet | |
| 126 | ||
| 127 | #define GG_LOGIN_FAILED 0x0009 | |
| 128 | ||
| 129 | --- 4) zmiana statusu ----------------------------------------------------- | |
| 130 | ||
| 131 | g*du-g*du przewiduje trzy stany klienta, które zmieniamy pakietem | |
| 132 | ||
| 133 | #define GG_NEW_STATUS 0x0002 | |
| 134 | ||
| 135 | #define GG_STATUS_NOT_AVAIL 0x0001 /* rozłączony */ | |
| 136 | #define GG_STATUS_AVAIL 0x0002 /* dostępny */ | |
| 137 | #define GG_STATUS_BUSY 0x0003 /* zajęty */ | |
| 138 | #define GG_STATUS_INVISIBLE 0x0014 /* niewidoczny */ | |
| 139 | ||
| 140 | #define GG_STATUS_FRIENDS_MASK 0x8000 /* tylko dla przyjaciół */ | |
| 141 | ||
| 142 | struct gg_new_status { | |
| 143 | int status; /* na jaki zmienić? */ | |
| 144 | } | |
| 145 | ||
| 146 | należy pamiętać, żeby przed rozłączeniem się z serwerem należy zmienić | |
| 147 | stan na GG_STATUS_NOT_AVAIL. jeśli ma być widoczny tylko dla przyjaciół, | |
| 148 | należy dodać GG_STATUS_FRIENDS do normalnej wartości stanu. | |
| 149 | ||
| 150 | --- 5) ludzie przychodzą, ludzie odchodzą --------------------------------- | |
| 151 | ||
| 152 | zaraz po zalogowaniu możemy wysłać serwerowi listę ludzików w naszej liście | |
| 153 | kontaktów, żeby dowiedzieć się, czy są w tej chwili dostępni. pakiet zawiera | |
| 154 | dowolną ilość struktur gg_notify: | |
| 155 | ||
| 156 | #define GG_NOTIFY 0x0010 | |
| 157 | ||
| 158 | struct gg_notify { | |
| 159 | int uin; /* numerek danej osoby */ | |
| 160 | char dunno1; /* == 3 */ | |
| 161 | }; | |
| 162 | ||
| 163 | jeśli ktoś jest, serwer odpowie pakietem zawierającym jedną lub więcej | |
| 164 | struktur gg_notify_reply: | |
| 165 | ||
| 166 | #define GG_NOTIFY_REPLY 0x000c /* tak, to samo co GG_LOGIN */ | |
| 167 | ||
| 168 | struct gg_notify_reply { | |
| 169 | int uin; /* numerek */ | |
| 170 | int status; /* status danej osoby */ | |
| 171 | int remote_ip; /* adres ip delikwenta */ | |
| 172 | short remote_port; /* port, na którym słucha klient */ | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
173 | int version; /* wersja klienta */ |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
174 | short dunno1; /* znowu port? */ |
| 2393 | 175 | }; |
| 176 | ||
| 177 | jeśli klient nie obsługuje połączeń między klientami (np. g*du-g*du 3.x) | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
178 | zamiast adresu ip jest 0, zamiast portu może być 0, 1, 2... nieważne ;) |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
179 | port może przyjmować wartość 1, jeśli klient znajduje się za jakimś |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
180 | firewallem lub innym urządzeniem robiącym NAT. w każdym razie, jeśli ktoś |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
181 | się pojawi w trakcie pracy, również zostanie przysłany ten pakiet. |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
182 | proste? proste :) |
| 2393 | 183 | |
| 184 | żeby dodać kogoś do listy w trakcie pracy, trzeba wysłać niżej opisany | |
| 185 | pakiet. jego format jest identyczny jak przy GG_NOTIFY. | |
| 186 | ||
| 187 | #define GG_ADD 0x000d | |
| 188 | ||
| 189 | struct gg_add { | |
| 190 | int uin; /* numerek */ | |
| 191 | char dunno1; /* == 3 */ | |
| 192 | }; | |
| 193 | ||
| 194 | jeśli ktoś opuści g*du-g*du lub zmieni stan, otrzymamy pakiet | |
| 195 | ||
| 196 | #define GG_STATUS 0x0002 | |
| 197 | ||
| 198 | struct gg_status { | |
| 199 | int uin; /* numerek */ | |
| 200 | int status; /* nowy stan */ | |
| 201 | }; | |
| 202 | ||
| 203 | --- 6) wysyłanie wiadomości ------------------------------------------------ | |
| 204 | ||
| 205 | przejdźmy do sedna sprawy ;) | |
| 206 | ||
| 207 | #define GG_SEND_MSG 0x000b | |
| 208 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
209 | #define GG_CLASS_QUEUED 0x0001 /* tylko przy odbieraniu */ |
| 2393 | 210 | #define GG_CLASS_MSG 0x0004 |
| 211 | #define GG_CLASS_CHAT 0x0008 | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
212 | #define GG_CLASS_UNKNOWN_1 0x0020 |
| 2393 | 213 | |
| 214 | struct gg_send_msg { | |
| 215 | int recipient; | |
| 216 | int seq; | |
| 217 | int class; | |
| 218 | char message[]; | |
| 219 | }; | |
| 220 | ||
| 221 | wiadomo, odbiorca. numer sekwencyjny, który wykorzystujemy potem do | |
| 222 | potwierdzenia. nie wykluczone, że w jakis sposób odróżnia się różne | |
| 223 | rozmowy za pomocą części bajtów, ale raczej nie ma znaczenia. klasa | |
| 224 | wiadomości pozwala odróżnić, czy wiadomość ma się pokazać w osobym | |
| 225 | okienku czy jako kolejna linijka w okienku rozmowy. wygląda na to, | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
226 | że to jakaś bitmapa, więc najlepiej olać inne bity niż 0x0e. (czasem |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
227 | klienty wysyłają 0x04, czasem 0x24 -- widocznie 0x20 to też jakaś |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
228 | flaga). jeśli odbiorca był niedostępny podczas wysyłania wiadomości, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
229 | zostanie zaznaczony bit 0x01. |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
230 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
231 | oryginalny klient wysyłając wiadomość do kilku użytkowników, wysyła po |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
232 | prostu kilka takich samych pakietów z różnymi numerkami odbiorców. nie |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
233 | ma osobnego pakietu do tego. natomiast jeśli chodzi o ,,konferencyjnę'' |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
234 | do pakietu doklejana jest za ,,char message[];'' następująca struktura: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
235 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
236 | struct gg_send_recipients { |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
237 | char flag; /* == 1 */ |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
238 | int count; /* ilość odbiorców */ |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
239 | int recipients[]; /* tablica odbiorców */ |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
240 | }; |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
241 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
242 | na przykład, by wysłać do trzech ludzi, należy wysłać pakiet: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
243 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
244 | - -- --- --+--+--+--+--+--+--+-----------+-----------+ |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
245 | treść |\0|\1| 0x02 | uin1 | uin2 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
246 | - -- -- ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |
| 2393 | 247 | |
| 248 | serwer po otrzymaniu wiadomości odsyła informację o tym. przy okazji | |
| 249 | mówi, czy wiadomość dotarła do odbiorcy (status == GG_ACK_DELIVERED), | |
| 250 | czy może jest offline i została zakolejkowana (GG_ACK_QUEUED): | |
| 251 | ||
| 252 | #define GG_SEND_MSG_ACK 0x0005 | |
| 253 | ||
| 254 | #define GG_ACK_DELIVERED 0x0002 | |
| 255 | #define GG_ACK_QUEUED 0x0003 | |
| 256 | ||
| 257 | struct gg_send_msg_ack { | |
| 258 | int status; | |
| 259 | int recipient; | |
| 260 | int seq; | |
| 261 | }; | |
| 262 | ||
| 263 | numer sekwencyjny i adresat ten sam, co przy wysyłaniu. | |
| 264 | ||
| 265 | --- 7) otrzymywanie wiadomości --------------------------------------------- | |
| 266 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
267 | zbyt wiele wyjaśnień chyba nie trzeba. wiadomo od kogo. drugie pole to |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
268 | najprawdopodobniej jakiś numerek sekwencyjny. trzecie oznacza czas nadania |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
269 | wiadomości. klasa wiadomości taka sama jak przy wysyłaniu: |
| 2393 | 270 | |
| 271 | #define GG_RECV_MSG 0x000a | |
| 272 | ||
| 273 | struct gg_recv_msg { | |
| 274 | int sender; | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
275 | int seq; |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
276 | int time; |
| 2393 | 277 | int class; |
| 278 | char message[]; | |
| 279 | }; | |
| 280 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
281 | w przypadku pakietów ,,konferencyjnych'' na koncu pakietu doklejona jest |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
282 | struktura identyczna ze struct gg_send_recipients zawierająca pozostałych |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
283 | rozmówców. |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
284 | |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
285 | --- 8) ping/pong ----------------------------------------------------------- |
| 2393 | 286 | |
| 287 | od czasu do czasu klient wysyła pakiet a'la ping do serwera i dostaje pustą | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
288 | odpowiedź. o ile dobrze pamiętam, serwer rozłącza się po upływie 5 minut od |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
289 | otrzymania ostatniej informacji. |
| 2393 | 290 | |
| 291 | #define GG_PING 0x0008 | |
| 292 | ||
| 293 | /* nie ma niczego */ | |
| 294 | ||
| 295 | #define GG_PONG 0x0007 | |
| 296 | ||
| 297 | /* nie ma niczego */ | |
| 298 | ||
| 299 | --- 9) podziękowania ------------------------------------------------------- | |
| 300 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
301 | swój wkład w poznanie protokołu mieli: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
302 | - Robert J. Woźny <speedy@atman.pl>: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
303 | opis nowości w protokole GG 4.6, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
304 | - Tomasz Jarzynka <tomee@cpi.pl>: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
305 | badanie timeoutów, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
306 | - Adam Ludwikowski <adam.ludwikowski@wp.pl>: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
307 | wiele różnych poprawek do tekstu, badanie wersji, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
308 | - Marek Kozina <klith@hybrid.art.pl>: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
309 | czas otrzymania wiadomości, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
310 | - Rafał Florek <raf@regionet.regionet.pl>: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
311 | konferencje, |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
312 | - Igor Popik <igipop@wsfiz.edu.pl>: |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
313 | klasy wiadomości przy odbieraniu zakolejkowanej. |
| 2393 | 314 | |
| 315 | ---------------------------------------------------------------------------- | |
| 316 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2393
diff
changeset
|
317 | $Id: protocol.txt 2819 2001-11-27 22:54:32Z warmenhoven $ |
| 2393 | 318 |