Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 91ff50b

Browse files
committed
upd: 删除之前的计数逻辑
1 parent e329961 commit 91ff50b

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/entity/commands/task/players.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export default class RefreshPlayer implements ILifeCycleTask {
3131
private playersChart: Array<{ value: string }> = [];
3232

3333
async start(instance: Instance) {
34-
let chartCount = 0;
3534
this.task = setInterval(async () => {
3635
// {
3736
// host: 'localhost',
@@ -49,18 +48,6 @@ export default class RefreshPlayer implements ILifeCycleTask {
4948
instance.info.maxPlayers = result.max_players ? result.max_players : -1;
5049
instance.info.currentPlayers = result.current_players ? result.current_players : -1;
5150
instance.info.version = result.version ? result.version : "";
52-
if (chartCount === 0) {
53-
chartCount = 99;
54-
this.playersChart.push({
55-
value: result.current_players ? result.current_players : 0
56-
});
57-
if (this.playersChart.length > 60) {
58-
this.playersChart = this.playersChart.slice(1, this.playersChart.length);
59-
}
60-
instance.info.playersChart = this.playersChart;
61-
} else {
62-
chartCount--;
63-
}
6451
} catch (error) { }
6552
}, 3000);
6653

0 commit comments

Comments
 (0)