This commit is contained in:
Philip Rosedale 2014-06-28 11:22:22 -07:00
commit 93602328d9
13 changed files with 30 additions and 16 deletions

View file

@ -1169,6 +1169,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
bool DomainServer::handleHTTPSRequest(HTTPSConnection* connection, const QUrl &url) {
const QString URI_OAUTH = "/oauth";
qDebug() << "HTTPS request received at" << url.toString();
if (url.path() == URI_OAUTH) {
QUrlQuery codeURLQuery(url);

View file

@ -16,8 +16,8 @@ var avatarPosition;
var cameraNumber = 0;
var freeCamera = false;
var cameraLocations = [ {x: 7972.2, y: 241.6, z: 7304.1}, {x: 7973.0, y: 241.6, z: 7304.1}, {x: 7975.5, y: 241.6, z: 7304.1}, {x: 7972.3, y: 241.6, z: 7303.3}, {x: 7971.4, y: 241.6, z: 7304.3}, {x: 7973.5, y: 240.6, z: 7302.5} ];
var cameraLookAts = [ {x: 7971.1, y: 241.6, z: 7304.1}, {x: 7972.1, y: 241.6, z: 7304.1}, {x: 7972.1, y: 241.6, z: 7304.1}, {x: 7972.1, y: 241.6, z: 7304.1}, {x: 7972.1, y: 241.6, z: 7304.1}, {x: 7972.1, y: 241., z: 7304.1} ];
var cameraLocations = [ {x: 7971.9, y: 241.3, z: 7304.1}, {x: 7973.0, y: 241.3, z: 7304.1}, {x: 7975.5, y: 241.3, z: 7304.1}, {x: 7972.3, y: 241.3, z: 7303.3}, {x: 7971.0, y: 241.3, z: 7304.3}, {x: 7973.5, y: 240.7, z: 7302.5} ];
var cameraLookAts = [ {x: 7971.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7971.3, y: 241.3, z: 7304.2} ];
function saveCameraState() {
oldMode = Camera.getMode();

View file

@ -164,7 +164,7 @@ function SeatIndicator(modelProperties, seatIndex) {
size: this.scale,
solid: true,
color: { red: 0, green: 0, blue: 255 },
alpha: 1,
alpha: 0.3,
visible: true
});

View file

@ -3650,8 +3650,9 @@ void Application::stopAllScripts(bool restart) {
}
void Application::stopScript(const QString &scriptName) {
if (_scriptEnginesHash.contains(scriptName)) {
_scriptEnginesHash.value(scriptName)->stop();
const QString& scriptURLString = QUrl(scriptName).toString();
if (_scriptEnginesHash.contains(scriptURLString)) {
_scriptEnginesHash.value(scriptURLString)->stop();
qDebug() << "stopping script..." << scriptName;
}
}

View file

@ -108,9 +108,9 @@ Menu::Menu() :
_fastFPSAverage(ONE_SECOND_OF_FRAMES),
_loginAction(NULL),
_preferencesDialog(NULL),
_scriptsLocation(),
_loginDialog(NULL),
_snapshotsLocation()
_snapshotsLocation(),
_scriptsLocation()
{
Application *appInstance = Application::getInstance();

View file

@ -582,8 +582,8 @@ void Avatar::initializeHair() {
for (int link = 0; link < HAIR_LINKS; link++) {
int vertexIndex = strand * HAIR_LINKS + link;
// Clear constraints
for (int link = 0; link < HAIR_MAX_CONSTRAINTS; link++) {
_hairConstraints[vertexIndex * HAIR_MAX_CONSTRAINTS + link] = -1;
for (int link2 = 0; link2 < HAIR_MAX_CONSTRAINTS; link2++) {
_hairConstraints[vertexIndex * HAIR_MAX_CONSTRAINTS + link2] = -1;
}
if (vertexIndex % HAIR_LINKS == 0) {
// start of strand

View file

@ -376,7 +376,7 @@ void ApplicationOverlay::renderControllerPointers() {
//then disable it.
const int MAX_BUTTON_PRESS_TIME = 250 * MSECS_TO_USECS;
if (usecTimestampNow() - pressedTime[index] < MAX_BUTTON_PRESS_TIME) {
if (usecTimestampNow() < pressedTime[index] + MAX_BUTTON_PRESS_TIME) {
_magActive[index] = !stateWhenPressed[index];
}
}

View file

@ -109,6 +109,8 @@ void OAuthWebViewHandler::displayWebviewForAuthorizationURL(const QUrl& authoriz
connect(_activeWebView->page()->networkAccessManager(), &QNetworkAccessManager::sslErrors,
this, &OAuthWebViewHandler::handleSSLErrors);
connect(_activeWebView->page()->networkAccessManager(), &QNetworkAccessManager::finished,
this, &OAuthWebViewHandler::handleReplyFinished);
connect(_activeWebView.data(), &QWebView::loadFinished, this, &OAuthWebViewHandler::handleLoadFinished);
// connect to the destroyed signal so after the web view closes we can start a timer
@ -132,6 +134,14 @@ void OAuthWebViewHandler::handleLoadFinished(bool success) {
NodeList::getInstance()->setSessionUUID(QUuid(authQuery.queryItemValue(AUTH_STATE_QUERY_KEY)));
_activeWebView->close();
_activeWebView = NULL;
}
}
void OAuthWebViewHandler::handleReplyFinished(QNetworkReply* reply) {
if (_activeWebView && reply->error() != QNetworkReply::NoError) {
qDebug() << "Error loading" << reply->url() << "-" << reply->errorString();
_activeWebView->close();
}
}
@ -148,6 +158,7 @@ void OAuthWebViewHandler::handleURLChanged(const QUrl& url) {
_activeWebView->show();
} else if (url.toString() == DEFAULT_NODE_AUTH_URL.toString() + "/login") {
// this is a login request - we're going to close the webview and signal the AccountManager that we need a login
qDebug() << "data-server replied with login request. Signalling that login is required to proceed with OAuth.";
_activeWebView->close();
AccountManager::getInstance().checkAndSignalForAccessToken();
}

View file

@ -31,6 +31,7 @@ public slots:
private slots:
void handleSSLErrors(QNetworkReply* networkReply, const QList<QSslError>& errorList);
void handleLoadFinished(bool success);
void handleReplyFinished(QNetworkReply* reply);
void handleWebViewDestroyed(QObject* destroyedObject);
void handleURLChanged(const QUrl& url);
private:

View file

@ -28,8 +28,8 @@ RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
FramelessDialog(parent, 0, POSITION_LEFT),
ui(new Ui::RunningScriptsWidget),
_signalMapper(this),
_scriptsModel(this),
_proxyModel(this) {
_proxyModel(this),
_scriptsModel(this) {
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, false);

View file

@ -902,7 +902,7 @@ padding: 10px;margin-top:10px</string>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<layout class="QHBoxLayout" name="horizontalLayout_111">
<property name="spacing">
<number>0</number>
</property>
@ -937,7 +937,7 @@ padding: 10px;margin-top:10px</string>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<spacer name="horizontalSpacer_111">
<property name="font">
<font>
<family>Arial</family>

View file

@ -121,7 +121,7 @@ qint64 AudioRingBuffer::writeData(const char* data, qint64 maxSize) {
// make sure we have enough bytes left for this to be the right amount of audio
// otherwise we should not copy that data, and leave the buffer pointers where they are
int samplesToCopy = std::min((quint64)(maxSize / sizeof(int16_t)), (quint64)_sampleCapacity);
quint64 samplesToCopy = std::min((quint64)(maxSize / sizeof(int16_t)), (quint64)_sampleCapacity);
if (_hasStarted && samplesToCopy > _sampleCapacity - samplesAvailable()) {
// this read will cross the next output, so call us starved and reset the buffer

View file

@ -209,7 +209,7 @@ bool PositionalAudioRingBuffer::shouldBeAddedToMix() {
}
return false;
} else if (samplesAvailable() < samplesPerFrame) {
} else if (samplesAvailable() < (unsigned int)samplesPerFrame) {
// if the buffer doesn't have a full frame of samples to take for mixing, it is starved
_isStarved = true;