Commit Graph
340 Commits
Author SHA1 Message Date
aksdb 99749a5168 ✅ Add FPCUnit test suites for shared code and server
Introduces two headless FPCUnit runners under tests/ with 119 tests
covering the shared stream, cache, and packet layers, the MUL file
library, and the server config, region, account, and landscape
bounds logic. Each runner uses its own object output directory so
client and server PPUs with colliding unit names cannot pollute
each other's builds. Drone now builds and runs both suites before
packaging. Found on the way: two product defects fixed in the
previous commits.
2026-11-15 22:08:32 +01:00
aksdb ca8a0afc3b 🚨 Rename a local that shadowed the localization text property
The unit did not compile standalone because the serialize routine
declared a variable with the name of the published property.
2026-11-15 22:08:32 +01:00
aksdb 2b6f684505 🐛 Write full row byte counts when encoding land art
The land encoder passed word counts as byte counts to the stream
write, so every diamond row was truncated to half its length and
saved land tiles were unreadable.
2026-11-15 22:08:32 +01:00
aksdb 8f70a5cc98 🐛 Release large scale operation state on failure
The bitmask arrays, operations, and pending radar packets were only
released at the end of the straight-line handler, so any exception
leaked tens of megabytes per malformed request.
2026-11-15 22:08:32 +01:00
aksdb e38a487d56 🐛 Free the block parts when loading corrupt map data fails
A failed block creation leaked the already constructed halves and
the index.
2026-11-15 22:08:32 +01:00
aksdb 208ad57777 🐛 Validate radar map file data
Odd-sized radar color files, short static blocks, and tile IDs
beyond the color table read or wrote past their arrays at startup.
2026-11-15 22:08:32 +01:00
aksdb 6df8df9a9b 🐛 Validate tile IDs in static insertion
Sub-4000 filter entries underflowed to huge tile IDs, and placing
on top of statics with corrupt IDs indexed past the tiledata array.
2026-11-15 22:08:32 +01:00
aksdb 8731ec150c 🐛 Accept empty tile filters in large scale operations
An empty tile list is a valid no-filter request, but the
constructors dereferenced the empty array while reading it.
2026-11-15 22:08:32 +01:00
aksdb 45386dcbaf 🐛 Free the config document on validation failures
Invalid or outdated configuration leaked the parsed XML document
while aborting startup.
2026-11-15 22:08:32 +01:00
aksdb 5910178309 🐛 Free compression buffers when server-side compression fails 2026-11-15 22:08:32 +01:00
aksdb 0d1c61364b 🐛 Skip unauthenticated sockets in region update notifications
Region change notifications dereferenced the account of every
socket, crashing on connections that had not logged in.
2026-11-15 22:08:32 +01:00
aksdb b3a3b090b4 🔒 Handle missing accounts in user modification responses
Rejecting an empty username built the response packet from a nil
account reference.
2026-11-15 22:08:32 +01:00
aksdb 464c170e2d 🔒 Skip unauthenticated sockets in admin broadcasts
Any connection that had not finished logging in has no account, and
dereferencing it aborted the broadcast for all remaining admins.
2026-11-15 22:08:32 +01:00
aksdb 46aaec645c 🐛 Stop block requests with no coordinates from crashing
A truncated request packet produced an empty coordinate array whose
first element was dereferenced.
2026-11-15 22:08:32 +01:00
aksdb e12fe942b7 🔒 Validate compressed packets on the server
A client could declare an unbounded decompressed size to exhaust
server memory, nest compressed packets recursively, or send a
truncated inner packet whose handler read garbage.
2026-11-15 22:08:32 +01:00
aksdb 7acd461086 🐛 Stop broadcasting to unauthenticated sockets
Change and radar packets reached every connected socket, leaking
map edit activity to anyone who had opened a connection without
logging in. The state sweep also ran per loop tick; it now runs
once per second.
2026-11-15 22:08:32 +01:00
aksdb 4a7f525937 🚨 Keep the server receive queue consistent on errors
A handler exception left the stream locked and skipped the packet
dequeue, permanently desyncing the connection. Declared packet
sizes are now validated against a sane range, and clients sending
garbage are dropped instead of stalling the queue.
2026-11-15 22:08:32 +01:00
aksdb e74065fd49 🚨 Reject out-of-range block subscriptions
The off-by-one bounds check let a crafted free-block packet index
one past the subscription array and follow garbage memory as a
client list, corrupting the heap.
2026-11-15 22:08:32 +01:00
aksdb 0a939d4f35 🚨 Free login profile handles on read or write errors 2026-11-15 22:08:32 +01:00
aksdb ef124eb495 🚨 Default to no access when no access level is selected 2026-11-15 22:08:32 +01:00
aksdb b7235f8f93 🚨 Stop account saves with exactly 256 regions from losing them
The region count was clamped to 256 and wrapped to zero in the
byte field, truncating the account's region list server-side.
2026-11-15 22:08:32 +01:00
aksdb 74cf40118c 🚨 Truncate tile lists to the wire limit consistently
Serializing more than 65535 tiles wrote a wrapped count while
sending every tile, desynchronizing the server-side parse.
2026-11-15 22:08:32 +01:00
aksdb bd60c99dc3 🚨 Clean up large scale command form teardown
Executing with no areas leaked the built packet, and pending tile
selection listeners stayed registered after the form was destroyed.
2026-11-15 22:08:32 +01:00
aksdb 335cfc875c 🚨 Mark mouse-created areas as unsaved changes
Drawing a new area rectangle on the map did not arm the save
button, so the area was silently discarded on the next switch.
2026-11-15 22:08:32 +01:00
aksdb f8f56d6b2f 🚨 Unregister the region dialog from access change notices
FormDestroy never removed its listener, leaving a dangling method
pointer in the main form's listener list after teardown.
2026-11-15 22:08:32 +01:00
aksdb aaaad354b2 🚨 Drop the temp region node before refreshing the list
The region list refresh freed all tree nodes, leaving the pending
new-region pointer dangling while its save button stayed armed.
2026-11-15 22:08:32 +01:00
aksdb 4f6e034b5c 🚨 Save edits to the region being edited
When switching regions with unsaved changes, the save prompt ran
after the tree had already moved its selection, so the old region's
areas were written into the newly selected region on the server.
The save now targets the region whose areas are loaded in the
editor.
2026-11-15 22:08:32 +01:00
aksdb 9864157f33 🚨 Stop region saves with exactly 256 areas from wiping them
The count was clamped to 256 and then stored in a byte, wrapping to
zero, so the server replaced the region with an empty area list.
2026-11-15 22:08:32 +01:00
aksdb 818590ded0 ⚡ Cache tile list thumbnails in memory
The tile browser decoded art from disk and rebuilt the image on
every repaint of every visible cell; entries are now decoded once
and reused.
2026-11-15 22:08:32 +01:00
aksdb 75220f3dc4 ⚡ Set the light mode once per run of tiles
The render loop reissued the light state calls for every tile even
when the mode was unchanged.
2026-11-15 22:08:32 +01:00
aksdb fbfd8e627f 🚨 Clamp UOA design placement altitude in both directions
Moving a design only guarded the upper altitude bound, letting tile
altitudes wrap past the signed range.
2026-11-15 22:08:32 +01:00
aksdb 0092f6893e 🚨 Return an empty rectangle when no tile is selected
GetSelectedRect left its result undefined when called without a
current tile.
2026-11-15 22:08:32 +01:00
aksdb b47292a4bc 🚨 Guard location name serialization against empty strings
Saving or loading an unnamed location indexed the first character
of an empty string.
2026-11-15 22:08:32 +01:00
aksdb 4d9e02aaef 🚨 Ignore disconnect notices for unknown clients
Deleting at index -1 raised an exception and aborted the packet
dispatch when the list had already diverged.
2026-11-15 22:08:32 +01:00
aksdb 5f7e277721 🚨 Free detached DOM nodes when deleting random presets
RemoveChild detaches without owning the node; every deleted preset
or overwritten preset entry leaked it.
2026-11-15 22:08:32 +01:00
aksdb 481d6ac905 🚨 Free the edit target list when an edit action fails mid-way 2026-11-15 22:08:32 +01:00
aksdb dd20f4962d 🚨 Nil the label pointer when freeing a screen block label
Freeing without clearing left a dangling reference that a repeated
prepare pass would free again.
2026-11-15 22:08:32 +01:00
aksdb 1fbce3570d 🚨 Release the old material when re-highlighting a static
Hovering with hue highlighting reassigned the screen buffer material
without dropping the previous reference, leaking a GL texture on
every hover.
2026-11-15 22:08:32 +01:00
aksdb f09b8b7fbc 🚨 Validate radar map packet payloads
An empty radar map indexed an empty array, and update coordinates
from the server were written into the image without bounds checks.
2026-11-15 22:08:32 +01:00
aksdb fcb90dffbb 🚨 Handle empty or unreadable radar cache files
A zero-byte cache file indexed an empty array, and read errors
leaked the file stream.
2026-11-15 22:08:32 +01:00
aksdb 71865facd8 🚨 Make radar shutdown safe
Destroying the radar window dereferenced the image without a nil
check when creation had failed, and leaked the cache file stream on
write errors, skipping cleanup of the remaining objects.
2026-11-15 22:08:32 +01:00
aksdb 93c2af9d9f 🚨 Free the light config document and tolerate a missing file
LoadConfig leaked the parsed XML document on every call and aborted
startup when the color config file was absent.
2026-11-15 22:08:32 +01:00
aksdb 043a5a1ccf 🚨 Free the light collection when the light map update fails 2026-11-15 22:08:32 +01:00
aksdb 3dd9ce1d68 🚨 Mark the light manager as initialized
The flag was never set, so the framebuffer extension was reloaded on
every frame with lights enabled.
2026-11-15 22:08:32 +01:00
aksdb b90fbdf190 🚨 Clamp drawn tile altitudes to the valid range
Drawn statics could exceed the signed altitude range and wrap
around.
2026-11-15 22:08:32 +01:00
aksdb 1e44b51a06 🚨 Apply random elevation offsets in raise and lower modes
The random offset was computed first and then overwritten by the
raise and lower branches.
2026-11-15 22:08:32 +01:00
aksdb 78f945cee7 🚨 Expose the draw action hue
The draw action reads its hue field but no property ever exposed
it, so hue selection was silently ignored.
2026-11-15 22:08:32 +01:00
aksdb 3e562ff03d 🚨 Take the elevation target as a signed byte
The coordinate-based elevate overload accepted a word and silently
truncated it when writing the signed altitude byte.
2026-11-15 22:08:32 +01:00
aksdb 992666583d 🚨 Guard block requests without coordinates 2026-11-15 22:08:32 +01:00
aksdb 63ca31805e 🚨 Free compression buffers when packet compression fails
A compression error leaked the buffers and the wrapped packet,
whose ownership had already been transferred.
2026-11-15 22:08:32 +01:00