https://metaplay.io logo
Issue with leagues end season from dashboard + cla...
# questions-and-feedback
j
Hi! 1. I happened to find a pretty rare edge case with the leagues feature that is reproducible at least in local environment but I guess it could happen in other environments as well. SDK version: 32.3 Issue: DivisionActorBase ConcludeSeason that handles participants rewarding might not get called at all Reproduce steps: This is a pretty tricky one but I was somewhat able to reproduce this reliably multiple times by first shutting down player's session linked to a division (only session alive), waiting 5-8 seconds and then ending the season in the dashboard and then within few seconds starting a new session with that player. Possible fix: In DivisionActorBase line 204 simply change if (MetaTime.Now > concludeTime) -> if (MetaTime.Now >= concludeTime). ScheduleOrDoConclude seemed to be called reliably even when the bug happened 2. Not sure if I missed something but it seems like by default when a league season is concluded players are only able to claim the rewards after starting a new season. In our case we send rewards as mail to player. To "fix" this behavior I had to touch a little bit in the actual SDK behavior, wondering if any of these additions would make sense to add SDK itself. Changes: - I overwrote ConcludeSeason in my own DivisionActor to send info to all session player actors about season being concluded. I noticed there's a similar commented line in the virtual method so perhaps this could be added there (but personally I'm fine with overwriting). In PlayerActor I handle that message by calling TryFinalizeCurrentLeagueDivision - Then the actual SDK change I did: As TryFinalizeCurrentLeagueDivision calls PlayerAddHistoricalDivisionEntry I needed to return the info back to player actor that a new entry has been added. So I added a new method to PlayerModelServerListenerCore (OnNewPlayerDivisionHistoryEntryAvailable) and call that from PlayerAddHistoricalDivisionEntry action so I can then send mail to a live player including the league rewards.
n
Hi, 1 seems interesting. Are you sure the conclude was not called, or just that the player didn't fetch the rewards on session start? By default, if the division actor is awake when the season concludes, there is a randomized 0-30s delay before the division actually concludes itself to avoid every division hitting the database and pinging players at the same time. The above could be the reason why the player doesn't get the rewards immediately, but they should receive them if they log in again. The SDK, by default, doesn't message the player actor when a division concludes, so the rewards are only fetched when the player logs in, or if the actor calls the TryFinalizeCurrentDivision on the game side. This will probably change for R34, where the SDK would initiate the finalization automatically during a session, and we could add a server listener hook for it too. I'll try to repro 1. tomorrow myself, but let me know if you have any more info on it.