mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 02:10:18 +01:00
17 lines
568 B
JavaScript
17 lines
568 B
JavaScript
"use client";
|
|
|
|
import { useSocket } from "@/context/socketContext";
|
|
import { useTeamConnexion } from "@/context/teamConnexionContext";
|
|
import { useTeamContext } from "@/context/teamContext";
|
|
|
|
export default function useGame() {
|
|
const {teamSocket} = useSocket();
|
|
const {loggedIn, login, teamId} = useTeamConnexion();
|
|
const {currentPosition, enemyPosition} = useTeamContext();
|
|
|
|
function sendCurrentPosition() {
|
|
teamSocket.emit("send_position");
|
|
}
|
|
|
|
return { sendCurrentPosition, login, enemyPosition, currentPosition, loggedIn, teamId };
|
|
} |