From 29b862c2e2590171e0443d75c465c3d174138ba9 Mon Sep 17 00:00:00 2001 From: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:13:00 -0500 Subject: [PATCH] tgui tgui update --- tgui/packages/tgui-dev-server/dreamseeker.js | 3 +++ tgui/packages/tgui-dev-server/reloader.js | 5 +++-- tgui/public/tgui.html | 5 ++++- tools/ci/check_grep.sh | 7 +++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tgui/packages/tgui-dev-server/dreamseeker.js b/tgui/packages/tgui-dev-server/dreamseeker.js index 3d4149cf256c..21ad32e06451 100644 --- a/tgui/packages/tgui-dev-server/dreamseeker.js +++ b/tgui/packages/tgui-dev-server/dreamseeker.js @@ -28,6 +28,9 @@ export class DreamSeeker { .map(key => encodeURIComponent(key) + '=' + encodeURIComponent(params[key])) .join('&'); + logger.log( + `topic call at ${this.client.defaults.baseURL + '/dummy?' + query}` + ); return this.client.get('/dummy?' + query); } } diff --git a/tgui/packages/tgui-dev-server/reloader.js b/tgui/packages/tgui-dev-server/reloader.js index 5722cee644bf..0f62c60ee5ba 100644 --- a/tgui/packages/tgui-dev-server/reloader.js +++ b/tgui/packages/tgui-dev-server/reloader.js @@ -67,8 +67,6 @@ export const findCacheRoot = async () => { const onCacheRootFound = cacheRoot => { logger.log(`found cache at '${cacheRoot}'`); - // Plant a dummy - fs.closeSync(fs.openSync(cacheRoot + '/dummy', 'w')); }; export const reloadByondCache = async bundleDir => { @@ -93,6 +91,9 @@ export const reloadByondCache = async bundleDir => { // Clear garbage const garbage = await resolveGlob(cacheDir, './*.+(bundle|chunk|hot-update).*'); try { + // Plant a dummy browser window file, we'll be using this to avoid world topic + fs.closeSync(fs.openSync(cacheRoot + '/dummy', 'w')); + for (let file of garbage) { fs.unlinkSync(file); } diff --git a/tgui/public/tgui.html b/tgui/public/tgui.html index 5bda2a9b8131..84b00709bb77 100644 --- a/tgui/public/tgui.html +++ b/tgui/public/tgui.html @@ -48,8 +48,9 @@ // Basic checks to detect whether this page runs in BYOND var isByond = (tridentVersion !== null || window.cef_to_byond) && location.hostname === '127.0.0.1' - && location.pathname.indexOf('/tmp') === 0 && location.search !== '?external'; + //As of BYOND 515 the path doesn't seem to include tmp dir anymore if you're trying to open tgui in external browser and looking why it doesn't work + //&& location.pathname.indexOf('/tmp') === 0 // Version constants Byond.IS_BYOND = isByond; @@ -202,6 +203,8 @@ var len = styleSheets.length; for (var i = 0; i < len; i++) { var styleSheet = styleSheets[i]; + if(styleSheet.href === undefined) + continue; if (styleSheet.href.indexOf(url) !== -1) { return styleSheet.rules.length > 0; } diff --git a/tools/ci/check_grep.sh b/tools/ci/check_grep.sh index eb83ab46f86a..0c9f29b7c617 100755 --- a/tools/ci/check_grep.sh +++ b/tools/ci/check_grep.sh @@ -117,4 +117,11 @@ do done < <(jq -r '[.map_file] | flatten | .[]' $json) done +# Check for non-515 compatable .proc/ syntax +if grep -P --exclude='__byond_version_compat.dm' '\.proc/' code/**/*.dm; then + echo + echo -e "${RED}ERROR: Outdated proc reference use detected in code, please use proc reference helpers.${NC}" + st=1 +fi; + exit $st