Skip to content

Commit

Permalink
!fixup: sif: Make some user/ui preferences configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Si <[email protected]>
  • Loading branch information
YumeMichi committed Feb 1, 2024
1 parent 9603234 commit 66459e7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 38 deletions.
71 changes: 36 additions & 35 deletions handler/live.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"honoka-chan/config"
"honoka-chan/database"
"honoka-chan/encrypt"
"honoka-chan/model"
Expand Down Expand Up @@ -517,7 +518,7 @@ func PlayScore(ctx *gin.Context) {
},
RankInfo: ranks,
CanActivateEffect: true,
ServerTimestamp: int(time.Now().Unix()),
ServerTimestamp: time.Now().Unix(),
},
ReleaseInfo: []any{},
StatusCode: 200,
Expand Down Expand Up @@ -573,22 +574,22 @@ func PlayReward(ctx *gin.Context) {
IsHighScore: true,
HiScore: totalScore,
BaseRewardInfo: model.BaseRewardInfo{
PlayerExp: 830,
PlayerExp: 0,
PlayerExpUnitMax: model.PlayerExpUnitMax{
Before: 900,
After: 900,
Before: 0,
After: 0,
},
PlayerExpFriendMax: model.PlayerExpFriendMax{
Before: 99,
After: 99,
},
PlayerExpLpMax: model.PlayerExpLpMax{
Before: 417,
After: 417,
Before: config.Conf.UserPrefs.EnergyMax,
After: config.Conf.UserPrefs.EnergyMax,
},
GameCoin: 4500,
GameCoin: 0,
GameCoinRewardBoxFlag: false,
SocialPoint: 10,
SocialPoint: 0,
},
RewardUnitList: model.RewardUnitList{
LiveClear: []model.LiveClear{},
Expand All @@ -602,57 +603,57 @@ func PlayReward(ctx *gin.Context) {
LimitedEffortBox: []any{},
UnitList: unitsList,
BeforeUserInfo: model.BeforeUserInfo{
Level: 1028,
Exp: 28823566,
PreviousExp: 27734700,
NextExp: 28941885,
GameCoin: 86505544,
SnsCoin: 49,
FreeSnsCoin: 48,
PaidSnsCoin: 1,
Level: config.Conf.UserPrefs.Level,
Exp: config.Conf.UserPrefs.ExpNumerator,
PreviousExp: 0,
NextExp: config.Conf.UserPrefs.ExpDenominator,
GameCoin: config.Conf.UserPrefs.GameCoin,
SnsCoin: config.Conf.UserPrefs.SnsCoin,
FreeSnsCoin: config.Conf.UserPrefs.SnsCoin,
PaidSnsCoin: 0,
SocialPoint: 1438165,
UnitMax: 5000,
WaitingUnitMax: 1000,
CurrentEnergy: 392,
EnergyMax: 417,
CurrentEnergy: config.Conf.UserPrefs.EnergyMax,
EnergyMax: config.Conf.UserPrefs.EnergyMax,
TrainingEnergy: 9,
TrainingEnergyMax: 10,
EnergyFullTime: "2023-03-20 01:28:55",
LicenseLiveEnergyRecoverlyTime: 60,
FriendMax: 99,
TutorialState: -1,
OverMaxEnergy: 0,
OverMaxEnergy: config.Conf.UserPrefs.OverMaxEnergy,
UnlockRandomLiveMuse: 1,
UnlockRandomLiveAqours: 1,
},
AfterUserInfo: model.AfterUserInfo{
Level: 1028,
Exp: 28824396,
PreviousExp: 27734700,
NextExp: 28941885,
GameCoin: 86520044,
SnsCoin: 50,
FreeSnsCoin: 49,
PaidSnsCoin: 1,
Level: config.Conf.UserPrefs.Level,
Exp: config.Conf.UserPrefs.ExpNumerator,
PreviousExp: 0,
NextExp: config.Conf.UserPrefs.ExpDenominator,
GameCoin: config.Conf.UserPrefs.GameCoin,
SnsCoin: config.Conf.UserPrefs.SnsCoin,
FreeSnsCoin: config.Conf.UserPrefs.SnsCoin,
PaidSnsCoin: 0,
SocialPoint: 1438375,
UnitMax: 5000,
WaitingUnitMax: 1000,
CurrentEnergy: 392,
EnergyMax: 417,
CurrentEnergy: config.Conf.UserPrefs.EnergyMax,
EnergyMax: config.Conf.UserPrefs.EnergyMax,
TrainingEnergy: 9,
TrainingEnergyMax: 10,
EnergyFullTime: "2023-03-20 01:28:55",
LicenseLiveEnergyRecoverlyTime: 60,
FriendMax: 99,
TutorialState: -1,
OverMaxEnergy: 0,
OverMaxEnergy: config.Conf.UserPrefs.OverMaxEnergy,
UnlockRandomLiveMuse: 1,
UnlockRandomLiveAqours: 1,
},
NextLevelInfo: []model.NextLevelInfo{
{
Level: 1028,
FromExp: 28823566,
Level: config.Conf.UserPrefs.Level,
FromExp: config.Conf.UserPrefs.ExpNumerator,
},
},
GoalAccompInfo: model.GoalAccompInfo{
Expand All @@ -675,12 +676,12 @@ func PlayReward(ctx *gin.Context) {
IsVisible: true,
},
AccomplishedAchievementList: []model.AccomplishedAchievementList{},
UnaccomplishedAchievementCnt: 15,
UnaccomplishedAchievementCnt: 0,
AddedAchievementList: []any{},
MuseumInfo: model.Museum{},
UnitSupportList: []model.RewardUnitSupportList{},
ServerTimestamp: 1679238066,
PresentCnt: 2159,
ServerTimestamp: time.Now().Unix(),
PresentCnt: 0,
},
ReleaseInfo: []any{},
StatusCode: 200,
Expand Down
2 changes: 1 addition & 1 deletion handler/userinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func UserInfo(ctx *gin.Context) {
NextExp: config.Conf.UserPrefs.ExpDenominator,
GameCoin: config.Conf.UserPrefs.GameCoin,
SnsCoin: config.Conf.UserPrefs.SnsCoin,
FreeSnsCoin: 0,
FreeSnsCoin: config.Conf.UserPrefs.SnsCoin,
PaidSnsCoin: 0,
SocialPoint: 1438395,
UnitMax: 5000,
Expand Down
4 changes: 2 additions & 2 deletions model/live.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ type PlayScoreRes struct {
Off Off `json:"off"`
RankInfo []RankInfo `json:"rank_info"`
CanActivateEffect bool `json:"can_activate_effect"`
ServerTimestamp int `json:"server_timestamp"`
ServerTimestamp int64 `json:"server_timestamp"`
}

// PlayScoreResp ...
Expand Down Expand Up @@ -617,7 +617,7 @@ type RewardRes struct {
AddedAchievementList []any `json:"added_achievement_list"`
MuseumInfo Museum `json:"museum_info"`
UnitSupportList []RewardUnitSupportList `json:"unit_support_list"`
ServerTimestamp int `json:"server_timestamp"`
ServerTimestamp int64 `json:"server_timestamp"`
PresentCnt int `json:"present_cnt"`
}

Expand Down

0 comments on commit 66459e7

Please sign in to comment.