Jump to content

Search the Community

Showing results for tags 'players online'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. EverythingRS - Players Online Tutorial EverythingRS is a free API system. Here's a quick tutorial on how to get started with adding Players Online. Getting started First off download our everythingrs-api.jar from here and include it into your project. Also register an account at EverythingRS Remember your secret key as you will be using it in the next section Making the Players Online work with your server This part of the tutorial is for PI, but can easily be changed to work with any server. If you want me to add a snippet on the thread so it can work with your framework leave a comment with the server base you want the snippet for. In your server startup (Server.java) under public static void main( Add this and change your secret key to the one on your account com.everythingrs.playersonline.PlayersOnline.service.scheduleAtFixedRate(new Runnable() { @Override public void run() { int online = 0; for (Player player : PlayerHandler.players) { if (player != null) { online += 1; } } com.everythingrs.playersonline.PlayersOnline.insert("secret_key", online, false); } }, 0, 30, TimeUnit.SECONDS); Displaying your player count on your website In your index.php place this where ever you wish to display your player count. Remember to change the secret key. <?php $secret = "change_this_to_your_secret_key"; $playersOnline = @file_get_contents("https://everythingrs.com/api/playersonline/get/".$secret); echo "There are currently ".$playersOnline." players online"; ?> Fin You are finished with the tutorial and can now view your player count on your site ^^ Info and some documentation Player count will update every 30 seconds. If you wish to make calls every 30 minutes just change the 5 to 30 (or to whichever number you wish) and TimeUnit.SECONDS to TimeUnit.MINUTES in the startup code. If you wish to make direct changes to the way the code works, this section will help out. To fetch the current players online you can use this code com.everythingrs.playersonline.PlayersOnline.get(); To set the count to whatever you wish use this code com.everythingrs.playersonline.PlayersOnline.set(value); To add to the playercount use this com.everythingrs.playersonline.PlayersOnline.increment(value); To subtract from the playercount use this com.everythingrs.playersonline.PlayersOnline.decrement(value);
×