Skip to content

strangergwenn/Mayday

Repository files navigation

Mayday

Mayday is a lightweight crash reporter for Unreal Engine games that uploads the crash context and minidump to an HTTP(S) server of your choosing when your game encounters a crash.

The tool is statically compiled down to a reasonably-size (<3MB) executable that does not need require dependencies on the end-user's machine.

How to build

  • Install CMake 3.5, the OpenSSL library, and your favorite C++ 17 capable compiler. OpenSSL is available as a binary for Windows here.
  • Edit sources/config.h to provide your own settings.
  • Configure the CMake project and compile in Release.
  • Copy the compiled crash reporter from /build/<platform>Release/Mayday(.exe) as /Engine/Binaries/CrashReportClient(.exe) in your packaged game build directory.

Configuration

Configuration for the crash reporter is available in sources/config.h. Changes require rebuilding the executable.

MaydayReportDomain

Fill this value with your raw domain name, without http or https prefixes, or paths.

  • Example value : "unrealengine.com"

MaydayReportURL

Fill this value with your relative reporting URL.

  • Example value : "/mayday-crash-reports.php"

MaydayUserAgent

Fill this value with the HTTP user-agent string to report for filtering purposes in your reporting service.

  • Example value : "Mayday"

MaydayProjectName

Fill this value with the Unreal Engine project name. This needs to be the technical name used for the .uproject file.

  • Example value : "ShooterGame"

MaydayGameName

Fill this value with your complete game name. The value will be sent to your reporting service.

  • Example value : "War of Battle Shooter"

MaydayUseHTTPS

Control whether to connect to the domain with SSL on port 443 (HTTPS), or on port 80 in plaintext. Is it recommended to use encryption.

  • true : use HTTPS (default)
  • false : use plaintext

MaydayVerifyMethod

Control how to verify the host's certificate.

  • TcpSocket::SSLVerifyMethod::FullVerification : let OpenSSL run full certificate validation (default)
  • TcpSocket::SSLVerifyMethod::DomainAndCertificate : verify the domain name and the certificate chain using a limited built-in CA store - check "certs.h" to add more
  • TcpSocket::SSLVerifyMethod::AcceptSelfSigned : verify the domain name, but accept self-signed certificates

Reporting service

Mayday will report crash data through a single HTTP(S) POST request to the URL https://MaydayReportDomain/MaydayReportURL. Only three fields will be set in the request content.

game

The game field is the game name string set in MaydayGameName. For example, in PHP, this value would be recovered in the following way.

$gameName = $_POST['game'];

context

The context field stores a compressed, base-64 encoded, HTML-entity-encoded text file for the file generated by Unreal Engine as "CrashContext.runtime-xml". For example, in PHP, this value would be recovered in the following way.

$contextData = gzuncompress(base64_decode(html_entity_decode($_POST['context'])));

minidump

The minidump field stores a compressed, base-64 encoded, HTML-entity-encoded binary file for the file generated by Unreal Engine as "UE4Minidump.dmp". For example, in PHP, this value would be recovered in the following way.

$minidumpData = gzuncompress(base64_decode(html_entity_decode($_POST['minidump'])));

User privacy control

The reporter will read EnableCrashReports in Saved/Config/GameUserSettings.ini and determine from that value if the crash reporter is allowed to run. This makes it easy to add a control for end-users for privacy purposes. It is recommended to implement such a control. In the absence of the field or file, the default behavior will be to run the tool.

TODO

Pull requests are welcome to improve the project. In particular, the following tasks would be very useful :

  • Linux support & testing
  • Add a mechanism to override config.h at configure or build time from a text file, to avoid persistent local changes
  • Investigate the use of multipart form encoding instead of base64 to reduce bandwidth ; implies moving from std::string to a proper data type, and probably means HttpRequest should specialize into a POST-specific, multipart-specific class
  • General testing and improvements

About

GAMEDEV / Lightweight crash reporter for Unreal Engine

Resources

License

Stars

Watchers

Forks

Languages