Advanced

Re: Callback changes

Callback changes
June 14, 2021 09:58AM
A few changes will be made today, or possibly tomorrow.
  • Method GetBadgeGenData() uses BadgeGen v3 (this is not a change)
  • Method GetBadgeGenDataV4() will be added.
  • A method to get the furthest find will be made available. The distance from home will also be returned, but with a lower precision (like rounded km). This is to protect the privacy of the user. Generally checkers using this method should be careful with what information they hand out. All tags on this script could probably use the new method instead.
Re: Callback changes
June 14, 2021 10:50AM
Method GetFurthestFound() added. Doxygen is updated. Generally it should be enough to use it with the profileId as the first parameter only.
Re: Callback changes
June 14, 2021 12:54PM
For the script you mentioned https://project-gc.com/Tools/Challenges?edit&addTag&scriptId=1305 , I could create the new script then you could transfer the code over, if this is needed.
Also, I assume it excludes travelling caches?



Edited 1 time(s). Last edit at 06/14/2021 12:55PM by DrAcorn. (view changes)
Re: Callback changes
June 14, 2021 12:59PM
I can transfer tags if needed. I can also update the config of the tags if needed.

This is what the Doxygen documentation says:
/// @brief Get the furthest found from home.
///
/// If the user doesn't have home coordinates a value of FALSE will be returned.
/// @param[in] int $profileId An integer with the users profile id.
/// @param[in] array $params An optional associative array of options for filtering/sorting/limit.
/// - types (array): An array of valid cache types (defaults to all).
/// - excludeTypes (array): An array of invalid cache types (defaults to [Locationless (Reverse) Cache], set to [] to include all).
/// - excludeTraveling (bool): Defaults to true. Ignore geocaches listed in http://www.geocaching.com/bookmarks/view.aspx?code=BM1A6W6 .
/// @returns associative array with the following fields: gccode, distance (km), visitdate

So yes, by default it excludes traveling. It also excludes locationless by default (via excludeTypes). These two defaults should make it default in the same way as the badgegen-hack did.
Re: Callback changes
June 14, 2021 01:23PM
sorry - obviously didn't reload the page to see this addition!

The new script https://project-gc.com/Tools/Challenges?edit&tagId=61454 should be working now, the type filter isn't added yet but I'll do this later as no existing tags use it.

I rounded down the user's furthest distance to the nearest 100km to protect privacy for now, and didnt display any gc-codes.



Edited 1 time(s). Last edit at 06/14/2021 01:25PM by DrAcorn. (view changes)
Re: Callback changes
June 14, 2021 01:29PM
@DrAcorn Thanks.

And while at it, also a big thank you for all your Wiki-edits.

I don't think there is a reason to overdo your script and add type support. These challenges aren't allowed to be created. They are actually against multiple rules, yet there has been a handful published the last years.

I will transfer all tags listed at https://project-gc.com/Tools/Challenges?edit&addTag&scriptId=1305 during the day.
From script 1305 to script 7812 (note to self).
Re: Callback changes
June 14, 2021 01:33PM
No problem! I had only thought to add the types in case there was a small chance of any legacy caches that would benefit, I can always easily do this if it is really necessary.
Re: Callback changes
June 14, 2021 01:39PM
Tags has been transferred. I tested one, it seemed to work. I didn't really read the output to be honest, I trust in you, after all it doesn't seem like the most complex checker in the system. :)
Re: Callback changes
June 14, 2021 01:14PM
That badge script should probably be left alone, since it was for challenges for badges v3. Changing the script would change the challenges. Badges v4 was coded by myself from scratch not using the PGC.GetBadgeGenData() call, since reviewers didn't accept challenges based on that function given rule 4. Subsequently they now don't accept any new badge related challenges, so the new method is probably moot?
Re: Callback changes
June 14, 2021 01:16PM
You are probably correct that there is no need for the new method. But in my end it was just to add another method, use the same code as before, but include the badgegen-v4-include file instead of the old one.

It didn't even take me five minutes to create that method. That's why I did it now when I had the whole badgegen-thing in my mind.
Re: Callback changes
June 21, 2021 09:02PM
https://project-gc.com/qa/?qa=27313/checker-for-badgegen-belt-fails
Might this be because of the changes? The function seems not to work.
Re: Callback changes
June 22, 2021 05:25AM
Yes, due to a spelling error. There is also a related issue from updating our polygon system.

I won't be able to release a fix until next week.
Sorry, you do not have permission to post/reply in this forum.