mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Implement Fate Boards
Build and Push Docker images to Docker Hub / build-and-push (push) Has been cancelled
Build and Push Docker images to Docker Hub / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -266,6 +266,9 @@ func ChangedTables(before, after *store.UserState) []string {
|
||||
if !mapsEqualStruct(before.TowerAccumulationRewards, after.TowerAccumulationRewards) {
|
||||
add("IUserEventQuestTowerAccumulationReward")
|
||||
}
|
||||
if !mapsEqualStruct(before.LabyrinthStages, after.LabyrinthStages) {
|
||||
add("IUserEventQuestLabyrinthStage")
|
||||
}
|
||||
|
||||
if !mapsEqualStruct(before.BigHuntMaxScores, after.BigHuntMaxScores) {
|
||||
add("IUserBigHuntMaxScore")
|
||||
@@ -431,6 +434,8 @@ func keyFieldsForTable(table string) []string {
|
||||
return []string{"userId", "cageOrnamentId"}
|
||||
case "IUserEventQuestTowerAccumulationReward":
|
||||
return []string{"userId", "eventQuestChapterId"}
|
||||
case "IUserEventQuestLabyrinthStage":
|
||||
return []string{"userId", "eventQuestChapterId", "stageOrder"}
|
||||
case "IUserAutoSaleSettingDetail":
|
||||
return []string{"userId", "possessionAutoSaleItemType"}
|
||||
case "IUserCharacterRebirth":
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package userdata
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"lunar-tear/server/internal/masterdata"
|
||||
"lunar-tear/server/internal/store"
|
||||
"lunar-tear/server/internal/utils"
|
||||
)
|
||||
|
||||
var labyrinthCatalog = sync.OnceValue(masterdata.LoadLabyrinthCatalog)
|
||||
|
||||
func init() {
|
||||
register("IUserEventQuestLabyrinthSeason", func(user store.UserState) string {
|
||||
chapters := labyrinthCatalog().ChaptersByOrder
|
||||
records := make([]map[string]any, 0, len(chapters))
|
||||
for _, ch := range chapters {
|
||||
if st, ok := user.LabyrinthSeasons[ch.EventQuestChapterId]; ok {
|
||||
records = append(records, map[string]any{
|
||||
"userId": user.UserId,
|
||||
"eventQuestChapterId": st.EventQuestChapterId,
|
||||
"lastJoinSeasonNumber": st.LastJoinSeasonNumber,
|
||||
"lastSeasonRewardReceivedSeasonNumber": st.LastSeasonRewardReceivedSeasonNumber,
|
||||
"latestVersion": st.LatestVersion,
|
||||
})
|
||||
continue
|
||||
}
|
||||
records = append(records, map[string]any{
|
||||
"userId": user.UserId,
|
||||
"eventQuestChapterId": ch.EventQuestChapterId,
|
||||
"lastJoinSeasonNumber": ch.LatestSeasonNumber,
|
||||
"lastSeasonRewardReceivedSeasonNumber": 0,
|
||||
"latestVersion": user.GameStartDatetime,
|
||||
})
|
||||
}
|
||||
s, _ := utils.EncodeJSONMaps(records...)
|
||||
return s
|
||||
})
|
||||
|
||||
register("IUserEventQuestLabyrinthStage", func(user store.UserState) string {
|
||||
records := make([]map[string]any, 0)
|
||||
for _, ch := range labyrinthCatalog().ChaptersByOrder {
|
||||
for _, stageOrder := range ch.StageOrders {
|
||||
key := store.LabyrinthStageKey{
|
||||
EventQuestChapterId: ch.EventQuestChapterId,
|
||||
StageOrder: stageOrder,
|
||||
}
|
||||
if st, ok := user.LabyrinthStages[key]; ok {
|
||||
records = append(records, map[string]any{
|
||||
"userId": user.UserId,
|
||||
"eventQuestChapterId": st.EventQuestChapterId,
|
||||
"stageOrder": st.StageOrder,
|
||||
"isReceivedStageClearReward": st.IsReceivedStageClearReward,
|
||||
"accumulationRewardReceivedQuestMissionCount": st.AccumulationRewardReceivedQuestMissionCount,
|
||||
"latestVersion": st.LatestVersion,
|
||||
})
|
||||
continue
|
||||
}
|
||||
records = append(records, map[string]any{
|
||||
"userId": user.UserId,
|
||||
"eventQuestChapterId": ch.EventQuestChapterId,
|
||||
"stageOrder": stageOrder,
|
||||
"isReceivedStageClearReward": false,
|
||||
"accumulationRewardReceivedQuestMissionCount": 0,
|
||||
"latestVersion": user.GameStartDatetime,
|
||||
})
|
||||
}
|
||||
}
|
||||
s, _ := utils.EncodeJSONMaps(records...)
|
||||
return s
|
||||
})
|
||||
}
|
||||
@@ -243,8 +243,6 @@ func init() {
|
||||
})
|
||||
registerStatic(
|
||||
"IUserEventQuestDailyGroupCompleteReward",
|
||||
"IUserEventQuestLabyrinthSeason",
|
||||
"IUserEventQuestLabyrinthStage",
|
||||
"IUserQuestReplayFlowRewardGroup",
|
||||
"IUserQuestAutoOrbit",
|
||||
"IUserQuestSceneChoice",
|
||||
|
||||
Reference in New Issue
Block a user