diff --git a/index.d.ts b/index.d.ts index ea1179a..cda2551 100644 --- a/index.d.ts +++ b/index.d.ts @@ -162,7 +162,7 @@ declare module 'bedrock-protocol' { constructor(options: Options) - listen(host?: string, port?: number): Promise + listen(): Promise close(disconnectReason?: string): Promise on(event: 'connect', cb: (client: Player) => void): any diff --git a/src/server.js b/src/server.js index 6d9aa79..4dc9852 100644 --- a/src/server.js +++ b/src/server.js @@ -118,8 +118,9 @@ class Server extends EventEmitter { return this.advertisement } - async listen (host = this.options.host, port = this.options.port) { - this.raknet = new this.RakServer({ host, port }, this) + async listen () { + const { host, port, maxPlayers } = this.options + this.raknet = new this.RakServer({ host, port, maxPlayers }, this) try { await this.raknet.listen()