Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-cn-database-generator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
ygopro-cn-database-generator
Commits
603a331f
Commit
603a331f
authored
Jul 23, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no more auto update
parent
7ac7f25a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
17 deletions
+25
-17
.gitlab-ci.yml
.gitlab-ci.yml
+16
-16
src/dbreader.ts
src/dbreader.ts
+9
-1
No files found.
.gitlab-ci.yml
View file @
603a331f
...
...
@@ -68,19 +68,19 @@ upload_to_minio:
only
:
-
master
deploy_to_ygopro_server
:
stage
:
deploy
dependencies
:
-
zh-CN
tags
:
-
linux
script
:
-
apt update && apt -y install openssh-client rsync coreutils
-
mkdir ~/.ssh
-
chmod 700 ~/.ssh
-
ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts
-
echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
-
chmod 600 ~/.ssh/*
-
rsync -4cavzP --delete output/zh-CN/expansions/ nanahira@koishi.momobako.com:~/ygopro-cn/expansions
only
:
-
master
#
deploy_to_ygopro_server:
#
stage: deploy
#
dependencies:
#
- zh-CN
#
tags:
#
- linux
#
script:
#
- apt update && apt -y install openssh-client rsync coreutils
#
- mkdir ~/.ssh
#
- chmod 700 ~/.ssh
#
- ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts
#
- echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
#
- chmod 600 ~/.ssh/*
#
- rsync -4cavzP --delete output/zh-CN/expansions/ nanahira@koishi.momobako.com:~/ygopro-cn/expansions
#
only:
#
- master
src/dbreader.ts
View file @
603a331f
...
...
@@ -96,6 +96,7 @@ export class Card {
...
this
.
loadedTexts
,
...
this
.
preTexts
}
this
.
datas
.
ot
|=
0x8
;
this
.
texts
.
desc
+=
'
\r\n\r\n\
u2605简体中文卡
'
;
}
getSQLQueries
()
{
...
...
@@ -201,6 +202,10 @@ export class DBReader extends Base {
]);
await
fs
.
writeFile
(
`
${
this
.
config
.
outputPath
}
/expansions/lflist.conf`
,
banlistString
);
}
async
generatePatch
(
codes
:
number
[])
{
const
patchString
=
`update datas set ot = ot | 0x8 where
${
codes
.
map
(
code
=>
`id =
${
code
}
`
).
join
(
'
or
'
)}
;`
;
await
fs
.
writeFile
(
`
${
this
.
config
.
outputPath
}
/patch.sql`
,
patchString
);
}
private
async
categorizeCards
(
cards
:
Card
[]):
Promise
<
CardPool
>
{
const
main
=
cards
.
filter
(
card
=>
card
.
isInMainDeck
()).
map
(
card
=>
card
.
code
);
const
extra
=
cards
.
filter
(
card
=>
card
.
isInExtraDeck
()).
map
(
card
=>
card
.
code
);
...
...
@@ -227,9 +232,12 @@ export class DBReader extends Base {
await
query
.
perform
(
this
.
outputdb
);
}
await
this
.
outputdb
.
run
(
"
COMMIT;
"
);
const
allCodes
=
allCards
.
map
(
card
=>
card
.
code
);
this
.
log
.
debug
(
`Database created.`
);
await
this
.
generateBanlist
(
allC
ards
.
map
(
card
=>
card
.
code
)
);
await
this
.
generateBanlist
(
allC
odes
);
this
.
log
.
debug
(
`LFList created.`
);
await
this
.
generatePatch
(
allCodes
);
this
.
log
.
debug
(
`Patch created.`
);
await
this
.
generateDecks
(
cards
);
this
.
log
.
debug
(
`Decks generated.`
);
}
...
...
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