From f351b6bb99d0538c4f31772904620bcb3a5f8913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Tue, 17 Oct 2017 16:12:50 +0200 Subject: [PATCH] Started working on README.md events --- server/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/README.md b/server/README.md index 3b7ca164..4f9362d4 100644 --- a/server/README.md +++ b/server/README.md @@ -1,8 +1,6 @@ -# Backend +## Events -### Events - -Emitted events between the server and client +### To server ``` socket.emit("end", {id: video_id, channel: channel_name}); Tells the server the song is clientside socket.emit("pos", {channel: channel_name}); Asks server where in the song it should be @@ -20,7 +18,10 @@ socket.emit("id", {id: CHANNEL_ID, type: "pause", value: "mock"}); Sends socket.emit("id", {id: CHANNEL_ID, type: "skip", value: "mock"}); Sends message to the host channel for skip socket.emit("id", {id: CHANNEL_ID, type: "volume", value: VALUE}); Sends message to the host channel to change volume socket.emit("id", {id: CHANNEL_ID, type: "channel", value: NEW_CHANNEL_NAME}); Sends message to the host channel to change channel +``` +### From server +``` socket.on("toast", STRING) Recieves a string from server for what type of toast to be triggered socket.on("pw", STRING) Recieves the password for the channel if the user sent the right in the first place socket.on("conf", [ARRAY]) Recieves configuration array from server