bedrock-portal 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -12
- package/package.json +1 -1
- package/src/common/constants.js +1 -1
package/README.md
CHANGED
|
@@ -36,15 +36,19 @@ const { BedrockPortal } = require('bedrock-portal');
|
|
|
36
36
|
const { Authflow, Titles } = require('prismarine-auth');
|
|
37
37
|
|
|
38
38
|
const main = async () => {
|
|
39
|
-
|
|
39
|
+
const auth = new Authflow('example', './', { authTitle: Titles.MinecraftNintendoSwitch, deviceType: 'Nintendo' });
|
|
40
|
+
|
|
41
|
+
const session = new BedrockPortal(auth, {
|
|
42
|
+
ip: 'geyserconnect.net', // The server IP & port to redirect players to
|
|
43
|
+
port: 19132,
|
|
44
|
+
joinability: 'friends_of_friends', // The joinability of the session. Can be 'friends_of_friends', 'friends_only', 'invite_only'
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
await session.start();
|
|
48
|
+
|
|
49
|
+
// accepts a player's gamertag or xuid
|
|
50
|
+
await session.invitePlayer('p3')
|
|
40
51
|
|
|
41
|
-
const session = new BedrockPortal(auth, {
|
|
42
|
-
ip: 'geyserconnect.net', // The server IP & port to redirect players to
|
|
43
|
-
port: 19132,
|
|
44
|
-
joinability: 'friends_of_friends', // The joinability of the session. Can be 'friends_of_friends', 'friends_only', 'invite_only'
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
await session.start();
|
|
48
52
|
};
|
|
49
53
|
|
|
50
54
|
main();
|
|
@@ -56,10 +60,10 @@ Modules are used to extend the functionality of the BedrockPortal class. You can
|
|
|
56
60
|
|
|
57
61
|
```js
|
|
58
62
|
new BedrockPortal(auth, {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
...,
|
|
64
|
+
modules: {
|
|
65
|
+
autoFriendAdd: true, // Automatically add friends to the session
|
|
66
|
+
},
|
|
63
67
|
})
|
|
64
68
|
```
|
|
65
69
|
|
package/package.json
CHANGED
package/src/common/constants.js
CHANGED