Commit 603a331f authored by nanahira's avatar nanahira

no more auto update

parent 7ac7f25a
......@@ -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
......@@ -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(allCards.map(card => card.code));
await this.generateBanlist(allCodes);
this.log.debug(`LFList created.`);
await this.generatePatch(allCodes);
this.log.debug(`Patch created.`);
await this.generateDecks(cards);
this.log.debug(`Decks generated.`);
}
......
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