Update GaCy-GO
This commit is contained in:
1 parent
da8a32f60d
commit
0cbe460e49
345 files changed
+98202
-77559
No files matched your search
@@ -3,7 +3,6 @@ package gameserver
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
@@ -73,7 +72,7 @@ func excludedSubMissionsForConfiguredClient() (map[uint32]struct{}, error) {
|
||||
|
||||
func getMissionUnlocks() *MissionUnlocks {
|
||||
missionUnlocksOnce.Do(func() {
|
||||
raw, err := os.ReadFile("mission_unlocks.json")
|
||||
raw, err := common.ReadResourceFile("mission_unlocks.json")
|
||||
if err != nil {
|
||||
Log("mission_unlocks.json not found: " + err.Error())
|
||||
return
|
||||
@@ -83,6 +82,27 @@ func getMissionUnlocks() *MissionUnlocks {
|
||||
missionUnlocks = MissionUnlocks{}
|
||||
return
|
||||
}
|
||||
// Native CW's current panel has a different introductory guide mission
|
||||
// than the older function-unlock export. Publish only its validated
|
||||
// resource-declared prerequisites so the native condition checker can
|
||||
// leave PreGuide; do not force UI state or finish the full mission table.
|
||||
if guideMissions, err := common.LoadCurrencyWarsGuideMissions(); err != nil {
|
||||
Log("CW guide unlock withheld: " + err.Error())
|
||||
} else {
|
||||
seen := make(map[uint32]bool, len(missionUnlocks.FuncUnlockMissions))
|
||||
for _, id := range missionUnlocks.FuncUnlockMissions {
|
||||
seen[id] = true
|
||||
}
|
||||
added := 0
|
||||
for _, id := range guideMissions {
|
||||
if !seen[id] {
|
||||
seen[id] = true
|
||||
missionUnlocks.FuncUnlockMissions = append(missionUnlocks.FuncUnlockMissions, id)
|
||||
added++
|
||||
}
|
||||
}
|
||||
Log(fmt.Sprintf("CW guide mission prerequisites loaded=%d added=%d", len(guideMissions), added))
|
||||
}
|
||||
Log("Loaded mission_unlocks.json successfully")
|
||||
})
|
||||
return &missionUnlocks
|
||||
@@ -123,7 +143,20 @@ func init() {
|
||||
// beta client re-asks when this field is missing (tag 13)
|
||||
rsp.CurversionFinishedMainMissionIdList = finished
|
||||
|
||||
excludedSubMissions, err := excludedSubMissionsForConfiguredClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, id := range req.SubMissionIdList {
|
||||
// Status refreshes use the same config-backed mission model as
|
||||
// initial login. Do not reintroduce a removed JSON config through
|
||||
// a later status request after filtering GetMissionData.
|
||||
if id == 0 {
|
||||
continue
|
||||
}
|
||||
if _, excluded := excludedSubMissions[id]; excluded {
|
||||
continue
|
||||
}
|
||||
rsp.SubMissionStatusList = append(rsp.SubMissionStatusList, &goproto.Mission{
|
||||
Id: id,
|
||||
Progress: 1,
|
||||
@@ -167,6 +200,10 @@ func init() {
|
||||
}
|
||||
seenSubMissions := make(map[uint32]struct{}, len(unlocks.SubMissionIDs))
|
||||
excludedCount := 0
|
||||
// GetMissionDataCsReq carries no ID list in this protocol revision, so
|
||||
// the Client processes whatever we push; IDs absent from its installed
|
||||
// MissionJsonTable NRE in MainMissionData.AddSubMission. The exclusion
|
||||
// list plus the staged scripts/mission_probe.lua enumeration bound it.
|
||||
for _, id := range unlocks.SubMissionIDs {
|
||||
if id == 0 {
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user