-
Notifications
You must be signed in to change notification settings - Fork 1
merge with mascal #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v2
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR merges updates from the mascal branch into main by standardizing error reporting and refreshing version information. Key changes include:
- Adding an eprint() function to both warstatus scripts for consistent error output.
- Replacing print calls with eprint in error-handling blocks.
- Updating version strings in JavaScript files and adding a maintenance notice in the README.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| warstatus/warstatus.py | Introduces error logging via eprint and replaces print calls. |
| warstatus/stats/generate.py | Updates error messages to use eprint for consistency. |
| js/menu.js | Updates version information. |
| js/bosses.js | Updates respawn timestamps and corresponding comments. |
| README.md | Adds a maintenance mode notice with links for further developments. |
Comments suppressed due to low confidence (2)
warstatus/warstatus.py:51
- [nitpick] Consider removing the extra space before the exclamation mark to ensure the error message is clear and consistent.
eprint("Failed to fetch the page ! " + traceback.format_exc())
warstatus/warstatus.py:223
- [nitpick] Consider rephrasing this error message for clarity, for example: 'Unexpected upstream HTML format or server reboot detected; aborting operation.'
eprint("Messed up upstream HTML or server reboot, write nothing")
|
Hi @Joshua2504, Copilot is WAY too dumb to solve this 🤣 It requires ancient, pre-Github wizardry: mail patches, with path manipulation. I could have just pushed the branch, but I think it's interesting for you to get to know how to do it, for the future : git clone https://github.com/mascaldotfr/CoRT.git
cd CoRT
# Get the last 6 patches; you can also specify a specific commit and stuff
# Your menu.js is too different to get merged
git format-patch --stdout -6 ':!js/menu.js' > /tmp/mascal_changes.patch
# Change paths (hopefully I almost never change html stuff ahah)
# That's MacOS syntax already for sed(1) iirc
sed -E -i '' 's@(a|b)/(js|data)@\1/public/\2@g' /tmp/mascal_changes.patch
# Get back to your own repo
cd /where/is/yourCoRT
# We create our own branch
git checkout v2 # your main branch
git checkout -b mascal_import20250430 # create an import branch
# Then we apply the patch
git am /tmp/mascal_changes.patch
# All your commits are already in that branch
git log
# Just push the branch
git push origin mascal_import20250430:mascal_import20250430And then you can PR from Github :) |
21713d9 to
83be289
Compare
It's better to have a simplified map than a pixelized one.
Shadows never appeared on any Webkit browser (like Safari on Apple stuff), but I found out some nice docs from Apple about canvas and it fixed it. See https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/HTML-canvas-guide/AddingShadows/AddingShadows.html
Support varies following platforms and browsers used.
Finally. Part 2 will include further fixes due to the change.
Layout changes should be less aggressive
It was too airy imo.
Very happy to fix that longstanding annoyance. I should have RTFM long ago!
Network throttling does wonders for testing!
Instead of making an arbitrary percentage of the trainer area, use 3 em by trainer row.
Preventing bunny hoppers to hop.
It's a complete overkill to do this at each hit
This eases development a lot, see the docs for more infos. I can't really do this for BZs sadly, due to the hourly nature of BZs. You better off changing your system date for this.
Like WZ, refresh on focus if no other focus event was trigerred the last 5 seconds. Note that it won't cause more API usage, it's guarded by refresh_display(), that is caching respawns until next respawn.
Given that in fake mode there is 60 respawns / hour, it's better NOT starting computing from 1970, right :)?
This has been the first piece of server side stuff I wrote for CoRT 3 years ago. Back then I didn't expect to see CoRT becoming that popular and implemented a full file rewrite for every submitted setup as quick hack (and well my PHP was rusty, and still is). With almost 10K setups nowadays, it's beginning to get expensive, so only add the line corresponding to the setup to the trainer_saved_setups.txt and its gziped counterpart. The submission runtime is now around 1.5ms; it used to be 35ms before that commit.
It's similar to what I did to bosses.js, but the situation is different because we don't need to notify in that page, so we can be more aggressive: - If the page is hidden, do nothing - If the page is focused, immediatly update (with a 5s debounce) - If the page is visible, then the good old 60s update delay is used
If an element of the browser, like the address bar, was focused and tha page was visible again, nothing happened.
Callbacks are called multiple times when the computer gets out of sleep and the window get focus. If I mention computers, it's because "smart" devices aren't impacted as long a connection is available. - For bosses and BZ, use a 1s cooldown. None was implemented before. - For wstats and wz, it's just that the last run was recorded after networked callbacks, letting time to events to fire multiple times.
Allow to test notifications properly.
These 3 notifies, and need to be used off main thread. Use a new MyScheduler class, a middleware allowing to easily implement web workers without calling ticker.js every time. It also deal with focus events. No WET code as such. Also: BZ - update minutely instead of each second - use Time class from wztools.js so countdown values are similar to WZ and BZ. Remove duplicate code as a result. - warn BZ is going to end one minute before the end; a bug that is becoming a feature if properly worded, and it's more consistent with how BOSSES does things. BOSSES - the move to MyScheduler allow more precise respawn countdowns, but this is coming also from the fact that bosses spawns are now exactly aligned at :00 of the spawn minute (ex: 12:34:56 => 12:34:00). Survived Microsoft's weirdly baked virtual desktops.
Since the move to the API, we have at best 5 BZ displayed now, instead of 7.
It gives me time to then edit the release body
Inspired by Vlata's questions, thanks!
Corrected link formatting for the automation script reference.
It didn't expand properly on mobile.
People don't read docs anyway :'(
No description provided.