finds.dev← search

// the find

lonng/nanoserver

★ 954 · Go · MIT · updated Jun 2024

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

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/.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →