Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
kfet/sockets/index.js

33 lines
1.3 KiB
JavaScript
Raw Normal View History

const listCommand = require("./listCommand");
const listDish = require("./listDish");
const listIngredient = require("./listIngredient");
const listSauce = require("./listSauce");
const listDrink = require("./listDrink");
const listDessert = require("./listDessert");
const listUser = require("./listUser");
const addCommand = require("./addCommand");
const addUSer = require("./addUser")
const giveCommand = require("./giveCommand");
const errorCommand = require("./errorCommand");
const clearCommand = require("./clearCommand");
2020-05-30 16:48:50 +02:00
const price = require("./price")
2020-05-29 19:44:12 +02:00
module.exports = socket => {
socket.on("list command", listCommand(socket));
socket.on("list dish", listDish(socket));
socket.on("list ingredient", listIngredient(socket));
socket.on("list sauce", listSauce(socket));
socket.on("list drink", listDrink(socket));
socket.on("list dessert", listDessert(socket));
socket.on("list dessert", listDessert(socket));
socket.on("list user", listUser(socket));
2020-05-29 19:44:12 +02:00
socket.on("add command", addCommand(socket));
socket.on("add user", addUSer(socket));
socket.on("give command", giveCommand(socket));
socket.on("error command", errorCommand(socket));
socket.on("clear command", clearCommand(socket));
2020-05-30 16:48:50 +02:00
socket.on("price", price(socket));
2020-05-29 19:44:12 +02:00
console.log("New connection !");
socket.emit("connected");
}