Skip to content

Commit

Permalink
store the current game version
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Jun 10, 2024
1 parent d9a4f12 commit b919736
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/src/main/java/com/geode/launcher/GeometryDashActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
}

try {
createVersionFile()
tryLoadGame()
} catch (e: UnsatisfiedLinkError) {
Log.e("GeodeLauncher", "Library linkage failure", e)
Expand Down Expand Up @@ -104,6 +105,13 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
}
}

private fun createVersionFile() {
val versionPath = File(filesDir, "game_version.txt")
val gameVersion = GamePackageUtils.getGameVersionCode(packageManager)

versionPath.writeText("$gameVersion")
}

private fun returnToMain(
error: LaunchUtils.LauncherError? = null,
returnMessage: String? = null,
Expand Down

0 comments on commit b919736

Please sign in to comment.