mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat: web dashboard and playground work
The NexusDashboard-parity dashboard (dDashboardServer) and everything built on it on the experimental branch: accounts, characters, properties and moderation tools, permissions shared with in-game slash commands, economy reports, World 3D and property 3D views with client scenery, scheduled events (features, vanity changes, live events, announcements, restarts), vanity files and events, the CDClient browser, the message inspector with saved captures, chat filter tools, community challenges, live ops, the AI moderator helper, and the server-side changes they need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
67
dCommon/LevelFile.h
Normal file
67
dCommon/LevelFile.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <iosfwd>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "dCommonVars.h"
|
||||
#include "NiPoint3.h"
|
||||
#include "NiQuaternion.h"
|
||||
#include "LDFFormat.h"
|
||||
|
||||
struct SceneObject {
|
||||
LWOOBJID id;
|
||||
LOT lot;
|
||||
uint32_t nodeType;
|
||||
uint32_t glomId;
|
||||
NiPoint3 position;
|
||||
NiQuaternion rotation = QuatUtils::IDENTITY;
|
||||
float scale = 1.0f;
|
||||
uint32_t value3;
|
||||
LwoNameValue settings;
|
||||
};
|
||||
|
||||
/**
|
||||
* A scene file (.lvl) as the world server loads it (Level): its chunk headers and every object in it, with the object's
|
||||
* settings parsed. Only reads; which objects the world spawns (feature gating, client-only objects, spawners) stays in
|
||||
* dZoneManager, so the dashboard reads scenes with the same code.
|
||||
*/
|
||||
struct LevelFile {
|
||||
enum ChunkTypeID : uint16_t {
|
||||
FileInfo = 1000,
|
||||
SceneEnviroment = 2000,
|
||||
SceneObjectData,
|
||||
SceneParticleData
|
||||
};
|
||||
|
||||
struct FileInfoChunk {
|
||||
uint32_t version{};
|
||||
uint32_t revision{};
|
||||
uint32_t enviromentChunkStart{};
|
||||
uint32_t objectChunkStart{};
|
||||
uint32_t particleChunkStart{};
|
||||
};
|
||||
|
||||
struct ChunkHeader {
|
||||
uint32_t id{};
|
||||
uint16_t chunkVersion{};
|
||||
ChunkTypeID chunkType{};
|
||||
uint32_t size{};
|
||||
uint32_t startPosition{};
|
||||
FileInfoChunk fileInfo;
|
||||
};
|
||||
|
||||
std::map<uint32_t, ChunkHeader> chunkHeaders;
|
||||
std::vector<SceneObject> objects;
|
||||
|
||||
/**
|
||||
* Reads the whole file. Throws std::runtime_error (BinaryIO) if it ends early; what was read before that stays
|
||||
* (an object is only added once all of it was read).
|
||||
*/
|
||||
void Read(std::istream& file);
|
||||
|
||||
private:
|
||||
void ReadFileInfoChunk(std::istream& file, ChunkHeader& header);
|
||||
void ReadSceneObjectDataChunk(std::istream& file, uint32_t version);
|
||||
};
|
||||
Reference in New Issue
Block a user