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:
@@ -1,12 +1,39 @@
|
||||
package liveschema
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type FlexibleLiveDifficultyID int
|
||||
|
||||
func (id *FlexibleLiveDifficultyID) UnmarshalJSON(data []byte) error {
|
||||
var intValue int
|
||||
if err := json.Unmarshal(data, &intValue); err == nil {
|
||||
*id = FlexibleLiveDifficultyID(intValue)
|
||||
return nil
|
||||
}
|
||||
|
||||
var stringValue string
|
||||
if err := json.Unmarshal(data, &stringValue); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
parsed, err := strconv.Atoi(stringValue)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*id = FlexibleLiveDifficultyID(parsed)
|
||||
return nil
|
||||
}
|
||||
|
||||
type PlayScoreReq struct {
|
||||
Module string `json:"module"`
|
||||
Action string `json:"action"`
|
||||
TimeStamp int64 `json:"timeStamp"`
|
||||
Mgd int `json:"mgd"`
|
||||
LiveDifficultyID string `json:"live_difficulty_id"`
|
||||
CommandNum string `json:"commandNum"`
|
||||
Module string `json:"module"`
|
||||
Action string `json:"action"`
|
||||
TimeStamp int64 `json:"timeStamp"`
|
||||
Mgd int `json:"mgd"`
|
||||
LiveDifficultyID FlexibleLiveDifficultyID `json:"live_difficulty_id"`
|
||||
CommandNum string `json:"commandNum"`
|
||||
}
|
||||
|
||||
type On struct {
|
||||
|
||||
Reference in New Issue
Block a user