By continuing to use this site, you agree to the Terms of Service of this website, including usage of cookies.

OK, Don't show this again

This plugin displays player count and MODT from any server on a sign.
version 1.1.1
Approved
Direct Download How to install?
Switch version
938 Downloads / 2023 Total
4 Reviews
Plugin Description §

Usage:

Anyone with the permission SSS.signs can create a sign with the following content:

[SSS]
serverIP/Hostname (can go over two lines with a - at the end of the first line)
serverPort

The plugin will recognize that sign and fill it with colorful stats!

Note: Due to 1.1+ not telling the server when the sign is finished, you now need to tap the sign once to activate it after setting it up.

API:

This plugin can also be used as a query API. You might want to look into SignServerStats.php, because all the API functions are in there.

Example plugins are provided in /examples/:

  • DumpInfo.php - Dumps all available info about a server.

Because the following two examples may also be useful for users, they are also provided as phars in every release:

  • WarnOffline/ - Warns if a server has gone offline. Depends on StatusList.
  • StatusList/ - Lists online status and player count of multiple servers in a List.

You should always check if your plugin is compatible with the version of SignServerStats present on the current server with the help of the isCompatible function

Example:

/** @var robske_110\SSS\SignServerStats $signServerStats */
if(!$signServerStats->isCompatible("1.1.0")){
   	$this->getLogger()->critical("Your version of SignServerStats is not compatible with this plugin.");
	$this->getServer()->getPluginManager()->disablePlugin($this);
	return;
}

If you prefer just a quick introduction, here is one for getting the the online status of the server example.com:1234:

Initial, for example onEnable:

/** @var $sss robske_110\SSS\SignServerStats */
$sss->addServer("example.com", 1234);

This tells SSS that it should query that server in its next query.

IMPORTANT: The info might not be available in the next SSSasyncUpdateEvent!

To check if the server is online simply listen to the SSSasyncUpdateEvent and check the array:

public function onSSSasyncUpdate(robske_110\SSS\event\SSSasyncUpdateEvent $event){
	$serverOnlineArray = $event->getPlugin()->getServerOnline();
	if(isset($serverOnlineArray["example.com"."@".1234])){
		$isOnline = $serverOnlineArray["example.com"."@".1234];
	    //isOnline is now a bool (true/false) that reflects the online state of the server (if the server is online and this says false, it probably doesn't have query enabled.)
	    //You can now also get additional data with getMODTs() and getPlayerData() in the same way.
	    //There is also the function getFullData() with which you can get allthedata a server sent over the query. Do a var_dump on it for a headstart.
	}else{
	    //The information is going to be here in the next event!
	}
}

TODO:

  • [ ] FTPs? NCPs?

  • [x] Multi-line server hostnames

  • [x] Create custom event onAsyncUpdate for easier API use

  • [x] API should be able to also get other data (playernamelist, pluginlist)

  • [x] Sign style config

  • [x] Tap sign to transfer

What's new §
  • Updated for API 3.0.0 (suitable for all 3.x.x, therefore also compatible with 3.1.0)
  • Added default permissions
    Thanks to Aericio for the help!
  • Bump to ALPHA11
  • Bump to alpha10
  • Tap a sign to get transferred! (For all users with the permission SSS.servertransfer
  • You can now use longer hostnames, simply utilise line 2+3, and place a - at the end of line2
  • A Sign style config is now available for you to fully customise the looks of the sign.
  • AsyncTask: More robust against invalid query responses
  • API: Plugins can now get the full response data (basically everything one can fetch via a query)
  • API: Added AsyncUpdateEvent, which defeats the need to use tasks to fetch information (see the example plugin changes for details)
Now compatible with ALPHA9

Bluelex
using v1.1.0-0.alpha11
02 Apr 18
How to create a sign?
robske110
Staff
03 Apr 18
Just create a sign with the following content: first line: [SSS], second line: serverIP and third line: port and then tap the sign once.
Lihener
using v1.1.0
10 Jan 18
Actualizen ya a la alpha 10 plz
robske110
Staff
02 Feb 18
done
dude2093350
using v1.0.0
01 Jul 18
HonorGamerHD
using v1.0.0
04 Jun 18
your plugin is very helpful, please update to ALPHA12 :D

Reply to review by :

Supported API versions
3.0.0
->
3.5.0
License §
Categories:
Informational
General
Teleportation
Miscellaneous
Permissions
Other files
Permissions
Asynchronous tasks

You can leave one review per plugin release, and delete or update your review at any time

Loading...