grapevine icon indicating copy to clipboard operation
grapevine copied to clipboard

Add UID to messages on a channel

Open oestrich opened this issue 5 years ago • 0 comments

We should add a UID and timestamp field to messages. The server would add both of these fields when broadcasting out.

  • timestamp will be a ISO8601 timestamp in UTC
  • uid will be a string that uniquely identifies this message

Example

Sending stays as normal:

{
  "event": "channels/send",
  "ref": "28523394-6dcf-4c2a-ad1d-2d0ef8bb823b",
  "payload": {
    "channel": "grapevine",
    "name": "Player",
    "message": "Hello everyone!"
  }
}

Games listening on your channel now receive these extra fields.

{
  "event": "channels/broadcast",
  "ref": "89036074-446f-41ab-b87a-44ef1f962f2e",
  "payload": {
    "uid": "a61a2913-84c6-410d-bee0-e2bd8d34374e",
    "timestmap": "2019-11-22T18:00:00Z",
    "channel": "grapevine",
    "message": "Hello everyone!",
    "game": "ExVenture",
    "name": "Player"
  }
}

oestrich avatar Nov 22 '19 18:11 oestrich