Moon is a lightweight game server framework based on the actor model. One worker thread can have one or more actors (services), which communicate with each other through message queues. There are many features for game server development:
- The architecture is simple, and the source code is concise and easy to understand.
- Cross-platform (Windows, Linux, MacOS)
- Uses ASIO for scheduling
- Uses Lua for logic scripting
- Optimized networking
- Tcp
- Udp/Kcp
- Websockets
- Http
- Asynchronous based on Lua coroutines
- Coroutine-socket
- Timer
- Inter-service communication
- Inter-process communication
- Redis/PostgreSQL/Mongodb/Mysql async client driver
- High performance and optimized Lua Json library
- Lua protobuf library
- Lua filesystem
- Recast Navigation
- Lua zset library for ranklist
# Run test
./moon example/test/main_test.lua
# Run script in the example directory, e:
./moon example/example_timer.lua
# This is a guessing game, example/GuessGame.md
./moon example/main_game.lua
-
Make sure your compiler(vs2022 17.5+, gcc 9.3+, clang 9.0+) support C++17 or Install
C++17
Compiler.。 -
Install premake5 and ensure that the premake5 executable location is included in your system path.
Download link: https://premake.github.io/download
On Mac, you can install it usingbrew install premake
-
Clone source code
git clone https://github.com/sniper00/moon.git
-
Build
cd moon premake5 build --release
-
Run
premake5 run --release example/send_benchmark.lua
-
Publish
premake5 publish
If you want modify premake5 script, See detail build steps