mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Add SQLite persistence, import-snapshot tool, and karma functionality
This commit is contained in:
@@ -37,11 +37,10 @@ func (s *TutorialServiceServer) SetTutorialProgress(ctx context.Context, req *pb
|
||||
ChoiceId: req.ChoiceId,
|
||||
}
|
||||
}
|
||||
if req.TutorialType == int32(model.TutorialTypeMenuFirst) ||
|
||||
req.TutorialType == int32(model.TutorialTypeMenuSecond) {
|
||||
grants = s.engine.ApplyTutorialReward(user, model.TutorialType(req.TutorialType), req.ChoiceId, nowMillis)
|
||||
if req.TutorialType == int32(model.TutorialTypeMenuFirst) && req.ProgressPhase == 20 {
|
||||
store.EnsureDefaultDeck(user, nowMillis)
|
||||
}
|
||||
grants = s.engine.ApplyTutorialReward(user, model.TutorialType(req.TutorialType), req.ChoiceId, nowMillis)
|
||||
})
|
||||
tables := []string{"IUserTutorialProgress"}
|
||||
if req.TutorialType == int32(model.TutorialTypeMenuFirst) ||
|
||||
@@ -55,7 +54,7 @@ func (s *TutorialServiceServer) SetTutorialProgress(ctx context.Context, req *pb
|
||||
if len(grants) > 0 {
|
||||
tables = append(tables, "IUserCompanion")
|
||||
}
|
||||
result := userdata.SelectTables(userdata.FullClientTableMap(user), tables)
|
||||
result := userdata.ProjectTables(user, tables)
|
||||
for _, t := range tables {
|
||||
log.Printf("[TutorialService] DiffTable %s -> %s", t, result[t])
|
||||
}
|
||||
@@ -89,7 +88,7 @@ func (s *TutorialServiceServer) SetTutorialProgressAndReplaceDeck(ctx context.Co
|
||||
}
|
||||
})
|
||||
return &pb.SetTutorialProgressAndReplaceDeckResponse{
|
||||
DiffUserData: userdata.BuildDiffFromTables(userdata.SelectTables(userdata.FullClientTableMap(user), []string{
|
||||
DiffUserData: userdata.BuildDiffFromTables(userdata.ProjectTables(user, []string{
|
||||
"IUserTutorialProgress",
|
||||
"IUserDeck",
|
||||
"IUserDeckCharacter",
|
||||
|
||||
Reference in New Issue
Block a user