Skip to content

fix(waypoint-tools): leave loaded.json to the Gateway that runs the game - #39

Merged
evrydayjunglist merged 1 commit into
LocalExile:mainfrom
evrydayjunglist:fix/waypoint-tools-listing
Nov 13, 2026
Merged

evrydayjunglist merged 1 commit into
LocalExile:mainfrom
evrydayjunglist:fix/waypoint-tools-listing

Conversation

@evrydayjunglist

@evrydayjunglist evrydayjunglist commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Waypoint's Give item answered "Give item uses the Waypoint Tools mod, and no running game has it loaded" whenever Waypoint was started while the game already ran, until the game's Gateway loaded the mod again.

Cause. A Gateway asked for its commands or values <kind> loads the mods too, for their commands, and Waypoint's Console asks when Waypoint starts. The mod wrote data/waypoint-tools/loaded.json on every load, so that short-lived Gateway wrote its own process over the one that runs the game and then ended. Waypoint reads a file naming an ended process as "left by a Gateway that stopped". LocalExile/Waypoint#31 found the same cause and said the root fix belongs in the mod; this is it.

Fix. loaded.json now belongs to the first Gateway that loads the mod in the folder, for as long as it runs:

  • Another Gateway in the same folder leaves the file and the requests alone.
  • When the named process has ended (a stop does not unload the mods) or is another program by now, the next scan takes the file: a quarter of a second later at most.
  • The file gains started, the named process's start time, so a process number that is used again is not taken for the Gateway. A file without it (1.0.2 and before) is matched by the program's name.
  • Unloading removes the file only when it is this Gateway's.

Waypoint reads protocol, actions and pid only, so the new field changes nothing for it, and the protocol number stays 1. Waypoint's own docs for this are in LocalExile/Waypoint#34; it needs no code change.

Version 1.0.2 becomes 1.0.3, the README says what the file now means, and mods.json is rebuilt. The change needs nothing new in LocalExile. compatibleClientVersions is unchanged (0.4.3-beta, 0.5.0-beta, 0.5.1-beta): the new code uses only System.Diagnostics, but it was played on 0.5.1-beta only.

Testing

Built against LocalExile main 77d300870 and run on a LocalExile 0.5.1-beta release folder with the 3.29.3d client.

Test Result
Servers started loaded.json names the game's Gateway, with started
GameServer.Gateway commands while the game's Gateway runs exit 0, 132 lines; the file still names the game's Gateway (with 1.0.2 it named the commands process, which had ended)
The file rewritten by hand to name an ended process names the game's Gateway again within a second
The file rewritten by hand to name another running program names the game's Gateway again within a second
commands first, with no servers running; then the servers started the file names the game's Gateway
Character in an area, then Waypoint started, item crafter, Give item "Added Iron Ring", item in the inventory. With 1.0.2 in the same order: the refusal above
The mod's files swapped to 1.0.2 while the Gateway ran [mods] unloaded waypoint-tools, [mods] loaded waypoint-tools 1.0.2; the file was the Gateway's again

Not checked: a source checkout (a Gateway run through dotnet), LocalExile 0.4.3-beta and 0.5.0-beta, Linux.

tools/build-index.ps1 -Check passes.

Waypoint's Give item answered that the mod is not loaded whenever
Waypoint was started while the game already ran, until the Gateway
loaded the mod again.

A Gateway asked for its `commands` or `values` loads the mods too, for
their commands, and Waypoint's Console asks when Waypoint starts. The mod
wrote loaded.json on every load, so that short-lived Gateway wrote its
own process over the one that runs the game and ended: the file named an
ended process, which Waypoint reads as "left by a Gateway that stopped".

loaded.json now belongs to the first Gateway that loads the mod in the
folder, for as long as it runs. Another Gateway there leaves the file
and the requests alone. When the named process has ended (a stop does not
unload the mods) or is another program by now, the next scan takes the
file, a quarter of a second later at most. The file gains `started`, the
named process's start time, so a process number used again is not taken
for the Gateway; a file without it (1.0.2 and before) is matched by the
program's name. Unloading removes the file only when it is this
Gateway's.

1.0.3. Checked on a LocalExile 0.5.1-beta release with the 3.29.3d
client: with the game running, a `commands` run leaves the file naming
the game's Gateway; a file naming an ended process, or another running
program, is taken back within a second; asked first and started after,
the Gateway takes the file; and a Waypoint started while the game ran
gave an Iron Ring ("Added Iron Ring"), where with 1.0.2 it answered that
the mod is not loaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant