From 91f772d309f482c572605c9530c6f101833234a6 Mon Sep 17 00:00:00 2001 From: DitFranXX Date: Mon, 26 Apr 2021 20:03:35 +0900 Subject: [PATCH] initailize migration helper --- gitadora@asphyxia/README.md | 17 +++++++++++++---- gitadora@asphyxia/index.ts | 7 +++++-- gitadora@asphyxia/models/scores.ts | 2 +- gitadora@asphyxia/utils/index.ts | 2 +- gitadora@asphyxia/utils/migration.ts | 7 +++++++ 5 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 gitadora@asphyxia/utils/migration.ts diff --git a/gitadora@asphyxia/README.md b/gitadora@asphyxia/README.md index 0ea2c46..fc5a1e6 100644 --- a/gitadora@asphyxia/README.md +++ b/gitadora@asphyxia/README.md @@ -1,14 +1,18 @@ GITADORA Plugin for Asphyxia-Core ================================= -This plugin is converted from public-exported Asphyxia's Routes. +This plugin is based on converted from public-exported Asphyxia's Routes. Supported Versions ================== - Matixx - Exchain - - NEX+AGE (Beta) + - NEX+AGE +Profile sharing between version (WIP) +------------------------------------- +Only scores are shared between versions. As It's planned to support some Version-specific features. + Note about newer version of Asphyxia Core ----------------------------------------- Since newer version of Core separate the save db per each plugin, Seems there was an error after the migration process. till it's fixed on Core side, you maybe need backup the old save and start from zero. @@ -16,8 +20,13 @@ Since newer version of Core separate the save db per each plugin, Seems there wa Release Notes ============= -v1.1.0 (Current) ----------------- +v2.0.0 (Current, WIP) +--------------------- +* Support score shares between versions. + + +v1.1.0-beta +------------ * NEX+AGE Support (Beta) v1.0.0 diff --git a/gitadora@asphyxia/index.ts b/gitadora@asphyxia/index.ts index 0d98eef..e35806c 100644 --- a/gitadora@asphyxia/index.ts +++ b/gitadora@asphyxia/index.ts @@ -2,13 +2,16 @@ import { gameInfoGet, shopInfoRegist } from "./handlers/info"; import { playableMusic } from "./handlers/MusicList" import { getPlayer, check, regist, savePlayer } from "./handlers/profiles"; import { updatePlayerInfo } from "./handlers/webui"; -import { isRequiredVersion } from "./utils"; +import { isRequiredCoreVersion } from "./utils"; +import { initialze as migrationInitialize } from "./utils/migration" export function register() { - if(!isRequiredVersion(1, 20)) { + if(!isRequiredCoreVersion(1, 20)) { console.error("You need newer version of Core. v1.20 or newer required.") } + migrationInitialize() + R.GameCode('M32'); R.Config("enable_custom_mdb", { diff --git a/gitadora@asphyxia/models/scores.ts b/gitadora@asphyxia/models/scores.ts index e61d3f8..40e91ed 100644 --- a/gitadora@asphyxia/models/scores.ts +++ b/gitadora@asphyxia/models/scores.ts @@ -2,7 +2,7 @@ export interface Scores { collection: 'scores'; game: 'gf' | 'dm'; - version: string; + version?: string; pluginVer: number scores: { diff --git a/gitadora@asphyxia/utils/index.ts b/gitadora@asphyxia/utils/index.ts index 8fd47b7..10d4daa 100644 --- a/gitadora@asphyxia/utils/index.ts +++ b/gitadora@asphyxia/utils/index.ts @@ -11,7 +11,7 @@ export const getVersion = (info: EamuseInfo) => { return moduleName.match(/([^_]*)_(.*)/)[1]; }; -export function isRequiredVersion(major: number, minor: number) { +export function isRequiredCoreVersion(major: number, minor: number) { // version value exposed since Core v1.19 const core_major = typeof CORE_VERSION_MAJOR === "number" ? CORE_VERSION_MAJOR : 1 const core_minor = typeof CORE_VERSION_MINOR === "number" ? CORE_VERSION_MINOR : 18 diff --git a/gitadora@asphyxia/utils/migration.ts b/gitadora@asphyxia/utils/migration.ts new file mode 100644 index 0000000..d300618 --- /dev/null +++ b/gitadora@asphyxia/utils/migration.ts @@ -0,0 +1,7 @@ +export async function initialze() { + await dbMigration() +} + +async function dbMigration() { + +} \ No newline at end of file