mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1035389c9e |
No files matched your search
@@ -160,14 +160,9 @@ class MasterPlugin extends libPlugin.BaseMasterPlugin {
|
||||
this.logger.warn(`${instanceName} downloaded ${player_name} while another instance has acquired it`);
|
||||
}
|
||||
|
||||
let playerData = this.playerDatastore.get(player_name);
|
||||
if (!playerData) {
|
||||
throw new libErrors.RequestError(`No player data exists for ${player_name}`);
|
||||
}
|
||||
|
||||
this.logger.verbose(`Sending player data for ${player_name} to ${instanceName}`);
|
||||
return {
|
||||
player_data: playerData || null,
|
||||
player_data: this.playerDatastore.get(player_name) || null,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ local function download_inventory(player_name, data, number, total)
|
||||
log("ERROR: Inventory sync failed, got empty player data for " .. player.name .. " from the master")
|
||||
player.print("ERROR: Inventory sync failed, got empty player data from the master")
|
||||
|
||||
progress_dialog.remove(player)
|
||||
|
||||
-- Give the player a character and pretend that's the synced player data
|
||||
ensure_character(player)
|
||||
|
||||
|
||||
@@ -194,7 +194,10 @@ function inventory_sync.sync_player(acquire_response)
|
||||
return
|
||||
end
|
||||
|
||||
if not player_record.sync or acquire_response.generation > player_record.generation then
|
||||
if
|
||||
acquire_response.has_data
|
||||
and (not player_record.sync or acquire_response.generation > player_record.generation)
|
||||
then
|
||||
inventory_sync.initiate_inventory_download(player, player_record, acquire_response.generation)
|
||||
|
||||
else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@clusterio/plugin-inventory_sync",
|
||||
"version": "2.0.0-alpha.9",
|
||||
"version": "2.0.0-alpha.9.b",
|
||||
"description": "Clusterio plugin forwarding between Factorio servers",
|
||||
"author": "Danielv <danielv@danielv.no>",
|
||||
"homepage": "https://github.com/clusterio/factorioClusterio#readme",
|
||||
|
||||
Reference in new issue
Block a user