6568: Also print platform, game and OS version in assertion popup r=def- a=Robyt3



## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
bors[bot] 2023-05-07 18:21:04 +00:00 committed by GitHub
commit 262a2a83a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4590,8 +4590,11 @@ int main(int argc, const char **argv)
pClient->RegisterInterfaces();
dbg_assert_set_handler([pClient](const char *pMsg) {
char aMessage[256];
str_format(aMessage, sizeof(aMessage), "An assertion error occured. Please write down or take a screenshot of the following information and report this error.\n\n%s", pMsg);
char aVersionStr[128];
if(os_version_str(aVersionStr, sizeof(aVersionStr)))
str_copy(aVersionStr, "unknown");
char aMessage[512];
str_format(aMessage, sizeof(aMessage), "An assertion error occured. Please write down or take a screenshot of the following information and report this error.\nPlease also share the assert log which you should find in the 'dumps' folder in your config directory.\n\n%s\n\nPlatform: %s\nGame version: %s %s\nOS version: %s", pMsg, CONF_PLATFORM_STRING, GAME_RELEASE_VERSION, GIT_SHORTREV_HASH != nullptr ? GIT_SHORTREV_HASH : "", aVersionStr);
pClient->ShowMessageBox("Assertion Error", aMessage);
});