包含所有线上运行的改动: - 荷官端倒计时卡顿修复(CountdownService TTL+10/前端watchdog) - 停止下注debounce防重复(8个handle.js) - 洗码量规则重写(单边/双边/开和不计/百家乐+龙虎) - 龙虎和局不杀庄闲(全额退回) - 日志系统(Logger工具类/日志查看/清理脚本) - 好路提醒异常处理(WaybillRemindService try-catch) - 扫牌器连接改进(ScanConnectService) - 牛牛/三卡开牌修复 - .gitignore更新/.DS_Store清理
54 lines
2.0 KiB
PHP
54 lines
2.0 KiB
PHP
<?php
|
|
|
|
|
|
namespace app\services\process;
|
|
|
|
|
|
use app\models\process\NumberTab;
|
|
use app\services\connect\InitTableService;
|
|
use app\utils\Logger;
|
|
use freedom\utils\SocketSession;
|
|
|
|
/**
|
|
* TODO 开始倒计时
|
|
* Class StartBetService
|
|
* @package app\services\process
|
|
*/
|
|
class StartBetService
|
|
{
|
|
/**
|
|
* TODO 处理开始倒计时
|
|
* @param int $numberTabId
|
|
* @param array $tableInfo
|
|
* @return void
|
|
*/
|
|
public static function startBet(int $numberTabId, array $tableInfo){
|
|
$ws = app('\think\swoole\WebSocket');
|
|
$modelRes = NumberTab::startBet($numberTabId);
|
|
if ($modelRes['status'] == true){
|
|
$numberTabInfo = $modelRes['data'];
|
|
$responseData = [
|
|
'status' => true,
|
|
'table_id' => $tableInfo['id'],
|
|
'round' => [
|
|
'boot_id' => $numberTabInfo['boot_id'],
|
|
'boot_num' => $numberTabInfo['boot_num'],
|
|
'number_tab_id' => $numberTabInfo['id'],
|
|
'number_tab_number' => $numberTabInfo['number'],
|
|
'in_checkout' => $tableInfo['in_checkout'],
|
|
'number_tab_status' => InitTableService::numberTabStatus($numberTabInfo)
|
|
]
|
|
];
|
|
// 广播到 house 房间
|
|
$ws->to(SocketSession::HOUSE_NAME)->emit('startBet', $responseData);
|
|
// 同时发送给请求者
|
|
$ws->emit('startBet', $responseData);
|
|
//启动倒计时(该处以后会废弃掉)
|
|
CountdownService::countdown($numberTabId,$tableInfo,$modelRes['data']);
|
|
Logger::info(Logger::CAT_GAME, 'start_bet', ['table_id' => $tableInfo['id'], 'table_name' => $tableInfo['table_name'], 'nt_id' => $numberTabId]);
|
|
}else{
|
|
Logger::warn(Logger::CAT_GAME, 'start_bet_fail', ['table_id' => $tableInfo['id'], 'msg' => $modelRes['msg']]);
|
|
$ws->emit('startBet', ['status' => false, 'msg' => $modelRes['msg']]);
|
|
}
|
|
}
|
|
} |