Difference between revisions of "Net protocol"
From X-Moto
(→Main packet) |
|||
Line 6: | Line 6: | ||
== Main packet == | == Main packet == | ||
+ | Format: | ||
+ | [size of the subheader+subpacket written in ascii]\n | ||
+ | ===> beginning of the subheader | ||
+ | [source written in ascii]\n | ||
+ | [subsource written in ascii]\n | ||
+ | [actionType]\n | ||
+ | ===> beginning of the subpacket | ||
+ | [subpacket]\n | ||
+ | source : -1 for the server, or the uniq number associated to the client | ||
+ | subsource : the client subsource (0, 1, 2 or 3), for the player on the client machine | ||
+ | action type : name of the netAction | ||
+ | subpacket : specific to the netAction. \n is added at each subpacket so that it's more readable on a network sniffer, moreover, it can be used to be replaced by \0 to get the char. | ||
== Sub packets == | == Sub packets == |
Revision as of 08:50, 14 October 2008
Architecture
Server side
- 2 ports : port 4130 TCP, and port 4130 UDP
Client side
- 1 or 2 ports if possible : random ports
Main packet
Format:
[size of the subheader+subpacket written in ascii]\n ===> beginning of the subheader [source written in ascii]\n [subsource written in ascii]\n [actionType]\n ===> beginning of the subpacket [subpacket]\n
source : -1 for the server, or the uniq number associated to the client subsource : the client subsource (0, 1, 2 or 3), for the player on the client machine action type : name of the netAction subpacket : specific to the netAction. \n is added at each subpacket so that it's more readable on a network sniffer, moreover, it can be used to be replaced by \0 to get the char.