【Pitaya官方文档-中文版】1. 概述

8 篇文章 0 订阅

概述

Pitaya是一个易于使用、快速、轻量级的游戏服务器框架,灵感来自starxpemelo,构建在 nano的网络库之上。

Pitaya is an easy to use, fast and lightweight game server framework inspired by starx and pomelo and built on top of nano’s networking library.

Pitaya的目标是为分布式多人游戏和服务器端应用程序提供一个基本的、健壮的开发框架。

Pitaya is an easy to use, fast and lightweight game server framework inspired by starx and pomelo and built on top of nano’s networking library.

特性 Features

  • 用户回话(User sessions)

    Pitaya支持用户会话,允许将会话绑定到用户ID,设置自定义数据,在会话处于活动状态时,可以在其他地方获取该自定义数据

    Pitaya has support for user sessions, allowing binding sessions to user ids, setting custom data and retrieving it in other places while the session is active

  • 集群支持(Cluster support)

    Pitaya提供了默认的服务发现和RPC模块,可轻松实现不同类型的服务器之间的通信

    Pitaya comes with support to default service discovery and RPC modules, allowing communication between different types of servers with ease

  • WS和TCP监听(WS and TCP listeners)

    Pitaya提供了TCP和Websocket接收器,它们是从接收请求的应用程序中抽象出来的

    Pitaya has support for TCP and Websocket acceptors, which are abstracted from the application receiving the requests

  • 处理程序和远程处理(Handlers and remotes)

    Pitaya允许应用程序指定接收和处理客户端消息的处理程序,以及接收和处理RPC服务器消息的远程处理程序。它们都可以指定自定义的初始化、后置初始化和关闭方法

    Pitaya allows the application to specify its handlers, which receive and process client messages, and its remotes, which receive and process RPC server messages. They can both specify custom init, afterinit and shutdown methods

  • 消息转发(Message forwarding)

    当服务器接收到处理程序消息时,它将消息转发给对应类型的服务器

    When a server receives a handler message it forwards the message to the server of the correct type

  • 客户端sdk库(Client library SDK)

    libpitaya是Pitaya的官方客户端sdk库

    libpitaya is the official client library SDK for Pitaya

  • 监控(Monitoring)

    默认情况下,Pitaya支持Prometheus和statsd,并接受实现了Reporter接口的其他自定义报告程序

    Pitaya has support for Prometheus and statsd by default and accepts other custom reporters that implement the Reporter interface

  • 兼容Open tracing(Open tracing compatible)

    Pitaya与open tracing兼容,所以使用Jaeger或者任何其他兼容的跟踪框架都很简单

    Pitaya is compatible with open tracing, so using Jaeger or any other compatible tracing framework is simple

  • 自定义模块(Custom modules)

    Pitaya已经有一些默认的模块,并支持自定义模块

    Pitaya already has some default modules and supports custom modules as well

  • 自定义序列化器(Custom serializers)

    Pitaya本身支JSON和Protobuf消息,并且可以根据需要添加其他的自定义序列化器

    Pitaya natively supports JSON and Protobuf messages and it is possible to add other custom serializers as needed

  • 用其他语言编写兼容的服务器(Write compatible servers in other language)

    使用libpitaya-cluster,可以用其他语言编写与Pitaya兼容的服务器,这些服务器可以在集群中注册并处理RPC,现在在仓库中已经有了一个与Unity兼容的C#库和Python的WIP

    Using libpitaya-cluster its possible to write pitaya-compatible servers in other languages that are able to register in the cluster and handle RPCs, there’s already a csharp library that’s compatible with unity and a WIP of a python library in the repo.

  • 用于开发/调试的REPL客户端(REPL Client for development/debugging)

    Pitaya-cli是一个REPL客户端,可用于简化pitaya服务器的开发和调试

    Pitaya-cli is a REPL client that can be used for making development and debugging of pitaya servers easier.

  • 用于集成/压力测试的机器人(Bots for integration/stress tests)

    Pitaya-bot是一个服务器测试框架,它可以轻松地复制用户行为来测试角落场景,从而验证接收到的响应,或者对pitaya服务器进行大规模访问。

    Pitaya-bot is a server test framework that can easily copy users behaviour to test corner case scenarios, which can validate the responses received, or make massive accesses into pitaya servers.

架构 Architecture

Pitaya的开发以模块化和可扩展性为核心,同时提供坚实的基本功能,将客户端的交互抽象为定义良好的接口。完整的API文档可以在Godoc上的godot获得。

Pitaya was developed considering modularity and extendability at its core, while providing solid basic functionalities to abstract client interactions to well defined interfaces. The full API documentation is available in Godoc format at godoc.

谁在使用 Who’s Using it

现在,只有 TFG 公司的我们在使用它,但是如果有一个社区围绕着这个项目就太好了。希望很快能收到你们的来信!

Well, right now, only us at TFG Co, are using it, but it would be great to get a community around the project. Hope to hear from you guys soon!

如何贡献 How To Contribute?

还是老样子: Fork, Hack, Pull Request。重复以上过程。也不要忘记包括测试和文档(我们两者都很喜欢)。

Just the usual: Fork, Hack, Pull Request. Rinse and Repeat. Also don’t forget to include tests and docs (we are very fond of both).

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值