Skip to content

Instantly share code, notes, and snippets.

@danhawkins
Created December 20, 2022 02:51
Show Gist options
  • Save danhawkins/d09ca7a61fcfc9b629a44004be4d5f78 to your computer and use it in GitHub Desktop.
Save danhawkins/d09ca7a61fcfc9b629a44004be4d5f78 to your computer and use it in GitHub Desktop.
Vail Webhook.md

Vail Webhook Ideas

In order to get more insights that can make for more interesting live and post game stats, we would like to get more information from the webhook

Terms

To avoid abigutiy for the sake of these examples

  • Lobby is the a lobby that has been created, regardless of how many maps played until the lobby is closed
  • Map full map played to 11 points
  • Round each 2 minute round played unless one side is wiped out, or the objective is scored
  • Feed each significant event that occurs during a match including, kills, deaths, objectives, disconnects

Desired Webhooks

Feed Webhook

Sent on the occurance of any significant event

// Kill
{
  "timestamp": "2022-12-20T18:00:00Z",
  "lobbyId": "<lobbyId>",
  "eventType": "kill",
  "playerId": "<playerId>",
  "data": {
    "weapon": "ak12",
    "enemy": "<playerId>"
  }
}

// Player left lobby
{
  "timestamp": "2022-12-20T18:00:00Z",
  "lobbyId": "<lobbyId>",
  "eventType": "leftLobby",
  "playerId": "<playerId>"
}

// Player joined lobby
{
  "timestamp": "2022-12-20T18:00:00Z",
  "lobbyId": "<lobbyId>",
  "eventType": "joinedLobby",
  "playerId": "<playerId>",
  "data": {
    "side": "colonists"
  }
}

// Started Scan
{
  "timestamp": "2022-12-20T18:00:00Z",
  "lobbyId": "<lobbyId>",
  "eventType": "scanStarted",
  "playerId": "<playerId>"
}

// Started Scan
{
  "timestamp": "2022-12-20T18:00:00Z",
  "lobbyId": "<lobbyId>",
  "eventType": "scanComplete",
  "playerId": "<playerId>"
}

Round Webhook

Sent at the start and end of each round

// Round start
{
  "timestamp": "2022-12-20T18:00:00Z",
  "lobbyId": "<lobbyId>",
  "eventType": "roundStarted",
  "data": {
    "roundNumber": 2,
    "map": "Suna",
    "players": {
      "home": ["<playerId>", "<playerId>", "<playerId>", "<playerId>", "<playerId>"],
      "away": ["<playerId>", "<playerId>", "<playerId>", "<playerId>", "<playerId>"]
    }
  }
}

// Round end
{
  "timestamp": "2022-12-20T18:00:00Z",
  "lobbyId": "<lobbyId>",
  "eventType": "roundStarted",
  "data": {
    "roundNumber": 2,
    "map": "Suna",
    "homeScore": 5,
    "awayScore": 11
  }
}

Map and Lobby Webhooks

So long as we can get the above webhooks we shoulnd't need more as they can be reconciled easily, if the Feed or Round webhooks are not practical, we can discuss other options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment