NON-PRODUCTION

Mummy — tài liệu ghép client

Payline 5×3 + 3 minigame mua: Treasure Hunt (board 5×5), Boost Chest, Coin Collect. Ô MG là object {symbol, jackpot, amount}. Trang này chỉ serve khi ENVIRONMENT != production.

1. Tổng quan

MụcGiá trị
Grid base5×3 · reels[col][row] — mỗi ô {symbol,jackpot,amount}
Treasure HuntBoard 5×5, box lớn dần (size, is_grow_up)
game_type0 Normal · 1 TreasureHunt · 2 BoostChest · 3 CoinCollect
Jackpotminor / major / mega / grand
BuyPOST /buy-bonus {bet, game_type} — giá từ gameplay
Base path/api/v1
Bắt buộc GET /gameplay trước. Restore MG dở từ snapshot treasure_hunt / boost_chest / coin_collect. Loop MG tới is_finish rồi mới spin base.

2. Luồng ghép

  1. GET /gameplay — board, jackpot meters, giá buy, snapshot MG.
  2. Spin POST /spins hoặc mua POST /buy-bonus.
  3. Nếu vào Treasure Hunt (spin random hoặc buy type 1) → loop POST /treasure-hunt.
  4. Boost Chest → loop POST /boost-chest. Coin Collect → loop POST /coin-collect.
  5. is_finish → credit chip, về base, mở lại spin.

3. Auth & envelope

Authorization: Bearer <access_token>
Content-Type: application/json
{
  "code": 0,
  "msg": { ... }
}
codeÝ nghĩa
0OK
-1Unknown / JWT invalid
-2Invalid input
69Wrong state — chưa /gameplay, đang MG
1000Popup i18n (buy không hợp lệ)

4. Grid & symbol

Base 5×3

4
4
8
1
2
0
12
5
6
7
3
9
10
11
8

Treasure Hunt 5×5

·
·
·
·
·
·
9
12
10
·
·
12
JP
11
·
·
12
9
12
·
·
·
·
·
·

8 Mummy. 9–11 gem. 12 Coin. Ô xanh = box Hunt đang expand. JP = jackpot cell.

idSymbol
0–3Small
4–7Big
8Mummy
9–11Green / Pink / Blue gem
12Coin (có amount)
13None — ô MG chưa mở

5. GET /api/v1/gameplay

GET /api/v1/gameplay
FieldTypeClient dùng để
jackpot_minor/major/mega/grandint644 meter JP
pay_table / bets / show_bets / betBet + pay
user_moneyint64Chip
game_typeint0–3 — restore đúng MG
treasure_chest_priceint64Hệ số giá Hunt
boost_chest_priceint64Hệ số giá Boost
coin_collect_priceint64Hệ số giá Coin
init_reelsint[5][3]Preview base (symbol id)
treasure_huntobject?Snapshot: bet, size, row, col, gems, max_gems, spins, win_amount, jackpot, reels[][]
boost_chest / coin_collectobject?Snapshot: bet, spins, reels, jackpot, win_amount
{
  "code": 0,
  "msg": {
    "jackpot_minor": 20000, "jackpot_major": 80000, "jackpot_mega": 250000, "jackpot_grand": 2000000,
    "pay_table": [[1,2,5],[1.5,3,8],[2,4,10],[2.5,5,12],[3,8,15],[4,10,20],[5,12,25],[8,15,40]],
    "bets": [200, 1000, 2000], "show_bets": [200, 1000, 2000], "bet": 1000, "user_money": 500000,
    "game_type": 0, "treasure_chest_price": 50, "boost_chest_price": 30, "coin_collect_price": 20,
    "init_reels": [[4,0,3],[4,12,9],[8,5,10],[1,6,11],[2,7,8]]
  }
}

6. POST /api/v1/spins

