mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 18:28:42 +07:00
Removed game settings from crash report, not very helpful
This commit is contained in:
@ -9,7 +9,7 @@ class AndroidLauncher : AndroidApplication() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
val config = AndroidApplicationConfiguration().apply { useImmersiveMode = true }
|
val config = AndroidApplicationConfiguration().apply { useImmersiveMode = true }
|
||||||
val game = UncivGame(BuildConfig.VERSION_NAME, UncivCrashReportSender(this))
|
val game = UncivGame(BuildConfig.VERSION_NAME, CrashReportSenderAndroid(this))
|
||||||
initialize(game, config)
|
initialize(game, config)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ import android.widget.Toast
|
|||||||
import com.unciv.models.CrashReport
|
import com.unciv.models.CrashReport
|
||||||
import com.unciv.ui.utils.CrashReportSender
|
import com.unciv.ui.utils.CrashReportSender
|
||||||
|
|
||||||
class UncivCrashReportSender(private val activity: Activity) : CrashReportSender {
|
class CrashReportSenderAndroid(private val activity: Activity) : CrashReportSender {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val EMAIL_TO = "yairm210@hotmail.com"
|
private const val EMAIL_TO = "yairm210@hotmail.com"
|
||||||
@ -19,8 +19,7 @@ class UncivCrashReportSender(private val activity: Activity) : CrashReportSender
|
|||||||
"Game version: %s\n" +
|
"Game version: %s\n" +
|
||||||
"OS version: %s\n" +
|
"OS version: %s\n" +
|
||||||
"Device model: %s\n" +
|
"Device model: %s\n" +
|
||||||
"Game data: %s\n" +
|
"Game data: %s\n"
|
||||||
"Game settings: %s"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun sendReport(report: CrashReport) {
|
override fun sendReport(report: CrashReport) {
|
||||||
@ -42,5 +41,5 @@ class UncivCrashReportSender(private val activity: Activity) : CrashReportSender
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun buildEmailBody(report: CrashReport): String =
|
private fun buildEmailBody(report: CrashReport): String =
|
||||||
EMAIL_BODY.format(report.version, Build.VERSION.SDK_INT, Build.MODEL, report.gameInfo, report.gameSettings)
|
EMAIL_BODY.format(report.version, Build.VERSION.SDK_INT, Build.MODEL, report.gameInfo)
|
||||||
}
|
}
|
@ -2,6 +2,5 @@ package com.unciv.models
|
|||||||
|
|
||||||
data class CrashReport(
|
data class CrashReport(
|
||||||
val gameInfo: String,
|
val gameInfo: String,
|
||||||
val gameSettings: String,
|
|
||||||
val version: String
|
val version: String
|
||||||
)
|
)
|
@ -61,8 +61,7 @@ interface CrashController {
|
|||||||
private fun buildReport(): CrashReport {
|
private fun buildReport(): CrashReport {
|
||||||
return UncivGame.Current.run {
|
return UncivGame.Current.run {
|
||||||
val zippedGameInfo = Json().toJson(gameInfo).let { Gzip.zip(it) }
|
val zippedGameInfo = Json().toJson(gameInfo).let { Gzip.zip(it) }
|
||||||
val zippedGameSettings = Json().toJson(settings).let { Gzip.zip(it) }
|
CrashReport(zippedGameInfo, version)
|
||||||
CrashReport(zippedGameInfo, zippedGameSettings, version)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user