---
# System prepended metadata

title: 哈希色碟

---

# 哈希色碟

定義表
---

下注, 輸贏, 籌碼限額 ...

```
  [雙, 單, 4紅, 4白, 1白3紅, 1紅三白]
```
  
  
## client -> server

为cli端请求srv端的cmd, 透过 cbId 做消息配对, 响应后c端先判断 err 字段是否为空作例外处理.

RoomStatus
---
请求参数:

    {
      "svr": "xocdia",              // <string> 游戏名
      "route": "xocdia.roomStatus", // <string> 游戏名.的cmd
      "args": null,                 // <any>
      "cbId": 3
    }
    
<table>
<thead class="ant-table-thead">
<tr>
  <th key="name" style="width: 500px">名称</th>
  <th key="type">类型</th>
  <th key="required">是否必须</th>
  <th key="default">默认值</th>
  <th key="desc">备注</th>
  <th key="sub">其他信息</th>
</tr>
</thead>
<tbody className="ant-table-tbody">
<tr key="0-0">
  <td key="0">
    <span style="padding-left: 0px"
      ><span style="color: #8c8a8a"></span> svr</span
    >
  </td>
  <td key="1"><span>string</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap"></span></td>
  <td key="5"></td>
</tr>
<tr key="0-1">
  <td key="0">
    <span style="padding-left: 0px"
      ><span style="color: #8c8a8a"></span> route</span
    >
  </td>
  <td key="1"><span>string</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap"></span></td>
  <td key="5"></td>
</tr>
<tr key="0-2">
  <td key="0">
    <span style="padding-left: 0px"
      ><span style="color: #8c8a8a"></span> cbId</span
    >
  </td>
  <td key="1"><span>number</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap"></span></td>
  <td key="5"></td>
</tr>
<tr key="0-3">
  <td key="0">
    <span style="padding-left: 0px"
      ><span style="color: #8c8a8a"></span> args</span
    >
  </td>
  <td key="1"><span>object</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap"></span></td>
  <td key="5"></td>
</tr>
<tr key="0-3-0">
  <td key="0">
    <span style="padding-left: 20px"
      ><span style="color: #8c8a8a">├-</span> 1</span
    >
  </td>
  <td key="1"><span>object</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap"></span></td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-0">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> id</span
    >
  </td>
  <td key="1"><span>number</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap"></span></td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-1">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> name</span
    >
  </td>
  <td key="1"><span>string</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap">房间标题</span></td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-2">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> gametype_name</span
    >
  </td>
  <td key="1"><span>string</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap">游戏代号</span></td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-3">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> from_wallet</span
    >
  </td>
  <td key="1"><span>string</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap">钱包 from</span></td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-4">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> to_wallet</span
    >
  </td>
  <td key="1"><span>string</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap">钱包 to</span></td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-5">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> bet_level</span
    >
  </td>
  <td key="1"><span>number []</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap">筹码 下注阵列</span></td>
  <td key="5">
    <p key="3">
      <span style="font-weight: '700'">item 类型: </span><span>number</span>
    </p>
  </td>
</tr>
<tr key="array-1">
  <td key="0">
    <span style="padding-left: 60px"
      ><span style="color: #8c8a8a">├─</span>
    </span>
  </td>
  <td key="1"><span></span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4">
    <span style="white-space: pre-wrap">筹码 比值 1: 10000</span>
  </td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-6">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> player_bet_upper_limit</span
    >
  </td>
  <td key="1"><span>number []</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4">
    <span style="white-space: pre-wrap">个人上限 比值 1: 10000</span>
  </td>
  <td key="5">
    <p key="3">
      <span style="font-weight: '700'">item 类型: </span><span>number</span>
    </p>
  </td>
</tr>
<tr key="array-2">
  <td key="0">
    <span style="padding-left: 60px"
      ><span style="color: #8c8a8a">├─</span>
    </span>
  </td>
  <td key="1"><span></span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4">
    <span style="white-space: pre-wrap"
      >[雙, 單, 4紅, 4白, 1白3紅, 1紅三白] 比值 1: 10000</span
    >
  </td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-7">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> player_bet_lower_limit</span
    >
  </td>
  <td key="1"><span>number []</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4">
    <span style="white-space: pre-wrap">个人下限 比值 1: 10000</span>
  </td>
  <td key="5">
    <p key="3">
      <span style="font-weight: '700'">item 类型: </span><span>number</span>
    </p>
  </td>
