RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.service.WebsitePlayerCountService Class Reference
Inheritance diagram for com.runehive.game.service.WebsitePlayerCountService:
Collaboration diagram for com.runehive.game.service.WebsitePlayerCountService:

Static Public Member Functions

static WebsitePlayerCountService getInstance ()

Protected Member Functions

void runOneIteration () throws Exception
Scheduler scheduler ()

Static Private Attributes

static final WebsitePlayerCountService INSTANCE = new WebsitePlayerCountService()
static final Logger logger = LogManager.getLogger(WebsitePlayerCountService.class)

Detailed Description

Definition at line 14 of file WebsitePlayerCountService.java.

Member Function Documentation

◆ getInstance()

WebsitePlayerCountService com.runehive.game.service.WebsitePlayerCountService.getInstance ( )
static

Definition at line 20 of file WebsitePlayerCountService.java.

20 {
21 return INSTANCE;
22 }

References INSTANCE.

Referenced by com.runehive.RuneHive.start().

Here is the caller graph for this function:

◆ runOneIteration()

void com.runehive.game.service.WebsitePlayerCountService.runOneIteration ( ) throws Exception
protected

Definition at line 25 of file WebsitePlayerCountService.java.

25 {
26 try {
27 final int count = World.getPlayerCount();
28 InputStream is = new URL(String.format("%s/player_count.php?key=9A@2U0764JqB&amount=%d", Config.WEBSITE_URL, count)).openStream();
29 is.close();
30 } catch (IOException ex) {
31 logger.error("Error writing player count on website.", ex);
32 }
33 }

References com.runehive.game.world.World.getPlayerCount(), logger, and com.runehive.Config.WEBSITE_URL.

Here is the call graph for this function:

◆ scheduler()

Scheduler com.runehive.game.service.WebsitePlayerCountService.scheduler ( )
protected

Definition at line 36 of file WebsitePlayerCountService.java.

36 {
37 return Scheduler.newFixedRateSchedule(10, 30, TimeUnit.SECONDS);
38 }

Member Data Documentation

◆ INSTANCE

final WebsitePlayerCountService com.runehive.game.service.WebsitePlayerCountService.INSTANCE = new WebsitePlayerCountService()
staticprivate

Definition at line 18 of file WebsitePlayerCountService.java.

Referenced by getInstance().

◆ logger

final Logger com.runehive.game.service.WebsitePlayerCountService.logger = LogManager.getLogger(WebsitePlayerCountService.class)
staticprivate

Definition at line 16 of file WebsitePlayerCountService.java.

Referenced by runOneIteration().


The documentation for this class was generated from the following file: