NON-PRODUCTION
Horus — tài liệu ghép client
Cluster 5 cột × 6 hàng + 3 minigame: Wings of Horus, Falcon Strike, Divine Grace. Có buy minigame.
Chip MG chỉ credit khi is_finish. Trang này chỉ serve khi ENVIRONMENT != production.
1. Tổng quan
| Mục | Giá trị |
|---|---|
| Grid | 5 cột × 6 hàng · reels[col][row], cluster 4-neighbor |
| game_type | 0 base · 1 Wings · 2 Falcon · 3 Divine |
| Wings | Chọn position trên dãy card |
| Falcon | Tumble + active_cols / pot giữa chừng |
| Divine | Orbs + special symbols, so sánh reels vs end_reels |
| Buy | POST /buy-minigame {bet, mini_game_type} — board planted, line win không credit |
| Base path | /api/v1 |
Bắt buộc
GET /gameplay. Restore MG từ snapshot wings_of_horus / falcon_strike / divine_grace.
2. Luồng ghép
GET /gameplay— board 5×6, giá 3 MG, snapshot nếu đang dở.POST /spins. Playwin_result[](cluster tumble).- Nếu
is_bonus_game→ gọi đúng endpoint theobonus_game_typetớiis_finish. - Buy:
/buy-minigamerồi vào MG (line win spin buy không cộng chip). - Chip MG chỉ lấy từ
user_moneykhiis_finish.
3. Auth & envelope
Authorization: Bearer <access_token> Content-Type: application/json
{
"code": 0,
"msg": { ... }
}
| code | Ý nghĩa |
|---|---|
0 | OK |
-1 | Unknown / JWT invalid |
-2 | Invalid input |
69 | Wrong state — chưa /gameplay, đang MG |
1000 | Popup i18n (buy không hợp lệ) |
4. Grid & symbol
Cluster board 5 cột × 6 hàng. Hàng đầu = row 0.
5
5
2
3
10
5
5
5
4
1
0
11
6
7
8
9
16
2
3
4
1
0
12
6
7
8
9
5
1
0
Ô vàng = cluster High1 (5). 10 Scatter. 11–14 Wings. 16 Sun orb / 17 Sky orb wild.
| id | Symbol |
|---|---|
| 0–4 | Low 1–5 |
| 5–9 | High 1–5 |
| 10 | Scatter (trigger MG) |
| 11–14 | Silver / Epic Silver / Gold / Epic Gold Wings |
| 15 | Life orb |
| 16 | Sun orb (wild, cộng count) |
| 17 | Sky orb (wild, nhân combo) |
| 18 | Multiplier (Divine) |
| 19 | Empty rock (Divine) |
5. GET /api/v1/gameplay
GET /api/v1/gameplay
| Field | Type | Client dùng để |
|---|---|---|
user_money / bet / bets / show_bets | — | Chip + bet |
pay_table | float[][] | Paytable cluster |
game_type | int | 0–3 restore MG |
init_reels | int[5][6] | Preview |
wings_of_horus_price / falcon_strike_price / divine_grace_price | int64 | Hệ số giá buy |
wings_of_horus | object? | cards[{symbol,multiplier}], spins, multipliers |
falcon_strike | object? | active_cols, multipliers, spins, pot, max_spins |
divine_grace | object? | reels / symbols, multipliers, spins |
{
"code": 0,
"msg": {
"user_money": 500000, "bet": 1000,
"bets": [200, 1000, 2000], "show_bets": [200, 1000, 2000],
"pay_table": [[50,20,10],[25,10,5],[15,8,4],[10,5,2],[8,3,1.5],[40,15,8],[30,12,6],[20,8,4],[15,6,3],[10,4,2]],
"game_type": 0,
"init_reels": [[5,5,0,9,1,8],[5,5,11,0,0,9],[2,5,6,2,12,5],[3,4,7,3,6,1],[10,1,8,4,7,0]],
"wings_of_horus_price": 80, "falcon_strike_price": 100, "divine_grace_price": 120
}
}
6. POST /api/v1/spins
POST /api/v1/spins
{ "bet": 1000 }
| Field | Ý nghĩa |
|---|---|
bet / user_money / win_amount | Bet, chip, win base (MG chưa credit) |
win_result | Tumble cluster |
is_bonus_game / bonus_game_type | Vào MG 1/2/3 |
wings_of_horus / falcon_strike / divine_grace | Snapshot lúc trigger |
WinResult / WinLine
| Field | Ý nghĩa |
|---|---|
lines | symbol, positions, win_amount, line_size, multiplier, has_wild, wild_multiplier, active_col_multiplier |
reels / positions | Board trước xóa / ô thắng |
win_amount / total_win_amount | Bước / cộng dồn |
special_symbols | [{col,row,symbol,multiplier,col_multipliers,affected_cols}] |
wild_bonus_multiplier / wild_multiplier | Hệ số wild |
bonus_spins / col_multipliers / active_cols | Falcon / Divine extras |
{
"code": 0,
"msg": {
"bet": 1000, "user_money": 499000, "win_amount": 6000,
"is_bonus_game": true, "bonus_game_type": 1,
"win_result": [{
"lines": [{ "symbol": 5, "positions": [[0,1],[0,1],[1],[],[]], "win_amount": 6000, "line_size": 5, "multiplier": 8, "has_wild": false, "wild_multiplier": 0, "active_col_multiplier": 1 }],
"reels": [[5,5,0,9,1,8],[5,5,11,0,0,9],[2,5,6,2,12,5],[3,4,7,3,6,1],[10,1,8,4,7,0]],
"win_amount": 6000, "total_win_amount": 6000,
"positions": [[0,1],[0,1],[1],[],[]],
"wild_bonus_multiplier": 0, "wild_multiplier": 0, "special_symbols": [],
"active_cols": [0,1,2], "bonus_spins": 0, "col_multipliers": [1,1,1,1,1]
}],
"wings_of_horus": { "cards": [{ "symbol": 0, "multiplier": 0 }, { "symbol": 0, "multiplier": 0 }], "spins": 3, "multipliers": [1,1,1,1,1] }
}
}
7. POST /api/v1/wings-of-horus
POST /api/v1/wings-of-horus
{ "position": 2 }
| Field | Ý nghĩa |
|---|---|
position | Index vừa chọn |
symbol | {symbol, multiplier} lá vừa lật |
bonus_spins / spins | Lượt cộng / còn lại |
multipliers | Hệ số cột sau bước |
is_finish / win_amount / user_money | Hết MG — lúc này mới credit |
{
"code": 0,
"msg": {
"position": 2, "symbol": { "symbol": 11, "multiplier": 2 },
"bonus_spins": 1, "spins": 2, "multipliers": [1, 2, 1, 1, 1],
"is_finish": false, "win_amount": 0, "user_money": 499000
}
}
8. POST /api/v1/falcon-strike
POST /api/v1/falcon-strike
{ }
| Field | Ý nghĩa |
|---|---|
bet / user_money / win_amount | Chip chỉ tin khi finish |
win_result | Tumble bước Falcon |
pot | Cộng dồn giữa chừng — chưa credit |
multipliers / spins / active_cols | State cột |
is_finish | Credit pot |
{
"code": 0,
"msg": {
"bet": 1000, "user_money": 499000, "win_amount": 4000,
"win_result": [], "pot": 12000, "multipliers": [2,2,1,1,1],
"spins": 3, "active_cols": [true, true, true, false, false], "is_finish": false
}
}
9. POST /api/v1/divine-grace
POST /api/v1/divine-grace
| Field | Ý nghĩa |
|---|---|
reels / end_reels | Board trước / sau bước (Symbol {symbol,multiplier}) |
multipliers | Hệ số cột |
orbs | [{col,row,symbol,multiplier}] |
special_symbols | Wings affect cột |
spins / is_finish / win_amount / user_money | Loop / credit lúc finish |
{
"code": 0,
"msg": {
"reels": [[{ "symbol": 5, "multiplier": 0 }]], "end_reels": [[{ "symbol": 5, "multiplier": 2 }]],
"multipliers": [2,1,1,1,1],
"orbs": [{ "col": 0, "row": 1, "symbol": 18, "multiplier": 2 }],
"special_symbols": [{ "col": 1, "row": 2, "symbol": 11, "multiplier": 2, "col_multipliers": [2,2,1,1,1], "affected_cols": [0,1] }],
"spins": 2, "is_finish": false, "win_amount": 0, "user_money": 499000
}
}
10. POST /api/v1/buy-minigame
POST /api/v1/buy-minigame
{ "bet": 1000, "mini_game_type": 2 }
mini_game_type: 1 Wings · 2 Falcon · 3 Divine. Giá = price field × bet. Response gần giống SpinResult: board planted, line win không credit. Rồi vào loop MG.
Nút buy chỉ khi
game_type = 0 và đủ chip. Đang MG → code 1000.{
"code": 0,
"msg": {
"bet": 1000, "user_money": 400000, "win_amount": 0,
"win_result": [], "is_bonus_game": true, "bonus_game_type": 2,
"falcon_strike": { "active_cols": [true,true,true,true,true], "multipliers": [1,1,1,1,1], "spins": 5, "pot": 0, "max_spins": 5 }
}
}
11. Animation
- Base: play tumble
win_result, highlight cluster, special wings affect cột. - Wings: user tap
position, lậtsymbol, cập nhậtmultipliers. - Falcon: tumble như base, cột
active_colssáng, cộngpot(chưa chip). - Divine: interpolate
reels→end_reels, overlay orbs. is_finish: cộng chip, về base.
Source of truth tiền MG là
user_money lúc is_finish. Giữa chừng chỉ hiện pot / win_amount trên UI.12. Cheat (chỉ non-prod)
{ "bet": 1000, "reels": [[5,5,0,9,1,8],[5,5,11,0,0,9],[2,5,6,2,12,5],[3,4,7,3,6,1],[10,1,8,4,7,0]] }
Falcon nhận reels cheat tương tự. Production bỏ qua.
13. Error & tiền
| Tình huống | Hành vi |
|---|---|
| HTTP 401 | Relogin |
| code 69 | GET /gameplay — restore MG |
| code 1000 | Popup buy |
HTTP 400 blocked | User đang room PvP |
| Event | Chip |
|---|---|
| Base spin | −bet; +win_amount (line) |
| Buy MG | −price; line win planted không credit |
| MG giữa chừng | Không đổi chip |
| MG finish | +win vào user_money |
14. Checklist client
GET /gameplaytrước. Board 5×6 cluster.is_bonus_game→ đúng endpoint tớiis_finish.- Buy: planted board, không cộng line win.
- Chip MG chỉ lúc finish. Restore snapshot khi reconnect.
- Không spam 2 request song song.