X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=TODO;h=ec5bf9009d312c7f3ed6fcb31287fddfa8b16a7d;hb=61198078a81424b50902bf8ffc064cc948ad5386;hp=48fb75a7402b82b47560c366425f780460eae541;hpb=e8007a9f9f45a2a765d5ec42a056ff9499e3f6b6;p=lmno-todo diff --git a/TODO b/TODO index 48fb75a..ec5bf90 100644 --- a/TODO +++ b/TODO @@ -68,7 +68,7 @@ Flempires (flutter-based client) Bring client up to latest Empires API approach - [🗸] Pre-allocate a game ID in the server for flempires to use (QRST, say) + [🗸] Pre-allocate a game ID in the server for flempires to use (QRST) [ ] Change flempires from using https://families.cworth.org/api to instead use https://lmno.games/empires/QRST @@ -106,6 +106,44 @@ Bring client up to latest Empires API approach -H 'Content-Type: application/json' \ -d '{"character": "Cookie Monster"}' https://lmno.games/empires/QRST/register + Returns: 2 (Or some other player ID value) + + [ ] Listen to the /events stream for the game + + This will require an asynchronous mechanism that is continually + listening for events to come in. Events will be of the form + "event: " followed by the data of the event "data: + " followed by a blank line. There will also + be periodic keep-alive non-events sent which are just a line + with only a ":". + + This mechanism is called "Server-sent events" so you may find + code that supports the parsing of this. Or you may not. It + doesn't seem like this mechanism ever became all that popular + (before websockets came along and became popular). + + Example: + + curl https://lmno.games/empires/QRST/events + Returns: + + event: game-info + data: {"id":"QRST","url":"http://lmno.games/QRST"} + + event: player-info + data: {"id":5,"active":true,"name":"Cookie","team":""} + + event: player-enter + data: {"id":2,"active":true,"name":"Web","team":""} + + event: game-state + data: {"team_to_play":{"name":""}} + + event: players + data: [{"id":1,"name":"Carl"},{"id":2,"name":"Cookie"}] + + event: game-phase + data: {"old_phase":"none","new_phase":"join"} Scribe ======