mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-11 15:54:52 +09:00
Merge branch 'explosivegaming:main' into translate
This commit is contained in:
3 files changed
+6
-6
No files matched your search
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
@@ -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),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user