> **Public rooms update:** कोई भी registered player Gold Room List से chip tier चुनकर Play Now दबा सकता है। Public table का round तीन connected ready players पर अपने आप शुरू होता है। आप Owner Dashboard में Live Rooms और Round History से सार्वजनिक टेबल भी monitor कर सकते हैं। [Public Rooms का विवरण](PUBLIC-ROOMS-HINDI.md)।

# Owner Operating Playbook — Royal Teen Patti

Yeh document game ke operator/owner ke liye hai. **Saare chips free virtual rewards hain, cash ki value nahi hai.**

## 0. Initial setup / owner account

Project setup ke baad `npm run migrate` karein. `OWNER_EMAIL` aur unique 12+ character `OWNER_PASSWORD` set karke **ek baar** `npm run seed:owner` chalayein. Login par Owner Dashboard automatically dikhega. Owner email aur password `.env` ya Git mein permanently hardcode na karein.

## 1. Dashboard kya dikhata hai?

**Overview:** Total users, daily active, online, rooms, active/completed games aur pending chip requests. Refresh button updates dashboard statistics.

**Players:** Search by Game ID (jaise `TP100003`), name, email ya mobile. Account open karne par balance, verified phone status, login history aur recent wallet transactions milte hain.

**Chip requests:** Sabhi recent free-chip requests; new request pending hoti hai. Owner reason bhar kar Approve ya Reject kare. Approved request ki amount player ke wallet mein add hoti hai. Player ko in-game notification aur live balance update milta hai. Do baar approve nahi ho sakti (server row lock + pending status check).

**Live Rooms:** Har room ka code, players, pot aur current phase. **Actions** click karke betting activity dekhein. Agar owner opt-in spectator mode mein ho aur actively nahi khel raha, tab private room ki live cards spectator mode se dekhi ja sakti hain.

**Round History:** Complete ho chuke rounds ke saare cards, winner, pot, folded/remaining players. Betting log dekhne ke liye Show betting actions.

**Safety Flags:** Suspicious-pattern screening ke hints; yeh cheating ka automatic decision nahi hain.

**Audit Log:** Owner ne kitni chips badlayin, kisko block kiya, free request approve/reject ki, etc.

**Test Simulator:** Dummy game hands generate karke winner-check. Real active cards yahan nahi aate.

## 2. Wallet chips edit karna

Player search → correct Game ID confirm → **Required Reason** likhein:

| Kaam | Input | Effect |
|---|---|---|
| Free bonus dena | Adjustment +5000 | wallet +5000 |
| Free bonus hataana | Adjustment -500 | wallet -500 (only if available) |
| Exact balance set | Set Exact 10000 | wallet exactly 10000 |
| VIP bonus | Gift +500 VIP | VIP progress +500 |
| Player block | Block with reason | blocked account ke sessions revoked |

**Dhyan:** Wallet balance aur table stack alag cheezein hain. Owner overwrite **sirf wallet** par lagu hota hai; live pot ya doosron ki cards nahi badalti. Data changes ke saath immutable audit trail and wallet transactions banenge.

## 3. Player free chips request flow

1. Player game table/wallet se Request free chips.
2. Uske account mein ek samay par sirf **1 pending** request allowed hai, aur 10 minute rate limit hai.
3. Owner ko website notification aur optional Telegram Bot alert milega.
4. Owner **Chip requests** tab mein Game ID check karega.
5. Approve/Reject reason fill karega. Approve se `requested_chips` wallet mein add honge, approve ke baad player Add to Table kar sakta hai.
6. Approval aur wallet ledger same DB transaction mein record hote hain, repeat approvals block hote hain.

## 4. Telegram guide

Telegram BotFather se bot banayein, bot ko `/start` send karein. `TELEGRAM_BOT_TOKEN` secret rakhein; owner ki chat ID `TELEGRAM_OWNER_CHAT_ID` mein likhein. Aap bot ka `getUpdates` response apni secure environment mein dekh kar chat ID nikaal sakte hain. `OWNER_TELEGRAM_USERNAME` se player ko direct Telegram link dikhega. Sirf bot alert notification bhejta hai, message padhkar automatic chips nahi deta—approval website se hoga.

## 5. Fair play aur suspicious cases

- Playing Owner bhi doosre players ke **live hidden cards** nahi dekh sakta.
- Owner ko betting action history, completed-round cards aur heuristic flags milte hain.
- Collusion judge karne se pehle multiple rounds ka evidence check karein; abnormal win-rate cheating ka proof nahi.
- Private opt-in spectator mode use karte samay owner game ke current round mein participant nahi hota aur players ko pehle notice milta hai.

## 6. Daily owner checklist

- Pending chip requests review aur reason logs verify karein.
- Excessive chip adjustments aur unusual activity aur frequently saath khelne wale player pairs ka audit karein.
- SMTP/Telegram notification delivery, database backups aur free disk space monitor karein.
- Server logs mein errors, disconnects aur login abuse dekhein.
- VPS par one-process backend hi chalayein; multiple Node servers without distributed locking prohibited.

## 7. Release checklist (mandatory for a real launch)

- `npm test` passes.
- `npm install`, `npm run build`, `npm run migrate` all succeed on your VPS.
- Test 3+ genuine player sessions across Android devices, full match, disconnect/rejoin and timeout.
- Test real SMTP OTP, rejected/approved requests, owner balance overwrite, history and backups.
- HTTPS/secure cookies, Nginx WebSocket proxy, domain, production secret rotation.
- PWA install on Android; native APK requires its own tested packaging process.
