Skip to content

Commit 38dc5a2

Browse files
authored
Fix Server maxPlayers option (#565)
1 parent a79be99 commit 38dc5a2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ declare module 'bedrock-protocol' {
162162

163163
constructor(options: Options)
164164

165-
listen(host?: string, port?: number): Promise<void>
165+
listen(): Promise<void>
166166
close(disconnectReason?: string): Promise<void>
167167

168168
on(event: 'connect', cb: (client: Player) => void): any

src/server.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ class Server extends EventEmitter {
118118
return this.advertisement
119119
}
120120

121-
async listen (host = this.options.host, port = this.options.port) {
122-
this.raknet = new this.RakServer({ host, port }, this)
121+
async listen () {
122+
const { host, port, maxPlayers } = this.options
123+
this.raknet = new this.RakServer({ host, port, maxPlayers }, this)
123124

124125
try {
125126
await this.raknet.listen()

0 commit comments

Comments
 (0)