Added mods to crash report, many crashes are caused by incorrectly defined mods

This commit is contained in:
Yair Morgenstern 2020-10-24 23:16:16 +03:00
parent 2facd9e71a
commit 3713923caf
3 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,7 @@ class CrashReportSenderAndroid(private val activity: Activity) : CrashReportSend
"Game version: %s\n" +
"OS version: %s\n" +
"Device model: %s\n" +
"Mods: %s\n" +
"Game data: %s\n"
}
@ -41,5 +42,5 @@ class CrashReportSenderAndroid(private val activity: Activity) : CrashReportSend
}
private fun buildEmailBody(report: CrashReport): String =
EMAIL_BODY.format(report.version, Build.VERSION.SDK_INT, Build.MODEL, report.gameInfo)
EMAIL_BODY.format(report.version, Build.VERSION.SDK_INT, Build.MODEL, report.mods.joinToString(), report.gameInfo)
}

View File

@ -2,5 +2,6 @@ package com.unciv.models
data class CrashReport(
val gameInfo: String,
val mods: LinkedHashSet<String>,
val version: String
)

View File

@ -60,7 +60,7 @@ interface CrashController {
private fun buildReport(): CrashReport {
return UncivGame.Current.run {
val zippedGameInfo = Json().toJson(gameInfo).let { Gzip.zip(it) }
CrashReport(zippedGameInfo, version)
CrashReport(zippedGameInfo, gameInfo.gameParameters.mods, version)
}
}
}