游戏服务器框架php,golang -Pitaya 游戏服务器框架中文API教程

Pitaya是一个基于Go语言的轻量级游戏服务器框架,支持iOS、Android等客户端通过C SDK连接。该框架提供了分布式多人游戏和服务器端应用开发的基础,包括服务发现、RPC通信等功能。本文将介绍如何配置和使用Pitaya,包括启动etcd、运行示例服务器以及使用Pitaya CLI进行交互。
摘要由CSDN通过智能技术生成

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值