Skip to content

Conversation

@Joshua2504
Copy link

No description provided.

@Joshua2504 Joshua2504 requested a review from Copilot March 29, 2025 15:27
Copy link

Copilot AI left a 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")

@Joshua2504 Joshua2504 self-assigned this Mar 29, 2025
@mascaldotfr
Copy link

mascaldotfr commented Apr 30, 2025

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_import20250430

And then you can PR from Github :)

@mascaldotfr mascaldotfr force-pushed the main branch 3 times, most recently from 21713d9 to 83be289 Compare August 15, 2025 09:46
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.
mascaldotfr and others added 30 commits October 30, 2025 08:33
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 :'(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants