20 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 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 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 2e72bd4da5 Optimize live play handler
- Extract shared live setting, notes, and rank helpers
- Move constant leader skill and museum buff queries out of the per-unit loop
- Batch load deck unit data, accessories, and removable skill metadata
- Fix cool attribute removable skill effect type handling

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-06 15:12:05 +08:00
YumeMichi 45eef9566a Fix client friend status mapping
- Add explicit client friend status constants and resolver
- Return dynamic friend status from profileInfo and friend/search
- Accept invite_code when loading profileInfo targets
- Align live support friend status values with client expectations

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-05 22:55:00 +08:00
YumeMichi bac2335f14 Reintroduce friend support for live
- Return approved friends in live/partyList
- Use the selected support center unit during live play
- Fall back to self support when no friend is available
- Align friend_status with client display expectations

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-05 22:39:04 +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 c4f1686abb Implement present box
Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-05 06:53:48 +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 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