#Socket APIs
@param {String} { event: 'getClientId' }.
@response {String} { event: 'getClientId', data: clientId, result: true }.
@param {String} { event: 'generateGroup' }.
@response {String} { event: 'generateGroup', data: groupId, result: true }.
@param {String} { event: 'groupIsReady' }.
@response {String} { event: 'groupIsReady', result: true }.
After group is ready, the server will send the music manifest to the Players.
@param {String} { event: 'joinGroup', data: groupId }.
@response {String} { event: 'joinGroup', result: true }.
@param {String} { event: 'setGroupSong', data: song filename }.
@response {String} { event: 'setGroupSong', result: true }.
@param {String} { event: 'sendMessageToGroup', data: message(JSON string) }.
@response {String} { event: 'sendMessageToGroup', result: true }.
sendMessageToGroup is used for Player and Input communicated each other.
For example, Input would like to speed up the speed of music:
Use it with data { action: 'controlSpeed', data: 0.8 }
.
@param {String} { event: 'playerIsReady' }.
@response {String} { event: 'playerIsReady', result: true }.
If all player is ready in a group, the server will sendn a message { event: 'allPlayersReady', result: true }
to start the game.
@response {String} { event: 'trackList', data: { song: filename, tracks: trackIdArray }, result: true }.
@response {String} { event: 'tracksManifest', data: tracksManifest, result: true }.
See the data format in the /ws_server/lib/tracks_manifest.js.
@param {String} { event: 'ntp', data: client time }.
@response {String} { event: 'ntp', data: { clientTime: client time, serverTime: server time } , result: true }.
@param {String} { event: 'setGroupSpeed', data: conductor speed }.
@response {String} { event: 'setGroupSpeed', result: true }.
@param {String} { event: 'getGroupSpeed', data: client time }.
@response {String} { event: 'getGroupSpeed', data: { clientTime: client time triggerTime: trigger time, responseTime: response time, speed: conductor speed } , result: true }.
@response {String} { event: 'showGameScore', data: score, result: true }.