Files

69 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# poker.js — poker_handler() (satır 546)
[← poker.js](index.md) · [← Master](../../wiki.md)
Parça 3/6 · [önceki](poker_handler-2.md) · [sonraki](poker_handler-4.md)
```javascript
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") {
```