Skip to content

Commit

Permalink
Add 0.13.5 items and release 1.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
austinhodak committed Aug 10, 2023
1 parent 8a3d0b5 commit 17f549c
Show file tree
Hide file tree
Showing 6 changed files with 374,701 additions and 324,847 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import java.util.EnumSet
import io.sentry.android.gradle.extensions.InstrumentationFeature
import java.util.EnumSet

plugins {
id("com.android.application")
Expand Down Expand Up @@ -33,7 +33,7 @@ android {
targetSdk = 33

versionName = System.getenv("VERSION") ?: "1.6.7"
versionCode = System.getenv("VERSION_CODE")?.toIntOrNull() ?: 1
versionCode = System.getenv("VERSION_CODE")?.toIntOrNull() ?: 17020
}

buildFeatures {
Expand Down
Binary file added tarkovapi/src/main/assets/hideout_database_66.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object Module {
@ApplicationContext appContext: Context,
callback: AppDatabase.Callback
) = Room.databaseBuilder(appContext, AppDatabase::class.java, "hideout-database")
.createFromAsset("hideout_database_64.db")
.createFromAsset("hideout_database_66.db")
.fallbackToDestructiveMigration()
.addCallback(callback)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,45 @@ import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import androidx.sqlite.db.SupportSQLiteDatabase
import com.apollographql.apollo3.ApolloClient
import com.austinhodak.tarkovapi.*
import com.austinhodak.tarkovapi.R
import com.austinhodak.tarkovapi.di.ApplicationScope
import com.austinhodak.tarkovapi.room.dao.*
import com.austinhodak.tarkovapi.room.dao.AmmoDao
import com.austinhodak.tarkovapi.room.dao.BarterDao
import com.austinhodak.tarkovapi.room.dao.CraftDao
import com.austinhodak.tarkovapi.room.dao.ItemDao
import com.austinhodak.tarkovapi.room.dao.ModDao
import com.austinhodak.tarkovapi.room.dao.PriceDao
import com.austinhodak.tarkovapi.room.dao.QuestDao
import com.austinhodak.tarkovapi.room.dao.TraderDao
import com.austinhodak.tarkovapi.room.dao.WeaponDao
import com.austinhodak.tarkovapi.room.enums.ItemTypes
import com.austinhodak.tarkovapi.room.models.*
import com.austinhodak.tarkovapi.utils.*
import com.austinhodak.tarkovapi.room.models.Ammo
import com.austinhodak.tarkovapi.room.models.Barter
import com.austinhodak.tarkovapi.room.models.Craft
import com.austinhodak.tarkovapi.room.models.Item
import com.austinhodak.tarkovapi.room.models.Mod
import com.austinhodak.tarkovapi.room.models.Price
import com.austinhodak.tarkovapi.room.models.Quest
import com.austinhodak.tarkovapi.room.models.Trader
import com.austinhodak.tarkovapi.room.models.Weapon
import com.austinhodak.tarkovapi.room.models.toAmmoItem
import com.austinhodak.tarkovapi.room.models.toItem
import com.austinhodak.tarkovapi.room.models.toMod
import com.austinhodak.tarkovapi.room.models.toWeapon
import com.austinhodak.tarkovapi.utils.getItemType
import com.austinhodak.tarkovapi.utils.itemType
import com.austinhodak.tarkovapi.utils.iterator
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.json.JSONArray
import org.json.JSONObject
import javax.inject.Inject
import javax.inject.Provider
import kotlin.system.measureTimeMillis

@Database(entities = [Ammo::class, Item::class, Weapon::class, Quest::class, Trader::class, Craft::class, Barter::class, Mod::class, Price::class], version = 64)
@Database(entities = [Ammo::class, Item::class, Weapon::class, Quest::class, Trader::class, Craft::class, Barter::class, Mod::class, Price::class], version = 66)
@TypeConverters(Converters::class)
abstract class AppDatabase : RoomDatabase() {
abstract fun AmmoDao(): AmmoDao
Expand Down Expand Up @@ -62,7 +86,7 @@ abstract class AppDatabase : RoomDatabase() {

private fun loadItemsFile() {
scope.launch(Dispatchers.IO) {
populateDatabase(JSONArray(context.resources.openRawResource(R.raw.items_011223).bufferedReader().use { it.readText() }))
populateDatabase(JSONArray(context.resources.openRawResource(R.raw.items_081023).bufferedReader().use { it.readText() }))
}
}

Expand Down
Loading

0 comments on commit 17f549c

Please sign in to comment.