1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Add proper game analytics

This commit is contained in:
tobspr
2020-05-12 20:06:50 +02:00
parent 2411054ad2
commit 241b4b42d9
7 changed files with 193 additions and 76 deletions

View File

@@ -186,14 +186,9 @@ export class SavegameManager extends ReadWriteProxy {
* Helper method to generate a new internal savegame id
*/
generateInternalId() {
const timestamp = ("" + Math_floor(Date.now() / 1000.0 - 1565641619)).padStart(10, "0");
return (
timestamp +
"." +
Rusha.createHash()
.update(Date.now() + "/" + Math.random())
.digest("hex")
);
return Rusha.createHash()
.update(Date.now() + "/" + Math.random())
.digest("hex");
}
// End