{"id":21683342,"url":"https://github.com/dot123/eggserver","last_synced_at":"2026-04-12T00:47:18.085Z","repository":{"id":264476401,"uuid":"893433834","full_name":"dot123/eggserver","owner":"dot123","description":"百人大逃杀游戏服务器","archived":false,"fork":false,"pushed_at":"2024-12-20T08:30:13.000Z","size":34179,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T11:25:25.329Z","etag":null,"topics":["gin","gorm"],"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/dot123.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-11-24T12:47:46.000Z","updated_at":"2024-12-20T08:30:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"61c6ebdd-4506-41c7-8079-8b5788549770","html_url":"https://github.com/dot123/eggserver","commit_stats":null,"previous_names":["dot123/eggserver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dot123/eggserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot123%2Feggserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot123%2Feggserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot123%2Feggserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot123%2Feggserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dot123","download_url":"https://codeload.github.com/dot123/eggserver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot123%2Feggserver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378965,"owners_count":24240907,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gin","gorm"],"created_at":"2024-11-25T16:11:16.901Z","updated_at":"2026-04-12T00:47:18.051Z","avatar_url":"https://github.com/dot123.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eggserver百人大逃杀游戏服务器\n\n## 客户端：https://github.com/dot123/eggroyale\n\n## 项目概述\nEggServer 是一个基于 Go 语言开发的高性能服务器项目，采用现代化的技术栈和架构设计。\n\n## 1. 核心技术\n- **编程语言**: Go (版本 1.22.5)\n  - 高性能、并发友好的编程语言\n  - 丰富的标准库和工具链\n- **Web框架**: Gin (gin-gonic/gin)\n  - 高性能 HTTP Web 框架\n  - 优秀的路由性能和中间件支持\n- **数据库**: \n  - MySQL (gorm.io/driver/mysql)\n    - 主要数据持久化存储\n    - 通过 GORM 实现 ORM 映射\n  - Redis (redis/go-redis/v9)\n    - 缓存和数据共享\n    - 分布式锁实现\n\n## 2. 主要框架和库\n\n### 2.1 Web相关\n- Gin Web框架\n  - RESTful API 支持\n  - 中间件机制\n- CORS中间件 (gin-contrib/cors)\n  - 跨域资源共享支持\n- Swagger文档 (swaggo/gin-swagger)\n  - API 文档自动生成\n  - 接口测试支持\n\n### 2.2 数据库和缓存\n- GORM ORM框架\n  - 数据库模型映射\n  - 自动迁移支持\n- Redis 缓存\n  - 高性能数据缓存\n  - 分布式数据共享\n- Redis分布式锁 (go-redsync)\n  - 分布式环境下的同步控制\n- 内存缓存 (go-cache)\n  - 本地缓存支持\n\n### 2.3 认证和安全\n- JWT认证 (golang-jwt/jwt/v5)\n  - 用户身份验证\n  - 无状态会话管理\n- 速率限制 (redis_rate)\n  - API 访问控制\n  - 防止恶意请求\n\n### 2.4 工具库\n- Snowflake ID生成器\n  - 分布式环境下的唯一ID生成\n- Logrus日志系统\n  - 结构化日志记录\n- 文件轮转日志 (file-rotatelogs)\n  - 日志文件管理\n- MessagePack序列化 (msgpack)\n  - 高效的数据序列化\n- 错误处理 (pkg/errors)\n  - 统一的错误处理机制\n\n## 3. 项目架构特点\n\n### 3.1 目录结构\n```\n├── cmd/            # 主程序入口\n├── internal/       # 内部包\n│   ├── config/     # 配置管理\n│   ├── handler/    # HTTP请求处理\n│   ├── logic/      # 业务逻辑实现\n│   ├── middleware/ # 中间件组件\n│   └── models/     # 数据模型定义\n├── pkg/            # 公共功能包\n├── tools/          # 开发工具集\n└── docs/           # API 文档\n```\n\n### 3.2 设计模式\n- 三层架构模式\n  - Model: 数据模型层，处理数据持久化\n  - Handler: 请求处理层，负责HTTP请求的处理和路由\n  - Logic: 业务逻辑层，实现核心业务逻辑\n- 中间件模式\n  - 灵活的请求处理链\n  - 可插拔的功能模块\n- Repository模式\n  - 数据访问层抽象\n  - 便于切换数据源\n\n## 4. 开发和部署\n\n### 4.1 开发工具和命令\n- `./install dependencies.cmd`\n  - 安装项目依赖工具包\n- `./build_swag.cmd`\n  - 生成 API 接口文档\n- `./configs_gen.cmd`\n  - 使用 luban 导出配置表数据\n- `./robot/run.cmd`\n  - 性能压测工具\n- `./tools/error-gen/build.cmd`\n  - 生成错误码文件\n- `./data/conf/`\n  - MySQL、Redis 等配置信息\n\n### 4.2 部署和运维\n- `./build.sh`\n  - 打包项目为 bin.zip\n- AWS Lambda 支持\n  - 实现服务高可用\n  - 弹性伸缩能力\n\n## 5. 客户端截图\n### 主界面\n![主界面](./screenshot/01.png)\n\n### 宠物界面\n![宠物界面](./screenshot/02.png)\n\n### 任务界面\n![任务界面](./screenshot/03.png)\n\n### 商店界面\n![商店界面](./screenshot/04.png)\n\n### 签到界面\n![签到界面](./screenshot/05.png)\n\n### 战令界面\n![战令界面](./screenshot/06.png)\n\n### 匹配界面\n![宠物界面](./screenshot/07.png)\n\n### 战斗界面\n![战斗界面](./screenshot/08.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdot123%2Feggserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdot123%2Feggserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdot123%2Feggserver/lists"}