mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-22 15:33:12 +09:00
Address review on exp_server_list
The controller and instance plugins are init functions with closures. The controller batches refreshes with setMany and deleteMany, and the instance gates updates on its status instead of a started flag. short_name is now display_name. New always_on_top field sorts servers first in get_servers. The record carries has_password from the game password in factorio.settings, never the password itself, and the description falls back to the one in factorio.settings. A controller welcome is used when the instance has none, and the readme falls back to a default welcome from the locale. Lua gets is_synced for connect.lua. The readme passes an empty detail instead of nil to the join tooltip so the player count stays in __2__, restores the Password status, shows the welcome title as a centered label and shortens long descriptions with the full text as a tooltip. The Lua tests assert the lookups they index, which fixes the lint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4d136853c9
commit
c0289ed8a7
15 files changed
+528
-418
No files matched your search
@@ -2,12 +2,17 @@ import * as lib from "@clusterio/lib";
|
||||
import * as messages from "./messages.js";
|
||||
|
||||
declare module "@clusterio/lib" {
|
||||
export interface ControllerConfigFields {
|
||||
"exp_server_list.welcome": string;
|
||||
}
|
||||
|
||||
export interface InstanceConfigFields {
|
||||
"exp_server_list.short_name": string;
|
||||
"exp_server_list.display_name": string;
|
||||
"exp_server_list.description": string;
|
||||
"exp_server_list.welcome": string;
|
||||
"exp_server_list.reset_time": string;
|
||||
"exp_server_list.hidden": boolean;
|
||||
"exp_server_list.always_on_top": boolean;
|
||||
}
|
||||
|
||||
export interface Permissions {
|
||||
@@ -22,22 +27,30 @@ export const plugin: lib.PluginDeclaration = {
|
||||
|
||||
controllerEntrypoint: "./dist/node/controller.js",
|
||||
instanceEntrypoint: "./dist/node/instance.js",
|
||||
controllerConfigFields: {
|
||||
"exp_server_list.welcome": {
|
||||
title: "Welcome",
|
||||
description: "Message shown on the welcome tab of the readme for instances without their own",
|
||||
type: "string",
|
||||
initialValue: "",
|
||||
},
|
||||
},
|
||||
instanceConfigFields: {
|
||||
"exp_server_list.short_name": {
|
||||
title: "Short Name",
|
||||
"exp_server_list.display_name": {
|
||||
title: "Display Name",
|
||||
description: "Name shown in the server list, the instance name when empty",
|
||||
type: "string",
|
||||
initialValue: "",
|
||||
},
|
||||
"exp_server_list.description": {
|
||||
title: "Description",
|
||||
description: "One line about the server shown in the server list",
|
||||
description: "One line about the server shown in the server list, the server description when empty",
|
||||
type: "string",
|
||||
initialValue: "",
|
||||
},
|
||||
"exp_server_list.welcome": {
|
||||
title: "Welcome",
|
||||
description: "Message shown on the welcome tab of the readme",
|
||||
description: "Message shown on the welcome tab of the readme, the controller welcome when empty",
|
||||
type: "string",
|
||||
initialValue: "",
|
||||
},
|
||||
@@ -53,6 +66,12 @@ export const plugin: lib.PluginDeclaration = {
|
||||
type: "boolean",
|
||||
initialValue: false,
|
||||
},
|
||||
"exp_server_list.always_on_top": {
|
||||
title: "Always On Top",
|
||||
description: "List this instance before those without it",
|
||||
type: "boolean",
|
||||
initialValue: false,
|
||||
},
|
||||
},
|
||||
|
||||
messages: [
|
||||
|
||||
Reference in new issue
Block a user