mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 15:24:52 +09:00
Offer the player a temporary inventory while waiting for master
This commit is contained in:
1 parent
29917fb85a
commit
e63f1246da
8 files changed
+172
-2
No files matched your search
@@ -17,6 +17,7 @@ function chunkify(chunkSize, string) {
|
||||
|
||||
class InstancePlugin extends libPlugin.BaseInstancePlugin {
|
||||
async init() {
|
||||
// Handle IPC from scenario script
|
||||
this.instance.server.on("ipc-inventory_sync_upload", content => this.handleUpload(content)
|
||||
.catch(err => this.logger.error(`Error handling ipc-inventory_sync_upload:\n${err.stack}`)));
|
||||
this.instance.server.on("ipc-inventory_sync_download", content => this.handleDownload(content)
|
||||
@@ -35,6 +36,8 @@ class InstancePlugin extends libPlugin.BaseInstancePlugin {
|
||||
|
||||
async handleDownload(player) {
|
||||
this.logger.verbose(`Downloading ${player.player_name}`);
|
||||
|
||||
// Retrieves inventory data. If the master is offline it waits until it comes back online.
|
||||
let response = await this.info.messages.download.send(this.instance, {
|
||||
player_name: player.player_name,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user