Fix invalid mod-setting prototype name (colon not allowed)

Caught by actually running the mod on a real Factorio 2.0.77 server:

  Error while loading mod-setting prototype
  "kafkatorio:cache-expiration-seconds_kafkatorio-packet-keyed-PlayerUpdate"
  (double-setting): Invalid prototype name. Only characters
  A-Z a-z 0-9 _- are allowed.

cacheDurationSettingName() built names with a ":" separator
("kafkatorio:cache-expiration-seconds_..."), which Factorio 2.0
rejects outright. Replaced it with "-", matching the mod-name-prefix
convention the engine's own docs recommend. This is a pure runtime
validation issue invisible to the TypeScript compiler - exactly the
kind of thing only actually loading the mod in-game catches.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Lazzexus 2026-10-12 16:12:39 +02:00
parent d0c76b5c85
commit 1e8ed08ca2

View file

@ -48,7 +48,7 @@ export class KafkatorioSettingsConfig {
private static cacheDurationSettingName(type: KafkatorioKeyedPacketTypes): string {
return `kafkatorio:cache-expiration-seconds_${type.replaceAll(".", "-")}`
return `kafkatorio-cache-expiration-seconds_${type.replaceAll(".", "-")}`
}
}