From 04852196ad6ea0b36f6cb79d453a7fd61ee257ed Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 20 Jul 2022 13:18:47 +0200 Subject: [PATCH] Rename play time to online time Be a bit more accurate in the online time stat name and call it for what it is. It counts time spend online on the server, not necessarily time spent playing. --- docs/managing-a-cluster.md | 2 +- packages/ctl/src/commands.js | 2 +- packages/lib/users.js | 2 +- packages/web_ui/src/components/UserViewPage.jsx | 6 +++--- packages/web_ui/src/components/UsersPage.jsx | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/managing-a-cluster.md b/docs/managing-a-cluster.md index 28c03a39..ebf48211 100644 --- a/docs/managing-a-cluster.md +++ b/docs/managing-a-cluster.md @@ -54,7 +54,7 @@ Note: This may cause loss of data. ctl> instance extract-players -Creates a user account in the cluster for each player that has been online on the currently running save of the instance and sets the play time of that account on this instance to the online time recorded in the save. +Creates a user account in the cluster for each player that has been online on the currently running save of the instance and sets the online time of that account on this instance to the online time recorded in the save. Useful when importing a save to a cluster. Note that the online time in a save is recorded differntly from how Clusterio records online time. diff --git a/packages/ctl/src/commands.js b/packages/ctl/src/commands.js index 06f83956..ba5df6bd 100644 --- a/packages/ctl/src/commands.js +++ b/packages/ctl/src/commands.js @@ -750,7 +750,7 @@ instanceCommands.add(new libCommand.Command({ instanceCommands.add(new libCommand.Command({ definition: ["extract-players ", "Extract players from running save into the cluster.", (yargs) => { - yargs.positional("instance", { describe: "Instance to extract players and play time from", type: "string" }); + yargs.positional("instance", { describe: "Instance to extract players and online time from", type: "string" }); }], handler: async function(args, control) { let instanceId = await libCommand.resolveInstance(control, args.instance); diff --git a/packages/lib/users.js b/packages/lib/users.js index 2ccc702b..a212c519 100644 --- a/packages/lib/users.js +++ b/packages/lib/users.js @@ -478,7 +478,7 @@ definePermission({ definePermission({ name: "core.instance.extract_players", title: "Extract player stats from running save", - description: "Run extraction to create a user for each player in the save and set the play time from the save.", + description: "Run extraction to create a user for each player in the save and set the online time from the save.", }); definePermission({ name: "core.instance.start", diff --git a/packages/web_ui/src/components/UserViewPage.jsx b/packages/web_ui/src/components/UserViewPage.jsx index 9e561b96..7015f6e9 100644 --- a/packages/web_ui/src/components/UserViewPage.jsx +++ b/packages/web_ui/src/components/UserViewPage.jsx @@ -284,7 +284,7 @@ export default function UserViewPage() { - + {formatDuration(user["player_stats"]["online_time_ms"] || 0)} @@ -306,8 +306,8 @@ export default function UserViewPage() { sorter: (a, b) => strcmp(a[0], b[0]), }, { - title: "Play time", - key: "playTime", + title: "Online time", + key: "onlineTime", render: ([, stats]) => formatDuration(stats["online_time_ms"] || 0), sorter: (a, b) => (a[1]["online_time_ms"] || 0) - (b[1]["online_time_ms"] || 0), }, diff --git a/packages/web_ui/src/components/UsersPage.jsx b/packages/web_ui/src/components/UsersPage.jsx index 4b32f147..cc5a1390 100644 --- a/packages/web_ui/src/components/UsersPage.jsx +++ b/packages/web_ui/src/components/UsersPage.jsx @@ -99,8 +99,8 @@ export default function UsersPage() { render: user => user.roles.map(id => {(roles.get(id) || { name: id })["name"]}), }, { - title: "Play time", - key: "playTime", + title: "Online time", + key: "onlineTime", render: user => user["player_stats"]["online_time_ms"] && formatDuration(user["player_stats"]["online_time_ms"]), sorter: (a, b) => (a["player_stats"]["online_time_ms"] || 0) -