Add getter for SteamVR's buildID to SteamClient

This commit is contained in:
Atlante45 2016-10-26 14:47:53 -07:00
parent 15ee56a50f
commit f26ddc6f8b
3 changed files with 28 additions and 0 deletions

View file

@ -569,6 +569,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
_deadlockWatchdogThread = new DeadlockWatchdogThread();
_deadlockWatchdogThread->start();
qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << SteamClient::getSteamVRBuildID();
qCDebug(interfaceapp) << "[VERSION] Build sequence:" << qPrintable(applicationVersion());
qCDebug(interfaceapp) << "[VERSION] MODIFIED_ORGANIZATION:" << BuildInfo::MODIFIED_ORGANIZATION;
qCDebug(interfaceapp) << "[VERSION] VERSION:" << BuildInfo::VERSION;

View file

@ -245,6 +245,32 @@ void SteamClient::shutdown() {
steamCallbackManager.getTicketRequests().stopAll();
}
int SteamClient::getSteamVRBuildID() {
if (initialized) {
static const int MAX_PATH_SIZE = 512;
static const int STEAMVR_APPID = 250820;
char rawPath[MAX_PATH_SIZE];
SteamApps()->GetAppInstallDir(STEAMVR_APPID, rawPath, MAX_PATH_SIZE);
QString path(rawPath);
path += "\\bin\\version.txt";
qDebug() << "SteamVR version file path:" << path;
QFile file(path);
if (file.open(QIODevice::ReadOnly)) {
QString buildIDString = file.readLine();
bool ok = false;
int buildID = buildIDString.toInt(&ok);
if (ok) {
return buildID;
}
}
}
return 0;
}
void SteamClient::runCallbacks() {
if (!initialized) {
return;

View file

@ -37,6 +37,7 @@ public:
static void openInviteOverlay();
static void joinLobby(QString lobbyId);
static int getSteamVRBuildID();
};
class SteamScriptingInterface : public QObject {