Swift is an easy to use, fast, distributed, supporting multi process multi process game server framework written by Golang.
This framework is under development, so please don't try it at the moment.
import (
"github.com/pengzj/swift"
"./app/servers/connector/handler"
)
func main() {
app := swift.CreateApp()
app.SetConfigPath("/Users/francis.peng/Work/PfsGame/config")
app.SetLogPath("/Users/francis.peng/Project/logs/pfs")
app.HandleFunc("user.login", handler.UserLogin)
app.RegisterHandler("onChat")
app.Run()
}
include files:
|-- master.json
|-- servers.json
|-- secret.key
master.json
{
"id": "master-server-1",
"host": "127.0.0.1",
"port": "3015"
}
servers.json
[
{"type": "connector", "id": "connector-server-1","clientHost": "127.0.0.1", "clientPort": "3301", "host": "127.0.0.1", "port": "3401", "frontend": true, "connType": "tcp"},
{"type": "connector", "id": "connector-server-2","clientHost": "127.0.0.1", "clientPort": "3302", "host": "127.0.0.1", "port": "3402", "frontend": true, "connType": "tcp"},
{"type": "rank", "id": "rank-server-1","host": "127.0.0.1", "port": "3403", "frontend": false}
]
secret.key
asdfkksad$sadfk
data async to db in progress
optimize internal interface
manage tool
service
test case
benchmark