Add flow and deviceType options to relay (#464)

* add flow and deviceType

for when authTitle is changed

* Update index.d.ts

---------

Co-authored-by: extremeheat <extreme@protonmail.ch>
This commit is contained in:
GameParrot 2024-01-02 14:37:32 -05:00 committed by GitHub
commit 842e66266f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

3
index.d.ts vendored
View file

@ -196,6 +196,9 @@ declare module 'bedrock-protocol' {
// tokens to join the backend server. Cached after the first login.
// If this is not specified, the client will be disconnected with a login prompt.
onMsaCode?(data: ServerDeviceCodeResponse, client: Client): any
// prismarine-auth configuration
flow?: string,
deviceType?: string
}
export class Relay extends Server {

View file

@ -186,6 +186,8 @@ class Relay extends Server {
async openUpstreamConnection (ds, clientAddr) {
const options = {
authTitle: this.options.authTitle,
flow: this.options.flow,
deviceType: this.options.deviceType,
offline: this.options.destination.offline ?? this.options.offline,
username: this.options.offline ? ds.profile.name : ds.profile.xuid,
version: this.options.version,