Skip to content

Commit

Permalink
Add overideDeviceOS option to RedirectFromRealm module
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienHH committed Oct 9, 2024
1 parent 4f1dc87 commit ae2560f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/redirectFromRealm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export default class RedirectFromRealm extends Module {
* @default {}
*/
clientOptions: any,
/**
* The device OS to use when connecting to the Realm. This is passed directly to a [bedrock-protocol createClient](https://github.com/PrismarineJS/bedrock-protocol/blob/master/docs/API.md#becreateclientoptions--client)
* @default 7 // = Windows
*/
overideDeviceOS: number,
/**
* Options for the chat command
* @type {object}
Expand Down Expand Up @@ -46,6 +51,7 @@ export default class RedirectFromRealm extends Module {
super('redirectFromRealm', 'Automatically invite players to the server when they join a Realm')
this.options = {
clientOptions: { }, // Options for the bedrock-protocol client
overideDeviceOS: 7,
chatCommand: {
enabled: true,
cooldown: 60000,
Expand Down Expand Up @@ -77,6 +83,8 @@ export default class RedirectFromRealm extends Module {

this.client = this.bedrock.createClient(options)

if (this.options.overideDeviceOS) this.client.session.deviceOS = this.options.overideDeviceOS

this.client.once('error', (e: any) => (this.client = null, reject(e)))

this.client.once('disconnect', (e: any) => (this.client = null, reject(e)))
Expand Down

0 comments on commit ae2560f

Please sign in to comment.