GS2-Schedule
Provides functionality to manage schedules for in-game events and similar activities.
This microservice does not function independently; it is intended to be used in conjunction with other microservices.
There are two types of event duration periods. The first is an “absolute period,” where all players share the same duration. The second is a “relative period,” where the duration differs for each player.
Absolute Duration
This duration type is used for cases like “Hosting a New Year’s event from January 1st to January 3rd.”
Relative Duration
This duration type is used for cases where the event period differs per player, such as “One week from game start” or “24 hours after defeating a boss for the first time.”
To implement relative periods, there is a mechanism called “Triggers.” After executing a trigger, the specified duration (ttl) is treated as the event’s active period.
Types of Trigger Activation Methods
When activating a trigger, there are multiple methods for specifying the event period if the trigger is already active.
- Restart the trigger (renew)
- Extend the trigger (extend)
- Do nothing (drop)
- Expires at the event’s repeat cycle end date/time (repeatCycleEnd)
- Expires at the next repeat cycle start date/time (repeatCycleNextStart)
- Expires at the absolute duration event’s end date/time (absoluteEnd)
repeatCycleEnd / repeatCycleNextStart / absoluteEnd are methods that automatically adjust the expiration date based on the event’s repeat settings or absolute duration.
If a trigger is pulled at 00:00 on January 1, 2020 and a 7-day relative duration event is started, when the trigger is pulled again at 00:00 on January 3, 2020, each action will be as follows.
| Method | Event End Date and Time | |
|---|---|---|
| renew | January 10, 2020 00:00 | Add 7 days at the time of trigger activation January 3, 2020 00:00 |
| extend | January 14, 2020 00:00 | Expiration date of already existing triggers 7 days added on January 7, 2020 00:00 |
| drop | January 7, 2020 00:00 |
Repeat Settings
To enable specific days of the week or time periods within an event period, you can define daily, weekly, monthly, or custom cycle repeats using RepeatSetting.
Master Data Management
Registering master data allows you to configure data and behaviors available to microservices.
Master data types include the following:
EventMaster: Event duration and repeat settings
Master data can be registered via the Management Console. Additionally, you can set up workflows to reflect data from GitHub or register via CI using GS2-Deploy.
Example implementation
Trigger Pulling
Triggering is intentionally not handled by the game engine SDK.
Please implement it in the GS2 account creation script or as a reward for completing the GS2 quest.
Obtaining a list of current events
var items = await gs2.Schedule.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).EventsAsync(
).ToListAsync(); const auto Domain = Gs2->Schedule->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
);
const auto It = Domain->Events(
);
TArray<Gs2::UE5::Schedule::Model::FEzEventPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}