initailize migration helper

This commit is contained in:
DitFranXX 2021-04-26 20:03:35 +09:00
parent 75b6cd9464
commit 91f772d309
5 changed files with 27 additions and 8 deletions

View File

@ -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

View File

@ -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", {

View File

@ -2,7 +2,7 @@ export interface Scores {
collection: 'scores';
game: 'gf' | 'dm';
version: string;
version?: string;
pluginVer: number
scores: {

View File

@ -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

View File

@ -0,0 +1,7 @@
export async function initialze() {
await dbMigration()
}
async function dbMigration() {
}