Skip to content

Commit

Permalink
possible true fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Dec 19, 2024
1 parent a0818a2 commit 76f7624
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions code/modules/asset_cache/asset_cache_client.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
var/job = ++last_asset_job
var/t = 0
var/timeout_time = timeout
src << browse({"<script>window.location.href="?asset_cache_confirm_arrival=[job]"</script>"}, "window=asset_cache_browser&file=asset_cache_send_verify.htm")
if(byond_version < 516)
src << browse({"<script>window.location.href="byond://?asset_cache_confirm_arrival=[job]"</script>"}, "window=asset_cache_browser&file=asset_cache_send_verify.htm")
else
src << browse({"<script>var xhr = new XMLHttpRequest(); xhr.open('GET', 'byond://?asset_cache_confirm_arrival=[job]', true); xhr.send(null);</script>"}, "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++
if(byond_version == 516) // shitty workaround but avoids the spam limiter being hit
src << browse(null, "window=asset_cache_browser&file=asset_cache_send_verify.htm")
if (t < timeout_time)
return TRUE
4 changes: 2 additions & 2 deletions code/modules/asset_cache/validate_assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//this is used over window.location because window.location has a character limit in IE.
function sendbyond(text) {
var xhr = new XMLHttpRequest();
xhr.open('GET', '?'+text, true);
xhr.open('GET', 'byond://?' + text, true);
xhr.send(null);
}
var xhr = new XMLHttpRequest();
Expand All @@ -24,6 +24,6 @@
};
xhr.send(null);
</script>

</body>
</html>

0 comments on commit 76f7624

Please sign in to comment.