golang -Pitaya 是一种简单、快速、轻量级游戏服务器和集群支持框架和客户端库iOS、Android,团结和其他人通过C SDK。它提供了一个基本的分布式多人游戏和服务器端应用程序开发框架。
先决条件Go >= 1.10
etcd (用于服务发现)
nats (可选的,用于发送和接收rpc, grpc实现也可以使用,如果喜欢的话)
docker (可选:用于在容器上运行etcd和nats依赖项)
安装
clone the repogit clone https://github.com/topfreegames/pitaya.git
setup pitaya dependenciesmake setup
Hacking pitaya
下面是一个跑pitaya的例子:
启动etcd(此命令需要docker-compose,并将在本地运行etcd容器。etcd可以在没有docker的情况下运行。cd ./examples/testing && docker-compose up -d etcd
run the connector frontend server from cluster_grpc examplemake run-cluster-grpc-example-connector
run the room backend server from the cluster_grpc examplemake run-cluster-grpc-example-room
Now there should be 2 pitaya servers running, a frontend connector and a backend room. To send requests, use a REPL client for pitaya pitaya-cli.$ pitaya-cli
Pitaya REPL Client>>> connect localhost:3250connected!>>> request room.room.entry>>> sv-> {"code":0,"result":"ok"}
Running the testsmake test
This command will run both unit and e2e tests.
Contributing
#TODO
AuthorsTFG Co - Initial work
License
Acknowledgementsnano authors for build