mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
fix(zone): read a zone's paths as the chunk the client reads
The client reads a zone file's paths as a chunk of its own (LuzFile::ReadLUZFile copies the u32-sized chunk, ReadLUZPaths reads it, 1.10.64) and drops every path when it refuses any of it: - a chunk version of 2 or more, or 10000 paths or more (ReadLUZPaths); - a path of version 19 or more, 10000 waypoints or more, or a waypoint with more than 99 name/value pairs (LevelPath::FromBuffer). The reader read the paths straight from the file, trusting the chunk to be well formed. It now reads the chunk by its size, reads the paths from it with the client's limits, and when one is refused the zone has no paths (logged), while the rest of the zone file still reads. Every zone file on disk reads the same paths as before. The unit tests' sample zones now give the path chunk its real length. Check in game: moving platforms, NPC patrols and spawners work as before on every world. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -260,7 +260,8 @@ private:
|
||||
void ReadZoneBoundaries(std::istream& file);
|
||||
void ReadSceneTransition(std::istream& file);
|
||||
SceneTransitionInfo ReadSceneTransitionInfo(std::istream& file);
|
||||
void ReadPath(std::istream& file);
|
||||
bool ReadPaths(std::istream& file);
|
||||
bool ReadPath(std::istream& file);
|
||||
// A waypoint's name/value pairs: waypoint commands on movement and rail paths, LDF config on the others
|
||||
static void ReadLdfConfig(std::istream& file, PathType pathType, PathWaypoint& waypoint);
|
||||
static bool ReadLdfConfig(std::istream& file, PathType pathType, PathWaypoint& waypoint);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user