mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
add popping of messages for entitlement check
This commit is contained in:
parent
d0236af334
commit
ea3e5f702a
1 changed files with 19 additions and 1 deletions
|
@ -15,6 +15,9 @@
|
|||
#include <QtCore/QDir>
|
||||
#include <QtCore/QProcessEnvironment>
|
||||
|
||||
#define OVRPL_DISABLED
|
||||
#include <OVR_Platform.h>
|
||||
|
||||
#include <controllers/Input.h>
|
||||
#include <controllers/Pose.h>
|
||||
#include <NumericalConstants.h>
|
||||
|
@ -27,6 +30,7 @@ static ovrSession session { nullptr };
|
|||
|
||||
static bool _quitRequested { false };
|
||||
static bool _reorientRequested { false };
|
||||
static bool _entitlementCheckFailed { false };
|
||||
|
||||
inline ovrErrorInfo getError() {
|
||||
ovrErrorInfo error;
|
||||
|
@ -125,6 +129,20 @@ void handleOVREvents() {
|
|||
return;
|
||||
}
|
||||
|
||||
// pop messages to see if we got a return for an entitlement check
|
||||
while ((message = ovr_PopMessage()) != nullptr) {
|
||||
switch (ovr_Message_GetType(message)) {
|
||||
case ovrMessage_Entitlement_GetIsViewerEntitled: {
|
||||
if (!ovr_Message_IsError(message)) {
|
||||
// this viewer is entitled, no need to flag anything
|
||||
} else {
|
||||
// we failed the entitlement check, set our flag so the app can stop
|
||||
_entitlementCheckFailed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_quitRequested = status.ShouldQuit;
|
||||
_reorientRequested = status.ShouldRecenter;
|
||||
}
|
||||
|
@ -217,4 +235,4 @@ controller::Pose ovrControllerPoseToHandPose(
|
|||
pose.velocity = toGlm(handPose.LinearVelocity);
|
||||
pose.valid = true;
|
||||
return pose;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue