All Projects → bytemode → pitaya-notes

bytemode / pitaya-notes

Licence: MIT license
Scalable game server framework with clustering support, code notes. pitaya游戏服务器代码注释

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to pitaya-notes

Borealis Server Manager
Utility designed to facilitate the deployment, management, and control of various kinds of dedicated gameservers.
Stars: ✭ 31 (-68.69%)
Mutual labels:  gameserver
Cod4x server
Extended Call of Duty 4 server
Stars: ✭ 190 (+91.92%)
Mutual labels:  gameserver
rockgo
A developing game server framework,based on Entity Component System(ECS).
Stars: ✭ 617 (+523.23%)
Mutual labels:  gameserver
Linuxgsm Docker
The Official LinuxGSM Docker image (experimental)
Stars: ✭ 73 (-26.26%)
Mutual labels:  gameserver
Windowsgsm
🎲 A powerful tool to manage game servers. Equipped with a GUI for server admins to install, import, start, stop, restart, update, and automate multiple servers with a push of a button.
Stars: ✭ 141 (+42.42%)
Mutual labels:  gameserver
lgsl
LGSL v6.2.0 for PHP 5.4-8.2.0dev (Live Game Server List): online status for Discord, FiveM, Rust, CS, SA:MP, GMOD, Minecraft, Source Query, etc.
Stars: ✭ 101 (+2.02%)
Mutual labels:  gameserver
Peonyframwork
一个优秀的java服务器框架 可应用于游戏服务器/应用服务器开发
Stars: ✭ 24 (-75.76%)
Mutual labels:  gameserver
quakejs
Fork of inolen/quakejs with additonal content server, local play page, and start-stop script
Stars: ✭ 79 (-20.2%)
Mutual labels:  gameserver
Game Server Configs
A repo of game server configuration files used by LinuxGSM
Stars: ✭ 157 (+58.59%)
Mutual labels:  gameserver
asyncio
A C++ implementation of an industrial-grade high-performance asynchronous network library, based on asio, similar to Python's asyncio, designed for stateful services, and can be used to quickly build a variety of online game servers, microservices and pressure testing tools
Stars: ✭ 48 (-51.52%)
Mutual labels:  gameserver
Nettygameserver
使用netty4.X实现的手机游戏分布式服务器,支持tcp,udp,http,websocket链接,采用protobuf自定义协议栈进行网络通信,支持rpc远程调用,使用mybatis3支持db存储分库分表,支持异步mysql存储,db保存时同步更新reids缓存。 使用ExcelToCode工程,将excel数据生成java类和json数据字典,DictService直接读取json,减少数据字典部分代码。使用game-executor工程,增加游戏内的异步事件全局服务, 支持事件sharding,均衡的异步执行事件逻辑
Stars: ✭ 1,203 (+1115.15%)
Mutual labels:  gameserver
L2dotnet
A server emulator for Lineage2 Interlude written in C#
Stars: ✭ 98 (-1.01%)
Mutual labels:  gameserver
nodegame-server
nodeGame server for the browser and node.js
Stars: ✭ 17 (-82.83%)
Mutual labels:  gameserver
Discordgsm
📺 Monitor your game servers on Discord and tracks the live data of your game servers. Also support one-click deployment to Heroku, self-hosted. Invite: https://discordgsm.com/invite
Stars: ✭ 74 (-25.25%)
Mutual labels:  gameserver
pigame
Just a game server template for Erlang/OTP.
Stars: ✭ 25 (-74.75%)
Mutual labels:  gameserver
Distributed game server
java,gameserver,distributed,vert.x,游戏服务器
Stars: ✭ 8 (-91.92%)
Mutual labels:  gameserver
Iw4x Client
🎮 Official IW4x source code
Stars: ✭ 218 (+120.2%)
Mutual labels:  gameserver
hawthorne
Game Server Management - Easy, Accessible, Self Hosted - simply reinvented.
Stars: ✭ 28 (-71.72%)
Mutual labels:  gameserver
ctf-gameserver
FAUST Gameserver for attack-defense CTFs
Stars: ✭ 38 (-61.62%)
Mutual labels:  gameserver
UltimaPHP
A modern Ultima Online server written in PHP
Stars: ✭ 123 (+24.24%)
Mutual labels:  gameserver

pitaya-notes

Scalable game server framework with clustering support, code notes 分布式游戏服务器pitaya,代码注释

结合项目使用pitaya的情况,对框架代码进行阅读和注释,加深理解. 同时对项目中遇到的情况进行说明给出解决方法. 目前pitaya因为是国外开源国内无社区,开源速度算是一般,架构ok但是实现上有待改善.

架构简述

游戏分为前后端服务,前端服务可以监听客户端连接,后端服务只接受rpc.
rpc底层实现为nats或者grpc. rpc分为两种sys rpc 和user rpc.sys rpc是服务之间
转发客户端消息的流程,user rpc是服务器之间用户代码实现的调用.

组件注册会生成服务,会根据反射将方法变为接收调用的反射信息,调用分析消息handler和rpc两种.
HandlerService
将组件Component中的符合Handler的方法遍历处理按照路由名字生成一个map放入HandleServices
一个组件生成一个Service存储组件本身和组件中handler的反射信息 同时将组件名字和service关联 且记录所有的路由和Handle的反射信息.

RemoteService
将组件Component,遍历组件方法取出符合rpc调用的方法封装为Remote 并且存储为method-name:Remote的map.

消息接收
app启动对每个acceptor上管道上传来的conn HandlerService创建一个agent然后读取数据成成消息写入消息管道,对管道消息进行处理,本地消息则交由本地服务器处理,
远程消息则交由remoteService处理.消息中存在servertype如果和本地不同则是remote消息,需要进行一次sys rpc转发调用到符合的service中调用本地方法.

关于RPC

游戏服务器中往往存在这多用开发语言,grpc对各种语言提供和很好的支持,非常的方便.

存在问题

  1. 消息不能大于2048byte 推荐同步nano的handler中的接收消息逻辑
  2. websocket使用上存在多线程写问题 推荐使用nano的心跳和发送消息逻辑
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].