LWOPreconditionComponent::CheckPrecondition is given the context
of the check and passes a precondition whose validContexts does not have that
context's bit: 0 buying from a vendor, 1 a vendor listing its items, 2
equipping an item that is bound to the player, and none (-1) for everything
else, which leaves out the rows that only name those three (a value under 5).
A row with no context at all fails. Every row was checked everywhere here.
Two things change:
- Preconditions 338 and 339 (mission 1926 / 1918 completed, validContexts 3)
are for vendors only and no longer stop an item from being used or equipped.
- A bound item was equipped without any of its requirements. It is now checked
in the bound item context, as the client checks it before asking: only the
level requirements (validContexts 249) are left out.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Using a property launch pad equips the player's rocket and opens the property
browser. When the browser is closed without a launch, or the player dies with
it open, the client fires "CancelLaunch" at the launch pad, locally and to the
server (LWOPropertyEntranceComponent::onPropertyEntranceSelected,
). Nothing handled the event, so the rocket stayed equipped until the
next world load.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three client messages had no handler:
- BuildExitConfirmation (1072): the client says it left a build mode, after
the last message of that mode (LWOPropertyManagementComponent::DoSetBuildMode
). It is addressed to the thinking hat the player wears
or to no object, neither of which is an entity here, so the player who sent
it takes it. Live answered nothing in the 10 captured ones, and the messages
before it already ended the mode, so it is checked and logged.
- PropertyModerationAction (915): the owner started editing a property whose
moderation status is not 0 and asks for 0 (LWOPropertyManagementComponent
). Live answered nothing in the 3 captured ones. The approval of an
edited property is already taken back when the edit ends, so it is checked
(own character, may build here, status 0) and logged; nothing new is stored.
- RequestLeaveProperty (1489): a visitor left through the "the owner is
starting to build" dialog
(LWOPropertyManagementComponent::onBuildModeVisitorConfirm). The
player is sent to the world the property's launch pad returns to, as the
visitors who are sent away when building starts.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The client tests a box against the property's boundary path and build height:
the box around the path's points, raised to maxBuildHeight above its lowest
point and with no floor, then the box's centre and bottom corners against the
path as a polygon. The server placed a model wherever UpdateModelFromClient
said.
PropertyBounds is that test, and UpdateModelPosition runs the model's position
through it with the path and height DownloadPropertyData sends. The server has
no box for a model, so only the position is tested. A refused placement leaves
the item in the inventory and is answered with PlaceModelResponse 12, for which
the client shows its placement bounds message.
Models already on a property are not tested, moved or removed, wherever they
stand; a property without a boundary path refuses nothing.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PlayerFlags.OnlySetByServer marks 22 flags. The client's flag component refuses
to set them itself (LWOFlagComponent::SendMessage logs "Attempted to
set a flag from the client side that can only be set from the server"), and
none of the 205 client SetFlag messages in the live captures named one; the
server set them. SetFlag::Handle set whatever flag the message named.
The message is now dropped for those flags, with a debug log line. Flags
already saved on a character are not touched.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LWOGhostComponent::LoadFromSaveData reads <ghst i> under <obj> and
the client hides its own character again once the scene has loaded when it is
set. Nothing wrote or read the element, so a GM was visible again after every
world change.
GhostComponent now writes <ghst i="1"/> while invisible and reads it back. A
save without the element loads as visible and is not given one; an element
that is set goes back to 0 when the GM is visible again.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LWOPropertyEntranceComponent::onRequestPropertyInfo sets the two
flags of PropertyEntranceSync when the search text is part of the map's default
property name / description, which the client shows for a property that has
none of its own. Both were read and ignored, so a property without a name or
description was never found by the text the player sees on it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Live replies to a friends query listed the friends' properties whatever their
access type (64 entries with accessType 0) and the properties of the account's
other characters (28 entries, isAlt set); the client draws the lock on the ones
that are closed. The query only returned friends' properties that were open to
friends.
The list was also what kept a closed property from being entered, so
PropertyEntranceComponent::OnEnterProperty now checks the selected entry itself:
public for everybody, friends-only for friends, as before. Entries after the
first are never marked as owned, as live.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
With bind_ip empty, chat, dashboard and UGC bind 127.0.0.1 only when master
is a loopback host; otherwise nothing changes. A set bind_ip always wins.
Auth, master and the worlds are unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The child closes every descriptor above 2 before exec, so master's UDP
ports are released when master stops. Process::Run closes them too.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
LWOPreconditionComponent::msgCheckAllPreconditions splits the list at ",;:" into groups and each
group at "|" into alternatives, and reports the alternatives of a group only when the whole group failed.
Here everything after a "|" was one alternative, so "248;290|340;338" did not ask for 338 when 290 passed, and
a failed alternative was reported to the client although the other one passed: with "62|26" (1715 items) a
player wearing item 7994 was told precondition 26 failed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LWOPreconditionComponent::CheckPrecondition answers types 1, 3, 15, 17 and 23 with the opposite of
the list check of types 0, 2, 14, 16 and 9, which passes on the first value that meets it. Faction and flag lists
passed here as soon as one value was not held: precondition 66 (not faction 1 or 33) passed for every player.
The level check (type 22, an unnamed client function) passes on the first level reached, like the other list checks.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LWOPreconditionComponent::CheckPrecondition answers type 3 with the opposite of type 2's check
(an unnamed client function: the count of the LOT is at least targetCount). Here it asked for the item to be equipped, so
precondition 3 (none of LOT 2633) could only be met while wearing the item it forbids.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LWOMovementAIComponent::ProcessDelayAction stores the delay and stops
LWOMovementAIComponent::msgArrived at that command, remembering which one it was. The object stands
at the waypoint for the delay, then the waypoint's other commands run and it walks on. A fight ends the wait.
36 waypoints use it (Nimbus Station pet ranch, Starbase 3001, the LEGO Club); the command did nothing before.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PathFollowWaypointsHelper goes on to waypoint 1, or to the one before the last, when it runs off an
end of a bounce path. Here the turned path started with the waypoint the object stood on, so that waypoint was
reached again at once and its commands ran twice.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LWOMovementAIComponent::LoadConfigData reads attached_path_start next to attached_path, and
LWOMovementAIComponent::ProgessChangeWPAciton splits "path,waypoint" at any of ",;:".
PathFollowWaypointsHelper::SetCurrentPath then heads for that waypoint of the path.
Both started at waypoint 0 here, and after a changeWP the new path's first waypoint was skipped. Avant Gardens
Survival's 26 changeWP commands all name a waypoint ("RaceTrack_01,6").
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LWOPropertyEntranceComponent::msgPropertySelectQuery hands wasFriends to the browser UI.
Live sent 1 on all 27 replies to a sort 5 query and 0 on all 8 replies to sort 1 and sort 3; it was always 1 here.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The shipped trigger files name the command DectivateSpawnerNetwork. The server
now reads that name as the deactivate spawner network command, so those triggers
run, and the edited file checks take it. The correctly spelt name stays as an alias.
The shipped files test no longer lets unknown trigger ids through for the
retail clients.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A world server answers the client's level editor: it remembers per connection
whether the editor is on (and never sends such a client a zone load), takes and
gives up the zone's lock, says whether files may be sent, takes them, sends the
zone's files, and reloads the zone. Who may is the same as for the dashboard's zone
file API: the account's editor level against zone_publish_gm_level, the zone's
editors or an admin, and the lock's holder to send files. Files are unpacked,
checked, written and packed on a worker thread, and every request is in the audit
log.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ZoneFilePack reads and writes the editor's packed files: named entries whose data is
sd0, one entry for a single file or the zone, terrain, scenes and triggers of a whole
map. Every length is checked, data that is not sd0 or has a chunk over 256 KiB is
refused, and only a name's base name is used. ZoneFilePush makes a set of what was
sent (one file replaces that file in the zone's set), checks it and applies it like
any other set.
The override store links a set's files instead of moving them, so a file the zone
already has can be carried into its next set, and one change at a time is made in an
override folder whichever server makes it. The asset manager can read the client's
own file past an override.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A character's editor level is its account's GM level for accounts at editor_gm_level
or above, and 0 for everyone else (it was 1 or 0). It is written as the save's edit
attribute, sent with the character after the GM level (the editor flag, then the
level) and given in answer to the GetEditorLevel game message.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A capped string now skips the characters it cut, so what follows it is read from the
right place. A request to join a private instance that is still starting is answered
once its world server is ready, instead of at once with an address nothing listens
on yet.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This reverts commit e92e47f5. Nothing starts an edit mode instance any more. Its two
fixes that had nothing to do with edit mode come back in the next commit.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This reverts commit 4a054406. The client's level editor builds a zone's objects
itself from its own files, so a world server that constructs none of them has no use.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
/api/v1/zones/{zoneId}: send a zone's edited files (multipart), follow the reload,
list, restore and clear the zone's sets, and take, release and look at its lock.
Every request needs an API key that names the zones_publish permission, an owner at
zone_publish_gm_level, and HTTPS or the server's own machine; refusals are counted
per address and every use is in the audit log. A publish is checked at its headers
before any of its body is taken, the files are checked and written on a worker
thread, and the zone's instances are replaced through the world reload, held while
players are there unless told to move them.
The Worlds page lists each zone's editors and lock holder for an admin.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A route registered as an upload route has its headers run through the middleware
first, so a request that isn't allowed is answered before any of its body is taken.
The body then goes to a file as it arrives, with a size limit, instead of into
memory. MultipartFile splits a multipart/form-data body that is in a file into its
parts without loading it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
For a file under maps/ master watches the file a world would read now: the override
when one is there, else the client's. An override that appears, changes or goes away
makes the instances that read another version stale, also for files from the packs.
The dashboard can hold a zone's automatic reloads (WORLD_RELOAD_HOLD, a new message
after the existing ones) until a reload of the zone is asked for. The status sent to
the dashboard counts what reloads did per zone.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
World, master and chat servers read files under maps/ through the override folder
named by zone_override_dir (empty: off). The settings for who may send zone files
and how large a set may be are in sharedconfig.ini and the settings catalog.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three pieces that know nothing of how a set of files arrives:
- ZonePublish reads every file of a set with the server's own readers and says, file
by file, what is wrong; a set is good only when every file is.
- ZoneOverrideStore keeps a good set in the override folder: built in a staging
folder, flushed, swapped in with a rename, the set before it kept as a backup.
Restoring a backup and clearing a zone's set are the same swap.
- ZoneEditLock has the rules for a zone's editors and its one lock holder, and for
holding a reload while players are in the zone.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Tables for the one account holding a zone's lock and for each zone's assigned
editors, on MySQL and SQLite, with the interface and the test database.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The asset manager reads a name under maps/ from the override folder when the file is
there, and from the client otherwise. Nothing else is looked for in it and the
client's files are never written. Off until a folder is set.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A string length, the path chunk's length and an object's render technique count are
compared with the bytes left before memory is set aside for them. The terrain reader
is built into dCommon, so every server that reads zone files has it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
With -editmode 1 the world loads the zone file, terrain scene map, navmesh and
level revisions, but makes no level objects, carver blockers, spawners, spawner
networks, triggers, vanity objects or live event objects. The zone control
object stays with the zone's own template, as the client makes the same one
itself (LevelManager::LoadZoneControlObject); its server script
does nothing and a race track's does not take the player into a race. Such a
world lets in only accounts at editor_gm_level.
Plumbing only: no command starts an edit mode instance yet (docs/EditMode.md).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CreatePrivateZone carries editMode as one more byte, written only when set, so
a plain private zone is sent as before. Master keeps it on the instance, starts
the world server with -editmode 1, and gives a private instance's replacement
(a reload or a live update) the same flag. Nothing sets it yet.
A capped string now skips the characters it cut, so what follows it is read
from the right place. A request to join a private instance that is still
starting is answered once its world server is ready, instead of at once with
an address nothing listens on yet.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The client takes a non-zero edit as the editor being enabled. A character whose
account GM level is at least editor_gm_level (worldconfig.ini, default 9) is
saved with edit="1"; everyone else keeps 0. A civilian never gets it, whatever
the setting. The setting is in the dashboard's settings catalog.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
L_FIRE_TRANS_ROCKS_MANAGER waits until the rocks of its RockGroup are all
there (NumberOfRocks, 3), sends them to waypoint 1 five seconds later,
and each time all of them have told it they are back down sends them up
again after a second. L_FIRE_TRANS_ROCKS holds a rock that arrived at
waypoint 1 for 3.5 s and sends it back to waypoint 0, where it tells the
manager (PlatformDown). Both act on ArrivedAtDesiredWaypoint and
GoToWaypoint, which the mover has.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The script (with L_BASE_SWITCH_ACTIVATED_SERVER) asks the switches in the
platform's switchGroup to tell it when they are activated and
deactivated, and sends the platform to waypoint 1 on the one and back to
waypoint 0 on the other. The NJ monastery's ice and lightning attic
platforms (LOTs 14539 and 14376) run it.
A switch can now be asked for that (SwitchComponent::
AddActivationCallback). Where live's switch tells its group that it has
loaded, the platform here looks for its switches again each second until
it has found one.
The script was on the list of scripts left out, with a note that its
platform does not exist; it is taken off the list.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The script of the platforms a spinner moves once: a simple mover (or a
mover on a two point path) in the spinner's group_deactivated_event
group goes to its waypoint 1 when the spinner fires the event named in
the platform's name_deactivated_event. The NJ spinner script already
fires those events at its groups.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LWOPlatformRotator::LoadConfigData reads rotX, rotY, rotZ and
rate as floats from the config; a value the level stored as another
number type read as 0 here.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
SG_TARGET.lua, the targets' server script: at the last waypoint of its
path (onArrived with isLastPoint, which the client's PushToLua
sets for a moving platform's Arrived as for a waypoint
follower's) a target notifies the cannon, FinishedPath, and sg_cannon.lua
spawns the next one as after a hit (checkSpawn). A target set to despawn
there then dies silently after 1 s, a moving platform after 2 s.
Here ships and subs sat at the end of their path until the game ended,
and nothing came after them. The script cannot load (the targets have a
script row of their own), so the cannon does it:
- the respawn is split out of RegisterHit (CheckSpawn), and the die
callback only registers a hit when the death is not the silent one;
- a moving platform target tells through PlatformAtLastWaypoint, a
waypoint follower through a new MovementAIComponent waypoint callback.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A simple mover is a LWOPlatform like a mover: made stopped at its
waypoint (12) and, unless startPathingOnLoad is false, waiting there (9)
for the shortest wait before it leaves for its other end
(ResumeTravelling, SetWaitingTime, RunPlatform
). Live showed it on the NJ counterweights, which wait for
their quick build first; one without a quick build was left waiting for
a script here.
The client only reads startPathingOnLoad (LWOMovingPlatformComponent::
LoadConfigData) and never starts a platform by itself, so the
rule is the server's, taken from what live did with movers (12 with the
setting false, else 9 and off) and from the scripts: L_NJ_SPINNER_SERVER
stops its platform when it starts up, simple movers included, and the
simple movers that wait for an event without that script all have
startPathingOnLoad 0 in the maps.
The wait now runs in the component for both, in place of the timer a
built counterweight got, and a simple mover with startPathingOnLoad
false is constructed stopped (12).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The tests compared the login response and SET_SESSION_KEY of the old
hand written code with the structs byte for byte, with the same seed
for both. The key no longer comes from the seeded engine, so the tests
leave its bytes out, and the copy of the old code writes the key the
way main writes it now.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>