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