Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 641 Bytes

development.md

File metadata and controls

26 lines (17 loc) · 641 Bytes

Development Guide

Websocket messaging

Websockets are used to communicate between the clients and the server.

Server -> Client

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):

  1. Vuex mutation SOCKET_ONMESSAGE is called for every message, and should handle each OP code as needed
  2. Vuex action SOME_ACTION needs to be defined, and is called only if the data contains an ACTION key/value pair

Client -> Server

TBD