mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 07:33:12 +09:00
Wait for RCON connecting on FactorioServer.stop()
If the RCON client is currently in the process of connecting to the Factorio server then wait for it to complete the connection to avoid it emmiting out an error connecting in FactorioServer.stop().
This commit is contained in:
1 parent
9082b40abd
commit
a781c2f988
1 file changed
+7
@@ -620,6 +620,13 @@ class FactorioServer extends events.EventEmitter {
|
||||
|
||||
this._state = "stopping";
|
||||
if (this._rconClient) {
|
||||
|
||||
// If RCON is not yet fully connected that operation needs to
|
||||
// complete before the RCON connection can be closed cleanly.
|
||||
if (!this._rconReady) {
|
||||
await events.once(this, 'rcon-ready');
|
||||
}
|
||||
|
||||
await this._rconClient.end();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user