SDK V1.0

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

User avatar
gouxim
Nadeo
Nadeo
Posts: 1188
Joined: 14 Jun 2010, 17:20

SDK V1.0

Post by gouxim »

Hey fellow coders,

We are releasing the 1.0 release of the SDK today. We fixed some bugs, we plugged new services, we updated the documentation. From now on, all the documentation will be on the Wiki of the google code project, and we'll use the forum for feedback, help and various discussions.

It all takes place here: http://code.google.com/p/maniaplanet-ws-sdk/

Have fun! :yes:
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
TheM
Posts: 1446
Joined: 15 Jun 2010, 14:30
Location: Uden, Noord-Brabant, Netherlands
Contact:

Re: SDK V1.0

Post by TheM »

Ah, nice a new version! :)
But: I don't see a possibility to authenticate a server... is there any?
Because that would be very easy for sites like Dedimania.
Global moderator | Dutch moderator | Laddermoderator | ManiaWiki moderator
Server Manager/webmaster of Smurfen.net, join us on Canyon, Valley and Royal!
ESL (Game) Staff Head for TrackMania (Stadium, Canyon and Valley).
User avatar
Slig
Posts: 640
Joined: 15 Jun 2010, 11:52
Location: TraXicoLand

Re: SDK V1.0

Post by Slig »

nice ! :thumbsup:
User avatar
gouxim
Nadeo
Nadeo
Posts: 1188
Joined: 14 Jun 2010, 17:20

Re: SDK V1.0

Post by gouxim »

TheM wrote:But: I don't see a possibility to authenticate a server... is there any?
Nop, it's not possible to authenticate a dedicated server.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
jonthekiller
Translator
Translator
Posts: 4702
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Re: SDK V1.0

Post by jonthekiller »

I have try to use the ManiaConnect and I have found a problem.

When I click on Authentificate, I have undefined parameter and the problem is the script doesn't add & ( maybe the script add a simple & ) between each parameters.

It's weird, I have an error on the line with the button for connect

Code: Select all

<label posn="-8 -27 2" style="CardButtonMedium" text="Authentificate" manialink="<?php echo $loginURL.'&page=home'; ?>"/>
5 minutes before it worked but now not.
Image
User avatar
TStarGermany
Posts: 470
Joined: 15 Jun 2010, 11:05
Contact:

Re: SDK V1.0

Post by TStarGermany »

Oumpf.. i'm running php5.3 only as CGI, of course some restrictions apply, I'll try to test useability as soon as I've got time.
User avatar
gouxim
Nadeo
Nadeo
Posts: 1188
Joined: 14 Jun 2010, 17:20

Re: SDK V1.0

Post by gouxim »

jonthekiller wrote:I have try to use the ManiaConnect and I have found a problem.

When I click on Authentificate, I have undefined parameter and the problem is the script doesn't add & ( maybe the script add a simple & ) between each parameters.

It's weird, I have an error on the line with the button for connect

Code: Select all

<label posn="-8 -27 2" style="CardButtonMedium" text="Authentificate" manialink="<?php echo $loginURL.'&page=home'; ?>"/>
5 minutes before it worked but now not.
I'm not sure about you're error, but in any case loginURL is not XML-encoded so you need to encode it first:

Code: Select all

manialink="<?php echo htmlentities($loginURL) ?>"
I see that you append a query string parameter to the login URL. That won't work. What you need to do is specify the redirect URI you want in the getLoginURL() method: http://code.google.com/p/maniaplanet-ws ... ent.php#64

Basically the player will click on the button, get the permission page, and then be redirected to the URI you passed to that method. If you pass null (the default value), it uses the current URI.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
jonthekiller
Translator
Translator
Posts: 4702
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Re: SDK V1.0

Post by jonthekiller »

I have a weird error on internet but works on ManiaPlanet but not when I click on Authentificate : http://www.bczteam.com/~jonthekiller/Ma ... alotto.php

Code: Select all

XML Parsing Error: not well-formed
Location: http://www.bczteam.com/~jonthekiller/Manialinks/loto/manialotto.php
Line Number 1, Column 63:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>object(stdClass)#2 (5) {
--------------------------------------------------------------^

Here is the code of my file

Code: Select all

<?php header('Content-Type: text/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>';

require_once 'libraries/autoload.php';

define('API_USERNAME', 'jonthekiller|lottomania');
define('API_PASSWORD', '*****');
define('SCOPE', 'basic');

$maniaconnect = new \Maniaplanet\WebServices\ManiaConnect\Player(API_USERNAME, API_PASSWORD);
$player = $maniaconnect->getPlayer();

$date = date('d M Y H:i:s');

if($player){

    $infos = $maniaconnect->getPlayer();
    var_dump($player, $infos);
	
	if (isset($_REQUEST['maniacode'])){
		include "manialotto_".$_GET['page'].".php";
	}
	else
	{
		?>
		<manialink>
		<include url="./langue.xml" />
		<timeout>0</timeout>
		<type>default</type> 
		<frame>
		<quad posn="-64 48 -10" sizen="128 96" image="http://www.bczteam.com/~jonthekiller/Manialinks/loto/fond/Lottomania.jpg"/>


		<?
		if (isset($_REQUEST['page'])){
			include "manialotto_".$_GET['page'].".php";
		}else{
			include "manialotto_home.php";
		}
		include 'manialotto_config.php';
		include 'manialotto_menu.php';
	}
}
else
{
$loginURL = $maniaconnect->getLoginURL(SCOPE);
	?>

	<manialink>
	<include url="./langue.xml" />
	<timeout>0</timeout>
	<type>default</type> 
	<frame>
	<quad posn="-64 48 -10" sizen="128 96" image="http://www.bczteam.com/~jonthekiller/Manialinks/loto/fond/Connexion.jpg"/>
	<label posn="-8 -27 2" style="CardButtonMedium" text="Authentificate" manialink="<?php echo htmlentities($loginURL); ?>"/>

	<label posn="44 -46 1" sizen="20 2" style="TextRaceValueSmall" text="$000<?php echo $date; ?> CEST" manialink="lottomania"/>

	<frame posn="-10 -43 -1">
	<include url="http://maniahome.maniaplanet.com/add/?url=lottery&name=%24FFFlotto%24000mania&version=0"/>
	</frame>
	</frame>
	</manialink>  
	<?
}
?>
I have put on RedirectionURI : http://www.bczteam.com/~jonthekiller/Ma ... alotto.php


The manialink is "Lottery".
Image
User avatar
gouxim
Nadeo
Nadeo
Posts: 1188
Joined: 14 Jun 2010, 17:20

Re: SDK V1.0

Post by gouxim »

Code: Select all

...


if($player){

    $infos = $maniaconnect->getPlayer();
    var_dump($player, $infos);

....
var_dump() dumps the given variable in HTML code. http://fr2.php.net/manual/en/function.var-dump.php You should remove that line.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
jonthekiller
Translator
Translator
Posts: 4702
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Re: SDK V1.0

Post by jonthekiller »

Good, it works fine :thumbsup:
Image
Locked

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 0 guests