The dashboard's web server answers one request at a time, so converting a big
.nif (glom files up to tens of MB) held up every other request, flairs included.
- dWeb: Web::Defer hands a request to another thread; the reply is sent from the
web thread on its next poll (DeferredQueue). A client that leaves first cancels
it and the late reply is dropped. The synchronous route API is unchanged.
- Web::Shutdown closes connections while the state their close events touch is
still alive; the destructor no longer runs handlers during static destruction
(stopping the dashboard aborted in ~WSClient).
- WorkerPool: priority lanes, with one thread only for urgent work (flairs,
small models, textures), and limited background work.
- Scenery: mesh and texture routes (and the showcase's) convert on the pool;
thread-safe memory and disk caches, one conversion per model at a time with
waiters sharing it; zones are converted ahead onto the disk cache while viewed.
- Setting scenery_workers (0: half the cores, 2 to 4).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its key starts with the zone, so the economy compaction read the whole table twice for every
day it merged into a month. With 900k old rows to merge on MariaDB the task went from 107 s to
14 s. The index holds only the day and the key, so the game's upsert that adds to a row's
events never updates it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Leave staff out of the currency and U-score reports by excluding the few staff characters,
instead of joining every ledger row to its character and account.
- Top earners: total per character first and look up names for the top rows only.
- The places list and the activity report read map events for every kind in one query
(GetMapZonesAllKinds) instead of one query per kind.
With about 1M currency rows and 650k map event rows (90 days) on MariaDB: currency 1.8 s to
0.8 s, top earners 2.4 s to 0.75 s, places 2.6 s to 0.5 s, activity 2.6 s to 1.7 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mysqldump was given --host=tcp --port=//host:port for the tcp:// form the servers accept, so
backups failed. Read mysql_host the way the servers connect with it: tcp://host:port (a trailing
/database is dropped), unix:// as --socket and pipe:// as a named pipe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The picker's EXISTS on ComponentsRegistry (no index) took 2 to 4 s with the bundled SQLite for the
treasure kinds; the same filter as IN takes under 10 ms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Read activity and map_id as signed: a row with map_id -1 made the page fail with a server error
when sorted by map.
- A search counts and pages through the characters it matches (index on character_id) instead
of joining every row of the log to a name; when the matches are a large part of the log the
page still walks the log in order.
- Sorted by character name, only the row ids are sorted and the page's rows are read after.
On a log of about 800k rows this takes searches with few matches from about 1 s to 0.1 s and
name sorts from about 3 s to 0.5 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a database NexusDashboard (or a server's own changes) already migrated, 29, 30 and 40 logged
an error for every column that was already there, and 40 and 57 added a second index on
columns MariaDB had already indexed for the inline REFERENCES foreign keys of 0_initial.sql.
Add those columns and indexes only when information_schema says they are missing.
40 also gives pet_names.owner_id values written before 23_store_character_id_as_objectid.sql
the persistent bit, as 23 did for every other character id column, so they match characters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each skip computed an absolute offset as a 32 bit tellg plus a size
product in 32 bit math (colorMapSize * colorMapSize * 4 and friends),
which wraps for large values and can seek backwards. The skips are now
relative to the current position with the size promoted to
std::streamoff first. Offsets are unchanged for every real terrain file,
so this only removes the overflow the TODO asked about.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two script TODOs with the live scripts shipped in the client to follow:
- AgPropGuard: accepting mission 768 before touching the orb (flag 71
unset) plays the "MissionCam" cinematic, as L_AG_PROP_GUARD.lua does.
Also no longer dereferences a missing Character.
- BaseFootRaceManager: joins the "FootRaceStarter" group on startup like
L_ACT_BASE_FOOT_RACE.lua, since other foot race objects look the
starters up through that group.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New instances already get their address from external_ip through the
master server's dServer, so the TODO asking to read it from config was
done. No behaviour change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Trigger commands with target="zone" gathered no targets, so they never
ran. Forbidden Valley uses it for two ActivateSpawnerNetwork commands
(qb1 on interact, qb2 on activation) in nd_forbidden_valley.lutriggers,
and the winter large property uses it too. The zone is now the zone
control object, the same entity scripts treat as the zone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Speed buffs (BuffParameters "speed", for example the slow from the Great
Katana of Freezing and the Shurikens of Ice) and speed behaviours go
through ControllablePhysicsComponent's speed multiplier, which only
players' clients used. Enemies move with MovementAIComponent, which
ignored it, so slows had no effect on them.
- MovementAIComponent scales its waypoint speed by the entity's speed
multiplier when one is set.
- RemoveSpeedboost set the multiplier of any entity without a
LevelProgressionComponent (every enemy and pet) to 0 once its last
boost ended, which was harmless while nothing read it for them. It now
goes back to the normal base of 500 (multiplier 1).
Needs an in-game check with the freezing katana charge-up against an
enemy.
Fixes#1179
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The live script (L_EXPLODING_ASSET.lua) does everything inside
"if not bIsHit": smash the attacker if they stand within 10 units, cast
the explosion skill, smash itself and progress missions. The server only
guarded the attacker smash, so another hit before the asset despawned
cast the skill and progressed missions again.
The TODO asking to kill everything in a radius is obsolete: live smashes
only the attacker directly, and everyone else in range takes the
explosion skill's damage, which the server already casts. Removed it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The drill only progressed missions 972, 1305 and 1308 for the player who
started it, so another player breaking the drill (the usual way on a
busy Crux Prime) got no credit for the drill objectives. The live
script (L_SKULLKIN_DRILL.lua, notifyDie) credits the killer, then also
the activator when that is someone else, which is what it does now. It
also no longer dereferences a null attacker. Removes the "Missions"
TODO.
May account for part of #1021 (Crux Prime daily smashable objectives not
tallying); needs an in-game check with two players.
Refs #1021
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ported from the live server scripts that ship with the client:
- scripts\ai\LS\ForceFieldEffect.lua (LEGO Club and Starbase 3001 force
fields): plays effect 3671 "cast" on whatever touches the phantom.
- scripts\ai\NP\L_NPC_NP_JETPACK_GUY.lua (jetpack ambient NPCs): plays
the object's "launch" effect when used.
- scripts\02_server\Map\AM\L_SKELETON_SPAWNER_VOLUME.lua (Crux Prime
Skullkin area): with 10 or more players in the volume the Skullkin
engineer, miner and patroller networks maintain 2/6/6 instead of
1/4/4, with a 60 second cooldown between changes and a catch-up check
when it ends. Only players are counted, and the count never goes
below zero.
WBL_Enemy_Grabbler.lua only sets wander variables for the old Lua
movement AI, so it joins the other alpha wander scripts in the excluded
list instead of logging as missing.
Refs #746
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The faction and immunity change, spawning the spider wave, knockbacks
and reading the animation time are all implemented right below their
TODOs, so the comments were stale. No behaviour change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dropship computer's OnDie activated the "next" spawner network
(pipe number + 1) when a player smashed it and only fell back to the
first network otherwise. The computer has no next network, so once a
player smashed it (easiest with area attacks like the Doom Hammer) it
never came back. The live script (L_DROPSHIP_COMPUTER.lua, shipped in
the client's server scripts) always resets its own network and
activates the first one, which is what it does now.
OnUse also dereferenced GetMission(979) without a null check, crashing
the world when a player without that mission used the built computer.
It now matches the live script: only players with the mission active
get the Nexus Talon data card, once. SsModularBuildServer had the same
unchecked GetMission and now checks the mission state.
Fixes#596
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"client_location = ../client " or a value with a trailing space is a
common setup mistake that surfaces much later as an unrelated error (a
missing client folder, a failed database login). Keys and values are now
trimmed of spaces, tabs and line endings when the ini is read, which
also covers the \r of files saved with Windows line endings. Spaces
inside a value are kept, and lines with an empty key are ignored.
Verified with a new unit test that loads an ini with padded keys and
values.
Refs #1113
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Loading a character whose xml has a malformed flag threw out of
std::stoul, and a character whose xml failed to parse (or has no obj
tag) dereferenced null on load and again on every save.
- Flags are parsed with TryParse and a malformed one is logged and
skipped instead of aborting the load.
- The quick parse checks for the obj and items tags before using them.
- Saving refuses to run when the document has no obj tag, logging that
the character was not saved, instead of crashing and taking every
other player's unsaved progress with it.
- The remaining obj-child lookups go through a helper that returns null
when the root is missing.
Component LoadFromXml/UpdateXml still assume a valid document; refusing
to load a player with invalid xml belongs in the world server's load
path, which is being converted separately.
Refs #1332
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Level files set factions with set_faction, and most of the string-typed
values have a trailing space ("13:6 ", "13:-1 ") or hold several
factions separated by spaces ("13:4 6"). The server split only on ';'
and TryParse rejects trailing characters, so about 1,500 placed objects
(smashable lanterns, fences, candles, treasure chest spawners and so on)
silently kept their component faction instead.
LWODestroyableComponent::LoadConfigData in the 1.10.64 client reads
set_faction as a string, splits it on both ';' and ' ', and replaces its
faction list with the result. The server now does the same: split on
both, skip empty pieces, and replace the factions (SetFaction for the
first, AddFaction for the rest). This also removes the TODO about
splitting on spaces, and the faction list from the destructible table
no longer uses std::stoi on a token that TryParse already parsed.
Values in the shipped maps were counted with a scan of the .lvl files.
Needs an in-game check that objects placed with set_faction (for example
the AG Survival buff stations and NT treasure chests) are still targeted
or ignored as expected; this may also affect #1301.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FindTarget kept returning the current target while it stayed inside the
tether radius, even after it died, so enemies stood over dead players
(most visible in long respawn areas like the Battle of Nimbus Station)
and pet or summon AI hovered over enemies playing their death animation.
A dead current target now loses its threat and a new target is picked,
and dead entities are skipped both as proximity candidates and as threat
entries. Players who respawn are picked up again through the usual
proximity and threat paths.
Verified by building WorldServer and the test suite; needs an in-game
check (die to an enemy, the enemy should return to idle or pick another
player).
Fixes#1428
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Client-sent AMF (CONTROL_BEHAVIORS) was decoded without limits on the
associative part of arrays, on nesting depth, or on the total number of
values. Associative entries went into an unordered_map with the standard
unseeded string hash, so a client could pick colliding keys and make
insertion quadratic, and deeply nested arrays recursed until the stack
overflowed, crashing the world server.
- The associative map is now an ordered std::map (O(log n) whatever the
keys, deterministic serialization order).
- Each array allows at most 10,000 associative entries, the same as the
existing dense limit, which is now checked before anything is read.
- Arrays may nest at most 32 deep and one deserializer reads at most
100,000 values. Every limit throws, which the only caller already
catches and drops the message.
- Inserting a duplicate key keeps the last value and no longer returns a
reference to a value that was destroyed when the key already held null.
Verified with new unit tests for each limit (including a 100,000 deep
nesting that previously overflowed the stack) and the existing live
packet test, which still decodes.
Fixes#2035
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 CHANGES SERVER BEHAVIOUR (intentionally); no wire change.
The MissionDialogueOK handler (carried over verbatim from
GameMessages::HandleMissionDialogOK) dereferenced the responder without
a null check, so a client naming an object that doesn't exist crashed
the world server. It now logs and ignores the message; the script
callback is no longer called with a null player (that path always
ended in the crash).
Test: handling a MissionDialogueOK with an unknown responder crashes
without this change and passes with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Converts OfferMission, NotifyMission, NotifyMissionTask, ResetMissions,
NotifyClientFlagChange and NotifyLevelRewards (sent with SendToClient:
the old functions never broadcast) and the received RespondToMission,
MissionDialogueOK, RequestLinkedMission, SetFlag and HasBeenCollected
to NetGameMsgs in MissionMessages.{h,cpp}. Callers are switched,
OfferMission's send-it-twice behaviour moves to MissionOfferComponent,
the received messages are registered in GameMessageHandler's map and
the old functions are deleted. Handlers are copied verbatim. The
byte-equality helper can now compare SendToClient messages.
No wire change and no change in recipients. Verified byte for byte
against a frozen verbatim copy of the old functions over an input grid
(including OfferMission's two packets), received messages compared with
the old handlers' read sequences and every truncated payload rejected,
hand computed golden bytes and round trips. Layouts confirmed against
the 1.10.64 client in Ghidra.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Converts the 12 racing / vehicle / modular assembly messages DLU sends
and the 8 it receives to NetGameMsgs in RacingMessages.{h,cpp}, adds
eRacingClientNotificationType for NotifyRacingClient's event type,
switches the callers (RacingControlComponent, CarBoostBehavior,
PossessorComponent, slash commands), registers the received messages
in GameMessageHandler's map and deletes the old functions. Handlers are
copied verbatim. Also moves the byte-equality test helpers into a
shared GameMessageTestUtils.h.
No wire change. Verified byte for byte against a frozen verbatim copy
of the old functions over an input grid, to one client and broadcast;
received messages compared with the old handlers' read sequences
(including all 16 optional-field combinations of
VehicleNotifyHitImaginationServer) and every truncated payload
rejected; hand computed golden bytes; round trips; a deliberate field
mutation made the tests fail. Layouts confirmed against the 1.10.64
client in Ghidra. Malformed received messages are
dropped (see the foundations commit).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Converts ActivityEnter, ActivityExit, ActivityStart, ActivityStop,
ActivityPause, StartActivityTime, RequestActivityEnter,
RequestActivityExit and ShowActivityCountdown to NetGameMsgs in
ActivityMessages.{h,cpp}, switches their callers (racing, shooting
gallery, survival, waves, AG course, NT combat challenge) and deletes
the old GameMessages::Send* / HandleRequestActivityExit functions.
REQUEST_ACTIVITY_EXIT is registered in GameMessageHandler's map.
No wire change. Verified by comparing every struct byte for byte with a
frozen verbatim copy of the old functions (tests/.../Legacy) over a
grid of inputs, both to one client and as a broadcast (a temporary test
proved the copy matched production before it was deleted), plus hand
computed golden bytes, round trips and a deliberate field mutation that
made the tests fail. Layouts confirmed against the 1.10.64 client in
Ghidra. Only difference: a broadcast no longer makes
the extra Send(UNASSIGNED, false) that RakNet already rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THIS CHANGES THE BYTES SENT TO THE CLIENT (intentionally).
UnSmash::Serialize wrote the "duration != 3.0f" flag but guarded the
value with "builderID != 3.0f" (a typo), so the 32-bit duration was
always written, even after a 0 flag. The LEGO Universe 1.10.64 client
(GameMessage::UnSmash::Serialize/Deserialize @ 00dc0e80/00dc0f50,
default 3.0f @ 017e66b4) writes it only when
duration != 3.0f. The client read the flag and ignored the trailing 32
bits, so this removes 4 junk bytes from default UnSmash messages;
messages with a non-default duration are unchanged.
Uses WriteOptional/ReadOptional and adds Deserialize. Verified with
hand computed golden bits for every flag combination and round trips.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
First step of moving hand written bitstream code to struct based
messages (see docs/PacketArchitecture.md). No wire changes.
- GameMsg is now only a server-internal event (delivered to handlers
registered with RegisterMsg); NetGameMsg is a wire message with
Send(sysAddr) (UNASSIGNED broadcasts), SendToClient(sysAddr) (one
client, never broadcasts), WritePacket, Serialize, Deserialize and
Handle. Mixing them up is now a compile error. NetGameMsgEvent<T> /
DeliverLocally carry a wire message to local handlers; loot drops,
pickup, the object debugger, GM invisibility and model RequestUse
use them. The GM invisibility message keeps its target, so its bytes
are unchanged.
- Behaviour change: GameMessageHandler logs and drops messages whose
Deserialize fails instead of handling them with default fields (the
4 messages already registered: RequestUse, RequestServerObjectInfo,
ShootingGalleryFire, PickupItem).
- LUBitStream (kept as on main) gets a virtual destructor (Mail deleted
derived packets through the base) and WritePacket, also used by
ChatPackets::SendRoutedMsg with identical bytes.
- BitStreamUtils::WriteOptional/ReadOptional for default-flag fields
and WriteLengthPrefixed/ReadLengthPrefixed for length prefixed
strings.
- Every message ID enumerator (MessageType::*, ServiceType, Mail's
wire enums) is pinned with static_asserts, so renumbering or removing
one fails to compile.
- Tests: dServerMock copies each sent packet (it kept a pointer to the
caller's destroyed BitStream); PacketTestUtils.h compares packets bit
for bit; helper tests use hand computed golden bytes and equality
with the hand written patterns they replace; compile-time checks
keep the wire/internal split in place.
- docs/PacketArchitecture.md: survey, target architecture,
conventions, verification method and migration plan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat: logging structure improvements
tested that logs are sorted by the folder argument and that the directories are created recursively.
tested that crash dumps follow the same exact name (+Crash_...name..._pid.log) so you can match the crash dump to the corresponding log file much easier
* Potential fix for pull request finding 'Use parsed cloneID when constructing the log folder'
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* const
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* feat: Add cheat detection knowledge
tested that getting kicked correctly displays the reasons why and their corresponding values
tested that a user with developer permissions is not kicked for said funness
tested that logs are correct for those funness values which i could actually trigger
* fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
tested that aggro is reset correctly and enemies no longer infinitely path to players. Tether now properly calculates the time to tether instead of guessing
* feat: debugger additions
Add type field for links in flash
Add warning level for dangerous buttons
fix uninitialzied memory with jetpack variable
remove a bunch of duplicated position push code
tested that the ui is still functional and components with multiple physics components have all their details visible.
tested that jetpack is initialized now
* remove amf3 header
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* fixes
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* refactor: update behavior slot determination to use equipLocation instead of itemType
* fix: improve skill management in InventoryComponent to ensure correct client updates
* feat: enhance possession mechanics with skill set integration and improved message handling
* fix: restore SetPossessor in Mount() and scope IsRacing to vehicles
SetPossessor was missing from Mount(), breaking direct possessions via
PossessableComponent::OnUse which bypasses HandlePossession. IsRacing
now only set/cleared when the mount has HavokVehiclePhysicsComponent,
preventing non-vehicle possessions from incorrectly affecting the
distance-driven statistic.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: testmap improvements
fixes#1191
removed the force flag because it would only work to let you softlock your character.
tested that taking the lego club door now spawns you at the lego club/ns lego club doors always vs letting you spawn where ever.
tested that a testmap no longer spawns you where you last were in a zone and instead spawns you at the spawn point
inspect allows you to inspect zoneControl and localCharacter now
updated docs with the new info
* Update Entity.cpp
* feat: spawner weights
* remove ref
* default weights to 1
* fix: remove team member if they've logged out
tested that if i logout, after 20 seconds the team member is removed.
* fix: enemies snapping to the incorrect position if they had a path
tested that ags enemies no longer snap backwards a large amount
* fix: move the home point so we can aggro correctly