POST /api/v1/spins
{ "bet": 1000 }
FieldTypeÝ nghĩa
user_money / win_amount / betChip / win / bet
game_typeint0 hoặc MG vừa trigger
win_linesWinLine[]win_amount, line, line_number, symbol, number_of_symbols
reelsSymbol[5][3]Ô {symbol, jackpot, amount}
treasure_hunt_spin_resultobject?Có khi vừa vào Hunt — bước đầu
{
  "code": 0,
  "msg": {
    "user_money": 499000, "win_amount": 3000, "bet": 1000, "game_type": 1,
    "win_lines": [{ "win_amount": 3000, "line": [4,4,8,1,2], "line_number": 0, "symbol": 4, "number_of_symbols": 2 }],
    "reels": [
      [{ "symbol": 4, "jackpot": 0, "amount": 0 }, { "symbol": 0, "jackpot": 0, "amount": 0 }, { "symbol": 3, "jackpot": 0, "amount": 0 }],
      [{ "symbol": 4, "jackpot": 0, "amount": 0 }, { "symbol": 12, "jackpot": 0, "amount": 500 }, { "symbol": 9, "jackpot": 0, "amount": 0 }],
      [{ "symbol": 8, "jackpot": 0, "amount": 0 }, { "symbol": 5, "jackpot": 0, "amount": 0 }, { "symbol": 10, "jackpot": 0, "amount": 0 }],
      [{ "symbol": 1, "jackpot": 0, "amount": 0 }, { "symbol": 6, "jackpot": 0, "amount": 0 }, { "symbol": 11, "jackpot": 0, "amount": 0 }],
      [{ "symbol": 2, "jackpot": 0, "amount": 0 }, { "symbol": 7, "jackpot": 0, "amount": 0 }, { "symbol": 8, "jackpot": 0, "amount": 0 }]
    ],
    "treasure_hunt_spin_result": {
      "reels": [], "positions": [], "spins": 3, "extra_spins": 0, "gems": 0, "size": 1,
      "max_gems": 3, "win_amount": 0, "total_win_amount": 0, "is_finish": false,
      "user_money": 499000, "is_grow_up": false, "col": 2, "row": 2
    }
  }
}

7. POST /api/v1/buy-bonus

POST /api/v1/buy-bonus
{ "bet": 1000, "game_type": 1 }

Giá = price field tương ứng × bet. Cấm khi đang MG → code 1000.

FieldÝ nghĩa
user_money / bet / game_type / priceChip sau trừ, bet, MG đã mua, số đã trừ
treasure_hunt_spin_resultCó nếu mua Hunt — bước mở đầu
{
  "code": 0,
  "msg": { "user_money": 450000, "bet": 1000, "game_type": 1, "price": 50000 }
}

8. POST /api/v1/treasure-hunt

POST /api/v1/treasure-hunt
{ }
FieldÝ nghĩa
reelsBoard 5×5 Symbol
positionsÔ vừa collect
spins / extra_spinsLượt còn / lượt cộng
gems / max_gems / sizeGem trong box, mốc, cạnh box
win_amount / total_win_amountWin bước / cộng dồn
is_finishHết Hunt — credit user_money
is_grow_upBox nở (size++)
col / rowNeo box
{
  "code": 0,
  "msg": {
    "reels": [[{ "symbol": 13, "jackpot": 0, "amount": 0 }, { "symbol": 9, "jackpot": 0, "amount": 0 }]],
    "positions": [[1],[1,2],[2]], "spins": 2, "extra_spins": 1, "gems": 2, "size": 2, "max_gems": 3,
    "win_amount": 800, "total_win_amount": 800, "is_finish": false, "user_money": 450000,
    "is_grow_up": true, "col": 1, "row": 2
  }
}

9. POST /boost-chest & /coin-collect

POST /api/v1/boost-chest
{ }
POST /api/v1/coin-collect
{ }

Cùng shape. Cheat non-prod: {"symbols": [[...]]}.

FieldÝ nghĩa
bet / spinsBet / lượt còn
reelsBoard MG
jackpotLoại JP nếu trúng
rewards[{col,row,symbol}] ô vừa nổ
win_amount / is_finish / user_moneyWin, hết MG, chip
{
  "code": 0,
  "msg": {
    "bet": 1000, "spins": 2,
    "reels": [[{ "symbol": 12, "jackpot": 0, "amount": 200 }]],
    "jackpot": 0,
    "rewards": [{ "col": 0, "row": 0, "symbol": { "symbol": 12, "jackpot": 0, "amount": 200 } }],
    "win_amount": 200, "is_finish": false, "user_money": 470000
  }
}
Loop đúng endpoint theo game_type tới is_finish. Đừng mix Hunt với Boost.

10. Animation

  1. Base: highlight win_lines. Coin trên base hiện amount.
  2. Hunt: vẽ 5×5, box từ col/row/size. is_grow_up → expand. Collect positions.
  3. Boost/Coin: overlay rewards từng ô, cộng win, JP fanfare nếu jackpot > 0.
  4. Hết MG: lấy chip từ user_money, về game_type = 0.

11. Cheat (chỉ non-prod)

{ "bet": 1000, "reels": [[4,0,3],[4,12,9],[8,5,10],[1,6,11],[2,7,8]] }

MG: body {"symbols": ...} cùng shape board MG. Production bỏ qua.

12. Error & tiền

Tình huốngHành vi
HTTP 401Relogin
code 69GET /gameplay — restore đúng MG
code 1000Popup buy không hợp lệ
HTTP 400 blockedUser đang room PvP
EventChip
Base spin−bet; +win_amount
Buy bonus−price
MG giữa chừngChưa credit tổng
MG is_finish+win vào user_money

13. Checklist client