Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions multiplayer-globe-template/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export class Globe extends Server {
console.warn(`Missing position information for connection ${conn.id}`);
return;
}
// Truncate lat/lon to single decimal for privacy
const position = {
lat: parseFloat(latitude),
lng: parseFloat(longitude),
lat: Math.trunc(parseFloat(latitude) * 10) / 10,
lng: Math.trunc(parseFloat(longitude) * 10) / 10,
id: conn.id,
};
// And save this on the connection's state
Expand Down