mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
more staging
This commit is contained in:
parent
704f005604
commit
a905310a58
7 changed files with 19 additions and 10 deletions
|
@ -125,7 +125,7 @@ void LoginDialog::login(const QString& username, const QString& password) const
|
|||
void LoginDialog::loginThroughOculus() {
|
||||
qDebug() << "Attempting to login through Oculus";
|
||||
if (auto oculusDisplay = PluginManager::getInstance()->getOculusDisplayPlugin()) {
|
||||
//oculusDisplay->requestTicket([this](QString nonce, QString userID) {
|
||||
oculusDisplay->requestTicket([this](QString nonce, QString userID) {
|
||||
// if (nonce.isEmpty() || userID.isEmpty()) {
|
||||
// emit handleLoginFailed();
|
||||
// return;
|
||||
|
|
|
@ -21,6 +21,7 @@ class DisplayPlugin;
|
|||
class InputPlugin;
|
||||
class CodecPlugin;
|
||||
class SteamClientPlugin;
|
||||
class OculusDisplayPlugin;
|
||||
class OculusPlatformPlugin;
|
||||
class Plugin;
|
||||
class PluginContainer;
|
||||
|
@ -36,5 +37,6 @@ using CodecPluginPointer = std::shared_ptr<CodecPlugin>;
|
|||
using CodecPluginList = std::vector<CodecPluginPointer>;
|
||||
using CodecPluginProvider = std::function<CodecPluginList()>;
|
||||
using SteamClientPluginPointer = std::shared_ptr<SteamClientPlugin>;
|
||||
using OculusDisplayPluginPointer = std::shared_ptr<OculusDisplayPlugin>;
|
||||
using OculusPlatformPluginPointer = std::shared_ptr<OculusPlatformPlugin>;
|
||||
using InputPluginSettingsPersister = std::function<void(const InputPluginList&)>;
|
||||
|
|
|
@ -179,8 +179,8 @@ const SteamClientPluginPointer PluginManager::getSteamClientPlugin() {
|
|||
return steamClientPlugin;
|
||||
}
|
||||
|
||||
const DisplayPluginPointer PluginManager::getOculusDisplayPlugin() {
|
||||
static DisplayPluginPointer oculusDisplayPlugin;
|
||||
const OculusDisplayPluginPointer PluginManager::getOculusDisplayPlugin() {
|
||||
static OculusDisplayPluginPointer oculusDisplayPlugin;
|
||||
static std::once_flag once;
|
||||
std::call_once(once, [&] {
|
||||
// Now grab the display plugins - might break in the main update loop if user unplugs the headset I think?
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
const InputPluginList& getInputPlugins();
|
||||
const CodecPluginList& getCodecPlugins();
|
||||
const SteamClientPluginPointer getSteamClientPlugin();
|
||||
const DisplayPluginPointer getOculusDisplayPlugin();
|
||||
const OculusDisplayPluginPointer getOculusDisplayPlugin();
|
||||
|
||||
DisplayPluginList getPreferredDisplayPlugins();
|
||||
void setPreferredDisplayPlugins(const QStringList& displays);
|
||||
|
|
|
@ -53,7 +53,6 @@ public:
|
|||
|
||||
class OculusPlatformProvider {
|
||||
public:
|
||||
virtual ~OculusPlatformProvider() {}
|
||||
virtual OculusPlatformPluginPointer getOculusPlatformPlugin() = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ bool OculusBaseDisplayPlugin::beginFrameRender(uint32_t frameIndex) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (ovr::quitRequested(status) || ovr::displayLost(status) || _isViewerEntitled) {
|
||||
if (ovr::quitRequested(status) || ovr::displayLost(status) || !_isViewerEntitled) {
|
||||
QMetaObject::invokeMethod(qApp, "quit");
|
||||
return false;
|
||||
}
|
||||
|
@ -255,6 +255,7 @@ void OculusBaseDisplayPlugin::handleOVREvents() {
|
|||
_user = ovr_User_GetOculusID(user);
|
||||
} else {
|
||||
qCDebug(oculusLog) << "Oculus Platform user retrieval failed" << QString(ovr_Error_GetMessage(ovr_Message_GetError(message)));
|
||||
_user = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -269,16 +270,24 @@ void OculusBaseDisplayPlugin::handleOVREvents() {
|
|||
break;
|
||||
}
|
||||
case ovrMessage_User_GetUserProof: {
|
||||
_nonceChanged = true;
|
||||
if (!ovr_Message_IsError(message)) {
|
||||
ovrUserProofHandle userProof = ovr_Message_GetUserProof(message);
|
||||
QString nonce = ovr_UserProof_GetNonce(userProof);
|
||||
_nonce = ovr_UserProof_GetNonce(userProof);
|
||||
} else {
|
||||
qCDebug(oculusLog) << "Oculus Platform nonce retrieval failed" << QString(ovr_Error_GetMessage(ovr_Message_GetError(message)));
|
||||
_nonce = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_nonceChanged) {
|
||||
emit nonceAndUserIDChanged(_nonce, _user);
|
||||
_nonce = _user = "";
|
||||
_nonceChanged = false;
|
||||
}
|
||||
|
||||
// free the message handle to cleanup and not leak
|
||||
ovr_FreeMessage(message);
|
||||
|
||||
|
|
|
@ -35,9 +35,7 @@ public:
|
|||
QVector<glm::vec3> getSensorPositions() override;
|
||||
|
||||
signals:
|
||||
void userIDChanged(uint64_t userID);
|
||||
void userChanged(QString user);
|
||||
void nonceChanged(QString nonce);
|
||||
void nonceAndUserIDChanged(QString nonce, QString userID);
|
||||
|
||||
protected:
|
||||
void customizeContext() override;
|
||||
|
@ -50,6 +48,7 @@ protected:
|
|||
protected:
|
||||
bool _isViewerEntitled;
|
||||
QString _nonce;
|
||||
bool _nonceChanged;
|
||||
QString _user;
|
||||
ovrID _userID;
|
||||
ovrSession _session{ nullptr };
|
||||
|
|
Loading…
Reference in a new issue