NON-PRODUCTION
Si Xiang — tài liệu ghép client
Payline 5×3 Tứ tượng + gem minigames (Dragon Pearl, Gold Pick, Lucky Draw, Rapid Pay) và Ultimate. Domain Si Xiang — đừng gọi API game khác. Trang này chỉ serve khi ENVIRONMENT != production.
1. Tổng quan
Mục Giá trị
Grid 5 cột × 3 hàng · payline. 3 cột scatter → bonus wheel
Symbols 0–4 small · 5–8 big · 9 WILD · 10 Scatter
game_state 0 spins · 1 bonus · 2 dragon_pearl · 3 lucky_draw · 4 gold_pick · 5 rapid_pay · 6 ultimate_select
Gem 0 Thanh Long (Pearl) · 1 Bạch Hổ (Gold) · 2 Chu Tước (Rapid) · 3 Huyền Vũ (Draw). Đủ 4 → Ultimate
Jackpot Cố định × bet (minor/major/mega/grand trên /gameplay). 5 cột wild = Grand
Base path /api/v1 trên domain Si Xiang
Không spin khi đang minigame. Hết MG phải POST /done rồi mới POST /spins. Thiếu /gameplay → code 69.
2. Luồng ghép
GET /gameplay. Restore theo game_state + snapshot MG.
Base: POST /spins. Highlight win_lines. is_bonus → wheel POST /spins-scatter.
Wheel: MG → endpoint tương ứng; chip reward (type 4–7) credit rồi về spins.
Lặp MG tới finish. select_ultimate_game → UI chọn rồi POST /select-ultimate-game.
Mua ngọc: POST /buy-gem → vào MG. Hết MG: POST /done rồi spin tiếp.
3. Auth & envelope
Authorization: Bearer <access_token>
Content-Type: application/json
{ "code": 0, "msg": { ... } }
code Ý nghĩa
0 / -1 / -2 OK / unknown-JWT / invalid input
69 Sai state — chưa /gameplay, đang MG mà spin, bet sai
1000 Popup i18n (buy-gem không hợp lệ)
4. Grid, gem picker
5×3. Ô xanh = wild, vàng = scatter. Hàng gem: 4 Tứ tượng (sáng = đã có).
Giá buy gem = bet × gem_price_multipliers[số ngọc đã có]. gems là bool[4].
5. GET /api/v1/gameplay
GET /api/v1/gameplay
Field Ý nghĩa
init_reelsPreview 5×3
jackpot_minor/major/mega/grandHệ số hiển thị (× bet)
pay_table / bets / show_bets / bet / user_moneyPay & chip
game_statePhase 0–6
ultimate_game_multiplierHệ số Ultimate
gem_list[{bet,gems,price}]Ngọc theo mức cược
gem_price_multipliersHệ số giá theo số ngọc đang có
dragon_pearl / gold_pick / rapid_pay / lucky_drawSnapshot resume (omitempty)
{
"code": 0,
"msg": {
"init_reels": [[0,1,2],[5,9,6],[10,7,3],[4,10,8],[1,2,10]],
"jackpot_minor": 10, "jackpot_major": 20, "jackpot_mega": 30, "jackpot_grand": 100,
"pay_table": [[1,2,5],[1,2,5],[1.5,3,8],[2,4,10],[2,5,12],[3,8,20],[4,10,25],[5,12,30],[8,20,50]],
"bets": [200,1000,2000], "show_bets": [200,1000,2000], "bet": 1000, "user_money": 420000,
"game_state": 0, "ultimate_game_multiplier": 3, "gem_price_multipliers": [50,80,120,200],
"gem_list": [{ "bet": 1000, "gems": [true,false,false,true], "price": 80000 }]
}
}
6. GET /api/v1/gems
GET /api/v1/gems
Danh sách ngọc. Nếu rỗng, dùng gem_list trên /gameplay.
Field Ý nghĩa
bet / gems[4] / priceMức cược; 4 Tứ tượng; giá mua ngọc kế
{ "code": 0, "msg": [{ "bet": 200, "gems": [false,false,false,false], "price": 10000 }, { "bet": 1000, "gems": [true,false,false,true], "price": 80000 }] }
7. POST /api/v1/spins
POST /api/v1/spins
{ "bet": 1000 }
Chỉ khi game_state = 0. Trừ bet, credit line win ngay.
Field Ý nghĩa
user_money / win_amount / betChip sau GD
is_grand_jackpot5 cột wild — fanfare Grand
is_bonus3 scatter col → gọi /spins-scatter, đừng spin tiếp
win_lines[]win_amount, line (hàng theo cột), line_number, symbol, number_of_symbols
reelsBoard 5×3 kết quả
{
"code": 0,
"msg": {
"user_money": 425000, "win_amount": 6000, "bet": 1000,
"is_grand_jackpot": false, "is_bonus": true,
"win_lines": [{ "win_amount": 6000, "line": [1,1,1,1,1], "line_number": 2, "symbol": 5, "number_of_symbols": 5 }],
"reels": [[0,5,2],[5,9,6],[10,5,3],[4,10,8],[1,5,10]]
}
}
8. POST /api/v1/spins-scatter
POST /api/v1/spins-scatter
Khi is_bonus. reward_type: 0 Pearl · 1 Draw · 2 Gold · 3 Rapid · 4–7 chip 3×/6×/10×/15×.
Field Ý nghĩa
mini_game_typePhase sau wheel (2–5 MG, 0 nếu chip)
reward_type0–7 như trên
user_money / win_amount / betChip nếu reward chip
4 snapshot dragon_pearl / gold_pick / rapid_pay / lucky_draw (một cái non-null)
{
"code": 0,
"msg": {
"mini_game_type": 2, "reward_type": 0, "user_money": 425000, "win_amount": 0, "bet": 1000,
"dragon_pearl": { "win_amount": 0, "is_ultimate_game": false, "pearls": [], "spins": 3 }
}
}
9. POST /api/v1/buy-gem
POST /api/v1/buy-gem
{ "bet": 1000, "gem_type": 0 }
Field Ý nghĩa
price / bet / user_moneyĐã trừ giá
gem_type / mini_game_typeNgọc mua / MG vừa vào
snapshots Một MG info tương ứng
{ "code": 0, "msg": { "price": 80000, "bet": 1000, "user_money": 345000, "gem_type": 0, "mini_game_type": 2, "dragon_pearl": { "win_amount": 0, "is_ultimate_game": false, "pearls": [], "spins": 3 } } }
10. POST /api/v1/select-ultimate-game
POST /api/v1/select-ultimate-game
{ "mini_game_type": 2 }
mini_game_type = 2 Pearl · 3 Draw · 4 Gold · 5 Rapid.
Field Ý nghĩa
mini_game_type / multiplier / betMG + hệ số Ultimate
snapshots Board MG vừa mở (ultimate)
{ "code": 0, "msg": { "mini_game_type": 4, "multiplier": 3, "bet": 1000, "gold_pick": { "win_amount": 0, "is_ultimate_game": true, "number_of_picks": 3, "golds": [] } } }
11. Minigames — loop tới finish
POST /dragon-pearl
POST /api/v1/dragon-pearl
Field Ý nghĩa
pearls[]row,col,pearl_type,lucky_money_type,jackpot_type,multiplier,win_amount,is_bonus_spin,is_jackpot,is_doubled
finished / spins / bonus_spinsHết lượt / còn lại / +spin
select_ultimate_game / is_ultimate_game / grand_jackpot / gem_typeFlags kết thúc
{ "code": 0, "msg": { "bet": 1000, "user_money": 431000, "finished": false, "win_amount": 6000, "gem_type": -1, "select_ultimate_game": false, "is_ultimate_game": false, "grand_jackpot": false, "bonus_spins": 0, "spins": 2, "pearls": [{ "row": 0, "col": 1, "pearl_type": 1, "lucky_money_type": 0, "jackpot_type": 0, "multiplier": 6, "win_amount": 6000, "is_bonus_spin": false, "is_jackpot": false, "is_doubled": false }] } }
POST /gold-pick
POST /api/v1/gold-pick
Field Ý nghĩa
golds[]gold_type, win_amount, jackpot_type, multiplier
flags select_ultimate_game, is_ultimate_game, gem_type, user_money, win_amount
{ "code": 0, "msg": { "bet": 1000, "user_money": 428000, "win_amount": 3000, "is_ultimate_game": false, "select_ultimate_game": false, "gem_type": 1, "golds": [{ "gold_type": 0, "win_amount": 3000, "jackpot_type": 0, "multiplier": 3 }] } }
POST /lucky-draw & /quick-lucky-draw
POST /api/v1/lucky-draw
{ "position": 4 }
Field Ý nghĩa
cardcard_type, win_amount, multiplier, jackpot_type, position
finished + flagsNhư MG khác. Quick trả cards[] (lật hết)
{ "code": 0, "msg": { "bet": 1000, "user_money": 427000, "win_amount": 2000, "finished": false, "is_ultimate_game": false, "select_ultimate_game": false, "gem_type": -1, "card": { "card_type": 1, "win_amount": 2000, "multiplier": 2, "jackpot_type": 0, "position": 4 } } }
POST /api/v1/quick-lucky-draw
{ "code": 0, "msg": { "bet": 1000, "user_money": 440000, "win_amount": 15000, "is_ultimate_game": false, "select_ultimate_game": true, "gem_type": 3, "cards": [{ "card_type": 2, "win_amount": 5000, "multiplier": 5, "jackpot_type": 0, "position": 0 }] } }
POST /rapid-pay & /quick-rapid-pay
POST /api/v1/rapid-pay
{ "position": 1 }
Field Ý nghĩa
rowitems[], item chọn, multiplier, position
finished / multiplier + flagsQuick trả rows[]
{ "code": 0, "msg": { "bet": 1000, "user_money": 426000, "win_amount": 1000, "multiplier": 1, "finished": false, "is_ultimate_game": false, "select_ultimate_game": false, "gem_type": -1, "row": { "items": [0,1,2], "item": 1, "multiplier": 1, "position": 1 } } }
POST /api/v1/quick-rapid-pay
{ "code": 0, "msg": { "bet": 1000, "user_money": 450000, "win_amount": 25000, "multiplier": 25, "is_ultimate_game": false, "select_ultimate_game": false, "gem_type": 2, "rows": [{ "items": [0,1,2], "item": 2, "multiplier": 5, "position": 2 }] } }
12. POST /api/v1/done
POST /api/v1/done
Bắt buộc khi hết MG / trước spin base tiếp theo. msg = null. Flush jackpot notify dở.
{ "code": 0, "msg": null }
13. Cheat (chỉ non-prod / cheater)
{ "bet": 1000, "reels": [[10,5,2],[10,9,6],[10,5,3],[4,7,8],[1,5,0]] }
5×3. Production bỏ qua.
14. Error & tiền
Tình huống Hành vi
HTTP 401 Relogin
code 69 GET /gameplay, đừng spin khi state ≠ 0
code 1000 Popup buy-gem
HTTP 400 blocked User đang PvP
Base: −bet + line win ngay. MG: cộng khi pick/finish. Chip wheel 4–7 credit trên /spins-scatter.
15. Checklist client
Domain Si Xiang. GET /gameplay trước. Restore game_state + snapshot.
Không /spins giữa MG. Hết MG → /done rồi mới spin.
is_bonus → /spins-scatter. Đủ 4 gem → select-ultimate-game.
Gem picker 4 ô. Không song song request / user.
Si Xiang · tài liệu client · chỉ hiện trên server không phải production