mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Initial commit
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lunar-tear/server/internal/store"
|
||||
|
||||
"google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
||||
var startedGameStartTables = []string{
|
||||
"IUserProfile",
|
||||
"IUserCharacter",
|
||||
"IUserCostume",
|
||||
"IUserWeapon",
|
||||
"IUserWeaponSkill",
|
||||
"IUserWeaponAbility",
|
||||
"IUserCompanion",
|
||||
"IUserDeckCharacter",
|
||||
"IUserDeck",
|
||||
"IUserGem",
|
||||
"IUserMission",
|
||||
"IUserMainQuestFlowStatus",
|
||||
"IUserMainQuestMainFlowStatus",
|
||||
"IUserMainQuestProgressStatus",
|
||||
"IUserMainQuestSeasonRoute",
|
||||
"IUserQuest",
|
||||
"IUserQuestMission",
|
||||
"IUserTutorialProgress",
|
||||
"IUserWeaponNote",
|
||||
"IUserWeaponStory",
|
||||
"IUserCostumeActiveSkill",
|
||||
"IUserDeckTypeNote",
|
||||
"IUserDeckSubWeaponGroup",
|
||||
"IUserDeckPartsGroup",
|
||||
"IUserConsumableItem",
|
||||
"IUserMaterial",
|
||||
"IUserImportantItem",
|
||||
}
|
||||
|
||||
var gimmickDiffTables = []string{
|
||||
"IUserGimmick",
|
||||
"IUserGimmickOrnamentProgress",
|
||||
"IUserGimmickSequence",
|
||||
"IUserGimmickUnlock",
|
||||
}
|
||||
|
||||
func currentUserId(ctx context.Context, users store.UserRepository, sessions store.SessionRepository) int64 {
|
||||
if md, ok := metadata.FromIncomingContext(ctx); ok {
|
||||
if vals := md.Get("x-session-key"); len(vals) > 0 {
|
||||
if userId, err := sessions.ResolveUserId(vals[0]); err == nil {
|
||||
return userId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultId, _ := users.DefaultUserId()
|
||||
return defaultId
|
||||
}
|
||||
Reference in New Issue
Block a user