Events

Events are the most configurable set of content objects in UserWise. These are 100% created by your developers and are identified by the external_event_type that is returned. This will match the framework event type in the UI:

In UserWise’s SDK we give you three Events you can listen to:

public event EventHandler OnLoaded

  • This event is triggered when the UserWise SDK has finished loading and the response from UserWise has returned. This will include all events that are currently available and upcoming for this player.

    • Typically this is not used unless you have some logic where say 4 of the same external_event_type will be returned for the player and you need to randomly choose which to give the player.

public event EventHandler OnActive

  • This event is triggered for each event once it has loaded and is now active. For example, if the UserWise SDK returned an upcoming event starts in 5 minutes, it would not call OnActive until 5 minutes has passed and that event should now be active (e.g. a new daily quest).

    • Typically when this is called you’ll switch on the external_event_type and handle it with some appropriate logic to turn this on. E.g. here is the experience_per_level for this player and their gold_multipler

public event EventHandler OnInactive

  • Very similar to above this method triggers when an event is no longer active - perhaps a quest, challenge, or battle pass ended and should no longer apply for a player.

Setting up Event Listeners

In our initial setup script we can add this in

EventsModule eventsModule = this.userwise.EventsModule; eventsModule.OnLoaded += GameEventHandler.OnLoaded; eventsModule.OnActive += GameEventHandler.OnActive; eventsModule.OnInactive += GameEventHandler.OnInactive;

You can see an example of this here.

Powered by UserWise