Compare commits

...
Author SHA1 Message Date
Hornwitser 1035389c9e Hotfix new player sync logic
Fix has_data not being checked by sync_player, dialog being stuck open if
no data is received by the master and master server refusing to server
empty data.
2021-09-12 00:27:46 +02:00
4 changed files with 8 additions and 8 deletions

No files matched your search

+1 -6
View File
@@ -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 -1
View File
@@ -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",