From 6d666b1737cf17167284875ffee5aa88f515a76e Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Sat, 24 Apr 2021 23:31:43 +0200 Subject: [PATCH] Add note about external content URLs to readme --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index ebe4634..95a6d68 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ have been made to the map concepts. the Work Adventure client API, the [Matrix Widget API](https://github.com/matrix-org/matrix-widget-api) is available to scripts +* **Resources**: Resources like images, tilesets, and media can be + referenced using `mxc://` URLs ## Managing game and maps in a room @@ -99,6 +101,29 @@ Care should be taken when referencing such maps from other maps in the room, or using such maps as starting map in the widget. Users could abuse this possibility to add inappropriate content or even scripts that introduce security risks. +#### Referencing URLs to maps + +Instead of loading the entire map JSON into the room state, maps can be referenced +as URLs. + +To link an external map to a map name, simply put a JSON object containing +only the key `url`: + +```sh +curl \ + -X PUT \ + -H "Authorization: Bearer AccessToken" \ + -H "Content-Type: application/json" \ + -d "{'url': 'https://example.com/mymap.json'} \ + https://matrix.org/_matrix/client/r0/rooms/%21roomid%3Amatrix.org/state/team.auglement.augmentile.map/mymap +``` + +URLs can also be used everywhere else where maps are referenced, e.g. in `exitUrl` in other +maps or in URL parameters of Aug\[m\]entile. + +Apart from regular `https://` URLs, `mxc://` URLs are also allowed to reference files uploaded +as media to Matrix. + ### Adding the game as room widget Using the Element client, the widget can be added with the `/addwidget` command. -- GitLab