diff --git a/nostalgia@asphyxia/README.md b/nostalgia@asphyxia/README.md index 4034600..bc2ca45 100644 --- a/nostalgia@asphyxia/README.md +++ b/nostalgia@asphyxia/README.md @@ -4,7 +4,7 @@ Plugin Version: **v1.2.0** Supported Versions ------------------- -- ノスタルジア / First Version (Experiment-Old) +- ノスタルジア/ First Version (Experiment-Old) - Forte (Experiment-Old) - Op.2 @@ -13,6 +13,8 @@ About Experiment-Old Support A version that marked as **Experiment-Old** is _Not_ Primary supported experiment version. Since This plugin is mainly focused on Op.2, other versions may not work correctly. +If you have a problem that move from old version to new version, There's webui for mitigate the issue. + Changelog ========= 1.2.0 (Current) diff --git a/nostalgia@asphyxia/handler/webui.ts b/nostalgia@asphyxia/handler/webui.ts new file mode 100644 index 0000000..9edfbd1 --- /dev/null +++ b/nostalgia@asphyxia/handler/webui.ts @@ -0,0 +1,20 @@ +import { Profile } from "../models/profile"; + +export const fixIndexBug = async (data: { + refid: string; + confirm: string; + }) => { + if (data.confirm == "on") { + console.warn(`refid "${data.refid}" performs index reset!`) + await DB.Update( + data.refid, + { collection: 'profile' }, + { $set: { + music: 0, + sheet: 0, + brooch: 0 + } + } + ); + } + }; \ No newline at end of file diff --git a/nostalgia@asphyxia/index.ts b/nostalgia@asphyxia/index.ts index 8399164..67cb5a3 100644 --- a/nostalgia@asphyxia/index.ts +++ b/nostalgia@asphyxia/index.ts @@ -1,9 +1,12 @@ import { get_common_info, get_music_info } from "./handler/common"; import { get_musicdata, get_playdata, regist_playdata, set_total_result } from "./handler/player" +import { fixIndexBug } from "./handler/webui"; export function register() { R.GameCode('PAN'); + R.WebUIEvent("nosFixIndexBug", fixIndexBug) + const MultiRoute = (method: string, handler: EPR | boolean) => { // Helper for register multiple versions. R.Route(method, handler); // First version and Forte. diff --git a/nostalgia@asphyxia/webui/profile_fix_login.pug b/nostalgia@asphyxia/webui/profile_fix_login.pug new file mode 100644 index 0000000..76e1271 --- /dev/null +++ b/nostalgia@asphyxia/webui/profile_fix_login.pug @@ -0,0 +1,26 @@ +div + .card + .card-header + p.card-header-title + span.icon + i.mdi.mdi-account-edit + | Fix Error with Login + .card-content + p If you unable to login after travels of between versions, This may helpful. + p Normally, login issue caused you played deleted song last time in previous version that not deleted time. + p This page is about reset of last indexes that causing login problem. + form(method="post" action="/emit/nosFixIndexBug") + .field + label.label ID + .control + input.input(type="text" name="refid", value=refid readonly) + .field + label.label Are you sure to reset indexes? + .control + input(type="checkbox" name="confirm") + | This is not recoverable. Do this if you have a problem. + .field + button.button.is-primary(type="submit") + span.icon + i.mdi.mdi-check + span Submit