Update to latest pauth API
This commit is contained in:
parent
9a2b96f62b
commit
73df1f7079
3 changed files with 6 additions and 6 deletions
|
|
@ -59,7 +59,7 @@ async function connect (client) {
|
|||
if (client.options.useSignalling) {
|
||||
client.signalling = new NethernetSignal(client.connection.nethernet.networkId, client.options.authflow)
|
||||
|
||||
await client.signalling.connect()
|
||||
await client.signalling.connect(client.options.version)
|
||||
|
||||
client.connection.nethernet.credentials = client.signalling.credentials
|
||||
client.connection.nethernet.signalHandler = client.signalling.write.bind(client.signalling)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ function createServer (options) {
|
|||
if (server.options.transport === 'nethernet') {
|
||||
server.signalling = new NethernetSignal(server.options.networkId, server.options.authflow)
|
||||
|
||||
server.signalling.connect()
|
||||
server.signalling.connect(server.options.version)
|
||||
.then(() => {
|
||||
server.signalling.on('signal', (signal) => {
|
||||
switch (signal.type) {
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ class NethernetSignal extends EventEmitter {
|
|||
this.credentials = null
|
||||
}
|
||||
|
||||
async connect () {
|
||||
async connect (version) {
|
||||
if (this.ws?.readyState === WebSocket.OPEN) throw new Error('Already connected signalling server')
|
||||
await this.init()
|
||||
await this.init(version)
|
||||
|
||||
await once(this, 'credentials')
|
||||
}
|
||||
|
|
@ -69,8 +69,8 @@ class NethernetSignal extends EventEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
async init () {
|
||||
const xbl = await this.authflow.getMinecraftServicesToken()
|
||||
async init (version) {
|
||||
const xbl = await this.authflow.getMinecraftBedrockServicesToken({ version })
|
||||
|
||||
const address = `wss://signal.franchise.minecraft-services.net/ws/v1.0/signaling/${this.networkId}`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue