Skip to content

Commit

Permalink
Moved headset formatting to the server
Browse files Browse the repository at this point in the history
  • Loading branch information
NSGolova committed Dec 3, 2024
1 parent 46818c9 commit 618863d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
17 changes: 0 additions & 17 deletions include/Utils/FormatUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ using namespace UnityEngine;

namespace FormatUtils {

inline string_view GetHeadsetNameById(int id) {
switch (id) {
case 1: return "Rift";
case 2: return "Vive";
case 4: return "Vive Pro";
case 8: return "WMR";
case 16: return "Rift S";
case 32: return "Quest";
case 64: return "Index";
case 128: return "Vive Cosmos";
case 256: return "Quest 2";
case 512: return "Quest 3";
}

return "Unknown HMD";
}

const int Second = 1;
const int Minute = 60 * Second;
const int Hour = 60 * Minute;
Expand Down
2 changes: 1 addition & 1 deletion shared/Models/Score.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct Score
int wallsHit;
int pauses;
bool fullCombo;
int hmd;
string headsetName;
string timeset;
string platform;

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Score::Score(rapidjson::Value const& document) {
wallsHit = document["wallsHit"].GetInt();
pauses = document["pauses"].GetInt();

hmd = document["hmd"].GetInt();
headsetName = document["headsetName"].GetString();
timeset = document["timeset"].GetString();
platform = document["platform"].GetString();

Expand Down
2 changes: 1 addition & 1 deletion src/UI/ScoreDetails/GeneralScoreDetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ string GetTimeSetString(Score const& score) {
stringstream result;
result << "<color=#FFFFFF>" << FormatUtils::GetRelativeTimeString(score.timeset);
result << "<color=#888888><size=70%> on </size>";
result << "<color=#FFFFFF>" << FormatUtils::GetHeadsetNameById(score.hmd);
result << "<color=#FFFFFF>" << score.headsetName;
return result.str();
}

Expand Down

0 comments on commit 618863d

Please sign in to comment.