What ngnet is

A generic network layer for Ace of Spades style games and servers, in C.

It carries bytes. It has no game types and no protocol knowledge: the uint32 *connect data* is opaque (it is ENet’s connect data, or the n of the DataChannel’s connect <n> line), the list of masters is passed in by the program, and nothing is allow-listed. It is written so that third-party servers such as LSD and SpadesX can use it with a handful of changed lines.

Licence: GPL-3.0-or-later.

Three ways to use it

LevelForWhat you write
ENet shim (ngnet/enet.h)a server that already speaks ENetnothing in the code: compile with -include ngnet/enet.h
Lua binding (ngnet/lua.h)a server with an embedded Lua config#include <ngnet/lua.h> and one ngnet_lua_open(L)
Native API (ngnet/ngnet.h)a new game or a server that wants full controlngnet_server_start(port, &events), ngnet_service() every tick