Websockets are used to communicate between the clients and the server.
Messages should be structured with the following data format:
{
"OP": "SOME_OP_CODE",
"DATA": {},
"ACTION": "SOME_ACTION"
}
On the client side, the messages are handled in 2 places (in the Vuex store):
- Vuex mutation
SOCKET_ONMESSAGE
is called for every message, and should handle each OP code as needed - Vuex action
SOME_ACTION
needs to be defined, and is called only if the data contains anACTION
key/value pair
TBD