From 14b460760fd0fa06bc17484019a119e441f94fa7 Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Mon, 6 Jun 2022 01:02:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=86=E6=95=B0?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=BE=97=E5=A4=9A=E4=BD=8D=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/user_center/rpc/etc/user_center-dev.yaml | 1 - app/user_center/rpc/etc/user_center.yaml | 160 +++++++++++++++--- .../logic/statistics/stat_pvp_report_logic.go | 12 +- 3 files changed, 147 insertions(+), 26 deletions(-) diff --git a/app/user_center/rpc/etc/user_center-dev.yaml b/app/user_center/rpc/etc/user_center-dev.yaml index 09d1edd..08eff59 100644 --- a/app/user_center/rpc/etc/user_center-dev.yaml +++ b/app/user_center/rpc/etc/user_center-dev.yaml @@ -10,7 +10,6 @@ Etcd: NonBlock: true Log: Mode: console - Path: logs/live-service KeepDays: 7 Level: info DB: diff --git a/app/user_center/rpc/etc/user_center.yaml b/app/user_center/rpc/etc/user_center.yaml index 4b569da..7728aff 100644 --- a/app/user_center/rpc/etc/user_center.yaml +++ b/app/user_center/rpc/etc/user_center.yaml @@ -9,28 +9,31 @@ Etcd: NonBlock: true Log: Mode: file + Path: logs/user_center KeepDays: 7 Level: info DB: - #DataSource: root:root@tcp(192.168.1.100:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true DataSource: root:root@tcp(127.0.0.1:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true Kafka: - UserNotify: + UserCoinNotify: Addr: [ "127.0.0.1:9093" ] - Topic: "notify-user" + Topic: "notify-user-coin" RankUpdate: Addr: [ "127.0.0.1:9093" ] Topic: "rank-update" + RewardPool: + Addr: [ "127.0.0.1:9093" ] + Topic: "rewardPool" UserRetriever: Enabled: true UpdateDuration: 720 # 720 hours = 30 Day = 1 Month + NobilityPlatforms: [ "bilibili" ] # 需要获取贵族的平台列表 Cron: PlatformUser: "0 0/5 * * * ?" # 每隔5分钟执行一次 Nobility: "0 0/10 * * * ?" # 每隔10分钟执行一次 - NobilityPlatforms: [ "bilibili" ] # 需要获取贵族的平台列表 Bilibili: - RoomId: 8722013 - Mid: 6704420 + RoomId: 6925399 + # Mid: 6704420 RoomShortInfoApi: https://api.live.bilibili.com/room/v1/Room/room_init TopListApi: https://api.live.bilibili.com/guard/topList Rank: @@ -38,27 +41,142 @@ Rank: Cron: Update: "@every 10s" # 10s一次 Persistence: "@every 10m" # 10min一次 + Submit: + # 未列举的榜 + 0: + Best: [30,10,8,6,5,5] + Consolation: 1 + # 名将 + 3: + TitleId: 1000 + Best: [50,30,20,15,10,8] + Consolation: 1 + # 小兵终结者 + 5: + TitleId: 1001 + Best: [50,30,20,15,10,8] + Consolation: 1 + # 拆迁办 + 7: + TitleId: 1002 + Best: [60,40,25.6,18,10,8] + Consolation: 1 + # 获胜榜 + 9: + TitleId: 1003 + Best: [45.6,23.4,15,10,8,6] + Consolation: 1 + # 一血 + 11: + TitleId: 1004 + Best: [66.6,45.6,28,18,10,6] + Consolation: 2 + # 怒送一血 + 12: + TitleId: 1005 + Best: [66.6,45.6,28,18,10,6] + Consolation: 2 GiftCollector: Enabled: true Platforms: [ "bilibili" ] Cron: CollectGift: "0 0 0/6 * * ?" # 每隔6小时执行一次 -Integral: - # 签到积分配置 +Coin: + # 签到配置 CheckIn: - # 签到积分 一周 0(周日) 1 2 3 4 5 6 - Points: [ 10000,2500,2500,3500,5000,6500,8000 ] - Critical: 0.15 # 签到积分暴击率 - CriticalRadio: [ 1.0, 1.0, 1.2, 1.5, 1.8 ] # 暴击倍率 - BattleReport: - GeneralIntegral: 1000 # 名将积分 - WinRadio: 0.02 # 伤害量 1/50 - LostRadio: 0.008 # 伤害量 1/120 - # RMB到积分的转换 - RMBToIntegral: 1000 + # 签到 一周 0(周日) 1 2 3 4 5 6 + Points: [ 60,10,15,20,25,30,50 ] + Critical: 0.08 # 签到暴击率 + CriticalRadio: [ 1.2, 1.3, 1.5 ] # 暴击倍率 + # RMB到弹币的转换 + RMBToCoin: 10 # 平台礼物到RMB的转换 GiftToRMB: bilibili: 0.001 - # 平台免费礼物到积分的转换 - FreeToIntegral: - bilibili: 0.00025 \ No newline at end of file + # 平台免费礼物到弹币的转换 + FreeToCoin: + bilibili: 0.01 # 价值1毛 +Elite: + LiveDict: { "1": "0", "2": "1001", "3": "1002" } + DefaultId: 0 + Items: + - Id: 1001 + Sort: 2 + PriceDay: 80 + PriceForever: 26660 + - Id: 1002 + Sort: 3 + PriceDay: 60 + PriceForever: 18888 +Title: + LiveDict: { "1": "2000" } + Items: + - Id: 99999 + Name: 无上意志 + Type: custom + - Id: 1 + Name: 祁池帝姬 + Type: custom + - Id: 2 + Name: 废物舰长 + Type: custom + - Id: 3 + Name: Joe王 + Type: custom + - Id: 4 + Name: 我是弟弟 + Type: custom + - Id: 5 + Name: 萌新导师 + Type: custom + - Id: 6 + Name: 群萌新 + Type: custom + - Id: 1000 + Name: 军神 # 名将榜首 + Type: rank + RankType: 3 + - Id: 1001 + Name: 人屠 # 小兵击杀榜首 + Type: rank + RankType: 5 + - Id: 1002 + Name: 破营 # 拆迁榜首 + Type: rank + RankType: 7 + - Id: 1003 + Name: 不败 # 常胜榜首 + Type: rank + RankType: 9 + - Id: 1004 + Name: 勇冠三军 # 一血榜首 + Type: rank + RankType: 11 + - Id: 1005 + Name: 求放过 # 被一血榜首 + Type: rank + RankType: 12 + - Id: 2000 + Name: 无用之人 + Type: default + PriceDay: 50 + PriceForever: 100000 +GiftPackMap: + - PackType: starter + PackName: 新手礼包 + Condition: + UserLimit: 1 + UserResetType: unset + StartTime: "2022-05-21 09:00:00" + EndTime: "2022-05-21 09:00:00" + Content: + Coin: 50 + - PackType: subsistence + PackName: 低保 + Condition: + UserLimit: 3 + UserResetType: daily + StartTime: "2022-05-21 09:00:00" + EndTime: "2022-05-21 09:00:00" + Content: + Coins: [ 10, 15, 20 ] \ No newline at end of file diff --git a/app/user_center/rpc/internal/logic/statistics/stat_pvp_report_logic.go b/app/user_center/rpc/internal/logic/statistics/stat_pvp_report_logic.go index f7c80e8..341868b 100644 --- a/app/user_center/rpc/internal/logic/statistics/stat_pvp_report_logic.go +++ b/app/user_center/rpc/internal/logic/statistics/stat_pvp_report_logic.go @@ -163,10 +163,14 @@ func (l *StatPvpReportLogic) calcScoreResponse(sum sumType, items []*statPvPRepo Mul(decimal.NewFromInt(30)). Round(1).Float64() - itemResp.Score += float32(damageScore) - itemResp.Score += float32(deDamageScore) - itemResp.Score += float32(killPlayerScore) - itemResp.Score += float32(kdScore) + tmpScore, _ := decimal.NewFromFloat32(itemResp.Score). + Add(decimal.NewFromFloat(damageScore)). + Add(decimal.NewFromFloat(deDamageScore)). + Add(decimal.NewFromFloat(killPlayerScore)). + Add(decimal.NewFromFloat(kdScore)). + Round(1).Float64() + + itemResp.Score += float32(tmpScore) if item.firstBlood { itemResp.Score += 5 }