</tr>
<tr key="array-3">
  <td key="0">
    <span style="padding-left: 60px"
      ><span style="color: #8c8a8a">├─</span>
    </span>
  </td>
  <td key="1"><span></span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4">
    <span style="white-space: pre-wrap"
      >[雙, 單, 4紅, 4白, 1白3紅, 1紅三白] 比值 1: 10000</span
    >
  </td>
  <td key="5"></td>
</tr>
<tr key="0-3-0-8">
  <td key="0">
    <span style="padding-left: 40px"
      ><span style="color: #8c8a8a">├─</span> area_bet_upper_limit</span
    >
  </td>
  <td key="1"><span>number []</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4">
    <span style="white-space: pre-wrap">单区上限 比值 1: 10000</span>
  </td>
  <td key="5">
    <p key="3">
      <span style="font-weight: '700'">item 类型: </span><span>number</span>
    </p>
  </td>
</tr>
<tr key="array-4">
  <td key="0">
    <span style="padding-left: 60px"
      ><span style="color: #8c8a8a">├─</span>
    </span>
  </td>
  <td key="1"><span></span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4">
    <span style="white-space: pre-wrap"
      >[雙, 單, 4紅, 4白, 1白3紅, 1紅三白] 比值 1: 10000</span
    >
  </td>
  <td key="5"></td>
</tr>
<tr key="0-4">
  <td key="0">
    <span style="padding-left: 0px"
      ><span style="color: #8c8a8a"></span> err</span
    >
  </td>
  <td key="1"><span>string</span></td>
  <td key="2">必须</td>
  <td key="3"></td>
  <td key="4"><span style="white-space: pre-wrap">错误提示</span></td>
  <td key="5"></td>
</tr>
</tbody>
</table>

```
{
  "svr": "",
  "route": "",
  "cbId": 3,
  "args": {
    "23": {
      "id": 23,
      "name": "X123",
      "gametype_name": "哈希色碟",
      "from_wallet": "TCTfPcF1wTRDK1qFAb7w2zGjF11WE9v8DA",
      "to_wallet": "TRCJhQw5u4F3wZ1PkY199p3jm2XN4WjKYR",
      "bet_level": [
        10000000,
        50000000,
        100000000,
        200000000,
        500000000,
        1000000000
      ],
      "player_bet_upper_limit": [
        1000000000,
        1000000000,
        1000000000,
        1000000000,
        1000000000,
        1000000000
      ],
      "player_bet_lower_limit": [
        10000000,
        10000000,
        10000000,
        10000000,
        10000000,
        10000000
      ],
      "area_bet_upper_limit": [
        100000000000,
        100000000000,
        100000000000,
        100000000000,
        100000000000,
        100000000000
      ],
      "tmp_bet_balance_limit": 10000000000
    }
  },
  "err": null
}
```


JoinGame
---
    
请求参数:
 ```
{
  "svr": "xocdia",
  "route": "xocdia.joinGame",
  "args": {
  "room_id":23
      },
  "cbId": 3
    }
```
返回数据:
```
{
  "svr": "",
  "route": "",
  "cbId": 3,
  "args": {
    "info": {
      "id": 23,
      "name": "X123",
      "gametype_name": "哈希色碟",
      "from_wallet": "TCTfPcF1wTRDK1qFAb7w2zGjF11WE9v8DA",
      "to_wallet": "TRCJhQw5u4F3wZ1PkY199p3jm2XN4WjKYR",
      "bet_level": [
        10000000,
        50000000,
        100000000,
        200000000,
        500000000,
        1000000000
      ],
      "player_bet_upper_limit": [
        1000000000,
        1000000000,
        1000000000,
        1000000000,
        1000000000,
        1000000000
      ],
      "player_bet_lower_limit": [
        10000000,
        10000000,
        10000000,
        10000000,
        10000000,
        10000000
      ],
      "area_bet_upper_limit": [
        100000000000,
        100000000000,
        100000000000,
        100000000000,
        100000000000,
        100000000000
      ],
      "tmp_bet_balance_limit": 10000000000
    },
    "self": {
      "id": 9896316,
      "nickname": "666666"
    },
    "player_count": 2,
    "history": {
      "history": [
        {
          "code": [  原始哈希末四碼
            "f",
            "0",
            "a",
            "7"
          ],
          "Color": [ 哈希轉顏色1白2紅 EX:[1,1,2,1] 白 白 紅 白
            2,
            1,
            2,
            1
          ],
          "win_area": [
            1,        雙
            -1,       單
            -1,       4紅
            -1,       4白
            -1,       1白3紅
            -1        1紅3白
          ],
          "OddEven": 0
        },
       
      ],
      "win_ratio": [
        52,      雙   雙單為選桌廳館使用
        48,      單
        6,       4紅  [4紅 4白 1白3紅 1紅3白] 桌內使用
        4,       4白
        13,      1白3紅
        15       1紅3白
      ],
      "good_road": 0,     const: 0, 1, 2, 3, 4,
      "good_road_name": "沒有" "沒有""雙跳" "單跳" "4連單" "4連雙"
    },
    "room_chips": [
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "bets": [
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "room_remain_chips": [
      100000000000,
      100000000000,
      100000000000,
      100000000000,
      100000000000,
      100000000000
    ],
    "round_uuid": "BXDX1232210190020",
    "bet_ratio": [
      55,    雙
      45     單
    ]
  },
  "err": null
}
```

