Skip to content

Commit

Permalink
SignServerStats 1.0.0 + ALPHA8
Browse files Browse the repository at this point in the history
Most things have been tested, and they worked!
  • Loading branch information
robske110 committed Sep 22, 2017
1 parent 9eeea85 commit e968f8d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Anyone with the permission `SSS.signs` can create a sign with the following cont

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 need to tap the sign once to activate it after setting it up.*
*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.**
Expand All @@ -21,8 +21,8 @@ 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, so they are also provided as phars in every release:
- WarnOffline/ - Warns if a server has gone offline. Depends on StatusList (BETA)
- StatusList/ - Lists online status and player count of multiple servers in a List. (BETA)
- 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 StatusList present on the current server with the help of the isCompatible function_

Expand All @@ -36,12 +36,12 @@ if(!$signServerStats->isCompatible("1.0.0")){
}
```

#### If you prefer just a quick introduction, here is one for getting the the online status of the server `someip.com:1234`:
#### 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:
```php
/** @var $sss robske_110\SSS\SignServerStats */
$sss->addServer("someip.com", 1234);
$sss->addServer("example.com", 1234);
```
This tells SSS that it should query that server in its next query.

Expand All @@ -51,9 +51,9 @@ To check if the server is online simply do this, it is recommended to do this in
```php
/** @var $sss robske_110\SSS\SignServerStats */
$serverOnlineArray = $sss->getServerOnline();
if(isset($serverOnlineArray["someip.com"."@".'1234'])){
$isOnline = $serverOnlineArray["someip.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)
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.
}else{
//You didn't wait long enough, the information didn't get here yet...
Expand Down
4 changes: 2 additions & 2 deletions SSS/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: SignServerStats
api: [3.0.0-ALPHA7]
version: 1.0.0-InDev-beta4
api: [3.0.0-ALPHA7, 3.0.0-ALPHA8]
version: 1.0.0
load: POSTWORLD
main: robske_110\SSS\SignServerStats
author: robske_110
Expand Down
14 changes: 7 additions & 7 deletions SSS/src/robske_110/SSS/SignServerStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ public function removeServer(string $ip, int $port): bool{
* @internal
*
* WARNING: Do not use this function. Use @link{this->removeSign}!
*
* @param Vector3 $pos
* @param string $levelName
* @param int|null $index
*
* @return bool $foundSign
*/
*
* @param Vector3 $pos
* @param string $levelName
* @param int|null $index
*
* @return bool $foundSign
*/
public function internalRemoveSign(Vector3 $pos, string $levelName, ?int $index = null): bool{
if($index === null){
$foundSign = $this->doesSignExist($pos, $levelName, $index);
Expand Down
4 changes: 2 additions & 2 deletions examples/DumpInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* @name DumpServerInfo
* @main robske_110\DPS\DumpServerInfo
* @version 1.0.0-beta2
* @api 3.0.0-ALPHA7
* @version 1.0.0
* @api 3.0.0-ALPHA8
* @description Dumps query info of a Server using SignServerStats
* @author robske_110
* @license MIT
Expand Down
2 changes: 1 addition & 1 deletion examples/StatusList/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $sl->addStatusServer("someip.com", 1234, $sl->getSSS(), false); /* Last argument
Checking if there the server `someip.com:1234` is online:
```php
/** @var $sl robske_110\SL\StatusList */
if(($status = $sl->getStatusListManager()->getStatusServers()["someip.com@1234"][2]) === true){
if(($status = $sl->getStatusListManager()->getStatusServers()["someip.com"."@".1234][2]) === true){
//online
}elseif($status === false){
//offline
Expand Down
4 changes: 2 additions & 2 deletions examples/StatusList/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: StatusList
api: [3.0.0-ALPHA7]
version: 1.0.0-InDev-beta2
api: [3.0.0-ALPHA7, 3.0.0-ALPHA8]
version: 1.0.0
depend: SignServerStats
load: POSTWORLD
main: robske_110\SL\StatusList
Expand Down
4 changes: 2 additions & 2 deletions examples/WarnOffline/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: WarnOffline
api: [3.0.0-ALPHA7]
version: 1.0.0-InDev-beta2
api: [3.0.0-ALPHA7, 3.0.0-ALPHA8]
version: 1.0.0
depend: StatusList
load: POSTWORLD
main: robske_110\WO\WarnOffline
Expand Down

0 comments on commit e968f8d

Please sign in to comment.