Development

Methods from the dedicated server

To communicate with the dedicated server you can use so called ListMethods, e.g. if you want to know how many Planets the server currently has: GetServerPlanets.

Example: Get the amount of Planets

$aseco->client->resetError();
$aseco->client->query('GetServerPlanets');
if ( !$aseco->client->isError() ) {
	$server_planets = $aseco->client->getResponse();
}
else {
	$aseco->console('Error at ListMethod "GetServerPlanets": ['.
		$aseco->client->getErrorCode() .'] '. $aseco->client->getErrorMessage()
	);
}

Please note, that you do not need to call the GetServerPlanets ListMethod, because the amount of Planets the server currently own is accessible with $aseco->server->amount_planets. See also the documentation of the includes/class/server.class.php.

Available Dedicated Server Methods

For details which Methods are available, visit the Dedicated Server Methods list.

Development

Tips for methods from the dedicated server

While coding my Plugins i have found some things that you may find useful to know before running into the same problems then me.


int Pay(string, int, string)

This method takes three parameters: Login of the payee, Cost in Planets to pay and a Label to send with the payment.

If you want to include a line feed (LF), then you have to mask them with %0A. I assume the length has to be shorter then 256 Signs as at SendBill too.


int SendBill(string, int, string, string)

This method takes four parameters: LoginFrom of the payee, Cost in Planets (TM2) the Player has to pay, Label of the transaction and an optional LoginTo of the payee (if empty string, then the server account is used).

Make sure that Label is shorter then 256 Signs, otherwise the Player will see an transaction failure.

This is a private enthusiast Website. Maniaplanet, Trackmania, Shootmania, Nadeo are trademarks of Ubisoft Entertainment.
Windows is a registered trademark of Microsoft Corporation.

Last modified: Thu, 04 May 2017 22:08:28 +0200