Merge branch 'explosivegaming:main' into translate

This commit is contained in:
phidias authored and GitHub committed 2026-10-18 00:29:31 +09:00
commit a0de42f725
3 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ export default async function (context: ControllerPluginContext) {
const record = players.get(request.name);
return new messages.PlayerStatistics(request.name, {
...record?.stats,
...messages.userStatistics(controller.users.getByName(request.name)),
...messages.userStatistics(controller.users.getByName(request.name), record?.stats),
}, record?.updatedAtMs);
});
+4 -4
View File
@@ -42,11 +42,11 @@ export class PlayerStatistics {
}
}
/** Statistics clusterio already keeps for every user, shown with the others but never added to */
export function userStatistics(user?: Pick<lib.UserDetails, "playerStats">): Record<string, number> {
/** Statistics clusterio already keeps for every user, shown with the others but never added to, existing stats may contain legacy values */
export function userStatistics(user?: Pick<lib.UserDetails, "playerStats">, stats: Record<string, number> = {}): Record<string, number> {
return {
Playtime: Math.floor((user?.playerStats.onlineTimeMs ?? 0) / 60e3),
JoinCount: user?.playerStats.joinCount ?? 0,
Playtime: (stats.Playtime ?? 0) + Math.floor((user?.playerStats.onlineTimeMs ?? 0) / 60e3),
JoinCount: (stats.JoinCount ?? 0) + (user?.playerStats.joinCount ?? 0),
};
}
+1 -1
View File
@@ -180,7 +180,7 @@ function Elements.join_server.refresh(button, server)
elseif status == "Modded" then
button.enabled = true
button.sprite = "utility/downloading_white"
button.sprite = "utility/downloading"
button.hovered_sprite = "utility/downloading"
else