Different NBLAPS values..xaseco, plugin, or map issue?

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
malonn
pedestrian
pedestrian
Posts: 5
Joined: 01 Dec 2015 20:45
Owned TM-games: TMU, TM2

Different NBLAPS values..xaseco, plugin, or map issue?

Post by malonn » 02 Dec 2015 00:15

So I'm using R-AutoLaps plugin to adjust laps accordingly.

But there's some maps where the <header> displays nblaps="x" but R-AutoLaps retrieves it as nblaps="y"

Why is this happening? is it a problem with xaseco? the plugin?

Is it even possible to change NBLAPS?

Here's an example map:
http://tmnforever.tm-exchange.com/main. ... &id=340195

The plugin retrieves NBLAPS=1, but the header says NBLAPS=2. I don't even know where it gets 1 from. nblaps=1 doesn't even show up in a hexeditor.

Xymph
Pit Crew
Pit Crew
Posts: 5685
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Different NBLAPS values..xaseco, plugin, or map issue?

Post by Xymph » 02 Dec 2015 08:11

malonn wrote:So I'm using R-AutoLaps plugin to adjust laps accordingly.

But there's some maps where the <header> displays nblaps="x" but R-AutoLaps retrieves it as nblaps="y"

Why is this happening? is it a problem with xaseco? the plugin?
Don't know, would need more debugging.
malonn wrote: Here's an example map:
http://tmnforever.tm-exchange.com/main. ... &id=340195

The plugin retrieves NBLAPS=1, but the header says NBLAPS=2. I don't even know where it gets 1 from. nblaps=1 doesn't even show up in a hexeditor.
Don't use a hex editor when better tools are available. nblaps is indeed 2:

Code: Select all

$ extractgbxdata.php 500cc_Simple_and_Fun.Challenge.Gbx 
UId     : 8aOmbWq_EJqLqbKVz4hmDsM5lP6
HdrVersn: 6
Name    : $n$f80500cc $zSimple and Fun
   strip: 500cc Simple and Fun
AuthLogn: ben75
Type    : 0  Race
Kind    : 8  Multi
Multilap: Yes
Editor  : Advanced
GhostBks: No
NbChecks: 0
NbLaps  : 2
Lightmap: 0
Environ.: Stadium
Mood    : Sunset
Envir.BG: Stadium
AuthorBG: Nadeo
AuthorTm:  27020    0:27.02
Gold  Tm:  29000    0:29.00
SilverTm:  33000    0:33.00
BronzeTm:  41000    0:41.00
Cost    : 500
AuthScor: 27020
Password: 
Thumblen: 5149
Comment : $wHave fun! :)

XML     :
<header type="challenge" version="TMc.6" exever="2.11.13">
<ident uid="8aOmbWq_EJqLqbKVz4hmDsM5lP6" name="$n$f80500cc $zSimple and Fun" author="ben75"/>
<desc envir="Stadium" mood="Sunset" type="Race" nblaps="2" price="500" />
<times bronze="41000" silver="33000" gold="29000" authortime="27020" authorscore="27020"/>
<deps>
<dep file="Skins\Any\Advertisement\SignRight.bik"/>
</deps>
</header>
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

malonn
pedestrian
pedestrian
Posts: 5
Joined: 01 Dec 2015 20:45
Owned TM-games: TMU, TM2

Re: Different NBLAPS values..xaseco, plugin, or map issue?

Post by malonn » 02 Dec 2015 19:55

Okay I had a good idea how to debug it today, and I'm a little farther, I think it's a problem with the map, so I will continue to use that as an example.

Code: Select all

$gbx = new GBXChallengeFetcher($aseco->server->trackdir.$filename, false);
if($gbx->nblaps <= 1){ $gbx->nblaps = 1;}
This is the part that causing the issue. For that map, nblaps is initially being returned as zero, then obviously gets set to 1. Header says 2, map says 0, plugin sets it to 1.

