mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
fixed in placement zone detection
This commit is contained in:
@@ -131,7 +131,7 @@ export default class Game {
|
|||||||
team.currentLocation = location;
|
team.currentLocation = location;
|
||||||
//Update the team ready status if they are in their starting area
|
//Update the team ready status if they are in their starting area
|
||||||
if (this.state == GameState.PLACEMENT && team.startingArea && team.startingArea && location) {
|
if (this.state == GameState.PLACEMENT && team.startingArea && team.startingArea && location) {
|
||||||
team.ready = isInCircle(location, [team.startingArea.center.lat, team.startingArea.center.lng], team.startingArea.radius)
|
team.ready = isInCircle({ lat: location[0], lng: location[1] }, team.startingArea.center, team.startingArea.radius)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ const upload = multer({
|
|||||||
export function initPhotoUpload() {
|
export function initPhotoUpload() {
|
||||||
clean();
|
clean();
|
||||||
app.post("/upload", upload.single('file'), (req, res) => {
|
app.post("/upload", upload.single('file'), (req, res) => {
|
||||||
|
res.set("Access-Control-Allow-Origin", "*");
|
||||||
console.log("upload", req.query)
|
console.log("upload", req.query)
|
||||||
res.send("")
|
res.send("")
|
||||||
})
|
})
|
||||||
@@ -52,6 +53,7 @@ export function initPhotoUpload() {
|
|||||||
let team = game.getTeam(Number(req.query.team));
|
let team = game.getTeam(Number(req.query.team));
|
||||||
if (team) {
|
if (team) {
|
||||||
res.set("Content-Type", "image/png")
|
res.set("Content-Type", "image/png")
|
||||||
|
res.set("Access-Control-Allow-Origin", "*");
|
||||||
res.sendFile(process.cwd() + "/" + UPLOAD_DIR + "/" + team.id);
|
res.sendFile(process.cwd() + "/" + UPLOAD_DIR + "/" + team.id);
|
||||||
} else {
|
} else {
|
||||||
res.send(400, "Team not found")
|
res.send(400, "Team not found")
|
||||||
@@ -61,6 +63,7 @@ export function initPhotoUpload() {
|
|||||||
let team = game.getTeam(Number(req.query.team));
|
let team = game.getTeam(Number(req.query.team));
|
||||||
if (team) {
|
if (team) {
|
||||||
res.set("Content-Type", "image/png")
|
res.set("Content-Type", "image/png")
|
||||||
|
res.set("Access-Control-Allow-Origin", "*");
|
||||||
res.sendFile(process.cwd() + "/" + UPLOAD_DIR + "/" + team.chasing);
|
res.sendFile(process.cwd() + "/" + UPLOAD_DIR + "/" + team.chasing);
|
||||||
} else {
|
} else {
|
||||||
res.send(400, "Team not found")
|
res.send(400, "Team not found")
|
||||||
|
|||||||
Reference in New Issue
Block a user