backup: 线上最终版本全量备份

包含所有线上运行的改动:
- 荷官端倒计时卡顿修复(CountdownService TTL+10/前端watchdog)
- 停止下注debounce防重复(8个handle.js)
- 洗码量规则重写(单边/双边/开和不计/百家乐+龙虎)
- 龙虎和局不杀庄闲(全额退回)
- 日志系统(Logger工具类/日志查看/清理脚本)
- 好路提醒异常处理(WaybillRemindService try-catch)
- 扫牌器连接改进(ScanConnectService)
- 牛牛/三卡开牌修复
- .gitignore更新/.DS_Store清理
This commit is contained in:
OG Backup
2026-06-14 14:20:43 +08:00
parent 728ce45856
commit 2cd31285f0
78 changed files with 2407 additions and 538 deletions
BIN
View File
Binary file not shown.
+7 -1
View File
@@ -36,7 +36,13 @@ class ExceptionHandle extends Handle
*/
public function report(Throwable $exception): void
{
// 使用内置的方式记录异常日志
if (!$this->isIgnoreReport($exception)) {
\app\utils\Logger::error(\app\utils\Logger::CAT_ERROR, $exception->getMessage(), [
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'trace' => substr($exception->getTraceAsString(), 0, 2000),
]);
}
parent::report($exception);
}
+4 -1
View File
@@ -3,7 +3,10 @@
//应用公共文件
// 版本号
define('VERSION_V','?ver=v10.0.1');
define('VERSION_V','?ver=v10.1.1');
// 强制加载中文语言包
\think\facade\Lang::load(__DIR__ . '/lang/zh-cn.php');
// 加密秘钥
const UC_AUTH_KEY = 'L=<z|6aMF8s.Z_CE~K)e}c[VuG9hlJ#gp02t"1&`';
+19 -1
View File
@@ -65,6 +65,24 @@ class Index extends Common{
//View::assign('localSbServer',Env::get('system.SB_SERVER'));
View::assign('localSbServer', $tableInfo['media_near_rtmp']); // 无用的字段来作为本地识别设备IP
}
public function log_report(): Json
{
if (!Request::instance()->isPost()) return json(['status' => 0]);
$data = Request::instance()->post();
\app\utils\Logger::error(\app\utils\Logger::CAT_FRONTEND, $data['message'] ?? 'unknown', [
'source' => $data['source'] ?? 'unknown',
'type' => $data['type'] ?? 'error',
'stack' => isset($data['stack']) ? substr($data['stack'], 0, 2000) : '',
'file' => $data['file'] ?? '',
'url' => $data['url'] ?? '',
'line' => $data['line'] ?? '',
'col' => $data['col'] ?? '',
'ua' => Request::instance()->header('user-agent', ''),
'ip' => Request::instance()->ip(),
]);
return json(['status' => 1]);
}
function get_lang(): Json
{
if (!Request::instance()->isPost()) return json();
@@ -157,7 +175,7 @@ class Index extends Common{
$forecast = intval(Request::instance()->post('forecast'));
// 验证靴ID
if($bootId > 0){
$ns = NumberTab::getByBootIdDone($bootId,'result,pair');
$ns = NumberTab::getByBootIdDone($bootId,'result,pair,luck_six,dragon_seven,panda_eight');
if($forecast == 1){
// 庄问路
$ns[] = array('result'=>1,'pair'=>0);
+36
View File
@@ -0,0 +1,36 @@
<?php
declare (strict_types = 1);
namespace app\handle\controller;
use think\facade\Request;
use think\response\Json;
class Log
{
public function report(): Json
{
if (!Request::instance()->isPost()) return json(['status' => 0]);
$data = Request::instance()->post();
if (empty($data)) {
$raw = Request::instance()->getContent();
$data = json_decode($raw, true) ?: [];
}
if (empty($data)) {
$raw2 = file_get_contents('php://input');
$data = json_decode($raw2, true) ?: [];
}
\app\utils\Logger::error(\app\utils\Logger::CAT_FRONTEND, $data['message'] ?? 'unknown', [
'source' => $data['source'] ?? 'unknown',
'type' => $data['type'] ?? 'error',
'stack' => isset($data['stack']) ? substr($data['stack'], 0, 2000) : '',
'file' => $data['file'] ?? '',
'url' => $data['url'] ?? '',
'line' => $data['line'] ?? '',
'col' => $data['col'] ?? '',
'ua' => Request::instance()->header('user-agent', ''),
'ip' => Request::instance()->ip(),
]);
return json(['status' => 1]);
}
}
+600
View File
@@ -0,0 +1,600 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 核心中文语言包
return [
// 操作端 和 swoole文件 简体中文语言包
'lang' => 'zh-cn',
'table' => '桌台',
'boot' => '靴数',
'number' => '局数',
'now_time' => '当前时间',
'login_fail' => '登录失败',
'banker' => '庄',
'player' => '闲',
'tie' => '和',
'banker_pair' => '庄对',
'player_pair' => '闲对',
'both_pair' => '庄闲对',
'pair' => '对子',
'big' => '大',
'small' => '小',
'dragon' => '龙',
'tiger' => '虎',
'win_6' => '赢6',
'is_win_6' => '是否赢6',
'luck_6' => '幸运6',
'commission' => '抽佣',
'free_commission' => '免佣',
'round_host' => '本局为庄家',
'banker_full' => '庄',
'player_full' => '闲',
'tie_full' => '和',
'banker_pair_full' => '庄对',
'player_pair_full' => '闲对',
'both_pair_full' => '庄闲对',
'dragon_full' => '龙',
'tiger_full' => '虎',
'player_1' => '闲1',
'player_2' => '闲2',
'player_3' => '闲3',
'player_1_flat' => '闲1平倍',
'player_1_double' => '闲1翻倍',
'banker_player_1_flat' => '庄(闲1)平倍',
'banker_player_1_double' => '庄(闲1)翻倍',
'player_2_flat' => '闲2平倍',
'player_2_double' => '闲2翻倍',
'banker_player_2_flat' => '庄(闲2)平倍',
'banker_player_2_double' => '庄(闲2)翻倍',
'player_3_flat' => '闲3平倍',
'player_3_double' => '闲3翻倍',
'banker_player_3_flat' => '庄(闲3)平倍',
'banker_player_3_double' => '庄(闲3)翻倍',
'bull_0' => '无牛',
'bull_1' => '牛一',
'bull_2' => '牛二',
'bull_3' => '牛三',
'bull_4' => '牛四',
'bull_5' => '牛五',
'bull_6' => '牛六',
'bull_7' => '牛七',
'bull_8' => '牛八',
'bull_9' => '牛九',
'bull_bull' => '牛牛',
'5_bulls' => '五公',
'yes' => '是',
'no' => '否',
'online_number' => '在线人数',
'bet_amount' => '本局下注金额',
'wait_For_Opening' => '停止下注-等待开盘',
'point' => '点',
'void' => '已作废',
'next' => '下一局',
'disclaimer' => '路牌资料仅供参考,如有错漏。本公司概不负责',
'data_error' => '数据错误',
'browser_error' => '您的浏览器不支持WebSocket',
'start' => '开始',
'end' => '结束',
'start_bet' => '接收下注',
'end_bet' => '结束下注',
'opening' => '提交结果',
'shuffle' => '开始洗牌',
'change_boot' => '换靴',
'close_Boot' => '日结算',
'logout' => '退出',
'is_to_shuffle' => '是否需要将桌子的状态设置为"洗牌中"',
'is_to_balance' => '是否需要进行日结算?',
'is_to_boot' => '是否需要进行换靴?',
'need_a_result' => '请选择要修改的结果',
'is_to_logout' => '是否退出登录?',
'edit_previous_result' => '修改上一局结果',
'select_result' => '选择结果',
'select' => '请选择',
'monday' => '星期一',
'tuesday' => '星期二',
'wednesday' => '星期三',
'thursday' => '星期四',
'friday' => '星期五',
'saturday' => '星期六',
'sunday' => '星期日',
'user_not_exist' => '用户不存在',
'table_not_run' => '该桌子暂时没有营运',
'tableNotRun' => '该桌子暂时没有营运',
'bet_fail' => '下注失败,服务器链接失败',
'no_right' => '你无权操作',
'bet_status_1' => '接受下注',
'bet_status_0' => '尚未接受下注',
'bet_status_2' => '停止下注-等待开盘',
'confirm' => '确定',
'cancel' => '取消',
'connect_fail' => '您已断开链接,请返回重新进入',
'message' => '信息',
'table_status_0' => '桌子运营中',
'table_status_1' => '洗牌中',
'table_status_2' => '停台中',
'link_server_fail' => '与服务通讯失败',
'link_server_fail_1' => '荷官不在线',
'link_server_fail_2' => '与服务通讯失败2',
'link_server_fail_3' => '与服务通讯失败3',
'appid_error' => 'appid 错误',
'appsecret_error' => 'appsecret 错误',
'appid_or_appsecret_error' => 'appid或appsecret 错误',
'param_error' => '参数错误',
'illegal_request' => '非法请求',
'balance_success' => '日结算成功',
'balance_fail' => '日结算失败',
'balance_fail_1' => '日结算失败1',
'balance_fail_2' => '日结算失败2',
'table_status_error' => '请把桌子更改为"洗牌状态"再进行日结算',
'boot_settle_success' => '靴结算成功',
'boot_settle_fail' => '靴结算失败',
'boot_settle_fail_1' => '换靴失败,该桌子还没有靴,请进行日结',
'boot_settle_fail_2' => '换靴失败,该桌子已经结算,请重新登录再继续',
'boot_settle_fail_3' => '该铺尚未结束,请开出结果后再换靴',
'start_bet_success' => '开始下注成功',
'start_bet_fail' => '开始下注失败',
'start_bet_fail_1' => '开始下注失败,下注铺已经开始下注或者已经停止了下注',
'start_bet_fail_2' => '开始下注失败,下注铺信息有误',
'start_bet_fail_3' => '操作失败,请确保桌子不是在洗牌中或者停台中状态',
'end_bet_success' => '结束下注成功',
'end_bet_fail' => '结束下注失败',
'end_bet_fail_1' => '停止下注失败,该铺还没开始接受下注或者已经停止了下注',
'end_bet_fail_2' => '开始下注失败,下注铺信息有误',
'to_bet_success' => '下注成功',
'to_bet_fail' => '下注失败',
'to_bet_fail_1' => '余额不足,不能下注',
'to_bet_fail_2' => '会员信息错误,不能下注',
'to_bet_fail_3' => '已超过允许的下注时间,不能下注',
'to_bet_fail_4' => '该局不是在可以下注的状态,不能下注',
'to_bet_fail_5' => '下注失败,下注铺信息有误',
'to_bet_fail_6' => '下注金额必须大于0',
'to_bet_fail_7' => '超过50局后无法下注幸运6',
'to_bet_fail_8' => '超过30局后无法下注大小',
'opening_success' => '开盘结果成功',
'opening_fail' => '开盘结果失败',
'opening_fail_1' => '开结果失败,请确认该局是处于停止下注的状态',
'opening_fail_2' => '开盘失败,开盘铺信息有误',
'opening_fail_3' => '请输入开盘结果',
'opening_fail_4' => '下注未结束,无法开结果',
'opening_fail_5' => '开盘失败,庄闲牌面不齐',
'opening_fail_6' => '开牌数据不存在',
'retreated_success' => '修改成功',
'retreated_fail' => '修改失败',
'retreated_fail_1' => '请正确选择结果',
'retreated_fail_2' => '没有上一铺数据可更改',
'retreated_fail_3' => '靴信息错误',
'retreated_fail_4' => '回合信息错误',
'retreated_fail_5' => '桌子信息错误',
'retreated_fail_6' => '游戏类型错误',
// PC投注页面 简体中文语言包
'welcome' => '欢迎您',
'account' => '账号',
'money' => '余额',
'language' => '语言',
'rule' => '规则',
'record' => '记录',
'user' => '个人中心',
'log_out' => '退出游戏',
'limit' => '限红',
'game' => '游戏',
'baccarat' => '百家乐',
'dt' => '龙虎',
'color_plate' => '色碟',
'sic_bo' => '骰宝',
'roulette' => '轮盘',
'start_date' => '开始日期',
'end_date' => '结束日期',
'search' => '查询',
'ttf' => '桌台/时间/局号',
'total' => '合计',
'card' => '牌',
'banker_all' => '庄',
'player_all' => '闲',
'tie_all' => '和',
'banker_pair_all' => '庄对',
'player_pair_all' => '闲对',
'both_pair_all' => '庄闲对',
'banker_doub_all' => '庄翻倍',
'player_doub_all' => '闲翻倍',
'dragon_all' => '龙',
'tiger_all' => '虎',
'full_screen' => '全屏',
'exit_full_screen' => '退出全屏',
'back' => '返回',
'sound' => '声音',
'statistics' => '统计',
'b_query' => '庄问路',
'p_query' => '闲问路',
'd_query' => '龙问路',
't_query' => '虎问路',
'line' => '线路',
'line_1' => '近景',
'line_2' => '远景',
'line_3' => '线路三',
'lobby' => '大厅',
'video_line_error' => '视频线路错误',
'lose' => '输',
'win' => '赢',
'to_bet_confirm_tip' => '请下注后再点击确定',
'browser_tip' => '请使用谷歌、360、QQ、百度、火狐、或者IE10以上版本的高级浏览器进入游戏',
'select_chip_tip' => '请选择下注筹码',
'recharge_tip' => '余额不足,请充值',
'instant_pot' => '即时彩池',
'bet' => '下注',
'settlement' => '结算结果',
'no_bet_data' => '没有下注数据',
'personal_limit_banker_high' => '个人限红:庄最高下注额为',
'personal_limit_banker_low' => '个人限红:庄最低下注额为',
'personal_limit_player_high' => '个人限红:闲最高下注额为',
'personal_limit_player_low' => '个人限红:闲最低下注额为',
'personal_limit_tie_high' => '个人限红:和最高下注额为',
'personal_limit_tie_low' => '个人限红:和最低下注额为',
'personal_limit_banker_pair_high' => '个人限红:庄对最高下注额为',
'personal_limit_banker_pair_low' => '个人限红:庄对最低下注额为',
'personal_limit_player_pair_high' => '个人限红:闲对最高下注额为',
'personal_limit_player_pair_low' => '个人限红:闲对最低下注额为',
'personal_limit_dragon_high' => '个人限红:龙最高下注额为',
'personal_limit_dragon_low' => '个人限红:龙最低下注额为',
'personal_limit_tiger_high' => '个人限红:虎最高下注额为',
'personal_limit_tiger_low' => '个人限红:虎最低下注额为',
'game_not_start' => '游戏尚未开始',
'game_stop_bet' => '本局游戏已停止下注',
'leave_table_tip' => '确定要离开当前游戏台吗?',
'select_chip_tip' => '请选择下注筹码',
// wap电投和网投语言包
'coming_soon' => '即将推出',
'game_room' => '游戏大厅',
'edit_pass' => '修改密码',
'change_password' => '修改密码',
'phone' => '联系电话',
'last_login_time' => '上次登陆时间',
'recharge' => '充值上分',
'withdraw' => '申请下分',
'bill' => '账单',
'game_record' => '游戏记录',
'baccarat_total_bet_count' => '百家乐总下注次数',
'dt_total_bet_count' => '龙虎总下注次数',
'total_cleared_wash_code' => '已结算洗码总额',
'uncleared_total_wash_code' => '未结算洗码总额',
'wash_rate' => '洗码率',
'current_password' => '请输入旧密码',
'new_password' => '请输入新密码',
'confirm_password' => '再次输入新密码',
'current_password_tip' => '请输入旧密码',
'new_password_tip' => '新密码不能小于6个字符',
'confirm_password_tip' => '两次输入的密码不一致',
'login_again' => '请重新登录',
'login' => '登录',
'sign_in' => '登录',
'account_login' => '已有账户登录',
'register' => '注册',
'register_new_user' => '新用户注册',
'password' => '密码',
'register_password_length_tip' => '密码不能小于6个字符',
'register_account_length_tip' => '账号不能小于6个字符',
'register_account_exist_tip' => '账号已存在',
'register_account_tip' => '6-20位英文.数字组成',
'register_password_tip' => '6-20位字符.不包含空格',
'register_confirm_password_tip' => '再输入一遍登录密码',
'register_success' => '注册成功',
'register_fail' => '注册失败',
'password_not_empty' => '旧密码或新密码不能为空',
'change_password_success' => '修改密码成功',
'change_password_fail' => '修改密码失败',
'current_password_error' => '旧密码错误',
'recharge_unsupport_tip' => '上分暂时未开启,请联系您的代理上分',
'withdraw_unsupport_tip' => '下分暂时未开启,请联系您的代理下分',
'select_time' => '选择时间',
'start_time_tip' => '请选择开始时间',
'end_time_tip' => '请选择结束时间',
'wash_code_amount' => '洗码量',
'code_amount' => '码量',
'net_code_amount' => '净码量',
'wash_code_time' => '洗码时间',
'extraction_method' => '提取方式',
'deposit_money' => '存入余额',
'setup' => '设置',
'mute' => '静音',
'voice' => '开声',
'win_or_lose' => '输赢',
'account_tip' => '请输入账号',
'password_tip' => '请输入密码',
'read_and_agree' => '我已阅读并同意',
'rule_and_agreement' => '游戏规则与用户协议',
'account_or_password_error' => '账号或密码错误',
'account_not_exist' => '账号不存在',
'force_offline' => '你已被管理员强制下线',
'auto_back' => '5局内未下注自动返回游戏大厅',
'reset_number' => '作废',
'is_reset_number' => '是否作废当前该局?',
'reset_number_success' => '操作成功',
'reset_number_fail_1' => '操作失败,该靴已经结算',
'reset_number_fail_2' => '操作失败,该桌子已经结算',
'reset_number_fail_3' => '操作失败,下注状态不符',
'reset_number_msg' => '该局已重置,请重新下注',
// 系统错误提示
'Undefined variable' => '未定义变量',
'Undefined index' => '未定义数组索引',
'Undefined offset' => '未定义数组下标',
'Parse error' => '语法解析错误',
'Type error' => '类型错误',
'Fatal error' => '致命错误',
'syntax error' => '语法错误',
// 框架核心错误提示
'dispatch type not support' => '不支持的调度类型',
'method param miss' => '方法参数错误',
'method not exists' => '方法不存在',
'module not exists' => '模块不存在',
'controller not exists' => '控制器不存在',
'class not exists' => '类不存在',
'property not exists' => '类的属性不存在',
'template not exists' => '模板文件不存在',
'illegal controller name' => '非法的控制器名称',
'illegal action name' => '非法的操作名称',
'url suffix deny' => '禁止的URL后缀访问',
'Route Not Found' => '当前访问路由未定义',
'Undefined db type' => '未定义数据库类型',
'variable type error' => '变量类型错误',
'PSR-4 error' => 'PSR-4 规范错误',
'not support total' => '简洁模式下不能获取数据总数',
'not support last' => '简洁模式下不能获取最后一页',
'error session handler' => '错误的SESSION处理器类',
'not allow php tag' => '模板不允许使用PHP语法',
'not support' => '不支持',
'redisd master' => 'Redisd 主服务器错误',
'redisd slave' => 'Redisd 从服务器错误',
'must run at sae' => '必须在SAE运行',
'memcache init error' => '未开通Memcache服务,请在SAE管理平台初始化Memcache服务',
'KVDB init error' => '没有初始化KVDB,请在SAE管理平台初始化KVDB服务',
'fields not exists' => '数据表字段不存在',
'where express error' => '查询表达式错误',
'no data to update' => '没有任何数据需要更新',
'miss data to insert' => '缺少需要写入的数据',
'miss complex primary data' => '缺少复合主键数据',
'miss update condition' => '缺少更新条件',
'model data Not Found' => '模型数据不存在',
'table data not Found' => '表数据不存在',
'delete without condition' => '没有条件不会执行删除操作',
'miss relation data' => '缺少关联表数据',
'tag attr must' => '模板标签属性必须',
'tag error' => '模板标签错误',
'cache write error' => '缓存写入失败',
'sae mc write error' => 'SAE mc 写入错误',
'route name not exists' => '路由标识不存在(或参数不够)',
'invalid request' => '非法请求',
'bind attr has exists' => '模型的属性已经存在',
'relation data not exists' => '关联数据不存在',
'relation not support' => '关联不支持',
'chunk not support order' => 'Chunk不支持调用order方法',
// 上传错误信息
'unknown upload error' => '未知上传错误!',
'file write error' => '文件写入失败!',
'upload temp dir not found' => '找不到临时文件夹!',
'no file to uploaded' => '没有文件被上传!',
'only the portion of file is uploaded' => '文件只有部分被上传!',
'upload File size exceeds the maximum value' => '上传文件大小超过了最大值!',
'upload write error' => '文件上传保存错误!',
'has the same filename: {:filename}' => '存在同名文件:{:filename}',
'upload illegal files' => '非法上传文件',
'illegal image files' => '非法图片文件',
'extensions to upload is not allowed' => '上传文件后缀不允许',
'mimetype to upload is not allowed' => '上传文件MIME类型不允许!',
'filesize not match' => '上传文件大小不符!',
'directory {:path} creation failed' => '目录 {:path} 创建失败!',
// Validate Error Message
':attribute require' => ':attribute不能为空',
':attribute must be numeric' => ':attribute必须是数字',
':attribute must be integer' => ':attribute必须是整数',
':attribute must be float' => ':attribute必须是浮点数',
':attribute must be bool' => ':attribute必须是布尔值',
':attribute not a valid email address' => ':attribute格式不符',
':attribute not a valid mobile' => ':attribute格式不符',
':attribute must be a array' => ':attribute必须是数组',
':attribute must be yes,on or 1' => ':attribute必须是yes、on或者1',
':attribute not a valid datetime' => ':attribute不是一个有效的日期或时间格式',
':attribute not a valid file' => ':attribute不是有效的上传文件',
':attribute not a valid image' => ':attribute不是有效的图像文件',
':attribute must be alpha' => ':attribute只能是字母',
':attribute must be alpha-numeric' => ':attribute只能是字母和数字',
':attribute must be alpha-numeric, dash, underscore' => ':attribute只能是字母、数字和下划线_及破折号-',
':attribute not a valid domain or ip' => ':attribute不是有效的域名或者IP',
':attribute must be chinese' => ':attribute只能是汉字',
':attribute must be chinese or alpha' => ':attribute只能是汉字、字母',
':attribute must be chinese,alpha-numeric' => ':attribute只能是汉字、字母和数字',
':attribute must be chinese,alpha-numeric,underscore, dash' => ':attribute只能是汉字、字母、数字和下划线_及破折号-',
':attribute not a valid url' => ':attribute不是有效的URL地址',
':attribute not a valid ip' => ':attribute不是有效的IP地址',
':attribute must be dateFormat of :rule' => ':attribute必须使用日期格式 :rule',
':attribute must be in :rule' => ':attribute必须在 :rule 范围内',
':attribute be notin :rule' => ':attribute不能在 :rule 范围内',
':attribute must between :1 - :2' => ':attribute只能在 :1 - :2 之间',
':attribute not between :1 - :2' => ':attribute不能在 :1 - :2 之间',
'size of :attribute must be :rule' => ':attribute长度不符合要求 :rule',
'max size of :attribute must be :rule' => ':attribute长度不能超过 :rule',
'min size of :attribute must be :rule' => ':attribute长度不能小于 :rule',
':attribute cannot be less than :rule' => ':attribute日期不能小于 :rule',
':attribute cannot exceed :rule' => ':attribute日期不能超过 :rule',
':attribute not within :rule' => '不在有效期内 :rule',
'access IP is not allowed' => '不允许的IP访问',
'access IP denied' => '禁止的IP访问',
':attribute out of accord with :2' => ':attribute和确认字段:2不一致',
':attribute cannot be same with :2' => ':attribute和比较字段:2不能相同',
':attribute must greater than or equal :rule' => ':attribute必须大于等于 :rule',
':attribute must greater than :rule' => ':attribute必须大于 :rule',
':attribute must less than or equal :rule' => ':attribute必须小于等于 :rule',
':attribute must less than :rule' => ':attribute必须小于 :rule',
':attribute must equal :rule' => ':attribute必须等于 :rule',
':attribute has exists' => ':attribute已存在',
':attribute not conform to the rules' => ':attribute不符合指定规则',
'invalid Request method' => '无效的请求类型',
'invalid token' => '令牌数据无效',
'not conform to the rules' => '规则错误',
'in_top_sumday' => '该桌子处于最新的日结天数,请明天再进行日结',
'exceeds_limit' => '下注超出限紅',
'exceeds_limit_table' => '下注超出桌子限紅',
'exceeds_limit_user' => '下注超出个人限紅',
'under_limit_user' => '下注低于个人限紅',
'end_bet_error' => '停止成功',
'end_bet_error_1' => '当前局状态不在下注状态,不能停止',
'end_bet_error_2' => '停止下注失败',
'repeated_entry' => '你的账号在其他地方登陆了,即将退出',
'online_entrance' => '电投登录入口',
'onlinechip_entrance' => '网投登录入口',
'agent_entrance' => '代理端登录入口',
'login_entrance' => '登录入口',
'change_boot_false' => '当前有下注,不能结算,请开结果后再进行结算',
'win_limit_tip' => '已达到日赢上限,无法下注',
'toning_result_0' => '0红4白',
'toning_result_1' => '1红3白',
'toning_result_2' => '2红2白',
'toning_result_3' => '3红1白',
'toning_result_4' => '4红0白',
'toning_zero' => '0区下注额',
'toning_four' => '4区下注额',
'toning_one' => '1区下注额',
'toning_three' => '3区下注额',
'toning_big' => '大区下注额',
'toning_small' => '小区下注额',
'toning_singular' => '单区下注额',
'toning_plural' => '双区下注额',
'dice_small' => '大小-小下注额',
'dice_big' => '大小-大下注额',
'dice_singular' => '单双-单下注额',
'dice_plural' => '单双-双区下注额',
'dice_two_11' => '双骰-1下注额',
'dice_two_22' => '双骰-2下注额',
'dice_two_33' => '双骰-3下注额',
'dice_two_44' => '双骰-4下注额',
'dice_two_55' => '双骰-5下注额',
'dice_two_66' => '双骰-6下注额',
'dice_leopard' => '全围下注额',
'dice_three_111' => '围骰-1下注额',
'dice_three_222' => '围骰-2下注额',
'dice_three_333' => '围骰-3下注额',
'dice_three_444' => '围骰-4下注额',
'dice_three_555' => '围骰-5下注额',
'dice_three_666' => '围骰-6下注额',
'dice_number_4' => '总和-4下注额',
'dice_number_5' => '总和-5下注额',
'dice_number_6' => '总和-6下注额',
'dice_number_7' => '总和-7下注额',
'dice_number_8' => '总和-8下注额',
'dice_number_9' => '总和-9下注额',
'dice_number_10' => '总和-10下注额',
'dice_number_11' => '总和-11下注额',
'dice_number_12' => '总和-12下注额',
'dice_number_13' => '总和-13下注额',
'dice_number_14' => '总和-14下注额',
'dice_number_15' => '总和-15下注额',
'dice_number_16' => '总和-16下注额',
'dice_number_17' => '总和-17下注额',
'dice_two_12' => '组合-1+2下注额',
'dice_two_13' => '组合-1+3下注额',
'dice_two_14' => '组合-1+4下注额',
'dice_two_15' => '组合-1+5下注额',
'dice_two_16' => '组合-1+6下注额',
'dice_two_23' => '组合-2+3下注额',
'dice_two_24' => '组合-2+4下注额',
'dice_two_25' => '组合-2+5下注额',
'dice_two_26' => '组合-2+6下注额',
'dice_two_34' => '组合-3+4下注额',
'dice_two_35' => '组合-3+5下注额',
'dice_two_36' => '组合-3+6下注额',
'dice_two_45' => '组合-4+5下注额',
'dice_two_46' => '组合-4+6下注额',
'dice_two_56' => '组合-5+6下注额',
'dice_living_1' => '点数-1下注额',
'dice_living_2' => '点数-2下注额',
'dice_living_3' => '点数-3下注额',
'dice_living_4' => '点数-4下注额',
'dice_living_5' => '点数-5下注额',
'dice_living_6' => '点数-6下注额',
'european' => '欧式',
'french' => '法式',
'roulette_straight' => '直注',
'roulette_split' => '分注',
'roulette_street' => '街注',
'roulette_triple' => '三数',
'roulette_corner' => '角注',
'roulette_four' => '角注',
'roulette_line' => '线注',
'roulette_dozen' => '打注',
'roulette_column' => '列注',
'roulette_red' => '红',
'roulette_black' => '黑',
'roulette_odd' => '单',
'roulette_even' => '双',
'roulette_low' => '小',
'roulette_high' => '大',
'roulette_column_1' => '第一列',
'roulette_column_2' => '第二列',
'roulette_column_3' => '第三列',
'roulette_dozen_1' => '第一打',
'roulette_dozen_2' => '第二打',
'roulette_dozen_3' => '第三打',
'roulette_zeroGame' => '轮上零旁',
'roulette_neighborsOfZero' => '零旁注上角',
'roulette_orphans' => '轮上孤注',
'roulette_theThird' => '轮盘下角注',
];
+47 -35
View File
@@ -117,31 +117,36 @@
<span id="betstatus"></span>
</div>
</div>
<div class="limit-box">
<div class="list clearfix" style="padding-top:0;">
<div class="lab" style="margin:0;">
{:lang('banker')}\{:lang('player')}
<div class="bottom-row">
<div class="limit-box">
<div class="list clearfix" style="padding-top:0;">
<div class="lab" style="margin:0;">
{:lang('banker')}\{:lang('player')}
</div>
<div class="item fl">
<span class="fr showLimitBP">&nbsp;</span>
</div>
</div>
<div class="item fl">
<span class="fr showLimitBP">&nbsp;</span>
<div class="list clearfix" style="padding-top:0;">
<div class="lab" style="margin:0;">
{:lang('tie')}
</div>
<div class="item fl">
<span class="fr showLimitTie">&nbsp;</span>
</div>
</div>
<div class="list clearfix" style="padding-top:0;">
<div class="lab" style="margin:0;">
{:lang('pair')}
</div>
<div class="item fl">
<span class="fr showLimitPair">&nbsp;</span>
</div>
</div>
</div>
<div class="list clearfix" style="padding-top:0;">
<div class="lab" style="margin:0;">
{:lang('tie')}
</div>
<div class="item fl">
<span class="fr showLimitTie">&nbsp;</span>
</div>
</div>
<div class="list clearfix" style="padding-top:0;">
<div class="lab" style="margin:0;">
{:lang('pair')}
</div>
<div class="item fl">
<span class="fr showLimitPair">&nbsp;</span>
</div>
<div class="result-area">
<div class="result-area-timer" id="resultAreaTimer"></div>
<div class="result-area-img" id="resultAreaImg"></div>
</div>
</div>
</div>
@@ -196,6 +201,8 @@
<input type="hidden" id="result_player_pair" value="0">
<input type="hidden" id="lucky_six" value="0">
<input type="hidden" id="lucky_six_number" value="0">
<input type="hidden" id="dragon_seven" value="0">
<input type="hidden" id="panda_eight" value="0">
<input type="hidden" id="dt_pair" value="0">
</div>
<div class="btn-box4">
@@ -247,18 +254,22 @@
{:lang('select_result')}
<select id="update_ludan_result">
<option value="">{:lang('select')}</option>
<option value="1-0">{:lang('banker')}</option>
<option value="2-0">{:lang('player')}</option>
<option value="3-0">{:lang('tie')}</option>
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
<option value="1-0-0-0-0">{:lang('banker')}</option>
<option value="2-0-0-0-0">{:lang('player')}</option>
<option value="3-0-0-0-0">{:lang('tie')}</option>
<option value="1-1-0-0-0">{:lang('banker')}-{:lang('banker_pair')}</option>
<option value="1-2-0-0-0">{:lang('banker')}-{:lang('player_pair')}</option>
<option value="1-3-0-0-0">{:lang('banker')}-{:lang('both_pair')}</option>
<option value="1-0-2-0-0">{:lang('banker')}-幸运6(2张)</option>
<option value="1-0-3-0-0">{:lang('banker')}-幸运6(3张)</option>
<option value="1-0-0-1-0">{:lang('banker')}-龙7</option>
<option value="2-1-0-0-0">{:lang('player')}-{:lang('banker_pair')}</option>
<option value="2-2-0-0-0">{:lang('player')}-{:lang('player_pair')}</option>
<option value="2-3-0-0-0">{:lang('player')}-{:lang('both_pair')}</option>
<option value="2-0-0-0-1">{:lang('player')}-熊8</option>
<option value="3-1-0-0-0">{:lang('tie')}-{:lang('banker_pair')}</option>
<option value="3-2-0-0-0">{:lang('tie')}-{:lang('player_pair')}</option>
<option value="3-3-0-0-0">{:lang('tie')}-{:lang('both_pair')}</option>
</select>
</div>
<div class="update-ludan-footer">
@@ -281,6 +292,7 @@
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/handle_b.js?3"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_b.js{$Think.VERSION_V}"></script>
</body>
</html>
+5
View File
@@ -67,6 +67,10 @@
</div>
</div>
<div class="result-area" style="margin:4px auto;width:60%;">
<div class="result-area-timer" id="resultAreaTimer"></div>
<div class="result-area-img" id="resultAreaImg"></div>
</div>
</div>
<iframe class="video-iframe" id="video-iframe" ></iframe>
</div>
@@ -201,6 +205,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -490,6 +490,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_b_sb_scan_four.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -124,6 +124,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_dice.js{$Think.VERSION_V}"></script>
</body>
</html>
+21 -14
View File
@@ -105,22 +105,28 @@
<span id="betstatus"></span>
</div>
</div>
<div class="limit-box">
<div class="list clearfix">
<div class="lab">
{:lang('dragon')}\{:lang('tiger')}
<div class="bottom-row">
<div class="limit-box">
<div class="list clearfix">
<div class="lab">
{:lang('dragon')}\{:lang('tiger')}
</div>
<div class="item fl">
<span class="fr showLimitBP">&nbsp;</span>
</div>
</div>
<div class="item fl">
<span class="fr showLimitBP">&nbsp;</span>
<div class="list clearfix">
<div class="lab">
{:lang('tie')}
</div>
<div class="item fl">
<span class="fr showLimitTie">&nbsp;</span>
</div>
</div>
</div>
<div class="list clearfix">
<div class="lab">
{:lang('tie')}
</div>
<div class="item fl">
<span class="fr showLimitTie">&nbsp;</span>
</div>
<div class="result-area">
<div class="result-area-timer" id="resultAreaTimer"></div>
<div class="result-area-img" id="resultAreaImg"></div>
</div>
</div>
</div>
@@ -227,6 +233,7 @@
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/handle_b.js?1"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_b.js{$Think.VERSION_V}"></script>
</body>
</html>
+5
View File
@@ -59,6 +59,10 @@
</div>
</div>
<div class="result-area" style="margin:4px auto;width:60%;">
<div class="result-area-timer" id="resultAreaTimer"></div>
<div class="result-area-img" id="resultAreaImg"></div>
</div>
</div>
<iframe class="video-iframe" id="video-iframe" ></iframe>
</div>
@@ -170,6 +174,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -459,6 +459,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_dt_sb.js{$Think.VERSION_V}"></script>
</body>
</html>
+5
View File
@@ -156,6 +156,10 @@
</div>
</div>
<div class="result-area" style="margin:4px auto;width:60%;">
<div class="result-area-timer" id="resultAreaTimer"></div>
<div class="result-area-img" id="resultAreaImg"></div>
</div>
</div>
<iframe class="video-iframe" id="video-iframe" ></iframe>
</div>
@@ -341,6 +345,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+5
View File
@@ -137,6 +137,10 @@
<small id="onlineNumber">0</small>
</div>
</div>
<div class="result-area" style="margin:4px auto;width:60%;">
<div class="result-area-timer" id="resultAreaTimer"></div>
<div class="result-area-img" id="resultAreaImg"></div>
</div>
</div>
<iframe class="video-iframe" id="video-iframe" ></iframe>
</div>
@@ -616,6 +620,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -620,6 +620,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_nn_sb.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -126,6 +126,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_roulette.js{$Think.VERSION_V}"></script>
</body>
</html>
+5
View File
@@ -51,6 +51,10 @@
</div>
</div>
<div class="result-area" style="margin:4px auto;width:60%;">
<div class="result-area-timer" id="resultAreaTimer"></div>
<div class="result-area-img" id="resultAreaImg"></div>
</div>
</div>
<iframe class="video-iframe" id="video-iframe"></iframe>
</div>
@@ -132,6 +136,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+32
View File
@@ -0,0 +1,32 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use think\facade\Request;
use think\response\Json;
class Log
{
public function report(): Json
{
if (!Request::instance()->isPost()) return json(['status' => 0]);
$data = Request::instance()->post();
if (empty($data)) {
$raw = Request::instance()->getContent();
$data = json_decode($raw, true) ?: [];
}
\app\utils\Logger::error(\app\utils\Logger::CAT_FRONTEND, $data['message'] ?? 'unknown', [
'source' => $data['source'] ?? 'unknown',
'type' => $data['type'] ?? 'error',
'stack' => isset($data['stack']) ? substr($data['stack'], 0, 2000) : '',
'file' => $data['file'] ?? '',
'url' => $data['url'] ?? '',
'line' => $data['line'] ?? '',
'col' => $data['col'] ?? '',
'ua' => Request::instance()->header('user-agent', ''),
'ip' => Request::instance()->ip(),
]);
return json(['status' => 1]);
}
}
+600
View File
@@ -0,0 +1,600 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 核心中文语言包
return [
// 操作端 和 swoole文件 简体中文语言包
'lang' => 'zh-cn',
'table' => '桌台',
'boot' => '靴数',
'number' => '局数',
'now_time' => '当前时间',
'login_fail' => '登录失败',
'banker' => '庄',
'player' => '闲',
'tie' => '和',
'banker_pair' => '庄对',
'player_pair' => '闲对',
'both_pair' => '庄闲对',
'pair' => '对子',
'big' => '大',
'small' => '小',
'dragon' => '龙',
'tiger' => '虎',
'win_6' => '赢6',
'is_win_6' => '是否赢6',
'luck_6' => '幸运6',
'commission' => '抽佣',
'free_commission' => '免佣',
'round_host' => '本局为庄家',
'banker_full' => '庄',
'player_full' => '闲',
'tie_full' => '和',
'banker_pair_full' => '庄对',
'player_pair_full' => '闲对',
'both_pair_full' => '庄闲对',
'dragon_full' => '龙',
'tiger_full' => '虎',
'player_1' => '闲1',
'player_2' => '闲2',
'player_3' => '闲3',
'player_1_flat' => '闲1平倍',
'player_1_double' => '闲1翻倍',
'banker_player_1_flat' => '庄(闲1)平倍',
'banker_player_1_double' => '庄(闲1)翻倍',
'player_2_flat' => '闲2平倍',
'player_2_double' => '闲2翻倍',
'banker_player_2_flat' => '庄(闲2)平倍',
'banker_player_2_double' => '庄(闲2)翻倍',
'player_3_flat' => '闲3平倍',
'player_3_double' => '闲3翻倍',
'banker_player_3_flat' => '庄(闲3)平倍',
'banker_player_3_double' => '庄(闲3)翻倍',
'bull_0' => '无牛',
'bull_1' => '牛一',
'bull_2' => '牛二',
'bull_3' => '牛三',
'bull_4' => '牛四',
'bull_5' => '牛五',
'bull_6' => '牛六',
'bull_7' => '牛七',
'bull_8' => '牛八',
'bull_9' => '牛九',
'bull_bull' => '牛牛',
'5_bulls' => '五公',
'yes' => '是',
'no' => '否',
'online_number' => '在线人数',
'bet_amount' => '本局下注金额',
'wait_For_Opening' => '停止下注-等待开盘',
'point' => '点',
'void' => '已作废',
'next' => '下一局',
'disclaimer' => '路牌资料仅供参考,如有错漏。本公司概不负责',
'data_error' => '数据错误',
'browser_error' => '您的浏览器不支持WebSocket',
'start' => '开始',
'end' => '结束',
'start_bet' => '接收下注',
'end_bet' => '结束下注',
'opening' => '提交结果',
'shuffle' => '开始洗牌',
'change_boot' => '换靴',
'close_Boot' => '日结算',
'logout' => '退出',
'is_to_shuffle' => '是否需要将桌子的状态设置为"洗牌中"',
'is_to_balance' => '是否需要进行日结算?',
'is_to_boot' => '是否需要进行换靴?',
'need_a_result' => '请选择要修改的结果',
'is_to_logout' => '是否退出登录?',
'edit_previous_result' => '修改上一局结果',
'select_result' => '选择结果',
'select' => '请选择',
'monday' => '星期一',
'tuesday' => '星期二',
'wednesday' => '星期三',
'thursday' => '星期四',
'friday' => '星期五',
'saturday' => '星期六',
'sunday' => '星期日',
'user_not_exist' => '用户不存在',
'table_not_run' => '该桌子暂时没有营运',
'tableNotRun' => '该桌子暂时没有营运',
'bet_fail' => '下注失败,服务器链接失败',
'no_right' => '你无权操作',
'bet_status_1' => '接受下注',
'bet_status_0' => '尚未接受下注',
'bet_status_2' => '停止下注-等待开盘',
'confirm' => '确定',
'cancel' => '取消',
'connect_fail' => '您已断开链接,请返回重新进入',
'message' => '信息',
'table_status_0' => '桌子运营中',
'table_status_1' => '洗牌中',
'table_status_2' => '停台中',
'link_server_fail' => '与服务通讯失败',
'link_server_fail_1' => '荷官不在线',
'link_server_fail_2' => '与服务通讯失败2',
'link_server_fail_3' => '与服务通讯失败3',
'appid_error' => 'appid 错误',
'appsecret_error' => 'appsecret 错误',
'appid_or_appsecret_error' => 'appid或appsecret 错误',
'param_error' => '参数错误',
'illegal_request' => '非法请求',
'balance_success' => '日结算成功',
'balance_fail' => '日结算失败',
'balance_fail_1' => '日结算失败1',
'balance_fail_2' => '日结算失败2',
'table_status_error' => '请把桌子更改为"洗牌状态"再进行日结算',
'boot_settle_success' => '靴结算成功',
'boot_settle_fail' => '靴结算失败',
'boot_settle_fail_1' => '换靴失败,该桌子还没有靴,请进行日结',
'boot_settle_fail_2' => '换靴失败,该桌子已经结算,请重新登录再继续',
'boot_settle_fail_3' => '该铺尚未结束,请开出结果后再换靴',
'start_bet_success' => '开始下注成功',
'start_bet_fail' => '开始下注失败',
'start_bet_fail_1' => '开始下注失败,下注铺已经开始下注或者已经停止了下注',
'start_bet_fail_2' => '开始下注失败,下注铺信息有误',
'start_bet_fail_3' => '操作失败,请确保桌子不是在洗牌中或者停台中状态',
'end_bet_success' => '结束下注成功',
'end_bet_fail' => '结束下注失败',
'end_bet_fail_1' => '停止下注失败,该铺还没开始接受下注或者已经停止了下注',
'end_bet_fail_2' => '开始下注失败,下注铺信息有误',
'to_bet_success' => '下注成功',
'to_bet_fail' => '下注失败',
'to_bet_fail_1' => '余额不足,不能下注',
'to_bet_fail_2' => '会员信息错误,不能下注',
'to_bet_fail_3' => '已超过允许的下注时间,不能下注',
'to_bet_fail_4' => '该局不是在可以下注的状态,不能下注',
'to_bet_fail_5' => '下注失败,下注铺信息有误',
'to_bet_fail_6' => '下注金额必须大于0',
'to_bet_fail_7' => '超过50局后无法下注幸运6',
'to_bet_fail_8' => '超过30局后无法下注大小',
'opening_success' => '开盘结果成功',
'opening_fail' => '开盘结果失败',
'opening_fail_1' => '开结果失败,请确认该局是处于停止下注的状态',
'opening_fail_2' => '开盘失败,开盘铺信息有误',
'opening_fail_3' => '请输入开盘结果',
'opening_fail_4' => '下注未结束,无法开结果',
'opening_fail_5' => '开盘失败,庄闲牌面不齐',
'opening_fail_6' => '开牌数据不存在',
'retreated_success' => '修改成功',
'retreated_fail' => '修改失败',
'retreated_fail_1' => '请正确选择结果',
'retreated_fail_2' => '没有上一铺数据可更改',
'retreated_fail_3' => '靴信息错误',
'retreated_fail_4' => '回合信息错误',
'retreated_fail_5' => '桌子信息错误',
'retreated_fail_6' => '游戏类型错误',
// PC投注页面 简体中文语言包
'welcome' => '欢迎您',
'account' => '账号',
'money' => '余额',
'language' => '语言',
'rule' => '规则',
'record' => '记录',
'user' => '个人中心',
'log_out' => '退出游戏',
'limit' => '限红',
'game' => '游戏',
'baccarat' => '百家乐',
'dt' => '龙虎',
'color_plate' => '色碟',
'sic_bo' => '骰宝',
'roulette' => '轮盘',
'start_date' => '开始日期',
'end_date' => '结束日期',
'search' => '查询',
'ttf' => '桌台/时间/局号',
'total' => '合计',
'card' => '牌',
'banker_all' => '庄',
'player_all' => '闲',
'tie_all' => '和',
'banker_pair_all' => '庄对',
'player_pair_all' => '闲对',
'both_pair_all' => '庄闲对',
'banker_doub_all' => '庄翻倍',
'player_doub_all' => '闲翻倍',
'dragon_all' => '龙',
'tiger_all' => '虎',
'full_screen' => '全屏',
'exit_full_screen' => '退出全屏',
'back' => '返回',
'sound' => '声音',
'statistics' => '统计',
'b_query' => '庄问路',
'p_query' => '闲问路',
'd_query' => '龙问路',
't_query' => '虎问路',
'line' => '线路',
'line_1' => '近景',
'line_2' => '远景',
'line_3' => '线路三',
'lobby' => '大厅',
'video_line_error' => '视频线路错误',
'lose' => '输',
'win' => '赢',
'to_bet_confirm_tip' => '请下注后再点击确定',
'browser_tip' => '请使用谷歌、360、QQ、百度、火狐、或者IE10以上版本的高级浏览器进入游戏',
'select_chip_tip' => '请选择下注筹码',
'recharge_tip' => '余额不足,请充值',
'instant_pot' => '即时彩池',
'bet' => '下注',
'settlement' => '结算结果',
'no_bet_data' => '没有下注数据',
'personal_limit_banker_high' => '个人限红:庄最高下注额为',
'personal_limit_banker_low' => '个人限红:庄最低下注额为',
'personal_limit_player_high' => '个人限红:闲最高下注额为',
'personal_limit_player_low' => '个人限红:闲最低下注额为',
'personal_limit_tie_high' => '个人限红:和最高下注额为',
'personal_limit_tie_low' => '个人限红:和最低下注额为',
'personal_limit_banker_pair_high' => '个人限红:庄对最高下注额为',
'personal_limit_banker_pair_low' => '个人限红:庄对最低下注额为',
'personal_limit_player_pair_high' => '个人限红:闲对最高下注额为',
'personal_limit_player_pair_low' => '个人限红:闲对最低下注额为',
'personal_limit_dragon_high' => '个人限红:龙最高下注额为',
'personal_limit_dragon_low' => '个人限红:龙最低下注额为',
'personal_limit_tiger_high' => '个人限红:虎最高下注额为',
'personal_limit_tiger_low' => '个人限红:虎最低下注额为',
'game_not_start' => '游戏尚未开始',
'game_stop_bet' => '本局游戏已停止下注',
'leave_table_tip' => '确定要离开当前游戏台吗?',
'select_chip_tip' => '请选择下注筹码',
// wap电投和网投语言包
'coming_soon' => '即将推出',
'game_room' => '游戏大厅',
'edit_pass' => '修改密码',
'change_password' => '修改密码',
'phone' => '联系电话',
'last_login_time' => '上次登陆时间',
'recharge' => '充值上分',
'withdraw' => '申请下分',
'bill' => '账单',
'game_record' => '游戏记录',
'baccarat_total_bet_count' => '百家乐总下注次数',
'dt_total_bet_count' => '龙虎总下注次数',
'total_cleared_wash_code' => '已结算洗码总额',
'uncleared_total_wash_code' => '未结算洗码总额',
'wash_rate' => '洗码率',
'current_password' => '请输入旧密码',
'new_password' => '请输入新密码',
'confirm_password' => '再次输入新密码',
'current_password_tip' => '请输入旧密码',
'new_password_tip' => '新密码不能小于6个字符',
'confirm_password_tip' => '两次输入的密码不一致',
'login_again' => '请重新登录',
'login' => '登录',
'sign_in' => '登录',
'account_login' => '已有账户登录',
'register' => '注册',
'register_new_user' => '新用户注册',
'password' => '密码',
'register_password_length_tip' => '密码不能小于6个字符',
'register_account_length_tip' => '账号不能小于6个字符',
'register_account_exist_tip' => '账号已存在',
'register_account_tip' => '6-20位英文.数字组成',
'register_password_tip' => '6-20位字符.不包含空格',
'register_confirm_password_tip' => '再输入一遍登录密码',
'register_success' => '注册成功',
'register_fail' => '注册失败',
'password_not_empty' => '旧密码或新密码不能为空',
'change_password_success' => '修改密码成功',
'change_password_fail' => '修改密码失败',
'current_password_error' => '旧密码错误',
'recharge_unsupport_tip' => '上分暂时未开启,请联系您的代理上分',
'withdraw_unsupport_tip' => '下分暂时未开启,请联系您的代理下分',
'select_time' => '选择时间',
'start_time_tip' => '请选择开始时间',
'end_time_tip' => '请选择结束时间',
'wash_code_amount' => '洗码量',
'code_amount' => '码量',
'net_code_amount' => '净码量',
'wash_code_time' => '洗码时间',
'extraction_method' => '提取方式',
'deposit_money' => '存入余额',
'setup' => '设置',
'mute' => '静音',
'voice' => '开声',
'win_or_lose' => '输赢',
'account_tip' => '请输入账号',
'password_tip' => '请输入密码',
'read_and_agree' => '我已阅读并同意',
'rule_and_agreement' => '游戏规则与用户协议',
'account_or_password_error' => '账号或密码错误',
'account_not_exist' => '账号不存在',
'force_offline' => '你已被管理员强制下线',
'auto_back' => '5局内未下注自动返回游戏大厅',
'reset_number' => '作废',
'is_reset_number' => '是否作废当前该局?',
'reset_number_success' => '操作成功',
'reset_number_fail_1' => '操作失败,该靴已经结算',
'reset_number_fail_2' => '操作失败,该桌子已经结算',
'reset_number_fail_3' => '操作失败,下注状态不符',
'reset_number_msg' => '该局已重置,请重新下注',
// 系统错误提示
'Undefined variable' => '未定义变量',
'Undefined index' => '未定义数组索引',
'Undefined offset' => '未定义数组下标',
'Parse error' => '语法解析错误',
'Type error' => '类型错误',
'Fatal error' => '致命错误',
'syntax error' => '语法错误',
// 框架核心错误提示
'dispatch type not support' => '不支持的调度类型',
'method param miss' => '方法参数错误',
'method not exists' => '方法不存在',
'module not exists' => '模块不存在',
'controller not exists' => '控制器不存在',
'class not exists' => '类不存在',
'property not exists' => '类的属性不存在',
'template not exists' => '模板文件不存在',
'illegal controller name' => '非法的控制器名称',
'illegal action name' => '非法的操作名称',
'url suffix deny' => '禁止的URL后缀访问',
'Route Not Found' => '当前访问路由未定义',
'Undefined db type' => '未定义数据库类型',
'variable type error' => '变量类型错误',
'PSR-4 error' => 'PSR-4 规范错误',
'not support total' => '简洁模式下不能获取数据总数',
'not support last' => '简洁模式下不能获取最后一页',
'error session handler' => '错误的SESSION处理器类',
'not allow php tag' => '模板不允许使用PHP语法',
'not support' => '不支持',
'redisd master' => 'Redisd 主服务器错误',
'redisd slave' => 'Redisd 从服务器错误',
'must run at sae' => '必须在SAE运行',
'memcache init error' => '未开通Memcache服务,请在SAE管理平台初始化Memcache服务',
'KVDB init error' => '没有初始化KVDB,请在SAE管理平台初始化KVDB服务',
'fields not exists' => '数据表字段不存在',
'where express error' => '查询表达式错误',
'no data to update' => '没有任何数据需要更新',
'miss data to insert' => '缺少需要写入的数据',
'miss complex primary data' => '缺少复合主键数据',
'miss update condition' => '缺少更新条件',
'model data Not Found' => '模型数据不存在',
'table data not Found' => '表数据不存在',
'delete without condition' => '没有条件不会执行删除操作',
'miss relation data' => '缺少关联表数据',
'tag attr must' => '模板标签属性必须',
'tag error' => '模板标签错误',
'cache write error' => '缓存写入失败',
'sae mc write error' => 'SAE mc 写入错误',
'route name not exists' => '路由标识不存在(或参数不够)',
'invalid request' => '非法请求',
'bind attr has exists' => '模型的属性已经存在',
'relation data not exists' => '关联数据不存在',
'relation not support' => '关联不支持',
'chunk not support order' => 'Chunk不支持调用order方法',
// 上传错误信息
'unknown upload error' => '未知上传错误!',
'file write error' => '文件写入失败!',
'upload temp dir not found' => '找不到临时文件夹!',
'no file to uploaded' => '没有文件被上传!',
'only the portion of file is uploaded' => '文件只有部分被上传!',
'upload File size exceeds the maximum value' => '上传文件大小超过了最大值!',
'upload write error' => '文件上传保存错误!',
'has the same filename: {:filename}' => '存在同名文件:{:filename}',
'upload illegal files' => '非法上传文件',
'illegal image files' => '非法图片文件',
'extensions to upload is not allowed' => '上传文件后缀不允许',
'mimetype to upload is not allowed' => '上传文件MIME类型不允许!',
'filesize not match' => '上传文件大小不符!',
'directory {:path} creation failed' => '目录 {:path} 创建失败!',
// Validate Error Message
':attribute require' => ':attribute不能为空',
':attribute must be numeric' => ':attribute必须是数字',
':attribute must be integer' => ':attribute必须是整数',
':attribute must be float' => ':attribute必须是浮点数',
':attribute must be bool' => ':attribute必须是布尔值',
':attribute not a valid email address' => ':attribute格式不符',
':attribute not a valid mobile' => ':attribute格式不符',
':attribute must be a array' => ':attribute必须是数组',
':attribute must be yes,on or 1' => ':attribute必须是yes、on或者1',
':attribute not a valid datetime' => ':attribute不是一个有效的日期或时间格式',
':attribute not a valid file' => ':attribute不是有效的上传文件',
':attribute not a valid image' => ':attribute不是有效的图像文件',
':attribute must be alpha' => ':attribute只能是字母',
':attribute must be alpha-numeric' => ':attribute只能是字母和数字',
':attribute must be alpha-numeric, dash, underscore' => ':attribute只能是字母、数字和下划线_及破折号-',
':attribute not a valid domain or ip' => ':attribute不是有效的域名或者IP',
':attribute must be chinese' => ':attribute只能是汉字',
':attribute must be chinese or alpha' => ':attribute只能是汉字、字母',
':attribute must be chinese,alpha-numeric' => ':attribute只能是汉字、字母和数字',
':attribute must be chinese,alpha-numeric,underscore, dash' => ':attribute只能是汉字、字母、数字和下划线_及破折号-',
':attribute not a valid url' => ':attribute不是有效的URL地址',
':attribute not a valid ip' => ':attribute不是有效的IP地址',
':attribute must be dateFormat of :rule' => ':attribute必须使用日期格式 :rule',
':attribute must be in :rule' => ':attribute必须在 :rule 范围内',
':attribute be notin :rule' => ':attribute不能在 :rule 范围内',
':attribute must between :1 - :2' => ':attribute只能在 :1 - :2 之间',
':attribute not between :1 - :2' => ':attribute不能在 :1 - :2 之间',
'size of :attribute must be :rule' => ':attribute长度不符合要求 :rule',
'max size of :attribute must be :rule' => ':attribute长度不能超过 :rule',
'min size of :attribute must be :rule' => ':attribute长度不能小于 :rule',
':attribute cannot be less than :rule' => ':attribute日期不能小于 :rule',
':attribute cannot exceed :rule' => ':attribute日期不能超过 :rule',
':attribute not within :rule' => '不在有效期内 :rule',
'access IP is not allowed' => '不允许的IP访问',
'access IP denied' => '禁止的IP访问',
':attribute out of accord with :2' => ':attribute和确认字段:2不一致',
':attribute cannot be same with :2' => ':attribute和比较字段:2不能相同',
':attribute must greater than or equal :rule' => ':attribute必须大于等于 :rule',
':attribute must greater than :rule' => ':attribute必须大于 :rule',
':attribute must less than or equal :rule' => ':attribute必须小于等于 :rule',
':attribute must less than :rule' => ':attribute必须小于 :rule',
':attribute must equal :rule' => ':attribute必须等于 :rule',
':attribute has exists' => ':attribute已存在',
':attribute not conform to the rules' => ':attribute不符合指定规则',
'invalid Request method' => '无效的请求类型',
'invalid token' => '令牌数据无效',
'not conform to the rules' => '规则错误',
'in_top_sumday' => '该桌子处于最新的日结天数,请明天再进行日结',
'exceeds_limit' => '下注超出限紅',
'exceeds_limit_table' => '下注超出桌子限紅',
'exceeds_limit_user' => '下注超出个人限紅',
'under_limit_user' => '下注低于个人限紅',
'end_bet_error' => '已停止下注',
'end_bet_error_1' => '当前局状态不在下注状态,不能停止',
'end_bet_error_2' => '停止下注失败',
'repeated_entry' => '你的账号在其他地方登陆了,即将退出',
'online_entrance' => '电投登录入口',
'onlinechip_entrance' => '网投登录入口',
'agent_entrance' => '代理端登录入口',
'login_entrance' => '登录入口',
'change_boot_false' => '当前有下注,不能结算,请开结果后再进行结算',
'win_limit_tip' => '已达到日赢上限,无法下注',
'toning_result_0' => '0红4白',
'toning_result_1' => '1红3白',
'toning_result_2' => '2红2白',
'toning_result_3' => '3红1白',
'toning_result_4' => '4红0白',
'toning_zero' => '0区下注额',
'toning_four' => '4区下注额',
'toning_one' => '1区下注额',
'toning_three' => '3区下注额',
'toning_big' => '大区下注额',
'toning_small' => '小区下注额',
'toning_singular' => '单区下注额',
'toning_plural' => '双区下注额',
'dice_small' => '大小-小下注额',
'dice_big' => '大小-大下注额',
'dice_singular' => '单双-单下注额',
'dice_plural' => '单双-双区下注额',
'dice_two_11' => '双骰-1下注额',
'dice_two_22' => '双骰-2下注额',
'dice_two_33' => '双骰-3下注额',
'dice_two_44' => '双骰-4下注额',
'dice_two_55' => '双骰-5下注额',
'dice_two_66' => '双骰-6下注额',
'dice_leopard' => '全围下注额',
'dice_three_111' => '围骰-1下注额',
'dice_three_222' => '围骰-2下注额',
'dice_three_333' => '围骰-3下注额',
'dice_three_444' => '围骰-4下注额',
'dice_three_555' => '围骰-5下注额',
'dice_three_666' => '围骰-6下注额',
'dice_number_4' => '总和-4下注额',
'dice_number_5' => '总和-5下注额',
'dice_number_6' => '总和-6下注额',
'dice_number_7' => '总和-7下注额',
'dice_number_8' => '总和-8下注额',
'dice_number_9' => '总和-9下注额',
'dice_number_10' => '总和-10下注额',
'dice_number_11' => '总和-11下注额',
'dice_number_12' => '总和-12下注额',
'dice_number_13' => '总和-13下注额',
'dice_number_14' => '总和-14下注额',
'dice_number_15' => '总和-15下注额',
'dice_number_16' => '总和-16下注额',
'dice_number_17' => '总和-17下注额',
'dice_two_12' => '组合-1+2下注额',
'dice_two_13' => '组合-1+3下注额',
'dice_two_14' => '组合-1+4下注额',
'dice_two_15' => '组合-1+5下注额',
'dice_two_16' => '组合-1+6下注额',
'dice_two_23' => '组合-2+3下注额',
'dice_two_24' => '组合-2+4下注额',
'dice_two_25' => '组合-2+5下注额',
'dice_two_26' => '组合-2+6下注额',
'dice_two_34' => '组合-3+4下注额',
'dice_two_35' => '组合-3+5下注额',
'dice_two_36' => '组合-3+6下注额',
'dice_two_45' => '组合-4+5下注额',
'dice_two_46' => '组合-4+6下注额',
'dice_two_56' => '组合-5+6下注额',
'dice_living_1' => '点数-1下注额',
'dice_living_2' => '点数-2下注额',
'dice_living_3' => '点数-3下注额',
'dice_living_4' => '点数-4下注额',
'dice_living_5' => '点数-5下注额',
'dice_living_6' => '点数-6下注额',
'european' => '欧式',
'french' => '法式',
'roulette_straight' => '直注',
'roulette_split' => '分注',
'roulette_street' => '街注',
'roulette_triple' => '三数',
'roulette_corner' => '角注',
'roulette_four' => '角注',
'roulette_line' => '线注',
'roulette_dozen' => '打注',
'roulette_column' => '列注',
'roulette_red' => '红',
'roulette_black' => '黑',
'roulette_odd' => '单',
'roulette_even' => '双',
'roulette_low' => '小',
'roulette_high' => '大',
'roulette_column_1' => '第一列',
'roulette_column_2' => '第二列',
'roulette_column_3' => '第三列',
'roulette_dozen_1' => '第一打',
'roulette_dozen_2' => '第二打',
'roulette_dozen_3' => '第三打',
'roulette_zeroGame' => '轮上零旁',
'roulette_neighborsOfZero' => '零旁注上角',
'roulette_orphans' => '轮上孤注',
'roulette_theThird' => '轮盘下角注',
];
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -3,6 +3,7 @@ declare (strict_types = 1);
namespace app\listener;
use app\utils\Logger;
use freedom\utils\SocketSession;
use think\swoole\WebSocket;
@@ -55,6 +56,6 @@ class WsClose
}
$tableFd->del((string) $fd);
$ws->leave(SocketSession::HOUSE_NAME);
echo $fd.":退出\n";
Logger::info(Logger::CAT_CONNECT, 'ws_close', ['fd' => $fd, 'mode' => $mode, 'table_id' => $fdInfo['table_id'] ?? '']);
}
}
+6
View File
@@ -7,6 +7,7 @@ use app\services\connect\ScanConnectService;
use app\services\connect\SpaceConnectService;
use app\services\connect\UserConnectService;
use app\services\connect\ManagerConnectService;
use app\utils\Logger;
use think\Request;
class WsConnect
@@ -18,6 +19,11 @@ class WsConnect
*/
public function handle(Request $event){
$connect = $event->get('connect');
Logger::info(Logger::CAT_CONNECT, 'ws_connect', [
'mode' => $connect,
'table_id' => $event->get('table_id'),
'account' => $event->get('account'),
]);
switch ($connect) {
case 'space':
SpaceConnectService::doSpaceConnect($event);
+3
View File
@@ -4,6 +4,7 @@ declare (strict_types = 1);
namespace app\listener\space;
use app\models\process\Boot;
use app\utils\Logger;
use freedom\utils\SocketSession;
use think\swoole\WebSocket;
@@ -22,7 +23,9 @@ class ChangeBoot
$modelRes = Boot::changeBoot($tableInfo);
if ($modelRes['status'] == true){
$ws->to(SocketSession::HOUSE_NAME)->emit('changeBoot',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $modelRes['data']]);
Logger::info(Logger::CAT_GAME, 'change_boot', ['table_id' => $tableInfo['id'], 'table_name' => $tableInfo['table_name']]);
}else{
Logger::warn(Logger::CAT_GAME, 'change_boot_fail', ['table_id' => $tableInfo['id'], 'msg' => $modelRes['msg']]);
$ws->emit('changeBoot', ['status' => false, 'msg' => $modelRes['msg']]);
}
}else{
+4
View File
@@ -4,6 +4,7 @@ declare (strict_types = 1);
namespace app\listener\space;
use app\models\process\Sumday;
use app\utils\Logger;
use freedom\utils\SocketSession;
use think\swoole\Websocket;
@@ -22,11 +23,14 @@ class ResetBoot
$modelRes = Sumday::resetBoot($tableInfo);
if ($modelRes['status'] == true){
$ws->to(SocketSession::HOUSE_NAME)->emit('resetBoot',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $modelRes['data']]);
Logger::info(Logger::CAT_GAME, 'reset_boot_success', ['table_id' => $tableInfo['id']]);
}else{
$ws->emit('resetBoot', ['status' => false, 'msg' => $modelRes['msg']]);
Logger::warn(Logger::CAT_GAME, 'reset_boot_fail', ['table_id' => $tableInfo['id'], 'reason' => $modelRes['msg']]);
}
}else{
$ws->emit('resetBoot', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
Logger::warn(Logger::CAT_GAME, 'reset_boot_fail', ['reason' => $preliminaryCheckRes['msg']]);
}
}
}
BIN
View File
Binary file not shown.
+4 -1
View File
@@ -136,7 +136,7 @@ class NumberTab extends BaseModel
{
$numberTabInfo = self::get(['id' => $numberTabId]);
if (!$numberTabInfo) return ['status' => false, 'msg' => 'end_bet_fail'];
if ($numberTabInfo['bet_status'] != 1) return ['status' => false, 'msg' => 'end_bet_error'];
if ($numberTabInfo['bet_status'] != 1) return ['status' => false, 'msg' => 'end_bet_error', 'bet_status' => $numberTabInfo['bet_status']];
self::where(['id' => $numberTabInfo['id']])->update(['bet_status' => 2, 'bet_end_time' => time()]);
$numberTabInfo['bet_status'] = 2;
$numberTabInfo['bet_start_time'] = time();
@@ -687,6 +687,9 @@ class NumberTab extends BaseModel
'result_before_edit' => $numberTabInfo['result'],
'pair' => $event['pair'],
'pair_before_edit' => $numberTabInfo['pair'],
'luck_six' => intval($event['luck_six'] ?? 0),
'dragon_seven' => intval($event['dragon_seven'] ?? 0),
'panda_eight' => intval($event['panda_eight'] ?? 0),
);
NumberTab::where(['id' => $numberTabInfo['id']])->update($updateNumberTab);
BIN
View File
Binary file not shown.
@@ -4,6 +4,7 @@
namespace app\services\bet;
use app\models\bet\Bet;
use app\utils\Logger;
use freedom\utils\SocketSession;
/**
@@ -156,8 +157,10 @@ class ToBetBaccaratService
),
);
$ws->to(SocketSession::HOUSE_NAME)->emit('allBetAmount',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_BET, 'baccarat_bet_success', ['user_id' => $userInfo['id'], 'table_id' => $tableInfo['id'], 'amount' => $amount]);
}else{
$ws->emit('toBet',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => 'to_bet_fail']);
Logger::warn(Logger::CAT_BET, 'baccarat_bet_db_fail', ['user_id' => $userInfo['id'], 'table_id' => $tableInfo['id'], 'amount' => $amount]);
}
SocketSession::resetRepeat($fd,'user','isToBet');
}
+15 -1
View File
@@ -9,6 +9,7 @@ use app\models\process\NumberTab;
use app\models\user\User;
use app\models\user\Session;
use app\services\connect\InitTableService;
use app\utils\Logger;
class ToBetCommonService
{
@@ -24,48 +25,61 @@ class ToBetCommonService
/** 通用检验重复部分开始 */
$amount = array_sum($data);
if ($amount == 0){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['reason' => 'to_bet_fail_6', 'detail' => 'zero_amount']);
return ['status' => false, 'msg' => 'to_bet_fail_6'];
}
$numberTabId = isset($event['number_tab_id']) && intval($event['number_tab_id']) > 0 ? intval($event['number_tab_id']) : 0;
$userId = isset($event['user_id']) && intval($event['user_id']) > 0 ? intval($event['user_id']) : 0;
$userInfo = User::get(['id' => $userId, 'status' => 1, 'is_delete' => 0]);
if (!$userInfo) return ['status' => false, 'msg' => 'to_bet_fail_2'];
if (!$userInfo) {
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_2', 'detail' => 'user_not_found']);
return ['status' => false, 'msg' => 'to_bet_fail_2'];
}
if($userInfo['bet_type'] == 2){
$session_id = $userInfo['api_token'];
$sessionInfo = Session::get(['session_id' => $session_id]);
if(!$sessionInfo){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_9', 'detail' => 'session_not_found']);
return ['status' => false, 'msg' => 'to_bet_fail_9'];
}
if(!$sessionInfo['server_status']){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_10', 'detail' => 'server_status_off']);
return ['status' => false, 'msg' => 'to_bet_fail_10'];
}
}
// 使用 InitTableService::initTable 获取当前靴的最新一局,与其他服务保持一致
$numberTabInfo = InitTableService::initTable($tableInfo);
if ($numberTabInfo['id'] != $numberTabId){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_5', 'detail' => 'number_tab_mismatch']);
return ['status' => false, 'msg' => 'to_bet_fail_5'];
}
if ($numberTabInfo['bet_status'] != 1 || time() > ($numberTabInfo['bet_start_time'] + $tableInfo['wait_time'])){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_4', 'detail' => 'bet_closed_or_timeout']);
return ['status' => false, 'msg' => 'to_bet_fail_4'];
}
// 超过50局幸运6禁止下注
if ($numberTabInfo['number'] > 50 && isset($event['luck_six_amount']) && $event['luck_six_amount'] > 0){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_7', 'detail' => 'luck_six_over_50_rounds']);
return ['status' => false, 'msg' => 'to_bet_fail_7'];
}
// 超过30局大小禁止下注
if ($numberTabInfo['number'] > 30 && isset($event['big_amount']) && $event['big_amount'] > 0){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_8', 'detail' => 'big_over_30_rounds']);
return ['status' => false, 'msg' => 'to_bet_fail_8'];
}
if ($numberTabInfo['number'] > 30 && isset($event['small_amount']) && $event['small_amount'] > 0){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_8', 'detail' => 'small_over_30_rounds']);
return ['status' => false, 'msg' => 'to_bet_fail_8'];
}
if($userInfo['win_limit'] > 0){
$winTotalToday = Bet::getWinTotalToday($userInfo['id']);
if($winTotalToday >= $userInfo['win_limit']){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'win_limit_tip', 'detail' => 'daily_win_limit_reached']);
return ['status' => false, 'msg' => 'win_limit_tip'];
}
}
if ($userInfo['money'] < $amount){
Logger::warn(Logger::CAT_BET, 'bet_rejected', ['user_id' => $userId, 'table_id' => $tableInfo['id'] ?? 0, 'reason' => 'to_bet_fail_1', 'detail' => 'insufficient_balance']);
return ['status' => false, 'msg' => 'to_bet_fail_1'];
}
return ['status' => true, 'numberTabInfo' => $numberTabInfo, 'userInfo' => $userInfo];
+4
View File
@@ -3,6 +3,7 @@
namespace app\services\bet;
use app\models\bet\Bet;
use app\utils\Logger;
use freedom\utils\DiceUtil;
use freedom\utils\SocketSession;
@@ -33,6 +34,7 @@ class ToBetDiceService{
$time = time();
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
if ($toBetCheck['status'] == false){
Logger::warn(Logger::CAT_BET, 'dice_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;
@@ -90,6 +92,7 @@ class ToBetDiceService{
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0);
$numberTabAmount = string_to_array($numberTabInfo['dice_amount']);
if($res){
Logger::info(Logger::CAT_BET, 'dice_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']);
$totalAmountArray = DiceUtil::amountInc($numberTabAmount, $data);
$round = [
@@ -98,6 +101,7 @@ class ToBetDiceService{
];
$ws->to(SocketSession::HOUSE_NAME)->emit('allBetAmount',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
}else{
Logger::warn(Logger::CAT_BET, 'dice_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');
+4
View File
@@ -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');
+4
View File
@@ -4,6 +4,7 @@
namespace app\services\bet;
use app\models\bet\Bet;
use app\utils\Logger;
use freedom\utils\SocketSession;
/**
@@ -49,6 +50,7 @@ class ToBetNnService
$time = time();
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
if ($toBetCheck['status'] == false){
Logger::warn(Logger::CAT_BET, 'nn_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;
@@ -181,9 +183,11 @@ class ToBetNnService
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0);
if($res){
Logger::info(Logger::CAT_BET, 'nn_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']);
// 待确定是否推送即时彩池,现不推送
}else{
Logger::warn(Logger::CAT_BET, 'nn_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');
@@ -3,6 +3,7 @@
namespace app\services\bet;
use app\models\bet\Bet;
use app\utils\Logger;
use freedom\utils\RouletteUtil;
use freedom\utils\SocketSession;
@@ -36,6 +37,7 @@ class ToBetRouletteService{
$time = time();
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
if ($toBetCheck['status'] == false){
Logger::warn(Logger::CAT_BET, 'roulette_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;
@@ -54,6 +56,7 @@ class ToBetRouletteService{
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0,$fieldName);
$numberTabAmount = string_to_array($numberTabInfo[$fieldName]);
if($res){
Logger::info(Logger::CAT_BET, 'roulette_bet_success', ['user_id' => $userInfo['id'], 'table_id' => $tableInfo['id'], 'amount' => $amount]);
$ws->emit('toBet',['status' => true, 'table_id' => $tableInfo['id'], 'bet_amount_msg' => [$fieldName => $betTotalAmount], 'money' => ($userInfo['money'] - $amount),'seat_num' => $seat_num, 'msg' => 'to_bet_success']);
$totalAmountArray = RouletteUtil::amountInc($numberTabAmount, $data);
$round = [
@@ -62,6 +65,7 @@ class ToBetRouletteService{
];
$ws->to(SocketSession::HOUSE_NAME)->emit('allBetAmount',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
}else{
Logger::warn(Logger::CAT_BET, 'roulette_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');
+4
View File
@@ -4,6 +4,7 @@
namespace app\services\bet;
use app\models\bet\Bet;
use app\utils\Logger;
use freedom\utils\SocketSession;
/**
@@ -50,6 +51,7 @@ class ToBetTcService
$time = time();
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
if ($toBetCheck['status'] == false){
Logger::warn(Logger::CAT_BET, 'tc_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;
@@ -182,9 +184,11 @@ class ToBetTcService
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0);
if($res){
Logger::info(Logger::CAT_BET, 'tc_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']);
// 待确定是否推送即时彩池,现不推送
}else{
Logger::warn(Logger::CAT_BET, 'tc_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');
+4
View File
@@ -4,6 +4,7 @@
namespace app\services\bet;
use app\models\bet\Bet;
use app\utils\Logger;
use freedom\utils\SocketSession;
/**
@@ -36,6 +37,7 @@ class ToBetToningService
$time = time();
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
if ($toBetCheck['status'] == false){
Logger::warn(Logger::CAT_BET, 'toning_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;
@@ -89,6 +91,7 @@ class ToBetToningService
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0);
$numberTabAmount = string_to_array($numberTabInfo['toning_amount']);
if($res){
Logger::info(Logger::CAT_BET, 'toning_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']);
$round = array(
'toning_zero' => isset($numberTabAmount['toning_zero']) ? intval($numberTabAmount['toning_zero'] + $data['toning_zero']) : $data['toning_zero'],
@@ -113,6 +116,7 @@ class ToBetToningService
);
$ws->to(SocketSession::HOUSE_NAME)->emit('allBetAmount',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
}else{
Logger::warn(Logger::CAT_BET, 'toning_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');
+16 -6
View File
@@ -7,6 +7,7 @@ namespace app\services\connect;
use app\models\process\Boot;
use app\models\process\NumberTab;
use app\models\process\Sumday;
use app\utils\Logger;
/**
* TODO 桌子状态服务
@@ -22,15 +23,24 @@ class InitTableService
*/
public static function initTable(array $tableInfo): array
{
//查询日结
$lastSumday = Sumday::getByTableIdOrderByIdDesc($tableInfo);
if (!$lastSumday) $lastSumday = Sumday::addByTable($tableInfo);
//查询靴
if (!$lastSumday) {
$lastSumday = Sumday::addByTable($tableInfo);
Logger::info(Logger::CAT_GAME, 'init_create_sumday', ['table_id' => $tableInfo['id']]);
}
$lastBoot = Boot::getByTableIdOrderByIdDesc($tableInfo);
if (!$lastBoot) $lastBoot = Boot::addBySumday($lastSumday);
//查询铺
if (!$lastBoot) {
$lastBoot = Boot::addBySumday($lastSumday);
Logger::info(Logger::CAT_GAME, 'init_create_boot', ['table_id' => $tableInfo['id'], 'sumday_id' => $lastSumday['id'] ?? '']);
}
$lastNumberTab = NumberTab::getByBootIdOrderByIdDesc($lastBoot);
if (!$lastNumberTab) $lastNumberTab = NumberTab::addByBoot($lastBoot);
if (!$lastNumberTab) {
$lastNumberTab = NumberTab::addByBoot($lastBoot);
Logger::info(Logger::CAT_GAME, 'init_create_number_tab', ['table_id' => $tableInfo['id'], 'boot_id' => $lastBoot['id'] ?? '']);
}
if (!$lastNumberTab) {
Logger::warn(Logger::CAT_GAME, 'init_table_fail', ['table_id' => $tableInfo['id'], 'table_name' => $tableInfo['table_name'] ?? '']);
}
return $lastNumberTab;
}
@@ -6,6 +6,7 @@ namespace app\services\connect;
use app\models\process\NumberTab;
use app\models\table\Table;
use app\utils\Logger;
use freedom\utils\SocketSession;
use think\Request;
@@ -30,6 +31,7 @@ class ScanConnectService
if (!$numberTabInfo){
$ws->emit('onlineLogin',['status' => false, 'msg' => 'Not NumberTab Data']);
$ws->close();
Logger::warn(Logger::CAT_CONNECT, 'scan_connect_fail', ['table_id' => $tableId, 'reason' => 'no_number_tab_data']);
return;
}
$round = array();
@@ -45,5 +47,6 @@ class ScanConnectService
}
$ws->join(SocketSession::HOUSE_NAME);
$ws->emit('onlineLogin',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_CONNECT, 'scan_connect_success', ['table_id' => $tableId]);
}
}
+4 -1
View File
@@ -6,6 +6,7 @@ namespace app\services\connect;
use app\models\table\Table;
use app\models\table\UserController;
use app\utils\Logger;
use freedom\utils\SocketSession;
use think\Request;
@@ -38,8 +39,8 @@ class SpaceConnectService
$username = trim($event->get('account'));
$userController = UserController::get(['id' => $userId, 'username' => $username, 'login_token' => $loginToken]);
if (!$tableInfo || !$userController){
Logger::warn(Logger::CAT_CONNECT, 'space_auth_fail', ['table_id' => $tableId, 'username' => $username, 'has_table' => !!$tableInfo, 'has_user' => !!$userController]);
$ws->emit('onlineLogin',['status' => false, 'msg' => 'not_table_data']);
//$ws->close();
return;
}
$lastNumberTab = InitTableService::initTable($tableInfo);
@@ -54,7 +55,9 @@ class SpaceConnectService
$round['show_card'] = GetCardService::getCard($tableInfo,$lastNumberTab);
$ws->emit('onlineLogin',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
SocketSession::saveSocketSession(['table_id' => $tableInfo['id'], 'table_name' => $tableInfo['table_name']],'space');
Logger::info(Logger::CAT_CONNECT, 'space_login_ok', ['table_id' => $tableInfo['id'], 'table_name' => $tableInfo['table_name'], 'username' => $username]);
}else{
Logger::warn(Logger::CAT_CONNECT, 'space_init_fail', ['table_id' => $tableId, 'username' => $username]);
$ws->emit('onlineLogin',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => 'link_server_fail']);
//$ws->close();
}
@@ -5,6 +5,7 @@ namespace app\services\connect;
use app\models\user\User;
use app\utils\Logger;
use freedom\utils\SocketSession;
use think\Request;
@@ -30,13 +31,16 @@ class UserConnectService
if($userInfo && $userInfo['login_token'] == $loginToken && $username == $userInfo['username']){
SocketSession::saveSocketSession(['user_id' => $userId, 'username' => $username],'user');
$ws->emit('onlineLogin',['status' => true, 'money' => $userInfo['money']]);
Logger::info(Logger::CAT_CONNECT, 'user_login_success', ['user_id' => $userId, 'username' => $username]);
}else{
$ws->emit('onlineLogin',['status' => false, 'money' => 0, 'msg' => 'link_server_fail']);
$ws->close();
Logger::warn(Logger::CAT_CONNECT, 'user_login_auth_fail', ['user_id' => $userId, 'username' => $username, 'reason' => 'token_or_user_mismatch']);
}
}else{
$ws->emit('onlineLogin',['status' => false, 'money' => 0, 'msg' => 'link_server_fail']);
$ws->close();
Logger::warn(Logger::CAT_CONNECT, 'user_login_param_missing', ['user_id' => $userId, 'username' => $username ?? '']);
}
}
}
+30 -20
View File
@@ -11,6 +11,7 @@ use app\services\waybill\WaybillRemindService;
use freedom\utils\CardPosition;
use freedom\utils\RedisUtil;
use freedom\utils\SocketSession;
use app\utils\Logger;
use think\swoole\Websocket;
/**
@@ -32,6 +33,7 @@ class OpeningBaccaratService
//判断结果并推送结果
$res = self::doOpening($event,$tableInfo);
if ($res['status'] == false){
Logger::warn(Logger::CAT_GAME, 'opening_baccarat_fail', ['table_id' => $tableInfo['id'], 'msg' => $res['msg']]);
$ws->emit('openingBaccarat',['status' => false, 'msg' => $res['msg']]);
return;
}
@@ -52,6 +54,7 @@ class OpeningBaccaratService
);
$ws->emit('openingBaccarat',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
$ws->to(SocketSession::HOUSE_NAME)->emit('openingBaccaratResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_GAME, 'opening_baccarat', ['table_id' => $tableInfo['id'], 'opening' => $opening, 'pair' => $pair, 'luck_six' => $luck_six]);
//处理注单
self::doBet($ws,$tableInfo,$lastNumberTabInfo);
//处理好路
@@ -141,6 +144,8 @@ class OpeningBaccaratService
$banker_pair = intval($event['banker_pair']);
$player_pair = intval($event['player_pair']);
$luck_six = intval($event['luck_six']);
$dragon_seven = intval($event['dragon_seven'] ?? 0);
$panda_eight = intval($event['panda_eight'] ?? 0);
//处理开盘
if($banker_pair == 1 && $player_pair == 2){
//庄闲对
@@ -157,7 +162,7 @@ class OpeningBaccaratService
}
if (!in_array($opening,[1,2,3])) return ['status' => false, 'msg' => 'opening_fail_3'];
//开盘
$numberTabUpdate = ['result' => $opening, 'pair' => $pair, 'luck_six' => $luck_six, 'big_small' => $big_small, 'end_time' => time(), 'bet_status' => 3];
$numberTabUpdate = ['result' => $opening, 'pair' => $pair, 'luck_six' => $luck_six, 'dragon_seven' => $dragon_seven, 'panda_eight' => $panda_eight, 'big_small' => $big_small, 'end_time' => time(), 'bet_status' => 3];
$newNumberTabInfo = NumberTab::next($numberTabInfo,$numberTabUpdate,$tableInfo);
if ($newNumberTabInfo){
$lastNumberTabInfo = array_merge($numberTabInfo,$numberTabUpdate);
@@ -183,11 +188,7 @@ class OpeningBaccaratService
}
$amount = $v['banker_amount'] + $v['player_amount'] + $v['tie_amount'] + $v['banker_pair_amount'] + $v['player_pair_amount'] + $v['luck_six_amount'] + $v['big_amount'] + $v['small_amount'];
$winMoney = 0;
// 双边洗码
$ximaliang = 0;
if($userInfo['type_xima'] == 1){
$ximaliang = abs($v['banker_amount'] - $v['player_amount']);
}
if($numberTabInfo['result'] == 1){
// 庄赢
if ($v['banker_amount'] > 0){
@@ -201,26 +202,26 @@ class OpeningBaccaratService
$winMoney = round($v['banker_amount'] * (1 + $userInfo['price_banker']),2) + $winMoney;
}
}
// 单边洗码
if($userInfo['type_xima'] == 2){
$ximaliang = $v['player_amount'];
if($userInfo['type_xima'] == 1){
$ximaliang = $amount;
}else{
$ximaliang += $v['player_amount'] + $v['tie_amount'];
}
}elseif($numberTabInfo['result'] == 2){
// 闲赢
if($v['player_amount'] > 0){
$winMoney = $v['player_amount'] * (1 + $userInfo['price_player']) + $winMoney;
}
// 单边洗码
if($userInfo['type_xima'] == 2){
$ximaliang = $v['banker_amount'];
if($userInfo['type_xima'] == 1){
$ximaliang = $amount;
}else{
$ximaliang += $v['banker_amount'] + $v['tie_amount'];
}
}elseif($numberTabInfo['result'] == 3) {
$ximaliang = 0;
// 和赢
// 和赢:庄闲退回,开和不计洗码
if($v['tie_amount'] > 0){
$winMoney = $v['tie_amount'] * (1 + $userInfo['price_tie_baccarat']) + $winMoney;
}
// 开 和,下注庄和闲不扣钱
if($v['banker_amount'] > 0 && $v['player_amount'] > 0){
$winMoney = $v['player_amount'] + $v['banker_amount'] + $winMoney;
}elseif($v['banker_amount'] > 0){
@@ -229,12 +230,11 @@ class OpeningBaccaratService
$winMoney = $v['player_amount'] + $winMoney;
}
}
// 对子
if($numberTabInfo['pair'] == 3){
// 计算庄对下注的赢钱金额
if ($v['banker_pair_amount'] > 0) {
$winMoney = $v['banker_pair_amount'] * (1 + $userInfo['price_pair']) + $winMoney;
}
//计算闲对下注的赢钱金额
if ($v['player_pair_amount'] > 0) {
$winMoney = $v['player_pair_amount'] * (1 + $userInfo['price_pair']) + $winMoney;
}
@@ -242,22 +242,32 @@ class OpeningBaccaratService
if ($v['banker_pair_amount'] > 0) {
$winMoney = $v['banker_pair_amount'] * (1 + $userInfo['price_pair']) + $winMoney;
}
if($userInfo['type_xima'] != 1) $ximaliang += $v['player_pair_amount'];
}elseif($numberTabInfo['pair'] == 2){
if ($v['player_pair_amount'] > 0) {
$winMoney = $v['player_pair_amount'] * (1 + $userInfo['price_pair']) + $winMoney;
}
if($userInfo['type_xima'] != 1) $ximaliang += $v['banker_pair_amount'];
}else{
if($userInfo['type_xima'] != 1) $ximaliang += $v['banker_pair_amount'] + $v['player_pair_amount'];
}
// 幸运6
if ($numberTabInfo['luck_six'] == 2 && $v['luck_six_amount'] > 0){
$winMoney = $v['luck_six_amount'] * (1 + $userInfo['price_luck_six_2']) + $winMoney;
}
if ($numberTabInfo['luck_six'] == 3 && $v['luck_six_amount'] > 0){
}elseif ($numberTabInfo['luck_six'] == 3 && $v['luck_six_amount'] > 0){
$winMoney = $v['luck_six_amount'] * (1 + $userInfo['price_luck_six_3']) + $winMoney;
}else{
if($userInfo['type_xima'] != 1) $ximaliang += $v['luck_six_amount'];
}
// 大小
if ($numberTabInfo['big_small'] == 1){
$winMoney = $v['big_amount'] * (1 + $userInfo['price_big']) + $winMoney;
}
if ($numberTabInfo['big_small'] == 2){
if($userInfo['type_xima'] != 1) $ximaliang += $v['small_amount'];
}elseif ($numberTabInfo['big_small'] == 2){
$winMoney = $v['small_amount'] * (1 + $userInfo['price_small']) + $winMoney;
if($userInfo['type_xima'] != 1) $ximaliang += $v['big_amount'];
}else{
if($userInfo['type_xima'] != 1) $ximaliang += $v['big_amount'] + $v['small_amount'];
}
// 计算最终赢钱金额
$winTotal = $winMoney - $amount;
@@ -10,6 +10,7 @@ use app\models\user\User;
use app\services\connect\InitTableService;
use freedom\utils\DiceUtil;
use freedom\utils\SocketSession;
use app\utils\Logger;
use think\swoole\Websocket;
/**
@@ -31,6 +32,7 @@ class OpeningDiceService
//判断结果并推送结果
$res = self::doOpening($event,$tableInfo);
if ($res['status'] == false){
Logger::warn(Logger::CAT_GAME, 'opening_dice_fail', ['table_id' => $tableInfo['id'], 'msg' => $res['msg']]);
$ws->emit('openingDice',['status' => false, 'msg' => $res['msg']]);
return;
}
@@ -47,6 +49,7 @@ class OpeningDiceService
);
$ws->emit('openingDice',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
$ws->to(SocketSession::HOUSE_NAME)->emit('openingDiceResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_GAME, 'opening_dice', ['table_id' => $tableInfo['id'], 'result' => $resultArray]);
//处理注单
self::doBet($ws,$tableInfo,$lastNumberTabInfo,$resultArray,$resultParse);
}
+13 -16
View File
@@ -13,6 +13,7 @@ use freedom\utils\CardPosition;
use freedom\utils\RedisUtil;
use freedom\utils\SocketSession;
use think\facade\Env;
use app\utils\Logger;
use think\swoole\Websocket;
/**
@@ -35,6 +36,7 @@ class OpeningDtService
//判断结果并推送结果
$res = self::doOpening($event,$tableInfo);
if ($res['status'] == false){
Logger::warn(Logger::CAT_GAME, 'opening_dt_fail', ['table_id' => $tableInfo['id'], 'msg' => $res['msg']]);
$ws->emit('openingDt',['status' => false, 'msg' => $res['msg']]);
return;
}
@@ -52,6 +54,7 @@ class OpeningDtService
);
$ws->emit('openingDt',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
$ws->to(SocketSession::HOUSE_NAME)->emit('openingDtResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_GAME, 'opening_dt', ['table_id' => $tableInfo['id'], 'opening' => $opening]);
//处理注单
self::doBet($ws,$tableInfo,$lastNumberTabInfo);
//处理好路
@@ -128,19 +131,16 @@ class OpeningDtService
}
$amount = $v['banker_amount'] + $v['player_amount'] + $v['tie_amount'];
$winMoney = 0;
// 双边洗码
$ximaliang = 0;
if($userInfo['type_xima'] == 1){
$ximaliang = abs($v['banker_amount'] - $v['player_amount']);
}
// 龙赢
if ($numberTabInfo['result'] == 1) {
if($v['banker_amount'] > 0){
$winMoney = round($v['banker_amount'] * (1 + $userInfo['price_dragon']),2) + $winMoney;
}
// 单边洗码
if($userInfo['type_xima'] == 2){
$ximaliang = $v['player_amount'];
if($userInfo['type_xima'] == 1){
$ximaliang = $amount;
}else{
$ximaliang = $v['player_amount'] + $v['tie_amount'];
}
}
// 虎赢
@@ -148,18 +148,15 @@ class OpeningDtService
if($v['player_amount'] > 0){
$winMoney = round($v['player_amount'] * (1 + $userInfo['price_tiger']),2) + $winMoney;
}
// 单边洗码
if($userInfo['type_xima'] == 2){
$ximaliang = $v['banker_amount'];
if($userInfo['type_xima'] == 1){
$ximaliang = $amount;
}else{
$ximaliang = $v['banker_amount'] + $v['tie_amount'];
}
}
// 和
// 和:不杀龙虎,全额退回
if ($numberTabInfo['result'] == 3) {
if (Env::get('system.dt_half') == 1) {
$winMoney = round(($v['banker_amount'] + $v['player_amount']) / 2, 2) + $winMoney;
} else {
$winMoney = $v['banker_amount'] + $v['player_amount'] + $winMoney;
}
$winMoney = $v['banker_amount'] + $v['player_amount'] + $winMoney;
$ximaliang = 0;
if ($v['tie_amount'] > 0) {
$winMoney = $v['tie_amount'] * (1 + $userInfo['price_tie_dt']) + $winMoney;
@@ -11,6 +11,7 @@ use app\services\connect\InitTableService;
use freedom\utils\CardPositionNn;
use freedom\utils\RedisUtil;
use freedom\utils\SocketSession;
use app\utils\Logger;
use think\swoole\Websocket;
class OpeningNnService
@@ -26,6 +27,7 @@ class OpeningNnService
//判断结果并推送结果
$res = self::doOpening($event,$tableInfo);
if ($res['status'] == false){
Logger::warn(Logger::CAT_GAME, 'opening_nn_fail', ['table_id' => $tableInfo['id'], 'msg' => $res['msg']]);
$ws->emit('openingNn',['status' => false, 'msg' => $res['msg']]);
return;
}
@@ -41,6 +43,7 @@ class OpeningNnService
$round = array_merge($round,$data);
$ws->emit('openingNn',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
$ws->to(SocketSession::HOUSE_NAME)->emit('openingNnResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_GAME, 'opening_nn', ['table_id' => $tableInfo['id'], 'result_banker' => $data['result_banker'], 'win_p1' => $data['win_player_1'], 'win_p2' => $data['win_player_2'], 'win_p3' => $data['win_player_3']]);
//处理注单
self::doBet($ws,$tableInfo,$lastNumberTabInfo,$data);
}
@@ -8,6 +8,7 @@ use app\models\process\Boot;
use app\models\process\NumberTab;
use app\models\user\User;
use app\services\connect\InitTableService;
use app\utils\Logger;
use freedom\utils\RouletteUtil;
use freedom\utils\SocketSession;
use think\swoole\Websocket;
@@ -31,6 +32,7 @@ class OpeningRouletteService
//判断结果并推送结果
$res = self::doOpening($event,$tableInfo);
if ($res['status'] == false){
Logger::warn(Logger::CAT_GAME, 'opening_roulette_fail', ['table_id' => $tableInfo['id'], 'msg' => $res['msg']]);
$ws->emit('openingRoulette',['status' => false,'table_id' => $tableInfo['id'], 'msg' => $res['msg']]);
return;
}
@@ -47,6 +49,7 @@ class OpeningRouletteService
);
$ws->emit('openingRoulette',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
$ws->to(SocketSession::HOUSE_NAME)->emit('openingRouletteResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_GAME, 'opening_roulette', ['table_id' => $tableInfo['id'], 'result' => $round['result'] ?? '']);
//处理注单
self::doBet($ws,$tableInfo,$lastNumberTabInfo,$result,$resultParse);
}
@@ -11,6 +11,7 @@ use app\services\connect\InitTableService;
use freedom\utils\CardPositionTc;
use freedom\utils\RedisUtil;
use freedom\utils\SocketSession;
use app\utils\Logger;
use think\swoole\Websocket;
class OpeningTcService
@@ -26,6 +27,7 @@ class OpeningTcService
//判断结果并推送结果
$res = self::doOpening($event,$tableInfo);
if ($res['status'] == false){
Logger::warn(Logger::CAT_GAME, 'opening_tc_fail', ['table_id' => $tableInfo['id'], 'msg' => $res['msg']]);
$ws->emit('openingTc',['status' => false, 'msg' => $res['msg']]);
return;
}
@@ -41,6 +43,7 @@ class OpeningTcService
$round = array_merge($round,$data);
$ws->emit('openingTc',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
$ws->to(SocketSession::HOUSE_NAME)->emit('openingTcResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_GAME, 'opening_tc', ['table_id' => $tableInfo['id'], 'result_banker' => $data['result_banker'], 'win_p1' => $data['win_player_1'], 'win_p2' => $data['win_player_2'], 'win_p3' => $data['win_player_3']]);
//处理注单
self::doBet($ws,$tableInfo,$lastNumberTabInfo,$data);
}
@@ -10,6 +10,7 @@ use app\models\user\User;
use app\services\connect\InitTableService;
use freedom\utils\SocketSession;
use freedom\utils\ToningUtil;
use app\utils\Logger;
use think\swoole\Websocket;
/**
@@ -31,6 +32,7 @@ class OpeningToningService
//判断结果并推送结果
$res = self::doOpening($event,$tableInfo);
if ($res['status'] == false){
Logger::warn(Logger::CAT_GAME, 'opening_toning_fail', ['table_id' => $tableInfo['id'], 'msg' => $res['msg']]);
$ws->emit('openingToning',['status' => false, 'msg' => $res['msg']]);
return;
}
@@ -46,6 +48,7 @@ class OpeningToningService
);
$ws->emit('openingToning',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
$ws->to(SocketSession::HOUSE_NAME)->emit('openingToningResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
Logger::info(Logger::CAT_GAME, 'opening_toning', ['table_id' => $tableInfo['id'], 'result' => $result]);
//处理注单
self::doBet($ws,$tableInfo,$lastNumberTabInfo);
}
+1 -1
View File
@@ -27,7 +27,7 @@ class CountdownService
//处理倒计时
$waitTime = intval($tableInfo['wait_time']);
//将倒计时用作是redis的过期时间
RedisUtil::save('countdown_'.$numberTabInfo['id'],$waitTime,$waitTime);
RedisUtil::save('countdown_'.$numberTabInfo['id'],$waitTime,$waitTime + 10);
while($waitTime >= 0){
$countdown = Cache::store('redis')->get('countdown_'.$numberTabInfo['id']);
if ($countdown){
+4 -1
View File
@@ -6,6 +6,7 @@ namespace app\services\process;
use app\models\process\NumberTab;
use app\services\connect\InitTableService;
use app\utils\Logger;
use freedom\utils\RedisUtil;
use freedom\utils\SocketSession;
@@ -41,8 +42,10 @@ class EndBetService
'number_tab_status' => InitTableService::numberTabStatus($numberTabInfo)
]
]);
Logger::info(Logger::CAT_GAME, 'end_bet', ['table_id' => $tableInfo['id'], 'nt_id' => $numberTabId]);
}else{
$ws->emit('endBet', ['status' => false, 'msg' => $modelRes['msg']]);
Logger::warn(Logger::CAT_GAME, 'end_bet_fail', ['table_id' => $tableInfo['id'], 'msg' => $modelRes['msg'], 'bet_status' => $modelRes['bet_status'] ?? null]);
$ws->emit('endBet', ['status' => false, 'msg' => $modelRes['msg'], 'bet_status' => $modelRes['bet_status'] ?? null]);
}
}
}
@@ -6,6 +6,7 @@ namespace app\services\process;
use app\models\process\NumberTab;
use app\services\connect\InitTableService;
use app\utils\Logger;
use freedom\utils\SocketSession;
/**
@@ -26,15 +27,15 @@ class ResetNumberTabService
$numberTabInfo = InitTableService::initTable($tableInfo);
if (!$numberTabInfo){
$ws->emit('resetNumberTab', ['status' => false, 'msg' => 'not_number_tab_data']);
Logger::warn(Logger::CAT_GAME, 'reset_number_tab_fail', ['table_id' => $tableInfo['id'], 'reason' => 'not_number_tab_data']);
return;
}
// 调试日志
\think\facade\Log::write('resetNumberTab debug: bet_status=' . $numberTabInfo['bet_status'] . ', rob_status=' . $numberTabInfo['rob_status'] . ', id=' . $numberTabInfo['id'] . ', boot_id=' . $numberTabInfo['boot_id'], 'info');
if($numberTabInfo['bet_status'] == 1 || $numberTabInfo['bet_status'] == 2 || ($numberTabInfo['bet_status'] == 0 && $numberTabInfo['rob_status'] == 1) || ($numberTabInfo['bet_status'] == 0 && $numberTabInfo['rob_status'] == 2)){
Logger::info(Logger::CAT_GAME, 'reset_number_tab_attempt', ['table_id' => $tableInfo['id'], 'bet_status' => $numberTabInfo['bet_status'], 'nt_id' => $numberTabInfo['id']]);
if($numberTabInfo['bet_status'] == 1 || $numberTabInfo['bet_status'] == 2 || $numberTabInfo['bet_status'] == 3 || ($numberTabInfo['bet_status'] == 0 && ($numberTabInfo['rob_status'] == 1 || $numberTabInfo['rob_status'] == 2))){
//事务处理
$res = NumberTab::resetNumberTab($numberTabInfo);
\think\facade\Log::write('resetNumberTab result: ' . ($res ? 'true' : 'false'), 'info');
if (!$res){
Logger::warn(Logger::CAT_GAME, 'reset_number_tab_fail', ['table_id' => $tableInfo['id'], 'nt_id' => $numberTabInfo['id']]);
$ws->emit('resetNumberTab', ['status' => false, 'msg' => 'reset_number_fail']);
return;
}
@@ -55,8 +56,10 @@ class ResetNumberTabService
$ws->to(SocketSession::HOUSE_NAME)->emit('resetNumberTab', $responseData);
// 同时发送给请求者
$ws->emit('resetNumberTab', $responseData);
Logger::info(Logger::CAT_GAME, 'reset_number_tab', ['table_id' => $tableInfo['id'], 'nt_id' => $numberTabInfo['id']]);
}else{
$ws->emit('resetNumberTab', ['status' => false, 'msg' => 'reset_number_fail']);
Logger::warn(Logger::CAT_GAME, 'reset_number_tab_fail', ['table_id' => $tableInfo['id'], 'number_tab_id' => $numberTabInfo['id'], 'reason' => 'invalid_bet_status']);
}
}
}
+3
View File
@@ -6,6 +6,7 @@ namespace app\services\process;
use app\models\process\NumberTab;
use app\services\connect\InitTableService;
use app\utils\Logger;
use freedom\utils\SocketSession;
/**
@@ -44,7 +45,9 @@ class StartBetService
$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']]);
}
}
+7 -1
View File
@@ -4,6 +4,7 @@
namespace app\services\reset;
use app\models\process\NumberTab;
use app\utils\Logger;
use freedom\utils\SocketSession;
use think\swoole\Websocket;
@@ -27,25 +28,29 @@ class ResetBaccaratService
$numberTabInfo = NumberTab::getByTableIdOrderByIdDesc_two($tableInfo);
if (!$numberTabInfo){
$ws->emit('resetBaccarat', ['status' => false, 'msg' => 'not_number_tab_data']);
Logger::warn(Logger::CAT_GAME, 'reset_baccarat_fail', ['table_id' => $tableInfo['id'], 'reason' => 'not_number_tab_data']);
return;
}
if(count($numberTabInfo) != 2){
$ws->emit('resetBaccarat', ['status' => false, 'msg' => '上一铺数据不存在']);
Logger::warn(Logger::CAT_GAME, 'reset_baccarat_fail', ['table_id' => $tableInfo['id'], 'reason' => 'previous_round_not_found']);
return;
}
if($numberTabInfo[0]['boot_id'] != $numberTabInfo[1]['boot_id']){
$ws->emit('resetBaccarat', ['status' => false, 'msg' => '上一铺不在同一靴']);
Logger::warn(Logger::CAT_GAME, 'reset_baccarat_fail', ['table_id' => $tableInfo['id'], 'reason' => 'boot_mismatch']);
return;
}
$numberTabInfo = $numberTabInfo[1];
if($event['opening'] == $numberTabInfo['result'] && $event['pair'] == $numberTabInfo['pair'] && $event['luck_six'] == $numberTabInfo['luck_six']){
if($event['opening'] == $numberTabInfo['result'] && $event['pair'] == $numberTabInfo['pair'] && ($event['luck_six'] ?? 0) == $numberTabInfo['luck_six'] && ($event['dragon_seven'] ?? 0) == $numberTabInfo['dragon_seven'] && ($event['panda_eight'] ?? 0) == $numberTabInfo['panda_eight']){
$ws->emit('resetBaccarat', ['status' => false, 'msg' => '结果一样']);
return;
}
$res = NumberTab::resetBaccarat($event,$numberTabInfo,$tableInfo);
if (!$res){
$ws->emit('resetBaccarat', ['status' => false, 'msg' => '修改上一局结果失败']);
Logger::warn(Logger::CAT_GAME, 'reset_baccarat_fail', ['table_id' => $tableInfo['id'], 'number_tab_id' => $numberTabInfo['id'], 'reason' => 'db_update_failed']);
return;
}
@@ -56,5 +61,6 @@ class ResetBaccaratService
'previous_number_tab_id' => $numberTabInfo['id']
]
]);
Logger::info(Logger::CAT_GAME, 'reset_baccarat', ['table_id' => $tableInfo['id'], 'opening' => $event['opening'], 'pair' => $event['pair']]);
}
}
+6
View File
@@ -4,6 +4,7 @@
namespace app\services\reset;
use app\models\process\NumberTab;
use app\utils\Logger;
use freedom\utils\SocketSession;
use think\swoole\Websocket;
@@ -27,14 +28,17 @@ class ResetDtService
$numberTabInfo = NumberTab::getByTableIdOrderByIdDesc_two($tableInfo);
if (!$numberTabInfo){
$ws->emit('resetDt', ['status' => false, 'msg' => 'not_number_tab_data']);
Logger::warn(Logger::CAT_GAME, 'reset_dt_fail', ['table_id' => $tableInfo['id'], 'reason' => 'not_number_tab_data']);
return;
}
if(count($numberTabInfo) != 2){
$ws->emit('resetDt', ['status' => false, 'msg' => '上一铺数据不存在']);
Logger::warn(Logger::CAT_GAME, 'reset_dt_fail', ['table_id' => $tableInfo['id'], 'reason' => 'previous_round_not_found']);
return;
}
if($numberTabInfo[0]['boot_id'] != $numberTabInfo[1]['boot_id']){
$ws->emit('resetDt', ['status' => false, 'msg' => '上一铺不在同一靴']);
Logger::warn(Logger::CAT_GAME, 'reset_dt_fail', ['table_id' => $tableInfo['id'], 'reason' => 'boot_mismatch']);
return;
}
@@ -46,6 +50,7 @@ class ResetDtService
$res = NumberTab::resetDt($event,$numberTabInfo,$tableInfo);
if (!$res){
$ws->emit('resetDt', ['status' => false, 'msg' => '修改上一局结果失败']);
Logger::warn(Logger::CAT_GAME, 'reset_dt_fail', ['table_id' => $tableInfo['id'], 'number_tab_id' => $numberTabInfo['id'], 'reason' => 'db_update_failed']);
return;
}
@@ -56,5 +61,6 @@ class ResetDtService
'previous_number_tab_id' => $numberTabInfo['id']
]
]);
Logger::info(Logger::CAT_GAME, 'reset_dt', ['table_id' => $tableInfo['id'], 'opening' => $event['opening']]);
}
}
@@ -16,7 +16,7 @@ use app\models\process\WaybillRemind;
class WaybillRemindService{
public static function parseWaybillRemind($game_id, $table_id, $table_name, $boot_id){
$is_good = array();
$ns = NumberTab::getByBootIdDone($boot_id,'result, pair');
$ns = NumberTab::getByBootIdDone($boot_id,'result,pair,luck_six,dragon_seven,panda_eight');
$bigRoad = array();
//列
$yKey = 0;
@@ -99,6 +99,7 @@ class WaybillRemindService{
}
}
$bigRoad_lenth = count($bigRoadLocation);
try {
if($bigRoad_lenth >= 4){
//y=1
if($bigRoadLocation[$bigRoad_lenth-1]['show_y'] == 1){
@@ -530,7 +531,7 @@ class WaybillRemindService{
}
}elseif($bigRoadLocation[$bigRoad_lenth-1]['result'] == 2){
if($bigRoadLocation[$bigRoad_lenth-1]['show_y'] < 6){
$last_banker_lenth = $bigRoadLocation[$bigRoad_lenth-1]['show_y'];
$last_player_lenth = $bigRoadLocation[$bigRoad_lenth-1]['show_y'];
}
if($bigRoadLocation[$bigRoad_lenth-1]['show_y'] == 6){
for($length=0;$length<99;$length++){
@@ -616,6 +617,9 @@ class WaybillRemindService{
}
}
}
} catch (\Throwable $e) {
// 路子珠数据不足时跳过 pattern 检测
}
$table = WaybillRemind::where('table_id',$table_id)->find();
$create_time = time();
$bigRoadLocation = json_encode($bigRoadLocation);
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace app\utils;
class Logger
{
const CAT_CONNECT = 'connect';
const CAT_GAME = 'game';
const CAT_BET = 'bet';
const CAT_ERROR = 'error';
const CAT_FRONTEND = 'frontend';
public static function log(string $category, string $level, string $message, array $context = []): void
{
$date = date('Y-m-d');
$time = date('Y-m-d H:i:s');
$dir = root_path() . 'runtime' . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . $category;
if (!is_dir($dir)) {
mkdir($dir, 0755, true);
}
$file = $dir . DIRECTORY_SEPARATOR . $date . '.log';
$contextStr = $context ? ' ' . json_encode($context, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) : '';
$line = "[{$time}][{$level}] {$message}{$contextStr}" . PHP_EOL;
file_put_contents($file, $line, FILE_APPEND | LOCK_EX);
}
public static function info(string $category, string $message, array $context = []): void
{
self::log($category, 'INFO', $message, $context);
}
public static function warn(string $category, string $message, array $context = []): void
{
self::log($category, 'WARN', $message, $context);
}
public static function error(string $category, string $message, array $context = []): void
{
self::log($category, 'ERROR', $message, $context);
}
}