1package com.runehive.game.service;
3import com.google.common.util.concurrent.AbstractScheduledService;
4import com.runehive.Config;
5import com.runehive.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;
28 InputStream is =
new URL(String.format(
"%s/player_count.php?key=9A@2U0764JqB&amount=%d",
Config.
WEBSITE_URL, count)).openStream();
30 }
catch (IOException ex) {
31 logger.error(
"Error writing player count on website.", ex);
37 return Scheduler.newFixedRateSchedule(10, 30, TimeUnit.SECONDS);
The class that contains setting-related constants for the server.
static final String WEBSITE_URL
static final Logger logger
static final WebsitePlayerCountService INSTANCE
static WebsitePlayerCountService getInstance()
Represents the game world.
static int getPlayerCount()
Gets the amount of valid players online.