From 94f7dae62e230761541b2b3433c4c835094f502f Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 1 Jul 2020 16:24:12 +0200 Subject: [PATCH 1/2] Porting "Fix asset cache verification" and other tiny bits. --- code/__HELPERS/icons.dm | 4 ++-- code/modules/asset_cache/asset_cache_client.dm | 9 +-------- code/modules/client/client_defines.dm | 8 ++++++++ interface/skin.dmf | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index aee0f3d7f7..62876316f9 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1138,7 +1138,7 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 var/name = sanitize_filename("[generate_asset_name(thing)].png") register_asset(name, thing) for (var/thing2 in targets) - send_asset(thing2, key, FALSE) + send_asset(thing2, key) return "" var/atom/A = thing if (isnull(dir)) @@ -1162,7 +1162,7 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 key = "[generate_asset_name(I)].png" register_asset(key, I) for (var/thing2 in targets) - send_asset(thing2, key, FALSE) + send_asset(thing2, key) return "" diff --git a/code/modules/asset_cache/asset_cache_client.dm b/code/modules/asset_cache/asset_cache_client.dm index 50a5685ded..0f51520f13 100644 --- a/code/modules/asset_cache/asset_cache_client.dm +++ b/code/modules/asset_cache/asset_cache_client.dm @@ -1,11 +1,4 @@ -/client - var/list/sent_assets = list() // List of all asset filenames sent to this client by the asset cache, along with their assoicated md5s - var/list/completed_asset_jobs = list() /// List of all completed blocking send jobs awaiting acknowledgement by send_asset - - var/last_asset_job = 0 /// Last asset send job id. - var/last_completed_asset_job = 0 - /// Process asset cache client topic calls for "asset_cache_confirm_arrival=[INT]" /client/proc/asset_cache_confirm_arrival(job_id) var/asset_cache_job = round(text2num(job_id)) @@ -50,7 +43,7 @@ var/t = 0 var/timeout_time = timeout src << browse({""}, "window=asset_cache_browser&file=asset_cache_send_verify.htm") - + while(!completed_asset_jobs["[job]"] && t < timeout_time) // Reception is handled in Topic() stoplag(1) // Lock up the caller until this is received. t++ diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 0402dc683f..12536b4382 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -134,5 +134,13 @@ var/parallax_layers_max = 3 var/parallax_animate_timer + // List of all asset filenames sent to this client by the asset cache, along with their assoicated md5s + var/list/sent_assets = list() + /// List of all completed blocking send jobs awaiting acknowledgement by send_asset + var/list/completed_asset_jobs = list() + /// Last asset send job id. + var/last_asset_job = 0 + var/last_completed_asset_job = 0 + //world.time of when the crew manifest can be accessed var/crew_manifest_delay diff --git a/interface/skin.dmf b/interface/skin.dmf index 8d68336754..cf49f0f30f 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -80,6 +80,7 @@ window "mainwindow" anchor2 = none background-color = #272727 is-visible = false + auto-format = false saved-params = "" elem "tooltip" type = BROWSER From f7de8034a1a63812e52691dd733d64ac748a33a0 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 1 Jul 2020 19:26:09 +0200 Subject: [PATCH 2/2] Put an end to the null stack traces from icon2html's register_asset. --- code/__HELPERS/icons.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 62876316f9..3155fe2548 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1136,7 +1136,8 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 if (!isicon(I)) if (isfile(thing)) //special snowflake var/name = sanitize_filename("[generate_asset_name(thing)].png") - register_asset(name, thing) + if(!SSassets.cache[name]) + register_asset(name, thing) for (var/thing2 in targets) send_asset(thing2, key) return "" @@ -1160,7 +1161,8 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 I = icon(I, icon_state, dir, frame, moving) key = "[generate_asset_name(I)].png" - register_asset(key, I) + if(!SSassets.cache[key]) + register_asset(key, I) for (var/thing2 in targets) send_asset(thing2, key)