1package com.osroyale.game.service;
3import com.google.common.util.concurrent.AbstractScheduledService;
4import com.osroyale.Config;
5import com.osroyale.game.world.World;
6import org.apache.logging.log4j.LogManager;
7import org.apache.logging.log4j.Logger;
9import java.io.IOException;
10import java.io.InputStream;
12import java.util.concurrent.TimeUnit;
48 protected void runOneIteration()
throws Exception {
51 InputStream is =
new URL(String.format(
"%s/player_count.php?key=9A@2U0764JqB&amount=%d",
Config.WEBSITE_URL, count)).openStream();
53 }
catch (IOException ex) {
54 logger.error(
"Error writing player count on website.", ex);
59 protected Scheduler scheduler() {
60 return Scheduler.newFixedRateSchedule(10, 30, TimeUnit.SECONDS);
static int getPlayerCount()