{"id":15056289,"url":"https://github.com/meteorgx/gengametools","last_synced_at":"2026-03-17T18:01:46.287Z","repository":{"id":254572808,"uuid":"846853347","full_name":"MeteorGX/GenGameTools","owner":"MeteorGX","description":"Generate online game framework toolset","archived":false,"fork":false,"pushed_at":"2024-09-16T15:52:46.000Z","size":159,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-29T21:26:38.111Z","etag":null,"topics":["erlang","gameserver","godot"],"latest_commit_sha":null,"homepage":"","language":"Python","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/MeteorGX.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":"2024-08-24T06:12:04.000Z","updated_at":"2025-08-04T11:36:07.000Z","dependencies_parsed_at":"2024-08-24T12:54:03.527Z","dependency_job_id":"098ec15d-cd66-43bc-bb84-a9679f16621d","html_url":"https://github.com/MeteorGX/GenGameTools","commit_stats":null,"previous_names":["meteorgx/gengametools"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MeteorGX/GenGameTools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeteorGX%2FGenGameTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeteorGX%2FGenGameTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeteorGX%2FGenGameTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeteorGX%2FGenGameTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeteorGX","download_url":"https://codeload.github.com/MeteorGX/GenGameTools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeteorGX%2FGenGameTools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30628405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["erlang","gameserver","godot"],"created_at":"2024-09-24T21:49:45.251Z","updated_at":"2026-03-17T18:01:46.248Z","avatar_url":"https://github.com/MeteorGX.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 游戏工具集\n\n汇集日常 `游戏服务端|客户端|策划` 常用的工具集, 采用 `Python3` 做处理, 相关其他文档内容:\n\n\u003e [具体游戏项目规划](Doc/README.md)\n\n## Erlang服务端\n\n初始化 `Erlang` 游戏项目项目, 自带了 `Rebar3` 做包管理:\n\n```shell\n# 构建出名为 game 游戏服务端, -lib 附带有自定义的工具\npython Rebar3Builder/GenRebar3Project.py -p game -lib\n```\n\n## 网络协议\n\n这里导出网络数据传输模板文件, 采用二进制数据做数据封包处理, 这里执行模板内容定义:\n\n```plain\n// 参考 Proto/defines/user.txt\n.c2s_login_req\n\t//请求登录, 客户端连接成功后发的第一条协议\n\t{\n\t\tuint:sid \t\t//服号\n\t\tuint:ver \t\t//版本号\n\t\tstring:username //账号\n\t\tstring:password // 密码\n\t}\n```\n\n执行协议转化工具:\n\n```shell\n# -d 为读取的协议模板, -o 为导出协议模板文件目录, 默认导出协议文件名为 protocol.txt\npython ProtocolBuidler/GenProtocolLoader.py -d Proto/defines -o Proto/output\n```\n\n最后导出的模板文件, 也就是 `Proto/output/protocol.txt` 文件:\n\n```plain\n//登录相关, 这里首位 201 就是提交协议Id, 客户端按照协议封包方式提交\n201.c2s_login_req\n\t//请求登录, 客户端连接成功后发的第一条协议\n\t{\n\t\tuint:sid \t\t//服号\n\t\tuint:ver \t\t//版本号\n\t\tstring:username //账号\n\t\tstring:password // 密码\n\t}\n```\n\n\u003e 客户端需要以此模板文件自己做命令行工具解构成自己源代码文件\n\n网络数据结构, 采用大端网络序列做数据提交:\n\n```plain\n[ uint32(数据长度) ][ uint32(协议id) ][ bytes(数据二进制) ]\n```\n\n二进制封包数据后续再扩展怎么做数据封包和解包, 这里暂时仅做示范, 这里也提供个 `Erlang` 服务端和 `Godot` 客户端编码解码工具:\n\n```shell\n# -f 就是 GenProtocolLoader.py 解析的协议文件, -o 就是 Erlang 协议输出目录\npython ProtocolBuidler\\GenProtocolErlang.py -f Proto/output/protocol.txt -o Proto/output/erlang\n# 最后会在 Proto/output/erlang 目录输出对应源文件和头文件\n\n# Godot 功能也是一致\npython ProtocolBuidler\\GenProtocolGodot.py -f Proto/output/protocol.txt -o Proto/output/gd\n```\n\n## 策划打表\n\n日常数据需要策划进行 `excel` 配表设置, 需要先安装 `Python3` 依赖:\n\n```shell\npip install openpyxl\npip install slpp\n```\n\n之后就是打表为服务端和客户端文件, 这里提供随机昵称码表工具调用( `cfg_nickname` ):\n\n```shell\n# 导出 erlang 服务端所需文件\npython ExcelBuilder/GenExcelTables.py --input Excel/xls --srv Excel/output/server  --timeout -1 --suffix .xlsx --swriter erlangerl\npython ExcelBuilder/GenExcelTables.py --input Excel/xls --srv Excel/output/server --timeout -1 --suffix .xlsx --swriter erlanghrl\n\n# 导出 lua 客户端所需文件\npython ExcelBuilder/GenExcelTables.py --input Excel/xls --clt Excel/output/client --timeout -1 --suffix .xlsx --cwriter lua\n\n# 导出 Godot 客户端所需文件\npython ExcelBuilder/GenExcelTables.py --input Excel/xls --clt Excel/output/client --timeout -1 --suffix .xlsx --cwriter gdscript\n```\n\n这里就会导出文件到 ` Excel/output/server` 和 `Excel/output/client` 目录.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeteorgx%2Fgengametools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeteorgx%2Fgengametools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeteorgx%2Fgengametools/lists"}