Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
421051af
Commit
421051af
authored
Apr 29, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove pre-rerelease
parent
5d65cf42
Pipeline
#26773
passed with stages
in 10 minutes and 33 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
102 deletions
+19
-102
neos.config.json
neos.config.json
+0
-3
neos.config.prod.json
neos.config.prod.json
+2
-5
src/api/index.ts
src/api/index.ts
+0
-1
src/api/superPreRelease.ts
src/api/superPreRelease.ts
+0
-24
src/middleware/sqlite/index.ts
src/middleware/sqlite/index.ts
+13
-45
src/ui/Layout/index.tsx
src/ui/Layout/index.tsx
+0
-2
src/ui/Layout/utils.ts
src/ui/Layout/utils.ts
+2
-11
src/ui/Match/util.ts
src/ui/Match/util.ts
+1
-5
src/ui/Shared/YgoCard/index.tsx
src/ui/Shared/YgoCard/index.tsx
+1
-6
No files found.
neos.config.json
View file @
421051af
...
...
@@ -23,10 +23,7 @@
],
"assetsPath"
:
"/neos-assets"
,
"releaseImgUrl"
:
"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"
,
"preReleaseDbUrl"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb"
,
"preReleaseConfig"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release-v2.json"
,
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"lflistUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf"
,
"replayUrl"
:
"replay.neos.moe"
,
...
...
neos.config.prod.json
View file @
421051af
...
...
@@ -2,8 +2,8 @@
"version"
:
4960
,
"servers"
:
[{
"name"
:
"koishi"
,
"ip"
:
"
koishi.momobako.com
"
,
"port"
:
"
7211
"
"ip"
:
"
127.0.0.1
"
,
"port"
:
"
8080
"
},
{
"name"
:
"mycard-athletic"
,
...
...
@@ -23,10 +23,7 @@
],
"assetsPath"
:
"/neos-assets"
,
"releaseImgUrl"
:
"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"
,
"preReleaseDbUrl"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb"
,
"preReleaseConfig"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release-v2.json"
,
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"lflistUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf"
,
"replayUrl"
:
"replay.neos.moe"
,
...
...
src/api/index.ts
View file @
421051af
...
...
@@ -5,4 +5,3 @@ export * from "./mycard";
export
*
from
"
./ocgcore/idl/ocgcore
"
;
export
*
from
"
./ocgcore/ocgHelper
"
;
export
*
from
"
./strings
"
;
export
*
from
"
./superPreRelease
"
;
src/api/superPreRelease.ts
deleted
100644 → 0
View file @
5d65cf42
import
{
useConfig
}
from
"
@/config
"
;
const
{
preReleaseConfig
}
=
useConfig
();
interface
SuperPreInfo
{
/* only use id currently, other fields see:
* https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release-v2.json
* */
id
:
number
;
}
let
superPreList
:
SuperPreInfo
[]
=
[];
export
async
function
initSuperPrerelease
()
{
const
json
=
await
(
await
fetch
(
preReleaseConfig
)).
text
();
const
list
:
SuperPreInfo
[]
=
JSON
.
parse
(
json
);
superPreList
=
list
;
}
export
function
isSuperReleaseCard
(
code
:
number
):
boolean
{
if
(
superPreList
.
length
===
0
)
console
.
warn
(
"
Super pre release config has not been initialized!
"
);
return
superPreList
.
find
(({
id
})
=>
id
===
code
)
!==
undefined
;
}
src/middleware/sqlite/index.ts
View file @
421051af
...
...
@@ -7,7 +7,6 @@
import
initSqlJs
,
{
Database
}
from
"
sql.js
"
;
import
{
isSuperReleaseCard
}
from
"
@/api
"
;
import
{
CardData
,
CardMeta
,
CardText
}
from
"
@/api/cards
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
pfetch
}
from
"
@/infra
"
;
...
...
@@ -30,7 +29,6 @@ export interface sqliteAction<T extends sqliteCmd> {
// 初始化DB需要业务方传入的数据
initInfo
?:
{
releaseDbUrl
:
string
;
preReleaseDbUrl
:
string
;
progressCallback
?:
(
progress
:
number
)
=>
void
;
// 用于获取读取进度
};
payload
?:
{
...
...
@@ -57,10 +55,9 @@ export default function <T extends sqliteCmd>(
// TODO: may defining a class be better?
interface
YgoDbs
{
release
:
Database
|
null
;
preRelease
:
Database
|
null
;
}
let
YGODBS
:
YgoDbs
=
{
release
:
null
,
preRelease
:
null
};
let
YGODBS
:
YgoDbs
=
{
release
:
null
};
// FIXME: 应该有个返回值,告诉业务方本次请求的结果,比如初始化DB失败
function
helper
<
T
extends
sqliteCmd
>
(
action
:
sqliteAction
<
T
>
)
{
...
...
@@ -71,39 +68,24 @@ function helper<T extends sqliteCmd>(action: sqliteAction<T>) {
const
releasePromise
=
pfetch
(
info
.
releaseDbUrl
,
{
progressCallback
:
action
.
initInfo
?.
progressCallback
,
}).
then
((
res
)
=>
res
.
arrayBuffer
());
// TODO: i18n
const
preReleasePromise
=
pfetch
(
info
.
preReleaseDbUrl
,
{
progressCallback
:
action
.
initInfo
?.
progressCallback
,
}).
then
((
res
)
=>
res
.
arrayBuffer
());
return
Promise
.
all
([
sqlPromise
,
releasePromise
,
preReleasePromise
,
]).
then
(([
SQL
,
releaseBuffer
,
preReleaseBuffer
])
=>
{
YGODBS
.
release
=
new
SQL
.
Database
(
new
Uint8Array
(
releaseBuffer
));
YGODBS
.
preRelease
=
new
SQL
.
Database
(
new
Uint8Array
(
preReleaseBuffer
),
);
console
.
log
(
"
YGODB inited!
"
);
});
return
Promise
.
all
([
sqlPromise
,
releasePromise
]).
then
(
([
SQL
,
releaseBuffer
])
=>
{
YGODBS
.
release
=
new
SQL
.
Database
(
new
Uint8Array
(
releaseBuffer
));
console
.
log
(
"
YGODB inited!
"
);
},
);
}
else
{
console
.
warn
(
"
init YGODB action without initInfo
"
);
return
{};
}
}
case
sqliteCmd
.
SELECT
:
{
if
(
YGODBS
.
release
&&
YGODBS
.
preRelease
&&
action
.
payload
&&
action
.
payload
.
id
)
{
if
(
YGODBS
.
release
&&
action
.
payload
&&
action
.
payload
.
id
)
{
const
code
=
action
.
payload
.
id
;
const
db
=
isSuperReleaseCard
(
code
)
?
YGODBS
.
preRelease
:
YGODBS
.
release
;
const
db
=
YGODBS
.
release
;
const
dataStmt
=
db
.
prepare
(
"
SELECT * FROM datas WHERE ID = $id
"
);
const
dataResult
=
dataStmt
.
getAsObject
({
$id
:
code
});
...
...
@@ -123,22 +105,8 @@ function helper<T extends sqliteCmd>(action: sqliteAction<T>) {
return
{};
}
case
sqliteCmd
.
FTS
:
{
if
(
YGODBS
.
release
&&
YGODBS
.
preRelease
&&
action
.
payload
&&
action
.
payload
.
ftsParams
)
{
const
releaseMetas
=
invokeFts
(
YGODBS
.
release
,
action
.
payload
.
ftsParams
,
);
const
preReleaseMetas
=
invokeFts
(
YGODBS
.
preRelease
,
action
.
payload
.
ftsParams
,
);
const
metas
=
releaseMetas
.
concat
(
preReleaseMetas
);
if
(
YGODBS
.
release
&&
action
.
payload
&&
action
.
payload
.
ftsParams
)
{
const
metas
=
invokeFts
(
YGODBS
.
release
,
action
.
payload
.
ftsParams
);
return
{
ftsResult
:
metas
};
}
else
{
...
...
src/ui/Layout/index.tsx
View file @
421051af
...
...
@@ -26,7 +26,6 @@ import {
initForbidden
,
initI18N
,
initSqlite
,
initSuper
,
initWASM
,
}
from
"
./utils
"
;
...
...
@@ -39,7 +38,6 @@ export const loader: LoaderFunction = async () => {
initWASM
();
initForbidden
();
initI18N
();
initSuper
();
return
null
;
};
...
...
src/ui/Layout/utils.ts
View file @
421051af
...
...
@@ -5,14 +5,13 @@ import {
forbidden
,
getCookie
,
initStrings
,
initSuperPrerelease
,
setCookie
,
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useEnv
}
from
"
@/hook
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
import
{
accountStore
,
deckStore
,
initStore
,
type
User
}
from
"
@/stores
"
;
const
{
releaseDbUrl
,
preReleaseDbUrl
}
=
useConfig
();
const
{
releaseDbUrl
}
=
useConfig
();
const
{
BASE_URL
}
=
useEnv
();
/** 加载ygodb */
...
...
@@ -24,7 +23,7 @@ export const initSqlite = async () => {
sqlite
.
progress
=
0.01
;
await
sqliteMiddleWare
({
cmd
:
sqliteCmd
.
INIT
,
initInfo
:
{
releaseDbUrl
,
pr
eReleaseDbUrl
,
pr
ogressCallback
},
initInfo
:
{
releaseDbUrl
,
progressCallback
},
});
sqlite
.
progress
=
1
;
}
...
...
@@ -64,14 +63,6 @@ export const initI18N = async () => {
}
};
/** 加载超先行服配置 */
export
const
initSuper
=
async
()
=>
{
if
(
!
initStore
.
superprerelease
)
{
await
initSuperPrerelease
();
initStore
.
superprerelease
=
true
;
}
};
/** sso登录跳转回来 */
export
const
handleSSOLogin
=
async
(
search
:
string
)
=>
{
/** 从SSO跳转回的URL之中,解析用户信息 */
...
...
src/ui/Match/util.ts
View file @
421051af
import
rustInit
from
"
rust-src
"
;
import
{
initStrings
,
initSuperPrerelease
}
from
"
@/api
"
;
import
{
initStrings
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
socketMiddleWare
,
{
socketCmd
}
from
"
@/middleware/socket
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
...
...
@@ -27,16 +27,12 @@ export const connectSrvpro = async (params: {
cmd
:
sqliteCmd
.
INIT
,
initInfo
:
{
releaseDbUrl
:
NeosConfig
.
releaseDbUrl
,
preReleaseDbUrl
:
NeosConfig
.
preReleaseDbUrl
,
},
});
// 初始化I18N文案
await
initStrings
();
// 初始化超先行配置
await
initSuperPrerelease
();
if
(
params
.
replay
&&
params
.
replayData
)
{
// 连接回放websocket服务
socketMiddleWare
({
...
...
src/ui/Shared/YgoCard/index.tsx
View file @
421051af
import
classNames
from
"
classnames
"
;
import
{
CSSProperties
,
useMemo
}
from
"
react
"
;
import
{
isSuperReleaseCard
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
styles
from
"
./index.module.scss
"
;
...
...
@@ -63,9 +62,5 @@ export function getCardImgUrl(code: number, back = false) {
return
`
${
ASSETS_BASE
}
/card_back.jpg`
;
}
if
(
isSuperReleaseCard
(
code
))
{
return
`
${
NeosConfig
.
preReleaseImgUrl
}
/
${
code
}
.jpg`
;
}
else
{
return
`
${
NeosConfig
.
releaseImgUrl
}
/
${
code
}
.jpg`
;
}
return
`
${
NeosConfig
.
releaseImgUrl
}
/
${
code
}
.jpg`
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment