Showing the changes to scripts/tutorials (1 of 1 file). Show all
Unified · Split
| @@ -16,14 +16,21 @@ location.hostChanged.connect(function(host) { · 15 unmodified lines | |||
| 16 | 16 | ||
| 17 | // Fetch the domain ID from the metaverse | 17 | // Fetch the domain ID from the metaverse |
| 18 | var placeData = request(SERVER + '/places/' + host); | 18 | var placeData = request(SERVER + '/places/' + host); |
| 19 | if (!placeData) { return; } | 19 | if (!placeData) { |
| 20 | print('Cannot find place name - abandoning metadata request for', host); | ||
| 21 | return; | ||
| 22 | |||
| 23 | } | ||
| 20 | var domainID = placeData.data.place.domain.id; | 24 | var domainID = placeData.data.place.domain.id; |
| 21 | print('Domain ID:', domainID); | 25 | print('Domain ID:', domainID); |
| 22 | 26 | ||
| 23 | // Fetch the domain metadata from the metaverse | 27 | // Fetch the domain metadata from the metaverse |
| 24 | var domainData = request(SERVER + '/domains/' + domainID); | 28 | var domainData = request(SERVER + '/domains/' + domainID); |
| 25 | print(SERVER + '/domains/' + domainID); | 29 | print(SERVER + '/domains/' + domainID); |
| 26 | if (!domainData) { return; } | 30 | if (!domainData) { |
| 31 | print('Cannot find domain data - abandoning metadata request for', domainID); | ||
| 32 | return; | ||
| 33 | } | ||
| 27 | var metadata = domainData.domain; | 34 | var metadata = domainData.domain; |
| 28 | print('Domain metadata:', JSON.stringify(metadata)); | 35 | print('Domain metadata:', JSON.stringify(metadata)); |
| 29 | 36 | ||