Flash SDK error in code when retrieving scorelist

Hi

I found an error in your code inside the function “advancedScoreListCustom” in IDNET.as:
Sorry I had to decompile your idnet-client.swf… it was always returning an error:
IDNET: Error mode is incorrect

if(!(param2 == “alltime”) || !(param2 == “last30days”) || !(param2 == “last7days”) || !(param2 == “today”) || !(param2 == “newest”))
{
this.log(“IDNET: Error mode is incorrect”);
return false;
}

!true returns false and !false returns true.
So when param2 == “alltime”, it will return true on all the cases when param2 != “alltime”. The proper way would be if ( param2 != “alltime” || param2 !=… )

Hi,

Decompiling is against the terms of service agreement and is generally bad etiquette within the Flash community.

That said, the actual code looks correct.

if(mode != 'alltime' || mode != 'last30days' || mode !...

What you see is a consequence of the decompiling program trying to reverse engineer the code.

Hi,

I understand your concerns regarding the decompiling.

The reason I did it is because I keep having (and still do) the “IDNET: Error mode is incorrect” while calling “advancedScoreListCustom” with the “alltime” mode value.

Maybe I’m doing something wrong but by actually checking the code of your sdk, I managed to make it work by using the code that you’re using inside your advancedScoreListCustom function.

I can only conclude that the mode check is where it bugs.

Also, there is something that really bugs me: it’s the fact that one needs to get the data from the idnet.data property and not, for example, a callback that we give to the function, or an event that not only has the received data but also a copy of the data that were sent.
In some cases, it can be impossible to know which data originates from which call… take the advancedScoreListCustom function called multiple times in a row with a different mode for example (I’m caching the results internally, that’s why I’m retrieving all of the data once). When receiving the data, I have no information from which call, and thus which mode, the data comes from…

If that change could be made, that would be super awesome.

Thanks for your time.

Hi,

Thanks for reporting on the mode issue. I removed the mode check as it was not needed. It will default to ‘alltime’ if null or an incorrect mode is given.

I can make the API send back which mode was used, is that what you’re are after? For now everything is using events to maintain parity with AS2 which doesn’t handle JS style callbacks very well.

Thank you and cheers

yes if you can return the mode as well that would be great !
thx !

Try it now, mode should be sent. :rabbit:

yep, it’s good, thanks

Y8 Games