-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints.txt
96 lines (65 loc) · 1.45 KB
/
endpoints.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
POST - /register
> { "name": name }
< { "id": id, "token": token }
POST - /cardpacks
< [ "pack1", "pack2" ]
POST - /heartbeat
Must be called as a response to the /heartbeat event, or the player is deleted
/*
* Do room stuff
*/
POST - /room_create
> { "name": name, "cardpacks": [ "pack1", "pack2" ], "cards_per_player": number, "pitch_duration": seconds }
< { "id": id }
==> /room, /players, /roles, /hand
POST - /room_join
> { "id": id[, "password": password ] }
==> /room, /players, /roles, /hand
POST - /room_leave
==> /room
POST - /room_send_message
> { "msg": message }
==> /messages
/*
* Get game related info
*/
POST - /room
< { "id": id, "name": name }
POST - /hand
< { cardid: cardtext, ... }
POST - /players
< { playerid : {"name": name, "score": score, "pitch": pitch}, ... }
POST - /roles
< { "customer": playerid, "profession": name, "pitcher": playerid, "pitch_started": bool, "operator": playerid }
POST - /messages
< [ { "from": playerid, "date": date, "msg": message }, ... ]
/*
* Do game stuff
*/
POST - /pitch-start
> { "cards": [cardid, cardid] }
< { "time": seconds }
POST - /pitch-end
POST - /reveal
> { }
< { }
POST - /choose
> { "player": playerid }
< { }
AND FINALLY
POST - /event
< ["/path", "/path2"]
All requests are sent with user ID headers (session-id)
and token headers (session-token)
/*
* Events
*/
==> /cardpacks
==> /room
==> /roles
==> /hand
==> /players
==> /roles
==> /pitch_end
==> /heartbeat
==> /messages