diff --git a/sample_config.js b/sample_config.js index d262b62..eec7ba3 100644 --- a/sample_config.js +++ b/sample_config.js @@ -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, } diff --git a/traque.js b/traque.js index c9961b4..1ba1b50 100644 --- a/traque.js +++ b/traque.js @@ -162,7 +162,12 @@ function color(team){ // apparent information of a team, for other only function apparent_info(equipe){ if(equipe.state.shown){ - return {"id": equipe.id, "color": color(equipe), "position": equipe.pos}; + 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]}; }