Teeworlds protocol

Teeworlds 0.6 and 0.7 protocol differences

Far from complete diff between 0.6 and 0.7 protocol versions


Reflection attack protection

0.6.5 and 0.7 make the client send 512 null bytes while connecting ( NET_CTRLMSG_CONNECT, NET_CTRLMSG_TOKEN ). If they are not sent the server (0.7 only) silently drops the connection. This is a protection against reflection attacks where the attacker spoofs the victims ip and uses the teeworlds servers response as attacking traffic.

0.6.4 (including ddnet) and earlier do not send these nullbytes.

Packet header

Security tokens

Packet flags

                    
     Full packet headers with every letter representing one bit:

     f = flag bit
     - = unused bit
     a = ack
     c = number of chunks
     t = security token

     0.6.4
     ffff --aa  aaaa aaaa  cccc cccc

     0.6.5
     ffff f-aa  aaaa aaaa  cccc cccc  tttt tttt  tttt tttt  tttt tttt  tttt tttt

     0.7
     --ff ffaa  aaaa aaaa  cccc cccc  tttt tttt  tttt tttt  tttt tttt  tttt tttt
                    
                
The unused bits should be zeroed for proper compatibility with newer and older versions. Old teeworlds versions actually wrongly interpreted the unused bits as part of the ack number so when 0.6.5 started using them for the token flag it broke the connection.

Chunk header

chunk header diff

0.7 removed laser damage tuning

The tuning entry laser_damage was removed in 0.7

0.7 removed sound global and also removed some sound world snap items

In 0.6 the sounds SOUND_PLAYER_JUMP (15), SOUND_HOOK_ATTACH_GROUND (21), SOUND_HOOK_ATTACH_PLAYER (22) and SOUND_HOOK_NOATTACH (23) were sent via the snap item event_sound_world.

In 0.7 this no longer happens. The sounds still exists but it is triggered from the client side for the owner of the tee. The client side game state gamecore detects when for example a hook is about to hit and then sets a flag which plays the sound in the gameclient. This does not happen for spectators. A spectator depends on m_TriggeredEvents from the obj_character snap item to play those sounds.

Also the snap item event_sound_global was removed in 0.7. The relevant git commit is d2924b5.