-
-
Notifications
You must be signed in to change notification settings - Fork 39
ServerAuth Web API
In this tutorial you will check if a ServerAuth account exists
1. Create example.php file in your Web Server directory
2. Add ServerAuthWebAPI.php file in the same directory
3. Now add this code in example.php
<?php
//Include ServerAuth Web API
include 'ServerAuthWebAPI.php';
//Player to check
$player = "Steve";
//Initialize a ServerAuthWebAPI instance (put your ServerAuth MySQL data)
$api = new ServerAuthWebAPI("host", 3306, "username", "password", "serverauth", "srvauth_");
var_dump($api->isPlayerRegistered($player));
?>
Description:
Success
Value:
1
Description:
Outdated ServerAuthWebAPI error
Value:
2
Description:
Outdated ServerAuth plugin error
Value:
3
Description:
MySQL error
Value:
4
function __construct($host, $port, $username, $password, $database, $table_prefix)
Parameters:
$host MySQL database host
$port MySQL database port (default 3306)
$username MySQL database username
$password MySQL database password
$database MySQL ServerAuth database
$table_prefix ServerAuth MySQL database table prefix
Description:
Initialize a new ServerAuth Web API instance
int getStatus()
Description:
Initialize a new ServerAuth Web API instance
Return:
int SUCCESS, ERR_OUTDATED_WEBAPI, ERR_OUTDATED_PLUGIN or ERR_MYSQL
ServerAuth
ServerAuth Web API
ServerAuth Account Manager