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>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package rliveschema
|
||||
|
||||
type TokenReq struct {
|
||||
Module string `json:"module"`
|
||||
Action string `json:"action"`
|
||||
Mgd int `json:"mgd"`
|
||||
Token string `json:"token"`
|
||||
TimeStamp int64 `json:"timeStamp"`
|
||||
CommandNum string `json:"commandNum"`
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package rliveschema
|
||||
|
||||
import liveschema "honoka-chan/internal/schema/live"
|
||||
|
||||
type LotReq struct {
|
||||
Module string `json:"module"`
|
||||
Action string `json:"action"`
|
||||
MemberCategory int `json:"member_category"`
|
||||
Mgd int `json:"mgd"`
|
||||
Difficulty int `json:"difficulty"`
|
||||
Attribute int `json:"attribute"`
|
||||
TimeStamp int64 `json:"timeStamp"`
|
||||
CommandNum string `json:"commandNum"`
|
||||
}
|
||||
|
||||
type LiveInfo struct {
|
||||
LiveDifficultyID int `json:"live_difficulty_id"`
|
||||
IsRandom bool `json:"is_random"`
|
||||
AcFlag int `json:"ac_flag"`
|
||||
SwingFlag int `json:"swing_flag"`
|
||||
}
|
||||
|
||||
type LotData struct {
|
||||
LiveInfo LiveInfo `json:"live_info"`
|
||||
HasSlideNotes int `json:"has_slide_notes"`
|
||||
PartyList []liveschema.PartyList `json:"party_list"`
|
||||
TrainingEnergy int `json:"training_energy"`
|
||||
TrainingEnergyMax int `json:"training_energy_max"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type LotResp struct {
|
||||
ResponseData LotData `json:"response_data"`
|
||||
ReleaseInfo []any `json:"release_info"`
|
||||
StatusCode int `json:"status_code"`
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package rliveschema
|
||||
|
||||
import liveschema "honoka-chan/internal/schema/live"
|
||||
|
||||
type PlayReq struct {
|
||||
Module string `json:"module"`
|
||||
PartyUserID int64 `json:"party_user_id"`
|
||||
Action string `json:"action"`
|
||||
Mgd int `json:"mgd"`
|
||||
IsTraining bool `json:"is_training"`
|
||||
UnitDeckID int `json:"unit_deck_id"`
|
||||
Token string `json:"token"`
|
||||
TimeStamp int `json:"timeStamp"`
|
||||
LpFactor int `json:"lp_factor"`
|
||||
CommandNum string `json:"commandNum"`
|
||||
}
|
||||
|
||||
func (req PlayReq) ToLivePlayReq(liveDifficultyID int) liveschema.PlayReq {
|
||||
return liveschema.PlayReq{
|
||||
Module: req.Module,
|
||||
PartyUserID: req.PartyUserID,
|
||||
Action: req.Action,
|
||||
Mgd: req.Mgd,
|
||||
IsTraining: req.IsTraining,
|
||||
UnitDeckID: req.UnitDeckID,
|
||||
LiveDifficultyID: itoa(liveDifficultyID),
|
||||
TimeStamp: req.TimeStamp,
|
||||
LpFactor: req.LpFactor,
|
||||
CommandNum: req.CommandNum,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package rliveschema
|
||||
|
||||
import liveschema "honoka-chan/internal/schema/live"
|
||||
|
||||
type RewardReq struct {
|
||||
Module string `json:"module"`
|
||||
Action string `json:"action"`
|
||||
GoodCnt int `json:"good_cnt"`
|
||||
MissCnt int `json:"miss_cnt"`
|
||||
IsTraining bool `json:"is_training"`
|
||||
GreatCnt int `json:"great_cnt"`
|
||||
CommandNum string `json:"commandNum"`
|
||||
LoveCnt int `json:"love_cnt"`
|
||||
RemainHp int `json:"remain_hp"`
|
||||
MaxCombo int `json:"max_combo"`
|
||||
ScoreSmile int `json:"score_smile"`
|
||||
PerfectCnt int `json:"perfect_cnt"`
|
||||
BadCnt int `json:"bad_cnt"`
|
||||
Mgd int `json:"mgd"`
|
||||
EventPoint int `json:"event_point"`
|
||||
LiveDifficultyID int `json:"live_difficulty_id"`
|
||||
TimeStamp int `json:"timeStamp"`
|
||||
PreciseScoreLog liveschema.PreciseScoreLog `json:"precise_score_log"`
|
||||
ScoreCute int `json:"score_cute"`
|
||||
EventID any `json:"event_id"`
|
||||
ScoreCool int `json:"score_cool"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
func (req RewardReq) ToLiveRewardReq(liveDifficultyID int) liveschema.RewardReq {
|
||||
return liveschema.RewardReq{
|
||||
Module: req.Module,
|
||||
Action: req.Action,
|
||||
GoodCnt: req.GoodCnt,
|
||||
MissCnt: req.MissCnt,
|
||||
IsTraining: req.IsTraining,
|
||||
GreatCnt: req.GreatCnt,
|
||||
CommandNum: req.CommandNum,
|
||||
LoveCnt: req.LoveCnt,
|
||||
RemainHp: req.RemainHp,
|
||||
MaxCombo: req.MaxCombo,
|
||||
ScoreSmile: req.ScoreSmile,
|
||||
PerfectCnt: req.PerfectCnt,
|
||||
BadCnt: req.BadCnt,
|
||||
Mgd: req.Mgd,
|
||||
EventPoint: req.EventPoint,
|
||||
LiveDifficultyID: liveDifficultyID,
|
||||
TimeStamp: req.TimeStamp,
|
||||
PreciseScoreLog: req.PreciseScoreLog,
|
||||
ScoreCute: req.ScoreCute,
|
||||
EventID: req.EventID,
|
||||
ScoreCool: req.ScoreCool,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package rliveschema
|
||||
|
||||
import "strconv"
|
||||
|
||||
func itoa(v int) string {
|
||||
return strconv.Itoa(v)
|
||||
}
|
||||
Reference in New Issue
Block a user