Plenty of new stuff#51
Open
edelkas wants to merge 1141 commits into
Open
Conversation
…ging, other minor stuff
Last episode had 3 levels only and wouldn't load in-game, so 2 filler levels were added.
Added an admin special command to show a grid of buttons with things for the botmaster to configure. So far only added one, the log configuration. It opens up a modal that allows changing the log settings (level, modes, etc).
Added checkboxes to change modes, as well as configure fanciness and socket logs.
I was still manually sending requests to Metanet without the wrapper in a few places (get_completions, get_pb, scan_boards), which no longer works ever since tickets are enforced. Also took the opportunity to simplify some of those methods as well.
Removed an argument that was no longer used, and abstracted away the minimum number of highscores required to submit a zero score automatically.
Finally removed all remaining instances of the old concurrent_edit function (to send progress messages to Discord in the background) with the new TmpMsg class.
Steam refresh tokens are JWT's which expire in about 200 days after being issued. After that we can no longer login with them, and since they are required to generate authentication tickets to perform requests to Metanet's server, this breaks the online functionality of outte. So I've added a global var where I store all tokens found in ENV, and parse them every 5 minutes, sending a warning to Discord when there's a week left for expiry. This var also simplifies fetching the tokens themselves, instead of having to manually scramble inside ENV every time.
Added a special command which computes several interesting lists of levels based on their object counts, generates a screenshot of them all, and overlays the object counts with ImageMagick. I've also readded the object names to Map::OBJECTS since they're useful here.
Long ago I had coded my own histogram function and used it for the stats function, but I never updated the userlevel stats which was still using it. Now I'm able to remove the dependency.
Added searchable keywords so that navigating the utils source file is simpler, specifically jumping from one section to another, or back to the table of contents.
Classified gems in groups and sorted alphabetically for better organization
Added new dependency, and used it to fetch the video library sheet and parse it. Eventually the plan is to add video queries to outte, and perhaps incorporate them to the db.
After so many years I'm finally readding these. Videos are associated with highscoreables, players, and challenges. The video library will eventually be fetched and parsed regularly.
Use Roo gem to parse the video library, by reading the author list as well as all challenge sheets, and mapping to our internal classes (Player, Challenge, Video).
Since players from the video library do not necessarily/easily map to N++ players automatically, this new class will represent people who create N++ content, primarily via Youtube or Twitch. We may optionally associate them with their corresponding Player.
Fetching Google sheets via the regular export link is innefficient and also the conversion isn't perfect and misses data, so now we're doing it correctly via the official API, filtering the data appropriately to ignore metadata crap we don't care about. This returns a JSON file instead. Additionally, since this method requires identification via e.g. API keys in order to measure quotas and such, I've added a system to parse such keys from ENV.
Adapted the Video.update method that parses the Video Library to new JSON format that comes from the Google API, seems to be working.
Added a daily task to keep the videos up to date. Also finished polishing the updating method (detect duplicates, logging, ...)
Added a function to browse the library by specifying the highscoreable, and then navigating through the challenges, and for each challenges, through its videos. This all uses the new component system, showing sections with buttons as accessories, for which I've had to implement this functionality. Also made challenge parsing more flexible in the process.
Polished the aspect and now videos are embedded instead of opening the browser. Also the behaviour for DMs and regular channels is different: DMs will always edit the message, but regular channels will post each video separately, since multiple people might use it simultaneously.
If there are more than 10 videos it'll use a select menu (up to 25 max) instead of sections, and if there are 0 it'll display a warning and don't actually allow to click the button. Added a button in the challenges method to go browse the videos. Also added icons (YouTube, Twitch, etc).
Forgot to remove the very old (2019-ish) original system to import videos from the library, which was manual and no longer necessary now that we fetch and parse the spreadsheet automatically
Minor changes to level names (for normalization) and data
Added a couple of fields to the mappack levels table to store the corresponding userlevel ID and whether it should be forwarded or not. This is intended for mappacks that contain already-published userlevels so they can be redirected to Metanet instead of storing a separate copy of the leaderboards locally. Added a method to automatically find the corresponding userlevel (by name), and also a way to compute distances between levels so that we can keep the best match found in case of a tie, as well as find non-exact matches to inspect them manually.
For mappack levels that are connected with a userlevel, I'm now forwarding new submitted scores to Metanet, as well as leaderboard requests. Replays get forwarded automatically already because their replay IDs aren't recognized. This has involved several subtleties that stem from the fact the game generates corrupt scores when submitting IL scores from within episode runs, which I've had to patch to ensure corrupt scores don't get pushed to Metanet boards. Also, this functionality requires to patch the requests before forwarding to Metanet, as well as patching the response before sending it back to the game (mainly to swap the level ID, but also perhaps the score, as mentioned). To aid in this, I've modified the Request class so that it's more easily editable, and now it no longer stores the original Rack env, which isn't really designed to be mutated.
Made some things a bit less strict. For instance, sheet names are now parsed via regex, and a few more errors are detected in advance. Also, exceptions are reported to Discord so I am alerted.
Arbitrary text can now be overlayed on the PNG screenshots. This requires ImageMagick since ChunkyPNG doesn't support text rendering, but it's costly to convert between both formats so we probably shouldn't do that for day-to-day screenshots. Used it for optionally showing bad matches in userlevels connected to mappack levels, so they can be compared with the naked eye, as an application.
The random function now returns a screenshot showcase of all selected samples, with their IDs overlayed.
Added a new table to store permanent score corrections that need to be applied to levels that were changed after release, specifically when gold was added or removed. This is also useful for mappack levels that differ from their userlevel counterparts only in unavoidable gold, so their scores can also be forwarded to Metanet after adjusting the scores suitably.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is mainly a stylistic commit, but there's also a couple of minor functionalities added.
Main change
Added padding to name formatting and score formatting, so that most functions are aligned in columns, with two modes:
Smaller changes
Style
inne++ functions
Dev