-
Notifications
You must be signed in to change notification settings - Fork 159
(Don't Merge)Nekobrawl arena v2 #1454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rophec
wants to merge
18
commits into
Project-N-E-K-O:main
Choose a base branch
from
rophec:NekoBrawlArenaV2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5dc24ce
NekoBattleArenaV2
rophec 6c6094c
Merge branch 'Project-N-E-K-O:main' into NekoBrawlArenaV2
rophec b52144e
Merge remote-tracking branch 'upstream/main' into NekoBrawlArenaV2
rophec 9c2b35d
feat: update neko brawl arena prototype
rophec 43259f8
Merge branch 'main' into NekoBrawlArenaV2
rophec e9d359c
fix: make deck builder card collection scrollable
rophec 718f0b8
fix: limit forged cards to single deck copy
rophec bd1331b
fix: refine forged card story prompt perspective
rophec b308b56
feat: expand neko brawl arena prototype
rophec ee64a77
Merge branch 'Project-N-E-K-O:main' into NekoBrawlArenaV2
rophec 62615da
Merge branch 'NekoBrawlArenaV2' of https://github.com/rophec/N.E.K.O …
rophec c84df69
docs: add neko brawl exploration rules
rophec f1d92b3
Merge remote-tracking branch 'upstream/main' into draft
rophec d0599ff
feat(neko-brawl): 探险五类落点交互实装 + 移除战斗触发卡
LyaQanYi 47130b5
docs(neko-brawl): 同步探险交互实现状态 + 新增改动总览
LyaQanYi 32292ae
fix(neko-brawl): 处理 PR review 的 6 条意见
LyaQanYi 3086b8e
Merge branch 'main' into NekoBrawlArenaV2
LyaQanYi 02a84ab
Merge remote-tracking branch 'upstream/main' into NekoBrawlArenaV2
rophec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,6 +89,7 @@ Cargo.lock | |
|
|
||
| # Node/Front-end temp (if any) | ||
| node_modules/ | ||
| .vite/ | ||
| *.cache/ | ||
| *.tsbuildinfo | ||
| dist/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!doctype html> | ||
| <html lang="zh-CN"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>猫娘大乱斗 · Nekoverse</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.jsx"></script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
头像同步端点缺少输入边界,容易被超大 dataUrl 或任意 side 撑爆内存喵。
Line [1601-1606] 直接把外部
side/dataUrl/name入内存,没有 side 白名单、格式校验和长度上限喵。建议最少限制 side(left/right)并限制 dataUrl 前缀与长度(超限返回 4xx)喵。💡 建议修复(示例)
_battle_arena_avatars: dict = {} # side -> {dataUrl, name} +_BATTLE_AVATAR_SIDES = {"left", "right"} +_BATTLE_AVATAR_MAX_DATA_URL_LEN = 2_000_000 `@app.post`('/battle-arena/avatar') async def set_battle_avatar(payload: dict): @@ - side = str(payload.get('side', 'left')) + side = str(payload.get('side', 'left')).strip() data_url = str(payload.get('dataUrl', '')) name = str(payload.get('name', '')) - if data_url: + if side not in _BATTLE_AVATAR_SIDES: + return JSONResponse(status_code=400, content={"ok": False, "error": "invalid side"}) + if data_url and (not data_url.startswith("data:image/") or len(data_url) > _BATTLE_AVATAR_MAX_DATA_URL_LEN): + return JSONResponse(status_code=413, content={"ok": False, "error": "avatar too large or invalid"}) + if data_url: _battle_arena_avatars[side] = {'dataUrl': data_url, 'name': name} return {"ok": True}🤖 Prompt for AI Agents