SkillAgentSearch skills...

Libtw2

Some Teeworlds stuff in Rust.™

Install / Use

/learn @heinrich5991/Libtw2
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

libtw2

Some Teeworlds stuff in Rust.™

This repository hosts some third-party Teeworlds/DDNet libraries and tooling, written in Rust. Additionally, it has some programming language independent documentation of some Teeworlds/DDNet protocols, in the doc directory.

The highlights are probably

  • doc. The documentation.
  • wireshark-dissector. A working Wireshark dissector for Teeworlds 0.6, Teeworlds 0.7 and DDNet.
  • gamenet/generate/spec. JSON files describing the high-level Teeworlds 0.6, Teeworlds 0.7 and DDNet protocol.

Documentation

More links to other people's documentation can be found in "Resources" on the DDNet Wiki.

Code

The code is split into many smaller and larger libraries. Bold names indicate that the libraries or executables might be useful outside of libtw2.

  • _old. Unmaintained implementation of the low-level file format of Teeworlds/DDNet maps ("datafiles"), written in C, before libtw2 turned to Rust.
  • buffer. Helpers for writing to uninitialized byte buffers.
  • common. Utilities for all the other crates. Number conversion, byte strings, etc.
  • datafile. Low-level file format of Teeworlds/DDNet maps.
  • demo. Low-level file format of Teeworlds/DDNet demos (replays).
  • downloader. Downloader for maps from game servers.
  • event-loop. Helper for creating Teeworlds/DDNet protocol clients/servers.
  • gamenet. Multiple crates for handling the high-level Teeworlds 0.6, Teeworlds 0.7 and DDNet network protocols.
  • gamenet/generate/spec. JSON files describing the high-level Teeworlds 0.6, Teeworlds 0.7 and DDNet protocol.
  • httphook. Helper library to register Teeworlds/DDNet game servers with the DDNet masterserver, for those that don't support it natively.
  • httphook-ldpreload. Library that you can insert into Teeworlds/DDNet servers using LD_PRELOAD that automatically registers them with the DDNet masterserver, even if the game server itself doesn't support it.
  • huffman. Homebrew compression format using Huffman coding, used in demos and over the network. Alternative: Ryozuki's rustyman.
  • logger. Utility crate to unify logging across libtw2 code.
  • map. High-level format of Teeworlds/DDNet maps. You should probably use Patiga's TwMap instead.
  • net. Low-level network protocol of Teeworlds 0.6, Teeworlds 0.7 and DDNet.
  • packer. Encodings for Teeworlds/DDNet network protocols and file formats. See also Ryozuki's teeint for another implementation of Teeworlds/DDNet's variable-length integers.
  • polyfill-1-63. Some helpers for Rust 1.63 compatibility.
  • register. Register game servers with DDNet's masterserver (https://master1.ddnet.org/ddnet/15/servers.json).
  • render-map. Render Teeworlds/DDNet maps to images. You should probably use Patiga's TwGpu instead.
  • server. Proof-of-concept Teeworlds 0.6 server implementation.
  • serverbrowse. Server info protocol for Teeworlds 0.5, Teeworlds 0.6, Teeworlds 0.7 and DDNet. See also Ryozuki's teestatus. Essentially superseded by the DDNet HTTPS masterserver protocol, server list is at https://master1.ddnet.org/ddnet/15/servers.json, you should probably use that instead.
  • snapshot Teeworlds/DDNet data structure for transferring gamestate.
  • socket. Helper for creating UDP sockets.
  • stats-browser. Used for adding entries to the DDNet HTTPS masterserver, for game servers not supporting the HTTPS masterserver protocol. Originally intended to provide a tracking for Teeworlds servers. That info can now be found at https://ddnet.org/stats/master/ and parsed using Ryozuki's teemasterparser.
  • teehistorian. DDNet file format for storing all player input. Alternative: Zwelf's teehistorian.
  • tools. Various tools.
  • uniffi. Python bindings for huffman using Mozilla's uniffi: libtw2-huffman.
  • warn. Small helper to communicate non-standard values while parsing.
  • wireshark-dissector. Working Wireshark dissector for Teeworlds 0.6, Teeworlds 0.7 and DDNet.
  • world. Proof-of-concept Teeworlds physics. You should probably use Zwelf's TwGame instead.
  • zlib-minimal. Minimal wrapper around zlib.
View on GitHub
GitHub Stars59
CategoryDevelopment
Updated2d ago
Forks22

Languages

Rust

Security Score

100/100

Audited on Mar 25, 2026

No findings