EventSettings
IEventSettings
IEventSettings
is a globally accessible object that provides Milestone
Reward
mapping capabilities for an IEventContent
. Each IEventContent
requires a corresponding IEventSettings
object. The IEventService
collects and uses these objects to manage reward claiming across different Contents
.
Important
The IEventSettings
must always be loaded so that it is globally accessible from all Contents
. Using this smaller subset of data allows you to safely unload IEventContent
when the player is in a different content while still supporting reward claiming and event displays.
Event Duration
All the data for the EventSettings
entities is defined in the events.EventSettingsData
sheet in the GLOBAL
machine readable sheet.
The duration of each event is defined by the lengths of its phases. An event normally consists of 2 phases: an announcement phase and the main phase.
The first announcement phase is to be used for advertising an upcoming event to the player. IdleKit will not allow the player to enter the event during its first phase. The second main phase is to be used for the actual event. During this phase the player can enter the event.
The phase durations are defined in the Phases
property of the EventSettingsData
.
Event leaderboard rank rewards
The rank rewards for players participating in an event are defined in the RankRewards
property in the EventSettingsData
. Each rank reward contains a min and a max rank for which they are granted. The min and max values can have overlapping values on several rewards, so a player that finishes the event with a rank of 3 would get both of the following rewards if their min and max ranks were defined like so:
Rank 1: Min 1 - Max 3 Rank 2: Min 3 - Max 7
An additional property that defines what IReward
the player would receive for finishing the event within the confines of the defined rank. The ranks and rewards are associated with each other in order. Which means an entry from EventSettingsData.RankRewards
at index 0 would correspond to an entry from EventSettingsData.RankRewardDataIds
at index 0.
You can use the ClaimRankRewards(...)
method within the IEventLeaderboardsService
to claim the leaderboard rank rewards the player has earned in an event.
Note
Any data that is not exposed in the EventSettingsData
can be retrieved by using the Beamable.EventsService
Beamable-specific service and its method GetCurrent()
.
Relationships
-
IEventSettings
- This interface defines methods to use for completingIMilestone
objects, claimingIReward
objects as well as properties forIEventSettingsData
andIEventSettingsSavedData
. -
IEventSettingsData
- This interface defines a list ofMilestoneRewardPair
objects, aneventContentId
which refers to its associatedIEventContent
, auniqueEventContentId
which is this event's unique id, an associatedIContent
where rewards can be claimed, and a method to return the mappedIReward
of anIMilestone
. -
IEventSettingsSavedData
- This interface defines properties to serialize completedIMilestone
ids and track if rewards have been claimed. It also contains information on all themilestones
completion time and whether it has been actually completed or not inMilestoneCompletionInfo
.
See EventContent for more information on the rest of this diagram.
Note
The Projection Service documentation contains information on how we calculate an estimation to the completion time of an IMilestone
that is then stored in the MilestoneCompletionInfo
.
How do I?...
Display a time until the event starts/ends in ui?
Each time a new phase of an event starts, the EventSettings
instance for that event subscribes to the ITimerService
for the duration of that phase. This subscription can be used to display the event's length in UI or to display the time until the event starts, by displaying the duration of the first (announcement) phase.