Leave
---

请求参数:
```
   {
      "svr": "xocdia",
      "route": "xocdia.leave",
      "args": {},
      "cbId": 3
    }
```

返回数据:

```
  {
      "svr": "",
      "route": "",
      "cbId": 3,
      "args": "成功啦",      
      "err": ""
    }
```

Bet
---

请求参数:

```
 {
  "svr": "football",
  "route": "football.bet",
  "args": {
      "bets":[0,10000000,0,0,0,10000000], //雙,單,4紅,4白,1白3紅,1紅三白,
      "room_id":23
  },
  "cbId": 3
}
```
返回数据:
```
{
  "svr": "",
  "route": "",
  "cbId": 3,
  "args": {
    "room_id": 23,
    "room_chips": [
      10000000,
      10000000,
      0,
      0,
      0,
      20000000
    ],
    "room_remain_chips": [
      100000000000,
      100000000000,
      100000000000,
      100000000000,
      100000000000,
      99980000000
    ],
    "my_bets": [
      0,
      10000000,
      0,
      0,
      0,
      10000000
    ],
    "before_balance": 100530000000,
    "after_balance": 100510000000,
    "bet_ratio": [
      50,
      50
    ]
  },
  "err": null
}
```

server -> client
--

RestStage
---
推送时间: 休息阶段开始
route:"xocdia.restStage"

```
{
  "svr": "",
  "route": "xocdia.restStage",
  "cbId": 0,
  "args": {
    "cd": 5,
    "cd_max": 5,
    "msg": "等待開局",
    "round_uuid": "BXDX1232210190039"
  },
  "err": ""
}
```

RestStageMid
---

推送时间: 中途加入休息阶段
route:"xocdia.restStageMid"

```
  {
      "svr": "",
      "route": "xocdia.restStageMid",
      "cbId": 0,
      "args": {
        "cd": 2,
        "cd_max": 5,
        "msg": "等待開局"
      },
      "err": ""
    }
```
BetStage
---

推送时间: 下注阶段开始
route:"xocdia.restStage"

```
  {
  "svr": "",
  "route": "xocdia.betStage",
  "cbId": 0,
  "args": {
    "cd": 25,
    "cd_max": 25,
    "msg": "開始下注"
  },
  "err": ""
}
```

BetStageMid
---

推送时间: 中途加入下注阶段
route:"xocdia.restStageMid"

```
{
  "svr": "",
  "route": "xocdia.betStageMid",
  "cbId": 0,
  "args": {
    "cd": 10,
    "cd_max": 25,
    "msg": "開放下注"
  },
  "err": ""
}
```
HashStage
---

推送时间: 開始取得哈希
route:"xocdia.restStage"

    {
      "svr": "",
      "route": "xocdia.hashStage",
      "cbId": 0,
      "args": {
        "cd": 30,
        "cd_max": 30,
        "msg": "等待哈希值"
      },
      "err": ""
    }
    
HashStageMid
---

推送时间: 中途加入取哈希阶段
route:"xocdia.restStageMid"

