Modification des paramètres en cours de jeu + UI + corrections

This commit is contained in:
Sébastien Rivière
2025-06-20 00:21:16 +02:00
parent 4fd73a35c8
commit ab81a5351c
12 changed files with 81 additions and 51 deletions

View File

@@ -59,8 +59,8 @@ export function initPhotoUpload() {
//App handler for serving the photo of a team given its secret ID
app.get("/photo/my", (req, res) => {
let team = game.getTeam(Number(req.query.team));
const imagePath = path.join(process.cwd(), UPLOAD_DIR, team.id.toString());
if (team) {
const imagePath = path.join(process.cwd(), UPLOAD_DIR, team.id.toString());
res.set("Content-Type", "image/png")
res.set("Access-Control-Allow-Origin", "*");
res.sendFile(fs.existsSync(imagePath) ? imagePath : path.join(process.cwd(), "images", "missing_image.jpg"));
@@ -71,8 +71,8 @@ export function initPhotoUpload() {
//App handler for serving the photo of the team chased by the team given by its secret ID
app.get("/photo/enemy", (req, res) => {
let team = game.getTeam(Number(req.query.team));
const imagePath = path.join(process.cwd(), UPLOAD_DIR, team.chasing.toString());
if (team) {
const imagePath = path.join(process.cwd(), UPLOAD_DIR, team.chasing.toString());
res.set("Content-Type", "image/png")
res.set("Access-Control-Allow-Origin", "*");
res.sendFile(fs.existsSync(imagePath) ? imagePath : path.join(process.cwd(), "images", "missing_image.jpg"));