Touranment ts definition question

export interface Tournament {
        id: string;
        title: string;
        description: string;
        category: number;
        sortOrder: number;
        size: number;
        maxSize: number;
        maxNumScore: number;
        duration: number;
        startActive: number;
        endActive: number;
        canEnter: boolean;
        nextReset: string;
        metadata: {[key: string]: any};
        createTime: number;
        startTime: number;
        endTime: number;

“prevReset”: 1719921600, missing in definition
“nextReset”: 1720008000, should be number

but this is the data we got when we tested tournamentGetIds API, seem like the definition is not matched with data we got, any idea?

btw, may i confirm whether the prevReset should same with startActive after 1 round?

        "id": "TournamentMain_1",
        "category": 1,
        "sortOrder": 1,
        "size": 0,
        "endActive": 1719925200,
        "prevReset": 1719921600,
        "startActive": 1719921600,
        "canEnter": false,
        "createTime": 1719854290,
        "endTime": null,
        "title": "Daily Dash",
        "description": "Dash past your opponents for high scores and big rewards!",
        "duration": 3600,
        "nextReset": 1720008000,
        "metadata": {
          "weatherConditions": "rain"
        "startTime": 1719854290,
        "maxSize": 10000,
        "maxNumScore": 3,
        "operator": "best"

Based on my testing, seems like this should be a bug for ts definition. will submit a pr

Hello @mengxin,

We’ll fix the type mismatches, thank you for reporting. Going forward if you find any more mismatches please consider opening an issue on GitHub - heroiclabs/nakama-common: The runtime framework for Nakama server. directly.

Can you explain what’s the scheduling that you’re trying to achieve?


basically, we want to get the start time of the current round (after reset) from tournament object.

for example:

Tournament start from Today: July 5th Friday 23:59:59, duration 5 days, reset each Thursday 23:59:59

1st round is July 5th 23:59:59 + 5days to July 10th Wed 23:59:59 and reset at July 11th (1 days for display buffer)
2nd round is July 11th 23.59.59 + 5days to July 16th Tuesday 23:59:59 (2 days for display buffer)

we want to get the time like:
July 5th 23:59:59
July 11th 23.59.59
which each round tournament is active to accept score.

i think the prevReset and startActive can be used for this value right?

Yes those values should be updated according to the current tournament cycle.

1 Like