跳至主要内容

訊息格式

通知類型

說明

  • 隨者遊戲進行,會發生不同事件。每個事件發生時,都有一個對應的通知類型(GameNotifyType),以及一個事件訊息,該訊息總共有四種訊息格式:GameProvide, ShiftRecord, ShoeRecord, RoundRecord

列表

GameNotifyTypebody訊息格式觸發時間
NOTIFY_GAME_PROVIDE_STATE_CHANGEGameProvide遊戲供應狀況改變時通知
NOTIFY_GAME_DEALER_LOGINGameProvide遊戲流程荷官登入時通知
NOTIFY_GAME_DEALER_LOGOUTGameProvide遊戲流程荷官登出時通知
NOTIFY_GAME_CHANGING_SHOEGameProvide遊戲流程開始換靴時通知
NOTIFY_SHIFT_STARTShiftRecord新班次開始時通知
NOTIFY_SHIFT_ENDShiftRecord此班次結束時通知
NOTIFY_SHOE_STARTShoeRecord新靴開始時通知
NOTIFY_SHOE_ENDShoeRecord此靴結束時通知
NOTIFY_ROUND_STARTRoundRecord新局開始時通知
NOTIFY_ROUND_BETRoundRecord遊戲局開始下注時通知
NOTIFY_ROUND_NO_MORE_BETRoundRecord遊戲局結束下注時通知
NOTIFY_ROUND_STEPRoundRecord遊戲局進行步驟時通知
NOTIFY_ROUND_FINISHRoundRecord遊戲局完成時通知
NOTIFY_ROUND_CANCELRoundRecord遊戲局取消時通知
NOTIFY_ROUND_PLAYBACKRoundRecord遊戲局建立完回放時通知

GameProvide

  • proto Github

  • 記錄遊戲當下供應狀態、荷官、直播資訊等

欄位類型說明
supplierstring遊戲供應
game_typestring遊戲類型
game_subtypestring遊戲子類型
game_codestring遊戲代碼
tagsmap<string, string>標籤
stateGameProvideState狀態
playersmap<int32, string>玩家入座
players_namemap<string, string>玩家姓名
mediasmap<string, string>附加媒體:key: 媒體資源代碼;value: 媒體內容。
live_streamsmap<string, LiveStreamParams>直播參數
last_round_codestring最後一局

GameProvideState

遊戲供應狀態類型

代碼說明
0GAME_PROVIDE_STATE_UNSPECIFIED未指定
1GAME_PROVIDE_AVAILABLE提供
2GAME_PROVIDE_MAINTEN_AFTER_ROUND此局結束後維護
3GAME_PROVIDE_IN_MAINTENANCE維護
4GAME_PROVIDE_CLOSE_AFTER_ROUND此局結束後關閉
5GAME_PROVIDE_CLOSE此局結束後關閉
6GAME_PROVIDE_AVAILABLE_AFTER_ROUND此局結束後關閉

LiveStreamParams

直播資訊,組成直播網址時需要

欄位類型說明
codestring串流代碼
appstring應用
channelstring頻道

ShiftRecord

排班記錄

欄位類型說明
idbytes紀錄ID
supplierstring遊戲供應
game_typestring遊戲類型
game_subtypestring遊戲子類型
game_versionstring遊戲版本
game_codestring遊戲代碼
table_codestring桌代碼
shift_codestring班代碼
ts_startgoogle.protobuf.Timestamp開始時間
tagsmap<string, string>標籤
round_codesrepeated string執行遊戲局
shoe_codesrepeated string洗牌
is_endbool結束
ts_endgoogle.protobuf.Timestamp結束時間
testbool是否測試

ShoeRecord

靴紀錄

欄位類型說明
idbytes紀錄ID
supplierstring遊戲供應
game_typestring遊戲類型
game_subtypestring遊戲子類型
game_versionstring遊戲版本
game_codestring遊戲代碼
table_codestring桌代碼
shift_codestring班代碼
shoe_codestring使用洗牌代碼
ts_startgoogle.protobuf.Timestamp此牌靴開始使用時間
decksmap<int32, Deck>cardList
is_endbool此牌靴已使用完畢,不可再使用
ts_endgoogle.protobuf.Timestamp牌靴使用完畢時間
testbool是否測試

Deck

一副牌

欄位類型說明
cardsCardList卡牌
start_indexint64起始位置(削牌後)
cut_indexint64切牌位置
indexint64目前位置

RoundRecord

局紀錄

欄位類型說明
idbytes紀錄ID
supplierstring遊戲供應
game_typestring遊戲類型
game_subtypestring遊戲子類型
game_versionstring遊戲版本
game_codestring遊戲代碼
table_codestring桌代碼
shift_codestring班代碼
shift_roundint64此排班局數
shoe_codestring使用靴代碼
shoe_roundint64使用此洗牌第幾局,從1開始計算
round_codestring局代碼
tagsmap<string, string>標籤
ts_startgoogle.protobuf.Timestamp開始時間
bet_stepBetStep下注狀態
seatsmap<int32, Seat>座位組
playersmap<int32, string>玩家入座
players_namemap<string, string>玩家姓名
processrepeated Step歷程
is_endbool結束
ts_endgoogle.protobuf.Timestamp結束時間
cancelbool取消
cancel_codestring取消代碼:CancelReasonCode
cancel_messagestring取消備註
win_typemap<int32, games.WinType>贏方
mediasmap<string, string>附加媒體:key: 媒體資源代碼;value: 媒體內容。
fortune_ratesmap<string, int64>財神倍率
testbool是否測試

BetStep

下注步驟

代碼說明
0BET_STEP_UNSPECIFIED未指定,此步驟與下注無關
1ROUND_BET開始下注
3NO_MORE_BET停止下注
4CARD牌異動

Seat

座位

欄位類型說明
codeint32座位功能代碼:SeatCode
cardsmap<int32, CardList>各類手牌

Step

遊戲步驟

欄位類型說明
codeint32步驟代碼:StepCode
seatint32玩家、執行者:SeatCode
timestampgoogle.protobuf.Timestamp時間戳
actionsrepeated StepAction執行動作
errorstring執行錯誤
cancelbool取消
durationint64分配毫秒數
bet_stepBetStep下注動作

StepAction

執行動作:對某些資源進行增、刪、移轉

欄位類型說明
codestring行為說明代碼
typeStepActionType動作類型
source_seatint32資源擁有座位。
target_seatint32資源轉移目標座位。
cardsmap<int32, CardList>目標卡牌資源
datagoogle.protobuf.Any(可選)附加資料

StepActionType

動作類型

代碼說明
0STEP_ACTION_TYPE_UNSPECIFIED未指定
1ADD派發資源
2SET設定指定資源
3SETALL改寫全部資源
4REMOVE將資源從場上移除
5READ讀取卡牌資料
6READ_UNVISIBLE讀卡但不可見
7TRANSFER移轉資源
8VISIBLE卡片正反面
9STATUS卡牌狀態改變
10NONE此步驟不須修改資源
11WIN決定輸贏

CardList

卡牌列表

欄位類型說明
card_typestring
listrepeated Card列表
patternint32牌型

Card

卡牌,代表在此局中使用的各類物品

欄位類型說明
idstring卡牌ID:牌唯一碼
codestring卡牌代碼
indexint64順序
visiblebool可見
statusint64橫放、直放...
plain_textstring明文
signaturestring簽章
sign_algorithmstring簽章方法