mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Add authentication server, dev CLI, Docker multi-service setup, and cross-platform improvements
This commit is contained in:
@@ -6,24 +6,6 @@ import (
|
||||
"lunar-tear/server/internal/utils"
|
||||
)
|
||||
|
||||
type CharacterRebirthRow struct {
|
||||
CharacterId int32 `json:"CharacterId"`
|
||||
CharacterRebirthStepGroupId int32 `json:"CharacterRebirthStepGroupId"`
|
||||
}
|
||||
|
||||
type CharacterRebirthStepRow struct {
|
||||
CharacterRebirthStepGroupId int32 `json:"CharacterRebirthStepGroupId"`
|
||||
BeforeRebirthCount int32 `json:"BeforeRebirthCount"`
|
||||
CostumeLevelLimitUp int32 `json:"CostumeLevelLimitUp"`
|
||||
CharacterRebirthMaterialGroupId int32 `json:"CharacterRebirthMaterialGroupId"`
|
||||
}
|
||||
|
||||
type CharacterRebirthMaterialRow struct {
|
||||
CharacterRebirthMaterialGroupId int32 `json:"CharacterRebirthMaterialGroupId"`
|
||||
MaterialId int32 `json:"MaterialId"`
|
||||
Count int32 `json:"Count"`
|
||||
}
|
||||
|
||||
type StepKey struct {
|
||||
GroupId int32
|
||||
BeforeRebirthCount int32
|
||||
@@ -31,22 +13,22 @@ type StepKey struct {
|
||||
|
||||
type CharacterRebirthCatalog struct {
|
||||
StepGroupByCharacterId map[int32]int32
|
||||
StepByGroupAndCount map[StepKey]CharacterRebirthStepRow
|
||||
MaterialsByGroupId map[int32][]CharacterRebirthMaterialRow
|
||||
StepByGroupAndCount map[StepKey]EntityMCharacterRebirthStepGroup
|
||||
MaterialsByGroupId map[int32][]EntityMCharacterRebirthMaterialGroup
|
||||
}
|
||||
|
||||
func LoadCharacterRebirthCatalog() (*CharacterRebirthCatalog, error) {
|
||||
rebirthRows, err := utils.ReadJSON[CharacterRebirthRow]("EntityMCharacterRebirthTable.json")
|
||||
rebirthRows, err := utils.ReadTable[EntityMCharacterRebirth]("m_character_rebirth")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("load character rebirth table: %w", err)
|
||||
}
|
||||
|
||||
stepRows, err := utils.ReadJSON[CharacterRebirthStepRow]("EntityMCharacterRebirthStepGroupTable.json")
|
||||
stepRows, err := utils.ReadTable[EntityMCharacterRebirthStepGroup]("m_character_rebirth_step_group")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("load character rebirth step group table: %w", err)
|
||||
}
|
||||
|
||||
materialRows, err := utils.ReadJSON[CharacterRebirthMaterialRow]("EntityMCharacterRebirthMaterialGroupTable.json")
|
||||
materialRows, err := utils.ReadTable[EntityMCharacterRebirthMaterialGroup]("m_character_rebirth_material_group")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("load character rebirth material group table: %w", err)
|
||||
}
|
||||
@@ -56,12 +38,12 @@ func LoadCharacterRebirthCatalog() (*CharacterRebirthCatalog, error) {
|
||||
stepGroupByCharacterId[r.CharacterId] = r.CharacterRebirthStepGroupId
|
||||
}
|
||||
|
||||
stepByGroupAndCount := make(map[StepKey]CharacterRebirthStepRow, len(stepRows))
|
||||
stepByGroupAndCount := make(map[StepKey]EntityMCharacterRebirthStepGroup, len(stepRows))
|
||||
for _, s := range stepRows {
|
||||
stepByGroupAndCount[StepKey{GroupId: s.CharacterRebirthStepGroupId, BeforeRebirthCount: s.BeforeRebirthCount}] = s
|
||||
}
|
||||
|
||||
materialsByGroupId := make(map[int32][]CharacterRebirthMaterialRow)
|
||||
materialsByGroupId := make(map[int32][]EntityMCharacterRebirthMaterialGroup)
|
||||
for _, m := range materialRows {
|
||||
materialsByGroupId[m.CharacterRebirthMaterialGroupId] = append(materialsByGroupId[m.CharacterRebirthMaterialGroupId], m)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user