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
7d557654
Commit
7d557654
authored
Oct 08, 2024
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor neos.config.json
parent
a7d6c103
Pipeline
#30259
passed with stages
in 14 minutes and 45 seconds
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
134 additions
and
228 deletions
+134
-228
neos.config.json
neos.config.json
+48
-98
neos.config.prod.json
neos.config.prod.json
+48
-98
src/api/cards.ts
src/api/cards.ts
+22
-24
src/api/superPreRelease.ts
src/api/superPreRelease.ts
+4
-2
src/infra/stream.ts
src/infra/stream.ts
+0
-1
src/service/duel/unimplemented.ts
src/service/duel/unimplemented.ts
+6
-3
src/ui/Layout/utils.ts
src/ui/Layout/utils.ts
+6
-2
No files found.
neos.config.json
View file @
7d557654
{
{
"version"
:
4961
,
"version"
:
4961
,
"servers"
:
[{
"servers"
:
[
{
"name"
:
"koishi"
,
"name"
:
"koishi"
,
"ip"
:
"koishi.momobako.com"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"7211"
"port"
:
"7211"
...
@@ -22,11 +23,15 @@
...
@@ -22,11 +23,15 @@
}
}
],
],
"assetsPath"
:
"/neos-assets"
,
"assetsPath"
:
"/neos-assets"
,
"releaseImgUrl"
:
"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN"
,
"releaseResource"
:
{
"preReleaseImgUrl"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/pics"
,
"img"
:
"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN"
,
"releaseDbUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb"
,
"cdb"
:
"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"
,
"preReleaseResource"
:
{
"img"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/pics"
,
"cdb"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb"
,
"config"
:
"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"
,
"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"
,
...
@@ -38,65 +43,10 @@
...
@@ -38,65 +43,10 @@
"userApi"
:
"https://sapi.moecube.com:444/accounts/users/{username}.json"
,
"userApi"
:
"https://sapi.moecube.com:444/accounts/users/{username}.json"
,
"mdproServer"
:
"https://rarnu.xyz:38443"
,
"mdproServer"
:
"https://rarnu.xyz:38443"
,
"agentServer"
:
"https://sapi.moecube.com:444/neos-ai-agent"
,
"agentServer"
:
"https://sapi.moecube.com:444/neos-ai-agent"
,
"streamInterval"
:
20
,
"startDelay"
:
1000
,
"startDelay"
:
1000
,
"ui"
:
{
"ui"
:
{
"hint"
:
{
"hint"
:
{
"maxCount"
:
1
"maxCount"
:
1
}
}
},
}
"unimplementedWhiteList"
:
[
1
,
6
,
7
,
34
,
54
,
55
,
56
,
60
,
61
,
62
,
63
,
64
,
65
,
70
,
71
,
72
,
73
,
74
,
75
,
76
,
80
,
81
,
83
,
93
,
95
,
96
,
97
,
101
,
102
,
110
,
111
,
112
,
113
,
114
,
120
,
121
,
122
,
123
,
130
,
131
,
132
,
133
,
160
,
161
,
163
,
164
,
165
,
170
,
180
,
230
,
231
,
236
]
}
}
neos.config.prod.json
View file @
7d557654
{
{
"version"
:
4961
,
"version"
:
4961
,
"servers"
:
[{
"servers"
:
[
{
"name"
:
"koishi"
,
"name"
:
"koishi"
,
"ip"
:
"koishi.momobako.com"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"7211"
"port"
:
"7211"
...
@@ -22,11 +23,15 @@
...
@@ -22,11 +23,15 @@
}
}
],
],
"assetsPath"
:
"/neos-assets"
,
"assetsPath"
:
"/neos-assets"
,
"releaseImgUrl"
:
"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN"
,
"releaseResource"
:
{
"preReleaseImgUrl"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/pics"
,
"img"
:
"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN"
,
"releaseDbUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb"
,
"cdb"
:
"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"
,
"preReleaseResource"
:
{
"img"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/pics"
,
"cdb"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb"
,
"config"
:
"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"
,
"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"
,
...
@@ -38,65 +43,10 @@
...
@@ -38,65 +43,10 @@
"userApi"
:
"https://sapi.moecube.com:444/accounts/users/{username}.json"
,
"userApi"
:
"https://sapi.moecube.com:444/accounts/users/{username}.json"
,
"mdproServer"
:
"https://rarnu.xyz:38443"
,
"mdproServer"
:
"https://rarnu.xyz:38443"
,
"agentServer"
:
"https://sapi.moecube.com:444/neos-ai-agent"
,
"agentServer"
:
"https://sapi.moecube.com:444/neos-ai-agent"
,
"streamInterval"
:
20
,
"startDelay"
:
1000
,
"startDelay"
:
1000
,
"ui"
:
{
"ui"
:
{
"hint"
:
{
"hint"
:
{
"maxCount"
:
1
"maxCount"
:
1
}
}
},
}
"unimplementedWhiteList"
:
[
1
,
6
,
7
,
34
,
54
,
55
,
56
,
60
,
61
,
62
,
63
,
64
,
65
,
70
,
71
,
72
,
73
,
74
,
75
,
76
,
80
,
81
,
83
,
93
,
95
,
96
,
97
,
101
,
102
,
110
,
111
,
112
,
113
,
114
,
120
,
121
,
122
,
123
,
130
,
131
,
132
,
133
,
160
,
161
,
163
,
164
,
165
,
170
,
180
,
230
,
231
,
236
]
}
}
src/api/cards.ts
View file @
7d557654
...
@@ -4,7 +4,7 @@ import { FtsParams } from "@/middleware/sqlite/fts";
...
@@ -4,7 +4,7 @@ import { FtsParams } from "@/middleware/sqlite/fts";
import
{
isSuperReleaseCard
}
from
"
./superPreRelease
"
;
import
{
isSuperReleaseCard
}
from
"
./superPreRelease
"
;
const
NeosConfig
=
useConfig
();
const
{
assetsPath
,
releaseResource
,
preReleaseResource
}
=
useConfig
();
export
interface
CardMeta
{
export
interface
CardMeta
{
id
:
number
;
id
:
number
;
...
@@ -80,12 +80,13 @@ export function getCardStr(meta: CardMeta, idx: number): string | undefined {
...
@@ -80,12 +80,13 @@ export function getCardStr(meta: CardMeta, idx: number): string | undefined {
export
function
getCardImgUrl
(
code
:
number
,
back
=
false
)
{
export
function
getCardImgUrl
(
code
:
number
,
back
=
false
)
{
const
ASSETS_BASE
=
const
ASSETS_BASE
=
import
.
meta
.
env
.
BASE_URL
===
"
/
"
import
.
meta
.
env
.
BASE_URL
===
"
/
"
?
NeosConfig
.
assetsPath
?
assetsPath
:
`
${
import
.
meta
.
env
.
BASE_URL
}${
NeosConfig
.
assetsPath
}
`
;
:
`
${
import
.
meta
.
env
.
BASE_URL
}${
assetsPath
}
`
;
if
(
back
||
code
===
0
)
{
if
(
back
||
code
===
0
)
{
return
`
${
ASSETS_BASE
}
/card_back.jpg`
;
return
`
${
ASSETS_BASE
}
/card_back.jpg`
;
}
}
else
if
(
isSuperReleaseCard
(
code
))
{
return
`
${
preReleaseResource
.
img
}
/
${
code
}
.jpg`
;
}
else
{
// Define translations for different languages (I18N)
// Define translations for different languages (I18N)
const
language
=
localStorage
.
getItem
(
"
language
"
);
const
language
=
localStorage
.
getItem
(
"
language
"
);
let
imgUrl
;
let
imgUrl
;
...
@@ -96,17 +97,14 @@ export function getCardImgUrl(code: number, back = false) {
...
@@ -96,17 +97,14 @@ export function getCardImgUrl(code: number, back = false) {
case
"
pt
"
:
case
"
pt
"
:
case
"
fr
"
:
case
"
fr
"
:
case
"
es
"
:
case
"
es
"
:
imgUrl
=
NeosConfig
.
releaseImgUrl
.
replace
(
"
zh-CN
"
,
"
en-US
"
);
imgUrl
=
releaseResource
.
img
.
replace
(
"
zh-CN
"
,
"
en-US
"
);
break
;
break
;
default
:
default
:
imgUrl
=
NeosConfig
.
releaseImgUrl
;
imgUrl
=
releaseResource
.
img
;
break
;
break
;
}
}
/* End of definition (I18N) */
/* End of definition (I18N) */
if
(
isSuperReleaseCard
(
code
))
{
return
`
${
NeosConfig
.
preReleaseImgUrl
}
/
${
code
}
.jpg`
;
}
else
{
return
`
${
imgUrl
}
/
${
code
}
.jpg`
;
return
`
${
imgUrl
}
/
${
code
}
.jpg`
;
}
}
}
}
src/api/superPreRelease.ts
View file @
7d557654
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
const
{
preReleaseConfig
}
=
useConfig
();
const
{
preReleaseResource
:
{
config
},
}
=
useConfig
();
interface
SuperPreInfo
{
interface
SuperPreInfo
{
/* only use id currently, other fields see:
/* only use id currently, other fields see:
...
@@ -12,7 +14,7 @@ interface SuperPreInfo {
...
@@ -12,7 +14,7 @@ interface SuperPreInfo {
let
superPreList
:
SuperPreInfo
[]
=
[];
let
superPreList
:
SuperPreInfo
[]
=
[];
export
async
function
initSuperPrerelease
()
{
export
async
function
initSuperPrerelease
()
{
const
json
=
await
(
await
fetch
(
preReleaseC
onfig
)).
text
();
const
json
=
await
(
await
fetch
(
c
onfig
)).
text
();
const
list
:
SuperPreInfo
[]
=
JSON
.
parse
(
json
);
const
list
:
SuperPreInfo
[]
=
JSON
.
parse
(
json
);
superPreList
=
list
;
superPreList
=
list
;
}
}
...
...
src/infra/stream.ts
View file @
7d557654
...
@@ -69,7 +69,6 @@ export class WebSocketStream {
...
@@ -69,7 +69,6 @@ export class WebSocketStream {
// but now it seems that we don't need wait any more,
// but now it seems that we don't need wait any more,
// so comment the following line and check if it's ok without it.
// so comment the following line and check if it's ok without it.
//
//
// await sleep(useConfig().streamInterval);
await
onMessage
(
value
);
await
onMessage
(
value
);
}
else
{
}
else
{
console
.
warn
(
"
value from ReadableStream is undefined!
"
);
console
.
warn
(
"
value from ReadableStream is undefined!
"
);
...
...
src/service/duel/unimplemented.ts
View file @
7d557654
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
Container
}
from
"
@/container
"
;
import
{
Container
}
from
"
@/container
"
;
const
NeosConfig
=
useConfig
();
const
UNIMPLEMENTED_WHITE_LIST
=
[
1
,
6
,
7
,
34
,
54
,
55
,
56
,
60
,
61
,
62
,
63
,
64
,
65
,
70
,
71
,
72
,
73
,
74
,
75
,
76
,
80
,
81
,
83
,
93
,
95
,
96
,
97
,
101
,
102
,
110
,
111
,
112
,
113
,
114
,
120
,
121
,
122
,
123
,
130
,
131
,
132
,
133
,
160
,
161
,
163
,
164
,
165
,
170
,
180
,
230
,
231
,
236
,
];
export
default
(
export
default
(
container
:
Container
,
container
:
Container
,
unimplemented
:
ygopro
.
StocGameMessage
.
MsgUnimplemented
,
unimplemented
:
ygopro
.
StocGameMessage
.
MsgUnimplemented
,
)
=>
{
)
=>
{
if
(
!
NeosConfig
.
unimplementedWhiteList
.
includes
(
unimplemented
.
command
))
{
if
(
!
UNIMPLEMENTED_WHITE_LIST
.
includes
(
unimplemented
.
command
))
{
container
.
context
.
matStore
.
unimplemented
=
unimplemented
.
command
;
container
.
context
.
matStore
.
unimplemented
=
unimplemented
.
command
;
}
}
};
};
src/ui/Layout/utils.ts
View file @
7d557654
...
@@ -12,7 +12,7 @@ import { useConfig } from "@/config";
...
@@ -12,7 +12,7 @@ import { useConfig } from "@/config";
import
{
useEnv
}
from
"
@/hook
"
;
import
{
useEnv
}
from
"
@/hook
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
import
{
accountStore
,
deckStore
,
initStore
,
type
User
}
from
"
@/stores
"
;
import
{
accountStore
,
deckStore
,
initStore
,
type
User
}
from
"
@/stores
"
;
const
{
release
DbUrl
,
preReleaseDbUrl
}
=
useConfig
();
const
{
release
Resource
,
preReleaseResource
}
=
useConfig
();
const
{
BASE_URL
}
=
useEnv
();
const
{
BASE_URL
}
=
useEnv
();
/** 加载ygodb */
/** 加载ygodb */
...
@@ -24,7 +24,11 @@ export const initSqlite = async () => {
...
@@ -24,7 +24,11 @@ export const initSqlite = async () => {
sqlite
.
progress
=
0.01
;
sqlite
.
progress
=
0.01
;
await
sqliteMiddleWare
({
await
sqliteMiddleWare
({
cmd
:
sqliteCmd
.
INIT
,
cmd
:
sqliteCmd
.
INIT
,
initInfo
:
{
releaseDbUrl
,
preReleaseDbUrl
,
progressCallback
},
initInfo
:
{
releaseDbUrl
:
releaseResource
.
cdb
,
preReleaseDbUrl
:
preReleaseResource
.
cdb
,
progressCallback
,
},
});
});
sqlite
.
progress
=
1
;
sqlite
.
progress
=
1
;
}
}
...
...
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