Implement Realm joining (#193)

* Pass client options to ping

* Implement RealmAPI to auth

* Add Realm join example

* Update package.json

* Update README.md

* Update index.d.ts

* Show one option, remove listener

* Fix wording

* Explain options

* Optional fields

* Fix typo

* Moved retry ad host/port extraction to prealms

* Add docs

* Fix lint

* Depend on prealms release

Co-authored-by: LucienHH <Lucien.holloway@aprox.co.uk>
This commit is contained in:
LucienHH 2022-04-09 18:11:12 +01:00 committed by GitHub
commit cde600d51e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 88 additions and 3 deletions

View file

@ -15,7 +15,7 @@ function createClient (options) {
if (options.skipPing) {
client.init()
} else {
ping(options).then(ad => {
ping(client.options).then(ad => {
const adVersion = ad.version?.split('.').slice(0, 3).join('.') // Only 3 version units
client.options.version = options.version ?? (Options.Versions[adVersion] ? adVersion : Options.CURRENT_VERSION)
client.conLog?.(`Connecting to server ${ad.motd} (${ad.name}), version ${ad.version}`, client.options.version !== ad.version ? ` (as ${client.options.version})` : '')