diff --git a/assets/images/dont delete gerald.txt b/assets/images/dont delete gerald.txt new file mode 100644 index 0000000000..9c89a3c72f --- /dev/null +++ b/assets/images/dont delete gerald.txt @@ -0,0 +1,262 @@ +if you delete gerald the game will fucking crash for some reason +and it has to be that specific gerald too + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++*++++-----:.....::::---=--------------::::::::::::::::::::::::::::::::.:.:::::.:::::--===-======--- ++++++++*:---:-:.........::---------:-:::::::::::::::::::::::::::::::....::::::.::::-====-========--- ++++++++++-----:::::.:..............::.::::::::::::::::.::.:.:::::.:::....::::::::=======-======-==== ++++++++++--++-::::::::::......:::::.::.::::::::::.:.:.:.:............:::::::::=====-==============-- +++++++++*=-++*:::::::::::::........::.:.:::::..:.:::..:............::::::-==============-===-==-===- ++++++++++--+++++::::::::::....:.....:::......::::::...::::::....:.::.:::======================--=--= +++++++++*=-++++++-:::::::::......:::..::.:::.::::::.........::...:::..============================-= ++++++++++=-++++++++=.::::.:.....:..::::.:.:.::::::::................-===========-=============--=-== +++++++++++-+++++++++++:..:::.:..:::.:.::.....:.::::::.............=========-==-=-=================== +++++++++++-++++++++++++==.:.:::..::...:..:...:.::-::...........:==========+==++=+++++++*+=========== ++++++++++===++++++++++=+===+-.:::::............:::.......::.==+==---------------:--------------::::: +--------=---======---:::::::::::.......:.......:::.:::.......:........................:::::::::::.:. +-::-:-::::::::-:::::::::::...:::.::::::........:::.:::.............::.................:::::::::::... +:::::::::::::::::::::::.........................:::................................................. +-::::::::::.:::..:.............................:::.................................................. +:::.::.........................................:.:.................................................. +::::................................................................:.::..:::::::::::::::::::::::::: +:::::....:::::................................::.:...............:::::::---::-:-:::::::::::::::::::: +::::::::::::::.............................:.::::.................::::--------:-:::::::::::::::::::: +::::::::::::::...............................::.::.:........:...::::--------:--::::::::::::::::::::: +:::::::.::::....................:............::::.:.....::.....::::----:---::::::::::::::::::::::::: +:::::::::.....................:.::..........::.::.:.....::....::::---------::::::::::::::::::::::::: +:::::::::....:..................::............:::::...:..:..:::::----------::::::::::::::::::::::::: +:::::::::::.......:.:::.....::..:::...........:::::........::::-------:-:--::::::::::::::::::::::::: +:::::::::::::::........:.:.:.::::::..........:::-:::..:.::.::::------::-:-:::::::::::::::::::::::::: +:::::::::::::..:::........::-.:::.:::....:*######**=..::::::::-----------::::::::::::::::::::::::::: +::::::::::::::::::..........:::-::.:+**+########*#*#**:::-:-:-----------:::::::::::::::::::::::::::: +:::::::::::::::...:..........:.++*%%+*=+*=#**##**+-+=+#*-=::-------------::::::::::::::::::::::::::: +::::::::::::::::::::.:::.::...=#**=**+=-+==***##***+=+*%####*=----=---:::::::::::::::::::::::::::::: +:::::::::::::::::.....::::::####*+++++===+**##***#*++++++==+#**+=-----:::::::::::::::::::::::::::::: +:::::::::::::::::::::::::=+#%%%@@@%%#*+=+****#***#*++**%%%%%%%##-----:--:::::::::::::::::::::::::::: +::::::::::::::::::.:::::+##**%%@#%%%%##++***+###*##+*#%%%%%%%%%*+*-------::::::::::::::::::::::::::: +:::::::::::::::::.:::#%%#++###%%%#%**%#*#*###########%##@@%@##*#*#+------:::::::::::::::---::::::::: +:::::::::::::::.::.*%#%##*#*=*#*%*##*%%################***+*#%%%%###+----::::::::::::------:-::::::: +::::::::::::::::.*######%%###*##***####%%%%%##*###%#######%#%%#%%#**=-:--::::::::::::--------::::::: +:::::::::::::::::%%%*%%%%######*#####*###%%##################%#####%%#----:::::::::::---------:::::: +::::::::::::::::-%#*%%%%%####%##*#####***%@@@@###@@%%+######%%######%%:-:--:::::::::-----------::::: +::::::::::::::::-#*#%#####%#%#%######*##****%#%%%%*+**#####%#########%*-::::::::::---------:----:::: +:::::::::::::::::*#%############%###***#++==+*%%#=+++*##%###*####%%##%@:::::-::::---------------:::: +:::::::::::::::::::%%%%#**##########**+*+++***%%**#*######*#*#####%#+#--:::::::::---:--:--------:::: +:::::::::::::::::::#%%%#***#*#**#*#%###**+****%%#*%##****##%#%*#%%#*---::::::::::----------------::: +:::::::::::::--:::.%%@%#***#**###****##**++*#%#####**###@%##*###%**#-::::-::::::::::----:::::-:-:::: +:-::::::::--:::::::-#%%%%%*****###%**#**######**#%%##%#####*#+%%%%+::::......::::::::::::::::::::::: +--:::----::::::-::::%@%%%***%%*%=:#*####*####%**##%*******%###%##%=.:.....:.::.::::::::::::::::::::. +::----::-:::::::::::%@#=%@%%%%%@*#+********%*+**+*#*++++#*#%%%%#%+.................::::::::::::::::. +-----:--::-:::::::::-+#%#%@+#-+%%%%%*%##*****+#++**+*#*%#%##@%%%#:...........::....::::::::::::::::. +:---:----:-::::::::::@%%%%@%%+%%%%%%%#%%%#*#*+#*+**##%%%%%##@@%%-::::::::::::::::::::::::::::::::::. +-----------::::::::::-%%+@#%=%@@%#%%%%%#%%###%%##@@%%#%@%#%#@@%%*====---------:--::::--::::::::..... +-------------::::::::+%#%*@#@@%%#%%#%%%%%%%%%%##%@%@@%%%%%%%@@%%#+++++==+============--------::::... +------------::-:::-:%#%#*%#@@%%%##%%%%%%%%%%%##%%%@@%%%%#%@%%%%%%#+++++++++++=+=+++=++++====---::::: +------------:-:--:=%+%%*%%@@@%@%##%%%%%%%%%%#%#%%%%%%%%%%%%@%%%%###*+*+++++++++==+++++++=====----:-- +--------:--------*%*%%%%%%@%@%%%##%%%%#%#%%%%%%#%%%%%%%%*%@@%%%%%%#*++++++++++++++=++++=+=+=--:----- +---------:-----:%%#%%%#%%%@@@@%%%%%%%##%%%%%%#%%%%%%%%%%##%@@%%%%%%%**+++++++++++++++++++===-----:-- +--------------=#%#%@%*%#%@@@@@@@%#*#*###%#####%%%%%%%%%%%%%%%%@%%%%%%+*+*++++++++++++++++==-----:::- +===-==-------=#%%%%%%%#%%@@@@%#%###*#####%####%%%%%%%%%%%%%%%%%@%%%%%**+**++*+++++++++++===------:-- +-------------%%%%%%%*#%%%@@%%##%%#%#####%**####%%%%%%%%%%%%%%%%%%%%%%%*****+++++++++++++==--:::-:-:: +------------=%#%%%%%%%%%@@%%%#%%#####%%%#######%%#%%%%%%%%@%%%%%%%%%%%*****+++*+++++++++===------:-- +==----------%%%%%@%*%%@@%%%#%%#%%#%*%%%#**######%%%%%%%@%%%%%%%%%%%%%%#******+*+++++++++===--------- +---------::%#%%%%%%#%@@%%%%%%%%%#%#%%#%%*#######%%%#%%%%%%%%%%%%%%%%%%%******++**++++++===------:--: +----::::::###%%%%%#%%%%%%%%@%@%%%%%%%%%#%########%#%%%%%%%%%%%%%%@%%%%%%******+++++++++==-=--------- +::----::=#%%%%%%%%%%@%@@@@@%%%%@%%%%%%%%%%###%#%%%%%%%%%%%%%%%@%@@@%@@%%********+*+**++==----------- +----=-=###%%#%%%%%%%%%@@@@@@%%@@@@@@%%#%%%%%#%%%%%%%%%%%%%%%@%@@@@%@%%%%%*******+*+++*+====--------- +======#%%%%%%%%%%%%%%%@@%@%%%%%%@%%%%%%%%%%%%%%%%%%%%%@%%%@@@@%@@%%%%@%%%***********++++===--------- +====*##%%%%%%%%%%%%%%%@%%%#%@@@@%@%%@%%%%%%%%%%%%%%%%@%@@%@@@@@%%@%%%%%%%#********+**+++===--------- +===#%#%#%%%%%%%%%#%%%@%#%%%@@@@@%@%@@%%%@@%%%%%%%%%%@%%%%@@%@@@%%%%%%%%%%#********+*++*+===-------:- +==*#%%%%#%%%%%%%%%%@@%%%%%%%%@@%@@@@%%%%@@%%%#%#%#%%%%%%%%%%%%%%%%%%%%%%%##**********++++===-------- \ No newline at end of file diff --git a/assets/images/gerald.gif b/assets/images/gerald.gif new file mode 100644 index 0000000000..0d0bbada70 Binary files /dev/null and b/assets/images/gerald.gif differ diff --git a/source/funkin/backend/system/Main.hx b/source/funkin/backend/system/Main.hx index 31d270d9d2..5047fc643f 100644 --- a/source/funkin/backend/system/Main.hx +++ b/source/funkin/backend/system/Main.hx @@ -1,5 +1,6 @@ package funkin.backend.system; +import haxe.crypto.Sha256; import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond; import flixel.addons.transition.FlxTransitionableState; import flixel.addons.transition.TransitionData; @@ -157,6 +158,42 @@ class Main extends Sprite initTransition(); } + private static var _geraldTimer:Float = 0; + private static final GERALD_HASH:String = "1ae87ef72344af9af1850fe64f417c54f3023e3e2b1030a8bd42429fc2ea6f1e"; + + public static function checkGeraldAsync(elapsed: Float) { + _geraldTimer += elapsed; + + if (_geraldTimer >= 2.0) { + _geraldTimer = 0; + + ThreadUtil.execAsync(function() { + var path:String = "assets/images/gerald.gif"; + + if (sys.FileSystem.exists(path)) { + var bytes = sys.io.File.getBytes(path); + var currentHash = Sha256.encode(bytes.toString()); + + if (currentHash != GERALD_HASH) { + Logs.traceColored([ + Logs.getPrefix("Main"), + Logs.logText("Gerald's hash doesn't match ("), + Logs.logText(currentHash, GRAY), + Logs.logText(")") + ], ERROR); + Sys.exit(1); + } + } else { + Logs.traceColored([ + Logs.getPrefix("Main"), + Logs.logText("Couldn't find Gerald") + ], ERROR); + Sys.exit(1); + } + }); + } + } + public static function refreshAssets() @:privateAccess { FunkinCache.instance.clearSecondLayer(); @@ -200,6 +237,8 @@ class Main extends Sprite if (PlayerSettings.solo.controls.FPS_COUNTER) Framerate.debugMode = (Framerate.debugMode + 1) % 3; + + checkGeraldAsync(flixel.FlxG.elapsed); } private static function onStateSwitchPost() {