mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-03 21:40:31 +07:00
performance: Don't calc checksum for non-multiplayer games, no one cares if you hack your own game
This commit is contained in:
parent
a2fa4cebf4
commit
5cc57f9293
@ -37,7 +37,6 @@ import java.io.PrintWriter
|
||||
import java.io.StringWriter
|
||||
import java.io.Writer
|
||||
import java.time.Duration
|
||||
import java.util.Arrays
|
||||
import java.util.GregorianCalendar
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
@ -69,13 +68,12 @@ class MultiplayerTurnCheckWorker(appContext: Context, workerParams: WorkerParame
|
||||
private const val FILE_STORAGE = "FILE_STORAGE"
|
||||
private const val AUTH_HEADER = "AUTH_HEADER"
|
||||
|
||||
private val constraints = Constraints.Builder()
|
||||
// If no internet is available, worker waits before becoming active.
|
||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
.build()
|
||||
|
||||
fun enqueue(appContext: Context, delay: Duration, inputData: Data) {
|
||||
|
||||
val constraints = Constraints.Builder()
|
||||
// If no internet is available, worker waits before becoming active.
|
||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
.build()
|
||||
|
||||
val checkTurnWork = OneTimeWorkRequestBuilder<MultiplayerTurnCheckWorker>()
|
||||
.setConstraints(constraints)
|
||||
.setInitialDelay(delay.seconds, TimeUnit.SECONDS)
|
||||
|
@ -372,7 +372,7 @@ class UncivFiles(
|
||||
}
|
||||
|
||||
/** Returns gzipped serialization of [game], optionally gzipped ([forceZip] overrides [saveZipped]) */
|
||||
fun gameInfoToString(game: GameInfo, forceZip: Boolean? = null, updateChecksum:Boolean=true): String {
|
||||
fun gameInfoToString(game: GameInfo, forceZip: Boolean? = null, updateChecksum:Boolean=false): String {
|
||||
game.version = GameInfo.CURRENT_COMPATIBILITY_VERSION
|
||||
|
||||
if (updateChecksum) game.checksum = game.calculateChecksum()
|
||||
|
Loading…
Reference in New Issue
Block a user