{"id":13412931,"url":"https://github.com/xtaci/gonet","last_synced_at":"2025-05-15T23:07:09.759Z","repository":{"id":7962245,"uuid":"9360392","full_name":"xtaci/gonet","owner":"xtaci","description":"A Game Server Skeleton in golang.","archived":false,"fork":false,"pushed_at":"2024-07-25T03:40:39.000Z","size":1487,"stargazers_count":1279,"open_issues_count":0,"forks_count":295,"subscribers_count":135,"default_branch":"master","last_synced_at":"2025-04-08T10:24:14.084Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtaci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-11T02:18:23.000Z","updated_at":"2025-04-03T08:48:39.000Z","dependencies_parsed_at":"2024-09-21T04:01:07.988Z","dependency_job_id":"8a22279f-d2ab-47f2-b740-83001c558758","html_url":"https://github.com/xtaci/gonet","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.052631578947368474","last_synced_commit":"7e529c8dbaca6cf426827f9a9aa5ac0076dc24ce"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fgonet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fgonet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fgonet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fgonet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtaci","download_url":"https://codeload.github.com/xtaci/gonet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436948,"owners_count":22070947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:31.266Z","updated_at":"2025-05-15T23:07:04.447Z","avatar_url":"https://github.com/xtaci.png","language":"Go","readme":"### A game server skeleton implemented with golang.\n![Architecture](doc/arch.png)\n\n### gonet/2\n\ngonet1已停止维护(I no longer maintain this, please move forward to http://github.com/gonet2 )\n\n建议移步至新架构:  http://gonet2.github.io\n\n#### 部署:     \n* Game Server(GS):  \n玩家直接连接GS， 处理玩家逻辑，并与 HUB/SS 通信，GS存在若干个。    \n(Players connect directly to GS(s) and process, GS(s) will communication with HUB)\n  \n* Hub Server(HUB):  \n若干个GS 连接到一个HUB, 只存在一个HUB，维护基础的全局信息，以及 GS\u003c---\u003eGS 的消息转发.  \n(packet forwarding)\n    \n* Stats Server(SS):     \n统计服务器，根据玩家的行为，记录策划需要的数据，以便于后期统计。     \n统计属于事后分析，数据量较大，性能需求不同, 故单独列为一个服务器。\n\n#### 通信原则:     \n1.  GS到HUB/SS的通信，都是Call同步调用，即GS必须等待ACK。         \n2.  HUB到GS的通信，只有forward数据包。       \n3.  单播消息在玩家离线时会存入db, 登录后的启动过程 ___GS___ 直接读取db，并forward给玩家goroutine。(持久化)       \n4.  多播消息会发送给所有的在线玩家(非持久化)       \n5.  广播消息会发送给所有的在线玩家(非持久化)       \n\n#### 服务器状态一致性\n1.  GS节点可以单独重启    \n2.  HUB 重启后，GS必须全部重启    \n3.  SS 可随意重启，不影响业务         \n\n#### 安装先决条件:\n0. 确保安装好graphviz, gawk\n1. 确保安装好mongodb\n2. 确保config.ini中的mongo_xxxx配置正确\n3. export GOPATH='当前目录'\n\n#### 安装:\n* xtaci@ubuntu:~$ git clone https://github.com/xtaci/gonet       \n* xtaci@ubuntu:~$ cd gonet        \n* xtaci@ubuntu:~/gonet$ export GOPATH=~/gonet       \n* xtaci@ubuntu:~/gonet$ go get gopkg.in/mgo.v2\n* xtaci@ubuntu:~/gonet$ make    \n* xtaci@ubuntu:~/gonet$ ./start-test.sh\n","funding_links":[],"categories":["Game Development","游戏开发","\u003cspan id=\"游戏开发-game-development\"\u003e游戏开发 Game Development\u003c/span\u003e","Go","Relational Databases"],"sub_categories":["Advanced Console UIs","检索及分析资料库","Search and Analytic Databases","SQL 查询语句构建库","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtaci%2Fgonet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtaci%2Fgonet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtaci%2Fgonet/lists"}