So now my question becomes: How does this happen to a map? How can the header give one value and yet trackmania internally reads it as a different value? Is it map corruption?

Edit:
This was my debug code...

Code: Select all

$gbx = new GBXChallengeFetcher($aseco->server->trackdir.$filename, false);
$chat = 'nblaps for next map is '.$gbx->nblaps;
$aseco->client->query('ChatSendServerMessage', $chat); //prints 0
if($gbx->nblaps <= 1){ $gbx->nblaps = 1;}
$aseco->client->query('ChatSendServerMessage', $chat); //prints 1

malonn
pedestrian
pedestrian
Posts: 5
Joined: 01 Dec 2015 20:45
Owned TM-games: TMU, TM2

Re: Different NBLAPS values..xaseco, plugin, or map issue?

Post by malonn » 02 Dec 2015 20:31

Jesus God, why didn't I think of this before...I'm just going to edit the plugin to use an xml file where you can store custom NBLAPS if needed...MUCH EASIER !

malonn
pedestrian
pedestrian
Posts: 5
Joined: 01 Dec 2015 20:45
Owned TM-games: TMU, TM2

Re: Different NBLAPS values..xaseco, plugin, or map issue?

Post by malonn » 02 Dec 2015 23:15

Okay, so I finished updating the plugin to support custom nblaps, but I can't get ANY info on that map, no UID, no NBLAPS, everything is returned as empty.

I would hugely appreciate someone verifying this for me, because I'm pretty sure that xaseco is failing to parse the map, even though GBXDump can.

Should I make a new post about this? If no one responds to this, I will.

Xymph
Pit Crew
Pit Crew
Posts: 5685
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Different NBLAPS values..xaseco, plugin, or map issue?

Post by Xymph » 03 Dec 2015 19:33

One thread is enough.
As a side note: If you intend to release your custom change to the plugin, you should contact its author RamCUP2000 to see if it can be officially incorporated, or whether he objects to you releasing it, under the same name or another.

W.r.t. the GBX data, which versions of XAseco and the gbxdatafetcher.inc.php module are used?
More debugging means to check what exactly goes into the GBXChallengeFetcher call, and what comes out. And use logging statements with print_r, not ChatSendServerMessage. If RamCUP2000 doesn't chime in here, you could also contact him for support.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

User avatar
Electron
cyclist
cyclist
Posts: 38
Joined: 25 Jun 2010 18:20
Owned TM-games: TMUF, TM2
Manialink(s): GbxDump
Contact:

Re: Different NBLAPS values..xaseco, plugin, or map issue?

Post by Electron » 04 Dec 2015 21:24

malonn wrote:

Code: Select all

$gbx = new GBXChallengeFetcher($aseco->server->trackdir.$filename, false);
if($gbx->nblaps <= 1){ $gbx->nblaps = 1;}
This is the part that causing the issue. For that map, nblaps is initially being returned as zero
GBXChallengeFetcher::nblaps is only set if the xml parser is activated using the second parameter.
Because the second parameter is set to "false", $gbx->nblaps returns the default initial value 0.
malonn wrote:, then obviously gets set to 1.
This was done in order to avoid division by zero in the next line.

Try to activate the XML parser:

Code: Select all

$gbx = new GBXChallengeFetcher($aseco->server->trackdir.$filename, true);
Image

User avatar
RamCUP2000
road tourist
road tourist
Posts: 105
Joined: 01 Apr 2009 17:43
Owned TM-games: MP, TMU(F), TMS, TMO
Manialink(s): usdmania
Location: Czech republic » Jihomoravský kraj » Břeclav
Contact:

Re: Different NBLAPS values..xaseco, plugin, or map issue?

Post by RamCUP2000 » 07 Dec 2015 15:46

fixed in my plugins :) THANKS !
Image
Czech ManiaPlanet Moderator
TrackMania player since Q2 2004 (TrackMania v1.2.5)

Post Reply