Commit Graph

23 Commits

Author SHA1 Message Date
MingxuanGame
29857506f2 refactor(lio): use REALTIME for multiplayer room 2025-08-26 13:18:11 +08:00
MingxuanGame
6ae64fd50c refactor(lio): remove unused hmac validation 2025-08-26 13:18:11 +08:00
MingxuanGame
d08b39d482 refactor(lio): remove unused hmac validation 2025-08-26 13:18:11 +08:00
MingxuanGame
6c04b15764 feat(lio): support upload replay 2025-08-26 13:18:11 +08:00
pre-commit-ci[bot]
7625cd99f5 chore(deps): auto fix by pre-commit hooks 2025-08-26 13:18:11 +08:00
咕谷酱
d13e5ba5cd Improve async DB handling in chat channel allocation
Replaced db.exec with db.execute for better async compatibility and improved error handling in chat channel queries and allocation. Added immediate commit after channel creation and a fallback mechanism for channel_id allocation in case of database errors.
2025-08-26 13:18:11 +08:00
咕谷酱
ea1a6cd007 Refactor chat channel join/leave logic in room API
Removed redundant safe join/leave channel functions and streamlined chat channel management for room creation, user addition, and removal. Channel operations now use direct server calls with improved error handling and logging, reducing complexity and ensuring main room flows are not interrupted by chat channel errors.
2025-08-26 13:18:11 +08:00
咕谷酱
616656638d Improve JWT claims and chat channel reliability
Adds standard JWT claims (audience and issuer) to access tokens and updates config for these fields. Refactors multiplayer room chat channel logic to ensure reliable user join/leave with retry mechanisms, improves error handling and cleanup, and ensures host is correctly added as a participant. Updates Docker entrypoint for better compatibility and connection handling, modifies Docker Compose and Nginx config for improved deployment and proxy header forwarding.
2025-08-26 13:18:11 +08:00
咕谷酱
71acc7182d Update lio.py 2025-08-26 13:18:11 +08:00
咕谷酱
6fa9d5ba79 修复密码房问题 2025-08-26 13:18:11 +08:00
咕谷酱
35a7bc19da Refactor multiplayer room creation and user removal
Improved error handling in the multiplayer room creation endpoint by restoring try/except blocks for JSON decoding and general exceptions. Updated user removal logic to fetch the full Room object instead of selected columns, simplifying access to room attributes.
2025-08-26 13:18:11 +08:00
咕谷酱
f796c3c1d2 Integrate chat channels with multiplayer rooms
Added logic to create and manage chat channels for multiplayer rooms, ensuring room owners and participants are joined/removed from channels on room events. Improved chat message retrieval to consistently return messages in ascending order, supporting both forward and backward pagination.
2025-08-26 13:18:11 +08:00
咕谷酱
56d6911589 Add multiplayer room event model and channel ID allocation
Introduces the MultiplayerRealtimeRoomEvent SQLModel for tracking real-time room events. Adds an async helper to allocate unique channel IDs for rooms, and updates room creation logic to use this helper for assigning channel IDs automatically.
2025-08-26 13:18:11 +08:00
咕谷酱
97dcc86d4d Add endpoint to ensure beatmap presence and cache
Introduces a new /beatmaps/ensure API endpoint to verify and cache beatmap metadata and raw files. Updates Playlist model to use auto-incrementing primary key and improves playlist DB insertion logic. Minor formatting and import changes in room and lio modules.
2025-08-26 13:18:11 +08:00
咕谷酱
9043389f25 Pass timestamp as string to signature verification
Changed the call to verify_request_signature to pass the timestamp as a string instead of an integer. This ensures proper signature verification and prevents unauthorized requests.
2025-08-26 13:18:11 +08:00
咕谷酱
c99807dabb 修复房间逻辑 2025-08-26 13:18:11 +08:00
咕谷酱
573a9a52ea Update lio.py 2025-08-26 13:18:11 +08:00
咕谷酱
ea575de250 Add updated_at and created_at to Playlist model
Introduces created_at and updated_at fields to the Playlist model for tracking creation and modification times. Refactors room user removal logic to handle owner transfer and participant count updates more robustly. Updates room query logic for more accurate filtering by category and status. Adds migration stubs for updated_at column in room playlists.
2025-08-26 13:18:11 +08:00
咕谷酱
4c653552a1 Update lio.py 2025-08-26 13:18:11 +08:00
咕谷酱
bec6aa2639 Update lio.py 2025-08-26 13:18:11 +08:00
咕谷酱
403d395ccc Refactor room participant and password handling
Replaces ORM object updates with SQLAlchemy update statements for participant and room records, improving efficiency. Enhances room password verification logic and request body parsing in add_user_to_room, adds debug logging, and simplifies error handling. Removes unused user_data parameter and streamlines participant removal.
2025-08-26 13:18:11 +08:00
咕谷酱
8e6b462645 Refactor multiplayer room endpoints and add logging
Refactored the multiplayer room creation and user management endpoints in lio.py for improved modularity and validation. Added helper functions for user, room, and playlist validation, and enhanced error handling. In auth.py, added logging to output generated JWT tokens for better traceability.
2025-08-26 13:18:11 +08:00
咕谷酱
e0aae80f4b Add password support to multiplayer rooms
Introduces a password field to the Room model and database schema, enabling password-protected multiplayer rooms. Adds LIO router endpoints for room creation, user join/leave, and updates related imports and router registrations.
2025-08-26 13:18:11 +08:00