vircadia / vircadia-web-sdk

Vircadia Web SDK - an SDK for the Vircadia platform that runs in your web browser.
Apache License 2.0
35 stars 29 forks source link

Add domain-server request to fetch metaverse-server URL #32

Open Misterblue opened 3 years ago

Misterblue commented 3 years ago

Vircadia-web needs to get the metaverse-server URL that the domain server is associated with. There should be a call on the DomainServer class instance for fetching same.

There is an existing request REST API request to "/api/metaverse_info" that might be the solution.

ctrlaltdavid commented 3 years ago

What does the domain server class need the metaverse server URL for, precisely?

Misterblue commented 3 years ago

I figured vircadia-web-sdk is the JS API to the domain-server. The domain-server, in addition to interfacing to the scene and services (audio, ...), has a REST API providing a bunch of functions. For instance, Interface never needs to talk to the metaverse-server to login. It can login through the domain-server via the URL "domain-server/oauth" (which passes through the request to the domain-server's metaverse-server). See https://github.com/vircadia/vircadia/blob/5da3f889711feff6797237924289b5c5c3e8a7c8/domain-server/src/DomainServer.cpp#L2026 for a list of these REST operations. The operations include domain-server control (/id, /restart, /assignment, /nodes), scene operations (/content/upload), and passthrough to the metaverse-server (/api/places, /api/domains, /api/backups, ...). Design-wise, does vircadia-web-sdk include an API for these REST operations or is this a separate module?

(Edit: this seems like serious man-splaining (what is the tech equivalent?) My fingers get going and since we don't talk a lot, I keep wanting to add context. If the context is obvious, just ignore my ramblings.)