Commit 4d118ecb authored by nanahira's avatar nanahira

fix

parent b8d7105a
...@@ -78,10 +78,11 @@ class DataManager { ...@@ -78,10 +78,11 @@ class DataManager {
.select(`${minOrMax}(id)`, "value") .select(`${minOrMax}(id)`, "value")
.from(CloudReplay_1.CloudReplay, "replay") .from(CloudReplay_1.CloudReplay, "replay")
.getRawOne())); .getRawOne()));
if (!minQuery || maxQuery) { if (!minQuery || !maxQuery) {
return null; return null;
} }
const targetId = Math.floor((maxQuery.value - minQuery.value) * Math.random()) + minQuery.value; const [minId, maxId] = [minQuery, maxQuery].map(query => parseInt(query.value));
const targetId = Math.floor((maxId - minId) * Math.random()) + minId;
return await this.db.createQueryBuilder(CloudReplay_1.CloudReplay, "replay") return await this.db.createQueryBuilder(CloudReplay_1.CloudReplay, "replay")
.where("replay.id >= :targetId", { targetId }) .where("replay.id >= :targetId", { targetId })
.orderBy("replay.id", "ASC") .orderBy("replay.id", "ASC")
......
...@@ -104,7 +104,7 @@ export class DataManager { ...@@ -104,7 +104,7 @@ export class DataManager {
if(!minQuery || !maxQuery) { if(!minQuery || !maxQuery) {
return null; return null;
} }
const [maxId, minId] = [minQuery, maxQuery].map(query => parseInt(query.value)); const [minId, maxId] = [minQuery, maxQuery].map(query => parseInt(query.value));
const targetId = Math.floor((maxId - minId) * Math.random()) + minId; const targetId = Math.floor((maxId - minId) * Math.random()) + minId;
return await this.db.createQueryBuilder(CloudReplay, "replay") return await this.db.createQueryBuilder(CloudReplay, "replay")
.where("replay.id >= :targetId", {targetId}) .where("replay.id >= :targetId", {targetId})
......
...@@ -11,25 +11,28 @@ var __metadata = (this && this.__metadata) || function (k, v) { ...@@ -11,25 +11,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.Ban = void 0; exports.Ban = void 0;
const typeorm_1 = require("typeorm"); const typeorm_1 = require("typeorm");
let Ban = class Ban { let Ban = /** @class */ (() => {
}; let Ban = class Ban {
__decorate([ };
typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }), __decorate([
__metadata("design:type", Number) typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }),
], Ban.prototype, "id", void 0); __metadata("design:type", Number)
__decorate([ ], Ban.prototype, "id", void 0);
typeorm_1.Index(), __decorate([
typeorm_1.Column({ type: "varchar", length: 64, nullable: true }), typeorm_1.Index(),
__metadata("design:type", String) typeorm_1.Column({ type: "varchar", length: 64, nullable: true }),
], Ban.prototype, "ip", void 0); __metadata("design:type", String)
__decorate([ ], Ban.prototype, "ip", void 0);
typeorm_1.Index(), __decorate([
typeorm_1.Column({ type: "varchar", length: 20, nullable: true }), typeorm_1.Index(),
__metadata("design:type", String) typeorm_1.Column({ type: "varchar", length: 20, nullable: true }),
], Ban.prototype, "name", void 0); __metadata("design:type", String)
Ban = __decorate([ ], Ban.prototype, "name", void 0);
typeorm_1.Entity(), Ban = __decorate([
typeorm_1.Unique(["ip", "name"]) typeorm_1.Entity(),
], Ban); typeorm_1.Unique(["ip", "name"])
], Ban);
return Ban;
})();
exports.Ban = Ban; exports.Ban = Ban;
//# sourceMappingURL=Ban.js.map //# sourceMappingURL=Ban.js.map
\ No newline at end of file
...@@ -11,19 +11,22 @@ var __metadata = (this && this.__metadata) || function (k, v) { ...@@ -11,19 +11,22 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.BasePlayer = void 0; exports.BasePlayer = void 0;
const typeorm_1 = require("typeorm"); const typeorm_1 = require("typeorm");
class BasePlayer { let BasePlayer = /** @class */ (() => {
} class BasePlayer {
__decorate([ }
typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }), __decorate([
__metadata("design:type", Number) typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }),
], BasePlayer.prototype, "id", void 0); __metadata("design:type", Number)
__decorate([ ], BasePlayer.prototype, "id", void 0);
typeorm_1.Column({ type: "varchar", length: 20 }), __decorate([
__metadata("design:type", String) typeorm_1.Column({ type: "varchar", length: 20 }),
], BasePlayer.prototype, "name", void 0); __metadata("design:type", String)
__decorate([ ], BasePlayer.prototype, "name", void 0);
typeorm_1.Column({ type: "tinyint" }), __decorate([
__metadata("design:type", Number) typeorm_1.Column({ type: "tinyint" }),
], BasePlayer.prototype, "pos", void 0); __metadata("design:type", Number)
], BasePlayer.prototype, "pos", void 0);
return BasePlayer;
})();
exports.BasePlayer = BasePlayer; exports.BasePlayer = BasePlayer;
//# sourceMappingURL=BasePlayer.js.map //# sourceMappingURL=BasePlayer.js.map
\ No newline at end of file
...@@ -17,43 +17,46 @@ const typeorm_1 = require("typeorm"); ...@@ -17,43 +17,46 @@ const typeorm_1 = require("typeorm");
const CloudReplayPlayer_1 = require("./CloudReplayPlayer"); const CloudReplayPlayer_1 = require("./CloudReplayPlayer");
const underscore_1 = __importDefault(require("underscore")); const underscore_1 = __importDefault(require("underscore"));
const moment_1 = __importDefault(require("moment")); const moment_1 = __importDefault(require("moment"));
let CloudReplay = class CloudReplay { let CloudReplay = /** @class */ (() => {
fromBuffer(buffer) { let CloudReplay = class CloudReplay {
this.data = buffer.toString("base64"); fromBuffer(buffer) {
} this.data = buffer.toString("base64");
toBuffer() { }
return Buffer.from(this.data, "base64"); toBuffer() {
} return Buffer.from(this.data, "base64");
getDateString() { }
return moment_1.default(this.date).format('YYYY-MM-DD HH:mm:ss'); getDateString() {
} return moment_1.default(this.date).format('YYYY-MM-DD HH:mm:ss');
getPlayerNamesString() { }
const playerInfos = underscore_1.default.clone(this.players); getPlayerNamesString() {
playerInfos.sort((p1, p2) => p1.pos - p2.pos); const playerInfos = underscore_1.default.clone(this.players);
return playerInfos[0].name + (playerInfos[2] ? "+" + playerInfos[2].name : "") + " VS " + (playerInfos[1] ? playerInfos[1].name : "AI") + (playerInfos[3] ? "+" + playerInfos[3].name : ""); playerInfos.sort((p1, p2) => p1.pos - p2.pos);
} return playerInfos[0].name + (playerInfos[2] ? "+" + playerInfos[2].name : "") + " VS " + (playerInfos[1] ? playerInfos[1].name : "AI") + (playerInfos[3] ? "+" + playerInfos[3].name : "");
getDisplayString() { }
return `R#${this.id} ${this.getPlayerNamesString()} ${this.getDateString()}`; getDisplayString() {
} return `R#${this.id} ${this.getPlayerNamesString()} ${this.getDateString()}`;
}; }
__decorate([ };
typeorm_1.PrimaryColumn({ unsigned: true, type: "bigint" }), __decorate([
__metadata("design:type", Number) typeorm_1.PrimaryColumn({ unsigned: true, type: "bigint" }),
], CloudReplay.prototype, "id", void 0); __metadata("design:type", Number)
__decorate([ ], CloudReplay.prototype, "id", void 0);
typeorm_1.Column({ type: "text" }), __decorate([
__metadata("design:type", String) typeorm_1.Column({ type: "text" }),
], CloudReplay.prototype, "data", void 0); __metadata("design:type", String)
__decorate([ ], CloudReplay.prototype, "data", void 0);
typeorm_1.Column({ type: "datetime" }), __decorate([
__metadata("design:type", Date) typeorm_1.Column({ type: "datetime" }),
], CloudReplay.prototype, "date", void 0); __metadata("design:type", Date)
__decorate([ ], CloudReplay.prototype, "date", void 0);
typeorm_1.OneToMany(() => CloudReplayPlayer_1.CloudReplayPlayer, player => player.cloudReplay), __decorate([
__metadata("design:type", Array) typeorm_1.OneToMany(() => CloudReplayPlayer_1.CloudReplayPlayer, player => player.cloudReplay),
], CloudReplay.prototype, "players", void 0); __metadata("design:type", Array)
CloudReplay = __decorate([ ], CloudReplay.prototype, "players", void 0);
typeorm_1.Entity() CloudReplay = __decorate([
], CloudReplay); typeorm_1.Entity()
], CloudReplay);
return CloudReplay;
})();
exports.CloudReplay = CloudReplay; exports.CloudReplay = CloudReplay;
//# sourceMappingURL=CloudReplay.js.map //# sourceMappingURL=CloudReplay.js.map
\ No newline at end of file
...@@ -8,32 +8,35 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, ...@@ -8,32 +8,35 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
var __metadata = (this && this.__metadata) || function (k, v) { var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
}; };
var CloudReplayPlayer_1;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.CloudReplayPlayer = void 0; exports.CloudReplayPlayer = void 0;
const typeorm_1 = require("typeorm"); const typeorm_1 = require("typeorm");
const CloudReplay_1 = require("./CloudReplay"); const CloudReplay_1 = require("./CloudReplay");
const BasePlayer_1 = require("./BasePlayer"); const BasePlayer_1 = require("./BasePlayer");
let CloudReplayPlayer = CloudReplayPlayer_1 = class CloudReplayPlayer extends BasePlayer_1.BasePlayer { let CloudReplayPlayer = /** @class */ (() => {
static fromPlayerInfo(info) { var CloudReplayPlayer_1;
const p = new CloudReplayPlayer_1(); let CloudReplayPlayer = CloudReplayPlayer_1 = class CloudReplayPlayer extends BasePlayer_1.BasePlayer {
p.key = info.key; static fromPlayerInfo(info) {
p.name = info.name; const p = new CloudReplayPlayer_1();
p.pos = info.pos; p.key = info.key;
return p; p.name = info.name;
} p.pos = info.pos;
}; return p;
__decorate([ }
typeorm_1.Index(), };
typeorm_1.Column({ type: "varchar", length: 40 }), __decorate([
__metadata("design:type", String) typeorm_1.Index(),
], CloudReplayPlayer.prototype, "key", void 0); typeorm_1.Column({ type: "varchar", length: 40 }),
__decorate([ __metadata("design:type", String)
typeorm_1.ManyToOne(() => CloudReplay_1.CloudReplay, replay => replay.players), ], CloudReplayPlayer.prototype, "key", void 0);
__metadata("design:type", CloudReplay_1.CloudReplay) __decorate([
], CloudReplayPlayer.prototype, "cloudReplay", void 0); typeorm_1.ManyToOne(() => CloudReplay_1.CloudReplay, replay => replay.players),
CloudReplayPlayer = CloudReplayPlayer_1 = __decorate([ __metadata("design:type", CloudReplay_1.CloudReplay)
typeorm_1.Entity() ], CloudReplayPlayer.prototype, "cloudReplay", void 0);
], CloudReplayPlayer); CloudReplayPlayer = CloudReplayPlayer_1 = __decorate([
typeorm_1.Entity()
], CloudReplayPlayer);
return CloudReplayPlayer;
})();
exports.CloudReplayPlayer = CloudReplayPlayer; exports.CloudReplayPlayer = CloudReplayPlayer;
//# sourceMappingURL=CloudReplayPlayer.js.map //# sourceMappingURL=CloudReplayPlayer.js.map
\ No newline at end of file
...@@ -17,73 +17,76 @@ const typeorm_1 = require("typeorm"); ...@@ -17,73 +17,76 @@ const typeorm_1 = require("typeorm");
const DuelLogPlayer_1 = require("./DuelLogPlayer"); const DuelLogPlayer_1 = require("./DuelLogPlayer");
const moment_1 = __importDefault(require("moment")); const moment_1 = __importDefault(require("moment"));
const underscore_1 = __importDefault(require("underscore")); const underscore_1 = __importDefault(require("underscore"));
let DuelLog = class DuelLog { let DuelLog = /** @class */ (() => {
getViewString() { let DuelLog = class DuelLog {
const viewPlayers = underscore_1.default.clone(this.players); getViewString() {
viewPlayers.sort((p1, p2) => p1.pos - p2.pos); const viewPlayers = underscore_1.default.clone(this.players);
const playerString = viewPlayers[0].realName.split("$")[0] + (viewPlayers[2] ? "+" + viewPlayers[2].realName.split("$")[0] : "") + " VS " + (viewPlayers[1] ? viewPlayers[1].realName.split("$")[0] : "AI") + (viewPlayers[3] ? "+" + viewPlayers[3].realName.split("$")[0] : ""); viewPlayers.sort((p1, p2) => p1.pos - p2.pos);
return `<${this.id}> ${playerString} ${moment_1.default(this.time).format("YYYY-MM-DD HH-mm-ss")}`; const playerString = viewPlayers[0].realName.split("$")[0] + (viewPlayers[2] ? "+" + viewPlayers[2].realName.split("$")[0] : "") + " VS " + (viewPlayers[1] ? viewPlayers[1].realName.split("$")[0] : "AI") + (viewPlayers[3] ? "+" + viewPlayers[3].realName.split("$")[0] : "");
} return `<${this.id}> ${playerString} ${moment_1.default(this.time).format("YYYY-MM-DD HH-mm-ss")}`;
getViewJSON(tournamentModeSettings) { }
const data = { getViewJSON(tournamentModeSettings) {
id: this.id, const data = {
time: moment_1.default(this.time).format("YYYY-MM-DD HH:mm:ss"), id: this.id,
name: this.name + (tournamentModeSettings.show_info ? " (Duel:" + this.duelCount + ")" : ""), time: moment_1.default(this.time).format("YYYY-MM-DD HH:mm:ss"),
roomid: this.roomId, name: this.name + (tournamentModeSettings.show_info ? " (Duel:" + this.duelCount + ")" : ""),
cloud_replay_id: "R#" + this.cloudReplayId, roomid: this.roomId,
replay_filename: this.replayFileName, cloud_replay_id: "R#" + this.cloudReplayId,
roommode: this.roomMode, replay_filename: this.replayFileName,
players: this.players.map(player => { roommode: this.roomMode,
return { players: this.players.map(player => {
pos: player.pos, return {
is_first: player.isFirst === 1, pos: player.pos,
name: player.name + (tournamentModeSettings.show_ip ? " (IP: " + player.ip.slice(7) + ")" : "") + (tournamentModeSettings.show_info && !(this.roomMode === 2 && player.pos % 2 > 0) ? " (Score:" + player.score + " LP:" + (player.lp != null ? player.lp : "???") + (this.roomMode !== 2 ? " Cards:" + (player.cardCount != null ? player.cardCount : "???") : "") + ")" : ""), is_first: player.isFirst === 1,
winner: player.winner === 1 name: player.name + (tournamentModeSettings.show_ip ? " (IP: " + player.ip.slice(7) + ")" : "") + (tournamentModeSettings.show_info && !(this.roomMode === 2 && player.pos % 2 > 0) ? " (Score:" + player.score + " LP:" + (player.lp != null ? player.lp : "???") + (this.roomMode !== 2 ? " Cards:" + (player.cardCount != null ? player.cardCount : "???") : "") + ")" : ""),
}; winner: player.winner === 1
}) };
}; })
return data; };
} return data;
}; }
__decorate([ };
typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }), __decorate([
__metadata("design:type", Number) typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }),
], DuelLog.prototype, "id", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLog.prototype, "id", void 0);
typeorm_1.Column("datetime"), __decorate([
__metadata("design:type", Date) typeorm_1.Column("datetime"),
], DuelLog.prototype, "time", void 0); __metadata("design:type", Date)
__decorate([ ], DuelLog.prototype, "time", void 0);
typeorm_1.Index(), __decorate([
typeorm_1.Column({ type: "varchar", length: 20 }), typeorm_1.Index(),
__metadata("design:type", String) typeorm_1.Column({ type: "varchar", length: 20 }),
], DuelLog.prototype, "name", void 0); __metadata("design:type", String)
__decorate([ ], DuelLog.prototype, "name", void 0);
typeorm_1.Column("int"), __decorate([
__metadata("design:type", Number) typeorm_1.Column("int"),
], DuelLog.prototype, "roomId", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLog.prototype, "roomId", void 0);
typeorm_1.Column("bigint"), __decorate([
__metadata("design:type", Number) typeorm_1.Column("bigint"),
], DuelLog.prototype, "cloudReplayId", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLog.prototype, "cloudReplayId", void 0);
typeorm_1.Column({ type: "varchar", length: 256 }), __decorate([
__metadata("design:type", String) typeorm_1.Column({ type: "varchar", length: 256 }),
], DuelLog.prototype, "replayFileName", void 0); __metadata("design:type", String)
__decorate([ ], DuelLog.prototype, "replayFileName", void 0);
typeorm_1.Column("tinyint", { unsigned: true }), __decorate([
__metadata("design:type", Number) typeorm_1.Column("tinyint", { unsigned: true }),
], DuelLog.prototype, "roomMode", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLog.prototype, "roomMode", void 0);
typeorm_1.Column("tinyint", { unsigned: true }), __decorate([
__metadata("design:type", Number) typeorm_1.Column("tinyint", { unsigned: true }),
], DuelLog.prototype, "duelCount", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLog.prototype, "duelCount", void 0);
typeorm_1.OneToMany(() => DuelLogPlayer_1.DuelLogPlayer, player => player.duelLog), __decorate([
__metadata("design:type", Array) typeorm_1.OneToMany(() => DuelLogPlayer_1.DuelLogPlayer, player => player.duelLog),
], DuelLog.prototype, "players", void 0); __metadata("design:type", Array)
DuelLog = __decorate([ ], DuelLog.prototype, "players", void 0);
typeorm_1.Entity() DuelLog = __decorate([
], DuelLog); typeorm_1.Entity()
], DuelLog);
return DuelLog;
})();
exports.DuelLog = DuelLog; exports.DuelLog = DuelLog;
//# sourceMappingURL=DuelLog.js.map //# sourceMappingURL=DuelLog.js.map
\ No newline at end of file
...@@ -8,93 +8,96 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, ...@@ -8,93 +8,96 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
var __metadata = (this && this.__metadata) || function (k, v) { var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
}; };
var DuelLogPlayer_1;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.DuelLogPlayer = void 0; exports.DuelLogPlayer = void 0;
const typeorm_1 = require("typeorm"); const typeorm_1 = require("typeorm");
const BasePlayer_1 = require("./BasePlayer"); const BasePlayer_1 = require("./BasePlayer");
const DuelLog_1 = require("./DuelLog"); const DuelLog_1 = require("./DuelLog");
const DeckEncoder_1 = require("../DeckEncoder"); const DeckEncoder_1 = require("../DeckEncoder");
let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.BasePlayer { let DuelLogPlayer = /** @class */ (() => {
setStartDeck(deck) { var DuelLogPlayer_1;
if (deck === null) { let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.BasePlayer {
this.startDeckBuffer = null; setStartDeck(deck) {
return; if (deck === null) {
this.startDeckBuffer = null;
return;
}
this.startDeckBuffer = DeckEncoder_1.encodeDeck(deck).toString("base64");
} }
this.startDeckBuffer = DeckEncoder_1.encodeDeck(deck).toString("base64"); getStartDeck() {
} return DeckEncoder_1.decodeDeck(Buffer.from(this.startDeckBuffer, "base64"));
getStartDeck() {
return DeckEncoder_1.decodeDeck(Buffer.from(this.startDeckBuffer, "base64"));
}
setCurrentDeck(deck) {
if (deck === null) {
this.currentDeckBuffer = null;
return;
} }
this.currentDeckBuffer = DeckEncoder_1.encodeDeck(deck).toString("base64"); setCurrentDeck(deck) {
} if (deck === null) {
getCurrentDeck() { this.currentDeckBuffer = null;
return DeckEncoder_1.decodeDeck(Buffer.from(this.currentDeckBuffer, "base64")); return;
} }
static fromDuelLogPlayerInfo(info) { this.currentDeckBuffer = DeckEncoder_1.encodeDeck(deck).toString("base64");
const p = new DuelLogPlayer_1(); }
p.name = info.name; getCurrentDeck() {
p.pos = info.pos; return DeckEncoder_1.decodeDeck(Buffer.from(this.currentDeckBuffer, "base64"));
p.realName = info.realName; }
p.lp = info.lp; static fromDuelLogPlayerInfo(info) {
p.ip = info.ip; const p = new DuelLogPlayer_1();
p.score = info.score; p.name = info.name;
p.cardCount = info.cardCount; p.pos = info.pos;
p.isFirst = info.isFirst ? 1 : 0; p.realName = info.realName;
p.winner = info.winner ? 1 : 0; p.lp = info.lp;
p.startDeckBuffer = info.startDeckBuffer.toString("base64"); p.ip = info.ip;
p.setCurrentDeck(info.deck); p.score = info.score;
return p; p.cardCount = info.cardCount;
} p.isFirst = info.isFirst ? 1 : 0;
}; p.winner = info.winner ? 1 : 0;
__decorate([ p.startDeckBuffer = info.startDeckBuffer.toString("base64");
typeorm_1.Index(), p.setCurrentDeck(info.deck);
typeorm_1.Column({ type: "varchar", length: 20 }), return p;
__metadata("design:type", String) }
], DuelLogPlayer.prototype, "realName", void 0); };
__decorate([ __decorate([
typeorm_1.Column({ type: "varchar", length: 64, nullable: true }), typeorm_1.Index(),
__metadata("design:type", String) typeorm_1.Column({ type: "varchar", length: 20 }),
], DuelLogPlayer.prototype, "ip", void 0); __metadata("design:type", String)
__decorate([ ], DuelLogPlayer.prototype, "realName", void 0);
typeorm_1.Column("tinyint", { unsigned: true }), __decorate([
__metadata("design:type", Number) typeorm_1.Column({ type: "varchar", length: 64, nullable: true }),
], DuelLogPlayer.prototype, "isFirst", void 0); __metadata("design:type", String)
__decorate([ ], DuelLogPlayer.prototype, "ip", void 0);
typeorm_1.Column("tinyint"), __decorate([
__metadata("design:type", Number) typeorm_1.Column("tinyint", { unsigned: true }),
], DuelLogPlayer.prototype, "score", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLogPlayer.prototype, "isFirst", void 0);
typeorm_1.Column("int", { nullable: true }), __decorate([
__metadata("design:type", Number) typeorm_1.Column("tinyint"),
], DuelLogPlayer.prototype, "lp", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLogPlayer.prototype, "score", void 0);
typeorm_1.Column("smallint", { nullable: true }), __decorate([
__metadata("design:type", Number) typeorm_1.Column("int", { nullable: true }),
], DuelLogPlayer.prototype, "cardCount", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLogPlayer.prototype, "lp", void 0);
typeorm_1.Column("text", { nullable: true }), __decorate([
__metadata("design:type", String) typeorm_1.Column("smallint", { nullable: true }),
], DuelLogPlayer.prototype, "startDeckBuffer", void 0); __metadata("design:type", Number)
__decorate([ ], DuelLogPlayer.prototype, "cardCount", void 0);
typeorm_1.Column("text", { nullable: true }), __decorate([
__metadata("design:type", String) typeorm_1.Column("text", { nullable: true }),
], DuelLogPlayer.prototype, "currentDeckBuffer", void 0); __metadata("design:type", String)
__decorate([ ], DuelLogPlayer.prototype, "startDeckBuffer", void 0);
typeorm_1.Column("tinyint"), __decorate([
__metadata("design:type", Number) typeorm_1.Column("text", { nullable: true }),
], DuelLogPlayer.prototype, "winner", void 0); __metadata("design:type", String)
__decorate([ ], DuelLogPlayer.prototype, "currentDeckBuffer", void 0);
typeorm_1.ManyToOne(() => DuelLog_1.DuelLog, duelLog => duelLog.players), __decorate([
__metadata("design:type", DuelLog_1.DuelLog) typeorm_1.Column("tinyint"),
], DuelLogPlayer.prototype, "duelLog", void 0); __metadata("design:type", Number)
DuelLogPlayer = DuelLogPlayer_1 = __decorate([ ], DuelLogPlayer.prototype, "winner", void 0);
typeorm_1.Entity() __decorate([
], DuelLogPlayer); typeorm_1.ManyToOne(() => DuelLog_1.DuelLog, duelLog => duelLog.players),
__metadata("design:type", DuelLog_1.DuelLog)
], DuelLogPlayer.prototype, "duelLog", void 0);
DuelLogPlayer = DuelLogPlayer_1 = __decorate([
typeorm_1.Entity()
], DuelLogPlayer);
return DuelLogPlayer;
})();
exports.DuelLogPlayer = DuelLogPlayer; exports.DuelLogPlayer = DuelLogPlayer;
//# sourceMappingURL=DuelLogPlayer.js.map //# sourceMappingURL=DuelLogPlayer.js.map
\ No newline at end of file
...@@ -11,36 +11,39 @@ var __metadata = (this && this.__metadata) || function (k, v) { ...@@ -11,36 +11,39 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.RandomDuelBan = void 0; exports.RandomDuelBan = void 0;
const typeorm_1 = require("typeorm"); const typeorm_1 = require("typeorm");
let RandomDuelBan = class RandomDuelBan { let RandomDuelBan = /** @class */ (() => {
setNeedTip(need) { let RandomDuelBan = class RandomDuelBan {
this.needTip = need ? 1 : 0; setNeedTip(need) {
} this.needTip = need ? 1 : 0;
getNeedTip() { }
return this.needTip > 0 ? true : false; getNeedTip() {
} return this.needTip > 0 ? true : false;
}; }
__decorate([ };
typeorm_1.PrimaryColumn({ type: "varchar", length: 64 }), __decorate([
__metadata("design:type", String) typeorm_1.PrimaryColumn({ type: "varchar", length: 64 }),
], RandomDuelBan.prototype, "ip", void 0); __metadata("design:type", String)
__decorate([ ], RandomDuelBan.prototype, "ip", void 0);
typeorm_1.Column("datetime"), __decorate([
__metadata("design:type", Date) typeorm_1.Column("datetime"),
], RandomDuelBan.prototype, "time", void 0); __metadata("design:type", Date)
__decorate([ ], RandomDuelBan.prototype, "time", void 0);
typeorm_1.Column("smallint"), __decorate([
__metadata("design:type", Number) typeorm_1.Column("smallint"),
], RandomDuelBan.prototype, "count", void 0); __metadata("design:type", Number)
__decorate([ ], RandomDuelBan.prototype, "count", void 0);
typeorm_1.Column({ type: "simple-array" }), __decorate([
__metadata("design:type", Array) typeorm_1.Column({ type: "simple-array" }),
], RandomDuelBan.prototype, "reasons", void 0); __metadata("design:type", Array)
__decorate([ ], RandomDuelBan.prototype, "reasons", void 0);
typeorm_1.Column({ type: "tinyint", unsigned: true }), __decorate([
__metadata("design:type", Number) typeorm_1.Column({ type: "tinyint", unsigned: true }),
], RandomDuelBan.prototype, "needTip", void 0); __metadata("design:type", Number)
RandomDuelBan = __decorate([ ], RandomDuelBan.prototype, "needTip", void 0);
typeorm_1.Entity() RandomDuelBan = __decorate([
], RandomDuelBan); typeorm_1.Entity()
], RandomDuelBan);
return RandomDuelBan;
})();
exports.RandomDuelBan = RandomDuelBan; exports.RandomDuelBan = RandomDuelBan;
//# sourceMappingURL=RandomDuelBan.js.map //# sourceMappingURL=RandomDuelBan.js.map
\ No newline at end of file
...@@ -11,18 +11,21 @@ var __metadata = (this && this.__metadata) || function (k, v) { ...@@ -11,18 +11,21 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.User = void 0; exports.User = void 0;
const typeorm_1 = require("typeorm"); const typeorm_1 = require("typeorm");
let User = class User { let User = /** @class */ (() => {
}; let User = class User {
__decorate([ };
typeorm_1.PrimaryColumn({ type: "varchar", length: 128 }), __decorate([
__metadata("design:type", String) typeorm_1.PrimaryColumn({ type: "varchar", length: 128 }),
], User.prototype, "key", void 0); __metadata("design:type", String)
__decorate([ ], User.prototype, "key", void 0);
typeorm_1.Column("varchar", { length: 16, nullable: true }), __decorate([
__metadata("design:type", String) typeorm_1.Column("varchar", { length: 16, nullable: true }),
], User.prototype, "chatColor", void 0); __metadata("design:type", String)
User = __decorate([ ], User.prototype, "chatColor", void 0);
typeorm_1.Entity() User = __decorate([
], User); typeorm_1.Entity()
], User);
return User;
})();
exports.User = User; exports.User = User;
//# sourceMappingURL=User.js.map //# sourceMappingURL=User.js.map
\ No newline at end of file
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