修改域名为h55555game.top

This commit is contained in:
2026-04-28 10:24:01 +08:00
parent 40277e677d
commit a7b2f2cd91
61 changed files with 2329 additions and 21 deletions

6
.idea/encodings.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/server/docs/PERFORMANCE_AND_QPS_ANALYSIS.md" charset="GB2312" />
</component>
</project>

View File

@@ -10,7 +10,7 @@
由部署方提供:
- 测试环境:`https://dice-api.yuliao666.top`
- 测试环境:`https://dice-api.h55555game.top`
下文所有路径均为相对路径,如:`/api/v1/getGameUrl`
@@ -68,9 +68,9 @@
| secret | 是 | string | 双方约定的密钥(服务端配置 `xF75oK91TQj13s0UmNIr1NBWMWGfflNO` |
| time | 是 | int/string | Unix 时间戳(秒),服务端会做时间容忍校验 |
| signature | 是 | string | 签名:`md5(agent_id + secret + time)` |
- **agent_id**:通过后台获取系统管理-用户管理-代理ID![http://dice-api.yuliao666.top/storage/20260317/20a0d49f016bcc89afa794ed217e762fe3ef6481.png](server/public/img.png)
- **agent_id**:通过后台获取系统管理-用户管理-代理ID![http://dice-api.h55555game.top/storage/20260317/20a0d49f016bcc89afa794ed217e762fe3ef6481.png](server/public/img.png)
- **secret**xF75oK91TQj13s0UmNIr1NBWMWGfflNO服务器配置
- **后台地址**https://dice.yuliao666.top 账号: zhuguan 密码123456
- **后台地址**https://dice.h55555game.top 账号: zhuguan 密码123456
#### 签名规则
- **签名字符串**:直接拼接 `agent_id.secret.time`(无分隔符)
@@ -135,7 +135,7 @@ signature = md5(agent_id + secret + time)
"code": 200,
"message": "success",
"data": {
"url": "https://dice-game.yuliao666.top/?token=...&lang=zh"
"url": "https://dice-game.h55555game.top/?token=...&lang=zh"
}
}
```

View File

@@ -5,7 +5,7 @@
VITE_BASE_URL = ./
# API 根地址(后端路由为 /core、/tool、/dice 等,无 /prod 前缀,不要加 /prod
VITE_API_URL = https://dice-v3-api.yuliao666.top
VITE_API_URL = https://dice-v3-api.h55555game.top
# 登录页是否显示验证码,设为 false 可关闭(需与后端 LOGIN_CAPTCHA_ENABLE 一致)
VITE_LOGIN_CAPTCHA_ENABLED = false

10
saiadmin-artd/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,10 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 已忽略包含查询文件的默认文件夹
/queries/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

View File

@@ -0,0 +1,57 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<HTMLCodeStyleSettings>
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
</HTMLCodeStyleSettings>
<JSCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</TypeScriptCodeStyleSettings>
<VueCodeStyleSettings>
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
</VueCodeStyleSettings>
<codeStyleSettings language="HTML">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Vue">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View File

@@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>

8
saiadmin-artd/.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/saiadmin-artd.iml" filepath="$PROJECT_DIR$/.idea/saiadmin-artd.iml" />
</modules>
</component>
</project>

6
saiadmin-artd/.idea/prettier.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PrettierConfiguration">
<option name="myConfigurationMode" value="AUTOMATIC" />
</component>
</project>

8
saiadmin-artd/.idea/saiadmin-artd.iml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
saiadmin-artd/.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@@ -25,7 +25,7 @@ WEBMAN_CHANNEL_PORT=2207
WEBMAN_CHANNEL_LISTEN_HOST=0.0.0.0
# 游戏地址,用于 /api/v1/getGameUrl 返回
GAME_URL=dice-v3-game.yuliao666.top
GAME_URL=dice-v3-game.h55555game.top
# API 鉴权与用户(可选,不填则用默认值)
# authToken 签名密钥(必填,与客户端约定,用于 signature 校验)

View File

@@ -111,7 +111,7 @@ class GameController extends BaseController
return $this->fail($e->getMessage(), ReturnCode::PARAMS_ERROR);
}
$gameUrlBase = rtrim(config('api.game_url', 'dice-game.yuliao666.top'), '/');
$gameUrlBase = rtrim(config('api.game_url', 'dice-game.h55555game.top'), '/');
$tokenInUrl = str_replace('%3D', '=', urlencode($result['token']));
$url = $gameUrlBase . '/?token=' . $tokenInUrl . '&lang=' . $lang;

View File

@@ -6,7 +6,7 @@ return [
// 登录成功返回的连接地址前缀,如 https://127.0.0.1:6777
'login_url_base' => env('API_LOGIN_URL_BASE', 'https://127.0.0.1:6777'),
// 游戏地址,用于 /api/v1/getGameUrl 返回拼接 token
'game_url' => env('GAME_URL', 'dice-game.yuliao666.top'),
'game_url' => env('GAME_URL', 'dice-game.h55555game.top'),
// 按 username 存储的登录会话 Redis key 前缀,用于 token 中间件校验
'session_username_prefix' => env('API_SESSION_USERNAME_PREFIX', 'api:user:session:'),
// 登录会话过期时间(秒),默认 7 天

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
ALTER TABLE `dice_config`
ADD COLUMN `title_en` varchar(255) NOT NULL DEFAULT '' COMMENT '标题(英文)' AFTER `title`,
ADD COLUMN `value_en` text NULL COMMENT '值(英文)' AFTER `value`;

51
server/db/dice_game.sql Normal file
View File

@@ -0,0 +1,51 @@
-- 游戏管理表
CREATE TABLE IF NOT EXISTS `dice_game` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`provider` varchar(64) NOT NULL DEFAULT 'Dicey Fun' COMMENT '供应商名称',
`provider_code` varchar(32) NOT NULL DEFAULT 'DF' COMMENT '供应商编码',
`game_code` varchar(64) NOT NULL COMMENT '游戏编号',
`game_key` varchar(64) NOT NULL COMMENT '游戏唯一值',
`game_name` varchar(128) NOT NULL COMMENT '游戏名称(中文)',
`game_name_en` varchar(128) NOT NULL DEFAULT '' COMMENT '游戏名称(英文)',
`game_type` varchar(32) NOT NULL DEFAULT 'slot' COMMENT '游戏类型',
`logo` varchar(255) NOT NULL DEFAULT '' COMMENT '游戏LOGO地址',
`game_url` varchar(255) NOT NULL DEFAULT '' COMMENT '游戏地址',
`hall_url` varchar(255) NOT NULL DEFAULT '' COMMENT '大厅地址',
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态1启用 0禁用',
`sort` int NOT NULL DEFAULT 100 COMMENT '排序值,越小越靠前',
`is_hot` tinyint NOT NULL DEFAULT 0 COMMENT '是否热门1是 0否',
`merchant_config_json` text COMMENT '商户可见扩展配置',
`sensitive_config_json` text COMMENT '敏感配置(不对大厅接口返回)',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
`delete_time` datetime DEFAULT NULL COMMENT '删除时间',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_dice_game_code` (`game_code`),
UNIQUE KEY `uk_dice_game_key` (`game_key`),
KEY `idx_provider_status_sort` (`provider_code`,`status`,`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='游戏管理表';
-- 初始化默认游戏(大富翁)
INSERT INTO `dice_game`
(`provider`,`provider_code`,`game_code`,`game_key`,`game_name`,`game_name_en`,`game_type`,`logo`,`game_url`,`hall_url`,`status`,`sort`,`is_hot`,`merchant_config_json`,`sensitive_config_json`,`remark`)
SELECT
'Dicey Fun',
'DF',
'dafuwen',
'dafuwen',
'大富翁',
'Dafuweng',
'slot',
'',
'https://dice-v3-game.h55555game.top/',
'https://dice-v3-game.h55555game.top/',
1,
1,
1,
NULL,
NULL,
'初始化默认游戏'
WHERE NOT EXISTS (
SELECT 1 FROM `dice_game` WHERE `game_code` = 'dafuwen'
);

View File

@@ -0,0 +1,44 @@
-- 游戏管理菜单与权限
-- 说明挂载到顶级菜单parent_id=0
SET @now = NOW();
-- 1) 创建游戏管理顶级菜单type=2parent_id=0
INSERT INTO `sa_system_menu`
(`parent_id`,`name`,`code`,`slug`,`type`,`path`,`component`,`method`,`icon`,`sort`,`is_iframe`,`is_keep_alive`,`is_hidden`,`is_fixed_tab`,`is_full_page`,`generate_id`,`generate_key`,`status`,`create_time`,`update_time`)
SELECT 0, '游戏管理', 'Game', NULL, 2, 'game', '/plugin/dice/game/index/index', NULL, 'ri:apps-2-line', 91, 2, 2, 2, 2, 2, 0, NULL, 1, @now, @now
WHERE NOT EXISTS (
SELECT 1 FROM `sa_system_menu` WHERE `path` = 'game' AND `component` = '/plugin/dice/game/index/index' AND `type` = 2
);
SET @game_menu_id = (
SELECT `id` FROM `sa_system_menu`
WHERE `path` = 'game' AND `component` = '/plugin/dice/game/index/index' AND `type` = 2
ORDER BY `id` ASC LIMIT 1
);
-- 2) 创建按钮权限
INSERT INTO `sa_system_menu`
(`parent_id`,`name`,`code`,`slug`,`type`,`path`,`component`,`method`,`sort`,`is_iframe`,`is_keep_alive`,`is_hidden`,`is_fixed_tab`,`is_full_page`,`generate_id`,`generate_key`,`status`,`create_time`,`update_time`)
SELECT @game_menu_id, '数据列表', '', 'dice:game:index:index', 3, '', '', '', 100, 2, 2, 2, 2, 2, 0, NULL, 1, @now, @now
WHERE NOT EXISTS (SELECT 1 FROM `sa_system_menu` WHERE `slug` = 'dice:game:index:index' AND `type` = 3);
INSERT INTO `sa_system_menu`
(`parent_id`,`name`,`code`,`slug`,`type`,`path`,`component`,`method`,`sort`,`is_iframe`,`is_keep_alive`,`is_hidden`,`is_fixed_tab`,`is_full_page`,`generate_id`,`generate_key`,`status`,`create_time`,`update_time`)
SELECT @game_menu_id, '读取', '', 'dice:game:index:read', 3, '', '', '', 100, 2, 2, 2, 2, 2, 0, NULL, 1, @now, @now
WHERE NOT EXISTS (SELECT 1 FROM `sa_system_menu` WHERE `slug` = 'dice:game:index:read' AND `type` = 3);
INSERT INTO `sa_system_menu`
(`parent_id`,`name`,`code`,`slug`,`type`,`path`,`component`,`method`,`sort`,`is_iframe`,`is_keep_alive`,`is_hidden`,`is_fixed_tab`,`is_full_page`,`generate_id`,`generate_key`,`status`,`create_time`,`update_time`)
SELECT @game_menu_id, '添加', '', 'dice:game:index:save', 3, '', '', '', 100, 2, 2, 2, 2, 2, 0, NULL, 1, @now, @now
WHERE NOT EXISTS (SELECT 1 FROM `sa_system_menu` WHERE `slug` = 'dice:game:index:save' AND `type` = 3);
INSERT INTO `sa_system_menu`
(`parent_id`,`name`,`code`,`slug`,`type`,`path`,`component`,`method`,`sort`,`is_iframe`,`is_keep_alive`,`is_hidden`,`is_fixed_tab`,`is_full_page`,`generate_id`,`generate_key`,`status`,`create_time`,`update_time`)
SELECT @game_menu_id, '修改', '', 'dice:game:index:update', 3, '', '', '', 100, 2, 2, 2, 2, 2, 0, NULL, 1, @now, @now
WHERE NOT EXISTS (SELECT 1 FROM `sa_system_menu` WHERE `slug` = 'dice:game:index:update' AND `type` = 3);
INSERT INTO `sa_system_menu`
(`parent_id`,`name`,`code`,`slug`,`type`,`path`,`component`,`method`,`sort`,`is_iframe`,`is_keep_alive`,`is_hidden`,`is_fixed_tab`,`is_full_page`,`generate_id`,`generate_key`,`status`,`create_time`,`update_time`)
SELECT @game_menu_id, '删除', '', 'dice:game:index:destroy', 3, '', '', '', 100, 2, 2, 2, 2, 2, 0, NULL, 1, @now, @now
WHERE NOT EXISTS (SELECT 1 FROM `sa_system_menu` WHERE `slug` = 'dice:game:index:destroy' AND `type` = 3);

View File

@@ -0,0 +1,3 @@
-- 彩金池累计盈利:每次抽奖成功后累加 (100 - DiceRewardConfig.real_ev),后台「当前彩金池」展示为 profit_amount
-- 若表已有 ev 字段可跳过本句
ALTER TABLE `dice_lottery_pool_config` ADD COLUMN `ev` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '池子累计盈利(游戏结算时累加)' AFTER `t5_weight`;

View File

@@ -0,0 +1,5 @@
-- 杀分开关:是否启用杀分(达到安全线后是否使用 type=1 权重)
-- 若列已存在可跳过
ALTER TABLE `dice_lottery_pool_config`
ADD COLUMN `kill_enabled` tinyint NOT NULL DEFAULT 1 COMMENT '是否启用杀分0=关闭 1=开启' AFTER `safety_line`;

View File

@@ -0,0 +1,7 @@
-- 彩金池盈利字段:使用 profit_amount计算方式为每局抽奖累加付费=win_coin-paid_amount免费=win_coin
-- 1. 添加 profit_amount若已存在则报错可忽略
ALTER TABLE `dice_lottery_pool_config` ADD COLUMN `profit_amount` decimal(14,2) NOT NULL DEFAULT 0.00 COMMENT '池子累计盈利(每局抽奖累加:付费=win_coin-paid_amount免费=win_coin' AFTER `t5_weight`;
-- 2. 若表中原有 ev 字段,可将数据同步到 profit_amount若无 ev 可注释本行)
-- UPDATE `dice_lottery_pool_config` SET `profit_amount` = IFNULL(`ev`, 0) WHERE 1;
-- 3. 可选:删除旧字段 ev
-- ALTER TABLE `dice_lottery_pool_config` DROP COLUMN `ev`;

View File

@@ -0,0 +1,6 @@
-- [已废弃] dice_lottery_pool_config 不再使用 type 字段,改用 name 区分:
-- default=原 type=0killScore=原 type=1up=原 type=2
-- 如需移除 type 列,请执行:
-- ALTER TABLE `dice_lottery_pool_config` DROP COLUMN `type`;
-- ALTER TABLE `dice_lottery_pool_config` DROP COLUMN `type`;

View File

@@ -0,0 +1,3 @@
-- DicePlayRecord 新增 roll_number 字段摇取点数和5 个色子点数之和5-30
ALTER TABLE `dice_play_record`
ADD COLUMN `roll_number` int unsigned NOT NULL DEFAULT 0 COMMENT '摇取点数和5个色子点数之和5-30' AFTER `roll_array`;

View File

@@ -0,0 +1,17 @@
-- 游玩记录表:新增 reward_tierT1,T2,T3,T4,T5,BIGWIN
-- 说明:
-- - 当前版本已不再使用/保留历史“奖励配置ID”字段
-- - 回填逻辑改为使用 target_index对应 dice_reward_config.id与 super_win_coin 判定 BIGWIN
ALTER TABLE `dice_play_record`
ADD COLUMN `reward_tier` varchar(10) NOT NULL DEFAULT '' COMMENT '中奖档位T1,T2,T3,T4,T5,BIGWIN' AFTER `direction`;
UPDATE `dice_play_record` r
SET r.`reward_tier` =
CASE
WHEN IFNULL(r.`super_win_coin`, 0) > 0 THEN 'BIGWIN'
WHEN IFNULL(r.`target_index`, 0) > 0 THEN IFNULL((SELECT c.`tier` FROM `dice_reward_config` c WHERE c.`id` = r.`target_index` LIMIT 1), '')
ELSE ''
END
WHERE IFNULL(r.`reward_tier`, '') = '';

View File

@@ -0,0 +1,5 @@
-- 测试用游玩记录表:结构与 dice_play_record 一致不关联真实玩家player_id 填 0
-- 用于一键测试权重时写入模拟数据,可一键清空
-- 若表已存在可跳过;执行前请确认 dice_play_record 表已存在
CREATE TABLE IF NOT EXISTS `dice_play_record_test` LIKE `dice_play_record`;

View File

@@ -0,0 +1,10 @@
-- 测试用游玩记录表:新增底注/注数 ante 与付费金额 paid_amount
-- 用于权重一键测试时按新口径计算 win_coin / paid_amount / 平台盈利
ALTER TABLE `dice_play_record_test`
ADD COLUMN `ante` int unsigned NOT NULL DEFAULT 1 COMMENT '底注/注数dice_ante_config.mult' AFTER `lottery_type`;
ALTER TABLE `dice_play_record_test`
ADD COLUMN `paid_amount` int unsigned NOT NULL DEFAULT 0 COMMENT '付费金额(付费局=ante*1免费局=0' AFTER `ante`;

View File

@@ -0,0 +1,5 @@
-- 测试抽奖记录关联权重测试记录:用于按 record 统计 platform_profit付费金额 paid_amount 求和 - win_coin 求和)
-- 若列已存在可跳过
ALTER TABLE `dice_play_record_test` ADD COLUMN `reward_config_record_id` int unsigned DEFAULT NULL COMMENT '关联 dice_reward_config_record.id' AFTER `admin_id`;
CREATE INDEX `idx_reward_config_record_id` ON `dice_play_record_test` (`reward_config_record_id`);

View File

@@ -0,0 +1,17 @@
-- 游玩记录测试表:新增 reward_tierT1,T2,T3,T4,T5,BIGWIN
-- 说明:
-- - 当前版本已不再使用/保留历史“奖励配置ID”字段
-- - 回填逻辑改为使用 target_index对应 dice_reward_config.id与 super_win_coin 判定 BIGWIN
ALTER TABLE `dice_play_record_test`
ADD COLUMN `reward_tier` varchar(10) NOT NULL DEFAULT '' COMMENT '中奖档位T1,T2,T3,T4,T5,BIGWIN' AFTER `direction`;
UPDATE `dice_play_record_test` r
SET r.`reward_tier` =
CASE
WHEN IFNULL(r.`super_win_coin`, 0) > 0 THEN 'BIGWIN'
WHEN IFNULL(r.`target_index`, 0) > 0 THEN IFNULL((SELECT c.`tier` FROM `dice_reward_config` c WHERE c.`id` = r.`target_index` LIMIT 1), '')
ELSE ''
END
WHERE IFNULL(r.`reward_tier`, '') = '';

View File

@@ -0,0 +1,14 @@
-- 修复测试记录时间字段为空:
-- 1) 先回填历史 NULL
-- 2) 再设置数据库默认值与自动更新时间,避免应用侧漏写导致 NULL
UPDATE `dice_play_record_test`
SET `create_time` = IFNULL(`create_time`, NOW()),
`update_time` = IFNULL(`update_time`, IFNULL(`create_time`, NOW()))
WHERE `create_time` IS NULL OR `update_time` IS NULL;
ALTER TABLE `dice_play_record_test`
MODIFY COLUMN `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间';
ALTER TABLE `dice_play_record_test`
MODIFY COLUMN `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间';

View File

@@ -0,0 +1,5 @@
-- 为 dice_player 表新增 admin_id 字段
-- admin_id 关联 sa_system_user.id表示创建该玩家的后台管理员
ALTER TABLE `dice_player`
ADD COLUMN `admin_id` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '创建该玩家的后台管理员ID关联 sa_system_user.id';

View File

@@ -0,0 +1,6 @@
-- 玩家表新增 free_ticket 字段用于记录免费抽奖券JSON{"ante":1,"count":1}
-- 若已存在可跳过
ALTER TABLE `dice_player`
ADD COLUMN `free_ticket` json NULL COMMENT '免费抽奖券:{"ante":1,"count":1}' AFTER `free_ticket_count`;

View File

@@ -0,0 +1,11 @@
-- 为 dice_play_record、dice_player_ticket_record、dice_player_wallet_record 表新增 admin_id 字段
-- admin_id 关联 DicePlayer.admin_id表示玩家所属管理员
ALTER TABLE `dice_play_record`
ADD COLUMN `admin_id` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '关联玩家所属管理员IDDicePlayer.admin_id';
ALTER TABLE `dice_player_ticket_record`
ADD COLUMN `admin_id` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '关联玩家所属管理员IDDicePlayer.admin_id';
ALTER TABLE `dice_player_wallet_record`
ADD COLUMN `admin_id` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '关联玩家所属管理员IDDicePlayer.admin_id';

12
server/db/dice_reward.sql Normal file
View File

@@ -0,0 +1,12 @@
-- 奖励对照表:按档位与方向(顺时针/逆时针)存储权重,无自增 ID
-- 与 dice_reward_config 通过 end_index(=DiceRewardConfig.id) 关联
CREATE TABLE IF NOT EXISTS `dice_reward` (
`tier` varchar(20) NOT NULL COMMENT '档位 T1-T5/BIGWIN',
`direction` tinyint NOT NULL COMMENT '0=顺时针,1=逆时针',
`end_index` int unsigned NOT NULL COMMENT '结束索引DiceRewardConfig.id',
`weight` int unsigned NOT NULL DEFAULT 1 COMMENT '权重 1-10000档位内按权重比抽取',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`delete_time` datetime DEFAULT NULL COMMENT '软删除时间',
PRIMARY KEY (`tier`, `direction`, `end_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='奖励对照表-按档位与方向存储权重';

View File

@@ -0,0 +1,8 @@
-- dice_reward 表增加展示字段:创建时从 config 写入,便于列表直接显示
ALTER TABLE `dice_reward`
ADD COLUMN `grid_number` int unsigned NOT NULL DEFAULT 0 COMMENT '色子点数(摇取值)',
ADD COLUMN `start_index` int unsigned NOT NULL DEFAULT 0 COMMENT '起始索引(DiceRewardConfig.id)',
ADD COLUMN `ui_text` varchar(255) DEFAULT '' COMMENT '显示文本(来自config)',
ADD COLUMN `real_ev` decimal(12,2) DEFAULT NULL COMMENT '实际中奖金额(来自config)',
ADD COLUMN `remark` varchar(255) DEFAULT '' COMMENT '备注(来自config)',
ADD COLUMN `type` tinyint NOT NULL DEFAULT 0 COMMENT '奖励类型(来自config):-2=唯一惩罚,-1=抽水,0=回本,1=再来一次,2=小赚,3=大奖格';

View File

@@ -0,0 +1,4 @@
-- dice_reward 表增加自增主键 id原复合主键改为唯一索引以保证 (tier,direction,end_index) 不重复
ALTER TABLE `dice_reward` DROP PRIMARY KEY;
ALTER TABLE `dice_reward` ADD COLUMN `id` bigint unsigned NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`);
ALTER TABLE `dice_reward` ADD UNIQUE KEY `uk_tier_direction_end` (`tier`, `direction`, `end_index`);

View File

@@ -0,0 +1,6 @@
-- 奖励配置表增加 weight 字段:仅 tier=BIGWIN 时使用0-1000010000=100% 中大奖
-- 若之前执行过 dice_reward_config_drop_weight.sql 已删除该列,需执行本脚本恢复
-- 若表已有 weight 列会报错,可忽略
ALTER TABLE `dice_reward_config`
ADD COLUMN `weight` int unsigned NOT NULL DEFAULT 10000 COMMENT 'BIGWIN 大奖权重 0-1000010000=100%' AFTER `tier`;

View File

@@ -0,0 +1,4 @@
-- 奖励配置表新增 type 字段:奖励类型
-- -2=唯一惩罚, -1=抽水, 0=回本, 1=再来一次, 2=小赚, 3=大奖格
ALTER TABLE `dice_reward_config`
ADD COLUMN `type` tinyint NOT NULL DEFAULT 0 COMMENT '奖励类型:-2=唯一惩罚,-1=抽水,0=回本,1=再来一次,2=小赚,3=大奖格';

View File

@@ -0,0 +1,3 @@
ALTER TABLE `dice_reward_config`
ADD COLUMN `ui_text_en` varchar(255) NOT NULL DEFAULT '' COMMENT '前端显示文本(英文)' AFTER `ui_text`;

View File

@@ -0,0 +1,3 @@
-- DiceRewardConfig 新增 weight 字段:仅 tier=BIGWIN 时可设定0-100%
ALTER TABLE `dice_reward_config`
ADD COLUMN `weight` decimal(5,2) NOT NULL DEFAULT 0.00 COMMENT '权重%,仅 tier=BIGWIN 时可设定0-100' AFTER `tier`;

View File

@@ -0,0 +1,14 @@
-- dice_reward_config 表结构迁移:按 DiceRewardConfigTest 配置
-- 1. s_end_index 改为 n_start_index逆时针起始索引
-- 2. n_end_index 改为 s_start_index顺时针起始索引
-- 3. weight 改为 1-10000 整数(原为 0-100 小数则需先改类型再改范围)
-- 若表已有 s_end_index / n_end_index先重命名
ALTER TABLE `dice_reward_config`
CHANGE COLUMN `s_end_index` `n_start_index` int NOT NULL DEFAULT 0 COMMENT '逆时针起始索引';
ALTER TABLE `dice_reward_config`
CHANGE COLUMN `n_end_index` `s_start_index` int NOT NULL DEFAULT 0 COMMENT '顺时针起始索引';
-- weight 改为 1-10000 无符号整数(若原为 decimal(5,2),先改类型)
ALTER TABLE `dice_reward_config`
MODIFY COLUMN `weight` int unsigned NOT NULL DEFAULT 1 COMMENT '权重 1-10000档位内按权重比抽取 grid_number';

View File

@@ -0,0 +1,28 @@
[
{"id": 0, "grid_number": 20, "ui_text": "100", "ui_text_en": "100", "real_ev": 1, "tier": "T2", "remark": "完美回本"},
{"id": 1, "grid_number": 27, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -80, "tier": "T3", "remark": "抽水"},
{"id": 2, "grid_number": 24, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -85, "tier": "T3", "remark": "抽水"},
{"id": 3, "grid_number": 10, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -140, "tier": "T4", "remark": "惩罚"},
{"id": 4, "grid_number": 5, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -90, "tier": "T3", "remark": "抽水"},
{"id": 5, "grid_number": 15, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -88, "tier": "T3", "remark": "抽水"},
{"id": 6, "grid_number": 8, "ui_text": "300", "ui_text_en": "300", "real_ev": 250, "tier": "T1", "remark": "大奖格"},
{"id": 7, "grid_number": 22, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -120, "tier": "T4", "remark": "惩罚"},
{"id": 8, "grid_number": 30, "ui_text": "600", "ui_text_en": "600", "real_ev": 499, "tier": "T1", "remark": "大奖格"},
{"id": 9, "grid_number": 23, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -83, "tier": "T3", "remark": "抽水"},
{"id": 10, "grid_number": 16, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -82, "tier": "T3", "remark": "抽水"},
{"id": 11, "grid_number": 12, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -79, "tier": "T3", "remark": "抽水"},
{"id": 12, "grid_number": 13, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -77, "tier": "T3", "remark": "抽水"},
{"id": 13, "grid_number": 7, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -78, "tier": "T3", "remark": "抽水"},
{"id": 14, "grid_number": 17, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -76, "tier": "T3", "remark": "抽水"},
{"id": 15, "grid_number": 9, "ui_text": "500", "ui_text_en": "500", "real_ev": 400, "tier": "T1", "remark": "大奖格"},
{"id": 16, "grid_number": 21, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -84, "tier": "T3", "remark": "抽水"},
{"id": 17, "grid_number": 26, "ui_text": "400", "ui_text_en": "400", "real_ev": 350, "tier": "T1", "remark": "大奖格"},
{"id": 18, "grid_number": 6, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -86, "tier": "T3", "remark": "抽水"},
{"id": 19, "grid_number": 29, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -87, "tier": "T3", "remark": "抽水"},
{"id": 20, "grid_number": 19, "ui_text": "100", "ui_text_en": "100", "real_ev": 1, "tier": "T2", "remark": "完美回本"},
{"id": 21, "grid_number": 11, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -81, "tier": "T3", "remark": "抽水"},
{"id": 22, "grid_number": 25, "ui_text": "再来一次", "ui_text_en": "Once again", "real_ev": 0, "tier": "T5", "remark": "前端需要在播放一次动画(特殊)"},
{"id": 23, "grid_number": 14, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -89, "tier": "T3", "remark": "抽水"},
{"id": 24, "grid_number": 28, "ui_text": "-40", "ui_text_en": "-40", "real_ev": -75, "tier": "T3", "remark": "抽水"},
{"id": 25, "grid_number": 18, "ui_text": "50", "ui_text_en": "50", "real_ev": 50, "tier": "T2", "remark": "小赚"}
]

View File

@@ -0,0 +1,7 @@
-- 移除 DiceRewardConfig 表的 s_start_index、n_start_index 字段
-- 起始索引已迁移至 dice_reward.start_index开局逻辑与列表均不再依赖 config 的这两列
-- 执行前请确认:已运行「创建奖励对照」且 dice_reward 中 start_index 已正确写入
-- 若 MySQL < 8.0.23 不支持 DROP COLUMN IF EXISTS可改为 DROP COLUMN 并忽略“列不存在”错误
ALTER TABLE `dice_reward_config` DROP COLUMN IF EXISTS `s_start_index`;
ALTER TABLE `dice_reward_config` DROP COLUMN IF EXISTS `n_start_index`;

View File

@@ -0,0 +1,2 @@
-- 从奖励配置表移除权重字段,权重改由 dice_reward 表管理(区分顺时针/逆时针)
ALTER TABLE `dice_reward_config` DROP COLUMN IF EXISTS `weight`;

View File

@@ -0,0 +1,14 @@
-- 权重配比测试记录表:保存测试时的权重快照与落点统计,用于验证配比效果
-- weight_config_snapshot: 测试时使用的权重配比快照(按档位 T1-T5/BIGWIN 的 id, grid_number, tier, weight
-- result_counts: 落点统计 JSON键为 grid_number色子点数值为出现次数
CREATE TABLE IF NOT EXISTS `dice_reward_config_record` (
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`test_count` int unsigned NOT NULL DEFAULT 100 COMMENT '测试次数100/500/1000',
`weight_config_snapshot` json DEFAULT NULL COMMENT '测试时权重配比快照:按档位保存 id,grid_number,tier,weight',
`result_counts` json DEFAULT NULL COMMENT '落点统计grid_number=>出现次数',
`admin_id` int unsigned DEFAULT NULL COMMENT '执行测试的管理员ID',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_create_time` (`create_time`),
KEY `idx_admin_id` (`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='奖励配置权重测试记录';

View File

@@ -0,0 +1,7 @@
-- 一键测试权重:新增底注/注数 ante 字段
-- 用于权重测试模拟时计算 win_coin / paid_amount / 平台盈利
-- 若列已存在可跳过该条
ALTER TABLE `dice_reward_config_record`
ADD COLUMN `ante` int unsigned NOT NULL DEFAULT 1 COMMENT '底注/注数(玩家每注下注倍数 mult' AFTER `free_n_count`;

View File

@@ -0,0 +1,5 @@
-- 奖励配置权重测试记录表新增 bigwin_weight测试时 BIGWIN 档位的权重快照
-- 若列已存在可跳过该条
ALTER TABLE `dice_reward_config_record` ADD COLUMN `bigwin_weight` json DEFAULT NULL COMMENT '测试时 BIGWIN 档位 weight 快照:{"grid_number": weight, ...}' AFTER `platform_profit`;

View File

@@ -0,0 +1,7 @@
-- 一键测试权重:链式再来一次模式显式落库,计划付费次数与再来一次次数用于展示
-- 执行前请确认表 `dice_reward_config_record` 已存在
ALTER TABLE `dice_reward_config_record`
ADD COLUMN `chain_free_mode` tinyint NOT NULL DEFAULT 0 COMMENT '1=链式再来一次(付费抽到T5后插入免费局)' AFTER `paid_n_count`,
ADD COLUMN `paid_planned_spins` int unsigned NOT NULL DEFAULT 0 COMMENT '计划付费抽奖次数(顺时针+逆时针)' AFTER `chain_free_mode`,
ADD COLUMN `play_again_count` int unsigned NOT NULL DEFAULT 0 COMMENT '再来一次次数(T5触发次数)' AFTER `paid_planned_spins`;

View File

@@ -0,0 +1,6 @@
-- 一键测试权重:新增测试内杀分开关与安全线
-- kill_mode_enabled=1 时,模拟玩家累计盈利达到 test_safety_line 后,付费抽奖切到 killScore
ALTER TABLE `dice_reward_config_record`
ADD COLUMN `kill_mode_enabled` tinyint NOT NULL DEFAULT 0 COMMENT '测试内杀分开关1=开启0=关闭' AFTER `chain_free_mode`,
ADD COLUMN `test_safety_line` int unsigned NOT NULL DEFAULT 5000 COMMENT '测试内安全线:模拟玩家累计盈利达到该值后,付费抽奖走杀分逻辑' AFTER `kill_mode_enabled`;

View File

@@ -0,0 +1,5 @@
-- 奖励配置权重测试记录:新增平台赚取金额(测试完成后写入)
-- 公式:关联 dice_play_record_test 中付费金额 paid_amount 求和 - 关联 win_coin 求和
-- 必须执行本脚本后,新完成的权重测试才会记录「平台赚取金额」;若某列已存在会报错,可跳过该条
ALTER TABLE `dice_reward_config_record` ADD COLUMN `platform_profit` decimal(14,2) DEFAULT NULL COMMENT '平台赚取金额(付费金额 paid_amount 求和-玩家总收益 win_coin 求和)' AFTER `tier_counts`;

View File

@@ -0,0 +1,16 @@
-- 一键测试权重:为 dice_reward_config_record 增加进度与结果字段
-- total_play_count: 总模拟次数s_count + n_count
-- over_play_count: 已完成次数,每完成 10 条写入 dice_play_record_test 后更新
-- status: -1 失败0 进行中1 成功
-- remark: 失败时记录原因
-- s_count / n_count: 顺时针、逆时针模拟次数
-- tier_counts: 档位出现次数 JSON如 {"T1":100,"T2":200,...},用于档位概率
-- 若某列已存在会报错,可跳过该条
ALTER TABLE `dice_reward_config_record` ADD COLUMN `total_play_count` int unsigned NOT NULL DEFAULT 0 COMMENT '总模拟次数' AFTER `lottery_config_id`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `over_play_count` int unsigned NOT NULL DEFAULT 0 COMMENT '已完成次数' AFTER `total_play_count`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态 -1失败 0进行中 1成功' AFTER `over_play_count`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `remark` varchar(500) DEFAULT NULL COMMENT '失败时记录原因' AFTER `status`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `s_count` int unsigned NOT NULL DEFAULT 0 COMMENT '顺时针模拟次数' AFTER `remark`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `n_count` int unsigned NOT NULL DEFAULT 0 COMMENT '逆时针模拟次数' AFTER `s_count`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `tier_counts` json DEFAULT NULL COMMENT '档位出现次数 T1=>count' AFTER `result_counts`;

View File

@@ -0,0 +1,4 @@
-- 测试记录表:增加 T1-T5 档位权重快照与使用的奖池配置 ID
ALTER TABLE `dice_reward_config_record`
ADD COLUMN `tier_weights_snapshot` json DEFAULT NULL COMMENT '测试时使用的 T1-T5 档位权重快照:来自 DiceLotteryPoolConfig 的 t1_weightt5_weight' AFTER `weight_config_snapshot`,
ADD COLUMN `lottery_config_id` int unsigned DEFAULT NULL COMMENT '测试时使用的奖池配置 IDDiceLotteryPoolConfig.id' AFTER `tier_weights_snapshot`;

View File

@@ -0,0 +1,8 @@
-- 移除 dice_reward_config_record 冗余旧计数字段(已由 paid_s_count/paid_n_count + 链式逻辑替代)
-- 执行前请确认相关代码已升级,不再依赖以下字段
ALTER TABLE `dice_reward_config_record`
DROP COLUMN `s_count`,
DROP COLUMN `n_count`,
DROP COLUMN `free_s_count`,
DROP COLUMN `free_n_count`;

View File

@@ -0,0 +1,7 @@
-- 一键测试权重:付费/免费可分别选择奖池配置type=0 / type=1
-- paid_lottery_config_id: 付费抽奖使用的奖池配置,默认 type=0
-- free_lottery_config_id: 免费抽奖使用的奖池配置,默认 type=1
-- 若某列已存在会报错,可跳过该条
ALTER TABLE `dice_reward_config_record` ADD COLUMN `paid_lottery_config_id` int unsigned DEFAULT NULL COMMENT '付费抽奖奖池配置ID' AFTER `lottery_config_id`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `free_lottery_config_id` int unsigned DEFAULT NULL COMMENT '免费抽奖奖池配置ID' AFTER `paid_lottery_config_id`;

View File

@@ -0,0 +1,12 @@
-- 一键测试权重:支持付费/免费分页配置与自定义档位概率
-- paid_s_count / paid_n_count: 付费抽奖 顺时针/逆时针 次数
-- free_s_count / free_n_count: 免费抽奖 顺时针/逆时针 次数
-- paid_tier_weights / free_tier_weights: 自定义档位概率 JSON {T1:x, T2:x, ...},不选奖池配置时使用
-- 若某列已存在会报错,可跳过该条
ALTER TABLE `dice_reward_config_record` ADD COLUMN `paid_s_count` int unsigned NOT NULL DEFAULT 0 COMMENT '付费抽奖顺时针次数' AFTER `n_count`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `paid_n_count` int unsigned NOT NULL DEFAULT 0 COMMENT '付费抽奖逆时针次数' AFTER `paid_s_count`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `free_s_count` int unsigned NOT NULL DEFAULT 0 COMMENT '免费抽奖顺时针次数' AFTER `paid_n_count`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `free_n_count` int unsigned NOT NULL DEFAULT 0 COMMENT '免费抽奖逆时针次数' AFTER `free_s_count`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `paid_tier_weights` json DEFAULT NULL COMMENT '付费自定义档位权重 T1-T5' AFTER `free_n_count`;
ALTER TABLE `dice_reward_config_record` ADD COLUMN `free_tier_weights` json DEFAULT NULL COMMENT '免费自定义档位权重 T1-T5' AFTER `paid_tier_weights`;

View File

@@ -0,0 +1,236 @@
[
{
"id": 0,
"grid_number": 20,
"ui_text": "100",
"ui_text_en": "100",
"real_ev": 0,
"tier": "T2",
"remark": "完美回本(豹子格位仅 T1/T2/T3"
},
{
"id": 1,
"grid_number": 27,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -80,
"tier": "T3",
"remark": "抽水"
},
{
"id": 2,
"grid_number": 24,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -85,
"tier": "T3",
"remark": "抽水"
},
{
"id": 3,
"grid_number": 10,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -75,
"tier": "T3",
"remark": "抽水"
},
{
"id": 4,
"grid_number": 5,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -90,
"tier": "T3",
"remark": "抽水"
},
{
"id": 5,
"grid_number": 15,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -88,
"tier": "T3",
"remark": "抽水"
},
{
"id": 6,
"grid_number": 8,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -82,
"tier": "T3",
"remark": "抽水"
},
{
"id": 7,
"grid_number": 22,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -78,
"tier": "T3",
"remark": "抽水"
},
{
"id": 8,
"grid_number": 30,
"ui_text": "600",
"ui_text_en": "600",
"real_ev": 499,
"tier": "T1",
"remark": "大奖格"
},
{
"id": 9,
"grid_number": 23,
"ui_text": "再来一次",
"ui_text_en": "Once again",
"real_ev": 0,
"tier": "T5",
"remark": "前端需要在播放一次动画(特殊)"
},
{
"id": 10,
"grid_number": 16,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -83,
"tier": "T3",
"remark": "抽水"
},
{
"id": 11,
"grid_number": 12,
"ui_text": "150",
"ui_text_en": "150",
"real_ev": 150,
"tier": "T1",
"remark": "大奖格"
},
{
"id": 12,
"grid_number": 13,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -140,
"tier": "T4",
"remark": "惩罚"
},
{
"id": 13,
"grid_number": 7,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -79,
"tier": "T3",
"remark": "抽水"
},
{
"id": 14,
"grid_number": 17,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -77,
"tier": "T3",
"remark": "抽水"
},
{
"id": 15,
"grid_number": 9,
"ui_text": "500",
"ui_text_en": "500",
"real_ev": 400,
"tier": "T1",
"remark": "大奖格"
},
{
"id": 16,
"grid_number": 21,
"ui_text": "100",
"ui_text_en": "100",
"real_ev": 0,
"tier": "T2",
"remark": "完美回本"
},
{
"id": 17,
"grid_number": 26,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -76,
"tier": "T3",
"remark": "抽水"
},
{
"id": 18,
"grid_number": 6,
"ui_text": "200",
"ui_text_en": "200",
"real_ev": 200,
"tier": "T1",
"remark": "大奖格"
},
{
"id": 19,
"grid_number": 29,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -120,
"tier": "T4",
"remark": "惩罚"
},
{
"id": 20,
"grid_number": 19,
"ui_text": "100",
"ui_text_en": "100",
"real_ev": 0,
"tier": "T2",
"remark": "完美回本"
},
{
"id": 21,
"grid_number": 11,
"ui_text": "120",
"ui_text_en": "120",
"real_ev": 120,
"tier": "T1",
"remark": "大奖格"
},
{
"id": 22,
"grid_number": 25,
"ui_text": "-40",
"ui_text_en": "-40",
"real_ev": -81,
"tier": "T3",
"remark": "抽水"
},
{
"id": 23,
"grid_number": 14,
"ui_text": "150",
"ui_text_en": "150",
"real_ev": 50,
"tier": "T2",
"remark": "小赚"
},
{
"id": 24,
"grid_number": 28,
"ui_text": "100",
"ui_text_en": "100",
"real_ev": 0,
"tier": "T2",
"remark": "完美回本"
},
{
"id": 25,
"grid_number": 18,
"ui_text": "30",
"ui_text_en": "30",
"real_ev": 30,
"tier": "T2",
"remark": "小赚"
}
]

View File

@@ -0,0 +1,20 @@
-- DiceRewardConfigTest 新表奖励配置T1-T5 按档位+权重直接抽取 grid_number
-- 字段s_end_index 改为 n_start_index逆时针起始索引n_end_index 改为 s_start_index顺时针起始索引
-- weight 取值范围 1-10000各档位权重和不限制
CREATE TABLE IF NOT EXISTS `dice_reward_config_test` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`grid_number` int NOT NULL DEFAULT 0 COMMENT '色子点数',
`ui_text` varchar(64) NOT NULL DEFAULT '' COMMENT '前端显示文本',
`real_ev` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '真实资金结算',
`tier` varchar(16) NOT NULL DEFAULT '' COMMENT '所属档位 T1-T5|BIGWIN',
`weight` int unsigned NOT NULL DEFAULT 1 COMMENT '权重 1-10000按档位内权重比抽取 grid_number',
`n_start_index` int NOT NULL DEFAULT 0 COMMENT '逆时针起始索引',
`s_start_index` int NOT NULL DEFAULT 0 COMMENT '顺时针起始索引',
`remark` varchar(255) NOT NULL DEFAULT '',
`type` tinyint NOT NULL DEFAULT 1,
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_tier` (`tier`),
KEY `idx_grid_number` (`grid_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='奖励配置Test按档位权重抽 grid_numberweight 1-10000';

View File

@@ -0,0 +1,3 @@
-- 保证每个点数(direction, grid_number)唯一一条记录,避免多点数算出相同 end_index 时互相覆盖
ALTER TABLE `dice_reward` DROP INDEX `uk_tier_direction_end`;
ALTER TABLE `dice_reward` ADD UNIQUE KEY `uk_direction_grid_number` (`direction`, `grid_number`);

View File

@@ -0,0 +1,10 @@
-- 移除 Dice_* 表的 channel_id 和 department_id 字段
-- 需 MySQL 8.0.23+ 支持 DROP COLUMN IF EXISTS若版本较低请逐条执行并忽略报错
ALTER TABLE `dice_config` DROP COLUMN IF EXISTS `channel_id`, DROP COLUMN IF EXISTS `department_id`;
ALTER TABLE `dice_player` DROP COLUMN IF EXISTS `channel_id`, DROP COLUMN IF EXISTS `department_id`;
ALTER TABLE `dice_play_record` DROP COLUMN IF EXISTS `channel_id`, DROP COLUMN IF EXISTS `department_id`;
ALTER TABLE `dice_player_ticket_record` DROP COLUMN IF EXISTS `channel_id`, DROP COLUMN IF EXISTS `department_id`;
ALTER TABLE `dice_player_wallet_record` DROP COLUMN IF EXISTS `channel_id`, DROP COLUMN IF EXISTS `department_id`;
ALTER TABLE `dice_reward_config` DROP COLUMN IF EXISTS `channel_id`, DROP COLUMN IF EXISTS `department_id`;
ALTER TABLE `dice_lottery_pool_config` DROP COLUMN IF EXISTS `channel_id`, DROP COLUMN IF EXISTS `department_id`;

View File

@@ -0,0 +1,9 @@
-- 为 sa_system_user 表新增 agent_id 字段
-- agent_id = md5(id),保证唯一,用于外部系统标识用户
ALTER TABLE `sa_system_user`
ADD COLUMN `agent_id` varchar(32) NULL DEFAULT NULL COMMENT '代理标识md5(id)唯一' AFTER `id`,
ADD UNIQUE INDEX `uk_agent_id`(`agent_id`) USING BTREE;
-- 为已有数据回填 agent_id
UPDATE `sa_system_user` SET `agent_id` = MD5(id) WHERE `agent_id` IS NULL OR `agent_id` = '';

View File

@@ -7,8 +7,8 @@
- game_type: `slot`
- game_list: `["dafuwen"]`
- provider_logo: ``
- 获取大厅地址: `https://dice-v3-lobby.yuliao666.top`
- 后台管理地址: `https://dice-v3.yuliao666.top/`
- 获取大厅地址: `https://dice-v3-lobby.h55555game.top`
- 后台管理地址: `https://dice-v3.h55555game.top/`
- agent_token: `[我来填]`
- agent_id: `5ef059938ba799aaa845e1c2e8a762bd`
@@ -199,8 +199,8 @@ auth-token: {authtoken}
"game_key": "dafuwen",
"game_type": "slot",
"logo": "",
"game_url": "https://dice-v3-game.yuliao666.top/",
"hall_url": "https://dice-v3-game.yuliao666.top/",
"game_url": "https://dice-v3-game.h55555game.top/",
"hall_url": "https://dice-v3-game.h55555game.top/",
"status": 1,
"sort": 1,
"game_name": "大富翁"
@@ -225,8 +225,8 @@ auth-token: {authtoken}
"game_key": "dafuwen",
"game_type": "slot",
"logo": "",
"game_url": "https://dice-v3-game.yuliao666.top/",
"hall_url": "https://dice-v3-game.yuliao666.top/",
"game_url": "https://dice-v3-game.h55555game.top/",
"hall_url": "https://dice-v3-game.h55555game.top/",
"status": 1,
"sort": 1,
"game_name": "Dafuweng"
@@ -264,7 +264,7 @@ auth-token: {authtoken}
"data": {
"provider": "Dicey Fun",
"provider_code": "DF",
"hall_url": "https://dice-v3-game.yuliao666.top/",
"hall_url": "https://dice-v3-game.h55555game.top/",
"game_list": [
{
"provider": "Dicey Fun",
@@ -273,8 +273,8 @@ auth-token: {authtoken}
"game_key": "dafuwen",
"game_type": "slot",
"logo": "",
"game_url": "https://dice-v3-game.yuliao666.top/",
"hall_url": "https://dice-v3-game.yuliao666.top/",
"game_url": "https://dice-v3-game.h55555game.top/",
"hall_url": "https://dice-v3-game.h55555game.top/",
"status": 1,
"sort": 1,
"game_name": "大富翁"
@@ -293,7 +293,7 @@ auth-token: {authtoken}
"data": {
"provider": "Dicey Fun",
"provider_code": "DF",
"hall_url": "https://dice-v3-game.yuliao666.top/",
"hall_url": "https://dice-v3-game.h55555game.top/",
"game_list": [
{
"provider": "Dicey Fun",
@@ -302,8 +302,8 @@ auth-token: {authtoken}
"game_key": "dafuwen",
"game_type": "slot",
"logo": "",
"game_url": "https://dice-v3-game.yuliao666.top/",
"hall_url": "https://dice-v3-game.yuliao666.top/",
"game_url": "https://dice-v3-game.h55555game.top/",
"hall_url": "https://dice-v3-game.h55555game.top/",
"status": 1,
"sort": 1,
"game_name": "Dafuweng"
@@ -432,7 +432,7 @@ auth-token: {authtoken}
## 9. 后台管理信息
- 后台管理地址:`https://dice-v3.yuliao666.top/`
- 后台管理地址:`https://dice-v3.h55555game.top/`
- 后台账号:`zhuguan`
- 后台密码:`qwer1234`

View File

@@ -0,0 +1,20 @@
# 后端 dice-api.h55555game.top 正确配置说明
# 问题:当前 Nginx 用 root 当静态站,而 /core、/dice 等接口由 Webman(6688) 处理,必须反代到 6688
# 在 server { ... } 内、在现有 location 之前,添加下面这一块(或替换掉仅用 root 的方式):
# 将请求转发到 Webman端口 6688
location / {
proxy_pass http://127.0.0.1:6688;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# 若 public 目录下有需要直接由 Nginx 提供的静态文件,可再单独加 location例如
# location /assets/ {
# alias /www/wwwroot/dafuweng-api/server/public/;
# }