removed comments

This commit is contained in:
2026-01-03 14:45:14 +00:00
parent b046a85806
commit f7328d59eb
29 changed files with 266 additions and 351 deletions
-5
View File
@@ -4,7 +4,6 @@ import axios from "axios";
const API_URL = "http://localhost:8000/api/v1";
class BiscaMatch {
// FIX: Added autoPlayCallback parameter
constructor(apiData, emitStateCallback, token, autoPlayCallback) {
this.id = apiData.id;
this.emitStateCallback = emitStateCallback;
@@ -92,7 +91,6 @@ class BiscaMatch {
this.currentGame.init();
// FIX: Start Timer & Connect Callback
this.currentGame.startTurnTimer((uid, cid) => {
if (this.autoPlayCallback) this.autoPlayCallback(uid, cid);
});
@@ -105,12 +103,10 @@ class BiscaMatch {
}
}
// --- FIX: Close DB Game row on surrender ---
async abortCurrentGame(loserId) {
if (this.currentGame && this.currentGame.dbId) {
console.log(`[Match ${this.id}] Aborting Game #${this.currentGame.dbId}`);
try {
// Determine winner for the DB record based on who DIDN'T lose
const winnerId = loserId == this.player1Id ? this.player2Id : this.player1Id;
const payload = {
@@ -208,7 +204,6 @@ class BiscaMatch {
const result = this.currentGame.playCard(userId, cardId);
// FIX: Restart timer if game continues
if (result && (result.action === 'next_turn' || result.action === 'trick_resolved')) {
this.currentGame.startTurnTimer((uid, cid) => {
if (this.autoPlayCallback) this.autoPlayCallback(uid, cid);