* feat: raw terrain parsing for scene data
Replace old dNavigation/dTerrain raw parser with new Raw module in
dZoneManager. Parse heightmaps, color maps, and scene maps from .raw
files to determine which scene a position belongs to. Build scene
adjacency graph from terrain data and scene transitions.
Adds NiColor type, SceneColor lookup table, eSceneType enum, terrain
mesh generation with OBJ export, and debug slash commands for scene
visualization.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: deduplicate terrain grid lookup logic, remove unnecessary cast
Add IsValidForSceneLookup(), GetSceneIDAtGrid(), and GridToWorldPos()
to Raw::Chunk. Use them in GenerateTerrainMesh, GetSceneIDFromPosition,
SpawnScenePoints, and SpawnAllScenePoints instead of duplicated inline
math. Remove unnecessary static_cast in LoadSceneTransitionInfo.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: add version < 32 support to raw terrain parser
The parser was only correct for v32 files. For v<32:
- colorMapResolution is width-1, not width
- Color map reads width*width*4 bytes (BGRA per-pixel), not colorMapRes^2*4
- No DDS lightmap
- No texture settings byte or blend DDS
- Scene map: v31 reads (colorMapRes+1)^2 cells with border skip,
v<31 skips 1 byte
- No mesh data
Verified against all 309 .raw files across multiple client versions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: log and reject legacy raw terrain format, clean up ReadRaw API
Log a clear message and throw if the zone uses a legacy raw format
(LUZ version < 30) since no known maps use it. Remove ReadLegacyRaw
and the mapVersion parameter from ReadRaw.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: revert v33 scene field renames to unknown1/unknown2
These fields are skipped by the client in every known build (ptr += 12
and ptr += 4). No client ever reads them into a struct. Keep the
original unknown1/unknown2 names from main.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: load the zone without scene lookups when its raw terrain is missing or unreadable
Log at debug when it parses; build the terrain mesh only for the OBJ export; read the zone name and description only for version 31 and later, as the client does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: look up the scene at a position as the client does, in constant time
Chunk bounds span (width - 1) * scale; the nearest scene map cell is used and the far edge is kept one cell inside. Chunks are indexed by grid cell when they form a grid. Skipping reads instead of seeking, so a cut-off file can't seek past the end. Terrain mesh indices follow the vertex order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat: scene point commands take a step and use brick LOTs from the BrickIDTable
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: rename NiColor::ToXYZ to Luminance
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: raw terrain reading, scene lookup, scene graph and scene commands
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: close the OBJ file before removing it so the test passes on Windows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: keep the zone boundary lines and read the luz scene count as the client does
Each boundary line's destination is read as a map ID and an instance ID into a LWOZONEID. The scene count is a byte before version 37 and a u32 from it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: name the fourth flair colour byte padding
The client never sets or reads it, so it holds leftover memory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: keep the scene map of version 31 and older raws
These files have a (resolution + 1)^2 scene map, kept in sceneMapLegacy. Version 31 uses its first resolution rows and columns; older versions are all scene 0, as in the client.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor: simplify the raw heightmap size check
The dimensions are capped at kMaxResolution, so the product can't overflow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: remove the scene point spawn commands and send /getadjacentscenes as one message
The spawn commands were only for testing. /getscene and /getadjacentscenes stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: security vulnerabilities
Tested that all functions related to the touched files work
will test sqlite on a CI build
* fix failing test
* ai feedback
* add buffer size checking
* use c_str
* dont log session key
* Try this for a mac definition
* be quiet apple
Tested that having the config option set to 1 and having an empty property auto-rejected it. Tested that having a model on the property or having the new config option set to 0 auto approved the property (as per live)
* replace linux calls
* windows api
* log child PIDs in parent process
* fix typo for windows
* functions now return the process ID
* use wchar_t for windows APIs
* Update Start.cpp
Try to fix MacOS issues
* Conditionally include unistd.h
* remove sudo config option and add error message for linux
* fix windows .exe extension
* REALLY fix windows
* try replacing c_str() with data()
* really REALLY fix Windows
* Update dNet/dServer.cpp
Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com>
* Update dServer.cpp
* simplify leaderboard code, fully abstract database
* update exception catching
* update exception catching and sql references, remove ugc from gamemessages
fix deleting model
remove unrelated changes
Update GameMessages.cpp
* remove ugc from gamemessages
* Update GameMessages.cpp
* Update Leaderboard.cpp
* bug fixes
* fix racing leaderboard
* remove extra stuff
* update
* add sqlite
* use a default for optimizations
* update sqlite
* Fix limits on update and delete
* fix bugs
* use definition to switch between databases
* add switch for different backends
* fix include guard and includes
* always build both
* add mysql if block
* Update Database.cpp
* add new options and add check to prevent overriding mysql
* correct config names
* Update README.md
* Update README.md
* merge to 1 sql file for sqlite database
* move to sqlite folder
* add back mysql migrations
* Update README.md
* add migration to correct the folder name or mysql
* yes aron
* updates
* Update CMakeLists.txt
* dont use paths at all, add where check to only update if folder name still exist
check also doesnt check for slashes and assumes one will be there since it will be.
* default dont auto create account
for releases we can change this flag
* default 0
* add times played query
* fix leaderboard not incrementing on a not better score
* add env vars with defaults for docker
* use an "enum"
* default to mariadb
* Update .env.example
adds an announcement sent to the system address which had the mismatched FDB to let the developer know they have a mis-matched one.
Tested that if a civilian tries to login without a gm level > developer, they are kicked.
Tested that if a GM is found to have a mismatched FDB, they are let in but have an announcement sent to them.
Use auth packets for msg
added comment as to why
ff
remove default
add comment
Remove broadcast
* greatly simplify docker
* back to gcc since I can't the libs to load properly
* fix typo
add set -e to entrypoint
better copy of entrypoint.sh and use proper entrypoint
* use debian instead of gcc for runtime
comment and organize it a bit
drop gcc to 12 since we are using debian 12 as well
* explicitly include mariadb libs
* Make the server not crash in the case we are using only env-vars
make the dockerfile have configs in the expected location incase of bypassing entrypoint.sh
* remove unneede var from example, since it's in the container now
* coments to dockerfile
* Revert master server changes
* Resolve conflicting port options between chat, master, and world
move chat_server_port to shared since it's used by world and chat
* Don't error if file does not exists when updating a config option
move update before and use bin dir var
* feat: reward codes
this is for giving rewards across characters as the did in live.
Tested that the default config works
Tested that all claim codes work
Tested that saving and loading claim codes work
Tested that mail sends correctly
* newlines
* include array
* delete cascade
* newline
* address feedback
* feat: add configurable feature and versions
to allow for easily swithing it out to enable features in the client for funsies
tested that this doesn't break anything and added test
* cleanup
* fix: properly check friend list limits
added a config for friend list limit for the brave that want to mod the client to sanely go over 50
moved the best friend limit config to chatconfig.ini where it should be
cleanup loading these configs options a bit
Tested that the BFF limit works and that the new friend limit works as well
* fix typo
* fix member variable naming
* re-add x and z checking for height
Now that we have better navmeshes, this will result in much better results and as such we can re-enable this check.
* Always run navmesh extraction
waste of time most of the time, but no other way to force update to the meshes easily.
* Navmeshes Version 2
- Add all missing zones
- Drastically improve several zones and their navmeshes, cleaning them up, making them more accurate and generally using more features of detour/recast.
* Update CMakeLists.txt
* update meshes
* Navmesh: Add pet cove navmesh
* Navmesh: Fix navmesh for fv
* Remove NET_VERSION define
I get to test this on 4 different platforms. yay...
* move stuff around
finally fixed you docker
i love this
Update Dockerfile
Update Dockerfile
change type
Update AuthPackets.cpp
Update AuthServer.cpp
* Update CMakeVariables.txt
* Update sharedconfig.ini
* First iteration of pack reader and interface
* Fix memory leak and remove logs
* Complete packed asset interface and begin on file loading replacement
* Implement proper BinaryIO error
* Improve AssetMemoryBuffer for reading and implement more reading
* Repair more file loading code and improve how navmeshes are loaded
* Missing checks implementation
* Revert addition of Manifest class and migration changes
* Resolved all feedback.
* Add friends list migration
* Change friends to use charID
Update friends table to use charID and not LWOOBJID variant.
* Fix remove friend
Fix remove friend and make the query more readable at a glance.
* Add and remove friends in the container
Properly add and remove friends in the player container
* add enums
* Add best friends and basic GM support V1
* Add more features
* not online / doesnt exist implementation
Implements the not online and invalid character response codes
* Address players not being removed
Fix an issue where players would not be marked as offline in the friends list due to the message not being sent in all circumstances.
Tested changes on 3 clients, switching characters, logging out from character select, switching characters, world transfer and my friends list looked as it was supposed to.
* Implement proper friends system
Remove debug logs
Track count of best friends
Add best friends list cap of 5
Add config option and best friend update
Add a config option and implement the last missing best friend serialization
Added comments and fixed remove best friend bug
Added some comments and addressed an issue where removing best friends would not remove them from your internal count of friends.
properties and logs fixes
whoops, had an issue
send reply if already BFFs
Send the correct objectID
I really need to rename these
Fix white space
goon
* Replace queries with unique ptrs
* remove user from player container on deletion
Remove the user from the player container when they delete their character.