All Projects → viphxin → Xingo

viphxin / Xingo

Licence: apache-2.0
高性能golang网络库,游戏开发脚手架

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Xingo

Rucio
Rucio - Scientific Data Management
Stars: ✭ 131 (-81.98%)
Mutual labels:  network, distributed-systems
Librg
🚀 Making multi-player gamedev simpler since 2017
Stars: ✭ 813 (+11.83%)
Mutual labels:  game, network
Go2p
Simple to use but full configurable p2p framework
Stars: ✭ 80 (-89%)
Mutual labels:  network, distributed-systems
Distributedsystem Series
📚 深入浅出分布式基础架构,Linux 与操作系统篇 | 分布式系统篇 | 分布式计算篇 | 数据库篇 | 网络篇 | 虚拟化与编排篇 | 大数据与云计算篇
Stars: ✭ 1,092 (+50.21%)
Mutual labels:  network, distributed-systems
Nice Lua
基于xlua的MVVM框架,支持Addressables, 统一渲染管线等Unity新特性
Stars: ✭ 207 (-71.53%)
Mutual labels:  game, network
Erewhon Game
Video game about programming your spaceships to destroy other programmed spaceships o/
Stars: ✭ 35 (-95.19%)
Mutual labels:  game, network
Openspades
Compatible client of Ace of Spades 0.75
Stars: ✭ 769 (+5.78%)
Mutual labels:  game, network
Moon
A cross-platform,lightweight,scalable game server framework written in C++, and support Lua Script
Stars: ✭ 313 (-56.95%)
Mutual labels:  game, network
Nano
Lightweight, facility, high performance golang based game server framework
Stars: ✭ 1,888 (+159.7%)
Mutual labels:  game, distributed-systems
Sgf
This is a Smart Game Foundation (Not Framework)
Stars: ✭ 122 (-83.22%)
Mutual labels:  game, network
Nkn
Official Go implementation of NKN full node.
Stars: ✭ 287 (-60.52%)
Mutual labels:  network, distributed-systems
Nuraft
C++ implementation of Raft core logic as a replication library
Stars: ✭ 428 (-41.13%)
Mutual labels:  network, distributed-systems
Translations
🐼 Chinese translations for classic IT resources
Stars: ✭ 6,074 (+735.49%)
Mutual labels:  distributed-systems
Nanoserver
DEMO: Mahjong server base on nano(https://github.com/lonng/nano)
Stars: ✭ 706 (-2.89%)
Mutual labels:  game
Abstreet
Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit
Stars: ✭ 6,355 (+774.14%)
Mutual labels:  game
Godot Make Pro 2d Games
A-RPG demo made with Godot, MIT-licensed, from our Godot course
Stars: ✭ 674 (-7.29%)
Mutual labels:  game
Talent Plan
open source training courses about distributed database and distributed systemes
Stars: ✭ 6,965 (+858.05%)
Mutual labels:  distributed-systems
Expo Crossy Road
🐥🚙 Crossy Road game clone made in Expo (iOS, Android, web), THREE.js, Tween, React Native. 🐔
Stars: ✭ 701 (-3.58%)
Mutual labels:  game
Kubeinvaders
Gamified Chaos Engineering Tool for Kubernetes
Stars: ✭ 673 (-7.43%)
Mutual labels:  game
Brooklin
An extensible distributed system for reliable nearline data streaming at scale
Stars: ✭ 668 (-8.12%)
Mutual labels:  distributed-systems

xingo_cluster

xingo golang游戏开发交流群:535378240
文档地址: http://www.runingman.net/

     xingo是免费、开源、可定制、可扩展、节点支持“热更新”的高性能分布式服务器开发框架,采用golang语言开发,天生携带
 高并发场景的处理基因,继承了golang语言本身的各种优点,开发简单易上手并且功能强大。它主要实现了高性能的异步网络库,
 分布式节点间的高性能rpc通信,日志管理,数据库支持(暂时只支持mongodb),goroutine安全的定时器,telnet在线服务器调试
 工具等,可用的开发场景包括但不局限于IM即时通讯服务器,游戏服务器(已有多款公司级别的项目选择了xingo)等可以节省大量
 游戏开发时间,让游戏开发人员可以将主要精力放到游戏玩法和游戏逻辑上。真正实现了修改配置文件就可以搭建自定义的分布式服
 务器架构。

    优势特点:
    1) 开发效率高
    2) 支持自定义的分布式架构,方便横向扩展节点,理论上只要有足够的物理机器,没有承载上限
    3) 支持自定义通信协议
    4) 分布式节点自动发现,自动重连
    5) worker pool工作线程池
    6) telnet在线服务调试工具(使用方便扩展简单)
    7) 内置mongodb数据库支持
    8)goroutine安全的定时器实现

