mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:43:45 +02:00
Merge branch 'master' into fix/update-api-docs
This commit is contained in:
commit
bc1ffa8a8d
25 changed files with 451 additions and 391 deletions
|
@ -154,18 +154,18 @@ public class EndpointUsersProvider implements UsersProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface EndpointUsersProviderService {
|
public interface EndpointUsersProviderService {
|
||||||
@GET("api/v1/users")
|
@GET("/api/v1/users")
|
||||||
Call<UsersResponse> getUsers(@Query("filter") String filter,
|
Call<UsersResponse> getUsers(@Query("filter") String filter,
|
||||||
@Query("per_page") int perPage,
|
@Query("per_page") int perPage,
|
||||||
@Query("online") Boolean online);
|
@Query("online") Boolean online);
|
||||||
|
|
||||||
@DELETE("api/v1/user/connections/{connectionUserName}")
|
@DELETE("/api/v1/user/connections/{connectionUserName}")
|
||||||
Call<UsersResponse> removeConnection(@Path("connectionUserName") String connectionUserName);
|
Call<UsersResponse> removeConnection(@Path("connectionUserName") String connectionUserName);
|
||||||
|
|
||||||
@DELETE("api/v1/user/friends/{friendUserName}")
|
@DELETE("/api/v1/user/friends/{friendUserName}")
|
||||||
Call<UsersResponse> removeFriend(@Path("friendUserName") String friendUserName);
|
Call<UsersResponse> removeFriend(@Path("friendUserName") String friendUserName);
|
||||||
|
|
||||||
@POST("api/v1/user/friends")
|
@POST("/api/v1/user/friends")
|
||||||
Call<UsersResponse> addFriend(@Body BodyAddFriend friendUserName);
|
Call<UsersResponse> addFriend(@Body BodyAddFriend friendUserName);
|
||||||
|
|
||||||
/* response
|
/* response
|
||||||
|
|
|
@ -169,7 +169,7 @@ public class UserStoryDomainProvider implements DomainProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface UserStoryDomainProviderService {
|
public interface UserStoryDomainProviderService {
|
||||||
@GET("api/v1/user_stories")
|
@GET("/api/v1/user_stories")
|
||||||
Call<UserStories> getUserStories(@Query("include_actions") String includeActions,
|
Call<UserStories> getUserStories(@Query("include_actions") String includeActions,
|
||||||
@Query("restriction") String restriction,
|
@Query("restriction") String restriction,
|
||||||
@Query("require_online") boolean requireOnline,
|
@Query("require_online") boolean requireOnline,
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
{
|
{
|
||||||
"name": "access_token",
|
"name": "access_token",
|
||||||
"label": "Access Token",
|
"label": "Access Token",
|
||||||
"help": "This is your OAuth access token to connect this domain-server with your High Fidelity account. <br/>It can be generated by clicking the 'Connect Account' button above.<br/>You can also go to the <a href='https://metaverse.highfidelity.com/user/security' target='_blank'>My Security</a> page of your account and generate a token with the 'domains' scope and paste it here.",
|
"help": "This is your OAuth access token to connect this domain-server with your Metaverse account. <br/>It can be generated by clicking the 'Connect Account' button above.<br/>You can also go to the Security page of your account on your Metaverse Server and generate a token with the 'domains' scope and paste it here.",
|
||||||
"advanced": true,
|
"advanced": true,
|
||||||
"backup": false
|
"backup": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"label": "Domain ID",
|
"label": "Domain ID",
|
||||||
"help": "This is your High Fidelity domain ID. If you do not want your domain to be registered in the High Fidelity metaverse you can leave this blank.",
|
"help": "This is your Metaverse domain ID. If you do not want your domain to be registered in the Metaverse you can leave this blank.",
|
||||||
"advanced": true
|
"advanced": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "automatic_networking",
|
"name": "automatic_networking",
|
||||||
"label": "Automatic Networking",
|
"label": "Automatic Networking",
|
||||||
"help": "This defines how other nodes in the High Fidelity metaverse will be able to reach your domain-server.<br/>If you don't want to deal with any network settings, use full automatic networking.",
|
"help": "This defines how other nodes in the Metaverse will be able to reach your domain-server.<br/>If you don't want to deal with any network settings, use full automatic networking.",
|
||||||
"default": "disabled",
|
"default": "disabled",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"options": [
|
"options": [
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"value": "disabled",
|
"value": "disabled",
|
||||||
"label": "None: use the network information I have entered for this domain at metaverse.highfidelity.com"
|
"label": "None: use the network information I have entered for this domain at in the Metaverse Server."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
{
|
{
|
||||||
"name": "enable_packet_verification",
|
"name": "enable_packet_verification",
|
||||||
"label": "Enable Packet Verification",
|
"label": "Enable Packet Verification",
|
||||||
"help": "Enable secure checksums on communication that uses the High Fidelity protocol. Increases security with possibly a small performance penalty.",
|
"help": "Enable secure checksums on communication that uses the Metaverse protocol. Increases security with possibly a small performance penalty.",
|
||||||
"default": true,
|
"default": true,
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"advanced": true
|
"advanced": true
|
||||||
|
@ -160,7 +160,7 @@
|
||||||
"name": "descriptors",
|
"name": "descriptors",
|
||||||
"label": "Description",
|
"label": "Description",
|
||||||
"restart": false,
|
"restart": false,
|
||||||
"help": "This data will be queryable from your server. It may be collected by High Fidelity and used to share your domain with others.",
|
"help": "This data will be queryable from your server. It may be collected by the Metaverse and used to share your domain with others.",
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"name": "world_name",
|
"name": "world_name",
|
||||||
|
|
|
@ -51,9 +51,9 @@ $.extend(Settings, {
|
||||||
var URLs = {
|
var URLs = {
|
||||||
// STABLE METAVERSE_URL: https://metaverse.highfidelity.com
|
// STABLE METAVERSE_URL: https://metaverse.highfidelity.com
|
||||||
// STAGING METAVERSE_URL: https://staging.highfidelity.com
|
// STAGING METAVERSE_URL: https://staging.highfidelity.com
|
||||||
METAVERSE_URL: 'https://metaverse.highfidelity.com',
|
DEFAULT_METAVERSE_URL: "https://metaverse.vircadia.com/live",
|
||||||
CDN_URL: 'https://cdn.highfidelity.com',
|
CDN_URL: 'https://content.vircadia.com/eu-c-1',
|
||||||
PLACE_URL: 'https://hifi.place',
|
PLACE_URL: 'https://xr.place'
|
||||||
};
|
};
|
||||||
|
|
||||||
var Strings = {
|
var Strings = {
|
||||||
|
@ -61,7 +61,7 @@ var Strings = {
|
||||||
|
|
||||||
CHOOSE_DOMAIN_BUTTON: "Choose from my domains",
|
CHOOSE_DOMAIN_BUTTON: "Choose from my domains",
|
||||||
CREATE_DOMAIN_BUTTON: "Create new domain ID",
|
CREATE_DOMAIN_BUTTON: "Create new domain ID",
|
||||||
CREATE_DOMAIN_SUCCESS_JUST_CONNECTED: "We connnected your High Fidelity account and created a new domain ID for this machine.",
|
CREATE_DOMAIN_SUCCESS_JUST_CONNECTED: "We connnected your Metaverse account and created a new domain ID for this machine.",
|
||||||
CREATE_DOMAIN_SUCCESS: "We created a new domain ID for this machine.",
|
CREATE_DOMAIN_SUCCESS: "We created a new domain ID for this machine.",
|
||||||
|
|
||||||
// When a place modification fails, they will be brought back to the previous
|
// When a place modification fails, they will be brought back to the previous
|
||||||
|
@ -92,7 +92,7 @@ var Strings = {
|
||||||
ADD_PLACE_LOADING_DIALOG: "Loading your places...",
|
ADD_PLACE_LOADING_DIALOG: "Loading your places...",
|
||||||
|
|
||||||
ADD_PLACE_NOT_CONNECTED_TITLE: "Access token required",
|
ADD_PLACE_NOT_CONNECTED_TITLE: "Access token required",
|
||||||
ADD_PLACE_NOT_CONNECTED_MESSAGE: "You must have an access token to query your High Fidelity places.<br><br>Please follow the instructions on the settings page to add an access token.",
|
ADD_PLACE_NOT_CONNECTED_MESSAGE: "You must have an access token to query your Metaverse places.<br><br>Please follow the instructions on the settings page to add an access token.",
|
||||||
};
|
};
|
||||||
|
|
||||||
var DOMAIN_ID_TYPE_NONE = 0;
|
var DOMAIN_ID_TYPE_NONE = 0;
|
||||||
|
@ -230,213 +230,212 @@ function getDomainFromAPI(callback) {
|
||||||
|
|
||||||
function chooseFromHighFidelityPlaces(accessToken, forcePathTo, onSuccessfullyAdded) {
|
function chooseFromHighFidelityPlaces(accessToken, forcePathTo, onSuccessfullyAdded) {
|
||||||
if (accessToken) {
|
if (accessToken) {
|
||||||
|
getMetaverseUrl(function(metaverse_url) {
|
||||||
|
|
||||||
var loadingDialog = showLoadingDialog(Strings.ADD_PLACE_LOADING_DIALOG);
|
var loadingDialog = showLoadingDialog(Strings.ADD_PLACE_LOADING_DIALOG);
|
||||||
|
|
||||||
function loadPlaces() {
|
function loadPlaces() {
|
||||||
$.ajax("/api/places", {
|
$.ajax("/api/places", {
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
jsonp: false,
|
jsonp: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.status == 'success') {
|
if (data.status == 'success') {
|
||||||
var modal_buttons = {
|
var modal_buttons = {
|
||||||
cancel: {
|
cancel: {
|
||||||
label: Strings.ADD_PLACE_CANCEL_BUTTON,
|
label: Strings.ADD_PLACE_CANCEL_BUTTON,
|
||||||
className: 'add-place-cancel-button btn-default'
|
className: 'add-place-cancel-button btn-default'
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var dialog;
|
|
||||||
var modal_body;
|
|
||||||
|
|
||||||
if (data.data.places.length) {
|
|
||||||
var places_by_id = {};
|
|
||||||
|
|
||||||
modal_body = $('<div>');
|
|
||||||
|
|
||||||
modal_body.append($("<p>Choose a place name that you own or <a href='" + URLs.METAVERSE_URL + "/user/places' target='_blank'>register a new place name</a></p>"));
|
|
||||||
|
|
||||||
var currentDomainIDType = getCurrentDomainIDType();
|
|
||||||
if (currentDomainIDType === DOMAIN_ID_TYPE_TEMP) {
|
|
||||||
var warning = "<div class='domain-loading-error alert alert-warning'>";
|
|
||||||
warning += "If you choose a place name it will replace your current temporary place name.";
|
|
||||||
warning += "</div>";
|
|
||||||
modal_body.append(warning);
|
|
||||||
}
|
|
||||||
|
|
||||||
// setup a select box for the returned places
|
|
||||||
modal_body.append($("<label for='place-name-select'>Places</label>"));
|
|
||||||
place_select = $("<select id='place-name-select' class='form-control'></select>");
|
|
||||||
_.each(data.data.places, function(place) {
|
|
||||||
places_by_id[place.id] = place;
|
|
||||||
place_select.append("<option value='" + place.id + "'>" + place.name + "</option>");
|
|
||||||
})
|
|
||||||
modal_body.append(place_select);
|
|
||||||
modal_body.append($("<p id='place-name-warning' class='warning-text' style='display: none'>This place name already points to a place or path. Saving this would overwrite the previous settings associated with it.</p>"));
|
|
||||||
|
|
||||||
if (forcePathTo === undefined || forcePathTo === null) {
|
|
||||||
var path = "<div class='form-group'>";
|
|
||||||
path += "<label for='place-path-input' class='control-label'>Path or Viewpoint</label>";
|
|
||||||
path += "<input type='text' id='place-path-input' class='form-control' value='/'>";
|
|
||||||
path += "</div>";
|
|
||||||
modal_body.append($(path));
|
|
||||||
}
|
|
||||||
|
|
||||||
var place_select = modal_body.find("#place-name-select")
|
|
||||||
place_select.change(function(ev) {
|
|
||||||
var warning = modal_body.find("#place-name-warning");
|
|
||||||
var place = places_by_id[$(this).val()];
|
|
||||||
if (place === undefined || place.pointee === null) {
|
|
||||||
warning.hide();
|
|
||||||
} else {
|
|
||||||
warning.show();
|
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
place_select.trigger('change');
|
|
||||||
|
|
||||||
modal_buttons["success"] = {
|
var dialog;
|
||||||
label: Strings.ADD_PLACE_CONFIRM_BUTTON,
|
var modal_body;
|
||||||
className: 'add-place-confirm-button btn btn-primary',
|
if (data.data.places.length) {
|
||||||
callback: function() {
|
var places_by_id = {};
|
||||||
var placeID = $('#place-name-select').val();
|
|
||||||
// set the place ID on the form
|
|
||||||
$(Settings.place_ID_SELECTOR).val(placeID).change();
|
|
||||||
|
|
||||||
if (forcePathTo === undefined || forcePathTo === null) {
|
modal_body = $('<div>');
|
||||||
var placePath = $('#place-path-input').val();
|
|
||||||
|
modal_body.append($("<p>Choose a place name that you own or <a href='" + metaverse_url + "/user/places' target='_blank'>register a new place name</a></p>"));
|
||||||
|
|
||||||
|
var currentDomainIDType = getCurrentDomainIDType();
|
||||||
|
if (currentDomainIDType === DOMAIN_ID_TYPE_TEMP) {
|
||||||
|
var warning = "<div class='domain-loading-error alert alert-warning'>";
|
||||||
|
warning += "If you choose a place name it will replace your current temporary place name.";
|
||||||
|
warning += "</div>";
|
||||||
|
modal_body.append(warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup a select box for the returned places
|
||||||
|
modal_body.append($("<label for='place-name-select'>Places</label>"));
|
||||||
|
place_select = $("<select id='place-name-select' class='form-control'></select>");
|
||||||
|
_.each(data.data.places, function(place) {
|
||||||
|
places_by_id[place.id] = place;
|
||||||
|
place_select.append("<option value='" + place.id + "'>" + place.name + "</option>");
|
||||||
|
})
|
||||||
|
modal_body.append(place_select);
|
||||||
|
modal_body.append($("<p id='place-name-warning' class='warning-text' style='display: none'>This place name already points to a place or path. Saving this would overwrite the previous settings associated with it.</p>"));
|
||||||
|
|
||||||
|
if (forcePathTo === undefined || forcePathTo === null) {
|
||||||
|
var path = "<div class='form-group'>";
|
||||||
|
path += "<label for='place-path-input' class='control-label'>Path or Viewpoint</label>";
|
||||||
|
path += "<input type='text' id='place-path-input' class='form-control' value='/'>";
|
||||||
|
path += "</div>";
|
||||||
|
modal_body.append($(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
var place_select = modal_body.find("#place-name-select")
|
||||||
|
place_select.change(function(ev) {
|
||||||
|
var warning = modal_body.find("#place-name-warning");
|
||||||
|
var place = places_by_id[$(this).val()];
|
||||||
|
if (place === undefined || place.pointee === null) {
|
||||||
|
warning.hide();
|
||||||
} else {
|
} else {
|
||||||
var placePath = forcePathTo;
|
warning.show();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
place_select.trigger('change');
|
||||||
|
|
||||||
$('.add-place-confirm-button').attr('disabled', 'disabled');
|
modal_buttons["success"] = {
|
||||||
$('.add-place-confirm-button').html(Strings.ADD_PLACE_CONFIRM_BUTTON_PENDING);
|
label: Strings.ADD_PLACE_CONFIRM_BUTTON,
|
||||||
$('.add-place-cancel-button').attr('disabled', 'disabled');
|
className: 'add-place-confirm-button btn btn-primary',
|
||||||
|
callback: function() {
|
||||||
|
var placeID = $('#place-name-select').val();
|
||||||
|
// set the place ID on the form
|
||||||
|
$(Settings.place_ID_SELECTOR).val(placeID).change();
|
||||||
|
|
||||||
function finalizeSaveDomainID(domainID) {
|
if (forcePathTo === undefined || forcePathTo === null) {
|
||||||
var jsonSettings = {
|
var placePath = $('#place-path-input').val();
|
||||||
metaverse: {
|
|
||||||
id: domainID
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var dialog = showLoadingDialog("Waiting for Domain Server to restart...");
|
|
||||||
$.ajax('/settings.json', {
|
|
||||||
data: JSON.stringify(jsonSettings),
|
|
||||||
contentType: 'application/json',
|
|
||||||
type: 'POST'
|
|
||||||
}).done(function(data) {
|
|
||||||
if (data.status == "success") {
|
|
||||||
waitForDomainServerRestart(function() {
|
|
||||||
dialog.modal('hide');
|
|
||||||
if (onSuccessfullyAdded) {
|
|
||||||
onSuccessfullyAdded(places_by_id[placeID].name, domainID);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
bootbox.alert("Failed to add place");
|
|
||||||
}
|
|
||||||
}).fail(function() {
|
|
||||||
bootbox.alert("Failed to add place");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// If domainID is not specified, the current domain id will be used.
|
|
||||||
function finishSettingUpPlace(domainID) {
|
|
||||||
sendUpdatePlaceRequest(
|
|
||||||
placeID,
|
|
||||||
placePath,
|
|
||||||
domainID,
|
|
||||||
false,
|
|
||||||
function(data) {
|
|
||||||
dialog.modal('hide')
|
|
||||||
if (domainID) {
|
|
||||||
$(Settings.DOMAIN_ID_SELECTOR).val(domainID).change();
|
|
||||||
finalizeSaveDomainID(domainID);
|
|
||||||
} else {
|
|
||||||
if (onSuccessfullyAdded) {
|
|
||||||
onSuccessfullyAdded(places_by_id[placeID].name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function(data) {
|
|
||||||
$('.add-place-confirm-button').removeAttr('disabled');
|
|
||||||
$('.add-place-confirm-button').html(Strings.ADD_PLACE_CONFIRM_BUTTON);
|
|
||||||
$('.add-place-cancel-button').removeAttr('disabled');
|
|
||||||
bootbox.alert(Strings.ADD_PLACE_UNKNOWN_ERROR);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function maybeCreateNewDomainID() {
|
|
||||||
console.log("Maybe creating domain id", currentDomainIDType)
|
|
||||||
if (currentDomainIDType === DOMAIN_ID_TYPE_FULL) {
|
|
||||||
finishSettingUpPlace();
|
|
||||||
} else {
|
} else {
|
||||||
sendCreateDomainRequest(function(domainID) {
|
var placePath = forcePathTo;
|
||||||
console.log("Created domain", domainID);
|
}
|
||||||
finishSettingUpPlace(domainID);
|
|
||||||
}, function() {
|
$('.add-place-confirm-button').attr('disabled', 'disabled');
|
||||||
$('.add-place-confirm-button').removeAttr('disabled');
|
$('.add-place-confirm-button').html(Strings.ADD_PLACE_CONFIRM_BUTTON_PENDING);
|
||||||
$('.add-place-confirm-button').html(Strings.ADD_PLACE_CONFIRM_BUTTON);
|
$('.add-place-cancel-button').attr('disabled', 'disabled');
|
||||||
$('.add-place-cancel-button').removeAttr('disabled');
|
|
||||||
bootbox.alert(Strings.ADD_PLACE_UNKNOWN_ERROR);
|
function finalizeSaveDomainID(domainID) {
|
||||||
|
var jsonSettings = {
|
||||||
|
metaverse: {
|
||||||
|
id: domainID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var dialog = showLoadingDialog("Waiting for Domain Server to restart...");
|
||||||
|
$.ajax('/settings.json', {
|
||||||
|
data: JSON.stringify(jsonSettings),
|
||||||
|
contentType: 'application/json',
|
||||||
|
type: 'POST'
|
||||||
|
}).done(function(data) {
|
||||||
|
if (data.status == "success") {
|
||||||
|
waitForDomainServerRestart(function() {
|
||||||
|
dialog.modal('hide');
|
||||||
|
if (onSuccessfullyAdded) {
|
||||||
|
onSuccessfullyAdded(places_by_id[placeID].name, domainID);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
bootbox.alert("Failed to add place");
|
||||||
|
}
|
||||||
|
}).fail(function() {
|
||||||
|
bootbox.alert("Failed to add place");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If domainID is not specified, the current domain id will be used.
|
||||||
|
function finishSettingUpPlace(domainID) {
|
||||||
|
sendUpdatePlaceRequest(
|
||||||
|
placeID,
|
||||||
|
placePath,
|
||||||
|
domainID,
|
||||||
|
false,
|
||||||
|
function(data) {
|
||||||
|
dialog.modal('hide')
|
||||||
|
if (domainID) {
|
||||||
|
$(Settings.DOMAIN_ID_SELECTOR).val(domainID).change();
|
||||||
|
finalizeSaveDomainID(domainID);
|
||||||
|
} else {
|
||||||
|
if (onSuccessfullyAdded) {
|
||||||
|
onSuccessfullyAdded(places_by_id[placeID].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function(data) {
|
||||||
|
$('.add-place-confirm-button').removeAttr('disabled');
|
||||||
|
$('.add-place-confirm-button').html(Strings.ADD_PLACE_CONFIRM_BUTTON);
|
||||||
|
$('.add-place-cancel-button').removeAttr('disabled');
|
||||||
|
bootbox.alert(Strings.ADD_PLACE_UNKNOWN_ERROR);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function maybeCreateNewDomainID() {
|
||||||
|
console.log("Maybe creating domain id", currentDomainIDType)
|
||||||
|
if (currentDomainIDType === DOMAIN_ID_TYPE_FULL) {
|
||||||
|
finishSettingUpPlace();
|
||||||
|
} else {
|
||||||
|
sendCreateDomainRequest(function(domainID) {
|
||||||
|
console.log("Created domain", domainID);
|
||||||
|
finishSettingUpPlace(domainID);
|
||||||
|
}, function() {
|
||||||
|
$('.add-place-confirm-button').removeAttr('disabled');
|
||||||
|
$('.add-place-confirm-button').html(Strings.ADD_PLACE_CONFIRM_BUTTON);
|
||||||
|
$('.add-place-cancel-button').removeAttr('disabled');
|
||||||
|
bootbox.alert(Strings.ADD_PLACE_UNKNOWN_ERROR);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maybeCreateNewDomainID();
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
maybeCreateNewDomainID();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
modal_buttons["success"] = {
|
||||||
|
label: Strings.ADD_PLACE_NO_PLACES_BUTTON,
|
||||||
|
callback: function() {
|
||||||
|
window.open(metaverse_url + "/user/places", '_blank');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
modal_body = Strings.ADD_PLACE_NO_PLACES_MESSAGE;
|
||||||
}
|
}
|
||||||
|
dialog = bootbox.dialog({
|
||||||
|
title: Strings.ADD_PLACE_TITLE,
|
||||||
|
message: modal_body,
|
||||||
|
closeButton: false,
|
||||||
|
buttons: modal_buttons,
|
||||||
|
onEscape: true
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
modal_buttons["success"] = {
|
bootbox.alert(Strings.ADD_PLACE_UNABLE_TO_LOAD_ERROR);
|
||||||
label: Strings.ADD_PLACE_NO_PLACES_BUTTON,
|
|
||||||
callback: function() {
|
|
||||||
window.open(URLs.METAVERSE_URL + "/user/places", '_blank');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
modal_body = Strings.ADD_PLACE_NO_PLACES_MESSAGE;
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
dialog = bootbox.dialog({
|
error: function() {
|
||||||
title: Strings.ADD_PLACE_TITLE,
|
|
||||||
message: modal_body,
|
|
||||||
closeButton: false,
|
|
||||||
buttons: modal_buttons,
|
|
||||||
onEscape: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
bootbox.alert(Strings.ADD_PLACE_UNABLE_TO_LOAD_ERROR);
|
bootbox.alert(Strings.ADD_PLACE_UNABLE_TO_LOAD_ERROR);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
loadingDialog.modal('hide');
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
error: function() {
|
}
|
||||||
bootbox.alert(Strings.ADD_PLACE_UNABLE_TO_LOAD_ERROR);
|
|
||||||
},
|
|
||||||
complete: function() {
|
|
||||||
loadingDialog.modal('hide');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var domainType = getCurrentDomainIDType();
|
|
||||||
if (domainType !== DOMAIN_ID_TYPE_UNKNOWN) {
|
|
||||||
loadPlaces();
|
|
||||||
} else {
|
|
||||||
getDomainFromAPI(function(data) {
|
|
||||||
if (data.status === 'success') {
|
|
||||||
var domainType = getCurrentDomainIDType();
|
|
||||||
loadPlaces();
|
|
||||||
} else {
|
|
||||||
loadingDialog.modal('hide');
|
|
||||||
bootbox.confirm("We were not able to load your domain information from the Metaverse. Would you like to retry?", function(response) {
|
|
||||||
if (response) {
|
|
||||||
chooseFromHighFidelityPlaces(accessToken, forcePathTo, onSuccessfullyAdded);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var domainType = getCurrentDomainIDType();
|
||||||
|
if (domainType !== DOMAIN_ID_TYPE_UNKNOWN) {
|
||||||
|
loadPlaces();
|
||||||
|
} else {
|
||||||
|
getDomainFromAPI(function(data) {
|
||||||
|
if (data.status === 'success') {
|
||||||
|
var domainType = getCurrentDomainIDType();
|
||||||
|
loadPlaces();
|
||||||
|
} else {
|
||||||
|
loadingDialog.modal('hide');
|
||||||
|
bootbox.confirm("We were not able to load your domain information from the Metaverse. Would you like to retry?", function(response) {
|
||||||
|
if (response) {
|
||||||
|
chooseFromHighFidelityPlaces(accessToken, forcePathTo, onSuccessfullyAdded);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
bootbox.alert({
|
bootbox.alert({
|
||||||
title: Strings.ADD_PLACE_NOT_CONNECTED_TITLE,
|
title: Strings.ADD_PLACE_NOT_CONNECTED_TITLE,
|
||||||
|
@ -507,8 +506,7 @@ function getMetaverseUrl(callback) {
|
||||||
callback(data.metaverse_url);
|
callback(data.metaverse_url);
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
callback(URLs.METAVERSE_URL);
|
callback(URLs.DEFAULT_METAVERSE_URL);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
Settings.extraGroupsAtEnd = Settings.extraDomainGroupsAtEnd;
|
Settings.extraGroupsAtEnd = Settings.extraDomainGroupsAtEnd;
|
||||||
Settings.extraGroupsAtIndex = Settings.extraDomainGroupsAtIndex;
|
Settings.extraGroupsAtIndex = Settings.extraDomainGroupsAtIndex;
|
||||||
var METAVERSE_URL = URLs.METAVERSE_URL;
|
var METAVERSE_URL = URLs.DEFAULT_METAVERSE_URL;
|
||||||
|
|
||||||
var SSL_PRIVATE_KEY_FILE_ID = 'ssl-private-key-file';
|
var SSL_PRIVATE_KEY_FILE_ID = 'ssl-private-key-file';
|
||||||
var SSL_PRIVATE_KEY_CONTENTS_ID = 'key-contents';
|
var SSL_PRIVATE_KEY_CONTENTS_ID = 'key-contents';
|
||||||
|
@ -277,7 +277,7 @@ $(document).ready(function(){
|
||||||
swal({
|
swal({
|
||||||
title: '',
|
title: '',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
text: "There was a problem retrieving domain information from High Fidelity API.",
|
text: "There was a problem retrieving domain information from the Metaverse API.",
|
||||||
confirmButtonText: 'Try again',
|
confirmButtonText: 'Try again',
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
closeOnConfirm: false
|
closeOnConfirm: false
|
||||||
|
@ -306,7 +306,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
if (hasAccessToken) {
|
if (hasAccessToken) {
|
||||||
el = "<p>";
|
el = "<p>";
|
||||||
el += "<span class='account-connected-header'>High Fidelity Account Connected</span>";
|
el += "<span class='account-connected-header'>Metaverse Account Connected</span>";
|
||||||
el += "<button id='" + Settings.DISCONNECT_ACCOUNT_BTN_ID + "' class='btn'>Disconnect</button>";
|
el += "<button id='" + Settings.DISCONNECT_ACCOUNT_BTN_ID + "' class='btn'>Disconnect</button>";
|
||||||
el += "</p>";
|
el += "</p>";
|
||||||
el = $(el);
|
el = $(el);
|
||||||
|
@ -319,7 +319,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
buttonSetting.help = "";
|
buttonSetting.help = "";
|
||||||
buttonSetting.classes = "btn-primary";
|
buttonSetting.classes = "btn-primary";
|
||||||
buttonSetting.button_label = "Connect High Fidelity Account";
|
buttonSetting.button_label = "Connect Metaverse Account";
|
||||||
buttonSetting.html_id = Settings.CONNECT_ACCOUNT_BTN_ID;
|
buttonSetting.html_id = Settings.CONNECT_ACCOUNT_BTN_ID;
|
||||||
|
|
||||||
buttonSetting.href = METAVERSE_URL + "/user/tokens/new?for_domain_server=true";
|
buttonSetting.href = METAVERSE_URL + "/user/tokens/new?for_domain_server=true";
|
||||||
|
@ -713,7 +713,7 @@ $(document).ready(function(){
|
||||||
html_id: Settings.PLACES_TABLE_ID,
|
html_id: Settings.PLACES_TABLE_ID,
|
||||||
help: "The following places currently point to this domain.</br>To point places to this domain, "
|
help: "The following places currently point to this domain.</br>To point places to this domain, "
|
||||||
+ " go to the <a href='" + METAVERSE_URL + "/user/places'>My Places</a> "
|
+ " go to the <a href='" + METAVERSE_URL + "/user/places'>My Places</a> "
|
||||||
+ "page in your High Fidelity Metaverse account.",
|
+ "page in your Metaverse account.",
|
||||||
read_only: true,
|
read_only: true,
|
||||||
can_add_new_rows: false,
|
can_add_new_rows: false,
|
||||||
columns: [
|
columns: [
|
||||||
|
@ -997,7 +997,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
if (data.data.domains.length) {
|
if (data.data.domains.length) {
|
||||||
// setup a select box for the returned domains
|
// setup a select box for the returned domains
|
||||||
modal_body = "<p>Choose the High Fidelity domain you want this domain-server to represent.<br/>This will set your domain ID on the settings page.</p>";
|
modal_body = "<p>Choose the Metaverse domain you want this domain-server to represent.<br/>This will set your domain ID on the settings page.</p>";
|
||||||
domain_select = $("<select id='domain-name-select' class='form-control'></select>");
|
domain_select = $("<select id='domain-name-select' class='form-control'></select>");
|
||||||
_.each(data.data.domains, function(domain){
|
_.each(data.data.domains, function(domain){
|
||||||
var domainString = "";
|
var domainString = "";
|
||||||
|
@ -1026,7 +1026,7 @@ $(document).ready(function(){
|
||||||
window.open(METAVERSE_URL + "/user/domains", '_blank');
|
window.open(METAVERSE_URL + "/user/domains", '_blank');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modal_body = "<p>You do not have any domains in your High Fidelity account." +
|
modal_body = "<p>You do not have any domains in your Metaverse account." +
|
||||||
"<br/><br/>Go to your domains page to create a new one. Once your domain is created re-open this dialog to select it.</p>"
|
"<br/><br/>Go to your domains page to create a new one. Once your domain is created re-open this dialog to select it.</p>"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1038,7 +1038,7 @@ $(document).ready(function(){
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
bootbox.alert("Failed to retrieve your domains from the High Fidelity Metaverse");
|
bootbox.alert("Failed to retrieve your domains from the Metaverse");
|
||||||
},
|
},
|
||||||
complete: function() {
|
complete: function() {
|
||||||
// remove the spinner from the choose button
|
// remove the spinner from the choose button
|
||||||
|
@ -1049,7 +1049,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
bootbox.alert({
|
bootbox.alert({
|
||||||
message: "You must have an access token to query your High Fidelity domains.<br><br>" +
|
message: "You must have an access token to query your Metaverse domains.<br><br>" +
|
||||||
"Please follow the instructions on the settings page to add an access token.",
|
"Please follow the instructions on the settings page to add an access token.",
|
||||||
title: "Access token required"
|
title: "Access token required"
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
<h4 class="step-title"></h4>
|
<h4 class="step-title"></h4>
|
||||||
<dl class="row">
|
<dl class="row">
|
||||||
<dd class="col-md-12">
|
<dd class="col-md-12">
|
||||||
<span class='step-description'>By connecting your High Fidelity Account you will be granting access to your account information.</span>
|
<span class='step-description'>By connecting your Metaverse Account you will be granting access to your account information.</span>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="row">
|
<dl class="row">
|
||||||
<dd class="col-md-12">
|
<dd class="col-md-12">
|
||||||
<a id="connect-account-btn" role="button" class="btn btn-primary btn-md btn-block" target="_blank">Connect your High Fidelity account</a>
|
<a id="connect-account-btn" role="button" class="btn btn-primary btn-md btn-block" target="_blank">Connect your Metaverse account</a>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<span class='step-description'>
|
<span class='step-description'>
|
||||||
<a target='_blank' href='https://docs.vircadia.dev/create-and-explore/start-working-in-your-sandbox/place-names'>Place names</a> are similar to web addresses. Users who want to visit your domain can
|
<a target='_blank' href='https://docs.vircadia.dev/create-and-explore/start-working-in-your-sandbox/place-names'>Place names</a> are similar to web addresses. Users who want to visit your domain can
|
||||||
enter its Place Name in High Fidelity's Interface. You can choose a Place Name for your domain.</br>
|
enter its Place Name in Vircadia's Interface. You can choose a Place Name for your domain.</br>
|
||||||
Your domain may also be reachable by <b>IP address</b>.
|
Your domain may also be reachable by <b>IP address</b>.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -56,11 +56,11 @@
|
||||||
<div class="wizard-step col-md-9 col-centered" style="display: none;">
|
<div class="wizard-step col-md-9 col-centered" style="display: none;">
|
||||||
<h4 class="step-title"></h4>
|
<h4 class="step-title"></h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<p id="permissions-description" class="col-md-12 step-info"><b>Localhost</b> has been granted administrator privileges to this domain. (Localhost is any</br>user on the same machine as the High Fidelity Server)</p>
|
<p id="permissions-description" class="col-md-12 step-info"><b>Localhost</b> has been granted administrator privileges to this domain. (Localhost is any</br>user on the same machine as the Vircadia Server)</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="admin-row" class="row">
|
<div id="admin-row" class="row">
|
||||||
<p class="col-md-6">
|
<p class="col-md-6">
|
||||||
<span class="step-info"><span id="admin-description"><b>Add your High Fidelity username</b> and any other usernames</span> to grant <span class='wizard-link' data-toggle="tooltip" title="Users who will have all the permissions for this domain.">administrator privileges</span></span>
|
<span class="step-info"><span id="admin-description"><b>Add your Metaverse username</b> and any other usernames</span> to grant <span class='wizard-link' data-toggle="tooltip" title="Users who will have all the permissions for this domain.">administrator privileges</span></span>
|
||||||
</p>
|
</p>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input id="admin-usernames" type="text" class="form-control">
|
<input id="admin-usernames" type="text" class="form-control">
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p class="col-md-5">
|
<p class="col-md-5">
|
||||||
<label>
|
<label>
|
||||||
<input id="connect-logged-in" name="connect-radio" type="radio" value="logged-in"> Users logged into High Fidelity
|
<input id="connect-logged-in" name="connect-radio" type="radio" value="logged-in"> Users logged into the Metaverse
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p class="col-md-2">
|
<p class="col-md-2">
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p class="col-md-5">
|
<p class="col-md-5">
|
||||||
<label>
|
<label>
|
||||||
<input id="rez-logged-in" name="rez-radio" type="radio" value="logged-in" disabled> Users logged into High Fidelity
|
<input id="rez-logged-in" name="rez-radio" type="radio" value="logged-in" disabled> Users logged into the Metaverse
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p class="col-md-2">
|
<p class="col-md-2">
|
||||||
|
@ -164,14 +164,14 @@
|
||||||
<dt class="col-md-4 step-info">Username</dt>
|
<dt class="col-md-4 step-info">Username</dt>
|
||||||
<dd class="col-md-8">
|
<dd class="col-md-8">
|
||||||
<input id="http_username" type="text" class="form-control">
|
<input id="http_username" type="text" class="form-control">
|
||||||
<span class='help-block'>This does not have to be your High Fidelity username</span>
|
<span class='help-block'>This does not have to be your Metaverse username</span>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="row">
|
<dl class="row">
|
||||||
<dt class="col-md-4 step-info">Enter password</dt>
|
<dt class="col-md-4 step-info">Enter password</dt>
|
||||||
<dd class="col-md-8">
|
<dd class="col-md-8">
|
||||||
<input id="http_password" type="password" class="form-control">
|
<input id="http_password" type="password" class="form-control">
|
||||||
<span class='help-block'>This should not be the same as your High Fidelity password</span>
|
<span class='help-block'>This should not be the same as your Metaverse password</span>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl id="verify-password-row" class="row">
|
<dl id="verify-password-row" class="row">
|
||||||
|
@ -262,4 +262,5 @@
|
||||||
<script src='/js/bootbox.min.js'></script>
|
<script src='/js/bootbox.min.js'></script>
|
||||||
<script src='/js/sha256.js'></script>
|
<script src='/js/sha256.js'></script>
|
||||||
<script src='js/wizard.js'></script>
|
<script src='js/wizard.js'></script>
|
||||||
|
<script src='../js/shared.js'></script>
|
||||||
<!--#include virtual="page-end.html"-->
|
<!--#include virtual="page-end.html"-->
|
||||||
|
|
|
@ -2,121 +2,127 @@ var Metaverse = {
|
||||||
accessToken: null
|
accessToken: null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var CURRENT_METAVERSE_URL;
|
||||||
|
|
||||||
var currentStepNumber;
|
var currentStepNumber;
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
Strings.ADD_PLACE_NOT_CONNECTED_MESSAGE = "You must have an access token to query your High Fidelity places.<br><br>" +
|
getMetaverseUrl(function(metaverse_url) {
|
||||||
"Please go back and connect your account.";
|
CURRENT_METAVERSE_URL = metaverse_url;
|
||||||
|
|
||||||
$('#connect-account-btn').attr('href', URLs.METAVERSE_URL + "/user/tokens/new?for_domain_server=true");
|
Strings.ADD_PLACE_NOT_CONNECTED_MESSAGE = "You must have an access token to query your Metaverse places.<br><br>" +
|
||||||
|
"Please go back and connect your account.";
|
||||||
|
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('#connect-account-btn').attr('href', CURRENT_METAVERSE_URL + "/user/tokens/new?for_domain_server=true");
|
||||||
|
|
||||||
$('.perms-link').on('click', function() {
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
var modal_body = '<div>';
|
|
||||||
modal_body += '<b>None</b> - No one will have permissions. Only you and the users your have given administrator privileges to will have permissions.</br></br>';
|
|
||||||
modal_body += '<b>Friends</b> - Users who are your Friends in High Fidelity.</br></br>';
|
|
||||||
modal_body += '<b>Users logged into High Fidelity</b> - Users who are currently logged into High Fidelity.</br></br>';
|
|
||||||
modal_body += '<b>Everyone</b> - Anyone who uses High Fidelity.';
|
|
||||||
modal_body += '</div>';
|
|
||||||
|
|
||||||
dialog = bootbox.dialog({
|
$('.perms-link').on('click', function() {
|
||||||
title: "User definition",
|
var modal_body = '<div>';
|
||||||
message: modal_body,
|
modal_body += '<b>None</b> - No one will have permissions. Only you and the users your have given administrator privileges to will have permissions.</br></br>';
|
||||||
closeButton: true
|
modal_body += '<b>Friends</b> - Users who are your Friends in the Metaverse.</br></br>';
|
||||||
});
|
modal_body += '<b>Users logged into the Metaverse</b> - Users who are currently logged into the Metaverse.</br></br>';
|
||||||
return false;
|
modal_body += '<b>Everyone</b> - Anyone who uses the Metaverse.';
|
||||||
});
|
modal_body += '</div>';
|
||||||
|
|
||||||
$('body').on('click', '.next-button', function() {
|
dialog = bootbox.dialog({
|
||||||
goToNextStep();
|
title: "User definition",
|
||||||
});
|
message: modal_body,
|
||||||
|
closeButton: true
|
||||||
$('body').on('click', '.back-button', function() {
|
|
||||||
goToPreviousStep();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('body').on('click', '#skip-wizard-button', function() {
|
|
||||||
skipWizard();
|
|
||||||
})
|
|
||||||
|
|
||||||
$('body').on('click', '#connect-account-btn', function() {
|
|
||||||
$(this).blur();
|
|
||||||
prepareAccessTokenPrompt(function(accessToken) {
|
|
||||||
Metaverse.accessToken = accessToken;
|
|
||||||
saveAccessToken();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('body').on('click', '#save-permissions', function() {
|
|
||||||
savePermissions();
|
|
||||||
});
|
|
||||||
|
|
||||||
function triggerSaveUsernamePassword(event) {
|
|
||||||
if (event.keyCode === 13) {
|
|
||||||
$("#save-username-password").click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$("#http_username").keyup(triggerSaveUsernamePassword);
|
|
||||||
$("#http_password").keyup(triggerSaveUsernamePassword);
|
|
||||||
$("#verify_http_password").keyup(triggerSaveUsernamePassword);
|
|
||||||
$('body').on('click', '#save-username-password', function() {
|
|
||||||
saveUsernamePassword();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('body').on('click', '#change-place-name', function() {
|
|
||||||
chooseFromHighFidelityPlaces(Settings.data.values.metaverse.access_token, "/0,-10,0", function(placeName) {
|
|
||||||
updatePlaceNameLink(placeName);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('body').on('click', '#visit-domain', function() {
|
|
||||||
$('#share-link')[0].click();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('input[type=radio][name=connect-radio]').change(function() {
|
|
||||||
var inputs = $('input[type=radio][name=rez-radio]');
|
|
||||||
var disabled = [];
|
|
||||||
|
|
||||||
switch (this.value) {
|
|
||||||
case 'none':
|
|
||||||
disabled = inputs.splice(1);
|
|
||||||
break;
|
|
||||||
case 'friends':
|
|
||||||
disabled = inputs.splice(2);
|
|
||||||
break;
|
|
||||||
case 'logged-in':
|
|
||||||
disabled = inputs.splice(3);
|
|
||||||
break;
|
|
||||||
case 'everyone':
|
|
||||||
disabled = inputs.splice(4);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$.each(inputs, function() {
|
|
||||||
$(this).prop('disabled', false);
|
|
||||||
});
|
|
||||||
$.each(disabled, function() {
|
|
||||||
if ($(this).prop('checked')) {
|
|
||||||
$(inputs.last()).prop('checked', true);
|
|
||||||
}
|
|
||||||
$(this).prop('disabled', true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
reloadSettings(function(success) {
|
|
||||||
if (success) {
|
|
||||||
getDomainFromAPI();
|
|
||||||
setupWizardSteps();
|
|
||||||
updatePlaceNameDisplay();
|
|
||||||
updateUsernameDisplay();
|
|
||||||
} else {
|
|
||||||
swal({
|
|
||||||
title: '',
|
|
||||||
type: 'error',
|
|
||||||
text: "There was a problem loading the domain settings.\nPlease refresh the page to try again.",
|
|
||||||
});
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '.next-button', function() {
|
||||||
|
goToNextStep();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '.back-button', function() {
|
||||||
|
goToPreviousStep();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '#skip-wizard-button', function() {
|
||||||
|
skipWizard();
|
||||||
|
})
|
||||||
|
|
||||||
|
$('body').on('click', '#connect-account-btn', function() {
|
||||||
|
$(this).blur();
|
||||||
|
prepareAccessTokenPrompt(function(accessToken) {
|
||||||
|
Metaverse.accessToken = accessToken;
|
||||||
|
saveAccessToken();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '#save-permissions', function() {
|
||||||
|
savePermissions();
|
||||||
|
});
|
||||||
|
|
||||||
|
function triggerSaveUsernamePassword(event) {
|
||||||
|
if (event.keyCode === 13) {
|
||||||
|
$("#save-username-password").click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$("#http_username").keyup(triggerSaveUsernamePassword);
|
||||||
|
$("#http_password").keyup(triggerSaveUsernamePassword);
|
||||||
|
$("#verify_http_password").keyup(triggerSaveUsernamePassword);
|
||||||
|
$('body').on('click', '#save-username-password', function() {
|
||||||
|
saveUsernamePassword();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '#change-place-name', function() {
|
||||||
|
chooseFromHighFidelityPlaces(Settings.data.values.metaverse.access_token, "/0,-10,0", function(placeName) {
|
||||||
|
updatePlaceNameLink(placeName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '#visit-domain', function() {
|
||||||
|
$('#share-link')[0].click();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('input[type=radio][name=connect-radio]').change(function() {
|
||||||
|
var inputs = $('input[type=radio][name=rez-radio]');
|
||||||
|
var disabled = [];
|
||||||
|
|
||||||
|
switch (this.value) {
|
||||||
|
case 'none':
|
||||||
|
disabled = inputs.splice(1);
|
||||||
|
break;
|
||||||
|
case 'friends':
|
||||||
|
disabled = inputs.splice(2);
|
||||||
|
break;
|
||||||
|
case 'logged-in':
|
||||||
|
disabled = inputs.splice(3);
|
||||||
|
break;
|
||||||
|
case 'everyone':
|
||||||
|
disabled = inputs.splice(4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each(inputs, function() {
|
||||||
|
$(this).prop('disabled', false);
|
||||||
|
});
|
||||||
|
$.each(disabled, function() {
|
||||||
|
if ($(this).prop('checked')) {
|
||||||
|
$(inputs.last()).prop('checked', true);
|
||||||
|
}
|
||||||
|
$(this).prop('disabled', true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
reloadSettings(function(success) {
|
||||||
|
if (success) {
|
||||||
|
getDomainFromAPI();
|
||||||
|
setupWizardSteps();
|
||||||
|
updatePlaceNameDisplay();
|
||||||
|
updateUsernameDisplay();
|
||||||
|
} else {
|
||||||
|
swal({
|
||||||
|
title: '',
|
||||||
|
type: 'error',
|
||||||
|
text: "There was a problem loading the domain settings.\nPlease refresh the page to try again.",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -142,7 +148,7 @@ function setupWizardSteps() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#permissions-description').html('You <span id="username-display"></span>have been assigned administrator privileges to this domain.');
|
$('#permissions-description').html('You <span id="username-display"></span>have been assigned administrator privileges to this domain.');
|
||||||
$('#admin-description').html('Add more High Fidelity usernames');
|
$('#admin-description').html('Add more Metaverse usernames');
|
||||||
} else {
|
} else {
|
||||||
$('.cloud-only').remove();
|
$('.cloud-only').remove();
|
||||||
$('#save-permissions').text("Finish");
|
$('#save-permissions').text("Finish");
|
||||||
|
@ -171,7 +177,7 @@ function updatePlaceNameLink(address) {
|
||||||
|
|
||||||
function updatePlaceNameDisplay() {
|
function updatePlaceNameDisplay() {
|
||||||
if (Settings.data.values.metaverse.id) {
|
if (Settings.data.values.metaverse.id) {
|
||||||
$.getJSON(URLs.METAVERSE_URL + '/api/v1/domains/' + Settings.data.values.metaverse.id, function(data) {
|
$.getJSON(CURRENT_METAVERSE_URL + '/api/v1/domains/' + Settings.data.values.metaverse.id, function(data) {
|
||||||
|
|
||||||
if (data.status === 'success') {
|
if (data.status === 'success') {
|
||||||
if (data.domain.default_place_name) {
|
if (data.domain.default_place_name) {
|
||||||
|
|
|
@ -821,7 +821,7 @@ void DomainGatekeeper::requestUserPublicKey(const QString& username, bool isOpti
|
||||||
callbackParams.errorCallbackMethod = "publicKeyJSONErrorCallback";
|
callbackParams.errorCallbackMethod = "publicKeyJSONErrorCallback";
|
||||||
|
|
||||||
|
|
||||||
const QString USER_PUBLIC_KEY_PATH = "api/v1/users/%1/public_key";
|
const QString USER_PUBLIC_KEY_PATH = "/api/v1/users/%1/public_key";
|
||||||
|
|
||||||
qDebug().nospace() << "Requesting " << (isOptimistic ? "optimistic " : " ") << "public key for user " << username;
|
qDebug().nospace() << "Requesting " << (isOptimistic ? "optimistic " : " ") << "public key for user " << username;
|
||||||
|
|
||||||
|
@ -1048,7 +1048,7 @@ void DomainGatekeeper::getGroupMemberships(const QString& username) {
|
||||||
callbackParams.jsonCallbackMethod = "getIsGroupMemberJSONCallback";
|
callbackParams.jsonCallbackMethod = "getIsGroupMemberJSONCallback";
|
||||||
callbackParams.errorCallbackMethod = "getIsGroupMemberErrorCallback";
|
callbackParams.errorCallbackMethod = "getIsGroupMemberErrorCallback";
|
||||||
|
|
||||||
const QString GET_IS_GROUP_MEMBER_PATH = "api/v1/groups/members/%2";
|
const QString GET_IS_GROUP_MEMBER_PATH = "/api/v1/groups/members/%2";
|
||||||
DependencyManager::get<AccountManager>()->sendRequest(GET_IS_GROUP_MEMBER_PATH.arg(username),
|
DependencyManager::get<AccountManager>()->sendRequest(GET_IS_GROUP_MEMBER_PATH.arg(username),
|
||||||
AccountManagerAuth::Required,
|
AccountManagerAuth::Required,
|
||||||
QNetworkAccessManager::PostOperation, callbackParams,
|
QNetworkAccessManager::PostOperation, callbackParams,
|
||||||
|
@ -1114,7 +1114,7 @@ void DomainGatekeeper::getDomainOwnerFriendsList() {
|
||||||
callbackParams.jsonCallbackMethod = "getDomainOwnerFriendsListJSONCallback";
|
callbackParams.jsonCallbackMethod = "getDomainOwnerFriendsListJSONCallback";
|
||||||
callbackParams.errorCallbackMethod = "getDomainOwnerFriendsListErrorCallback";
|
callbackParams.errorCallbackMethod = "getDomainOwnerFriendsListErrorCallback";
|
||||||
|
|
||||||
const QString GET_FRIENDS_LIST_PATH = "api/v1/user/friends";
|
const QString GET_FRIENDS_LIST_PATH = "/api/v1/user/friends";
|
||||||
if (DependencyManager::get<AccountManager>()->hasValidAccessToken()) {
|
if (DependencyManager::get<AccountManager>()->hasValidAccessToken()) {
|
||||||
DependencyManager::get<AccountManager>()->sendRequest(GET_FRIENDS_LIST_PATH, AccountManagerAuth::Required,
|
DependencyManager::get<AccountManager>()->sendRequest(GET_FRIENDS_LIST_PATH, AccountManagerAuth::Required,
|
||||||
QNetworkAccessManager::GetOperation, callbackParams, QByteArray(),
|
QNetworkAccessManager::GetOperation, callbackParams, QByteArray(),
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Stephen Birarda on 9/26/13.
|
// Created by Stephen Birarda on 9/26/13.
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
// Copyright 2013 High Fidelity, Inc.
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -118,7 +119,7 @@ bool DomainServer::forwardMetaverseAPIRequest(HTTPConnection* connection,
|
||||||
root.insert(requestSubobjectKey, subobject);
|
root.insert(requestSubobjectKey, subobject);
|
||||||
QJsonDocument doc { root };
|
QJsonDocument doc { root };
|
||||||
|
|
||||||
QUrl url{ MetaverseAPI::getCurrentMetaverseServerURL().toString() + metaversePath };
|
QUrl url { MetaverseAPI::getCurrentMetaverseServerURL().toString() + metaversePath };
|
||||||
|
|
||||||
QNetworkRequest req(url);
|
QNetworkRequest req(url);
|
||||||
req.setHeader(QNetworkRequest::UserAgentHeader, NetworkingConstants::VIRCADIA_USER_AGENT);
|
req.setHeader(QNetworkRequest::UserAgentHeader, NetworkingConstants::VIRCADIA_USER_AGENT);
|
||||||
|
@ -1156,7 +1157,7 @@ QUrl DomainServer::oauthAuthorizationURL(const QUuid& stateUUID) {
|
||||||
QUrl authorizationURL = _oauthProviderURL;
|
QUrl authorizationURL = _oauthProviderURL;
|
||||||
|
|
||||||
const QString OAUTH_AUTHORIZATION_PATH = "/oauth/authorize";
|
const QString OAUTH_AUTHORIZATION_PATH = "/oauth/authorize";
|
||||||
authorizationURL.setPath(OAUTH_AUTHORIZATION_PATH);
|
authorizationURL.setPath(MetaverseAPI::getCurrentMetaverseServerURLPath() + OAUTH_AUTHORIZATION_PATH);
|
||||||
|
|
||||||
QUrlQuery authorizationQuery;
|
QUrlQuery authorizationQuery;
|
||||||
|
|
||||||
|
@ -1434,7 +1435,7 @@ void DomainServer::sendPendingTransactionsToServer() {
|
||||||
transactionCallbackParams.jsonCallbackMethod = "transactionJSONCallback";
|
transactionCallbackParams.jsonCallbackMethod = "transactionJSONCallback";
|
||||||
|
|
||||||
while (i != _pendingAssignmentCredits.end()) {
|
while (i != _pendingAssignmentCredits.end()) {
|
||||||
accountManager->sendRequest("api/v1/transactions",
|
accountManager->sendRequest("/api/v1/transactions",
|
||||||
AccountManagerAuth::Required,
|
AccountManagerAuth::Required,
|
||||||
QNetworkAccessManager::PostOperation,
|
QNetworkAccessManager::PostOperation,
|
||||||
transactionCallbackParams, i.value()->postJson().toJson());
|
transactionCallbackParams, i.value()->postJson().toJson());
|
||||||
|
@ -1620,7 +1621,7 @@ void DomainServer::sendICEServerAddressToMetaverseAPI() {
|
||||||
callbackParameters.errorCallbackMethod = "handleFailedICEServerAddressUpdate";
|
callbackParameters.errorCallbackMethod = "handleFailedICEServerAddressUpdate";
|
||||||
callbackParameters.jsonCallbackMethod = "handleSuccessfulICEServerAddressUpdate";
|
callbackParameters.jsonCallbackMethod = "handleSuccessfulICEServerAddressUpdate";
|
||||||
|
|
||||||
qCDebug(domain_server_ice) << "Updating ice-server address in High Fidelity Metaverse API to"
|
qCDebug(domain_server_ice) << "Updating ice-server address in Metaverse API to"
|
||||||
<< (_iceServerSocket.isNull() ? "" : _iceServerSocket.getAddress().toString());
|
<< (_iceServerSocket.isNull() ? "" : _iceServerSocket.getAddress().toString());
|
||||||
|
|
||||||
static const QString DOMAIN_ICE_ADDRESS_UPDATE = "/api/v1/domains/%1/ice_server_address";
|
static const QString DOMAIN_ICE_ADDRESS_UPDATE = "/api/v1/domains/%1/ice_server_address";
|
||||||
|
@ -1979,6 +1980,7 @@ const QString URI_OAUTH = "/oauth";
|
||||||
bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler) {
|
bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler) {
|
||||||
const QString JSON_MIME_TYPE = "application/json";
|
const QString JSON_MIME_TYPE = "application/json";
|
||||||
|
|
||||||
|
const QString URI_ID = "/id";
|
||||||
const QString URI_ASSIGNMENT = "/assignment";
|
const QString URI_ASSIGNMENT = "/assignment";
|
||||||
const QString URI_NODES = "/nodes";
|
const QString URI_NODES = "/nodes";
|
||||||
const QString URI_SETTINGS = "/settings";
|
const QString URI_SETTINGS = "/settings";
|
||||||
|
@ -2055,7 +2057,6 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if this is a request for our domain ID
|
// check if this is a request for our domain ID
|
||||||
const QString URI_ID = "/id";
|
|
||||||
if (connection->requestOperation() == QNetworkAccessManager::GetOperation
|
if (connection->requestOperation() == QNetworkAccessManager::GetOperation
|
||||||
&& url.path() == URI_ID) {
|
&& url.path() == URI_ID) {
|
||||||
QUuid domainID = nodeList->getSessionUUID();
|
QUuid domainID = nodeList->getSessionUUID();
|
||||||
|
@ -2562,7 +2563,7 @@ bool DomainServer::handleHTTPSRequest(HTTPSConnection* connection, const QUrl &u
|
||||||
|
|
||||||
const QString OAUTH_TOKEN_REQUEST_PATH = "/oauth/token";
|
const QString OAUTH_TOKEN_REQUEST_PATH = "/oauth/token";
|
||||||
QUrl tokenRequestUrl = _oauthProviderURL;
|
QUrl tokenRequestUrl = _oauthProviderURL;
|
||||||
tokenRequestUrl.setPath(OAUTH_TOKEN_REQUEST_PATH);
|
tokenRequestUrl.setPath(MetaverseAPI::getCurrentMetaverseServerURLPath() + OAUTH_TOKEN_REQUEST_PATH);
|
||||||
|
|
||||||
const QString OAUTH_GRANT_TYPE_POST_STRING = "grant_type=authorization_code";
|
const QString OAUTH_GRANT_TYPE_POST_STRING = "grant_type=authorization_code";
|
||||||
QString tokenPostBody = OAUTH_GRANT_TYPE_POST_STRING;
|
QString tokenPostBody = OAUTH_GRANT_TYPE_POST_STRING;
|
||||||
|
@ -2876,7 +2877,7 @@ QNetworkReply* DomainServer::profileRequestGivenTokenReply(QNetworkReply* tokenR
|
||||||
|
|
||||||
// fire off a request to get this user's identity so we can see if we will let them in
|
// fire off a request to get this user's identity so we can see if we will let them in
|
||||||
QUrl profileURL = _oauthProviderURL;
|
QUrl profileURL = _oauthProviderURL;
|
||||||
profileURL.setPath("/api/v1/user/profile");
|
profileURL.setPath(MetaverseAPI::getCurrentMetaverseServerURLPath() + "/api/v1/user/profile");
|
||||||
profileURL.setQuery(QString("%1=%2").arg(OAUTH_JSON_ACCESS_TOKEN_KEY, accessToken));
|
profileURL.setQuery(QString("%1=%2").arg(OAUTH_JSON_ACCESS_TOKEN_KEY, accessToken));
|
||||||
|
|
||||||
qDebug() << "Sending profile request to: " << profileURL;
|
qDebug() << "Sending profile request to: " << profileURL;
|
||||||
|
@ -3725,7 +3726,7 @@ void DomainServer::screensharePresence(QString roomname, QUuid avatarID, int exp
|
||||||
callbackData.insert("roomname", roomname);
|
callbackData.insert("roomname", roomname);
|
||||||
callbackData.insert("avatarID", avatarID.toString());
|
callbackData.insert("avatarID", avatarID.toString());
|
||||||
callbackParams.callbackData = callbackData;
|
callbackParams.callbackData = callbackData;
|
||||||
const QString PATH = "api/v1/domains/%1/screenshare";
|
const QString PATH = "/api/v1/domains/%1/screenshare";
|
||||||
QString domain_id = uuidStringWithoutCurlyBraces(getID());
|
QString domain_id = uuidStringWithoutCurlyBraces(getID());
|
||||||
QJsonObject json, screenshare;
|
QJsonObject json, screenshare;
|
||||||
screenshare["username"] = verifiedUsername;
|
screenshare["username"] = verifiedUsername;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Stephen Birarda on 2014-06-24.
|
// Created by Stephen Birarda on 2014-06-24.
|
||||||
// Copyright 2014 High Fidelity, Inc.
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -1998,7 +1999,7 @@ void DomainServerSettingsManager::apiGetGroupID(const QString& groupName) {
|
||||||
callbackParams.jsonCallbackMethod = "apiGetGroupIDJSONCallback";
|
callbackParams.jsonCallbackMethod = "apiGetGroupIDJSONCallback";
|
||||||
callbackParams.errorCallbackMethod = "apiGetGroupIDErrorCallback";
|
callbackParams.errorCallbackMethod = "apiGetGroupIDErrorCallback";
|
||||||
|
|
||||||
const QString GET_GROUP_ID_PATH = "api/v1/groups/names/%1";
|
const QString GET_GROUP_ID_PATH = "/api/v1/groups/names/%1";
|
||||||
DependencyManager::get<AccountManager>()->sendRequest(GET_GROUP_ID_PATH.arg(groupName),
|
DependencyManager::get<AccountManager>()->sendRequest(GET_GROUP_ID_PATH.arg(groupName),
|
||||||
AccountManagerAuth::Required,
|
AccountManagerAuth::Required,
|
||||||
QNetworkAccessManager::GetOperation, callbackParams);
|
QNetworkAccessManager::GetOperation, callbackParams);
|
||||||
|
@ -2064,7 +2065,7 @@ void DomainServerSettingsManager::apiGetGroupRanks(const QUuid& groupID) {
|
||||||
callbackParams.jsonCallbackMethod = "apiGetGroupRanksJSONCallback";
|
callbackParams.jsonCallbackMethod = "apiGetGroupRanksJSONCallback";
|
||||||
callbackParams.errorCallbackMethod = "apiGetGroupRanksErrorCallback";
|
callbackParams.errorCallbackMethod = "apiGetGroupRanksErrorCallback";
|
||||||
|
|
||||||
const QString GET_GROUP_RANKS_PATH = "api/v1/groups/%1/ranks";
|
const QString GET_GROUP_RANKS_PATH = "/api/v1/groups/%1/ranks";
|
||||||
DependencyManager::get<AccountManager>()->sendRequest(GET_GROUP_RANKS_PATH.arg(groupID.toString().mid(1,36)),
|
DependencyManager::get<AccountManager>()->sendRequest(GET_GROUP_RANKS_PATH.arg(groupID.toString().mid(1,36)),
|
||||||
AccountManagerAuth::Required,
|
AccountManagerAuth::Required,
|
||||||
QNetworkAccessManager::GetOperation, callbackParams);
|
QNetworkAccessManager::GetOperation, callbackParams);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Stephen Birarda on 2014-06-24.
|
// Created by Stephen Birarda on 2014-06-24.
|
||||||
// Copyright 2014 High Fidelity, Inc.
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -108,7 +109,7 @@ public:
|
||||||
QStringList getDomainServerGroupNames();
|
QStringList getDomainServerGroupNames();
|
||||||
QStringList getDomainServerBlacklistGroupNames();
|
QStringList getDomainServerBlacklistGroupNames();
|
||||||
|
|
||||||
// these are used to locally cache the result of calling "api/v1/groups/.../is_member/..." on metaverse's api
|
// these are used to locally cache the result of calling "/api/v1/groups/.../is_member/..." on metaverse's api
|
||||||
void clearGroupMemberships(const QString& name) { _groupMembership[name.toLower()].clear(); }
|
void clearGroupMemberships(const QString& name) { _groupMembership[name.toLower()].clear(); }
|
||||||
void recordGroupMembership(const QString& name, const QUuid groupID, QUuid rankID);
|
void recordGroupMembership(const QString& name, const QUuid groupID, QUuid rankID);
|
||||||
QUuid isGroupMember(const QString& name, const QUuid& groupID); // returns rank or -1 if not a member
|
QUuid isGroupMember(const QString& name, const QUuid& groupID); // returns rank or -1 if not a member
|
||||||
|
|
|
@ -211,8 +211,15 @@ void IceServer::requestDomainPublicKey(const QUuid& domainID) {
|
||||||
auto& networkAccessManager = NetworkAccessManager::getInstance();
|
auto& networkAccessManager = NetworkAccessManager::getInstance();
|
||||||
|
|
||||||
QUrl publicKeyURL{ MetaverseAPI::getCurrentMetaverseServerURL() };
|
QUrl publicKeyURL{ MetaverseAPI::getCurrentMetaverseServerURL() };
|
||||||
|
// qDebug() << "publicKeyURL" << publicKeyURL;
|
||||||
|
// qDebug() << "MetaverseAPI::getCurrentMetaverseServerURLPath()" << MetaverseAPI::getCurrentMetaverseServerURLPath();
|
||||||
QString publicKeyPath = QString("/api/v1/domains/%1/public_key").arg(uuidStringWithoutCurlyBraces(domainID));
|
QString publicKeyPath = QString("/api/v1/domains/%1/public_key").arg(uuidStringWithoutCurlyBraces(domainID));
|
||||||
publicKeyURL.setPath(publicKeyPath);
|
publicKeyURL.setPath("/" + MetaverseAPI::getCurrentMetaverseServerURLPath() + publicKeyPath);
|
||||||
|
// qDebug() << "publicKeyPath" << publicKeyPath;
|
||||||
|
// qDebug() << "publicKeyURL.setPath" << "/" + MetaverseAPI::getCurrentMetaverseServerURLPath() + publicKeyPath;
|
||||||
|
// qDebug() << "publicKeyURL" << publicKeyURL;
|
||||||
|
// qDebug() << "publicKeyURL.isValid()" << publicKeyURL.isValid();
|
||||||
|
// qDebug() << "publicKeyURL.errorString()" << publicKeyURL.errorString();
|
||||||
|
|
||||||
QNetworkRequest publicKeyRequest { publicKeyURL };
|
QNetworkRequest publicKeyRequest { publicKeyURL };
|
||||||
publicKeyRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
publicKeyRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
|
|
|
@ -7123,7 +7123,7 @@ void Application::updateWindowTitle() const {
|
||||||
|
|
||||||
QString metaverseDetails;
|
QString metaverseDetails;
|
||||||
if (isMetaverseLoggedIn) {
|
if (isMetaverseLoggedIn) {
|
||||||
metaverseDetails = " (Metaverse: Logged in as " + metaverseUsername + ")";
|
metaverseDetails = " (Metaverse: Connected to " + MetaverseAPI::getCurrentMetaverseServerURL().toString() + " as " + metaverseUsername + ")";
|
||||||
} else {
|
} else {
|
||||||
metaverseDetails = " (Metaverse: Not Logged In)";
|
metaverseDetails = " (Metaverse: Not Logged In)";
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Gabriel Calero on 9/28/18.
|
// Created by Gabriel Calero on 9/28/18.
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -12,4 +13,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
static const QString API_SIGNUP_PATH = "api/v1/users";
|
static const QString API_SIGNUP_PATH = "/api/v1/users";
|
||||||
|
|
|
@ -30,7 +30,7 @@ QNetworkRequest createNetworkRequest() {
|
||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
|
|
||||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||||
requestURL.setPath(USER_ACTIVITY_URL);
|
requestURL.setPath(MetaverseAPI::getCurrentMetaverseServerURLPath() + USER_ACTIVITY_URL);
|
||||||
|
|
||||||
request.setUrl(requestURL);
|
request.setUrl(requestURL);
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ void ScreenshareScriptingInterface::requestScreenshareInfo() {
|
||||||
// See `DomainServer::screensharePresence()` for more info about that.
|
// See `DomainServer::screensharePresence()` for more info about that.
|
||||||
|
|
||||||
QString currentDomainID = uuidStringWithoutCurlyBraces(addressManager->getDomainID());
|
QString currentDomainID = uuidStringWithoutCurlyBraces(addressManager->getDomainID());
|
||||||
QString requestURLPath = "api/v1/domains/%1/screenshare";
|
QString requestURLPath = "/api/v1/domains/%1/screenshare";
|
||||||
JSONCallbackParameters callbackParams;
|
JSONCallbackParameters callbackParams;
|
||||||
callbackParams.callbackReceiver = this;
|
callbackParams.callbackReceiver = this;
|
||||||
callbackParams.jsonCallbackMethod = "handleSuccessfulScreenshareInfoGet";
|
callbackParams.jsonCallbackMethod = "handleSuccessfulScreenshareInfoGet";
|
||||||
|
|
|
@ -172,7 +172,7 @@ void LoginDialog::linkOculus() {
|
||||||
callbackParams.callbackReceiver = this;
|
callbackParams.callbackReceiver = this;
|
||||||
callbackParams.jsonCallbackMethod = "linkCompleted";
|
callbackParams.jsonCallbackMethod = "linkCompleted";
|
||||||
callbackParams.errorCallbackMethod = "linkFailed";
|
callbackParams.errorCallbackMethod = "linkFailed";
|
||||||
const QString LINK_OCULUS_PATH = "api/v1/user/oculus/link";
|
const QString LINK_OCULUS_PATH = "/api/v1/user/oculus/link";
|
||||||
|
|
||||||
QJsonObject payload;
|
QJsonObject payload;
|
||||||
payload["oculus_nonce"] = nonce;
|
payload["oculus_nonce"] = nonce;
|
||||||
|
@ -200,7 +200,7 @@ void LoginDialog::createAccountFromOculus(QString email, QString username, QStri
|
||||||
callbackParams.jsonCallbackMethod = "createCompleted";
|
callbackParams.jsonCallbackMethod = "createCompleted";
|
||||||
callbackParams.errorCallbackMethod = "createFailed";
|
callbackParams.errorCallbackMethod = "createFailed";
|
||||||
|
|
||||||
const QString CREATE_ACCOUNT_FROM_OCULUS_PATH = "api/v1/user/oculus/create";
|
const QString CREATE_ACCOUNT_FROM_OCULUS_PATH = "/api/v1/user/oculus/create";
|
||||||
|
|
||||||
QJsonObject payload;
|
QJsonObject payload;
|
||||||
payload["oculus_nonce"] = nonce;
|
payload["oculus_nonce"] = nonce;
|
||||||
|
@ -251,7 +251,7 @@ void LoginDialog::linkSteam() {
|
||||||
callbackParams.jsonCallbackMethod = "linkCompleted";
|
callbackParams.jsonCallbackMethod = "linkCompleted";
|
||||||
callbackParams.errorCallbackMethod = "linkFailed";
|
callbackParams.errorCallbackMethod = "linkFailed";
|
||||||
|
|
||||||
const QString LINK_STEAM_PATH = "api/v1/user/steam/link";
|
const QString LINK_STEAM_PATH = "/api/v1/user/steam/link";
|
||||||
|
|
||||||
QJsonObject payload;
|
QJsonObject payload;
|
||||||
payload["steam_auth_ticket"] = QJsonValue::fromVariant(QVariant(ticket));
|
payload["steam_auth_ticket"] = QJsonValue::fromVariant(QVariant(ticket));
|
||||||
|
@ -278,7 +278,7 @@ void LoginDialog::createAccountFromSteam(QString username) {
|
||||||
callbackParams.jsonCallbackMethod = "createCompleted";
|
callbackParams.jsonCallbackMethod = "createCompleted";
|
||||||
callbackParams.errorCallbackMethod = "createFailed";
|
callbackParams.errorCallbackMethod = "createFailed";
|
||||||
|
|
||||||
const QString CREATE_ACCOUNT_FROM_STEAM_PATH = "api/v1/user/steam/create";
|
const QString CREATE_ACCOUNT_FROM_STEAM_PATH = "/api/v1/user/steam/create";
|
||||||
|
|
||||||
QJsonObject payload;
|
QJsonObject payload;
|
||||||
payload["steam_auth_ticket"] = QJsonValue::fromVariant(QVariant(ticket));
|
payload["steam_auth_ticket"] = QJsonValue::fromVariant(QVariant(ticket));
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 12/4/13.
|
// Created by Brad Hefta-Gaub on 12/4/13.
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
// Copyright 2013 High Fidelity, Inc.
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -1040,7 +1041,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
||||||
* @property {boolean} groupCulled=false - <code>true</code> if the mesh parts of the model are LOD culled as a group,
|
* @property {boolean} groupCulled=false - <code>true</code> if the mesh parts of the model are LOD culled as a group,
|
||||||
* <code>false</code> if separate mesh parts are LOD culled individually.
|
* <code>false</code> if separate mesh parts are LOD culled individually.
|
||||||
*
|
*
|
||||||
* @example <caption>Rez a Vive tracker puck.</caption>
|
* @example <caption>Rez a cowboy hat.</caption>
|
||||||
* var entity = Entities.addEntity({
|
* var entity = Entities.addEntity({
|
||||||
* type: "Model",
|
* type: "Model",
|
||||||
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -2 })),
|
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -2 })),
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 12/4/13.
|
// Created by Brad Hefta-Gaub on 12/4/13.
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
// Copyright 2013 High Fidelity, Inc.
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -1492,7 +1493,7 @@ void EntityTree::startDynamicDomainVerificationOnServer(float minimumAgeToRemove
|
||||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||||
requestURL.setPath("/api/v1/commerce/proof_of_purchase_status/location");
|
requestURL.setPath(MetaverseAPI::getCurrentMetaverseServerURLPath() + "/api/v1/commerce/proof_of_purchase_status/location");
|
||||||
QJsonObject request;
|
QJsonObject request;
|
||||||
request["certificate_id"] = certificateID;
|
request["certificate_id"] = certificateID;
|
||||||
networkRequest.setUrl(requestURL);
|
networkRequest.setUrl(requestURL);
|
||||||
|
@ -1724,7 +1725,7 @@ void EntityTree::validatePop(const QString& certID, const EntityItemID& entityIt
|
||||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||||
requestURL.setPath("/api/v1/commerce/proof_of_purchase_status/transfer");
|
requestURL.setPath(MetaverseAPI::getCurrentMetaverseServerURLPath() + "/api/v1/commerce/proof_of_purchase_status/transfer");
|
||||||
QJsonObject request;
|
QJsonObject request;
|
||||||
request["certificate_id"] = certID;
|
request["certificate_id"] = certID;
|
||||||
networkRequest.setUrl(requestURL);
|
networkRequest.setUrl(requestURL);
|
||||||
|
|
|
@ -221,17 +221,24 @@ QNetworkRequest AccountManager::createRequest(QString path, AccountManagerAuth::
|
||||||
uuidStringWithoutCurlyBraces(_sessionID).toLocal8Bit());
|
uuidStringWithoutCurlyBraces(_sessionID).toLocal8Bit());
|
||||||
|
|
||||||
QUrl requestURL = _authURL;
|
QUrl requestURL = _authURL;
|
||||||
|
|
||||||
if (requestURL.isEmpty()) { // Assignment client doesn't set _authURL.
|
if (requestURL.isEmpty()) { // Assignment client doesn't set _authURL.
|
||||||
requestURL = getMetaverseServerURL();
|
requestURL = getMetaverseServerURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// qCDebug(networking) << "Received path" << path;
|
||||||
|
// qCDebug(networking) << "path.left(path.indexOf(\" ? \"))" << path.left(path.indexOf("?"));
|
||||||
|
// qCDebug(networking) << "getMetaverseServerURLPath(true)" << getMetaverseServerURLPath(true);
|
||||||
|
|
||||||
int queryStringLocation = path.indexOf("?");
|
int queryStringLocation = path.indexOf("?");
|
||||||
if (path.startsWith("/")) {
|
if (path.startsWith("/")) {
|
||||||
requestURL.setPath(path.left(queryStringLocation));
|
requestURL.setPath(getMetaverseServerURLPath(false) + path.left(queryStringLocation));
|
||||||
} else {
|
} else {
|
||||||
requestURL.setPath("/" + path.left(queryStringLocation));
|
requestURL.setPath(getMetaverseServerURLPath(true) + path.left(queryStringLocation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// qCDebug(networking) << "Creating request path" << requestURL;
|
||||||
|
// qCDebug(networking) << "requestURL.isValid()" << requestURL.isValid();
|
||||||
|
// qCDebug(networking) << "requestURL.errorString()" << requestURL.errorString();
|
||||||
|
|
||||||
if (queryStringLocation >= 0) {
|
if (queryStringLocation >= 0) {
|
||||||
QUrlQuery query(path.mid(queryStringLocation+1));
|
QUrlQuery query(path.mid(queryStringLocation+1));
|
||||||
|
@ -556,7 +563,7 @@ void AccountManager::requestAccessToken(const QString& login, const QString& pas
|
||||||
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
||||||
|
|
||||||
QUrl grantURL = _authURL;
|
QUrl grantURL = _authURL;
|
||||||
grantURL.setPath("/oauth/token");
|
grantURL.setPath(getMetaverseServerURLPath() + "/oauth/token");
|
||||||
|
|
||||||
QByteArray postData;
|
QByteArray postData;
|
||||||
postData.append("grant_type=password&");
|
postData.append("grant_type=password&");
|
||||||
|
@ -579,7 +586,7 @@ void AccountManager::requestAccessTokenWithAuthCode(const QString& authCode, con
|
||||||
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
||||||
|
|
||||||
QUrl grantURL = _authURL;
|
QUrl grantURL = _authURL;
|
||||||
grantURL.setPath("/oauth/token");
|
grantURL.setPath(getMetaverseServerURLPath() + "/oauth/token");
|
||||||
|
|
||||||
QByteArray postData;
|
QByteArray postData;
|
||||||
postData.append("grant_type=authorization_code&");
|
postData.append("grant_type=authorization_code&");
|
||||||
|
@ -602,7 +609,7 @@ void AccountManager::requestAccessTokenWithSteam(QByteArray authSessionTicket) {
|
||||||
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
||||||
|
|
||||||
QUrl grantURL = _authURL;
|
QUrl grantURL = _authURL;
|
||||||
grantURL.setPath("/oauth/token");
|
grantURL.setPath(getMetaverseServerURLPath() + "/oauth/token");
|
||||||
|
|
||||||
QByteArray postData;
|
QByteArray postData;
|
||||||
postData.append("grant_type=password&");
|
postData.append("grant_type=password&");
|
||||||
|
@ -624,7 +631,7 @@ void AccountManager::requestAccessTokenWithOculus(const QString& nonce, const QS
|
||||||
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
||||||
|
|
||||||
QUrl grantURL = _authURL;
|
QUrl grantURL = _authURL;
|
||||||
grantURL.setPath("/oauth/token");
|
grantURL.setPath(getMetaverseServerURLPath() + "/oauth/token");
|
||||||
|
|
||||||
QByteArray postData;
|
QByteArray postData;
|
||||||
postData.append("grant_type=password&");
|
postData.append("grant_type=password&");
|
||||||
|
@ -655,7 +662,7 @@ void AccountManager::refreshAccessToken() {
|
||||||
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
request.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
|
||||||
|
|
||||||
QUrl grantURL = _authURL;
|
QUrl grantURL = _authURL;
|
||||||
grantURL.setPath("/oauth/token");
|
grantURL.setPath(getMetaverseServerURLPath() + "/oauth/token");
|
||||||
|
|
||||||
QByteArray postData;
|
QByteArray postData;
|
||||||
postData.append("grant_type=refresh_token&");
|
postData.append("grant_type=refresh_token&");
|
||||||
|
@ -688,7 +695,7 @@ void AccountManager::setAccessTokens(const QString& response) {
|
||||||
} else {
|
} else {
|
||||||
// clear the path from the response URL so we have the right root URL for this access token
|
// clear the path from the response URL so we have the right root URL for this access token
|
||||||
QUrl rootURL = rootObject.contains("url") ? rootObject["url"].toString() : _authURL;
|
QUrl rootURL = rootObject.contains("url") ? rootObject["url"].toString() : _authURL;
|
||||||
rootURL.setPath("");
|
rootURL.setPath(getMetaverseServerURLPath());
|
||||||
|
|
||||||
qCDebug(networking) << "Storing an account with access-token for" << qPrintable(rootURL.toString());
|
qCDebug(networking) << "Storing an account with access-token for" << qPrintable(rootURL.toString());
|
||||||
|
|
||||||
|
@ -723,7 +730,7 @@ void AccountManager::requestAccessTokenFinished() {
|
||||||
} else {
|
} else {
|
||||||
// clear the path from the response URL so we have the right root URL for this access token
|
// clear the path from the response URL so we have the right root URL for this access token
|
||||||
QUrl rootURL = requestReply->url();
|
QUrl rootURL = requestReply->url();
|
||||||
rootURL.setPath("");
|
rootURL.setPath(getMetaverseServerURLPath());
|
||||||
|
|
||||||
qCDebug(networking) << "Storing an account with access-token for" << qPrintable(rootURL.toString());
|
qCDebug(networking) << "Storing an account with access-token for" << qPrintable(rootURL.toString());
|
||||||
|
|
||||||
|
@ -759,7 +766,7 @@ void AccountManager::refreshAccessTokenFinished() {
|
||||||
} else {
|
} else {
|
||||||
// clear the path from the response URL so we have the right root URL for this access token
|
// clear the path from the response URL so we have the right root URL for this access token
|
||||||
QUrl rootURL = requestReply->url();
|
QUrl rootURL = requestReply->url();
|
||||||
rootURL.setPath("");
|
rootURL.setPath(getMetaverseServerURLPath());
|
||||||
|
|
||||||
qCDebug(networking) << "Storing an account with a refreshed access-token for" << qPrintable(rootURL.toString());
|
qCDebug(networking) << "Storing an account with a refreshed access-token for" << qPrintable(rootURL.toString());
|
||||||
|
|
||||||
|
@ -784,7 +791,7 @@ void AccountManager::requestProfile() {
|
||||||
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||||
|
|
||||||
QUrl profileURL = _authURL;
|
QUrl profileURL = _authURL;
|
||||||
profileURL.setPath("/api/v1/user/profile");
|
profileURL.setPath(getMetaverseServerURLPath() + "/api/v1/user/profile");
|
||||||
|
|
||||||
QNetworkRequest profileRequest(profileURL);
|
QNetworkRequest profileRequest(profileURL);
|
||||||
profileRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
profileRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
|
@ -834,7 +841,7 @@ void AccountManager::requestAccountSettings() {
|
||||||
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||||
|
|
||||||
QUrl lockerURL = _authURL;
|
QUrl lockerURL = _authURL;
|
||||||
lockerURL.setPath("/api/v1/user/locker");
|
lockerURL.setPath(getMetaverseServerURLPath() + "/api/v1/user/locker");
|
||||||
|
|
||||||
QNetworkRequest lockerRequest(lockerURL);
|
QNetworkRequest lockerRequest(lockerURL);
|
||||||
lockerRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
lockerRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
|
@ -905,7 +912,7 @@ void AccountManager::postAccountSettings() {
|
||||||
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||||
|
|
||||||
QUrl lockerURL = _authURL;
|
QUrl lockerURL = _authURL;
|
||||||
lockerURL.setPath("/api/v1/user/locker");
|
lockerURL.setPath(getMetaverseServerURLPath() + "/api/v1/user/locker");
|
||||||
|
|
||||||
QNetworkRequest lockerRequest(lockerURL);
|
QNetworkRequest lockerRequest(lockerURL);
|
||||||
lockerRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
lockerRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
|
@ -1003,8 +1010,8 @@ void AccountManager::uploadPublicKey() {
|
||||||
qCDebug(networking) << "Attempting upload of public key";
|
qCDebug(networking) << "Attempting upload of public key";
|
||||||
|
|
||||||
// upload the public key so data-web has an up-to-date key
|
// upload the public key so data-web has an up-to-date key
|
||||||
const QString USER_PUBLIC_KEY_UPDATE_PATH = "api/v1/user/public_key";
|
const QString USER_PUBLIC_KEY_UPDATE_PATH = "/api/v1/user/public_key";
|
||||||
const QString DOMAIN_PUBLIC_KEY_UPDATE_PATH = "api/v1/domains/%1/public_key";
|
const QString DOMAIN_PUBLIC_KEY_UPDATE_PATH = "/api/v1/domains/%1/public_key";
|
||||||
|
|
||||||
QString uploadPath;
|
QString uploadPath;
|
||||||
const auto& domainID = _accountInfo.getDomainID();
|
const auto& domainID = _accountInfo.getDomainID();
|
||||||
|
|
|
@ -101,6 +101,9 @@ public:
|
||||||
const QString& getTemporaryDomainKey(const QUuid& domainID) { return _accountInfo.getTemporaryDomainKey(domainID); }
|
const QString& getTemporaryDomainKey(const QUuid& domainID) { return _accountInfo.getTemporaryDomainKey(domainID); }
|
||||||
|
|
||||||
QUrl getMetaverseServerURL() { return MetaverseAPI::getCurrentMetaverseServerURL(); }
|
QUrl getMetaverseServerURL() { return MetaverseAPI::getCurrentMetaverseServerURL(); }
|
||||||
|
QString getMetaverseServerURLPath(bool appendForwardSlash = false) {
|
||||||
|
return MetaverseAPI::getCurrentMetaverseServerURLPath(appendForwardSlash);
|
||||||
|
}
|
||||||
|
|
||||||
void removeAccountFromFile();
|
void removeAccountFromFile();
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// MetaverseAPI.cpp
|
// MetaverseAPI.cpp
|
||||||
// libraries/networking/src
|
// libraries/networking/src
|
||||||
//
|
//
|
||||||
// Created by Kalila (kasenvr) on 2019-12-16.
|
// Created by Kalila L. on 2019-12-16.
|
||||||
// Copyright 2019 Vircadia
|
// Copyright 2019 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -23,7 +23,7 @@ namespace MetaverseAPI {
|
||||||
QUrl getCurrentMetaverseServerURL() {
|
QUrl getCurrentMetaverseServerURL() {
|
||||||
QUrl selectedMetaverseURL;
|
QUrl selectedMetaverseURL;
|
||||||
Setting::Handle<QUrl> selectedMetaverseURLSetting("private/selectedMetaverseURL",
|
Setting::Handle<QUrl> selectedMetaverseURLSetting("private/selectedMetaverseURL",
|
||||||
NetworkingConstants::METAVERSE_SERVER_URL_STABLE);
|
NetworkingConstants::METAVERSE_SERVER_URL_STABLE);
|
||||||
|
|
||||||
selectedMetaverseURL = selectedMetaverseURLSetting.get();
|
selectedMetaverseURL = selectedMetaverseURLSetting.get();
|
||||||
|
|
||||||
|
@ -32,7 +32,17 @@ namespace MetaverseAPI {
|
||||||
if (QProcessEnvironment::systemEnvironment().contains(HIFI_METAVERSE_URL_ENV)) {
|
if (QProcessEnvironment::systemEnvironment().contains(HIFI_METAVERSE_URL_ENV)) {
|
||||||
return QUrl(QProcessEnvironment::systemEnvironment().value(HIFI_METAVERSE_URL_ENV));
|
return QUrl(QProcessEnvironment::systemEnvironment().value(HIFI_METAVERSE_URL_ENV));
|
||||||
}
|
}
|
||||||
|
|
||||||
return selectedMetaverseURL;
|
return selectedMetaverseURL;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
QString getCurrentMetaverseServerURLPath(bool appendForwardSlash){
|
||||||
|
QString path = getCurrentMetaverseServerURL().path();
|
||||||
|
|
||||||
|
if (!path.isEmpty() && appendForwardSlash) {
|
||||||
|
path.append("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
};
|
||||||
|
} // namespace MetaverseAPI
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// MetaverseAPI.h
|
// MetaverseAPI.h
|
||||||
// libraries/networking/src
|
// libraries/networking/src
|
||||||
//
|
//
|
||||||
// Created by Kalila (kasenvr) on 2019-12-16.
|
// Created by Kalila L. on 2019-12-16.
|
||||||
// Copyright 2019 Vircadia
|
// Copyright 2019 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
namespace MetaverseAPI {
|
namespace MetaverseAPI {
|
||||||
QUrl getCurrentMetaverseServerURL();
|
QUrl getCurrentMetaverseServerURL();
|
||||||
|
QString getCurrentMetaverseServerURLPath(bool appendForwardSlash = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // athena_MetaverseAPI_h
|
#endif // athena_MetaverseAPI_h
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Stephen Birarda on 2015-03-31.
|
// Created by Stephen Birarda on 2015-03-31.
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -19,14 +20,15 @@ namespace NetworkingConstants {
|
||||||
// If you want to use STAGING instead of STABLE,
|
// If you want to use STAGING instead of STABLE,
|
||||||
// links from the Domain Server web interface (like the connect account token generation)
|
// links from the Domain Server web interface (like the connect account token generation)
|
||||||
// will still point at stable unless you ALSO change the Domain Server Metaverse Server URL inside of:
|
// will still point at stable unless you ALSO change the Domain Server Metaverse Server URL inside of:
|
||||||
// <hifi repo>\domain-server\resources\web\js\shared.js
|
// <vircadia repo>\domain-server\resources\web\js\shared.js
|
||||||
|
|
||||||
// You can avoid changing that and still effectively use a connected domain on staging
|
// You can avoid changing that and still effectively use a connected domain on staging
|
||||||
// if you manually generate a personal access token for the domains scope
|
// if you manually generate a personal access token for the domains scope
|
||||||
// at https://staging.highfidelity.com/user/tokens/new?for_domain_server=true
|
// at https://staging.highfidelity.com/user/tokens/new?for_domain_server=true
|
||||||
|
|
||||||
const QUrl METAVERSE_SERVER_URL_STABLE { "https://metaverse.highfidelity.com" };
|
// For now we only have one Metaverse server.
|
||||||
const QUrl METAVERSE_SERVER_URL_STAGING { "https://staging-metaverse.vircadia.com" };
|
const QUrl METAVERSE_SERVER_URL_STABLE { "https://metaverse.vircadia.com/live" };
|
||||||
|
const QUrl METAVERSE_SERVER_URL_STAGING { "https://metaverse.vircadia.com/live" };
|
||||||
|
|
||||||
// Web Engine requests to this parent domain have an account authorization header added
|
// Web Engine requests to this parent domain have an account authorization header added
|
||||||
const QString AUTH_HOSTNAME_BASE = "highfidelity.com";
|
const QString AUTH_HOSTNAME_BASE = "highfidelity.com";
|
||||||
|
@ -42,11 +44,11 @@ namespace NetworkingConstants {
|
||||||
const QUrl BUILDS_XML_URL("https://highfidelity.com/builds.xml");
|
const QUrl BUILDS_XML_URL("https://highfidelity.com/builds.xml");
|
||||||
const QUrl MASTER_BUILDS_XML_URL("https://highfidelity.com/dev-builds.xml");
|
const QUrl MASTER_BUILDS_XML_URL("https://highfidelity.com/dev-builds.xml");
|
||||||
|
|
||||||
|
// For now we only have one ice server.
|
||||||
#if USE_STABLE_GLOBAL_SERVICES
|
#if USE_STABLE_GLOBAL_SERVICES
|
||||||
const QString ICE_SERVER_DEFAULT_HOSTNAME = "ice.highfidelity.com";
|
const QString ICE_SERVER_DEFAULT_HOSTNAME = "ice.vircadia.com";
|
||||||
#else
|
#else
|
||||||
const QString ICE_SERVER_DEFAULT_HOSTNAME = "dev-ice.highfidelity.com";
|
const QString ICE_SERVER_DEFAULT_HOSTNAME = "ice.vircadia.com";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com";
|
const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com";
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Simon Walton on Oct 15, 2018.
|
// Created by Simon Walton on Oct 15, 2018.
|
||||||
// Copyright 2018 High Fidelity, Inc.
|
// Copyright 2018 High Fidelity, Inc.
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -247,8 +248,7 @@ bool OctreeEntitiesFileParser::readEntitiesArray(QVariantList& entitiesArray) {
|
||||||
// model
|
// model
|
||||||
"modelURL",
|
"modelURL",
|
||||||
"animation.url",
|
"animation.url",
|
||||||
// FIXME: Handle models' "textures" and "originalTextures" properties which include URLs. Note that Particles
|
"textures",
|
||||||
// also has a "textures" property.
|
|
||||||
// image
|
// image
|
||||||
"imageURL",
|
"imageURL",
|
||||||
// web
|
// web
|
||||||
|
@ -258,7 +258,7 @@ bool OctreeEntitiesFileParser::readEntitiesArray(QVariantList& entitiesArray) {
|
||||||
"ambientLight.ambientURL",
|
"ambientLight.ambientURL",
|
||||||
"skybox.url",
|
"skybox.url",
|
||||||
// particles
|
// particles
|
||||||
"textures",
|
//"textures", Already specified for model entity type.
|
||||||
// materials
|
// materials
|
||||||
"materialURL",
|
"materialURL",
|
||||||
// ...shared
|
// ...shared
|
||||||
|
@ -292,11 +292,30 @@ bool OctreeEntitiesFileParser::readEntitiesArray(QVariantList& entitiesArray) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (entityObject.contains(key) && entityObject[key].isString()) {
|
if (entityObject.contains(key) && entityObject[key].isString()) {
|
||||||
const QString url = entityObject[key].toString();
|
const QString value = entityObject[key].toString();
|
||||||
|
|
||||||
if (url.startsWith("./") || url.startsWith("../")) {
|
if (value.startsWith("./") || value.startsWith("../")) {
|
||||||
entityObject[key] = _relativeURL.resolved(url).toString();
|
// URL value.
|
||||||
|
entityObject[key] = _relativeURL.resolved(value).toString();
|
||||||
isDirty = true;
|
isDirty = true;
|
||||||
|
} else if (value.startsWith("{")) {
|
||||||
|
// Object with URL values.
|
||||||
|
auto document = QJsonDocument::fromJson(value.toUtf8());
|
||||||
|
if (!document.isNull()) {
|
||||||
|
auto object = document.object();
|
||||||
|
bool isObjectUpdated = false;
|
||||||
|
for (const QString& key : object.keys()) {
|
||||||
|
auto value = object[key].toString();
|
||||||
|
if (value.startsWith("./") || value.startsWith("../")) {
|
||||||
|
object[key] = _relativeURL.resolved(value).toString();
|
||||||
|
isObjectUpdated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isObjectUpdated) {
|
||||||
|
entityObject[key] = QString(QJsonDocument(object).toJson());
|
||||||
|
isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue