Skip to content

Commit

Permalink
Reduce update intervals, update version
Browse files Browse the repository at this point in the history
  • Loading branch information
skykatik committed May 3, 2021
1 parent 0f7dc50 commit e36190a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/main/java/inside/LightweightHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void init(){
Events.on(TapEvent.class, event -> teleport(event.player, event.tile));

Events.run(Trigger.update, () -> {
if(interval.get(60 * 0.3f)){
if(interval.get(60 * 0.15f)){
Groups.player.each(this::teleport);
}
});
Expand Down Expand Up @@ -142,11 +142,11 @@ public void init(){
CompletableFuture<?>[] tasks = config.servers.stream()
.map(data -> CompletableFuture.runAsync(() -> {
// all tasks executes on ForkJoinPool
Core.app.post(() -> Call.label(data.title, 10f, data.titleX, data.titleY));
Core.app.post(() -> Call.label(data.title, 5f, data.titleX, data.titleY));
net.pingHost(data.ip, data.port, host -> {
counter.addAndGet(host.players);
Call.label(formatter.get(host), 10f, data.labelX, data.labelY);
}, e -> Call.label(config.offlinePattern, 10f, data.labelX, data.labelY));
Call.label(formatter.get(host), 5f, data.labelX, data.labelY);
}, e -> Call.label(config.offlinePattern, 5f, data.labelX, data.labelY));
}))
.toArray(CompletableFuture<?>[]::new);

Expand All @@ -155,7 +155,7 @@ public void init(){
Core.settings.put("totalPlayers", counter.get());
counter.set(0);
}).join();
}, 1.5f, 10f);
}, 1.5f, 5f);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"author": "Mindustry Inside",
"main": "inside.LightweightHub",
"description": "A lightweight hub plugin for servers.",
"version": "0.6"
"version": "0.7"
}

0 comments on commit e36190a

Please sign in to comment.