Add base function for killing the game
This commit is contained in:
parent
b58d1e7049
commit
d2014d6742
2 changed files with 6 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
||||||
|
import { Server, Socket } from 'socket.io';
|
||||||
|
export const KillGame = (io: Server, socket: Socket, data: KillGame) => {
|
||||||
|
console.log(`Killing the game`);
|
||||||
|
};
|
||||||
|
|
@ -3,6 +3,7 @@ import * as sio from "socket.io";
|
||||||
import { writeFileSync } from "fs";
|
import { writeFileSync } from "fs";
|
||||||
import { Game } from "./utils/Game";
|
import { Game } from "./utils/Game";
|
||||||
import { Vote } from "./events/Vote";
|
import { Vote } from "./events/Vote";
|
||||||
|
import { KillGame } from "./events/KillGame";
|
||||||
import { JoinGame } from "./events/JoinGame";
|
import { JoinGame } from "./events/JoinGame";
|
||||||
import { HostGame } from "./events/HostGame";
|
import { HostGame } from "./events/HostGame";
|
||||||
import { StartGame } from "./events/StartGame";
|
import { StartGame } from "./events/StartGame";
|
||||||
|
|
@ -57,6 +58,7 @@ io.on(`connection`, (socket: sio.Socket) => {
|
||||||
// Game Management
|
// Game Management
|
||||||
socket.on(`HostGame`, (data: HostGame) => HostGame(io, socket, data));
|
socket.on(`HostGame`, (data: HostGame) => HostGame(io, socket, data));
|
||||||
socket.on(`JoinGame`, (data: JoinGame) => JoinGame(io, socket, data));
|
socket.on(`JoinGame`, (data: JoinGame) => JoinGame(io, socket, data));
|
||||||
|
socket.on(`KillGame`, (data: KillGame) => KillGame(io, socket, data));
|
||||||
|
|
||||||
|
|
||||||
// Join a game
|
// Join a game
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue