Rigel Kentaurus
Well-known member
Today I was working on implementing new Trophy rules (for example, time the user spends browsing in the forum, has replied (a lot) to a single thread, thropies based off forumid, logging in 3 days in a row at midnight .., lots of goodies.
I added the trophy to the trophies table, with a different criteria. Problem is, since my criteria is a non-understood one, now the cron jobs picks it up and approves the trophy. I guess when the rule is not matched in the switch case, it just falls back to "return true" meaning "match".
I suggest something like this on Criteria.php
With the current implementation, if the criterion does not match any known rule, it defaults to true, which means the trophy is awarded. I do not want that, my impression is that if the cron jobs encounters an unknown rule it most likely mean it is used by other addon and it should ignore that trophy since it doesn't know how to interpret that.
I added the trophy to the trophies table, with a different criteria. Problem is, since my criteria is a non-understood one, now the cron jobs picks it up and approves the trophy. I guess when the rule is not matched in the switch case, it just falls back to "return true" meaning "match".
I suggest something like this on Criteria.php
Code:
switch ($criterion['rule'])
{
....
default:
return false;
}