… | |
… | |
21 | Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | --> |
22 | --> |
23 | </head> |
23 | </head> |
24 | <body> |
24 | <body> |
25 | |
25 | |
26 | <h1>$Revision: 1.70 $</h1> |
26 | <h1>$Revision: 1.71 $</h1> |
27 | |
27 | |
28 | <h1>KGS Protocol Description</h1> |
28 | <h1>KGS Protocol Description</h1> |
29 | |
29 | |
30 | <p>This XML document describes the KGS protocol. It is also used |
30 | <p>This XML document describes the KGS protocol. It is also used |
31 | to automatically generate the perl parser for all the messages and |
31 | to automatically generate the perl parser for all the messages and |
… | |
… | |
54 | ascii strings ("<code>username</code>"), zero- or non-terminated |
54 | ascii strings ("<code>username</code>"), zero- or non-terminated |
55 | UCS2-Strings ("<code>ZSTRING</code>" or "<code>STRING</code>"). Yes, |
55 | UCS2-Strings ("<code>ZSTRING</code>" or "<code>STRING</code>"). Yes, |
56 | I know java is supposed to do UTF-16, but no implementation seems to |
56 | I know java is supposed to do UTF-16, but no implementation seems to |
57 | care...</p> |
57 | care...</p> |
58 | |
58 | |
|
|
59 | <p>To get a feel for the protocol, get the <tt>KGS</tt> perl module |
|
|
60 | from CPAN, install it an run <tt>kgstrace</tt>, then conenct to |
|
|
61 | <tt>127.0.0.1</tt> with your client. <tt>kgstrace</tt> will dump all |
|
|
62 | messages from and to the server.</p> |
|
|
63 | |
|
|
64 | <p>For the rest, go figure or bug me, <a |
59 | <p>For the rest, go figure or bug me, <a href="mailto:pcg@goof.com">Marc Lehmann <pcg@goof.com></a></p> |
65 | href="mailto:pcg@goof.com">Marc Lehmann <pcg@goof.com></a></p> |
60 | |
66 | |
61 | <h2>Stream and message structure.</h2> |
67 | <h2>Stream and message structure.</h2> |
62 | |
68 | |
63 | <p>After connecting to the server, a handshake byte is sent. It's |
69 | <p>After connecting to the server, a handshake byte is sent. It's |
64 | the major version number of the protocol the client expects to |
70 | the major version number of the protocol the client expects to |
65 | receive. Version 3 and 4 are mostly the same, except that Version 4 |
71 | receive. Version 3 and 4 are mostly the same, except that Version 4 |
66 | clients expect server messages to be compressed, version 3 clients |
72 | clients expect server messages to be compressed, version 3 clients |
67 | not.</p> |
73 | do not. (version 3 probably is no longer supported).</p> |
68 | |
74 | |
69 | <p>The server sends back his protocol number, which is always 3 in |
75 | <p>The server sends back his protocol number, which is always 3 in |
70 | the current protocol. Most of the protocol variation is determined by |
76 | the current protocol. Most of the protocol variation is determined by |
71 | the server using the client version that is used in the initial login |
77 | the server using the client version that is used in the initial login |
72 | message, not the initial handshake byte.</p> |
78 | message, not the initial handshake byte.</p> |