Page 1 of 1

[Solved] Bug ? Wrong server joined

Posted: 07 Sep 2016, 16:54
by BusardCendre
Hi all,
I'm actually playing with manialink and maniascript to build a VioK's servers infos page and I found something really strange :

with this code :

Code: Select all

foreach (Event in PendingEvents) {
  if (Event.Type == CMlEvent::Type::MouseClick) {
    foreach (ServerId in G_ServersNames) {
      if (Event.Control.DataAttributeGet("servername") == ServerId) {
        log(ServerId);
        declare ServerLink = "maniaplanet://#join="^ServerId^"@"^C_InfosServers[ServerId][1];
        log (ServerLink);
        OpenLink(ServerLink, CMlScript::LinkType::Goto);
      }
    }
  }
}
this is the way I found to change the "manialink attribute" of a label ;-)

the 2 logs with my code are :
ServerId : ValleyVioK
ServerLink : maniaplanet://#join=ValleyVioK@TMValley

But then the game brings me to the server "Refuel VioK" which login is MicromachineValleyVioK and played on the title pack Trackmania_2@nadeolabs
If I write maniaplanet://#join=ValleyVioK@TMValley in the game browser, i'm redirected to the wrong server too !
:roflol:

thanks for help =)

Re: Bug ? Wrong server joined

Posted: 19 Sep 2016, 17:14
by BusardCendre
As it is possible to join our Valley server from multiplayer section of Valley title pack,
I suppose Nadeo wrote the code to join server in another way than what I did ...

could you please tell how you wrote it ? ;)

Re: Bug ? Wrong server joined

Posted: 20 Sep 2016, 09:01
by noyranea
Hi there!

I tried joining your server with both a Manialink and the Maniaplanet browser, and I managed to reach the good server in both cases.
The join code you wrote seems fine. The join url "maniaplanet://#join=ValleyVioK@TMValley" joins the ValleyVioK server, and the following script code

Code: Select all

OpenLink("maniaplanet://#join=ValleyVioK@TMValley", CMlScript::LinkType::Goto);
joins the server as well.

My guess would be that something in your ManiaScript code messed your servernames up, but I can't be quite sure. I suggest you check your script for any errors, and come back here if the situation is still a mystery to you.

Have a nice day,

-- noyranea

Re: Bug ? Wrong server joined

Posted: 20 Sep 2016, 19:49
by BusardCendre
thank you for the time you took to test it =)

It's ok I found my mistake ...

in fact, for my first tests, I used only two servers from Canyon title pack, so I wrote :

Code: Select all

declare ServerLink = "maniaplanet://#join="^ServerId^"@TMCanyon";
and I hadn't change it when I added some severs from other title packs :oops:
I had found my mistake before asking here,
but I hadn't saved my file with correction ...
the problem was :
if you try in game browser : maniaplanet://#join=ValleyVioK@TMCanyon
then you're redirected to RefuelVioK which is on TrackMania_2 ...
but once @TMCCanyon has been tried, then using @TMValley doesn't change things
and we're still going to RefuelVioK
I just tried it, I had to relaunch the game to make it work