finds.dev

lonng/nanoserver

DEMO: Mahjong server base on nano(https://github.com/lonng/nano)

View on GitHub

★ 954GoMITupdated Jun 2024

// the take

A demo Mahjong game server (specifically Sichuan variant, 3- or 4-player mode) built on top of the Nano game framework. It's primarily a learning reference showing how to use Nano for real-time multiplayer game servers, not a production-ready game platform.

The mahjong algorithm package has actual test coverage, which is more than most demo projects bother with. Disconnect/reconnect handling is explicitly implemented — player state survives process kills and network switches, which is the hard part of any real-time game server. The protocol layer is cleanly separated into its own package with typed structs rather than raw maps. WebSocket support is built in alongside the default TCP transport.

The README's own declaration says 'this is a demo for learning purposes only' and it means it — go1.11 was the target runtime (circa 2018), and the last push was mid-2024, so this hasn't tracked Go module conventions or API changes in years. The client source code is gated behind a WeChat group, which makes the 'complete example' claim somewhat hollow — you can run the server but can't actually play without hunting down the client. WeChat login and payment are hardwired into the auth flow, making this nearly useless outside China without surgery. The db package is a flat pile of files with no abstraction; every query hits MySQL directly with no ORM or migration tooling beyond a SQL dump in docs/.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
954
Forks
356
Language
Go
License
MIT
Last commit
8 Jun 2024

// nearby

If nanoserver isn't quite it.

All repos →