NON-PRODUCTION
Journey West — tài liệu ghép client
Payline 5×3 Tây Du Ký (Tề Thiên Đại Thánh). Ngọc hành trình mở Dragon Pearl, Gold Pick, Lucky Draw, Rapid Pay và Ultimate. Client gọi domain Journey West — không trộn session với 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 (cây gậy / kinh thư) → bánh xe thưởng
Symbols 0–4 small (đồ đệ / yêu) · 5–8 big (Đường Tăng, Bát Giới, Sa Tăng, Bạch Long) · 9 WILD (Tề Thiên) · 10 Scatter
game_state 0 spins · 1 bonus · 2 dragon_pearl · 3 lucky_draw · 4 gold_pick · 5 rapid_pay · 6 ultimate_select
Gem / relic 0 Kim Cô (Pearl) · 1 Cân Đẩu Vân (Gold) · 2 Như Ý (Rapid) · 3 Hồ Lô (Draw). Đủ 4 → Ultimate (Như Lai)
Jackpot Cố định × bet: minor/major/mega/grand. 5 cột wild = Grand
Base path /api/v1 trên domain Journey West
Không spin khi đang minigame. Hết MG phải POST /done rồi mới POST /spins. Thiếu GET /gameplay → code 69.
2. Luồng ghép
Vào Tây Du → GET /gameplay. Restore theo game_state + snapshot MG (nếu đang dở hành trình).
Base: POST /spins. Highlight payline. is_bonus → POST /spins-scatter (bánh xe Phật).
Wheel: MG → đúng endpoint; thưởng chip (type 4–7) credit rồi về spins.
Lặp MG tới finish. select_ultimate_game → chọn rồi POST /select-ultimate-game.
Mua relic: POST /buy-gem. 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 & hàng relic
5×3. Ô xanh = WILD Tề Thiên, vàng = scatter. Hàng dưới: 4 relic hành trình.
Giá mua relic = bet × gem_price_multipliers[số relic đã có]. gems bool[4] theo thứ tự 0–3 ở bảng tổng quan.
5. GET /api/v1/gameplay
GET /api/v1/gameplay
Field Ý nghĩa
init_reelsPreview 5×3 idle
jackpot_minor/major/mega/grandHệ số × bet để vẽ meter
pay_table / bets / show_bets / bet / user_moneyPay & chip
game_statePhase 0–6
ultimate_game_multiplierHệ số Như Lai (Ultimate)
gem_list[{bet,gems,price}]Relic theo mức cược
gem_price_multipliersHệ số giá theo số relic đang giữ
dragon_pearl / gold_pick / rapid_pay / lucky_drawSnapshot resume (omitempty)
{
"code": 0,
"msg": {
"init_reels": [[2,0,4],[7,9,5],[10,8,1],[3,10,6],[0,4,10]],
"jackpot_minor": 10, "jackpot_major": 20, "jackpot_mega": 30, "jackpot_grand": 100,
"pay_table": [[0.8,2,4],[1,2.5,6],[1.2,3,8],[1.5,4,10],[2,5,12],[3,8,18],[4,12,25],[6,15,35],[10,25,60]],
"bets": [500,2000,5000], "show_bets": [500,2000,5000], "bet": 2000, "user_money": 960000,
"game_state": 0, "ultimate_game_multiplier": 5, "gem_price_multipliers": [40,70,110,180],
"gem_list": [{ "bet": 2000, "gems": [false,true,false,false], "price": 140000 }]
}
}
6. GET /api/v1/gems
GET /api/v1/gems
Danh sách relic. Nếu rỗng, dùng gem_list từ /gameplay (cùng shape).
Field Ý nghĩa
bet / gems[4] / priceMức cược; 4 relic; giá mua viên kế
{ "code": 0, "msg": [{ "bet": 500, "gems": [true,true,false,false], "price": 55000 }, { "bet": 2000, "gems": [false,true,false,false], "price": 140000 }] }
7. POST /api/v1/spins
POST /api/v1/spins
{ "bet": 2000 }
Chỉ khi game_state = 0. Trừ bet, credit line win ngay. 5 cột wild → Grand.
Field Ý nghĩa
user_money / win_amount / betChip sau giao dịch
is_grand_jackpotFanfare Grand (5 wild)
is_bonus3 scatter col → /spins-scatter, khóa spin
win_lines[]win_amount, line, line_number, symbol, number_of_symbols
reelsBoard 5×3
{
"code": 0,
"msg": {
"user_money": 972000, "win_amount": 14000, "bet": 2000,
"is_grand_jackpot": false, "is_bonus": true,
"win_lines": [{ "win_amount": 14000, "line": [0,0,0,0,0], "line_number": 1, "symbol": 8, "number_of_symbols": 4 }],
"reels": [[8,2,4],[8,9,5],[10,8,1],[8,10,6],[0,4,10]]
}
}
8. POST /api/v1/spins-scatter
POST /api/v1/spins-scatter
Bánh xe: reward_type 0 Pearl · 1 Draw · 2 Gold · 3 Rapid · 4–7 chip 3×/6×/10×/15× bet.
Field Ý nghĩa
mini_game_typePhase sau wheel (2–5 MG, 0 nếu chip)
reward_type0–7
user_money / win_amount / betChip nếu trúng chip
snapshots Một trong dragon_pearl / gold_pick / rapid_pay / lucky_draw
{
"code": 0,
"msg": {
"mini_game_type": 5, "reward_type": 3, "user_money": 972000, "win_amount": 0, "bet": 2000,
"rapid_pay": { "win_amount": 0, "is_ultimate_game": false, "multiplier": 1, "rows": [] }
}
}
9. POST /api/v1/buy-gem
POST /api/v1/buy-gem
{ "bet": 2000, "gem_type": 1 }
Field Ý nghĩa
price / bet / user_moneyĐã trừ giá relic
gem_type / mini_game_typeRelic mua / MG mở
snapshots MG info tương ứng
{ "code": 0, "msg": { "price": 140000, "bet": 2000, "user_money": 832000, "gem_type": 1, "mini_game_type": 4, "gold_pick": { "win_amount": 0, "is_ultimate_game": false, "number_of_picks": 4, "golds": [] } } }
10. POST /api/v1/select-ultimate-game
POST /api/v1/select-ultimate-game
{ "mini_game_type": 5 }
Chọn 2 Pearl · 3 Draw · 4 Gold · 5 Rapid. Nhân ultimate_game_multiplier.
Field Ý nghĩa
mini_game_type / multiplier / betMG + hệ số Như Lai
snapshots Board ultimate vừa mở
{ "code": 0, "msg": { "mini_game_type": 2, "multiplier": 5, "bet": 2000, "dragon_pearl": { "win_amount": 0, "is_ultimate_game": true, "pearls": [], "spins": 5 } } }
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 / còn / +spin
flags select_ultimate_game, is_ultimate_game, grand_jackpot, gem_type
{ "code": 0, "msg": { "bet": 2000, "user_money": 988000, "finished": true, "win_amount": 16000, "gem_type": 0, "select_ultimate_game": false, "is_ultimate_game": false, "grand_jackpot": false, "bonus_spins": 1, "spins": 0, "pearls": [{ "row": 1, "col": 2, "pearl_type": 2, "lucky_money_type": 1, "jackpot_type": 0, "multiplier": 8, "win_amount": 16000, "is_bonus_spin": true, "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
{ "code": 0, "msg": { "bet": 2000, "user_money": 844000, "win_amount": 12000, "is_ultimate_game": false, "select_ultimate_game": false, "gem_type": 1, "golds": [{ "gold_type": 2, "win_amount": 8000, "jackpot_type": 2, "multiplier": 4 }, { "gold_type": 0, "win_amount": 4000, "jackpot_type": 0, "multiplier": 2 }] } }
POST /lucky-draw & /quick-lucky-draw
POST /api/v1/lucky-draw
{ "position": 11 }
Field Ý nghĩa
cardcard_type, win_amount, multiplier, jackpot_type, position
finished + flagsQuick trả cards[]
{ "code": 0, "msg": { "bet": 2000, "user_money": 976000, "win_amount": 4000, "finished": false, "is_ultimate_game": false, "select_ultimate_game": false, "gem_type": -1, "card": { "card_type": 0, "win_amount": 4000, "multiplier": 2, "jackpot_type": 0, "position": 11 } } }
POST /api/v1/quick-lucky-draw
{ "code": 0, "msg": { "bet": 2000, "user_money": 1010000, "win_amount": 38000, "is_ultimate_game": false, "select_ultimate_game": true, "gem_type": 3, "cards": [{ "card_type": 3, "win_amount": 20000, "multiplier": 10, "jackpot_type": 1, "position": 7 }] } }
POST /rapid-pay & /quick-rapid-pay
POST /api/v1/rapid-pay
{ "position": 0 }
Field Ý nghĩa
rowitems[], item, multiplier, position — một tầng tháp
finished / multiplierQuick trả rows[]
{ "code": 0, "msg": { "bet": 2000, "user_money": 974000, "win_amount": 2000, "multiplier": 1, "finished": false, "is_ultimate_game": false, "select_ultimate_game": false, "gem_type": -1, "row": { "items": [1,0,2], "item": 0, "multiplier": 1, "position": 0 } } }
POST /api/v1/quick-rapid-pay
{ "code": 0, "msg": { "bet": 2000, "user_money": 1048000, "win_amount": 76000, "multiplier": 38, "is_ultimate_game": true, "select_ultimate_game": false, "gem_type": 2, "rows": [{ "items": [2,1,0], "item": 2, "multiplier": 8, "position": 0 }] } }
12. POST /api/v1/done
POST /api/v1/done
Bắt buộc để về base trước spin tiếp. msg = null. Flush jackpot notify còn treo.
{ "code": 0, "msg": null }
13. Cheat (chỉ non-prod / cheater)
{ "bet": 2000, "reels": [[9,9,9],[9,8,5],[10,9,1],[9,10,6],[9,4,0]] }
5×3 trên domain Journey West. Production bỏ qua reels.
14. Error & tiền
Tình huống Hành vi
HTTP 401 Relogin
code 69 GET /gameplay; khô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 bánh xe 4–7 credit trên /spins-scatter.
15. Checklist client
Gọi đúng host Journey West. 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 relic → select-ultimate-game.
Hàng relic 4 ô (Kim Cô / Cân Đẩu Vân / Như Ý / Hồ Lô). Không song song request / user.
Journey West · Tây Du Ký · tài liệu client · chỉ hiện trên server không phải production