{"id":18267667,"url":"https://github.com/oxeu/seedcup","last_synced_at":"2026-07-22T20:31:43.342Z","repository":{"id":104133243,"uuid":"571219461","full_name":"OXeu/seedcup","owner":"OXeu","description":"🎈基于2022种子杯重实现GUI的客户端","archived":false,"fork":false,"pushed_at":"2022-12-08T15:00:43.000Z","size":29930,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T12:55:22.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OXeu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-11-27T14:51:22.000Z","updated_at":"2022-11-27T14:53:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"994c7a0a-7f53-46c9-ae3e-1b72e1a2f96f","html_url":"https://github.com/OXeu/seedcup","commit_stats":null,"previous_names":["oxeu/seedcup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OXeu/seedcup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fseedcup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fseedcup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fseedcup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fseedcup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OXeu","download_url":"https://codeload.github.com/OXeu/seedcup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fseedcup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35777193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-22T02:00:06.236Z","response_time":124,"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":[],"created_at":"2024-11-05T11:28:14.136Z","updated_at":"2026-07-22T20:31:43.316Z","avatar_url":"https://github.com/OXeu.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 2022 种子杯赛题\n##目录结构\n```\n./\n├── README.md\n├── config.json\n├── seedcupServer  # seedcup server\n├── bot            # baseline model\n├── documents\n│   ├── 2022种子杯初赛试题.pdf\n└── client\n    ├── base.py    # commen class/enum\n    ├── config.py  # read config file\n    ├── req.py     # request packet\n    ├── resp.py    # response packet\n    ├── ui.py      # ui for debug\n    └── main.py    # main entry\n```\n\n## 使用说明\n默认工作目录在最外层目录即为上图所示的``./``\n```bash\n# launch server\n./seedcupServer # if run into permission denied problem, run `chmod +x server` first\n\n# launch python client\npython client/main.py\n\n\n# launch bot\n./bot # if run into permission denied problem, run `chmod +x server` first\n```\n\npython客户端提供了玩家手玩的功能，两名玩家可以连接同一台机器手玩游戏体验游戏机制。\n\n## 传输协议\n客户端和服务端通信需要遵循一定的协议，为了便于选手debug，采用json序列化及反序列化。在python客户端中已经实现了通信的协议，理论上选手可以直接按照客户端提供的接口即可。\n\n### Reqeust协议\n#### 总协议\n总的协议体如下：`type`字段为`1`表示`InitReq`，`type`字段为`2`表示`ActionReq`。`data`字段则包含具体的请求。\n```json\n{\n  \"type\": 1,\n  \"data\": {\n\n  }\n}\n```\n#### InitReq\n`Init`请求告知服务端主武器和特殊武器的类型。\n```json\n{\n    \"masterWeaponType\": 1,\n    \"slaveWeaponType\": 2\n}\n```\n#### ActionReq\n`Action`请求告知服务端客户端要进行的具体行动。\n```json\n{\n    \"characterID\": 1,\n    \"actionType\": 2,\n    \"actionParam\": {}\n}\n```\n\n### Response协议\n总的协议体如下：`type`字段表示`resp`类型，`data`字段表示对应的具体的值。\n```json\n{\n  \"type\": 1,\n  \"data\": {\n\n  }\n}\n```\n#### ActionResp\n`ActionResp`会返回击杀数`kill`，当前得分`score`，以及整个地图信息，选手可以利用这些信息训练模型。\n```json\n{\n    \"playerID\": 0,\n    \"frame\": 1,\n    \"color\": 1,\n    \"kill\": 1,\n    \"score\": 20,\n    \"characters\": [],\n    \"map\":{\n        \"blocks\": [\n            {\n                \"x\": 0,\n                \"y\": 0, \n                \"frame\" : 1,\n                \"valid\": true,\n                \"color\": 2,\n                \"objs\": [\n\n                ]\n            }\n        ]\n    }\n}\n```\n##### Obj\n每个`block`可能含有0个或多个`obj`, `obj`有三种类型:`Character`，`Item`，`SlaveWeapon`。\n`Character`为玩家操控的角色，有以下属性\n```json\n{\n    \"x\": 0,\n    \"y\": 0,\n    \"playerID\": 0,\n    \"characterID\": 0,\n    \"direction\": 1,\n    \"color\": 2,\n    \"hp\": 2,\n    \"moveCD\": 2,\n    \"moveCDLeft\": 2,\n    \"isAlive\": true,\n    \"isSneaky\": true,\n    \"isGod\": false,\n    \"rebornTimeLeft\": 0,\n    \"godTimeLeft\": 0,\n    \"slaveWeapon\":{},\n    \"masterWeapon\": {}\n}\n```\n`Item`为场上的增益`buff`，有以下属性\n```json\n{\n    \"buffType\": 0\n}\n```\n`SlaveWeapon`为特殊武器，有以下属性\n```json\n{\n    \"weaponType\": 1,\n    \"playerID\": 1\n}\n```\n#### GameOverResp\n当游戏结束时会发送`GameOverResp`，有以下属性\n```json\n{\n    \"scores\": [20,22],\n    \"result\": 1\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxeu%2Fseedcup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxeu%2Fseedcup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxeu%2Fseedcup/lists"}