105 Commits
Author SHA1 Message Date
phidias 4e80fccb69 feat 2026-11-11 20:05:19 +09:00
phidias ac31e7d362 alloc 2026-11-11 03:18:53 +09:00
phidias b3e91220ff limit 2026-11-11 00:56:55 +09:00
phidias c52753ff06 area 2026-11-11 00:38:57 +09:00
phidias 991259f7da area 2026-11-11 00:37:00 +09:00
phidias 071ed044ec per tick 2026-11-11 00:33:12 +09:00
phidias 628eb7904c per tick 2026-11-11 00:29:20 +09:00
phidias 2366fb3abf . 2026-11-11 00:27:22 +09:00
phidias 4ce7bddeb4 min 2026-11-11 00:24:03 +09:00
phidias f86bd5731d M 2026-11-11 00:19:12 +09:00
phidias ec17ccdd06 . 2026-11-11 00:14:16 +09:00
phidias 613b25bf8e . 2026-11-10 23:58:49 +09:00
phidias 7a1a31c880 pair 2026-11-10 23:48:38 +09:00
phidias 1bd0bf9296 ieesp 2026-11-10 23:42:34 +09:00
phidias ab3a456dee item q 2026-11-10 23:21:59 +09:00
phidias 43d4452049 . 2026-11-10 23:16:45 +09:00
phidias e6d898dd95 unalloc 2026-11-10 21:35:44 +09:00
phidias 828e2e5951 unalloc 2026-11-10 21:29:32 +09:00
phidias 0354c3ebc6 . 2026-11-10 20:29:22 +09:00
phidias ce6f54dd17 s 2026-11-10 20:08:38 +09:00
phidias eeeda196ae wrong table key 2026-11-10 20:01:53 +09:00
phidias 23649d7c50 e 2026-11-10 19:54:53 +09:00
phidias 30f9739844 global 2026-11-10 19:47:48 +09:00
phidias fc8d5a3064 global 2026-11-10 17:55:43 +09:00
phidias 086af3cb78 early return 2026-11-10 14:17:46 +09:00
phidias 2dade8224d . 2026-11-10 02:30:59 +09:00
phidias 96b41b6662 func 2026-11-10 02:24:25 +09:00
phidias b685334969 1 2026-11-10 02:23:40 +09:00
phidias 5166c35bf7 . 2026-11-10 02:22:46 +09:00
phidias a0b76de876 filter 2026-11-10 02:16:58 +09:00
phidias 131d3e41f2 . 2026-11-10 02:11:24 +09:00
phidias ceb306cf57 assert 2026-11-10 00:58:19 +09:00
phidias 6fb5cff645 check 2026-11-10 00:53:50 +09:00
phidias b40931c5cd table key 2026-11-10 00:30:15 +09:00
phidias 7155ea21d4 missing param 2026-11-10 00:21:50 +09:00
phidias 2ab8b0003e comma 2026-11-10 00:12:34 +09:00
phidias 66722c8291 vlayer surface and quality draft 2026-11-09 23:57:57 +09:00
Cooldude2606 a7e66ccdd4 Remove collection of player locale (#508) 2026-10-16 13:55:06 +01:00
Cooldude2606 37cef0e6db Merge branch 'main' into feature/player-settings 2026-10-14 23:39:36 +01:00
Cooldude2606andClaude Opus 5.5 5180cc39d6 Move community details into a scenario feature and drop preset colours (#498)
* Add a community_details feature for the community name and links

The community name, Discord, website, status, GitHub, and Patreon links
lived in exp_legacy/config/server_detail.lua, so changing them meant
editing the scenario. They are now the community_details feature and can
be edited from the Scenario Features page.

Chat auto reply, help bubbles, and the readme read the live config
instead of copying the values when the file loads, so an edit shows up
without a restart. Help bubbles store the location name in their task
and build the messages each cycle; the readme tab tooltip can be a
function which is called when the readme opens.

Every feature gets an enabled switch from the framework. There is no
sensible meaning for a disabled community name, so the values are
always used and the feature description says the switch does nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Move greetings to exp_scenario and drop preset colours

The greeting reads the community name and Discord link from the new
community_details feature, which exp_legacy can not depend on, so it moves
to exp_scenario/control/greetings.lua along with its commands and
locale. The custom message still lives in PlayerData for now.

The hardcoded per-player join messages in config/join_messages.lua are
removed with their fallback, as are the preset player colours. Player
sync already restores the colour of returning players, so new players
keep the colour Factorio gives them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 23:13:33 +01:00
Bastiaan 69e31ac2d9 Merge pull request #500 from bbassie/refactor/settings-in-storage
Keep the server UPS and fast decon toggles out of player data
2026-10-14 23:11:08 +01:00
bbassieandClaude Opus 5.5 54941b85aa Sync the toolbar of players through the controller
The toolbar order, favourites, and open panels were saved into
exp_legacy's PlayerData, which was never synced, and the file doing so
was no longer loaded. When a player leaves, the lua side now sends
Gui.toolbar.get_state as json compressed with helpers.encode_string,
and the controller stores the string on the player record.

When the player joins again the instance plugin sends the stored string
over rcon to exp_scenario.player_settings.receive_toolbar, which
decodes it and calls Gui.toolbar.set_state. exp_gui builds the toolbar
in on_player_joined_game, so it exists by the time the rcon arrives.
A string which does not decode, or a state naming buttons which no
longer exist, is logged and ignored rather than raising in the game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:10:31 +00:00
bbassieandClaude Opus 5.5 ebe7504c00 Show the language of players on their user page
exp_legacy recorded each player's locale in PlayerData statistics
which nothing read. The lua side now sends one ipc event with the
player's locale when they join and when they change language, the
instance forwards it, and the controller stores it on the player
record.

The Scenario section of the user page shows the language by name with
a flag made from regional indicator symbols. Locales with a region use
it directly, the rest map to a country through a small table covering
Factorio's locale list. Arabic, Catalan, Basque, and Esperanto have no
single country and get no flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:10:31 +00:00
bbassieandClaude Opus 5.5 6821d62c10 Keep join messages on the controller and print them from the instance
Join messages were stored in exp_legacy's PlayerData, which nothing
ever synced. The controller now keeps a players.json datastore of
per-player settings keyed by player name, starting with the join
message, and saves it on the save and shutdown hooks. Records with
nothing set are removed.

When a player joins, the instance plugin fetches their record and
prints the message to everyone over rcon in the player's colour, so no
lua is needed to show it. The in-game /set-join-message and
/remove-join-message commands send ipc which the instance forwards to
the controller; /set-join-message without a message asks the instance,
which prints the stored message back to the player.

Greetings is now a feature. Disabling it stops the greeting, the
commands, and the printed join messages. The private greeting with the
community name and Discord link is shown to every joining player, even
those with a join message, since one is a welcome for the player and
the other an announcement to everyone else.

Two controller permissions cover the web interface:
exp_scenario.join_message.set for your own message and .set_other for
anyone's, checked against the requesting user the same way
exp_discord_auth checks unlinking. The seed grants them to Supporter
and Moderator alongside the in-game commands. The user page gets a
Scenario section showing the message with an edit button for users who
may change it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:10:31 +00:00
bbassieandClaude Opus 5.5 4d3c4de5b1 Move greetings to exp_scenario and drop preset colours
The greeting reads the community name and Discord link from the new
community_details feature, which exp_legacy can not depend on, so it moves
to exp_scenario/control/greetings.lua along with its commands and
locale. The custom message still lives in PlayerData for now.

The hardcoded per-player join messages in config/join_messages.lua are
removed with their fallback, as are the preset player colours. Player
sync already restores the colour of returning players, so new players
keep the colour Factorio gives them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:10:22 +00:00
bbassieandClaude Opus 5.5 a6c453a88e Add a community_details feature for the community name and links
The community name, Discord, website, status, GitHub, and Patreon links
lived in exp_legacy/config/server_detail.lua, so changing them meant
editing the scenario. They are now the community_details feature and can
be edited from the Scenario Features page.

Chat auto reply, help bubbles, and the readme read the live config
instead of copying the values when the file loads, so an edit shows up
without a restart. Help bubbles store the location name in their task
and build the messages each cycle; the readme tab tooltip can be a
function which is called when the readme opens.

Every feature gets an enabled switch from the framework. There is no
sensible meaning for a disabled community name, so the values are
always used and the feature description says the switch does nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:10:22 +00:00
Bastiaan 757a36fc03 Merge pull request #486 from bbassie/feature/convert-configs
Convert the remaining scenario configs into features
2026-10-05 00:33:36 +01:00
bbassieandClaude Fable 5.1 2959d7476b Send every value, register protected entities, fix the pattern offset
- The instance sends every value of a feature, defaults included, so
  update_config is one loop which sets each field and compares. The
  stored table is the last set of values, and _apply is gone.
- values_equal compares table sizes before the contents.
- Protected entities are registered with register_on_object_destroyed
  and forgotten in on_object_destroyed, which covers every way an
  entity can go. The four removal handlers and the validity checks are
  gone. Entities destroyed while the feature is disabled are swept when
  it is enabled again. Saves from before the registrations table get it
  through the Storage on_init callback.
- Spawn area applied the water offset twice and the pattern offset
  never. The pattern tiles now move with the entities above them.
- pruneFeatureValues reads a validation result instead of catching an
  error, and FeaturesPage hands its pending state and unsaved bar to
  helpers.
- Shorter comments throughout.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-04 12:55:08 +00:00
bbassieandClaude Fable 5.1 f90b8fcee1 Address the second inline review of the features framework
- Feature.register returns the config as a second value, so files
  write `local feature, config = Feature.register(...)`.
- The lib is ExpScenario.Features and the instance class with its
  fields sits on Feature._prototype, which is the __index, the same
  shape as exp_commands.
- update_config only looks at values whose override was added,
  removed, or replaced. _apply_field sets one value and returns it, so
  the comparison happens while applying and the second loop only
  raises. Overrides dropped from the previous set count as candidates
  because the value reverts to its default.
- The `@setting name` tags are gone from the config comments.
- Protection is guarded as a whole instead of checking config.enabled
  in one handler. The handlers also forget mined entities, so
  get_entities and is_entity_protected now drop invalid references,
  which also covers entities destroyed without an event. The list
  getters are gone, the selection overlay builds its lists from
  Protection.config.
- Chat and damage popups are one feature in control/popups.lua.
- ignore_admins and command_admin_only are removed, roles cover them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 07:35:58 +00:00
bbassieandClaude Fable 5.1 bff6a1c612 Fix stale values, the unsynced page, and three smaller review finds
- The page waited for nothing, so before the subscription delivered
  the records every feature looked enabled with its defaults, and an
  Apply in that window would have written that state. It now shows a
  spinner until synced, like the role page.
- Values stored for a setting which was since renamed, removed, or
  changed type made every later save of that feature fail validation.
  The controller now reconciles the stored records with features.ts on
  start: stale values are dropped with a warning, records of removed
  features are deleted, and new features get their defaults.
- update_config no longer stores overrides for unknown paths, so a
  stale key is warned about once instead of on every load.
- The armor and gun inventory handlers of nuke protection are new to
  this branch and asserted on get_inventory, which is nil without a
  character. They return instead.
- The AFK check ran every 30 minutes while afk_minutes and kick_minutes
  can be set as low as 1. It runs every minute.
- sameValue lives in features.ts and isDefaultValue uses it, and the
  custom input branch of FieldInput is a single narrowed check.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-02 21:58:25 +00:00