mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-26 06:32:49 +00:00
feat: scene ghosting, as the client streams a zone's scenes
The client keeps the scene under the player loaded, the scenes the zone file's transitions connect to it, and the global scene (Zone::StreamScenesAroundPosition 0x0108a3f0, TerrainManager::GetSceneAtPos 0x01069010, the connected scenes at 0x01066500; transitions naming a missing scene dropped as Zone::FixupInvalidTransitions 0x010842e0 does). - ZoneScenes (dCommon): the terrain's scene map lookup and the scene graph, shared by the world server and the dashboard. - Objects remember the scene they were placed in (spawners pass theirs on). - ghosting_scenes=1 (world config, off by default): players get the objects of their loaded scenes instead of the ones within the ghosting distances; objects from no scene go by the scene under them. Zones without a scene map keep distance ghosting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "dZMCommon.h"
|
||||
#include "LDFFormat.h"
|
||||
#include "ZoneFile.h"
|
||||
#include "ZoneScenes.h"
|
||||
#include "tinyxml2.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -48,6 +49,12 @@ public:
|
||||
const NiPoint3& GetSpawnPos() const { return m_Spawnpoint; }
|
||||
const NiQuaternion& GetSpawnRot() const { return m_SpawnpointRotation; }
|
||||
|
||||
// Which scenes the client keeps loaded where (ZoneScenes); the scene map is empty unless LoadSceneMap read it
|
||||
const ZoneScenes::SceneGraph& GetSceneGraph() const { return m_SceneGraph; }
|
||||
const ZoneScenes::SceneMap& GetSceneMap() const { return m_SceneMap; }
|
||||
// Reads the terrain file's scene map (for scene ghosting); false when the zone has none
|
||||
bool LoadSceneMap();
|
||||
|
||||
void SetSpawnPos(const NiPoint3& pos) { m_Spawnpoint = pos; }
|
||||
void SetSpawnRot(const NiQuaternion& rot) { m_SpawnpointRotation = rot; }
|
||||
|
||||
@@ -70,6 +77,8 @@ private:
|
||||
|
||||
std::map<LWOSCENEID, SceneRef> m_Scenes;
|
||||
std::vector<SceneTransition> m_SceneTransitions;
|
||||
ZoneScenes::SceneGraph m_SceneGraph;
|
||||
ZoneScenes::SceneMap m_SceneMap;
|
||||
|
||||
uint32_t m_PathDataLength;
|
||||
uint32_t m_PathChunkVersion;
|
||||
|
||||
Reference in New Issue
Block a user