mirror of
https://github.com/overte-org/overte.git
synced 2025-05-29 06:40:30 +02:00
Vircadia MS2 compatibility
Manage to "no cache" in the http request header (since they no more accept "acash" Add per_page=1000 since they change the default to 10. with the parameter it works equally for both: Overte DS1 and Vircadia MS2
This commit is contained in:
parent
9b15f7fd00
commit
db709b3993
1 changed files with 3 additions and 2 deletions
|
@ -183,7 +183,7 @@
|
||||||
|
|
||||||
for (var i = 0; i < metaverseServers.length; i++ ) {
|
for (var i = 0; i < metaverseServers.length; i++ ) {
|
||||||
if (metaverseServers[i].fetch === true) {
|
if (metaverseServers[i].fetch === true) {
|
||||||
extractedData = getContent(metaverseServers[i].url + "/api/v1/places?status=online" + "&acash=" + Math.floor(Math.random() * 999999));
|
extractedData = getContent(metaverseServers[i].url + "/api/v1/places?status=online&per_page=1000");
|
||||||
if (extractedData === "") {
|
if (extractedData === "") {
|
||||||
metaverseServers[i].error = true;
|
metaverseServers[i].error = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -331,7 +331,8 @@
|
||||||
|
|
||||||
function getContent(url) {
|
function getContent(url) {
|
||||||
httpRequest = new XMLHttpRequest();
|
httpRequest = new XMLHttpRequest();
|
||||||
httpRequest.open("GET", url, false); // false for synchronous request
|
httpRequest.open("GET", url, false); // false for synchronous request
|
||||||
|
httpRequest.setRequestHeader("Cache-Control", "no-cache");
|
||||||
httpRequest.timeout = REQUEST_TIMEOUT;
|
httpRequest.timeout = REQUEST_TIMEOUT;
|
||||||
httpRequest.ontimeout=function(){
|
httpRequest.ontimeout=function(){
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Reference in a new issue