You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
609 B
31 lines
609 B
const {socket} = require('socket.io');
|
|
|
|
const express = require('express');
|
|
|
|
const app = express();
|
|
const http = require('http').createServer(app);
|
|
const path = require('path');
|
|
const port = 8080;
|
|
|
|
const io = require('socket.io')(http);
|
|
|
|
app.get('/',(request,res) => {
|
|
res.sendFile(path.join(__dirname,'html/index.html'));
|
|
});
|
|
|
|
http.listen(port, () => {
|
|
console.log(`Actually listening !`);
|
|
})
|
|
|
|
|
|
let rooms = []
|
|
io.on('connection', (socket) => {
|
|
console.log(`[Server-side] Socket : ${socker.id}`);
|
|
})
|
|
|
|
|
|
|
|
io.on('playerData', (player) => {
|
|
console.log(`[Server-side] Plqyer : ${player.name}`)
|
|
})
|