fix: type definition errors found related to ServerAdvertisements. (#103)
* fix: online/max player count type definition. Fixes the type definition of the online/max players to be an immediate child of the ServerAdvertisement class so that it can be accessed properly on TypeScript. Signed-off-by: JK <u.sslooky@gmail.com> * feat: implement advertisementFn type definition. Adds the type definition for the 'advertisementFn' server option. Signed-off-by: JK <u.sslooky@gmail.com> * fix: minor advertisementFn typo in API docs. Fixes a minor typo found in the API docs that misspells 'advertisementFn' as 'advertismentFn'. Signed-off-by: JK <u.sslooky@gmail.com> * feat: add skipPing to the API docs. Adds the 'skipPing' client option to the API docs. Signed-off-by: JK <u.sslooky@gmail.com> * feat: add connectTimeout type definition. Adds the 'connectTimeout' client option to the package type definitions. Signed-off-by: JK <u.sslooky@gmail.com>
This commit is contained in:
parent
6a03c9813c
commit
90d12fa696
2 changed files with 8 additions and 6 deletions
|
|
@ -17,7 +17,8 @@ Returns a `Client` instance and connects to the server.
|
|||
| connectTimeout | *optional* | default to **9000ms**. How long to wait in milliseconds while trying to connect to server. |
|
||||
| onMsaCode | *optional* | Callback called when signing in with a microsoft account with device code auth, `data` is an object documented [here](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code#device-authorization-response) |
|
||||
| profilesFolder | *optional* | Where to store cached authentication tokens. Defaults to .minecraft, or the node_modules folder if not found. |
|
||||
| autoInitPlayer | optional | default to true, If we should send SetPlayerInitialized to the server after getting play_status spawn. |
|
||||
| autoInitPlayer | *optional* | default to true, If we should send SetPlayerInitialized to the server after getting play_status spawn. |
|
||||
| skipPing | *optional* | Whether pinging the server to check its version should be skipped. |
|
||||
|
||||
|
||||
## be.createServer(options) : Server
|
||||
|
|
@ -36,7 +37,7 @@ authenticated unless offline is set to true.
|
|||
| maxPlayers | *optional* | default to **3**. Set this to change the maximum number of players connected. |
|
||||
| kickTimeout | *[Future][1]* | How long to wait before kicking a unresponsive client. |
|
||||
| motd | *optional* | The "message of the day" for the server, the message shown to players in the server list. See usage below. |
|
||||
| advertismentFn | *optional* | optional. Custom function to call that should return a ServerAdvertisement, used for setting the RakNet server PONG data. Overrides `motd`. |
|
||||
| advertisementFn | *optional* | optional. Custom function to call that should return a ServerAdvertisement, used for setting the RakNet server PONG data. Overrides `motd`. |
|
||||
|
||||
## be.ping({ host, port }) : ServerAdvertisement
|
||||
|
||||
|
|
|
|||
9
index.d.ts
vendored
9
index.d.ts
vendored
|
|
@ -23,6 +23,8 @@ declare module "bedrock-protocol" {
|
|||
viewDistance?: number,
|
||||
// Specifies which game edition to sign in as. Optional, but some servers verify this.
|
||||
authTitle?: title | string,
|
||||
// How long to wait in milliseconds while trying to connect to the server.
|
||||
connectTimeout?: number
|
||||
// whether to skip initial ping and immediately connect
|
||||
skipPing?: boolean
|
||||
}
|
||||
|
|
@ -36,6 +38,7 @@ declare module "bedrock-protocol" {
|
|||
// The sub-header for the MOTD shown in the server list.
|
||||
levelName: string
|
||||
}
|
||||
advertisementFn: () => ServerAdvertisement
|
||||
}
|
||||
|
||||
enum ClientStatus {
|
||||
|
|
@ -145,10 +148,8 @@ declare module "bedrock-protocol" {
|
|||
name: string
|
||||
protocol: number
|
||||
version: string
|
||||
players: {
|
||||
online: number,
|
||||
max: number
|
||||
}
|
||||
playersOnline: number
|
||||
playersMax: number
|
||||
gamemode: string
|
||||
serverId: string
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue