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",
"cardImgUrl":"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN", "releaseImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"releaseDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb", "preReleaseImgUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/pics",
"preReleaseDbUrl":"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb", "releaseDbUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf", "preReleaseDbUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb",
"lflistUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf", "stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"replayUrl":"replay.neos.moe", "lflistUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"loginUrl":"https://accounts.moecube.com/signin", "replayUrl": "replay.neos.moe",
"logoutUrl":"https://accounts.moecube.com/signout", "loginUrl": "https://accounts.moecube.com/signin",
"profileUrl":"https://accounts.moecube.com/profiles", "logoutUrl": "https://accounts.moecube.com/signout",
"athleticWatchUrl":"wss://tiramisu.moecube.com:8923", "profileUrl": "https://accounts.moecube.com/profiles",
"entertainWatchUrl":"wss://tiramisu.moecube.com:7923", "athleticWatchUrl": "wss://tiramisu.moecube.com:8923",
"userApi":"https://sapi.moecube.com:444/accounts/users/{username}.json", "entertainWatchUrl": "wss://tiramisu.moecube.com:7923",
"streamInterval":20, "userApi": "https://sapi.moecube.com:444/accounts/users/{username}.json",
"startDelay":1000, "streamInterval": 20,
"ui":{ "startDelay": 1000,
"hint":{ "ui": {
"maxCount":1 "hint": {
"maxCount": 1
} }
}, },
"unimplementedWhiteList":[ "unimplementedWhiteList": [
1, 1,
6, 6,
7, 7,
......
{ {
"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",
"cardImgUrl":"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN", "releaseImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"releaseDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb", "preReleaseImgUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/pics",
"preReleaseDbUrl":"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb", "releaseDbUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf", "preReleaseDbUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb",
"lflistUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf", "stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"replayUrl":"replay.neos.moe", "lflistUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"loginUrl":"https://accounts.moecube.com/signin", "replayUrl": "replay.neos.moe",
"logoutUrl":"https://accounts.moecube.com/signout", "loginUrl": "https://accounts.moecube.com/signin",
"profileUrl":"https://accounts.moecube.com/profiles", "logoutUrl": "https://accounts.moecube.com/signout",
"athleticWatchUrl":"wss://tiramisu.moecube.com:8923", "profileUrl": "https://accounts.moecube.com/profiles",
"entertainWatchUrl":"wss://tiramisu.moecube.com:7923", "athleticWatchUrl": "wss://tiramisu.moecube.com:8923",
"userApi":"https://sapi.moecube.com:444/accounts/users/{username}.json", "entertainWatchUrl": "wss://tiramisu.moecube.com:7923",
"streamInterval":20, "userApi": "https://sapi.moecube.com:444/accounts/users/{username}.json",
"startDelay":1000, "streamInterval": 20,
"ui":{ "startDelay": 1000,
"hint":{ "ui": {
"maxCount":1 "hint": {
"maxCount": 1
} }
}, },
"unimplementedWhiteList":[ "unimplementedWhiteList": [
1, 1,
6, 6,
7, 7,
......
...@@ -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,8 +101,7 @@ function helper<T extends sqliteCmd>(action: sqliteAction<T>) { ...@@ -101,8 +101,7 @@ 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;
......
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