```
    {
      "svr": "",
      "route": "xocdia.hashStageMid",
      "cbId": 0,
      "args": {
        "cd": 6,
        "cd_max": 30,
        "msg": "等待哈希值"
      },
      "err": ""
    }
```
SettleStage
---
```
返回數據:
{
  "svr": "",
  "route": "xocdia.settleStage",
  "cbId": 0,
  "args": {
    "cd": 23,
    "cd_max": 23,
    "msg": "結算階段",
    "block_hash": "0000000001b1a4816b66cf135eab40f292471a501a41883572f60db0a3652b6c",
    "block_number": 28419201,
    "block_tx_id": "b885dff3d54b7908b20ca7bfecb8af801c88a8258b6c83e134686b4670f458f5",
    "code": [
      "2",
      "b",
      "6",
      "c"
    ],
    "color": [
      1,
      2,
      1,
      2
    ],
    "win_area": [
      1,
      -1,
      -1,
      -1,
      -1,
      -1
    ],
    "win_ratio": [
      53,
      47,
      4,
      6,
      12,
      15
    ]
  },
  "err": null
}
```

SettleStageMid
---

推送时间: 中途加入結算階段

返回數據:

```
{
  "svr": "",
  "route": "xocdia.settleStageMid",
  "cbId": 0,
  "args": {
    "cd": 7,
    "cd_max": 23,
    "msg": "结算完成",
    "block_hash": "0000000001b1a6d8eb0d541c434bbca071e26f00095ea7b0f9b33967dc72a29b",
    "block_number": 28419800,
    "block_tx_id": "5d69df12a6760ab616c8986c267af4ad62b3ae1c8ddbe4b9a2418cd4dd61cfab",
    "code": [
      "a",
      "2",
      "9",
      "b"
    ],
    "color": [
      2,
      1,
      2,
      2
    ],
    "win_area": [
      -1,
      1,
      -1,
      -1,
      -1,
      1
    ],
    "win_ratio": [
      53,
      47,
      4,
      6,
      14,
      14
    ]
  },
  "err": null
}
```

RoomPlayerCounter
---

推送时间: 每n秒同步給房內玩家
route: "football.roomPlayerCounter"

```
{
   "svr": "",
   "route": "xocdia.roomPlayerCounter",
   "cbId": 0,
   "args": 1,                           // 人數
   "err": ""
    }
```

ChangeStage
---

推送时间: 加入观察者后, 每局切换都以这个做路子
route: "football.changeStage"

返回數據:    

```
{
  "svr": "",
  "route": "xocdia.changeStage",
  "cbId": 0,
  "args": {
    "id": 23,
    "stage": 1,
    "stage_name": "下注階段",
    "cd": 11,
    "cd_max": 20,
    "history": {
      "history": [
        {
          "code": [
            "3",
            "3",
            "3",
            "e"
          ],
          "Color": [
            1,
            1,
            1,
            2
          ],
          "win_area": [
            -1,
            1,
            -1,
            -1,
            1,
            -1
          ],
          "OddEven": 0
        },
        {
          "code": [
            "a",
            "a",
            "1",
            "0"
          ],
          "Color": [
            2,
            2,
            1,
            1
          ],
          "win_area": [
            1,
            -1,
            -1,
            -1,
            -1,
            -1
          ],
          "OddEven": 0
        },
         "win_ratio": [
        56,
        44,
        3,
        4,
        17,
        10
      ],
      "good_road": 0,
      "good_road_name": "沒有"
    },
    "player_count": 1,
    "bets": [
      0,
      0,
      0,
      0,
      0,
      0
    ]
  },
  "err": null
}
```
SettleReport
---

返回數據:
```
{"svr":"",
"route":"xocdia.settleReport",
"cbId":0,
"args":{
"id":"BXDX1232210190118-07902186",
"round_uuid":"BXDX1232210190118",
"game_type":21,
"game_code":"BXD",
"game_name":"哈希色碟",
"room_id":23,
"round":118,
"sub_round":0,
"player_id":7902186,
"dealer_id":0,
"total_bet":50000000,
"you_xiao_tou_zhu":50000000,
"you_xiao_ying_fen":0,
"total_winlose":-50000000,
"bets":[
   0,
   50000000,
   0,
   0,
   0,
   0
],
"total_real_bet":0,
"prepay":0,
"winloses":[
   0,
  -50000000,
   0,
   0,
   0,
   0 
  ],
"date":""
,"created_at":"2022-10-19T15:03:07.90767289+08:00",
"type":1,
"status":1,
"currency":"TWD"},
"err":null
}
```