Skip to content

Commit

Permalink
Implement Nethernet support
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienHH committed Aug 21, 2024
1 parent 52bd3b4 commit 6436947
Show file tree
Hide file tree
Showing 8 changed files with 8,934 additions and 16 deletions.
26 changes: 26 additions & 0 deletions examples/basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
process.env.DEBUG = 'bedrock-portal*'

const { BedrockPortal, Joinability } = require('bedrock-portal')
const { Authflow, Titles } = require('prismarine-auth')

const main = async () => {
const auth = new Authflow('example', './', { authTitle: Titles.XboxAppIOS, deviceType: 'iOS', flow: 'sisu' })

const portal = new BedrockPortal(auth, {
ip: 'bedrock.opblocks.com',
port: 19132,
joinability: Joinability.FriendsOfFriends,
world: {
hostName: 'BedrockPortal',
name: 'BedrockPortal',
version: '1.21.20',
memberCount: 0,
maxMemberCount: 10,
},
})

await portal.start()

}

main()
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Creates a joinable session in Minecraft Bedrock Edition that can route players to their a specified host",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"scripts": {
"build": "tsc",
"watch": "tsc --watch",
"lint": "eslint --ignore-path .gitignore .",
Expand All @@ -21,15 +21,18 @@
},
"homepage": "https://github.com/LucienHH/bedrock-portal#readme",
"dependencies": {
"@lucienhh/bedrock-protocol": "^3.39.0",
"axios": "^1.0.0",
"debug": "^4.3.4",
"prismarine-auth": "^2.2.0",
"json-bigint": "^1.0.0",
"prismarine-auth": "github:LucienHH/prismarine-auth#playfab",
"tiny-typed-emitter": "^2.1.0",
"uuid": "^9.0.0",
"xbox-rta": "^2.0.1"
},
"devDependencies": {
"@types/debug": "^4.1.12",
"@types/json-bigint": "^1.0.4",
"@types/node": "^20.10.6",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^6.17.0",
Expand Down
1 change: 1 addition & 0 deletions src/classes/Host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class Host {

this.profile = await this.rest.getProfile(auth.userXUID)

// @ts-expect-error - XboxRTA isnt using the #playfab branch
this.rta = new XboxRTA(this.authflow)

await this.rta.connect()
Expand Down
Loading

0 comments on commit 6436947

Please sign in to comment.