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
6a13db7f
Commit
6a13db7f
authored
Oct 08, 2024
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor neos.config.json
parent
a7d6c103
Pipeline
#30270
failed with stages
in 6 minutes and 40 seconds
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
156 additions
and
230 deletions
+156
-230
neos.config.json
neos.config.json
+54
-98
neos.config.prod.json
neos.config.prod.json
+54
-98
src/api/cards.ts
src/api/cards.ts
+22
-24
src/api/forbiddens.ts
src/api/forbiddens.ts
+2
-2
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/I18N/Source/Chinese/translation.json
src/ui/I18N/Source/Chinese/translation.json
+1
-0
src/ui/I18N/Source/English/translation.json
src/ui/I18N/Source/English/translation.json
+1
-0
src/ui/I18N/Source/Japanese/translation.json
src/ui/I18N/Source/Japanese/translation.json
+1
-0
src/ui/Layout/utils.ts
src/ui/Layout/utils.ts
+6
-2
src/ui/Match/MatchModal/index.tsx
src/ui/Match/MatchModal/index.tsx
+5
-0
No files found.
neos.config.json
View file @
6a13db7f
{
"version"
:
4961
,
"servers"
:
[{
"name"
:
"koishi"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"7211"
},
{
"name"
:
"mycard-athletic"
,
"ip"
:
"tiramisu.moecube.com"
,
"port"
:
"8912"
},
{
"name"
:
"mycard-custom"
,
"ip"
:
"tiramisu.moecube.com"
,
"port"
:
"7912"
},
{
"name"
:
"pre-release"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"889"
}
],
"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"
,
"loginUrl"
:
"https://accounts.moecube.com/signin"
,
"logoutUrl"
:
"https://accounts.moecube.com/signout"
,
"profileUrl"
:
"https://accounts.moecube.com/profiles"
,
"athleticWatchUrl"
:
"wss://tiramisu.moecube.com:8923"
,
"entertainWatchUrl"
:
"wss://tiramisu.moecube.com:7923"
,
"userApi"
:
"https://sapi.moecube.com:444/accounts/users/{username}.json"
,
"version"
:
4961
,
"servers"
:
[
{
"name"
:
"koishi"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"7211"
},
{
"name"
:
"mycard-athletic"
,
"ip"
:
"tiramisu.moecube.com"
,
"port"
:
"8912"
},
{
"name"
:
"mycard-custom"
,
"ip"
:
"tiramisu.moecube.com"
,
"port"
:
"7912"
},
{
"name"
:
"pre-release"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"889"
},
{
"name"
:
"408"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"1408"
}
],
"assetsPath"
:
"/neos-assets"
,
"releaseResource"
:
{
"img"
:
"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN"
,
"cdb"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb"
,
"lflist"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf"
},
"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"
,
"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"
},
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"replayUrl"
:
"replay.neos.moe"
,
"loginUrl"
:
"https://accounts.moecube.com/signin"
,
"logoutUrl"
:
"https://accounts.moecube.com/signout"
,
"profileUrl"
:
"https://accounts.moecube.com/profiles"
,
"athleticWatchUrl"
:
"wss://tiramisu.moecube.com:8923"
,
"entertainWatchUrl"
:
"wss://tiramisu.moecube.com:7923"
,
"userApi"
:
"https://sapi.moecube.com:444/accounts/users/{username}.json"
,
"mdproServer"
:
"https://rarnu.xyz:38443"
,
"agentServer"
:
"https://sapi.moecube.com:444/neos-ai-agent"
,
"streamInterval"
:
20
,
"startDelay"
:
1000
,
"ui"
:
{
"hint"
:
{
"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
]
"startDelay"
:
1000
,
"ui"
:
{
"hint"
:
{
"maxCount"
:
1
}
}
}
neos.config.prod.json
View file @
6a13db7f
{
"version"
:
4961
,
"servers"
:
[{
"name"
:
"koishi"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"7211"
},
{
"name"
:
"mycard-athletic"
,
"ip"
:
"tiramisu.moecube.com"
,
"port"
:
"8912"
},
{
"name"
:
"mycard-custom"
,
"ip"
:
"tiramisu.moecube.com"
,
"port"
:
"7912"
},
{
"name"
:
"pre-release"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"889"
}
],
"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"
,
"loginUrl"
:
"https://accounts.moecube.com/signin"
,
"logoutUrl"
:
"https://accounts.moecube.com/signout"
,
"profileUrl"
:
"https://accounts.moecube.com/profiles"
,
"athleticWatchUrl"
:
"wss://tiramisu.moecube.com:8923"
,
"entertainWatchUrl"
:
"wss://tiramisu.moecube.com:7923"
,
"userApi"
:
"https://sapi.moecube.com:444/accounts/users/{username}.json"
,
"version"
:
4961
,
"servers"
:
[
{
"name"
:
"koishi"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"7211"
},
{
"name"
:
"mycard-athletic"
,
"ip"
:
"tiramisu.moecube.com"
,
"port"
:
"8912"
},
{
"name"
:
"mycard-custom"
,
"ip"
:
"tiramisu.moecube.com"
,
"port"
:
"7912"
},
{
"name"
:
"pre-release"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"889"
},
{
"name"
:
"408"
,
"ip"
:
"koishi.momobako.com"
,
"port"
:
"1408"
}
],
"assetsPath"
:
"/neos-assets"
,
"releaseResource"
:
{
"img"
:
"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN"
,
"cdb"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb"
,
"lflist"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf"
},
"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"
,
"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"
},
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"replayUrl"
:
"replay.neos.moe"
,
"loginUrl"
:
"https://accounts.moecube.com/signin"
,
"logoutUrl"
:
"https://accounts.moecube.com/signout"
,
"profileUrl"
:
"https://accounts.moecube.com/profiles"
,
"athleticWatchUrl"
:
"wss://tiramisu.moecube.com:8923"
,
"entertainWatchUrl"
:
"wss://tiramisu.moecube.com:7923"
,
"userApi"
:
"https://sapi.moecube.com:444/accounts/users/{username}.json"
,
"mdproServer"
:
"https://rarnu.xyz:38443"
,
"agentServer"
:
"https://sapi.moecube.com:444/neos-ai-agent"
,
"streamInterval"
:
20
,
"startDelay"
:
1000
,
"ui"
:
{
"hint"
:
{
"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
]
"startDelay"
:
1000
,
"ui"
:
{
"hint"
:
{
"maxCount"
:
1
}
}
}
src/api/cards.ts
View file @
6a13db7f
...
...
@@ -4,7 +4,7 @@ import { FtsParams } from "@/middleware/sqlite/fts";
import
{
isSuperReleaseCard
}
from
"
./superPreRelease
"
;
const
NeosConfig
=
useConfig
();
const
{
assetsPath
,
releaseResource
,
preReleaseResource
}
=
useConfig
();
export
interface
CardMeta
{
id
:
number
;
...
...
@@ -80,33 +80,31 @@ export function getCardStr(meta: CardMeta, idx: number): string | undefined {
export
function
getCardImgUrl
(
code
:
number
,
back
=
false
)
{
const
ASSETS_BASE
=
import
.
meta
.
env
.
BASE_URL
===
"
/
"
?
NeosConfig
.
assetsPath
:
`
${
import
.
meta
.
env
.
BASE_URL
}${
NeosConfig
.
assetsPath
}
`
;
?
assetsPath
:
`
${
import
.
meta
.
env
.
BASE_URL
}${
assetsPath
}
`
;
if
(
back
||
code
===
0
)
{
return
`
${
ASSETS_BASE
}
/card_back.jpg`
;
}
}
else
if
(
isSuperReleaseCard
(
code
))
{
return
`
${
preReleaseResource
.
img
}
/
${
code
}
.jpg`
;
}
else
{
// Define translations for different languages (I18N)
const
language
=
localStorage
.
getItem
(
"
language
"
);
let
imgUrl
;
// Define translations for different languages (I18N)
const
language
=
localStorage
.
getItem
(
"
language
"
);
let
imgUrl
;
switch
(
language
)
{
case
"
en
"
:
case
"
br
"
:
case
"
pt
"
:
case
"
fr
"
:
case
"
es
"
:
imgUrl
=
releaseResource
.
img
.
replace
(
"
zh-CN
"
,
"
en-US
"
);
break
;
default
:
imgUrl
=
releaseResource
.
img
;
break
;
}
/* End of definition (I18N) */
switch
(
language
)
{
case
"
en
"
:
case
"
br
"
:
case
"
pt
"
:
case
"
fr
"
:
case
"
es
"
:
imgUrl
=
NeosConfig
.
releaseImgUrl
.
replace
(
"
zh-CN
"
,
"
en-US
"
);
break
;
default
:
imgUrl
=
NeosConfig
.
releaseImgUrl
;
break
;
}
/* End of definition (I18N) */
if
(
isSuperReleaseCard
(
code
))
{
return
`
${
NeosConfig
.
preReleaseImgUrl
}
/
${
code
}
.jpg`
;
}
else
{
return
`
${
imgUrl
}
/
${
code
}
.jpg`
;
}
}
src/api/forbiddens.ts
View file @
6a13db7f
...
...
@@ -3,14 +3,14 @@ import { isNil } from "lodash-es";
import
{
useConfig
}
from
"
@/config
"
;
import
{
CardMeta
}
from
"
./cards
"
;
const
{
lflistUrl
}
=
useConfig
();
const
{
releaseResource
:
{
lflist
}
}
=
useConfig
();
class
Forbidden
{
private
data
:
Map
<
number
,
number
>
=
new
Map
<
number
,
number
>
();
public
time
:
string
=
"
?
"
;
public
async
init
():
Promise
<
void
>
{
const
text
=
await
(
await
fetch
(
lflist
Url
)).
text
();
const
text
=
await
(
await
fetch
(
lflist
)).
text
();
const
{
time
,
forbiddens
}
=
this
.
extractForbiddensFromText
(
text
);
this
.
time
=
time
;
this
.
setForbiddens
(
forbiddens
);
...
...
src/api/superPreRelease.ts
View file @
6a13db7f
import
{
useConfig
}
from
"
@/config
"
;
const
{
preReleaseConfig
}
=
useConfig
();
const
{
preReleaseResource
:
{
config
},
}
=
useConfig
();
interface
SuperPreInfo
{
/* only use id currently, other fields see:
...
...
@@ -12,7 +14,7 @@ interface SuperPreInfo {
let
superPreList
:
SuperPreInfo
[]
=
[];
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
);
superPreList
=
list
;
}
...
...
src/infra/stream.ts
View file @
6a13db7f
...
...
@@ -69,7 +69,6 @@ export class WebSocketStream {
// 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.
//
// await sleep(useConfig().streamInterval);
await
onMessage
(
value
);
}
else
{
console
.
warn
(
"
value from ReadableStream is undefined!
"
);
...
...
src/service/duel/unimplemented.ts
View file @
6a13db7f
import
{
ygopro
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
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
(
container
:
Container
,
unimplemented
:
ygopro
.
StocGameMessage
.
MsgUnimplemented
,
)
=>
{
if
(
!
NeosConfig
.
unimplementedWhiteList
.
includes
(
unimplemented
.
command
))
{
if
(
!
UNIMPLEMENTED_WHITE_LIST
.
includes
(
unimplemented
.
command
))
{
container
.
context
.
matStore
.
unimplemented
=
unimplemented
.
command
;
}
};
src/ui/I18N/Source/Chinese/translation.json
View file @
6a13db7f
...
...
@@ -165,6 +165,7 @@
"Server"
:
"服务器"
,
"KoishiServer"
:
"Koishi服"
,
"UltraPreemptiveServer"
:
"超先行服"
,
"408"
:
"408环境"
,
"PlayerNickname"
:
"玩家昵称"
,
"RoomPasswordOptional"
:
"房间密码(可选)"
,
"JoinRoom"
:
"加入房间"
,
...
...
src/ui/I18N/Source/English/translation.json
View file @
6a13db7f
...
...
@@ -165,6 +165,7 @@
"Server"
:
"Server"
,
"KoishiServer"
:
"Koishi Server"
,
"UltraPreemptiveServer"
:
"Ultra Preemptive Server"
,
"408"
:
"408 Environment"
,
"PlayerNickname"
:
"Player Nickname"
,
"RoomPasswordOptional"
:
"Room Password (optional)"
,
"JoinRoom"
:
"Join the Room"
...
...
src/ui/I18N/Source/Japanese/translation.json
View file @
6a13db7f
...
...
@@ -163,6 +163,7 @@
"Server"
:
"サーバー"
,
"KoishiServer"
:
"コイシサーバー"
,
"UltraPreemptiveServer"
:
"超先行サーバー"
,
"408"
:
"408環境"
,
"PlayerNickname"
:
"プレイヤーニックネーム"
,
"RoomPasswordOptional"
:
"ルームパスワード(任意)"
,
"JoinRoom"
:
"ルームに参加"
...
...
src/ui/Layout/utils.ts
View file @
6a13db7f
...
...
@@ -12,7 +12,7 @@ import { useConfig } from "@/config";
import
{
useEnv
}
from
"
@/hook
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
import
{
accountStore
,
deckStore
,
initStore
,
type
User
}
from
"
@/stores
"
;
const
{
release
DbUrl
,
preReleaseDbUrl
}
=
useConfig
();
const
{
release
Resource
,
preReleaseResource
}
=
useConfig
();
const
{
BASE_URL
}
=
useEnv
();
/** 加载ygodb */
...
...
@@ -24,7 +24,11 @@ export const initSqlite = async () => {
sqlite
.
progress
=
0.01
;
await
sqliteMiddleWare
({
cmd
:
sqliteCmd
.
INIT
,
initInfo
:
{
releaseDbUrl
,
preReleaseDbUrl
,
progressCallback
},
initInfo
:
{
releaseDbUrl
:
releaseResource
.
cdb
,
preReleaseDbUrl
:
preReleaseResource
.
cdb
,
progressCallback
,
},
});
sqlite
.
progress
=
1
;
}
...
...
src/ui/Match/MatchModal/index.tsx
View file @
6a13db7f
...
...
@@ -16,6 +16,7 @@ const serverConfig = NeosConfig.servers;
const
KOISHI_INDEX
=
0
;
const
PRERELEASE_INDEX
=
3
;
const
ENV_408
=
4
;
const
{
defaults
:
{
defaultPlayer
,
defaultPassword
},
...
...
@@ -115,6 +116,10 @@ export const MatchModal: React.FC = ({}) => {
value
:
PRERELEASE_INDEX
,
label
:
i18n
(
"
UltraPreemptiveServer
"
),
},
{
value
:
ENV_408
,
label
:
i18n
(
"
408
"
),
},
]
}
onChange=
{
handleServerChange
}
/>
...
...
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