Skip to content

lil2kki/Save-on-Crash-Handler

Repository files navigation

A cross-platform crash handling system for Geometry Dash that automatically saves your progress when the game crashes.

Was rejected by admin of Geode Index...

With this message:

this is very wrong on so many levels, first of all 
it is extremely dangerous to do heavy tasks 
like saving on crash as it can cause save corruptions, 
accumulated crashes and even memory overflows. 
crash handling is very delicate, 
even spawning a popup should be done 
with extreme caution. so yeah.

What it does

  • Detects crashes and unexpected shutdowns
  • Automatically saves your game progress
  • Saves level editor progress
  • Works on Windows, macOS, iOS, and Android
  • Provides crash callbacks for other mods to use

For developers

Other mods can register their own crash callbacks.

Add to your mod.json the dependencies:

"dependencies": {
	"user95401.save-on-crash-handler": ">=v1.0.0"
}

(supports suggested type)

Usage:

// Contains MBO and tools for shared CrashHandler*
#include <user95401.save-on-crash-handler/include/main.hpp>

void setupCrashHandler();
$on_mod(Loaded) { setupCrashHandler(); }
inline void setupCrashHandler() {
    CrashHandler::get()->onCrash(
        [](const std::string& crashInfo) {
            // Your crash handling code here
            log::info("Crash detected: {}", crashInfo);
        }
    );
}

Parameters of onCrash and onLevelSavedAtCrash:

  • callback: New function for callbacks list
  • prepend: Add to front of callback list (default: false)
  • replace: Replace all existing callbacks (default: false)

Technical details

  • Uses signal handlers (SIGSEGV, SIGBUS, SIGFPE, SIGILL) on Unix-like systems
  • Tries to use structured exception handling on Windows
  • Includes stack traces on macOS/iOS

Notes

  • Crash detection isn't 100% guaranteed for all crash types
  • Some crashes might be too severe to allow saving
  • Stack overflow crashes are particularly hard to handle
  • Works best with access violations and similar common crashes

About

A cross-platform crash handling system for Geometry Dash that automatically saves your progress when the game crashes.

Topics

Resources

License

Stars

Watchers

Forks

Contributors