A rebuilt Leaf game server project compatible with modern Go versions
(Go Modules, new protobuf, no deprecated dependencies)
- Original Project: https://github.com/chenglongcl/leafserver
- Framework: Leaf
- Go Version: Go 1.20+ (tested on modern Go toolchain)
This project is a modernized rebuild of the original leafserver project.
Main improvements:
- ✅ Compatible with Go Modules
- ✅ Works with modern Go versions (Go ≥ 1.20)
- ✅ Removed deprecated / broken dependencies (e.g.
lexkong/log) - ✅ Updated protobuf generation workflow
- ✅ Clean project structure, suitable for learning and extension
This project is suitable for:
- Learning the Leaf game server framework
- Building a simple TCP / game server
- Understanding client-server message handling
leafserver/
├── server/ # Server main logic
├── client/ # Simple client for testing
├── conf/ # Configuration & initialization
├── msg/ # Protobuf generated messages
├── config/ # YAML configuration files
├── go.mod
├── go.sum
└── main.go
Make sure you have the following installed:
go version
protoc --version
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
1️⃣ Clone the repository
git clone https://github.com/juinnlau2/leafserver.git cd leafserver2️⃣ Initialize dependencies
go mod tidy3️⃣ Start the server
go run main.goIf successful, you should see logs similar to:
[INFO] logger initialized
[release] Leaf 1.1.3 starting up4️⃣ Run the client (optional)
In another terminal:
cd client/ping
go run ping.goThe client will connect to the server and print received messages.