Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
extremeheat
2ea5c27893
Update index.d.ts 2025-01-17 05:37:26 -05:00
extremeheat
b4f4202faa
Update server.js 2025-01-17 05:36:27 -05:00
extremeheat
6b5aa08dba
Fix Server maxPlayers option 2025-01-17 05:35:26 -05:00
2 changed files with 4 additions and 3 deletions

2
index.d.ts vendored
View file

@ -162,7 +162,7 @@ declare module 'bedrock-protocol' {
constructor(options: Options) constructor(options: Options)
listen(host?: string, port?: number): Promise<void> listen(): Promise<void>
close(disconnectReason?: string): Promise<void> close(disconnectReason?: string): Promise<void>
on(event: 'connect', cb: (client: Player) => void): any on(event: 'connect', cb: (client: Player) => void): any

View file

@ -118,8 +118,9 @@ class Server extends EventEmitter {
return this.advertisement return this.advertisement
} }
async listen (host = this.options.host, port = this.options.port) { async listen () {
this.raknet = new this.RakServer({ host, port }, this) const { host, port, maxPlayers } = this.options
this.raknet = new this.RakServer({ host, port, maxPlayers }, this)
try { try {
await this.raknet.listen() await this.raknet.listen()