Commit be983f59 authored by chechunchi's avatar chechunchi

setup 408 lflist

parent d58778dc
Pipeline #30302 passed with stages
in 12 minutes and 10 seconds
......@@ -39,6 +39,9 @@
"lflist": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"config": "https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release-v2.json"
},
"env408Resource": {
"lflist": "https://cdn02.moecube.com:444/cn-database/env408-zh-CN/expansions/lflist.conf"
},
"stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"replayUrl": "replay.neos.moe",
"loginUrl": "https://accounts.moecube.com/signin",
......
......@@ -39,6 +39,9 @@
"lflist": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"config": "https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release-v2.json"
},
"env408Resource": {
"lflist": "https://cdn02.moecube.com:444/cn-database/env408-zh-CN/expansions/lflist.conf"
},
"stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"replayUrl": "replay.neos.moe",
"loginUrl": "https://accounts.moecube.com/signin",
......
import { isNil } from "lodash-es";
import { useConfig } from "@/config";
import { CardMeta } from "./cards";
const {
releaseResource: { lflist },
} = useConfig();
class Forbidden {
private data: Map<number, number> = new Map<number, number>();
public time: string = "?";
public async init(): Promise<void> {
public async init(lflist: string): Promise<void> {
const text = await (await fetch(lflist)).text();
const { time, forbiddens } = this.extractForbiddensFromText(text);
this.time = time;
......@@ -87,3 +82,4 @@ class Forbidden {
}
export const forbidden = new Forbidden();
export const forbidden_408 = new Forbidden();
......@@ -3,6 +3,7 @@ import rustInit from "rust-src";
import {
CookieKeys,
forbidden,
forbidden_408,
getCookie,
initStrings,
initSuperPrerelease,
......@@ -12,7 +13,7 @@ import { useConfig } from "@/config";
import { useEnv } from "@/hook";
import sqliteMiddleWare, { sqliteCmd } from "@/middleware/sqlite";
import { accountStore, deckStore, initStore, type User } from "@/stores";
const { releaseResource, preReleaseResource } = useConfig();
const { releaseResource, preReleaseResource, env408Resource } = useConfig();
const { BASE_URL } = useEnv();
/** 加载ygodb */
......@@ -55,7 +56,8 @@ export const initWASM = async () => {
/** 加载禁限卡表 */
export const initForbidden = async () => {
if (!initStore.forbidden) {
await forbidden.init();
await forbidden.init(releaseResource.lflist);
await forbidden_408.init(env408Resource.lflist);
initStore.forbidden = true;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment