Begin listening for lobby join events
This commit is contained in:
parent
88b07fdf1d
commit
4c9d0b272c
1 changed files with 3 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import { Server } from "socket.io";
|
|||
import Ping from "./events/ping";
|
||||
import ServerInfo from "./events/server_info";
|
||||
import CreateLobby from "./events/lobby/create";
|
||||
import JoinLobby from "./events/lobby/players/join";
|
||||
|
||||
export default async function() {
|
||||
log.info("Starting socket.io server...");
|
||||
|
|
@ -12,7 +13,7 @@ export default async function() {
|
|||
const io = new Server();
|
||||
|
||||
io.on("connection", (socket) => {
|
||||
log.debug(`Socket connected with ID: ${socket.id}`);
|
||||
log.silly(`Socket connected with ID: ${socket.id}`);
|
||||
|
||||
// Metadata Events
|
||||
socket.on(Ping.name, (data) => Ping.handler(io, socket, data));
|
||||
|
|
@ -20,6 +21,7 @@ export default async function() {
|
|||
|
||||
// Lobby Management Events
|
||||
socket.on(CreateLobby.name, (data) => CreateLobby.handler(io, socket, data));
|
||||
socket.on(JoinLobby.name, (data) => JoinLobby.handler(io, socket, data));
|
||||
});
|
||||
|
||||
io.listen(config.server.port, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue