Teeworlds 0.6 map download
Here is an example network traffic dump annotated using
a twnet_parser script.
The map download process is initiated if the map is changed or a client connects to the server.
And the client does not know the map. Both times the server sends a
NETMSG_MAP_CHANGE
message where the client is supposed to answer with either
NETMSG_CON_READY
indicating that the client knows the map and is ready to enter or with
NETMSG_REQUEST_MAP_DATA
to start the map download process.
The message NETMSG_MAP_DATA has more fields than just
chunk, data_size and last. But to keep the output simple I left those out.
[TW6] 54939 -> 8303 connect [TW6] 8303 -> 54939 connect_accept [TW6] 54939 -> 8303 info [TW6] 8303 -> 54939 map_change [TW6] 54939 -> 8303 request_map_data (chunk=0) [TW6] 8303 -> 54939 map_data (last=0 chunk=0 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=1) [TW6] 8303 -> 54939 map_data (last=0 chunk=1 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=2) [TW6] 8303 -> 54939 map_data (last=0 chunk=2 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=3) [TW6] 8303 -> 54939 map_data (last=0 chunk=3 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=4) [TW6] 8303 -> 54939 map_data (last=0 chunk=4 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=5) [TW6] 8303 -> 54939 map_data (last=0 chunk=5 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=6) [TW6] 8303 -> 54939 map_data (last=0 chunk=6 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=7) [TW6] 8303 -> 54939 map_data (last=0 chunk=7 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=8) [TW6] 8303 -> 54939 map_data (last=0 chunk=8 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=9) [TW6] 8303 -> 54939 map_data (last=0 chunk=9 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=10) [TW6] 8303 -> 54939 map_data (last=0 chunk=10 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=11) [TW6] 8303 -> 54939 map_data (last=0 chunk=11 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=12) [TW6] 8303 -> 54939 map_data (last=0 chunk=12 data_size=896 ..) [TW6] 54939 -> 8303 request_map_data (chunk=13) [TW6] 8303 -> 54939 map_data (last=1 chunk=13 data_size=460 ..) [TW6] 54939 -> 8303 ready [TW6] 8303 -> 54939 sv_motd, con_ready [TW6] 54939 -> 8303 cl_start_info [TW6] 8303 -> 54939 sv_vote_clear_options, sv_tune_params [TW6] 54939 -> 8303 enter_game
As you can see the client has to request every individual chunk from the server.
And the server then sets last to 1 when the last chunk of the map was sent. Informing the client that
he now holds the complete map file.
The map being downloaded here is ctf5 with crc d92129a0.