Commit 8e668218 authored by nanahira's avatar nanahira

share same card reader

parent 502e7220
......@@ -220,16 +220,7 @@ export class Room {
]);
}
private finalizors: RoomFinalizor[] = [
() => this.disposeOcgcore(),
() => {
if (this._cardReader) {
try {
this._cardReader.finalize?.();
} catch (e) {}
}
},
];
private finalizors: RoomFinalizor[] = [() => this.disposeOcgcore()];
addFinalizor(finalizor: RoomFinalizor, atEnd = false) {
if (atEnd) {
......
......@@ -16,12 +16,10 @@ export class YGOProResourceLoader {
private logger = this.ctx.createLogger(this.constructor.name);
private _cardReader = DirCardReader(this.ctx.SQL, ...this.ygoproPaths);
async getCardReader() {
this.logger.debug(
{ ygoproPaths: this.ygoproPaths, sql: typeof this.ctx.SQL.Database },
'Getting card reader',
);
return DirCardReader(this.ctx.SQL, ...this.ygoproPaths);
return this._cardReader;
}
async *getLFLists() {
......
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