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:
parent
dfff13867d
commit
cde600d51e
7 changed files with 88 additions and 3 deletions
13
examples/client/realm.js
Normal file
13
examples/client/realm.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* eslint-disable */
|
||||
const bedrock = require('bedrock-protocol')
|
||||
const client = bedrock.createClient({
|
||||
realms: {
|
||||
// realmId: '1234567', // Connect the client to a Realm using the Realms ID
|
||||
// realmInvite: 'https://realms.gg/AB1CD2EFA3B', // Connect the client to a Realm using the Realms invite URL or code
|
||||
pickRealm: (realms) => realms.find(e => e.name === 'Realm Name') // Connect the client to a Realm using a function that returns a Realm
|
||||
}
|
||||
})
|
||||
|
||||
client.on('text', (packet) => { // Listen for chat messages
|
||||
console.log('Received Text:', packet)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue