mirror of
https://github.com/mudabbir-ahmad/MAD-Treasure-Hunt.git
synced 2026-10-08 03:00:20 +00:00
Add new screens for game management, team management, and cache handling; implement caching logic and session management
This commit is contained in:
1 parent
8686f0e1ff
commit
17ed120ce8
70 files changed
+2172
-3892
No files matched your search
@@ -0,0 +1,72 @@
|
||||
import dbController from './DbController';
|
||||
|
||||
const useGameHook = () => {
|
||||
const getGameTypes = () => dbController.getGameTypes();
|
||||
|
||||
const getCreatedPrivateGame = (userId) => {
|
||||
return dbController.getCreatedPrivateGameByUser(userId);
|
||||
};
|
||||
|
||||
const createPrivateGame = (payload) => {
|
||||
return dbController.createPrivateGame(payload);
|
||||
};
|
||||
|
||||
const joinPrivateGame = (payload) => {
|
||||
return dbController.joinPrivateGame(payload);
|
||||
};
|
||||
|
||||
const joinAsAdmin = (payload) => {
|
||||
return dbController.joinAsAdmin(payload);
|
||||
};
|
||||
|
||||
const getLobby = (gid) => {
|
||||
return dbController.getLobby(gid);
|
||||
};
|
||||
|
||||
const getTeam = (tid) => {
|
||||
return dbController.getTeam(tid);
|
||||
};
|
||||
|
||||
const createTeam = (payload) => {
|
||||
return dbController.createTeam(payload);
|
||||
};
|
||||
|
||||
const joinTeamByCode = (payload) => {
|
||||
return dbController.joinTeamByCode(payload);
|
||||
};
|
||||
|
||||
const getMapPoints = (gid, sgid = null) => {
|
||||
return dbController.getMapPoints(gid, sgid);
|
||||
};
|
||||
|
||||
const getCaches = (gid, sgid = null) => {
|
||||
return dbController.getCaches(gid, sgid);
|
||||
};
|
||||
|
||||
const upsertCache = (payload) => {
|
||||
return dbController.upsertCache(payload);
|
||||
};
|
||||
|
||||
const claimCache = (payload) => {
|
||||
return dbController.claimCache(payload);
|
||||
};
|
||||
|
||||
return {
|
||||
getGameTypes,
|
||||
getCreatedPrivateGame,
|
||||
createPrivateGame,
|
||||
joinPrivateGame,
|
||||
joinAsAdmin,
|
||||
getLobby,
|
||||
getTeam,
|
||||
createTeam,
|
||||
joinTeamByCode,
|
||||
getMapPoints,
|
||||
getCaches,
|
||||
upsertCache,
|
||||
claimCache,
|
||||
};
|
||||
};
|
||||
|
||||
export default useGameHook;
|
||||
|
||||
Reference in new issue
Block a user