bppapsdf
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { getContextPlayerOrThrow, getGameOrThrow } from "data";
|
||||
import { HandlerFn } from "types";
|
||||
|
||||
export const restartGameHandler: HandlerFn = async (ctx) => {
|
||||
const player = getContextPlayerOrThrow(ctx);
|
||||
const isHost = player.isHost();
|
||||
if (!isHost) return;
|
||||
const game = getGameOrThrow(player.gameId);
|
||||
await game.restart(ctx);
|
||||
};
|
||||
Reference in New Issue
Block a user