{"id":26590156,"url":"https://github.com/niuma-wj/client","last_synced_at":"2026-05-02T09:35:10.913Z","repository":{"id":280609824,"uuid":"942564276","full_name":"niuma-wj/client","owner":"niuma-wj","description":"NiuMa平台游戏客户端(Unity、xLua热更新、棋牌游戏、麻将、斗地主、比鸡、牛牛)","archived":false,"fork":false,"pushed_at":"2025-03-20T01:16:00.000Z","size":89715,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-20T01:43:00.154Z","etag":null,"topics":["doudizhu","mahjong","unity","xlua"],"latest_commit_sha":null,"homepage":"","language":"C#","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/niuma-wj.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":"2025-03-04T09:57:06.000Z","updated_at":"2025-03-20T01:27:25.000Z","dependencies_parsed_at":"2025-03-04T10:51:07.794Z","dependency_job_id":null,"html_url":"https://github.com/niuma-wj/client","commit_stats":null,"previous_names":["niuma-wj/client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuma-wj%2Fclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuma-wj%2Fclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuma-wj%2Fclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuma-wj%2Fclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niuma-wj","download_url":"https://codeload.github.com/niuma-wj/client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245105563,"owners_count":20561550,"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":["doudizhu","mahjong","unity","xlua"],"created_at":"2025-03-23T13:21:31.322Z","updated_at":"2026-05-02T09:35:10.893Z","avatar_url":"https://github.com/niuma-wj.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"**其他语言版本: [中文](README.MD), [English](README_EN.MD).**\n\n# 概述\n\nNiuMa 游戏平台是一个全平台全工具链支持，包括 H5、原生 Android 及 IOS、Windows、MAC 等平台，且全平台互通的完整棋牌游戏解决方案，平台支持 Unity3D 和 Cocos Creator(3.8.7)两大主流游戏开发引擎。平台包含游戏服务器(C++)、WEB 服务端（JAVA）、Unity3D 环境客户端、Cocos Creator 环境客户端、后台管理前端（VUE）五个子项目。NiuMa 是一个免费授权开源项目，任何人都可以在此基础上做扩展和修改。本项目作为技术学习研究使用，切勿用于非法用途，否则由此引发的法律纠纷及连带责任本人概不承担。\n\n平台代码组织入口地址：[Project](https://github.com/niuma-wj)\\\n掼蛋游戏已更新，欢迎下载客户端测试，\\\n[下载地址 1](https://github.com/niuma-wj/client/releases/tag/client)\\\n[下载地址 2](http://106.55.181.89:8896/download)\\\n[WEB 客户端 PC 版](http://106.55.181.89:8896/niuma/web/pc)\\\n[WEB 客户端 H5 版](http://106.55.181.89:8896/niuma/web/h5)\\\n客户端是Unity3D工程项目(即项目名称client)打包生成，已包含麻将、掼蛋、牛牛等游戏，而WEB客户端则由Cocos Creator工程项目(即项目名称client-cocos)打包生成，当前仅实现了掼蛋游戏，两种开发平台下的客户端代码逻辑是完全相同的，其他游戏要集成到WEB版本客户端仅需要将lua代码翻译成Typescript代码即可。此外，由于 WEB 客户端所在的服务器带宽较低，所以加载相对较慢。\n\n# Unity 版本要求\n\n本项目最低支持的 Unity 版本为 2022.3.12f1 版本，因为依赖的 MessagePack-CSharp 库需要该版本以上才能通过 C#源码生成器以支持 IL2CPP，若不打 IL2CPP(即是用 MONO)则无此要求，不过通常建议打 IL2CPP 包，以便获得更好的性能并同时支持 ARM32 和 ARM64。具体请查看：\n[MessagePack-CSharp](https://github.com/MessagePack-CSharp/MessagePack-CSharp#unity-support)\n\n# 热更新方案\n\n本项目使用腾讯开源的 xLua 热更新方案，在此感谢 xLua 开源项目开发者的无私奉献。\nxLua 开源项目地址：\n[xLua](https://github.com/Tencent/xLua)\\\n游戏打包之前需要手动生成 xLua 相关的 C#代码，如下图所示：\\\n![xLua](https://github.com/niuma-wj/data/blob/main/xlua.jpg?raw=true)\\\n\n# 游戏打包\n\n打包游戏前需要先把 Assets/NiuMa/Resources 文件夹以及 Assets/NiuMa/Resources.meta 文件临时移出工程，因为 Assets/NiuMa/Resources 文件夹内的所有资源都以 asset bundle 的方式加载，游戏打包完成后再将这两者移回原位置。\n\n# AssetBundle 打包\n\n使用如下图所示菜单打包资源和脚本\\\n![assetbundle](https://github.com/niuma-wj/data/blob/main/ab.jpg?raw=true)\\\nAssetBundle 包全部文件如下图所示：\\\n![assetbundle](https://github.com/niuma-wj/data/blob/main/ab-list.jpg?raw=true)\\\n其中 MainManifest.xml 文件为客户端主界面依赖的 AssetBundle 包清单，GameManifest.xml 文件为客户端中各游戏依赖的 AssetBundle 包清单，Dependencies.xml 文件为 AssetBundle 包之间的依赖关系，Dependencies.xml 文件在打资源包时自动生成和更新(打 LUA 脚本包不会更新该文件)，其他两个 xml 则需要手动编辑。特别注意，这三个文件都需要保存为 UTF8 编码格式，否则客户端无法正常读取文件内容，所以每次打资源包之后需要手动将 Dependencies.xml 保存为 UTF8 编码格式，例如在 Windows 下可以用记事本打开另存为并选择 UTF8 编码。\\\n客户端主界面以及各个游戏的依赖 AssetBundle 包可以单独更新，这样使得在更新客户端时可以最小化下载依赖文件，如下图所示：\\\n![load](https://github.com/niuma-wj/data/blob/main/load.jpg?raw=true)\\\n![hall](https://github.com/niuma-wj/data/blob/main/hall.jpg?raw=true)\n\n![掼蛋截图 1](https://github.com/niuma-wj/data/blob/main/guandan1.jpg?raw=true)\\\n![掼蛋截图 2](https://github.com/niuma-wj/data/blob/main/guandan2.jpg?raw=true)\n\n# 启动配置\n\n客户端启动时首先需要加载一个名称为 config.json 的文件，该文件配置了后端 HTTP 接口地址，以及 AssetBundle 加载地址，文件内容如下图所示：\\\n![config](https://github.com/niuma-wj/data/blob/main/config.jpg?raw=true)\\\n在 Load.cs 代码中修改 config.json 的下载 url 地址，该 url 是写死在代码中的，当需要访问不同的后端地址时，仅需要重新配置 config.json 并替换该文件，而不需要重新打包客户端，如下图。\\\n![config1](https://github.com/niuma-wj/data/blob/main/config1.jpg?raw=true)\n\n# Debug 模式\n\n客户端支持调试模式，以便在打包之后(例如安卓和 IOS 端)可以在屏幕上打印 Debug.Log(以及 Lua 的 print 函数)的输出内容，方便在手机上排查错误，开起调试的代码设置如下图：\\\n![debug](https://github.com/niuma-wj/data/blob/main/debug.jpg?raw=true)\\\n开启调试模式之后的输出效果：\\\n![debug](https://github.com/niuma-wj/data/blob/main/debug1.jpg?raw=true)\n\n# 说明\n\n平台当前包含麻将、逮狗腿（斗地主类）、六安比鸡，以及百人牛牛共 4 款棋牌游戏。\\\n代码仓库中的密钥文件(Assets/Resources/user.keystore)的密码为：123456，该文件在打安卓包时需要用到。\n\n# 联系方式\n\n393817707@qq.com，大佬们麻烦点个Star，万分感谢！\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniuma-wj%2Fclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniuma-wj%2Fclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniuma-wj%2Fclient/lists"}