Fix Server maxPlayers option (#565)
This commit is contained in:
parent
a79be99c0f
commit
38dc5a2561
2 changed files with 4 additions and 3 deletions
2
index.d.ts
vendored
2
index.d.ts
vendored
|
|
@ -162,7 +162,7 @@ declare module 'bedrock-protocol' {
|
|||
|
||||
constructor(options: Options)
|
||||
|
||||
listen(host?: string, port?: number): Promise<void>
|
||||
listen(): Promise<void>
|
||||
close(disconnectReason?: string): Promise<void>
|
||||
|
||||
on(event: 'connect', cb: (client: Player) => void): any
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue