Mark train stations and factories as experimental (#1309)

## Description:

Train stations and factories won't be ready for v24.
Disable them by default. They can be reactivated on private lobies and
solo games, allowing us to gather feedbacks.

Changes:
- added an "experimental" attribute for units. When set, they are hidden
entirely when disabled, rather than appearing grayed out.
 - disabled train stations and factories by default.

Default values:

![image](https://github.com/user-attachments/assets/ec91ef80-c0ef-45a7-8e6c-6628a836b593)

No factories:

![image](https://github.com/user-attachments/assets/a3e35607-aed5-401c-bc38-4ea742d057c6)


## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

IngloriousTom
This commit is contained in:
DevelopingTom
2025-07-02 19:13:34 +02:00
committed by GitHub
parent fb38045829
commit cfabdfebc7
10 changed files with 62 additions and 20 deletions
+10 -1
View File
@@ -21,7 +21,7 @@ import {
} from "../core/Schemas";
import { createGameRecord } from "../core/Util";
import { GameEnv, ServerConfig } from "../core/configuration/Config";
import { GameType } from "../core/game/Game";
import { GameType, UnitType } from "../core/game/Game";
import { archive } from "./Archive";
import { Client } from "./Client";
import { gatekeeper } from "./Gatekeeper";
@@ -222,6 +222,15 @@ export class GameServer {
);
return;
}
if (
clientMsg.intent.type === "create_station" &&
this.gameConfig.disabledUnits?.includes(UnitType.Train)
) {
this.log.warn(
`create_station is disabled, client: ${client.clientID}`,
);
return;
}
this.addIntent(clientMsg.intent);
}
if (clientMsg.type === "ping") {