Implement Fate Boards
Build and Push Docker images to Docker Hub / build-and-push (push) Has been cancelled

This commit is contained in:
Ilya Groshev
2026-05-17 18:21:57 +03:00
parent 956dbfaefd
commit 2cf0c153e1
16 changed files with 549 additions and 7 deletions
@@ -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
})
}