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

70 lines
3.2 KiB
JavaScript
Raw Permalink Normal View History

2020-05-31 22:47:20 +02:00
const listCommand = require("./list/listCommand");
const listDish = require("./list/listDish");
const listIngredient = require("./list/listIngredient");
const listSauce = require("./list/listSauce");
const listDrink = require("./list/listDrink");
const listDessert = require("./list/listDessert");
const listUser = require("./list/listUser");
const listService = require("./list/listService");
const addCommand = require("./add/addCommand");
const addUSer = require("./add/addUser");
const addDish = require("./add/addDish");
const addIngredient = require("./add/addIngredient");
const addSauce = require("./add/addSauce");
const addDrink = require("./add/addDrink");
const addDessert = require("./add/addDessert");
2020-05-31 22:47:20 +02:00
const setDish = require("./set/setDish");
const setIngredient = require("./set/setIngredient");
const setSauce = require("./set/setSauce");
const setDrink = require("./set/setDrink");
const setDessert = require("./set/setDessert");
const setService = require("./set/setService");
const removeDish = require("./remove/removeDish");
const removeIngredient = require("./remove/removeIngredient");
const removeSauce = require("./remove/removeSauce");
const removeDrink = require("./remove/removeDrink");
const removeDessert = require("./remove/removeDessert");
const giveCommand = require("./giveCommand");
const WIPCommand = require("./WIPCommand");
const doneCommand = require("./doneCommand");
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 user", listUser(socket));
socket.on("list service", listService(socket));
2020-05-29 19:44:12 +02:00
socket.on("add command", addCommand(socket));
socket.on("add user", addUSer(socket));
socket.on("add dish", addDish(socket));
socket.on("add ingredient", addIngredient(socket));
socket.on("add sauce", addSauce(socket));
socket.on("add drink", addDrink(socket));
socket.on("add dessert", addDessert(socket));
socket.on("set dish", setDish(socket));
socket.on("set ingredient", setIngredient(socket));
socket.on("set sauce", setSauce(socket));
socket.on("set drink", setDrink(socket));
socket.on("set dessert", setDessert(socket));
socket.on("set service", setService(socket));
socket.on("remove dish", removeDish(socket));
socket.on("remove ingredient", removeIngredient(socket));
socket.on("remove sauce", removeSauce(socket));
socket.on("remove drink", removeDrink(socket));
socket.on("remove dessert", removeDessert(socket));
socket.on("give command", giveCommand(socket));
socket.on("WIP command", WIPCommand(socket));
socket.on("done command", doneCommand(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");
}