Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp the error/result code module. (nh-server#830)
* Prepare for error code rewrite -removed err.py -removed nxerr.py -edited kurisu.py to account for this * Add results cog It unifies `nxerr` and `err` together with a cleaner codebase. Its supporting code properly parses errors whenever possible and is mostly complete at this point. There are still some missing codes from all consoles, but I plan on adding more as time goes on. * Add types.py This file is the backbone of the result codes built on top of it. It provides the two basic types necessary for the result cog to function. * Add ctr.py This file contains all currently known 3DS error codes, and helper funcs to get information about them. * Add cafe.py This file contains all currently known Wii U error codes, and helper funcs to get information about them. * Add nx.py This file contains all currently known Switch error codes, and helper funcs to get information about them. * Rename files for less confusion nx.py to switch.py cafe.py to wiiu.py * Update cog code to account for renamed files * Add Wii U error code 115-5004. Closes issue nh-server#825. * Fix indentation of description embed field * Add comments to most of the files to help explain what they do. Also how to add new modules and error codes. * Adjust some comments in the cog. * Make a note that a number of 3DS result codes were left out. This wasn't completely intentional, but adding literally everything would have delayed this even longer than it's already taken (months of off and on work). I will add them in eventually. * Credit switchbrew, 3dbrew, and Atmosphere for much of the information. * Address pyflakes's complaints. They're actually valid for once. I missed a few things. * Add meme support Not bothering to obfuscate them anymore, because everyone knows about them already. * Add several more missing 3DS error codes. NIM-specifics are still NYI. * Adjust ban result codes to have a flag instead Keeps the descriptions much shorter. * Add more missing Wii U results * Add some missing nx support pages and errors * Implement err2hex, hex2err And also add a couple more errors... * Fixup the input for hex2err & err2hex * Prefer `is not None` when possible * Support showing both hex and human-readable results in the embed * Add basic support for Wii U hexadecimal error codes -Removed err2hex for 3ds & wiiu, it's not possible to do this * Revise QoL hex/err display logic * Shorten an extremely long line of code * Fix pyflakes issues * Two changes -Catch bad error or hex codes passed to err2hex and hex2err -Simplify the err_disp logic as much as possible * Remove debug prints * Fix small bug in wiiu.get Actually fix the bug * Add support for suppressing err2hex unsupported messages. It helps keep other code sane. Hopefully this is the LAST time I have to touch the error code display logic. I'm sick of this. Also change the embed colour to the warning colour when the result is a ban. * Add 3DS nim-specific error handling. It feels like a hack but it is what it is. * Add original notes from the nim-specific stuff in the old err cog Edited slightly since the first line had redundancy. * Don't need an f-string there * Fix indentation * Add a bit more info to one error code * Reorder 3ds modules based on number * Reorder Switch modules based on number * wiiu: Add missing parenthesis, remove old TODO * Fix various style issues (mainly spacing). Ignored error about := spacing, because pep8 doesn't know what it wants. Ignored line length limits, we don't follow that either. * Remove excess newlines at end of files Gedit has some kind of a bug in it, or it automatically adds newlines regardless of what you do? Unsure, don't care. * Remove unused and/or redundant things
- Loading branch information