Commit 603a331f authored by nanahira's avatar nanahira

no more auto update

parent 7ac7f25a
...@@ -68,19 +68,19 @@ upload_to_minio: ...@@ -68,19 +68,19 @@ upload_to_minio:
only: only:
- master - master
deploy_to_ygopro_server: #deploy_to_ygopro_server:
stage: deploy # stage: deploy
dependencies: # dependencies:
- zh-CN # - zh-CN
tags: # tags:
- linux # - linux
script: # script:
- apt update && apt -y install openssh-client rsync coreutils # - apt update && apt -y install openssh-client rsync coreutils
- mkdir ~/.ssh # - mkdir ~/.ssh
- chmod 700 ~/.ssh # - chmod 700 ~/.ssh
- ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts # - ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts
- echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa # - echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/* # - chmod 600 ~/.ssh/*
- rsync -4cavzP --delete output/zh-CN/expansions/ nanahira@koishi.momobako.com:~/ygopro-cn/expansions # - rsync -4cavzP --delete output/zh-CN/expansions/ nanahira@koishi.momobako.com:~/ygopro-cn/expansions
only: # only:
- master # - master
...@@ -96,6 +96,7 @@ export class Card { ...@@ -96,6 +96,7 @@ export class Card {
...this.loadedTexts, ...this.loadedTexts,
...this.preTexts ...this.preTexts
} }
this.datas.ot |= 0x8;
this.texts.desc += '\r\n\r\n\u2605简体中文卡'; this.texts.desc += '\r\n\r\n\u2605简体中文卡';
} }
getSQLQueries() { getSQLQueries() {
...@@ -201,6 +202,10 @@ export class DBReader extends Base { ...@@ -201,6 +202,10 @@ export class DBReader extends Base {
]); ]);
await fs.writeFile(`${this.config.outputPath}/expansions/lflist.conf`, banlistString); 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> { private async categorizeCards(cards: Card[]): Promise<CardPool> {
const main = cards.filter(card => card.isInMainDeck()).map(card => card.code); const main = cards.filter(card => card.isInMainDeck()).map(card => card.code);
const extra = cards.filter(card => card.isInExtraDeck()).map(card => card.code); const extra = cards.filter(card => card.isInExtraDeck()).map(card => card.code);
...@@ -227,9 +232,12 @@ export class DBReader extends Base { ...@@ -227,9 +232,12 @@ export class DBReader extends Base {
await query.perform(this.outputdb); await query.perform(this.outputdb);
} }
await this.outputdb.run("COMMIT;"); await this.outputdb.run("COMMIT;");
const allCodes = allCards.map(card => card.code);
this.log.debug(`Database created.`); this.log.debug(`Database created.`);
await this.generateBanlist(allCards.map(card => card.code)); await this.generateBanlist(allCodes);
this.log.debug(`LFList created.`); this.log.debug(`LFList created.`);
await this.generatePatch(allCodes);
this.log.debug(`Patch created.`);
await this.generateDecks(cards); await this.generateDecks(cards);
this.log.debug(`Decks generated.`); 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