Commit 9f0ffc18 authored by Chunchi Che's avatar Chunchi Che

suport super pre release

parent a2e52969
Pipeline #25497 passed with stages
in 12 minutes and 41 seconds
{ {
"version":4960, "version": 4960,
"servers":[ "servers": [{
{ "name": "koishi",
"name":"koishi", "ip": "koishi.momobako.com",
"ip":"koishi.momobako.com", "port": "7211"
"port":"7211" },
}, {
{ "name": "mycard-athletic",
"name":"mycard-athletic", "ip": "tiramisu.moecube.com",
"ip":"tiramisu.moecube.com", "port": "8912"
"port":"8912" },
}, {
{ "name": "pre-release",
"name":"pre-release", "ip": "koishi.momobako.com",
"ip":"koishi.momobako.com", "port": "889"
"port":"889" }
} ],
], "assetsPath": "/neos-assets",
"assetsPath":"/neos-assets", "releaseImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"cardImgUrl":"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN", "preReleaseImgUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/pics",
"releaseDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb", "releaseDbUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"preReleaseDbUrl":"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb", "preReleaseDbUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf", "stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"lflistUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf", "lflistUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"replayUrl":"replay.neos.moe", "replayUrl": "replay.neos.moe",
"loginUrl":"https://accounts.moecube.com/signin", "loginUrl": "https://accounts.moecube.com/signin",
"logoutUrl":"https://accounts.moecube.com/signout", "logoutUrl": "https://accounts.moecube.com/signout",
"profileUrl":"https://accounts.moecube.com/profiles", "profileUrl": "https://accounts.moecube.com/profiles",
"athleticWatchUrl":"wss://tiramisu.moecube.com:8923", "athleticWatchUrl": "wss://tiramisu.moecube.com:8923",
"entertainWatchUrl":"wss://tiramisu.moecube.com:7923", "entertainWatchUrl": "wss://tiramisu.moecube.com:7923",
"userApi":"https://sapi.moecube.com:444/accounts/users/{username}.json", "userApi": "https://sapi.moecube.com:444/accounts/users/{username}.json",
"streamInterval":20, "streamInterval": 20,
"startDelay":1000, "startDelay": 1000,
"ui":{ "ui": {
"hint":{ "hint": {
"maxCount":1 "maxCount": 1
} }
}, },
"unimplementedWhiteList":[ "unimplementedWhiteList": [
1, 1,
6, 6,
7, 7,
34, 34,
54, 54,
55, 55,
56, 56,
60, 60,
61, 61,
62, 62,
63, 63,
64, 64,
65, 65,
70, 70,
71, 71,
72, 72,
73, 73,
74, 74,
75, 75,
76, 76,
80, 80,
81, 81,
83, 83,
93, 93,
95, 95,
96, 96,
97, 97,
101, 101,
102, 102,
110, 110,
111, 111,
112, 112,
113, 113,
114, 114,
120, 120,
121, 121,
122, 122,
123, 123,
130, 130,
131, 131,
132, 132,
133, 133,
160, 160,
161, 161,
163, 163,
164, 164,
165, 165,
170, 170,
180, 180,
230, 230,
231, 231,
236 236
] ]
} }
{ {
"version":4960, "version": 4960,
"servers":[ "servers": [{
{ "name": "koishi",
"name":"koishi", "ip": "koishi.momobako.com",
"ip":"koishi.momobako.com", "port": "7211"
"port":"7211" },
}, {
{ "name": "mycard-athletic",
"name":"mycard-athletic", "ip": "tiramisu.moecube.com",
"ip":"tiramisu.moecube.com", "port": "8912"
"port":"8912" },
}, {
{ "name": "pre-release",
"name":"pre-release", "ip": "koishi.momobako.com",
"ip":"koishi.momobako.com", "port": "889"
"port":"889" }
} ],
], "assetsPath": "/neos-assets",
"assetsPath":"/neos-assets", "releaseImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"cardImgUrl":"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN", "preReleaseImgUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/pics",
"releaseDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb", "releaseDbUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"preReleaseDbUrl":"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb", "preReleaseDbUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf", "stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"lflistUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf", "lflistUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"replayUrl":"replay.neos.moe", "replayUrl": "replay.neos.moe",
"loginUrl":"https://accounts.moecube.com/signin", "loginUrl": "https://accounts.moecube.com/signin",
"logoutUrl":"https://accounts.moecube.com/signout", "logoutUrl": "https://accounts.moecube.com/signout",
"profileUrl":"https://accounts.moecube.com/profiles", "profileUrl": "https://accounts.moecube.com/profiles",
"athleticWatchUrl":"wss://tiramisu.moecube.com:8923", "athleticWatchUrl": "wss://tiramisu.moecube.com:8923",
"entertainWatchUrl":"wss://tiramisu.moecube.com:7923", "entertainWatchUrl": "wss://tiramisu.moecube.com:7923",
"userApi":"https://sapi.moecube.com:444/accounts/users/{username}.json", "userApi": "https://sapi.moecube.com:444/accounts/users/{username}.json",
"streamInterval":20, "streamInterval": 20,
"startDelay":1000, "startDelay": 1000,
"ui":{ "ui": {
"hint":{ "hint": {
"maxCount":1 "maxCount": 1
} }
}, },
"unimplementedWhiteList":[ "unimplementedWhiteList": [
1, 1,
6, 6,
7, 7,
34, 34,
54, 54,
55, 55,
56, 56,
60, 60,
61, 61,
62, 62,
63, 63,
64, 64,
65, 65,
70, 70,
71, 71,
72, 72,
73, 73,
74, 74,
75, 75,
76, 76,
80, 80,
81, 81,
83, 83,
93, 93,
95, 95,
96, 96,
97, 97,
101, 101,
102, 102,
110, 110,
111, 111,
112, 112,
113, 113,
114, 114,
120, 120,
121, 121,
122, 122,
123, 123,
130, 130,
131, 131,
132, 132,
133, 133,
160, 160,
161, 161,
163, 163,
164, 164,
165, 165,
170, 170,
180, 180,
230, 230,
231, 231,
236 236
] ]
} }
...@@ -10,8 +10,8 @@ import initSqlJs, { Database } from "sql.js"; ...@@ -10,8 +10,8 @@ import initSqlJs, { Database } from "sql.js";
import { CardData, CardMeta, CardText } from "@/api/cards"; import { CardData, CardMeta, CardText } from "@/api/cards";
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import { pfetch } from "@/infra"; import { pfetch } from "@/infra";
import { isSuperReleaseCard } from "@/superPreRelease";
import SuperReleaseData from "../../../super-pre-release.json";
import { FtsParams, invokeFts } from "./fts"; import { FtsParams, invokeFts } from "./fts";
const NeosConfig = useConfig(); const NeosConfig = useConfig();
...@@ -101,10 +101,9 @@ function helper<T extends sqliteCmd>(action: sqliteAction<T>) { ...@@ -101,10 +101,9 @@ function helper<T extends sqliteCmd>(action: sqliteAction<T>) {
) { ) {
const code = action.payload.id; const code = action.payload.id;
const db = const db = isSuperReleaseCard(code)
SuperReleaseData.find((id) => id === code) !== undefined ? YGODBS.preRelease
? YGODBS.preRelease : YGODBS.release;
: YGODBS.release;
const dataStmt = db.prepare("SELECT * FROM datas WHERE ID = $id"); const dataStmt = db.prepare("SELECT * FROM datas WHERE ID = $id");
const dataResult = dataStmt.getAsObject({ $id: code }); const dataResult = dataStmt.getAsObject({ $id: code });
......
import SuperReleaseData from "../../super-pre-release.json";
export function isSuperReleaseCard(code: number): boolean {
return SuperReleaseData.find((id) => id === code) !== undefined;
}
...@@ -22,12 +22,10 @@ import { proxy, useSnapshot } from "valtio"; ...@@ -22,12 +22,10 @@ import { proxy, useSnapshot } from "valtio";
import { sendSortCardResponse } from "@/api"; import { sendSortCardResponse } from "@/api";
import { CardMeta } from "@/api/cards"; import { CardMeta } from "@/api/cards";
import { useConfig } from "@/config"; import { getCardImgUrl } from "@/ui/Shared";
import { NeosModal } from "./NeosModal"; import { NeosModal } from "./NeosModal";
const NeosConfig = useConfig();
interface SortOption { interface SortOption {
meta: CardMeta; meta: CardMeta;
response: number; response: number;
...@@ -118,7 +116,7 @@ const SortableItem = (props: { id: number; meta: CardMeta }) => { ...@@ -118,7 +116,7 @@ const SortableItem = (props: { id: number; meta: CardMeta }) => {
cover={ cover={
<img <img
alt={props.meta.id.toString()} alt={props.meta.id.toString()}
src={`${NeosConfig.cardImgUrl}/${props.meta.id}.jpg`} src={getCardImgUrl(props.meta.id)}
/> />
} }
/> />
......
...@@ -2,6 +2,7 @@ import classNames from "classnames"; ...@@ -2,6 +2,7 @@ import classNames from "classnames";
import { CSSProperties, useMemo } from "react"; import { CSSProperties, useMemo } from "react";
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import { isSuperReleaseCard } from "@/superPreRelease";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
...@@ -60,5 +61,10 @@ export function getCardImgUrl(code: number, back = false) { ...@@ -60,5 +61,10 @@ export function getCardImgUrl(code: number, back = false) {
if (back || code === 0) { if (back || code === 0) {
return `${ASSETS_BASE}/card_back.jpg`; return `${ASSETS_BASE}/card_back.jpg`;
} }
return `${NeosConfig.cardImgUrl}/${code}.jpg`;
if (isSuperReleaseCard(code)) {
return `${NeosConfig.preReleaseImgUrl}/${code}.jpg`;
} else {
return `${NeosConfig.releaseImgUrl}/${code}.jpg`;
}
} }
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