Enumeration COMMAND

Enumeration Members

ASSIGN_ID: "assignId"

sent from server to assign an id for the connection and reconfirmed by the client. idTarget is used to carry the id

CLIENT_HEARTBEAT: "clientHeartbeat"

not used yet

CONNECT_HOST: "connectHost"

command sent by a client, which is supposed to become the host, to the server and from the server to all clients to create peer-to-peer-connections between this host and all other clients known to the server

CONNECT_PEERS: "connectPeers"

command initializing peer-to-peer-connections between the client identified with idTarget and all the peers
identified by the array giwen with content.peers

CREATE_MESH: "createMesh"

command sent by a client to the server and from the server to all clients to initiate a mesh structure between the clients creating peer-to-peer-connections between all clients known to the server

DISCONNECT_PEERS: "disconnectPeers"

dissolve peer-to-peer-connection between the client identified with idTarget and all the peers
identified by the array giwen with content.peers or to all peers the client is connected to, if content.peers is undefined

ERROR: "error"
ICE_CANDIDATE: "rtcCandidate"

command used internally when a client send its connection candidates for peer-to-peer connetion

LOGIN_REQUEST: "loginRequest"

sent from a client to the server to suggest a login name. name used for the suggested name

LOGIN_RESPONSE: "loginResponse"

sent from the server to the client requesting a login name. content.success is true or false for feedback

ROOM_CREATE: "roomCreate"

sent to the server to create a new room and return its id

ROOM_ENTER: "roomEnter"

sent to the server to join the calling client to the room given with the id, sent back to all clients in the room after

ROOM_GET_IDS: "roomGetIds"

sent to the server and back to the calling client to retrieve an array of available room ids

RTC_ANSWER: "rtcAnswer"

command used internally when a client answers a conection request from another client

RTC_OFFER: "rtcOffer"

command used internally when a client tries to connect to another via rtc to create a peer-to-peer-connection

SERVER_HEARTBEAT: "serverHeartbeat"

sent from the server every second to check if the connection is still up.
content is an array of objects with the ids of the clients and their connected peers as known to the server

UNDEFINED: "undefined"