Save endgame progress, team presets, technique support and camera controls
This commit is contained in:
1 parent
a681affdb3
commit
639cef7d19
52 files changed
+11940
-766
No files matched your search
@@ -16,6 +16,13 @@ import (
|
||||
// Scene loading (Go port of handlers/scene.rs)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Protocol scene modes from PearlSR 005d2c12, manager/scene_mgr.zig and
|
||||
// services/challenge.zig. MazePlane.PlaneType uses a different enumeration.
|
||||
const (
|
||||
sceneModeAdventure uint32 = 1
|
||||
sceneModeChallenge uint32 = 4
|
||||
)
|
||||
|
||||
// firstSceneOfEntry returns the (configName, config) pair for an entry.
|
||||
// Rust iterated a HashMap arbitrarily; we pick the lexicographically first
|
||||
// name for determinism.
|
||||
@@ -291,7 +298,7 @@ func init() {
|
||||
}
|
||||
if err := s.Send(&goproto.EnterSceneByServerScNotify{
|
||||
Scene: sceneInfo,
|
||||
Lineup: common.ToLineupInfo(player.Lineups),
|
||||
Lineup: s.techniqueLineup(),
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -889,15 +896,12 @@ func loadScene(s *Session, entryID uint32, isEnterScene, sendNotify bool, telepo
|
||||
FloorId: floorID,
|
||||
PlaneId: planeID,
|
||||
EntryId: entryID,
|
||||
GameModeType: scene.PlaneType,
|
||||
GameModeType: sceneModeAdventure,
|
||||
LeaderEntityId: 1,
|
||||
WorldId: scene.WorldID,
|
||||
SceneIdentifier: sceneIdent,
|
||||
FloorSavedData: scene.SavedValues,
|
||||
}
|
||||
if sceneInfo.WorldId == 100 {
|
||||
sceneInfo.WorldId = 501
|
||||
}
|
||||
sceneInfo.LightenSectionList = scene.Sections
|
||||
|
||||
missionInfo := &goproto.MissionStatusBySceneInfo{}
|
||||
@@ -929,6 +933,8 @@ func loadScene(s *Session, entryID uint32, isEnterScene, sendNotify bool, telepo
|
||||
s.PropEntities = map[uint32]PropEntry{}
|
||||
s.MonsterEntities = map[uint32]uint32{}
|
||||
s.ChallengeStageID = 0
|
||||
s.ChallengeBattleConfig = nil
|
||||
s.ChallengeRun = nil
|
||||
|
||||
for _, groupID := range sortedU32Keys2(scene.Scenes) {
|
||||
group := scene.Scenes[groupID]
|
||||
@@ -1003,9 +1009,15 @@ func loadScene(s *Session, entryID uint32, isEnterScene, sendNotify bool, telepo
|
||||
}
|
||||
|
||||
// player entities (lineup slots 0..3 -> entity ids 1..4)
|
||||
s.partyActorSlots = map[uint32]bool{}
|
||||
s.leaderSlot = player.TeamPreset(player.ActiveTeamPreset).LeaderSlot
|
||||
playerGroup := &goproto.SceneEntityGroupInfo{State: 0, GroupId: 0}
|
||||
for _, slot := range player.SortedLineupKeys() {
|
||||
avatarID := player.Lineups[slot]
|
||||
if avatarID == 0 {
|
||||
continue
|
||||
}
|
||||
s.partyActorSlots[slot] = true
|
||||
playerGroup.EntityList = append(playerGroup.EntityList, &goproto.SceneEntityInfo{
|
||||
EntityId: slot + 1,
|
||||
Motion: playerPos,
|
||||
@@ -1019,7 +1031,17 @@ func loadScene(s *Session, entryID uint32, isEnterScene, sendNotify bool, telepo
|
||||
},
|
||||
})
|
||||
}
|
||||
if player.Lineups[s.leaderSlot] == 0 {
|
||||
for _, slot := range player.SortedLineupKeys() {
|
||||
if player.Lineups[slot] != 0 {
|
||||
s.leaderSlot = slot
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
sceneInfo.LeaderEntityId = s.leaderSlot + 1
|
||||
sceneInfo.EntityGroupList = append(sceneInfo.EntityGroupList, playerGroup)
|
||||
SceneDebugLog("[SCENE] entry=%d floor=%d plane=%d world=%d mode=%d savedValues=%d groups=%v", entryID, floorID, planeID, sceneInfo.WorldId, sceneInfo.GameModeType, len(sceneInfo.FloorSavedData), sortedU32Keys2(scene.Scenes))
|
||||
|
||||
if isEnterScene {
|
||||
// in-memory only: the scene is persisted by SceneEntityMove once the
|
||||
@@ -1034,7 +1056,7 @@ func loadScene(s *Session, entryID uint32, isEnterScene, sendNotify bool, telepo
|
||||
if sendNotify {
|
||||
if err := s.Send(&goproto.EnterSceneByServerScNotify{
|
||||
Scene: sceneInfo,
|
||||
Lineup: common.ToLineupInfo(player.Lineups),
|
||||
Lineup: s.techniqueLineup(),
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user