XF 2.1 Freeze User Upgrade ( manage cron job )

Artur1339

Member
Hey,

I am currently integrating Xf with our game server. So I mapped each user upgrade to a feature in our server. For example, when a user wants to access special vehicles he has to purchase a vehicle user upgrade in the forum.
As far as I am aware there is no freeze upgrade option in the sense of I can turn off the user upgrade and while it is turned off the user won't lose any days on his upgrade.
Example:
1. The user buys an upgrade on 01.09 for 30 days so it expires on the 01.10.
2. We notice a bug in the vehicle system and disable this for a week ( We would freeze the upgrade for vehicles )
The user loses 7 days where he can't use the vehicle but the user upgrade is still ticking in Xf.
3. We fixed the issue and turned the upgrade back on
4. Now the user upgrade doesn't expire on the 01.10 but on the 08.10 because it was disabled ( frozen ) for 7 days

So basically whenever a flag is set on the upgrade the remaining time isn't decreased.
As far as this is working at the moment is that we have our own cron job running and incrementing the expiration date by 1 is the upgrade is disabled. But I was wondering if there would be a method to archive this in Xf directly like overriding the cronjob which expires the user upgrades.

Regards Artur
 
So I currently added up creating my own addon and then adding a column ( is_frozen ) to the user upgrade.
But I couldn't find any method override the downgradeExpired cron job by the addon. Or better to say the UserUpgrade::downgradeExpiredUpgrades method so I could do my own checks and see if something happens.
 
Last edited:
Top Bottom