feat: complete logging audit - fill all gaps
- Filter noisy audio play() errors from frontend log - Add logging to ALL 8 ToBet services (was only Baccarat) - Add InitTableService logging (Sumday/Boot/NumberTab creation & failure) - Add logview.sh for quick log viewing - Add log_cleanup.sh for 30-day rotation
This commit is contained in:
@@ -5,6 +5,7 @@ namespace app\services\bet;
|
||||
|
||||
|
||||
use app\models\bet\Bet;
|
||||
use app\utils\Logger;
|
||||
use freedom\utils\SocketSession;
|
||||
|
||||
/**
|
||||
@@ -32,6 +33,7 @@ class ToBetDtService
|
||||
$time = time();
|
||||
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
|
||||
if ($toBetCheck['status'] == false){
|
||||
Logger::warn(Logger::CAT_BET, 'dt_bet_fail', ['table_id' => $tableInfo['id'], 'msg' => $toBetCheck['msg']]);
|
||||
$ws->emit('toBet',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => $toBetCheck['msg']]);
|
||||
SocketSession::resetRepeat($fd,'user','isToBet');
|
||||
return;
|
||||
@@ -107,6 +109,7 @@ class ToBetDtService
|
||||
|
||||
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0);
|
||||
if($res){
|
||||
Logger::info(Logger::CAT_BET, 'dt_bet_success', ['user_id' => $userInfo['id'], 'table_id' => $tableInfo['id'], 'amount' => $amount]);
|
||||
$ws->emit('toBet',['status' => true, 'table_id' => $tableInfo['id'], 'bet_amount_msg' => $betTotalAmount, 'money' => ($userInfo['money'] - $amount),'seat_num' => $seat_num, 'msg' => 'to_bet_success']);
|
||||
if($userInfo['bet_type'] == 2){
|
||||
$tableManager = app('swoole.table.manager');
|
||||
@@ -128,6 +131,7 @@ class ToBetDtService
|
||||
);
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('allBetAmount',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
|
||||
}else{
|
||||
Logger::warn(Logger::CAT_BET, 'dt_bet_db_fail', ['user_id' => $userInfo['id'], 'table_id' => $tableInfo['id'], 'amount' => $amount]);
|
||||
$ws->emit('toBet',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => 'to_bet_fail']);
|
||||
}
|
||||
SocketSession::resetRepeat($fd,'user','isToBet');
|
||||
|
||||
Reference in New Issue
Block a user