|
|
|
|
@ -19,7 +19,7 @@ function stopOnline(message) {
|
|
|
|
|
function addClient({ data }) {
|
|
|
|
|
const { socket, id } = data;
|
|
|
|
|
this.clients.set(id, socket);
|
|
|
|
|
this.notifyOne(socket, { command: "setState", data: this.state });
|
|
|
|
|
this.notifyOne(socket, { action: "setState", data: this.state });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deleteClient({ data }) {
|
|
|
|
|
@ -47,12 +47,12 @@ const notifier = {
|
|
|
|
|
socket.send(messageStrinified);
|
|
|
|
|
},
|
|
|
|
|
processMessage: function (message) {
|
|
|
|
|
const action = actions[message.command];
|
|
|
|
|
const action = actions[message.action];
|
|
|
|
|
if (action) {
|
|
|
|
|
action.call(this, message);
|
|
|
|
|
console.log("PERFORM ACTION", message.command);
|
|
|
|
|
console.log("PERFORM ACTION", message.action);
|
|
|
|
|
} else {
|
|
|
|
|
console.log("no avaible command for state mutation", message.command);
|
|
|
|
|
console.log("no avaible command for state mutation", message.action);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|