{
"tries": 3, // number
"items": [
{
"name": "rock",
"weakness": ["paper"],
"picture": "url_or_data"
},
{
"name": "paper",
"weakness": ["scissors"],
"picture": "url_or_data"
},
{
"name": "scissors",
"weakness": ["rock"],
"picture": "url_or_data"
}
]
}Ping Client:
{
"op": 1,
"d": "Ping pong"
}Server:
{
"op": 1,
"d": "Ping pong"
}Join
Client:
{
"op": 2,
"d": {
"username": "my username",
"against": "other username" // Optional.
}
}Server:
{
"op": 2,
"d": {
"status": "ready", // "waiting" || "ready"
"rules": {
// see #Game-rules
}
}
}Server:
{
"op": 3,
"d": "paper" // "paper" | "scissor" | "rock" (or whatever there is in the rules) (this is what the other player chose)
}Client:
{
"op": 3,
"d": "rock" // "paper" | "scissor" | "rock" (or whatever there is in the rules)
}