Skip to main content

GameEventLog

The Game Event Log is a data type that records the events of a game by day. It is included in the GameSave data type that is written to the database at the end of the game.

Data Type​

The data type for GameEventLog is defined here, and is reproduced below for convenience:

export type GameEventLog = {
[day: number]: {
deathReveals: number[]
accusedPlayers: {
[playerNum: number]: {
accusedPlayerNum: number
accusers: number[]
judgementVotes: {
[playerNum: number]: JudgementVote | undefined
}
result: JudgementVote
}
}
nightActions: {
[playerNum: number]: {
target: number | undefined
feedback: { success: boolean; message: string }
}
}
}
}

Sample Data​

{
"1": {
"nightActions": {
"2": {
"feedback": {
"message": "You stayed home last night.",
"success": true
}
},
"3": {
"feedback": {
"message": "You successfully hacked 1 of Sheri [1]'s visitors last night.",
"success": true
},
"target": 1
},
"4": {
"feedback": {
"message": "You attacked Sheri [1] last night.",
"success": true
},
"target": 1
},
"5": {
"feedback": {
"message": "You were hacked and could not perform your ability last night.",
"success": false
},
"target": 1
},
"6": {
"feedback": {
"message": "You protected Eadie [4] last night, but they were not attacked.",
"success": false
},
"target": 4
}
}
},
"2": {
"accusedPlayers": {
"6": {
"accusedPlayerNum": 6,
"judgementVotes": {
"2": "pardon",
"3": "execute",
"5": "execute"
},
"result": "execute"
}
},
"deathReveals": {
"0": 1
},
"nightActions": {
"3": {
"feedback": {
"message": "You successfully hacked 1 of Jaquenette [2]'s visitors last night.",
"success": true
},
"target": 2
},
"4": {
"feedback": {
"message": "You attacked Jaquenette [2] last night.",
"success": true
},
"target": 2
},
"5": {
"feedback": {
"message": "You were hacked and could not perform your ability last night.",
"success": false
},
"target": 2
}
}
},
"3": {
"accusedPlayers": {
"5": {
"accusedPlayerNum": 5,
"judgementVotes": {
"3": "execute",
"4": "execute"
},
"result": "execute"
}
},
"deathReveals": {
"0": 2
}
}
}