add more hmd names
All checks were successful
deploy / deploy (push) Successful in 30s

This commit is contained in:
Lee 2023-10-30 21:06:27 +00:00
parent 410dc1c52c
commit bd992ad0e5
2 changed files with 12 additions and 28 deletions

@ -1,26 +1,11 @@
export const Headsets = [ export const Headsets: { [key: number]: string } = {
{ 0: "Unknown",
id: [-1], 1: "Rift CV1",
name: "Unknown", 2: "Vive",
}, 4: "Vive Pro",
{ 8: "Windows Mixed Reality",
id: [64], 16: "Rift S",
name: "Valve Index", 32: "Oculus Quest",
}, 64: "Valve Index",
{ 128: "Vive Cosmos",
id: [32], };
name: "Oculus Quest",
},
{
id: [16],
name: "Rift S",
},
{
id: [1],
name: "Rift CV1",
},
{
id: [2],
name: "Vive",
},
];

@ -72,8 +72,7 @@ async function connectWebsocket() {
} = score; } = score;
const { maxScore, stars, id: leaderboardId } = leaderboard; const { maxScore, stars, id: leaderboardId } = leaderboard;
const hmdName = const hmdName = Headsets[hmd] || "Unknown";
Headsets.find((h) => h.id.includes(hmd))?.name || "Unknown";
const countryId = normalizedRegionName(player.country) || "Unknown"; const countryId = normalizedRegionName(player.country) || "Unknown";
totalCountries[countryId] = (totalCountries[countryId] || 0) + 1; totalCountries[countryId] = (totalCountries[countryId] || 0) + 1;
totalHeadsets[hmdName] = (totalHeadsets[hmdName] || 0) + 1; totalHeadsets[hmdName] = (totalHeadsets[hmdName] || 0) + 1;