Commit Graph
23 Commits
Author SHA1 Message Date
YumeMichi ff67c554f7 Rollback live sessions on panic
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-07-13 08:03:12 +08:00
YumeMichi 96b7951ee1 Scope unit and accessory data to owning users
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-07-13 08:03:10 +08:00
YumeMichi 16ab2549d7 Validate main PHP sessions against user IDs
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-07-13 08:03:07 +08:00
YumeMichi 683645be8e Fix session cleanup on error paths
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-07-13 08:03:01 +08:00
YumeMichi cb8f587e30 Unify error handling and HTTP statuses
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-07-11 16:18:17 +08:00
YumeMichi 61b33ae0e3 Improve session abort error context
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-28 18:13:59 +08:00
YumeMichi 36ccf46df5 Fix accessory exp lookup from user data
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-28 18:13:57 +08:00
YumeMichi 1bb8f20c88 Fix legacy unit schema migration
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-28 01:20:05 +08:00
YumeMichi cb0200ff29 Migrate accessories to user data
- Add user_accessory as the per-user accessory inventory table.
- Migrate old accessory wear records to user-owned accessory ids, including legacy common_accessory_m lookups for old installs.
- Allocate default accessories for newly created users and update accessory reads to use user_accessory at runtime.
- Validate accessory ownership when wearing accessories and keep existing accessory-based responses working.

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-13 07:36:21 +08:00
YumeMichi 0aacf8a4e9 Improve live and random live handling
- Add random live handlers, schemas and persistence for lot/play/continue/gameover/reward flow
- Update live status and schedule generation, including special rotation handling and CN timezone alignment
- Add config support for unlocking all daily special rotation songs and document the option
- Refresh live play, reward, precise score and session logic plus bundled main.db updates

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-06 20:59:45 +08:00
YumeMichi f6466989c6 Persist live status and migrate legacy live data
- Add user_live_status to store hi score, hi combo count, and clear count per chart
- Expand user_live_goal to persist achieved live_goal_reward_id entries instead of only coarse goal types
- Update live reward handling to refresh live status and sync newly achieved live goals on every clear
- Return live status and achieved goal ids from stored user data in /api/live/status
- Aggregate profile liveCnt from stored user_live_status instead of hardcoded values
- Load complete-rank thresholds from live info for goal evaluation
- Migrate legacy user_live_record data into user_live_status and backfill achievable live goals on startup

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-06 16:25:06 +08:00
YumeMichi f8a0f2db13 Refine live schedule data
- Add special_live_rotation_m data to main.db for rotated special live scheduling
- Split normal and special live queries to avoid selecting special-only columns from normal_live_m
- Build live schedule/status around rotated special lives and derived training lives
- Reuse user training energy values in login top info and live party list responses
- Set training energy and max training energy defaults to 999

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-06 15:57:06 +08:00
YumeMichi acd9be627e Minor cleanup and fixes
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-05 06:53:48 +08:00
YumeMichi a7ec1f1b7b Add LP recovery items to user info
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-05 05:48:43 +08:00
YumeMichi fa2efe4298 webui: Make some user preferences configurable
This extends 09f0237560.

- Extend user_pref with configurable profile fields and automatic migration defaults
- Move user info responses to read from user_pref instead of hardcoded values
- Add admin profile page for editing UI values after login

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-04 19:31:27 +08:00
YumeMichi e61c07a9a3 Reduce handler request boilerplate
- Add session.Attach to reuse per-request sessions across middleware and ghome handlers
- Make Session finalize/abort paths idempotent to avoid duplicate commit or rollback work
- Move request_data parsing helper to internal/utils
- Expand ParseRequestData usage across api, download, unit, live, multiunit, and subscenario handlers
- Extract download package metadata into internal/handler/download/types.go
- Return explicit errors from selected session lookup helpers and update callers
- Make api action handlers return errors directly instead of calling ss.CheckErr in nested layers

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-04 03:05:32 +08:00
YumeMichi 9b367594ba Drop redundant internal utils
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-03 23:22:33 +08:00
YumeMichi e3f62faa75 Fix live replay
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-01 21:48:41 +08:00
YumeMichi 4664847f10 Minor cleanup and fixes
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-01 21:48:41 +08:00
YumeMichi ae847f5e29 Validate rand key length before 3des operations
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-04-28 11:44:56 +08:00
YumeMichi 150ce674ad Implement more endpoints & overhaul [2/n]
Drop LevelDB and move all the things to SQLite.

Implemented endpoints:
/api <unit, accessoryMaterialAll>
/api <unit, accessoryTab>
/live/continue
/live/partyList
/unit/favoriteAccessory (WIP)
/unit/sale

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-04-28 11:44:56 +08:00
YumeMichi c77241a883 Overhaul [1/n]
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-01-29 02:42:28 +08:00
YumeMichi 80a686849f Implement session module
Signed-off-by: Sean Du <do4suki@gmail.com>
2025-08-15 19:24:36 +08:00