This commit is contained in:
Louis Lam
2023-10-23 19:30:58 +08:00
parent 205bff2359
commit 5f70fa6baf
64 changed files with 10431 additions and 0 deletions

11
backend/util-server.ts Normal file
View File

@ -0,0 +1,11 @@
import { Socket } from "socket.io";
export interface DockgeSocket extends Socket {
userID: number;
}
export function checkLogin(socket : DockgeSocket) {
if (!socket.userID) {
throw new Error("You are not logged in.");
}
}