1.9 KiB
1.9 KiB
poker.js — poker_handler() (satır 546)
saveLobbyData(c, lobby);
refreshTablePlayers(c, targetId);
} else {
player.send("§cMasa dolu!");
return;
}
} else {
player.send("§bMasa izleyici olarak izleniyor...");
}
}
openPokerUI(c, player, targetId);
}
return;
}
// LOBİ MASA KAPAT (Lobi listesinden direkt silme)
if (lastAction.indexOf("lobby_close_") === 0) {
var targetId = lastAction.replace("lobby_close_", "");
var tableIndex = -1;
for (var i = 0; i < lobby.tables.length; i++) {
if (lobby.tables[i].id === targetId) {
tableIndex = i;
break;
}
}
if (tableIndex !== -1) {
var table = lobby.tables[tableIndex];
if (table.host === playerName || isPlayerOP(player)) {
lobby.tables.splice(tableIndex, 1);
saveLobbyData(c, lobby);
c.send("§c" + table.name + " poker masası kapatıldı!");
openLobbyUI(c, player);
}
}
return;
}
// --- OYUN MASASI AKSİYONLARI ---
var tableId = getPlayerTableId(lobby, playerName);
// Eğer oyuncu herhangi bir masada kayıtlı değilse, masayı kapat tuşuyla atıldıysa vs. lobiye at
if (!tableId) {
// Ancak eğer butona basılan aksiyon "btn_leave" veya "btn_close" ise yine lobi ekranını aç
if (lastAction === "btn_leave" || lastAction === "btn_close") {
openLobbyUI(c, player);
} else {
openLobbyUI(c, player);
}
return;
}
var table = getTableData(lobby, tableId);
if (!table) {
openLobbyUI(c, player);
return;
}
// EKRANI YENİLE
if (lastAction === "btn_refresh") {