示例配置:

{
    "master":{"host": "192.168.2.225","rootport":9999},
    "servers":{
        "gate2":{"host": "192.168.2.225", "rootport":10000,"name":"gate2", "module": "gate", "log": "gate2.log"},
        "gate1":{"host": "192.168.2.225", "rootport":10001,"name":"gate1", "module": "gate", "log": "gate1.log"},
        "net1":{"host": "192.168.2.225", "netport":11009,"name":"net1","remotes":["gate2", "gate1"], 
                    "module": "net", "log": "net.log"},
        "net2":{"host": "192.168.2.225", "netport":11010,"name":"net2","remotes":["gate2", "gate1"], 
                    "module": "net", "log": "net.log"},
        "net3":{"host": "192.168.2.225", "netport":11011,"name":"net3","remotes":["gate2", "gate1"], 
                    "module": "net", "log": "net.log"},
        "net4":{"host": "192.168.2.225", "netport":11012,"name":"net4","remotes":["gate2", "gate1"], 
                    "module": "net", "log": "net.log"},
        "admin":{"host": "192.168.2.225", "remotes":["gate2", "gate1"], "name":"admin", "module": "admin", 
            "http": [8888, "/static"]},
        "game1":{"host": "192.168.2.225", "remotes":["gate2", "gate1"], "name":"game1", "module": "game"}
    }
}

示例架构图: alt text

默认通信协议如下(支持自定义协议处理部分代码,支持灵活的重载协议部分代码):

Len uint32 数据Data部分长度
MsgId uint32 消息号
Data []byte 数据
消息默认通过google 的protobuf进行序列化

服务器全局配置对象为GlobalObject,支持的配置选项及默认值如下:
TcpPort: 8109,//服务器监听端口
MaxConn: 12000,//支持最大链接数
LogPath: "./log",//日志文件路径
LogName: "server.log",//日志文件名
MaxLogNum: 10,//最大日志数
MaxFileSize: 100,//per日志文件大小
LogFileUnit: logger.KB,//日志文件大小对应单位
LogLevel: logger.ERROR,//日志级别
SetToConsole: true,//是否输出到console
LogFileType: 1,//日志切割方式1 按天切割 2按文件大小切割 PoolSize: 10,//api接口工作线程数量
MaxWorkerLen: 1024 * 2,//任务缓冲池大小
MaxSendChanLen: 1024,//发送队列从缓冲池
FrameSpeed: 30,//未使用
MaxPacketSize: 1024,//协议数据包最大包体大小
FrequencyControl: 100/s,// 100/h(每小时一百个包), 100/m(每分钟一百个包), 100/s(每秒一百个包)
OnConnectioned: func(fconn iface.Iconnection) {},//链接建立事件回调
OnClosed: func(fconn iface.Iconnection) {},//链接断开事件回调
OnServerStop: func(), //服务器停服回调
Protoc: iface.IServerProtocol//socket数据pack和unpack的实现,可以通过设置该值重载服务器协议

如何使用?
只需要一步,添加消息路由:
s := fserver.NewServer()
//add api ---------------start
FightingRouterObj := &api.FightingRouter{}
s.AddRouter(FightingRouterObj)
//add api ---------------end
xingo会自动注册FightingRouter中的方法处理对应消息
例如:msgId =1 则会寻找FightingRouter中的Func_1的方法从进行处理
具体使用请参考项目:
帧同步服务器: https://github.com/viphxin/fighting
mmo demo: https://git.oschina.net/viphxin/xingo_demo
xingo_cluster demo: https://github.com/viphxin/xingo_cluster

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].