mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-04-11 00:30:19 +02:00
Server folders restructuration
This commit is contained in:
@@ -20,4 +20,3 @@
|
|||||||
- [ ] Ajouter imprécision de la position au besoin (comme sur google maps)
|
- [ ] Ajouter imprécision de la position au besoin (comme sur google maps)
|
||||||
- [ ] Synchroniser les horloges sur l'interface
|
- [ ] Synchroniser les horloges sur l'interface
|
||||||
- [ ] Améliorer l'intuitivité de l'interface (bouton d'actualisation / stats)
|
- [ ] Améliorer l'intuitivité de l'interface (bouton d'actualisation / stats)
|
||||||
- [ ] Publier sur le playstore
|
|
||||||
|
|||||||
@@ -23,7 +23,32 @@
|
|||||||
- [ ] Pouvoir load des paramètres enregistrés
|
- [ ] Pouvoir load des paramètres enregistrés
|
||||||
- [ ] Penser l'affichage en fin de traque
|
- [ ] Penser l'affichage en fin de traque
|
||||||
|
|
||||||
|
## Ancien TODO
|
||||||
|
|
||||||
|
- [ ] Rendre plus évident qui chasse qui quand on clique sur une équipe
|
||||||
|
- [ ] Montrer les dernières pos envoyées et la position de l'ennemie selon chaque équipe
|
||||||
|
- [ ] Logs des events de la game
|
||||||
|
- [ ] Save les configs de la partie (surtout en cas de crash)
|
||||||
|
- [ ] Afficher listes des kills
|
||||||
|
- [ ] Déplacer les équipes éliminées dans un classement provisoire
|
||||||
|
|
||||||
## Autres idées
|
## Autres idées
|
||||||
|
|
||||||
- Améliorer l'accessibilité (traduction anglaise notamment).
|
- Améliorer l'accessibilité (traduction anglaise notamment).
|
||||||
- Améliorer l'UI.
|
- Améliorer l'UI.
|
||||||
|
|
||||||
|
## Idées générales pour le jeu la traque
|
||||||
|
|
||||||
|
Avoir des sorte de powerup sous la forme d'objets physiques avec un code dessus dans la zone de jeu, en entrant le code dans l'app on pourrait débloquer un pouvoir en mode :
|
||||||
|
|
||||||
|
reveller le nom de l'équipe en train de nous traquer
|
||||||
|
Reveller la position de l'équipe en train de nous traquer
|
||||||
|
Update la position de l'équipe traquée sans update sa position
|
||||||
|
Reset le compteur avant pénalité
|
||||||
|
Enlever une pénalité
|
||||||
|
Transformer l'objet qui vient d'être récupéré en piège : la prochaine équipe qui l'active prend une pénalité, l'objet peut être placé n'importe ou (ne peut être activé qu'une fois)
|
||||||
|
Un nerf
|
||||||
|
3 ticket t+
|
||||||
|
Gilet lesté
|
||||||
|
Gilet jaune
|
||||||
|
Une cloche sur un colier
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#Make a self signed certificate for development
|
|
||||||
keys: key.pem server.crt
|
|
||||||
|
|
||||||
key.pem csr.pem:
|
|
||||||
openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem
|
|
||||||
|
|
||||||
server.crt: key.pem csr.pem
|
|
||||||
openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt
|
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -2,11 +2,11 @@
|
|||||||
"name": "traque-back",
|
"name": "traque-back",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "node index.js",
|
"start": "node src/index.js",
|
||||||
"dev": "nodemon index.js"
|
"dev": "nodemon src/index.js"
|
||||||
},
|
},
|
||||||
"author": "Quentin Roussel",
|
"author": "Quentin Roussel",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import multer from "multer";
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import game from "./game.js";
|
import game from "./game.js";
|
||||||
const UPLOAD_DIR = "uploads/"
|
const UPLOAD_DIR = path.join(process.cwd(), "uploads");
|
||||||
|
const IMAGES_DIR = path.join(process.cwd(), "assets", "images");
|
||||||
const ALLOWED_MIME = [
|
const ALLOWED_MIME = [
|
||||||
"image/png",
|
"image/png",
|
||||||
"image/jpeg",
|
"image/jpeg",
|
||||||
@@ -60,10 +61,10 @@ export function initPhotoUpload() {
|
|||||||
app.get("/photo/my", (req, res) => {
|
app.get("/photo/my", (req, res) => {
|
||||||
let team = game.getTeam(req.query.team);
|
let team = game.getTeam(req.query.team);
|
||||||
if (team) {
|
if (team) {
|
||||||
const imagePath = path.join(process.cwd(), UPLOAD_DIR, team.id);
|
const imagePath = path.join(UPLOAD_DIR, team.id);
|
||||||
res.set("Content-Type", "image/png")
|
res.set("Content-Type", "image/png")
|
||||||
res.set("Access-Control-Allow-Origin", "*");
|
res.set("Access-Control-Allow-Origin", "*");
|
||||||
res.sendFile(fs.existsSync(imagePath) ? imagePath : path.join(process.cwd(), "images", "missing_image.jpg"));
|
res.sendFile(fs.existsSync(imagePath) ? imagePath : path.join(IMAGES_DIR, "missing_image.jpg"));
|
||||||
} else {
|
} else {
|
||||||
res.status(400).send("Team not found")
|
res.status(400).send("Team not found")
|
||||||
}
|
}
|
||||||
@@ -72,10 +73,10 @@ export function initPhotoUpload() {
|
|||||||
app.get("/photo/enemy", (req, res) => {
|
app.get("/photo/enemy", (req, res) => {
|
||||||
let team = game.getTeam(req.query.team);
|
let team = game.getTeam(req.query.team);
|
||||||
if (team) {
|
if (team) {
|
||||||
const imagePath = path.join(process.cwd(), UPLOAD_DIR, team.chasing);
|
const imagePath = path.join(UPLOAD_DIR, team.chasing);
|
||||||
res.set("Content-Type", "image/png")
|
res.set("Content-Type", "image/png")
|
||||||
res.set("Access-Control-Allow-Origin", "*");
|
res.set("Access-Control-Allow-Origin", "*");
|
||||||
res.sendFile(fs.existsSync(imagePath) ? imagePath : path.join(process.cwd(), "images", "missing_image.jpg"));
|
res.sendFile(fs.existsSync(imagePath) ? imagePath : path.join(IMAGES_DIR, "missing_image.jpg"));
|
||||||
} else {
|
} else {
|
||||||
res.status(400).send("Team not found")
|
res.status(400).send("Team not found")
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
const UPLOAD_DIR = "trajectories";
|
const TRAJECTORIES_DIR = path.join(process.cwd(), "trajectories");
|
||||||
const EXTENSION = "txt";
|
const EXTENSION = "txt";
|
||||||
|
|
||||||
// Useful functions
|
// Useful functions
|
||||||
|
|
||||||
function teamIDToPath(teamID) {
|
function teamIDToPath(teamID) {
|
||||||
return path.join(UPLOAD_DIR, teamID + "." + EXTENSION);
|
return path.join(TRAJECTORIES_DIR, teamID + "." + EXTENSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dataToLine(...data) {
|
function dataToLine(...data) {
|
||||||
@@ -44,8 +44,8 @@ function addLineToFile(teamID, line) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function initTrajectories() {
|
function initTrajectories() {
|
||||||
const files = fs.readdirSync(UPLOAD_DIR);
|
const files = fs.readdirSync(TRAJECTORIES_DIR);
|
||||||
for (const file of files) fs.unlinkSync(path.join(UPLOAD_DIR, file));
|
for (const file of files) fs.unlinkSync(path.join(TRAJECTORIES_DIR, file));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export functions
|
// Export functions
|
||||||
Reference in New Issue
Block a user