GS2-Schedule

Event scheduling function

It provides the ability to manage schedules for in-game events and other events.

This microservice can do almost nothing on its own, and must be used in conjunction with other microservices.

There are two main types of event periods. The first is the “absolute period”, where all players have the same period, and the second is the “relative period”, where each player has a different period.

Absolute period

This type of period can be used in cases such as “New Year’s event will be held from January 1 to January 3.”

Relative period

“Relative period” can be used in cases where the duration of the event is different from player to player, such as “1 week from the start of the game” or “24 hours after the first boss is defeated”.

There is a “trigger” mechanism to achieve relative periods. The specified period after the trigger is pulled is processed as the event period.

Types of triggers to pull

When a trigger is pulled, there are three types of trigger behavior when a trigger has already been pulled.

  • Add a time period (add)
  • Re-trigger (renew)
  • Do nothing (drop)

In the situation where the trigger was pulled at 2020-01-01 00:00 and a 7-day relative event was started The following is an explanation of each behavior when the trigger is retriggered at 2020-01-03 00:00.

MethodEvent End Date
add2020-01-14 00:00
renew2020-01-10 00:00
drop2020-01-07 00:00

Example implementation

Trigger Pulling

Triggering cannot be 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(
    );
    for (auto Item : *It)
    {

    }

Detailed reference