Done
config.js to change the offset
This commit is contained in:
Sylvain Gay 2023-06-16 17:29:45 +02:00
parent 751ce62099
commit 1341fde11b
2 changed files with 11 additions and 2 deletions

View file

@ -14,5 +14,9 @@ module.exports = {
"port": 9000,
"key": "certif/server.key",
"cert": "certif/server.crt",
"validator": validator
"validator": validator,
// Offset for the randomization of the blurred status
"lat_ofs": 0.0005,
"long_ofs": 0.0005,
}

View file

@ -162,6 +162,11 @@ function color(team){
// apparent information of a team, for other only
function apparent_info(equipe){
if(equipe.state.shown){
if(equipe.state.blurred)
return {"id": equipe.id, "color": color(equipe),
"position": [parseFloat(equipe.pos[0])+config.lat_ofs*(Math.random()*2-1),
parseFloat(equipe.pos[1])+config.long_ofs*(Math.random()*2-1)]};
else
return {"id": equipe.id, "color": color(equipe), "position": equipe.pos};
} else {
return {"id": equipe.id, "color": color(equipe), "position": [0,0]};