kada7 / pitaya

Scalable game server framework with clustering support and client libraries for iOS, Android, Unity and others through the C SDK.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pitaya Build Status Coverage Status GoDoc Docs Go Report Card MIT licensed

Pitaya是一个简单、快速、轻量级的游戏服务器框架,通过C SDK 为iOS、Android、Unity等提供集群支持和客户端SDK。 它为分布式多人游戏服务器应用提供了一个基本的开发框架。

快速开始

准备工作

  • Go >= 1.10
  • etcd (用于服务发现)
  • nats (可选,用于发送和接收rpc,可以替换成grpc的实现。)
  • docker (可选:用于在容器上运行 etcd 和 nats 。)

安装

克隆代码仓库

git clone https://github.com/topfreegames/pitaya.git

设置pitaya依赖

make setup

Hacking pitaya

下面是一个运行Pitaya的例子:

启动etcd (该命令需要docker-compose和容器环境) ,当然你也可以不使用docker来运行etcd。)

cd ./examples/testing && docker-compose up -d etcd

从 cluster_grpc 示例中运行连接器前端服务器。

make run-cluster-grpc-example-connector

从 cluster_grpc 示例中运行room后端服务器。

make run-cluster-grpc-example-room

现在应该有2个pitaya服务器在运行,一个是前端连接器,一个是后端服务。可以使用pitaya的repl客户端pitaya-cli 来发送请求。

$ pitaya-cli
Pitaya REPL Client
>>> connect localhost:3250
connected!
>>> request room.room.entry
>>> sv-> {"code":0,"result":"ok"}

运行测试

make test

该命令将同时运行单元测试和e2e测试。

贡献

#TODO

作者

  • TFG Co - Initial work

许可证

MIT License

鸣谢

  • nano authors for building the framework pitaya is based on.
  • pomelo authors for the inspiration on the distributed design and protocol

安全

如果您发现了安全漏洞,请发邮件至 security@tfgco.com

资源

About

Scalable game server framework with clustering support and client libraries for iOS, Android, Unity and others through the C SDK.

License:MIT License


Languages

Language:Go 99.4%Language:Makefile 0.6%