mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +09:00
Fix message null issues
This commit is contained in:
4 files changed
+4
-6
No files matched your search
@@ -1147,6 +1147,7 @@ messages.instanceInitialized = new Event({
|
||||
messages.instanceStatusChanged = new Event({
|
||||
type: "instance_status_changed",
|
||||
links: ["instance-slave", "slave-master"],
|
||||
eventRequired: ["instance_id", "status"],
|
||||
eventProperties: {
|
||||
"instance_id": { type: "integer" },
|
||||
"status": { enum: [
|
||||
|
||||
@@ -106,7 +106,7 @@ class ControlConnection extends BaseConnection {
|
||||
version: slave.version,
|
||||
id: slave.id,
|
||||
name: slave.name,
|
||||
public_address: slave.public_address,
|
||||
public_address: slave.public_address || null,
|
||||
connected: this._master.wsServer.slaveConnections.has(slave.id),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ class Master {
|
||||
version: slave.version,
|
||||
id: slave.id,
|
||||
name: slave.name,
|
||||
public_address: slave.public_address,
|
||||
public_address: slave.public_address || null,
|
||||
connected: this.wsServer.slaveConnections.has(slave.id),
|
||||
};
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ class Instance extends libLink.Link {
|
||||
libLink.messages.instanceStatusChanged.send(this, {
|
||||
instance_id: this.id,
|
||||
status,
|
||||
game_port: this.server ? this.server.gamePort : this.config.get("factorio.game_port") || null,
|
||||
game_port: this.server?.gamePort || this.config.get("factorio.game_port") || null,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -694,8 +694,6 @@ class Instance extends libLink.Link {
|
||||
}
|
||||
|
||||
async masterConnectionEventEventHandler(message) {
|
||||
this.notifyStatus(this._status);
|
||||
|
||||
await libPlugin.invokeHook(this.plugins, "onMasterConnectionEvent", message.data.event);
|
||||
}
|
||||
|
||||
@@ -1301,7 +1299,6 @@ class Slave extends libLink.Link {
|
||||
libLink.messages.instanceStatusChanged.send(this, {
|
||||
instance_id,
|
||||
status: instanceConnection ? instanceConnection.status : "stopped",
|
||||
game_port: null,
|
||||
});
|
||||
|
||||
// save a copy of the instance config
|
||||
|
||||
Reference in new issue
Block a user