From c6c93acc32893d891adb39011674c02f3f04999e Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sat, 4 Nov 2023 23:59:44 +0000 Subject: gitignore some shit --- backend/dist/config/session-store.js | 59 ------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 backend/dist/config/session-store.js (limited to 'backend/dist/config/session-store.js') diff --git a/backend/dist/config/session-store.js b/backend/dist/config/session-store.js deleted file mode 100644 index e40e6f6..0000000 --- a/backend/dist/config/session-store.js +++ /dev/null @@ -1,59 +0,0 @@ -const sessions = {}; -function makeid(length) { - let result = ''; - const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - const charactersLength = characters.length; - let counter = 0; - while (counter < length) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - counter += 1; - } - return result; -} -export const createNewSession = () => { - const id = makeid(10); - const session = { - id, - state: "waiting", - host: undefined, - clients: [], - }; - sessions[id] = session; - return session; -}; -export const setSessionState = (id, state) => { - if (!sessions[id]) { - return; - } - sessions[id].state = state; -}; -export const setSessionHost = (id, clientId) => { - if (!sessions[id]) { - return; - } - sessions[id].host = clientId; -}; -export const addSessionClient = (id, clientId) => { - var _a; - if (!sessions[id]) { - return; - } - (_a = sessions[id]) === null || _a === void 0 ? void 0 : _a.clients.push(clientId); -}; -export const cleanupSession = (id) => { - if (!sessions[id]) { - return; - } - // if (sessions[id].host) { - // sessions[id].host!.close(); - // } - // - // sessions[id].clients.forEach((client) => { - // client.close(); - // }); - delete sessions[id]; -}; -export const getSession = (id) => { - return sessions[id]; -}; -//# sourceMappingURL=session-store.js.map \ No newline at end of file -- cgit v1.2.3-70-g09d2