diff --git a/README.md b/README.md index ebe46343bc9490008bc98440b52f4d9746a4f3fe..95a6d6868699a1a383238a7c1b845a8c8237ba11 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.