Compare commits
122 Commits
f15ce4ef8f
...
527e3b1acb
| Author | SHA1 | Date |
|---|---|---|
|
|
527e3b1acb | |
|
|
579c579118 | |
|
|
ee9878957a | |
|
|
07d8de615e | |
|
|
32a6f12ebf | |
|
|
b4c377fc44 | |
|
|
de391699b8 | |
|
|
e582568f6b | |
|
|
82ad3cd4c6 | |
|
|
91d3cfe16b | |
|
|
a0596475a7 | |
|
|
7232de625d | |
|
|
06ed65d88f | |
|
|
a5bf9df289 | |
|
|
a51ec6667d | |
|
|
18e9575aa3 | |
|
|
b76949b468 | |
|
|
211283fc65 | |
|
|
a14750dfb8 | |
|
|
044cf9f863 | |
|
|
5db3c767e4 | |
|
|
2bcbfaec2f | |
|
|
2aff7b19fb | |
|
|
e6baf7ef86 | |
|
|
79abb14bd3 | |
|
|
8a0502302f | |
|
|
03ac53b7e8 | |
|
|
d671697496 | |
|
|
c1f33de1d5 | |
|
|
d47ee74e2c | |
|
|
3ee3f677ce | |
|
|
d63043d3fc | |
|
|
231cff3c4a | |
|
|
8c9b279196 | |
|
|
90fb71b3dc | |
|
|
71c9b583af | |
|
|
521b6e935e | |
|
|
e72e3176a1 | |
|
|
20f511a840 | |
|
|
53889d6a80 | |
|
|
f845409979 | |
|
|
94e1effc63 | |
|
|
043f8d69ea | |
|
|
a535261752 | |
|
|
36708d2af6 | |
|
|
8a320c1cf4 | |
|
|
e4b85bf503 | |
|
|
61d589df26 | |
|
|
2b8ef577f5 | |
|
|
799b7464ef | |
|
|
7876fa34f9 | |
|
|
d1c2e2437c | |
|
|
b88ccb664d | |
|
|
79e05883db | |
|
|
9fd80b867d | |
|
|
a2acd36596 | |
|
|
4c8273031b | |
|
|
e97e531623 | |
|
|
280de58880 | |
|
|
9490fa2cc6 | |
|
|
8174c8447d | |
|
|
23a7160332 | |
|
|
c9bae9e147 | |
|
|
f85a6014fc | |
|
|
86ac616d2d | |
|
|
c00b794dc3 | |
|
|
c482f45e70 | |
|
|
a9cb952e52 | |
|
|
a95c6b6c90 | |
|
|
d5cedb814e | |
|
|
7f6b4a86ae | |
|
|
135f2f99b1 | |
|
|
163509fa5e | |
|
|
df74995590 | |
|
|
f7f5fe263c | |
|
|
71622caf8f | |
|
|
f0c215dc4a | |
|
|
2e16b0bd52 | |
|
|
c5132b2a91 | |
|
|
4bccaac006 | |
|
|
2209f516c7 | |
|
|
adf2dc3c92 | |
|
|
341e481cf5 | |
|
|
855422de68 | |
|
|
ef964f7ec7 | |
|
|
a6b93bceb5 | |
|
|
500527f45e | |
|
|
a3a8c2ef83 | |
|
|
425424c68b | |
|
|
5b28a10602 | |
|
|
f657773a5e | |
|
|
c12514e07d | |
|
|
32eb22f956 | |
|
|
08be09284b | |
|
|
726cdddbd0 | |
|
|
12e93f9750 | |
|
|
54c4e2f945 | |
|
|
70dd053179 | |
|
|
4e08e75510 | |
|
|
f2163d29ac | |
|
|
6647aa920b | |
|
|
91e5b732c1 | |
|
|
f3b7211913 | |
|
|
60a75f73ff | |
|
|
f1a580bce5 | |
|
|
a5bed973a5 | |
|
|
6a0e1e5e90 | |
|
|
b3a166c022 | |
|
|
531df8e564 | |
|
|
0b34ed9d75 | |
|
|
caee9f1aff | |
|
|
a430cc0421 | |
|
|
ae3622c587 | |
|
|
5368460ad3 | |
|
|
0cc66a8b28 | |
|
|
82887c39c1 | |
|
|
6d1fe0c89b | |
|
|
70f8ef26e0 | |
|
|
fe3f0a185d | |
|
|
defdc4b829 | |
|
|
6804bf6641 | |
|
|
51767e9c6a |
|
|
@ -1,12 +1,10 @@
|
|||
stages:
|
||||
- lock
|
||||
- build
|
||||
- save
|
||||
- sync
|
||||
- unlock
|
||||
|
||||
variables:
|
||||
ProjectPath: "mongo.games.com/game" # 项目相对于GOPATH的路径
|
||||
GOPROXY: "https://goproxy.cn,direct"
|
||||
GOPATH: "/home/gopath"
|
||||
GoServerSrcPath: "mongo.games.com/goserver" # 项目相对于GOPATH/src的路径
|
||||
BetaBinPath: "/home/game/" # beta环境部署路径
|
||||
DevelopBinPath: "/home/game/" # develop环境部署路径
|
||||
|
||||
|
|
@ -20,39 +18,29 @@ cache:
|
|||
- ${GOPATH}/pkg/mod
|
||||
- ${GOPATH}/bin
|
||||
|
||||
# 锁定作业,防止并发流水线执行
|
||||
lock_job:
|
||||
stage: lock
|
||||
script:
|
||||
- |
|
||||
if [ -f /tmp/ci_lock ]; then
|
||||
echo "流水线已在运行,等待..."
|
||||
exit 1
|
||||
else
|
||||
touch /tmp/ci_lock
|
||||
echo "获得锁定,开始流水线。"
|
||||
fi
|
||||
|
||||
build-job:
|
||||
stage: build
|
||||
only:
|
||||
- develop
|
||||
- release
|
||||
script:
|
||||
# 拉取代码
|
||||
- echo "拉取代码"
|
||||
- git checkout $CI_COMMIT_REF_NAME
|
||||
- git pull origin $CI_COMMIT_REF_NAME
|
||||
|
||||
# 替换 go.mod 中的 ../goserver
|
||||
- echo "替换 go.mod 中的 ../goserver"
|
||||
- sed -i "s|mongo.games.com/goserver => .*|mongo.games.com/goserver => $GOPATH/src/$GoServerSrcPath|" go.mod
|
||||
|
||||
- if [ ! -z "$(git status --porcelain go.mod go.sum)" ]; then
|
||||
GOMODTIDY=1;
|
||||
fi
|
||||
# 拷贝到GOPATH
|
||||
- echo '拷贝到GOPATH'
|
||||
- rsync -rvc --no-perms --delete ./* $GOPATH/src/$ProjectPath
|
||||
# 进入项目目录
|
||||
- cd $GOPATH/src/$ProjectPath
|
||||
|
||||
# 编译
|
||||
- echo '编译'
|
||||
- echo "编译"
|
||||
- if [ "$GOMODTIDY" == 1 ]; then
|
||||
go mod tidy;
|
||||
go mod tidy;
|
||||
fi
|
||||
- |
|
||||
while IFS= read -r line || [[ -n $line ]]
|
||||
|
|
@ -63,43 +51,33 @@ build-job:
|
|||
cd ..
|
||||
done < ./programs.txt
|
||||
|
||||
save-job:
|
||||
stage: save
|
||||
only:
|
||||
- develop
|
||||
- release
|
||||
script:
|
||||
- cd $GOPATH/src/$ProjectPath
|
||||
# 拷贝文件
|
||||
- echo '拷贝文件'
|
||||
- echo "拷贝文件"
|
||||
- rm -rf ./temp
|
||||
- mkdir ./temp
|
||||
- mkdir ./temp/data
|
||||
- cp -rfp ./data/* ./temp/data
|
||||
|
||||
# 删除自定义配置
|
||||
- echo '删除自定义配置'
|
||||
- echo "删除自定义配置"
|
||||
- |
|
||||
while IFS= read -r line || [[ -n $line ]]
|
||||
do
|
||||
echo "删除 $line 配置"
|
||||
rm ./temp/data/$line
|
||||
done < ./exclude.txt
|
||||
|
||||
# 拷贝可执行程序
|
||||
- echo '拷贝可执行程序'
|
||||
- echo "拷贝可执行程序"
|
||||
- |
|
||||
while IFS= read -r line || [[ -n $line ]]
|
||||
do
|
||||
echo "拷贝 $line"
|
||||
mv ./$line/$line ./temp/$line
|
||||
done < ./programs.txt
|
||||
|
||||
sync_job:
|
||||
stage: sync
|
||||
only:
|
||||
- develop
|
||||
- release
|
||||
script:
|
||||
- cd $GOPATH/src/$ProjectPath
|
||||
|
||||
# 获取部署环境信息
|
||||
- echo "获取部署环境信息"
|
||||
- if [ "$CI_COMMIT_BRANCH" == "develop" ]; then
|
||||
SSH_PRIVATE_KEY="$SSH_PRIVATE_KEY_DEVELOP";
|
||||
REMOTE_HOST="$REMOTE_HOST_DEVELOP";
|
||||
|
|
@ -128,14 +106,7 @@ sync_job:
|
|||
- echo "同步到服务器"
|
||||
- echo "Deploying to remote server using rsync... $BinPath"
|
||||
- rsync -rvz --delete ./temp/ $REMOTE_USER@$REMOTE_HOST:$BinPath
|
||||
|
||||
# 触发部署
|
||||
- "curl -X POST --fail -F token=$SERVER_CI_TOKEN -F ref=release -F variables[ServerName]=$ServerName https://git.pogorockgames.com/api/v4/projects/31/trigger/pipeline"
|
||||
|
||||
# 解锁作业,释放锁定
|
||||
unlock_job:
|
||||
stage: unlock
|
||||
script:
|
||||
- rm -f /tmp/ci_lock
|
||||
- echo "释放锁定,流水线结束。"
|
||||
when: always
|
||||
# 触发部署
|
||||
- echo "触发部署"
|
||||
- "curl -X POST --fail -F token=$SERVER_CI_TOKEN -F ref=release -F variables[ServerName]=$ServerName https://git.pogorockgames.com/api/v4/projects/31/trigger/pipeline"
|
||||
|
|
@ -211,123 +211,136 @@ const (
|
|||
)
|
||||
|
||||
const (
|
||||
GainWay_NewPlayer int32 = 0 //新建角色
|
||||
GainWay_Pay = 1 //后台增加(主要是充值)
|
||||
GainWay_ByPMCmd = 2 //pm命令
|
||||
GainWay_MatchBreakBack = 3 //退赛退还
|
||||
GainWay_MatchSystemSupply = 4 //比赛奖励
|
||||
GainWay_Exchange = 5 //兑换
|
||||
GainWay_ServiceFee = 6 //桌费
|
||||
GainWay_CoinSceneWin = 7 //金豆场赢取
|
||||
GainWay_CoinSceneLost = 8 //金豆场输
|
||||
GainWay_CoinSceneEnter = 9 //进入金币场预扣
|
||||
GainWay_ShopBuy = 10 //商城购买或者兑换
|
||||
GainWay_CoinSceneLeave = 11 //金豆场回兑
|
||||
GainWay_HundredSceneWin = 12 //万人场赢取
|
||||
GainWay_HundredSceneLost = 13 //万人场输
|
||||
GainWay_MessageAttach = 14 //邮件
|
||||
GainWay_SafeBoxSave = 15 //保险箱存入
|
||||
GainWay_SafeBoxTakeOut = 16 //保险箱取出
|
||||
GainWay_Fishing = 17 //捕鱼
|
||||
GainWay_CoinSceneExchange = 18 //金豆场兑换
|
||||
GainWay_UpgradeAccount = 19 //升级账号
|
||||
GainWay_API_AddCoin = 20 //API操作钱包
|
||||
GainWay_GoldCome = 21 //财神降临
|
||||
GainWay_Transfer_System2Thrid = 22 //系统平台转入到第三方平台的金币
|
||||
GainWay_Transfer_Thrid2System = 23 //第三方平台转入到系统平台的金币
|
||||
GainWay_RebateTask = 24 //返利获取
|
||||
GainWay_IOSINSTALLSTABLE = 25 //ios安装奖励
|
||||
GainWay_VirtualChange = 26 //德州虚拟账变
|
||||
GainWay_CreatePrivateScene = 27 //创建私有房间
|
||||
GainWay_PrivateSceneReturn = 28 //解散私有房间返还
|
||||
GainWay_OnlineRandCoin = 29 //红包雨
|
||||
GainWay_Expire = 30 //到期清理
|
||||
GainWay_PromoterBind = 31 //手动绑定推广员
|
||||
GainWay_GradeShopReturn = 32 //积分商城撤单退还积分
|
||||
GainWay_Api_In = 33 //转移金币
|
||||
GainWay_Api_Out = 34 //转移金币
|
||||
GainWay_Shop_Buy = 35 //购买记录
|
||||
GainWay_MAIL_MTEM = 36 //邮件领取道具
|
||||
GainWay_Item_Sale = 37 //道具出售
|
||||
GainWay_ReliefFund = 38 //领取救济金
|
||||
GainWay_Shop_Revoke = 39 //撤单
|
||||
GainWay_ActSign = 40 //
|
||||
GainWay_MatchSignup = 41 //比赛报名费用
|
||||
GainWay_MatchSeason = 42 //比赛赛季奖励
|
||||
GainWay_ActSignNew = 43 //新签到
|
||||
GainWay_ActTurnplate = 44 //轮盘
|
||||
GainWay_ActBlindBox = 45 //盲盒
|
||||
GainWay_ActFirstPay = 46 //首充
|
||||
GainWay_VIPGift = 47 //vip礼包
|
||||
GainWay_ActContinuousPay = 48 //连续充值
|
||||
GainWay_ActJybAward = 49 //礼包码兑换
|
||||
GainWay_LeaveDeduct = 50 //离开扣分
|
||||
GainWay_LeaveCombat = 51 //离开补偿
|
||||
GainWay_RankMatch = 52 //排位赛段位奖励
|
||||
GainWay_AddBag = 53 //增加背包接口调用
|
||||
GainWay_SmallRocket = 54 //小火箭收入
|
||||
GainWay_BindTel = 55 //绑定手机号
|
||||
GainWay_ReliefFund2 = 56 //救济金看视频双倍领取
|
||||
GainWay_ActTurnplate2 = 57 //轮盘看视频双倍领取
|
||||
GainWay_ActSignNew2 = 58 //签到看视频双倍领取
|
||||
GainWay_ItemUse = 59 //道具使用
|
||||
GainWay_PhoneScore = 60 //手机积分活动
|
||||
GainWay_RankReward = 61 //排位奖励
|
||||
GainWay_TaskReward = 62 //任务奖励
|
||||
GainWay_Interact = 63 //房间内互动效果
|
||||
GainWayItemCollectExchange = 64 //集卡活动兑换
|
||||
GainWay_WeekCardAward = 65 //周卡奖励
|
||||
GainWay_PigrankTakeCoin = 66 //存钱罐领取耗费钻石
|
||||
GainWay_PigrankGainCoin = 67 //存钱罐打开获取金币
|
||||
GainWay_ItemMove = 68 //道具赠送
|
||||
GainWay_RoleUpgrade = 69 //角色升级
|
||||
GainWay_PetUpgrade = 70 //宠物升级
|
||||
GainWay_Game = 71 //游戏掉落
|
||||
GainWayItemCollectLogin = 73 //集卡活动登录
|
||||
GainWay_Collect = 74 //集卡活动
|
||||
GainWayItemPhoneScoreExchange = 75 //抽手机活动兑换
|
||||
GainWayItemTaskInvite = 78 //邀请任务
|
||||
GainWayItemTaskNewPlayer = 79 //新手任务
|
||||
GainWayItemTaskAchievement = 80 //成就任务
|
||||
GainWayItemTaskEveryDay = 81 //每日任务
|
||||
GainWayItemWeekActive = 82 //周活跃奖励
|
||||
GainWayContinueSign = 83 //累计签到
|
||||
GainWayBackend = 84 // 后台操作
|
||||
GainWayBuyCoin = 85 // 商城购买金币
|
||||
GainWayBuyItem = 86 // 商城购买道具
|
||||
GainWayBuyWeekCard = 87 // 商城购买周卡
|
||||
GainWayVipBuyCoin = 88 // vip商城购买金币
|
||||
GainWaySign7Con = 89 // 累计签到进阶奖励消耗
|
||||
GainWay_PigrankGainDiamond = 90 //存钱罐打开获取钻石
|
||||
GainWaySign7Add = 91 // 累计签到进阶奖励获得
|
||||
GainWayItemChange = 92 //背包内使用道具兑换话费
|
||||
GainWayPetSkillLevelUp = 93 //宠物技能升级
|
||||
GainWayPermitAward = 94 // 赛季通行证等级奖励
|
||||
GainWayItemPermitRank = 95 // 赛季通行证排行奖励
|
||||
GainWayPermitExchangeCost = 96 // 赛季通行证兑换消耗
|
||||
GainWayPermitExchangeGain = 97 // 赛季通行证兑换获得
|
||||
GainWayItemTaskPermit = 98 // 赛季通行证任务
|
||||
GainWayDiamondLottery = 99 //钻石抽奖
|
||||
GainWaySkinUnLock = 100 // 皮肤解锁消耗
|
||||
GainWaySkinUpGrade = 101 // 皮肤升级消耗
|
||||
GainWayItemFen = 102 // 道具分解消耗
|
||||
GainWayItemFenGain = 103 // 道具分解获得
|
||||
GainWayGuide = 104 //新手引导奖励
|
||||
GainWayVipGift9 = 105 //vip等级礼包
|
||||
GainWayRoomCost = 106 //房费消耗
|
||||
GainWayRoomGain = 107 //房卡场获得
|
||||
GainWayItemShop = 108 // 交易市场道具交易
|
||||
GainWayClawdollCostItem = 109 // 娃娃机上分扣道具
|
||||
GainWayItemShopChangeDoll = 110 // 商城兑换娃娃
|
||||
GainWayItemBagChangeDoll = 111 // 背包内兑换娃娃
|
||||
GainWayClawdollCatch = 112 // 娃娃机抓取到娃娃获取卡
|
||||
GainWayItemBagChangeDollRevocation = 113 //娃娃兑换后台撤销
|
||||
GainWayPermitReset = 114 //赛季通行证积分重置
|
||||
GainWayClientUpgrade = 115 //客户端升级奖励
|
||||
GainWayLottery = 116 //开奖码抽奖
|
||||
GainWayGuide2 = 117 // 竞技馆引导奖励
|
||||
GainWayCompound = 118 // 道具合成消耗
|
||||
GainWayCompoundGain = 119 // 道具合成获得
|
||||
GainWay_NewPlayer int32 = 0 //新建角色
|
||||
GainWay_Pay = 1 //后台增加(主要是充值)
|
||||
GainWay_ByPMCmd = 2 //pm命令
|
||||
GainWay_MatchBreakBack = 3 //退赛退还
|
||||
GainWay_MatchSystemSupply = 4 //比赛奖励
|
||||
GainWay_Exchange = 5 //兑换
|
||||
GainWay_ServiceFee = 6 //桌费
|
||||
GainWay_CoinSceneWin = 7 //金豆场赢取
|
||||
GainWay_CoinSceneLost = 8 //金豆场输
|
||||
GainWay_CoinSceneEnter = 9 //进入金币场预扣
|
||||
GainWay_ShopBuy = 10 //商城购买或者兑换
|
||||
GainWay_CoinSceneLeave = 11 //金豆场回兑
|
||||
GainWay_HundredSceneWin = 12 //万人场赢取
|
||||
GainWay_HundredSceneLost = 13 //万人场输
|
||||
GainWay_MessageAttach = 14 //邮件
|
||||
GainWay_SafeBoxSave = 15 //保险箱存入
|
||||
GainWay_SafeBoxTakeOut = 16 //保险箱取出
|
||||
GainWay_Fishing = 17 //捕鱼
|
||||
GainWay_CoinSceneExchange = 18 //金豆场兑换
|
||||
GainWay_UpgradeAccount = 19 //升级账号
|
||||
GainWay_API_AddCoin = 20 //API操作钱包
|
||||
GainWay_GoldCome = 21 //财神降临
|
||||
GainWay_Transfer_System2Thrid = 22 //系统平台转入到第三方平台的金币
|
||||
GainWay_Transfer_Thrid2System = 23 //第三方平台转入到系统平台的金币
|
||||
GainWay_RebateTask = 24 //返利获取
|
||||
GainWay_IOSINSTALLSTABLE = 25 //ios安装奖励
|
||||
GainWay_VirtualChange = 26 //德州虚拟账变
|
||||
GainWay_CreatePrivateScene = 27 //创建私有房间
|
||||
GainWay_PrivateSceneReturn = 28 //解散私有房间返还
|
||||
GainWay_OnlineRandCoin = 29 //红包雨
|
||||
GainWay_Expire = 30 //到期清理
|
||||
GainWay_PromoterBind = 31 //手动绑定推广员
|
||||
GainWay_GradeShopReturn = 32 //积分商城撤单退还积分
|
||||
GainWay_Api_In = 33 //转移金币
|
||||
GainWay_Api_Out = 34 //转移金币
|
||||
GainWay_Shop_Buy = 35 //购买记录
|
||||
GainWay_MAIL_MTEM = 36 //邮件领取道具
|
||||
GainWay_Item_Sale = 37 //道具出售
|
||||
GainWay_ReliefFund = 38 //领取救济金
|
||||
GainWay_Shop_Revoke = 39 //撤单
|
||||
GainWay_ActSign = 40 //
|
||||
GainWay_MatchSignup = 41 //比赛报名费用
|
||||
GainWay_MatchSeason = 42 //比赛赛季奖励
|
||||
GainWay_ActSignNew = 43 //新签到
|
||||
GainWay_ActTurnplate = 44 //轮盘
|
||||
GainWay_ActBlindBox = 45 //盲盒
|
||||
GainWay_ActFirstPay = 46 //首充
|
||||
GainWay_VIPGift = 47 //vip礼包
|
||||
GainWay_ActContinuousPay = 48 //连续充值
|
||||
GainWay_ActJybAward = 49 //礼包码兑换
|
||||
GainWay_LeaveDeduct = 50 //离开扣分
|
||||
GainWay_LeaveCombat = 51 //离开补偿
|
||||
GainWay_RankMatch = 52 //排位赛段位奖励
|
||||
GainWay_AddBag = 53 //增加背包接口调用
|
||||
GainWay_SmallRocket = 54 //小火箭收入
|
||||
GainWay_BindTel = 55 //绑定手机号
|
||||
GainWay_ReliefFund2 = 56 //救济金看视频双倍领取
|
||||
GainWay_ActTurnplate2 = 57 //轮盘看视频双倍领取
|
||||
GainWay_ActSignNew2 = 58 //签到看视频双倍领取
|
||||
GainWay_ItemUse = 59 //道具使用
|
||||
GainWay_PhoneScore = 60 //手机积分活动
|
||||
GainWay_RankReward = 61 //排位奖励
|
||||
GainWay_TaskReward = 62 //任务奖励
|
||||
GainWay_Interact = 63 //房间内互动效果
|
||||
GainWayItemCollectExchange = 64 //集卡活动兑换
|
||||
GainWay_WeekCardAward = 65 //周卡奖励
|
||||
GainWay_PigrankTakeCoin = 66 //存钱罐领取耗费钻石
|
||||
GainWay_PigrankGainCoin = 67 //存钱罐打开获取金币
|
||||
GainWay_ItemMove = 68 //道具赠送
|
||||
GainWay_RoleUpgrade = 69 //角色升级
|
||||
GainWay_PetUpgrade = 70 //宠物升级
|
||||
GainWay_Game = 71 //游戏掉落
|
||||
GainWayItemCollectLogin = 73 //集卡活动登录
|
||||
GainWay_Collect = 74 //集卡活动
|
||||
GainWayItemPhoneScoreExchange = 75 //抽手机活动兑换
|
||||
GainWayItemTaskInvite = 78 //邀请任务
|
||||
GainWayItemTaskNewPlayer = 79 //新手任务
|
||||
GainWayItemTaskAchievement = 80 //成就任务
|
||||
GainWayItemTaskEveryDay = 81 //每日任务
|
||||
GainWayItemWeekActive = 82 //周活跃奖励
|
||||
GainWayContinueSign = 83 //累计签到
|
||||
GainWayBackend = 84 // 后台操作
|
||||
GainWayBuyCoin = 85 // 商城购买金币
|
||||
GainWayBuyItem = 86 // 商城购买道具
|
||||
GainWayBuyWeekCard = 87 // 商城购买周卡
|
||||
GainWayVipBuyCoin = 88 // vip商城购买金币
|
||||
GainWaySign7Con = 89 // 累计签到进阶奖励消耗
|
||||
GainWay_PigrankGainDiamond = 90 //存钱罐打开获取钻石
|
||||
GainWaySign7Add = 91 // 累计签到进阶奖励获得
|
||||
GainWayItemChange = 92 //背包内使用道具兑换话费
|
||||
GainWayPetSkillLevelUp = 93 //宠物技能升级
|
||||
GainWayPermitAward = 94 // 赛季通行证等级奖励
|
||||
GainWayItemPermitRank = 95 // 赛季通行证排行奖励
|
||||
GainWayPermitExchangeCost = 96 // 赛季通行证兑换消耗
|
||||
GainWayPermitExchangeGain = 97 // 赛季通行证兑换获得
|
||||
GainWayItemTaskPermit = 98 // 赛季通行证任务
|
||||
GainWayDiamondLottery = 99 //钻石抽奖
|
||||
GainWaySkinUnLock = 100 // 皮肤解锁消耗
|
||||
GainWaySkinUpGrade = 101 // 皮肤升级消耗
|
||||
GainWayItemFen = 102 // 道具分解消耗
|
||||
GainWayItemFenGain = 103 // 道具分解获得
|
||||
GainWayGuide = 104 //新手引导奖励
|
||||
GainWayVipGift9 = 105 //vip等级礼包
|
||||
GainWayRoomCost = 106 //房费消耗
|
||||
GainWayRoomGain = 107 //房卡场获得
|
||||
GainWayItemShop = 108 // 交易市场道具交易
|
||||
GainWayClawdollCostItem = 109 // 娃娃机上分扣道具
|
||||
GainWayItemShopChangeDoll = 110 // 商城兑换娃娃
|
||||
GainWayItemBagChangeDoll = 111 // 背包内兑换娃娃
|
||||
GainWayClawdollCatch = 112 // 娃娃机抓取到娃娃获取卡
|
||||
GainWayItemBagChangeDollRevocation = 113 //娃娃兑换后台撤销
|
||||
GainWayPermitReset = 114 //赛季通行证积分重置
|
||||
GainWayClientUpgrade = 115 //客户端升级奖励
|
||||
GainWayLottery = 116 //开奖码抽奖
|
||||
GainWayGuide2 = 117 // 竞技馆引导奖励
|
||||
GainWayCompound = 118 // 道具合成消耗
|
||||
GainWayCompoundGain = 119 // 道具合成获得
|
||||
GainWayItem_PigBankTakeCoin = 120 // 购买金币存钱罐奖励道具
|
||||
GainWayItem_PigBankTakeDiamond = 121 // 购买钻石存钱罐奖励道具
|
||||
GainWayNianCost = 122 //年兽活动消耗
|
||||
GainWayNianGain_Attack_LittleGuarantee = 123 //年兽活动小爆竹攻击年兽获得保底奖励
|
||||
GainWayRedPacket = 124 // 红包奖励
|
||||
GainWayNianGain_Sign = 125 //年兽活动签到获得
|
||||
GainWayNianGain_Change = 126 //年兽活动兑换获得
|
||||
GainWayNianGain_BossDie = 127 //年兽活动Boss死亡获得
|
||||
GainWayNianGain_BossDieOther = 128 //年兽活动Boss死亡额外获得
|
||||
GainWayNianGain_Attack_BigOther = 129 //年兽活动大爆竹攻击年兽获得额外奖励
|
||||
GainWayNianGain_Attack_BigGuarantee = 130 //年兽活动大爆竹攻击年兽获得保底奖励
|
||||
GainWayNianGain_Attack_Coin = 131 //攻击年兽获得金币奖励
|
||||
GainWayConsume = 134 //累消活动获得
|
||||
)
|
||||
|
||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||
|
|
@ -560,27 +573,29 @@ const (
|
|||
|
||||
// 道具ID
|
||||
const (
|
||||
ItemIDCoin = 100001 // 金币对应的itemId
|
||||
ItemIDDiamond = 100002 // 钻石对应的itemId
|
||||
ItemIDMoneyPond = 100003 // 玩家金币池对应物品Id
|
||||
ItemIDVipExp = 100005 // VIP经验对应的物品Id
|
||||
ItemIDPhoneScore = 100006 // 手机抽奖积分
|
||||
ItemIDWeekScore = 100004 // 周活跃积分
|
||||
ItemIDGiftBox = 50001 // 碎片礼盒
|
||||
ItemIDCollectBox = 50002 // 集卡礼盒
|
||||
ItemIDLike = 100007 // 点赞
|
||||
ItemIDCoffee = 100008 // 咖啡
|
||||
ItemIDBucket = 100009 // 水桶
|
||||
ItemIDSlippers = 100010 // 拖鞋
|
||||
ItemIDPermit = 100011 // 赛季通行证积分
|
||||
ItemIDLong = 50013 // 龙币
|
||||
ItemIDPetSkill = 11001 //宠物技能升级道具
|
||||
ItemIDVCard = 30001 // v卡
|
||||
ItemIDJCard = 30002 // 金券
|
||||
ItemDiamondScore = 100012 //钻石积分
|
||||
ItemIDClawdoll = 40003 // 娃娃卡
|
||||
ItemDollCard = 40004 // 娃娃卡积分
|
||||
ItemIDRoomCard = 40002 // 房卡
|
||||
ItemIDCoin = 100001 // 金币对应的itemId
|
||||
ItemIDDiamond = 100002 // 钻石对应的itemId
|
||||
ItemIDMoneyPond = 100003 // 玩家金币池对应物品Id
|
||||
ItemIDVipExp = 100005 // VIP经验对应的物品Id
|
||||
ItemIDPhoneScore = 100006 // 手机抽奖积分
|
||||
ItemIDWeekScore = 100004 // 周活跃积分
|
||||
ItemIDGiftBox = 50001 // 碎片礼盒
|
||||
ItemIDCollectBox = 50002 // 集卡礼盒
|
||||
ItemIDLike = 100007 // 点赞
|
||||
ItemIDCoffee = 100008 // 咖啡
|
||||
ItemIDBucket = 100009 // 水桶
|
||||
ItemIDSlippers = 100010 // 拖鞋
|
||||
ItemIDPermit = 100011 // 赛季通行证积分
|
||||
ItemIDLong = 50013 // 龙币
|
||||
ItemIDPetSkill = 11001 //宠物技能升级道具
|
||||
ItemIDVCard = 30001 // v卡
|
||||
ItemIDJCard = 30002 // 金券
|
||||
ItemDiamondScore = 100012 //钻石积分
|
||||
ItemIDClawdoll = 40003 // 娃娃卡
|
||||
ItemDollCard = 40004 // 娃娃卡积分
|
||||
ItemIDRoomCard = 40002 // 房卡
|
||||
ItemIDLittleGuaranteed = 50014 //小爆竹
|
||||
ItemIDBigGuaranteed = 50015 //大爆竹
|
||||
)
|
||||
|
||||
func ToItemId(id int32) int32 {
|
||||
|
|
@ -692,6 +707,10 @@ const (
|
|||
TaskTypeTienlenWinCoin = 29 // Tienlen赢取金币数量
|
||||
TaskTypeRankMatchWinTimes = 30 // 排位胜利次数
|
||||
TaskTypeBuyPermit = 31 // 购买典藏通行证
|
||||
TaskTypeBuyRedBag = 32 // 参与红包雨活动
|
||||
TaskTypeNianBossKill = 33 // 击杀年兽
|
||||
TaskTypeNianBossDamage = 34 // 年兽造成伤害
|
||||
TaskTypeNianSign = 35 // 年兽签到
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -702,13 +721,16 @@ const (
|
|||
)
|
||||
|
||||
const (
|
||||
TaskActivityTypeEveryDay = 1 // 每日任务
|
||||
TaskActivityTypeWeek = 2 // 每周任务
|
||||
TaskActivityTypeNovice = 3 // 新手任务
|
||||
TaskActivityTypeInvite = 4 // 邀请任务
|
||||
TaskActivityTypeAchieve = 5 // 成就任务
|
||||
TaskActivityTypePermitEveryDay = 6 // 赛季通行证每日任务
|
||||
TaskActivityTypePermit = 7 // 赛季通行证任务
|
||||
TaskActivityTypeEveryDay = 1 // 每日任务
|
||||
TaskActivityTypeWeek = 2 // 每周任务
|
||||
TaskActivityTypeNovice = 3 // 新手任务
|
||||
TaskActivityTypeInvite = 4 // 邀请任务
|
||||
TaskActivityTypeAchieve = 5 // 成就任务
|
||||
TaskActivityTypePermitEveryDay = 6 // 赛季通行证每日任务
|
||||
TaskActivityTypePermit = 7 // 赛季通行证任务
|
||||
TaskActivityTypeNianEveryDay = 8 // 年兽每日任务
|
||||
TaskActivityTypeNian = 9 // 活动期间年兽任务
|
||||
TaskActivityTypeConsume = 10 // 累计消耗活动任务
|
||||
)
|
||||
|
||||
const HeadRange = 3 // 机器人头像id范围
|
||||
|
|
@ -772,11 +794,15 @@ const (
|
|||
var PetIDs = []int32{PetIDChicken}
|
||||
|
||||
const (
|
||||
ChannelSwitchExchange = 1 // 兑换商城开关
|
||||
ChannelSwitchDropItem = 2 // v卡掉落开关
|
||||
ChannelSwitchInvite = 3 // 邀请开关
|
||||
ChannelSwitchPermit = 4 // 典藏通行证开关
|
||||
ChannelSwitchDiamondLottery = 5 // 钻石抽奖开关
|
||||
ChannelSwitchExchange = 1 // 兑换商城开关
|
||||
ChannelSwitchDropItem = 2 // v卡掉落开关
|
||||
ChannelSwitchInvite = 3 // 邀请开关
|
||||
ChannelSwitchPermit = 4 // 典藏通行证开关
|
||||
ChannelSwitchDiamondLottery = 5 // 钻石抽奖开关
|
||||
ChannelSwitchItemRecExpire = 8 // 记牌器开关
|
||||
ChannelSwitchPigBankCoin = 13 // 金币存钱罐开关
|
||||
ChannelSwitchPigBankDiamond = 14 // 钻石存钱罐开关
|
||||
|
||||
)
|
||||
|
||||
// 特殊商品id
|
||||
|
|
|
|||
|
|
@ -2,13 +2,15 @@ package common
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
rawproto "google.golang.org/protobuf/proto"
|
||||
"mongo.games.com/game/proto"
|
||||
"mongo.games.com/game/protocol/server"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/core/profile"
|
||||
"mongo.games.com/goserver/core/utils"
|
||||
|
||||
"mongo.games.com/game/proto"
|
||||
"mongo.games.com/game/protocol/server"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
package common
|
||||
|
||||
// 系统消息编号
|
||||
const (
|
||||
SYSMSG_BEGIN int = iota
|
||||
SYSMSG_PASSHU //因过胡规则,此牌不能胡
|
||||
)
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
GainWay_NewPlayer int32 = iota //0.新建角色 新建账号,系统赠送房卡%s张|新建账号,系统赠送金币%s个 remark:无
|
||||
GainWay_Pay //1.后台增加(主要是充值) %s,获得d%张房卡,剩余d%张 remark:充值X元
|
||||
GainWay_Transfer_In //2.俱乐部转移(转入) s%赠送您房卡d%张,剩余d%张 remark:玩家名称
|
||||
GainWay_AgentReturn //3.代创房间返还 -
|
||||
GainWay_DrawPrize //4.领取奖励 领取奖励房卡d%张,剩余%d张 remark:无
|
||||
GainWay_Share //5.每日分享 每日分享活动,奖励d%房卡,剩余d%房卡 remark:无
|
||||
GainWay_Activty //6.活动获得 s%活动奖励d%金币,剩余d%金币 remark:活动名称
|
||||
GainWay_Game //7.玩游戏消耗 开房间房卡-d%张,剩余d%张 remark:无
|
||||
GainWay_Task //8.任务 完成%s任务,奖励房卡d%张,剩余d%张 remark:任务名称
|
||||
GainWay_ByPMCmd //9.pm命令 -
|
||||
GainWay_MatchSignup //10.比赛报名 -
|
||||
GainWay_MatchPlay //11.比赛回兑 -
|
||||
GainWay_MatchAdd //12.比赛补充 -
|
||||
GainWay_MatchBreakBack //13.退赛退还 -
|
||||
GainWay_MatchSystemSupply //14.系统补给 -
|
||||
GainWay_Exchange //15.兑换 兑换%s,红包%d分,剩余红包%d分 remark:房卡x张
|
||||
GainWay_Contribute //16.贡献 -
|
||||
GainWay_ClubMoneySceneFee //17.俱乐部钻石场房费 -
|
||||
GainWay_Transfer_Out //18.俱乐部转移(转出) 赠送给s%房卡d%张,剩余d%张 remark:玩家名称
|
||||
GainWay_ServiceFee //19.桌费 扣除桌费d%金币,剩余d%金币 remark:无
|
||||
GainWay_CoinSceneWin //20.金豆场赢取 参与游戏赢取d%金币,剩余d%金币 remark:无
|
||||
GainWay_CoinSceneLost //21.金豆场输 参与游戏输掉d%金币,剩余d%金币 remark:无
|
||||
GainWay_BindTel //22.绑定手机 绑定手机,获得房卡%d张,剩余%d张 remark:无
|
||||
GainWay_PlayerShare //23.隶属玩家每日分享 每日分享活动,领取房卡%d张,剩余%d张 remark:无
|
||||
GainWay_Invite //24.邀请玩家 邀请玩家,获得红包%d分,剩余%d分 remark:无
|
||||
GainWay_LoginSign //25.签到奖励
|
||||
GainWay_OnlineGift //26.签到奖励
|
||||
GainWay_CoinSceneEnter //27.进入金币场预扣
|
||||
GainWay_ShopBuy //28.商城购买或者兑换 使用%s,购买金币%d,剩余%d remark:房卡x张
|
||||
GainWay_CoinSceneLeave //29.离开金币场回兑
|
||||
|
|
@ -28,6 +28,7 @@ func InSameDay(tNow, tPre time.Time) bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func InSameDayNoZero(tNow, tPre time.Time) bool {
|
||||
|
||||
if tNow.Day() != tPre.Day() {
|
||||
|
|
@ -110,7 +111,7 @@ func DiffMonth(tNow, tPre time.Time) int {
|
|||
return int(diffMonth)
|
||||
}
|
||||
|
||||
func DelayInvake(method func(), ud interface{}, delay time.Duration, times int) (timer.TimerHandle, bool) {
|
||||
func DelayInvoke(method func(), ud interface{}, delay time.Duration, times int) (timer.TimerHandle, bool) {
|
||||
return timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
|
||||
if method != nil {
|
||||
method()
|
||||
|
|
@ -126,6 +127,7 @@ func StrTimeToTs(strTime string) int64 {
|
|||
}
|
||||
return rTime.Unix()
|
||||
}
|
||||
|
||||
func TsToStrTime(tc int64) string {
|
||||
//return time.Now().Format("2018-07-02 19:14:00")
|
||||
return time.Unix(tc, 0).Format("2006-01-02 15:04:05")
|
||||
|
|
|
|||
|
|
@ -127,3 +127,11 @@ func TestInSameWeek(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestStrTimeToTime(t *testing.T) {
|
||||
t1 := StrRFC3339TimeToTime("2016-05-17 15:12:15")
|
||||
if t1.IsZero() {
|
||||
t.Fatal("StrTimeToTime(2016-05-17 15:12:15) expect result is not zero")
|
||||
}
|
||||
t.Log(t1)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,277 @@
|
|||
// --------------------------------------------------------------------------------------------
|
||||
// The following code is automatically generated by the mongo-dao-generator tool.
|
||||
// Please do not modify this code manually to avoid being overwritten in the next generation.
|
||||
// For more tool details, please click the link to view https://github.com/dobyte/mongo-dao-generator
|
||||
// --------------------------------------------------------------------------------------------
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
modelpkg "mongo.games.com/game/model"
|
||||
)
|
||||
|
||||
type RedPacketFilterFunc func(cols *RedPacketColumns) interface{}
|
||||
type RedPacketUpdateFunc func(cols *RedPacketColumns) interface{}
|
||||
type RedPacketPipelineFunc func(cols *RedPacketColumns) interface{}
|
||||
type RedPacketCountOptionsFunc func(cols *RedPacketColumns) *options.CountOptions
|
||||
type RedPacketAggregateOptionsFunc func(cols *RedPacketColumns) *options.AggregateOptions
|
||||
type RedPacketFindOneOptionsFunc func(cols *RedPacketColumns) *options.FindOneOptions
|
||||
type RedPacketFindManyOptionsFunc func(cols *RedPacketColumns) *options.FindOptions
|
||||
type RedPacketUpdateOptionsFunc func(cols *RedPacketColumns) *options.UpdateOptions
|
||||
type RedPacketDeleteOptionsFunc func(cols *RedPacketColumns) *options.DeleteOptions
|
||||
type RedPacketInsertOneOptionsFunc func(cols *RedPacketColumns) *options.InsertOneOptions
|
||||
type RedPacketInsertManyOptionsFunc func(cols *RedPacketColumns) *options.InsertManyOptions
|
||||
|
||||
type RedPacket struct {
|
||||
Columns *RedPacketColumns
|
||||
Database *mongo.Database
|
||||
Collection *mongo.Collection
|
||||
}
|
||||
|
||||
type RedPacketColumns struct {
|
||||
ID string
|
||||
Cid string // 红包活动id
|
||||
Use string // 已发红包 红包奖励数量:已发个数
|
||||
Ts string // 更新时间戳
|
||||
}
|
||||
|
||||
var redPacketColumns = &RedPacketColumns{
|
||||
ID: "_id",
|
||||
Cid: "Cid", // 红包活动id
|
||||
Use: "Use", // 已发红包 红包奖励数量:已发个数
|
||||
Ts: "Ts", // 更新时间戳
|
||||
}
|
||||
|
||||
func NewRedPacket() *RedPacket {
|
||||
return &RedPacket{
|
||||
Columns: redPacketColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// Count returns the number of documents in the collection.
|
||||
func (dao *RedPacket) Count(ctx context.Context, filterFunc RedPacketFilterFunc, optionsFunc ...RedPacketCountOptionsFunc) (int64, error) {
|
||||
var (
|
||||
opts *options.CountOptions
|
||||
filter = filterFunc(dao.Columns)
|
||||
)
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
return dao.Collection.CountDocuments(ctx, filter, opts)
|
||||
}
|
||||
|
||||
// Aggregate executes an aggregate command against the collection and returns a cursor over the resulting documents.
|
||||
func (dao *RedPacket) Aggregate(ctx context.Context, pipelineFunc RedPacketPipelineFunc, optionsFunc ...RedPacketAggregateOptionsFunc) (*mongo.Cursor, error) {
|
||||
var (
|
||||
opts *options.AggregateOptions
|
||||
pipeline = pipelineFunc(dao.Columns)
|
||||
)
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
return dao.Collection.Aggregate(ctx, pipeline, opts)
|
||||
}
|
||||
|
||||
// InsertOne executes an insert command to insert a single document into the collection.
|
||||
func (dao *RedPacket) InsertOne(ctx context.Context, model *modelpkg.RedPacket, optionsFunc ...RedPacketInsertOneOptionsFunc) (*mongo.InsertOneResult, error) {
|
||||
if model == nil {
|
||||
return nil, errors.New("model is nil")
|
||||
}
|
||||
|
||||
if err := dao.autofill(ctx, model); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var opts *options.InsertOneOptions
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
return dao.Collection.InsertOne(ctx, model, opts)
|
||||
}
|
||||
|
||||
// InsertMany executes an insert command to insert multiple documents into the collection.
|
||||
func (dao *RedPacket) InsertMany(ctx context.Context, models []*modelpkg.RedPacket, optionsFunc ...RedPacketInsertManyOptionsFunc) (*mongo.InsertManyResult, error) {
|
||||
if len(models) == 0 {
|
||||
return nil, errors.New("models is empty")
|
||||
}
|
||||
|
||||
documents := make([]interface{}, 0, len(models))
|
||||
for i := range models {
|
||||
model := models[i]
|
||||
if err := dao.autofill(ctx, model); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
documents = append(documents, model)
|
||||
}
|
||||
|
||||
var opts *options.InsertManyOptions
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
return dao.Collection.InsertMany(ctx, documents, opts)
|
||||
}
|
||||
|
||||
// UpdateOne executes an update command to update at most one document in the collection.
|
||||
func (dao *RedPacket) UpdateOne(ctx context.Context, filterFunc RedPacketFilterFunc, updateFunc RedPacketUpdateFunc, optionsFunc ...RedPacketUpdateOptionsFunc) (*mongo.UpdateResult, error) {
|
||||
var (
|
||||
opts *options.UpdateOptions
|
||||
filter = filterFunc(dao.Columns)
|
||||
update = updateFunc(dao.Columns)
|
||||
)
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
return dao.Collection.UpdateOne(ctx, filter, update, opts)
|
||||
}
|
||||
|
||||
// UpdateOneByID executes an update command to update at most one document in the collection.
|
||||
func (dao *RedPacket) UpdateOneByID(ctx context.Context, id string, updateFunc RedPacketUpdateFunc, optionsFunc ...RedPacketUpdateOptionsFunc) (*mongo.UpdateResult, error) {
|
||||
objectID, err := primitive.ObjectIDFromHex(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dao.UpdateOne(ctx, func(cols *RedPacketColumns) interface{} {
|
||||
return bson.M{"_id": objectID}
|
||||
}, updateFunc, optionsFunc...)
|
||||
}
|
||||
|
||||
// UpdateMany executes an update command to update documents in the collection.
|
||||
func (dao *RedPacket) UpdateMany(ctx context.Context, filterFunc RedPacketFilterFunc, updateFunc RedPacketUpdateFunc, optionsFunc ...RedPacketUpdateOptionsFunc) (*mongo.UpdateResult, error) {
|
||||
var (
|
||||
opts *options.UpdateOptions
|
||||
filter = filterFunc(dao.Columns)
|
||||
update = updateFunc(dao.Columns)
|
||||
)
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
return dao.Collection.UpdateMany(ctx, filter, update, opts)
|
||||
}
|
||||
|
||||
// FindOne executes a find command and returns a model for one document in the collection.
|
||||
func (dao *RedPacket) FindOne(ctx context.Context, filterFunc RedPacketFilterFunc, optionsFunc ...RedPacketFindOneOptionsFunc) (*modelpkg.RedPacket, error) {
|
||||
var (
|
||||
opts *options.FindOneOptions
|
||||
model = &modelpkg.RedPacket{}
|
||||
filter = filterFunc(dao.Columns)
|
||||
)
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
err := dao.Collection.FindOne(ctx, filter, opts).Decode(model)
|
||||
if err != nil {
|
||||
if err == mongo.ErrNoDocuments {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return model, nil
|
||||
}
|
||||
|
||||
// FindOneByID executes a find command and returns a model for one document in the collection.
|
||||
func (dao *RedPacket) FindOneByID(ctx context.Context, id string, optionsFunc ...RedPacketFindOneOptionsFunc) (*modelpkg.RedPacket, error) {
|
||||
objectID, err := primitive.ObjectIDFromHex(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dao.FindOne(ctx, func(cols *RedPacketColumns) interface{} {
|
||||
return bson.M{"_id": objectID}
|
||||
}, optionsFunc...)
|
||||
}
|
||||
|
||||
// FindMany executes a find command and returns many models the matching documents in the collection.
|
||||
func (dao *RedPacket) FindMany(ctx context.Context, filterFunc RedPacketFilterFunc, optionsFunc ...RedPacketFindManyOptionsFunc) ([]*modelpkg.RedPacket, error) {
|
||||
var (
|
||||
opts *options.FindOptions
|
||||
filter = filterFunc(dao.Columns)
|
||||
)
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
cur, err := dao.Collection.Find(ctx, filter, opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
models := make([]*modelpkg.RedPacket, 0)
|
||||
|
||||
if err = cur.All(ctx, &models); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return models, nil
|
||||
}
|
||||
|
||||
// DeleteOne executes a delete command to delete at most one document from the collection.
|
||||
func (dao *RedPacket) DeleteOne(ctx context.Context, filterFunc RedPacketFilterFunc, optionsFunc ...RedPacketDeleteOptionsFunc) (*mongo.DeleteResult, error) {
|
||||
var (
|
||||
opts *options.DeleteOptions
|
||||
filter = filterFunc(dao.Columns)
|
||||
)
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
return dao.Collection.DeleteOne(ctx, filter, opts)
|
||||
}
|
||||
|
||||
// DeleteOneByID executes a delete command to delete at most one document from the collection.
|
||||
func (dao *RedPacket) DeleteOneByID(ctx context.Context, id string, optionsFunc ...RedPacketDeleteOptionsFunc) (*mongo.DeleteResult, error) {
|
||||
objectID, err := primitive.ObjectIDFromHex(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dao.DeleteOne(ctx, func(cols *RedPacketColumns) interface{} {
|
||||
return bson.M{"_id": objectID}
|
||||
}, optionsFunc...)
|
||||
}
|
||||
|
||||
// DeleteMany executes a delete command to delete documents from the collection.
|
||||
func (dao *RedPacket) DeleteMany(ctx context.Context, filterFunc RedPacketFilterFunc, optionsFunc ...RedPacketDeleteOptionsFunc) (*mongo.DeleteResult, error) {
|
||||
var (
|
||||
opts *options.DeleteOptions
|
||||
filter = filterFunc(dao.Columns)
|
||||
)
|
||||
|
||||
if len(optionsFunc) > 0 {
|
||||
opts = optionsFunc[0](dao.Columns)
|
||||
}
|
||||
|
||||
return dao.Collection.DeleteMany(ctx, filter, opts)
|
||||
}
|
||||
|
||||
// autofill when inserting data
|
||||
func (dao *RedPacket) autofill(ctx context.Context, model *modelpkg.RedPacket) error {
|
||||
if model.ID.IsZero() {
|
||||
model.ID = primitive.NewObjectID()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/mongox"
|
||||
|
||||
"mongo.games.com/game/dao/internal"
|
||||
modelpkg "mongo.games.com/game/model"
|
||||
)
|
||||
|
||||
var (
|
||||
_ = context.Background()
|
||||
_ = logger.Logger
|
||||
_ = bson.M{}
|
||||
_ = mongo.Database{}
|
||||
)
|
||||
|
||||
type RedPacketColumns = internal.RedPacketColumns
|
||||
|
||||
type RedPacket struct {
|
||||
*internal.RedPacket
|
||||
}
|
||||
|
||||
func GetRedPacket(key string) (*RedPacket, error) {
|
||||
return mongox.GetDao(key, NewRedPacket)
|
||||
}
|
||||
|
||||
func NewRedPacket(db *mongo.Database, c *mongo.Collection) (*RedPacket, any) {
|
||||
if db == nil || c == nil {
|
||||
return &RedPacket{}, &modelpkg.RedPacket{}
|
||||
}
|
||||
|
||||
v := internal.NewRedPacket()
|
||||
v.Database = db
|
||||
v.Collection = c
|
||||
|
||||
// 创建索引
|
||||
c.Indexes().CreateOne(context.Background(), mongo.IndexModel{
|
||||
Keys: bson.D{{"cid", 1}}, // 1 表示升序,-1 表示降序
|
||||
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
|
||||
})
|
||||
c.Indexes().CreateOne(context.Background(), mongo.IndexModel{
|
||||
Keys: bson.D{{"ts", 1}}, // 1 表示升序,-1 表示降序
|
||||
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
|
||||
})
|
||||
c.Indexes().CreateOne(context.Background(), mongo.IndexModel{
|
||||
Keys: bson.D{{"ts", -1}}, // 1 表示升序,-1 表示降序
|
||||
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
|
||||
})
|
||||
|
||||
return &RedPacket{RedPacket: v}, &modelpkg.RedPacket{}
|
||||
}
|
||||
|
||||
func (r *RedPacket) GetAll() (res []*modelpkg.RedPacket, err error) {
|
||||
res, err = r.FindMany(context.Background(), func(cols *RedPacketColumns) interface{} {
|
||||
return bson.M{}
|
||||
})
|
||||
if err != nil && !errors.Is(err, mongo.ErrNoDocuments) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (r *RedPacket) UpdateAll(list []*modelpkg.RedPacket) error {
|
||||
var operations []mongo.WriteModel
|
||||
for _, v := range list {
|
||||
updateDataMap := bson.M{
|
||||
"$set": v,
|
||||
}
|
||||
delete(updateDataMap["$set"].(bson.M), "_id") // 删除 _id 字段
|
||||
operations = append(operations, mongo.NewUpdateOneModel().SetFilter(bson.M{"_id": v.ID}).SetUpdate(bson.M{"$set": v}).SetUpsert(true))
|
||||
}
|
||||
|
||||
_, err := r.Collection.BulkWrite(context.Background(), operations) // 批量更新
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("RedPacket.UpdateAll error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
Tienlen207 Àš
|
||||
欢ä¹<C3A4>æ<EFBFBD>•é±¼401 Àš
|
||||
高棉象棋521 Àš
|
||||
å<><C3A5>三水211 Àš
|
||||
愤怒的大å<C2A7>”606 Àš
|
||||
å°<C3A5>ç<EFBFBD>«ç®607 Àš
|
||||
è´¢è¿<C3A8>神301 à§
|
||||
å¤<C3A5>仇者è<E280A6>”盟302 à§
|
||||
å¤<C3A5>活节岛303 à§
|
||||
|
||||
冰河世纪304 à§
|
||||
百战æˆ<C3A6>神305 à§
|
||||
水果拉霸306 à§
|
||||
多ç¦<C3A7>多财307 à§
|
||||
FortuneTiger308 à§
|
||||
FortuneDragon309 à§
|
||||
FortuneRabbit310 à§
|
||||
FortuneOx311 à§
|
||||
FortuneMouse312 à§
|
||||
CashMania313 à§
|
||||
GatesOfOlympus314 à§
|
||||
娃娃机608
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"Arr": [
|
||||
{
|
||||
"Id": 1,
|
||||
"GameName": "Tienlen",
|
||||
"GameDif": "207",
|
||||
"LimitNum": 200000
|
||||
},
|
||||
{
|
||||
"Id": 2,
|
||||
"GameName": "欢乐捕鱼",
|
||||
"GameDif": "401",
|
||||
"LimitNum": 200000
|
||||
},
|
||||
{
|
||||
"Id": 3,
|
||||
"GameName": "高棉象棋",
|
||||
"GameDif": "521",
|
||||
"LimitNum": 200000
|
||||
},
|
||||
{
|
||||
"Id": 4,
|
||||
"GameName": "十三水",
|
||||
"GameDif": "211",
|
||||
"LimitNum": 200000
|
||||
},
|
||||
{
|
||||
"Id": 5,
|
||||
"GameName": "愤怒的大叔",
|
||||
"GameDif": "606",
|
||||
"LimitNum": 200000
|
||||
},
|
||||
{
|
||||
"Id": 6,
|
||||
"GameName": "小火箭",
|
||||
"GameDif": "607",
|
||||
"LimitNum": 200000
|
||||
},
|
||||
{
|
||||
"Id": 7,
|
||||
"GameName": "财运神",
|
||||
"GameDif": "301",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 8,
|
||||
"GameName": "复仇者联盟",
|
||||
"GameDif": "302",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 9,
|
||||
"GameName": "复活节岛",
|
||||
"GameDif": "303",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 10,
|
||||
"GameName": "冰河世纪",
|
||||
"GameDif": "304",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 11,
|
||||
"GameName": "百战成神",
|
||||
"GameDif": "305",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 12,
|
||||
"GameName": "水果拉霸",
|
||||
"GameDif": "306",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 13,
|
||||
"GameName": "多福多财",
|
||||
"GameDif": "307",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 14,
|
||||
"GameName": "FortuneTiger",
|
||||
"GameDif": "308",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 15,
|
||||
"GameName": "FortuneDragon",
|
||||
"GameDif": "309",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 16,
|
||||
"GameName": "FortuneRabbit",
|
||||
"GameDif": "310",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 17,
|
||||
"GameName": "FortuneOx",
|
||||
"GameDif": "311",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 18,
|
||||
"GameName": "FortuneMouse",
|
||||
"GameDif": "312",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 19,
|
||||
"GameName": "CashMania",
|
||||
"GameDif": "313",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 20,
|
||||
"GameName": "GatesOfOlympus",
|
||||
"GameDif": "314",
|
||||
"LimitNum": 300000
|
||||
},
|
||||
{
|
||||
"Id": 21,
|
||||
"GameName": "娃娃机",
|
||||
"GameDif": "608"
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
|
@ -7154,6 +7154,152 @@
|
|||
"Compound": {
|
||||
"71002": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 40005,
|
||||
"Name": "金币赛门票",
|
||||
"ShowLocation": [
|
||||
1,
|
||||
1,
|
||||
0
|
||||
],
|
||||
"Classify": [
|
||||
1,
|
||||
1,
|
||||
0
|
||||
],
|
||||
"Type": 4,
|
||||
"Effect0": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Effect": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"SaleGold": 100000,
|
||||
"Composition": 1,
|
||||
"CompositionMax": 1,
|
||||
"Location": "0",
|
||||
"Describe": "作用:用于报名特殊钻石赛事;\n产出途径:存钱罐"
|
||||
},
|
||||
{
|
||||
"Id": 40006,
|
||||
"Name": "钻石赛门票",
|
||||
"ShowLocation": [
|
||||
1,
|
||||
1,
|
||||
0
|
||||
],
|
||||
"Classify": [
|
||||
1,
|
||||
1,
|
||||
0
|
||||
],
|
||||
"Type": 4,
|
||||
"Effect0": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Effect": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"SaleGold": 100000,
|
||||
"Composition": 1,
|
||||
"CompositionMax": 1,
|
||||
"Location": "0",
|
||||
"Describe": "作用:用于报名特殊钻石赛事;\n产出途径:存钱罐"
|
||||
},
|
||||
{
|
||||
"Id": 50014,
|
||||
"Name": "爆竹",
|
||||
"ShowLocation": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Classify": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Type": 28,
|
||||
"Effect0": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Effect": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"SaleType": 1,
|
||||
"SaleGold": 5000,
|
||||
"Composition": 1,
|
||||
"CompositionMax": 9999,
|
||||
"Location": "0",
|
||||
"Describe": "可在年兽活动中击退年兽,获得奖品"
|
||||
},
|
||||
{
|
||||
"Id": 50015,
|
||||
"Name": "火箭爆竹",
|
||||
"ShowLocation": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Classify": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Type": 28,
|
||||
"Effect0": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Effect": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"SaleType": 1,
|
||||
"SaleGold": 5000,
|
||||
"Composition": 1,
|
||||
"CompositionMax": 9999,
|
||||
"Location": "0",
|
||||
"Describe": "可在年兽活动中击退年兽,获得奖品"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
4
|
||||
SignReward50014,10;100001,100000"签到奖励
|
||||
.
SignExcReward50015,1"签到额外奖励
|
||||
=SignExcRewardMax2"$签到额外奖励赠送次数上限
|
||||
9SignExcRewardProp30"签到额外奖励赠送概率
|
||||
BossExp6000000"
|
||||
BOSS血量
|
||||
9
|
||||
BossReward100001,100000;100002,10"BOSS击杀奖励
|
||||
0
LuckyRankNeed110000"幸运榜上榜条件
|
||||
0RankNeed80000000"总伤害榜上榜条件
|
||||
@ LittleHurtGold80000,120000"小爆竹造成的伤害范围
|
||||
>
|
||||
BigHurtGold
400000,600000"大爆竹造成的伤害范围
|
||||
4
|
||||
BigHurtExc30001"大爆竹额外掉落道具ID
|
||||
>BigHurtExcNumber10,30"!大爆竹额外掉落数量范围
|
||||
5
LittleGuaranteed30"小爆竹保底掉落次数
|
||||
ALittleGuaranteedReward100002,5"小爆竹保底掉落物品
|
||||
2
BigGuaranteed10"大爆竹保底掉落次数
|
||||
?BigGuaranteedReward 30001,100"大爆竹保底掉落物品
|
||||
.
|
||||
GiftShopID991001,991002,991003"礼包ID
|
||||
@
GiftShopLimit3,0,0"&礼包每日限购次数,0为不限购
|
||||
4BossExcLimit30"年兽死亡额外掉落要求
|
||||
" BuffCount1"Buff生效次数
|
||||
oExchangeDiamond30,5,1000000"L单次兑换爆竹所需要消耗的钻石,获得数量,获得金币数量
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
{
|
||||
"Arr": [
|
||||
{
|
||||
"Id": 1,
|
||||
"PorpName": "SignReward",
|
||||
"PropValue": "50014,10;100001,100000",
|
||||
"PropDec": "签到奖励"
|
||||
},
|
||||
{
|
||||
"Id": 2,
|
||||
"PorpName": "SignExcReward",
|
||||
"PropValue": "50015,1",
|
||||
"PropDec": "签到额外奖励"
|
||||
},
|
||||
{
|
||||
"Id": 3,
|
||||
"PorpName": "SignExcRewardMax",
|
||||
"PropValue": "2",
|
||||
"PropDec": "签到额外奖励赠送次数上限"
|
||||
},
|
||||
{
|
||||
"Id": 4,
|
||||
"PorpName": "SignExcRewardProp",
|
||||
"PropValue": "30",
|
||||
"PropDec": "签到额外奖励赠送概率"
|
||||
},
|
||||
{
|
||||
"Id": 5,
|
||||
"PorpName": "BossExp",
|
||||
"PropValue": "6000000",
|
||||
"PropDec": "BOSS血量"
|
||||
},
|
||||
{
|
||||
"Id": 6,
|
||||
"PorpName": "BossReward",
|
||||
"PropValue": "100001,100000;100002,10",
|
||||
"PropDec": "BOSS击杀奖励"
|
||||
},
|
||||
{
|
||||
"Id": 7,
|
||||
"PorpName": "LuckyRankNeed",
|
||||
"PropValue": "110000",
|
||||
"PropDec": "幸运榜上榜条件"
|
||||
},
|
||||
{
|
||||
"Id": 8,
|
||||
"PorpName": "RankNeed",
|
||||
"PropValue": "80000000",
|
||||
"PropDec": "总伤害榜上榜条件"
|
||||
},
|
||||
{
|
||||
"Id": 9,
|
||||
"PorpName": "LittleHurtGold",
|
||||
"PropValue": "80000,120000",
|
||||
"PropDec": "小爆竹造成的伤害范围"
|
||||
},
|
||||
{
|
||||
"Id": 10,
|
||||
"PorpName": "BigHurtGold",
|
||||
"PropValue": "400000,600000",
|
||||
"PropDec": "大爆竹造成的伤害范围"
|
||||
},
|
||||
{
|
||||
"Id": 11,
|
||||
"PorpName": "BigHurtExc",
|
||||
"PropValue": "30001",
|
||||
"PropDec": "大爆竹额外掉落道具ID"
|
||||
},
|
||||
{
|
||||
"Id": 12,
|
||||
"PorpName": "BigHurtExcNumber",
|
||||
"PropValue": "10,30",
|
||||
"PropDec": "大爆竹额外掉落数量范围"
|
||||
},
|
||||
{
|
||||
"Id": 13,
|
||||
"PorpName": "LittleGuaranteed",
|
||||
"PropValue": "30",
|
||||
"PropDec": "小爆竹保底掉落次数"
|
||||
},
|
||||
{
|
||||
"Id": 14,
|
||||
"PorpName": "LittleGuaranteedReward",
|
||||
"PropValue": "100002,5",
|
||||
"PropDec": "小爆竹保底掉落物品"
|
||||
},
|
||||
{
|
||||
"Id": 15,
|
||||
"PorpName": "BigGuaranteed",
|
||||
"PropValue": "10",
|
||||
"PropDec": "大爆竹保底掉落次数"
|
||||
},
|
||||
{
|
||||
"Id": 16,
|
||||
"PorpName": "BigGuaranteedReward",
|
||||
"PropValue": "30001,100",
|
||||
"PropDec": "大爆竹保底掉落物品"
|
||||
},
|
||||
{
|
||||
"Id": 17,
|
||||
"PorpName": "GiftShopID",
|
||||
"PropValue": "991001,991002,991003",
|
||||
"PropDec": "礼包ID"
|
||||
},
|
||||
{
|
||||
"Id": 18,
|
||||
"PorpName": "GiftShopLimit",
|
||||
"PropValue": "3,0,0",
|
||||
"PropDec": "礼包每日限购次数,0为不限购"
|
||||
},
|
||||
{
|
||||
"Id": 19,
|
||||
"PorpName": "BossExcLimit",
|
||||
"PropValue": "30",
|
||||
"PropDec": "年兽死亡额外掉落要求"
|
||||
},
|
||||
{
|
||||
"Id": 20,
|
||||
"PorpName": "BuffCount",
|
||||
"PropValue": "1",
|
||||
"PropDec": "Buff生效次数"
|
||||
},
|
||||
{
|
||||
"Id": 21,
|
||||
"PorpName": "ExchangeDiamond",
|
||||
"PropValue": "30,5,1000000",
|
||||
"PropDec": "单次兑换爆竹所需要消耗的钻石,获得数量,获得金币数量"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
(Ђв0–8Ўи;@dH–Pc
|
||||
((Ђв0¬8ўи;@dH¬PЗ
|
||||
яБЧ/ 2(Ђв0о8Ји;@dHоPу
|
||||
(€β8–@΅θ;PdX–`c
|
||||
< ((€β2ΕΈ2συ8¬@Άθ;JΖΈJσυPdX¬`Η
|
||||
?<18>ΑΧ/ 2(€β2ΕΈ2συ8ξ@£θ;JΖΈJσυPdXξ`σ
|
||||
|
|
@ -18,8 +18,16 @@
|
|||
"BuyCountMax": 2,
|
||||
"CostDiamond": 40,
|
||||
"MaxGold": 10000000,
|
||||
"GoldExc": {
|
||||
"310003": 1,
|
||||
"40005": 1
|
||||
},
|
||||
"MaxDiamond": 300,
|
||||
"DiamondId": 980002,
|
||||
"DiamondExc": {
|
||||
"310003": 1,
|
||||
"40006": 1
|
||||
},
|
||||
"CoinPrice": 100,
|
||||
"DiamondPrice": 300,
|
||||
"DiamondNowPrice": 199
|
||||
|
|
@ -30,8 +38,16 @@
|
|||
"BuyCountMax": 99999999,
|
||||
"CostDiamond": 50,
|
||||
"MaxGold": 10000000,
|
||||
"GoldExc": {
|
||||
"310003": 1,
|
||||
"40005": 2
|
||||
},
|
||||
"MaxDiamond": 750,
|
||||
"DiamondId": 980003,
|
||||
"DiamondExc": {
|
||||
"310003": 1,
|
||||
"40006": 2
|
||||
},
|
||||
"CoinPrice": 100,
|
||||
"DiamondPrice": 750,
|
||||
"DiamondNowPrice": 499
|
||||
|
|
|
|||
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
|
@ -1234,6 +1234,430 @@
|
|||
"Award": {
|
||||
"100011": 50
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13001,
|
||||
"Order": 1,
|
||||
"Name": "年兽活动",
|
||||
"Des": "领取年兽签到奖励",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 35,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13002,
|
||||
"Order": 2,
|
||||
"Name": "年兽活动",
|
||||
"Des": "在线时长60分钟",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 21,
|
||||
"TargetTimes": 3600,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13003,
|
||||
"Order": 3,
|
||||
"Name": "年兽活动",
|
||||
"Des": "购买1次任意存钱罐",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 22,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13004,
|
||||
"Order": 4,
|
||||
"Name": "年兽活动",
|
||||
"Des": "游戏Tienlen比赛场5次",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 25,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
},
|
||||
"GameType": 1
|
||||
},
|
||||
{
|
||||
"Id": 13005,
|
||||
"Order": 5,
|
||||
"Name": "年兽活动",
|
||||
"Des": "游戏十三水10次",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 5,
|
||||
"TargetTimes": 10,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
},
|
||||
"GameType": 2
|
||||
},
|
||||
{
|
||||
"Id": 13006,
|
||||
"Order": 6,
|
||||
"Name": "年兽活动",
|
||||
"Des": "今日累计赢取1M金币",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 8,
|
||||
"TargetTimes": 1000000,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13007,
|
||||
"Order": 7,
|
||||
"Name": "年兽活动",
|
||||
"Des": "今日消耗100钻石",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 100,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13008,
|
||||
"Order": 8,
|
||||
"Name": "年兽活动",
|
||||
"Des": "今日累计赢取5M金币",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 8,
|
||||
"TargetTimes": 5000000,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13009,
|
||||
"Order": 9,
|
||||
"Name": "年兽活动",
|
||||
"Des": "今日累计赢取10M金币",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 8,
|
||||
"TargetTimes": 10000000,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13010,
|
||||
"Order": 10,
|
||||
"Name": "年兽活动",
|
||||
"Des": "今日累计赢取20M金币",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 8,
|
||||
"TargetTimes": 20000000,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13011,
|
||||
"Order": 11,
|
||||
"Name": "年兽活动",
|
||||
"Des": "充值任意金额",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 7,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13012,
|
||||
"Order": 12,
|
||||
"Name": "年兽活动",
|
||||
"Des": "今日消耗500钻石",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 500,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13013,
|
||||
"Order": 13,
|
||||
"Name": "年兽活动",
|
||||
"Des": "今日充值1.99$",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 7,
|
||||
"TargetTimes": 199,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50015": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13014,
|
||||
"Order": 14,
|
||||
"Name": "年兽活动",
|
||||
"Des": "参与红包雨活动1次",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 32,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50015": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13015,
|
||||
"Order": 15,
|
||||
"Name": "年兽活动",
|
||||
"Des": "成功对年兽造成伤害1000000点",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 34,
|
||||
"TargetTimes": 1000000,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50015": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13016,
|
||||
"Order": 16,
|
||||
"Name": "年兽活动",
|
||||
"Des": "成功对年兽造成伤害10000000点",
|
||||
"ActivityType": 8,
|
||||
"TaskType": 34,
|
||||
"TargetTimes": 10000000,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50015": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13017,
|
||||
"Order": 17,
|
||||
"Name": "年兽活动",
|
||||
"Des": "累计充值9.99$",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 7,
|
||||
"TargetTimes": 999,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50015": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13018,
|
||||
"Order": 18,
|
||||
"Name": "年兽活动",
|
||||
"Des": "累计充值19.99$",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 7,
|
||||
"TargetTimes": 1999,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50015": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13019,
|
||||
"Order": 19,
|
||||
"Name": "年兽活动",
|
||||
"Des": "累计充值59.99$",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 7,
|
||||
"TargetTimes": 5999,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13020,
|
||||
"Order": 20,
|
||||
"Name": "年兽活动",
|
||||
"Des": "累计充值99.99$",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 7,
|
||||
"TargetTimes": 9999,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13021,
|
||||
"Order": 21,
|
||||
"Name": "年兽活动",
|
||||
"Des": "成功击杀1只年兽",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 33,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13022,
|
||||
"Order": 22,
|
||||
"Name": "年兽活动",
|
||||
"Des": "成功击杀2只年兽",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 33,
|
||||
"TargetTimes": 2,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13023,
|
||||
"Order": 23,
|
||||
"Name": "年兽活动",
|
||||
"Des": "成功击杀3只年兽",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 33,
|
||||
"TargetTimes": 3,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13024,
|
||||
"Order": 24,
|
||||
"Name": "年兽活动",
|
||||
"Des": "成功击杀5只年兽",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 33,
|
||||
"TargetTimes": 5,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13025,
|
||||
"Order": 25,
|
||||
"Name": "年兽活动",
|
||||
"Des": "成功击杀8只年兽",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 33,
|
||||
"TargetTimes": 8,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 13026,
|
||||
"Order": 26,
|
||||
"Name": "年兽活动",
|
||||
"Des": "成功击杀10只年兽",
|
||||
"ActivityType": 9,
|
||||
"TaskType": 33,
|
||||
"TargetTimes": 10,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"50014": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 14001,
|
||||
"Order": 1,
|
||||
"Name": "累消活动",
|
||||
"Des": "今日消耗99钻石",
|
||||
"ActivityType": 10,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 99,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100001": 100000,
|
||||
"100002": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 14002,
|
||||
"Order": 2,
|
||||
"Name": "累消活动",
|
||||
"Des": "今日消耗499钻石",
|
||||
"ActivityType": 10,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 499,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100001": 200000,
|
||||
"100002": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 14003,
|
||||
"Order": 3,
|
||||
"Name": "累消活动",
|
||||
"Des": "今日消耗999钻石",
|
||||
"ActivityType": 10,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 999,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100001": 300000,
|
||||
"100002": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 14004,
|
||||
"Order": 4,
|
||||
"Name": "累消活动",
|
||||
"Des": "今日消耗1999钻石",
|
||||
"ActivityType": 10,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 1999,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100001": 500000,
|
||||
"100002": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 14005,
|
||||
"Order": 5,
|
||||
"Name": "累消活动",
|
||||
"Des": "今日消耗2999钻石",
|
||||
"ActivityType": 10,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 2999,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100001": 1000000,
|
||||
"100002": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 14006,
|
||||
"Order": 6,
|
||||
"Name": "累消活动",
|
||||
"Des": "今日消耗4999钻石",
|
||||
"ActivityType": 10,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 4999,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100001": 2000000,
|
||||
"100002": 20
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -14,5 +14,9 @@
|
|||
"Upgrade": "{\"zh\":\"感谢您更新客户端,更新奖励已发放至附近,请注意查收\",\"vi\":\"Cảm ơn bạn đã cập nhật ứng dụng khách. Phần thưởng cập nhật đã được phân phối gần đó, vui lòng chú ý kiểm tra nhận\",\"en\":\"Thank you for updating the client. The update reward has been distributed to everyone. Please check it carefully.\",\"kh\":\"អរគុណសម្រាប់ការធ្វើបច្ចុប្បន្នភាពហ្គេម។ រង្វាន់នៃការធ្វើបច្ចុប្បន្នភាពត្រូវបានចែកចាយទៅគ្រប់គ្នា។ សូមពិនិត្យអោយបានច្បាស់លាស់។\"}",
|
||||
"LotteryTitle": "{\"zh\":\"玩游戏抽奖品\",\"vi\":\"Chơi game rút thưởng\",\"en\":\"Play games, draw prizes\",\"kh\":\"លេងហ្គេម ចាប់រង្វាន់\"}",
|
||||
"Lottery": "{\"zh\":\"恭喜您在好友房玩游戏抽奖品活动中获得了大奖,奖品随邮件发放,请注意查收\",\"vi\":\"Chúc mừng bạn đã trúng giải thưởng lớn trong hoạt động rút thưởng trò chơi tại phòng bạn bè. Giải thưởng sẽ được gửi qua email, vui lòng kiểm tra cẩn thận.\",\"en\":\"Congratulations on winning the grand prize in the lucky draw activity in the friend room. The prize will be sent via email, please check it carefully.\",\"kh\":\"សូមអបអរសាទរចំពោះការឈ្នះរង្វាន់ធំក្នុងសកម្មភាពចាប់រង្វាន់ក្នុងបន្ទប់មិត្តភ័ក្តិរបស់អ្នក រង្វាន់នឹងត្រូវបានផ្ញើតាមអ៊ីម៉ែល សូមពិនិត្យមើលវាដោយយកចិត្តទុកដាក់។\"}",
|
||||
"TelCodeTitle": "{\"zh\":\"话费卡兑换码\",\"vi\":\"Mã đổi thẻ điện thoại\",\"en\":\"Phone card redemption code\",\"kh\":\"លេខកូដប្រោសលោះកាតទូរស័ព្ទ\"}"
|
||||
"TelCodeTitle": "{\"zh\":\"话费卡兑换码\",\"vi\":\"Mã đổi thẻ điện thoại\",\"en\":\"Phone card redemption code\",\"kh\":\"លេខកូដប្រោសលោះកាតទូរស័ព្ទ\"}",
|
||||
"NianLuckTitle": "{\"zh\":\"幸运榜排行奖励\",\"vi\":\"Vượt qua phần thưởng xếp hạng\",\"en\":\"Pass Ranking Rewards\",\"kh\":\"រង្វាន់ចំណាត់ថ្នាក់ឆ្លងកាត់\"}",
|
||||
"NianLuckAward": "{\"zh\":\"恭喜您在昨日年兽活动幸运排行中名次达到%v名,排行奖励已发放,请查收\",\"vi\":\"Chúc mừng bạn đã đạt được %v trong bảng xếp hạng vượt qua. Phần thưởng xếp hạng đã được phân phối, vui lòng kiểm tra.\",\"en\":\"Congratulations on reaching %vth place in the pass ranking. Ranking rewards have been issued. Please check.\",\"kh\":\"សូមអបអរសាទរចំពោះការឈានដល់ចំណាត់ថ្នាក់ទី %v ក្នុងចំណាត់ថ្នាក់ឆ្លងកាត់។ រង្វាន់ចំណាត់ថ្នាក់ត្រូវបានចេញ។ សូមត្រួតពិនិត្យ។\"}",
|
||||
"NianDamageTitle": "{\"zh\":\"年兽活动排行奖励\",\"vi\":\"Vượt qua phần thưởng xếp hạng\",\"en\":\"Pass Ranking Rewards\",\"kh\":\"រង្វាន់ចំណាត់ថ្នាក់ឆ្លងកាត់\"}",
|
||||
"NianDamageAward": "{\"zh\":\"恭喜您在本次年兽活动总排行中名次达到%v名,排行奖励已发放,请查收\",\"vi\":\"Chúc mừng bạn đã đạt được %v trong bảng xếp hạng vượt qua. Phần thưởng xếp hạng đã được phân phối, vui lòng kiểm tra.\",\"en\":\"Congratulations on reaching %vth place in the pass ranking. Ranking rewards have been issued. Please check.\",\"kh\":\"សូមអបអរសាទរចំពោះការឈានដល់ចំណាត់ថ្នាក់ទី %v ក្នុងចំណាត់ថ្នាក់ឆ្លងកាត់។ រង្វាន់ចំណាត់ថ្នាក់ត្រូវបានចេញ។ សូមត្រួតពិនិត្យ។\"}"
|
||||
}
|
||||
|
|
@ -47,6 +47,9 @@
|
|||
"data":{
|
||||
"RootPath":"../data"
|
||||
},
|
||||
"mongox": {
|
||||
"Path": "./etc/mgo.json"
|
||||
},
|
||||
"etcd": {
|
||||
"Url": ["127.0.0.1:2379"],
|
||||
"UserName": "",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
"mongo.games.com/goserver/core/mongox"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
)
|
||||
|
||||
func init() {
|
||||
//module.RegisteModule(new(MonitorMgr), time.Second*30, 0)
|
||||
}
|
||||
|
||||
type MonitorData struct {
|
||||
SrvId int32 //服务器id
|
||||
SrvType int32 //服务器类型
|
||||
Key string //自定义key
|
||||
Time time.Time //时间戳
|
||||
Data interface{} //数据体
|
||||
}
|
||||
|
||||
type MonitorMgr struct {
|
||||
}
|
||||
|
||||
func (m *MonitorMgr) ModuleName() string {
|
||||
return "MonitorMgr"
|
||||
}
|
||||
|
||||
func (m *MonitorMgr) Init() {
|
||||
|
||||
}
|
||||
|
||||
func (m *MonitorMgr) Update() {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
var updates []mongo.WriteModel
|
||||
for k, v := range GetPPCState() {
|
||||
d := &MonitorData{
|
||||
SrvId: int32(common.GetSelfSrvId()),
|
||||
SrvType: int32(common.GetSelfSrvType()),
|
||||
Key: k,
|
||||
Time: time.Now(),
|
||||
Data: v,
|
||||
}
|
||||
updates = append(updates,
|
||||
mongo.NewUpdateOneModel().
|
||||
SetFilter(bson.M{"srvid": d.SrvId, "srvtype": d.SrvType, "key": d.Key}).
|
||||
SetUpdate(bson.M{"$set": d}).SetUpsert(true))
|
||||
}
|
||||
|
||||
if len(updates) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
c, err := mongox.GetGlobalMonitorCollection(fmt.Sprintf("%s_rpc", model.MonitorPrefixName))
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("MonitorMgr Update get collection failed")
|
||||
return nil
|
||||
}
|
||||
|
||||
opts := options.BulkWrite().SetOrdered(false) // SetOrdered(false) 表示并行执行
|
||||
_, err = c.BulkWrite(context.Background(), updates, opts)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("MonitorMgr Update bulk write failed: %v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
return nil
|
||||
}), nil, "MonitorMgr_Update").StartByFixExecutor("MonitorMgr")
|
||||
}
|
||||
|
||||
func (m *MonitorMgr) Shutdown() {
|
||||
module.UnregisteModule(m)
|
||||
}
|
||||
|
|
@ -76,4 +76,20 @@ func init() {
|
|||
return
|
||||
},
|
||||
})
|
||||
//年兽排行榜
|
||||
mq.RegisterHandler(&mq.RegisterHandlerParam{
|
||||
Name: model.MQRankNian,
|
||||
Data: &model.NianInfo{},
|
||||
Handler: func(data interface{}) (err error) {
|
||||
log, ok := data.(*model.NianInfo)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
err = svc.RankNianUpsert(log)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("RankNianUpsert err: %v", err)
|
||||
}
|
||||
return
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,75 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
const Timeout = 30 * time.Second
|
||||
|
||||
type RPCState struct {
|
||||
RunTimes int64 //执行次数
|
||||
TotalRuningTime int64 //总执行时间
|
||||
MaxRuningTime int64 //最长执行时间
|
||||
TimeoutTimes int64 //执行超时次数 大于30秒的次数
|
||||
FailTimes int64 //执行失败次数
|
||||
SuccessTimes int64 //执行成功次数
|
||||
}
|
||||
|
||||
var RPCStateMgr = make(map[string]*RPCState)
|
||||
var RPCStateMgrLock = sync.RWMutex{}
|
||||
|
||||
func GetPPCState() map[string]*RPCState {
|
||||
ret := make(map[string]*RPCState)
|
||||
RPCStateMgrLock.RLock()
|
||||
defer RPCStateMgrLock.RUnlock()
|
||||
for k, v := range RPCStateMgr {
|
||||
e := *v // 复制一份
|
||||
ret[k] = &e
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
//func loggingMiddleware(h http.Handler) http.Handler {
|
||||
// return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// RPCStateMgrLock.Lock()
|
||||
// state, ok := RPCStateMgr[r.URL.Path]
|
||||
// if !ok {
|
||||
// state = &RPCState{}
|
||||
// RPCStateMgr[r.URL.Path] = state
|
||||
// }
|
||||
// RPCStateMgrLock.Unlock()
|
||||
//
|
||||
// // 记录请求的时间戳
|
||||
// start := time.Now()
|
||||
//
|
||||
// var buf bytes.Buffer
|
||||
// if r.Body != nil {
|
||||
// tee := io.TeeReader(r.Body, &buf)
|
||||
// r.Body = io.NopCloser(tee)
|
||||
// }
|
||||
//
|
||||
// logger.Logger.Infof("==>RPC %s %s %s", r.Method, r.URL.Path, buf.String())
|
||||
// // 包装响应写入器以捕获响应内容
|
||||
// rw := &responseWriter{w, http.StatusOK}
|
||||
// h.ServeHTTP(rw, r)
|
||||
// // 记录请求完成时间和响应状态码
|
||||
// duration := time.Since(start).Milliseconds()
|
||||
//
|
||||
// RPCStateMgrLock.Lock()
|
||||
// state.RunTimes++
|
||||
// state.TotalRuningTime += duration
|
||||
// if duration > state.MaxRuningTime {
|
||||
// state.MaxRuningTime = duration
|
||||
// }
|
||||
// if duration > Timeout.Milliseconds() {
|
||||
// state.TimeoutTimes++
|
||||
// }
|
||||
// if rw.statusCode != http.StatusOK {
|
||||
// state.FailTimes++
|
||||
// } else {
|
||||
// state.SuccessTimes++
|
||||
// }
|
||||
// RPCStateMgrLock.Unlock()
|
||||
// })
|
||||
//}
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
package svc
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/globalsign/mgo"
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"mongo.games.com/game/dbproxy/mongo"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"net/rpc"
|
||||
)
|
||||
|
||||
var (
|
||||
RankNianDBName = "log"
|
||||
RankNianCollName = "log_ranknian"
|
||||
RankNianColError = errors.New("RankNian collection open failed")
|
||||
)
|
||||
|
||||
func RankNianCollection(plt string) *mongo.Collection {
|
||||
s := mongo.MgoSessionMgrSington.GetPltMgoSession(plt, RankNianDBName)
|
||||
if s != nil {
|
||||
c, first := s.DB().C(RankNianCollName)
|
||||
if first {
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"snid"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"-luck"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"-damage"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func RankNianUpsert(args *model.NianInfo) error {
|
||||
cc := RankNianCollection(args.Platform)
|
||||
if cc == nil {
|
||||
return RankNianColError
|
||||
}
|
||||
update := bson.M{
|
||||
"$set": bson.M{
|
||||
"platform": args.Platform,
|
||||
"name": args.Name,
|
||||
"damage": args.Damage,
|
||||
"modid": args.ModId,
|
||||
"ts": args.Ts,
|
||||
},
|
||||
}
|
||||
if args.Luck != 0 {
|
||||
update["$set"].(bson.M)["luck"] = args.Luck
|
||||
}
|
||||
if args.LuckTime != 0 {
|
||||
update["$set"].(bson.M)["lucktime"] = args.LuckTime
|
||||
}
|
||||
_, err := cc.Upsert(
|
||||
bson.M{"snid": args.SnId},
|
||||
update,
|
||||
)
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Error("RankNianSvc.Upsert is err: ", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RankNianSvc struct {
|
||||
}
|
||||
|
||||
func (svc *RankNianSvc) Upsert(args *model.NianInfo, ret *bool) error {
|
||||
err := RankNianUpsert(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*ret = true
|
||||
return nil
|
||||
}
|
||||
|
||||
// 幸运榜
|
||||
func (svc *RankNianSvc) LuckFind(args *model.FindNianListArgs, ret *model.FindNianListReply) error {
|
||||
fc := RankNianCollection(args.Platform)
|
||||
if fc == nil {
|
||||
return RankNianColError
|
||||
}
|
||||
|
||||
err := fc.Find(bson.M{}).Sort("-luck").Limit(40).All(&ret.List)
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Error("QueryMatchSeason is err: ", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 伤害榜
|
||||
func (svc *RankNianSvc) DamageFind(args *model.FindNianListArgs, ret *model.FindNianListReply) error {
|
||||
fc := RankNianCollection(args.Platform)
|
||||
if fc == nil {
|
||||
return RankNianColError
|
||||
}
|
||||
|
||||
err := fc.Find(bson.M{}).Sort("-damage").Limit(40).All(&ret.List)
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Error("QueryMatchSeason is err: ", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (svc *RankNianSvc) UpdateAll(args *model.FindNianListArgs, ret *model.FindNianListReply) error {
|
||||
fc := RankNianCollection(args.Platform)
|
||||
if fc == nil {
|
||||
return RankNianColError
|
||||
}
|
||||
|
||||
// 根据 args 中的条件构建查询
|
||||
query := bson.M{"platform": args.Platform}
|
||||
|
||||
update := bson.M{
|
||||
"$set": bson.M{
|
||||
"luck": 0,
|
||||
"lucktime": 0,
|
||||
},
|
||||
}
|
||||
_, err := fc.UpdateAll(query, update)
|
||||
if err != nil {
|
||||
logger.Logger.Error("RankNianSvc.UpdateAll is err: ", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (svc *RankNianSvc) DelAll(args *model.FindNianListArgs, ret *model.FindNianListReply) error {
|
||||
fc := RankNianCollection(args.Platform)
|
||||
if fc == nil {
|
||||
return RankNianColError
|
||||
}
|
||||
query := bson.M{"platform": args.Platform}
|
||||
_, err := fc.RemoveAll(query)
|
||||
if err != nil {
|
||||
logger.Logger.Error("RankNianSvc.RemoveAll is err: ", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
func init() {
|
||||
rpc.Register(new(RankNianSvc))
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package svc
|
||||
|
||||
import (
|
||||
"net/rpc"
|
||||
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/mongox"
|
||||
|
||||
"mongo.games.com/game/dao"
|
||||
"mongo.games.com/game/model"
|
||||
)
|
||||
|
||||
var RedPacketSvc = new(RedPacketService)
|
||||
|
||||
func init() {
|
||||
rpc.Register(RedPacketSvc)
|
||||
}
|
||||
|
||||
type RedPacketService struct {
|
||||
}
|
||||
|
||||
func (r *RedPacketService) GetAll(plt *string, res *[]*model.RedPacket) error {
|
||||
d, err := dao.GetRedPacket(*plt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
list, err := d.GetAll()
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("RedPacketService.GetAll error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
*res = list
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *RedPacketService) UpdateAll(req *model.UpdateRedPacketAllReq, res *bool) error {
|
||||
d, err := mongox.GetDao(req.Plt, dao.NewRedPacket)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = d.UpdateAll(req.List)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("RedPacketService.UpdateAll error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
*res = true
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ import (
|
|||
"mongo.games.com/game/dbproxy/mongo"
|
||||
"mongo.games.com/game/mgrsrv/api"
|
||||
"mongo.games.com/game/model"
|
||||
rpcx "mongo.games.com/game/rpc"
|
||||
"mongo.games.com/game/webapi"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
|
|
@ -136,6 +137,9 @@ func init() {
|
|||
gob.Register(basic.CmdStats{})
|
||||
gob.Register(map[string]basic.CmdStats{})
|
||||
gob.Register(utils.RuntimeStats{})
|
||||
gob.Register(rpcx.State{})
|
||||
gob.Register(map[string]rpcx.State{})
|
||||
|
||||
//gob registe
|
||||
|
||||
rpc.Register(new(MonitorDataSvc))
|
||||
|
|
|
|||
|
|
@ -30,23 +30,29 @@ const (
|
|||
ETCDKEY_PLAYERPOOL = "/game/plt/playerpool/" // 个人水池调控配置
|
||||
ETCDKEY_GAME_CONFIG = "/game/plt/gameconfig/" // 游戏管理/全局配置
|
||||
ETCDKEY_ACT_PHONELOTTERY = "/game/act_phoneLottery"
|
||||
ETCDKEY_ChannelSwitch = "/game/channel/switch" // 渠道开关
|
||||
ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置
|
||||
ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置
|
||||
ETCDKEY_DIAMOND_LOTTERY = "/game/diamond_lottery" // 钻石抽奖配置
|
||||
ETCDKEY_Item = "/game/item" // 道具列表
|
||||
ETCDKEY_SKin = "/game/skin_config" // 皮肤配置
|
||||
ETCDKEY_RANK_TYPE = "/game/RankType" // 排行榜奖励配置
|
||||
ETCDKEY_AWARD_CONFIG = "/game/awardlog_config" //获奖记录
|
||||
ETCDKEY_GUIDE = "/game/guide_config" //新手引导配置
|
||||
ETCDKEY_MACHINE = "/game/machine_config" //娃娃机配置
|
||||
ETCDKEY_MatchAudience = "/game/match_audience" //比赛观众
|
||||
ETCDKEY_Spirit = "/game/spirit" // 小精灵配置
|
||||
ETCDKEY_RoomType = "/game/room_type/" // 房间类型配置
|
||||
ETCDKEY_RoomConfig = "/game/room_config/" // 房间配置
|
||||
ETCDKEY_RoomConfigSystem = "/game/room_system" // 系统房间配置
|
||||
ETCDKEY_ClientUpgrade = "/game/client_upgrade" // 客户端升级奖励配置
|
||||
ETCDKEY_PopUpWindow = "/game/PopUpWindowConfig" //弹窗配置
|
||||
ETCDKEY_LotteryConfig = "/game/lottery" //抽奖配置
|
||||
ETCDKEY_LotteryUser = "/game/user_lottery" //抽奖用户必中配置
|
||||
ETCDKEY_ChannelSwitch = "/game/channel/switch" // 渠道开关
|
||||
ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置
|
||||
ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置
|
||||
ETCDKEY_DIAMOND_LOTTERY = "/game/diamond_lottery" // 钻石抽奖配置
|
||||
ETCDKEY_Item = "/game/item" // 道具列表
|
||||
ETCDKEY_SKin = "/game/skin_config" // 皮肤配置
|
||||
ETCDKEY_RANK_TYPE = "/game/RankType" // 排行榜奖励配置
|
||||
ETCDKEY_AWARD_CONFIG = "/game/awardlog_config" //获奖记录
|
||||
ETCDKEY_GUIDE = "/game/guide_config" //新手引导配置
|
||||
ETCDKEY_MACHINE = "/game/machine_config" //娃娃机配置
|
||||
ETCDKEY_MatchAudience = "/game/match_audience" //比赛观众
|
||||
ETCDKEY_Spirit = "/game/spirit" // 小精灵配置
|
||||
ETCDKEY_RoomType = "/game/room_type/" // 房间类型配置
|
||||
ETCDKEY_RoomConfig = "/game/room_config/" // 房间配置
|
||||
ETCDKEY_RoomConfigSystem = "/game/room_system" // 系统房间配置
|
||||
ETCDKEY_ClientUpgrade = "/game/client_upgrade" // 客户端升级奖励配置
|
||||
ETCDKEY_PopUpWindow = "/game/PopUpWindowConfig" //弹窗配置
|
||||
ETCDKEY_LotteryConfig = "/game/lottery" //抽奖配置
|
||||
ETCDKEY_LotteryUser = "/game/user_lottery" //抽奖用户必中配置
|
||||
ETCDKEY_PigBankDiamond = "/game/pigbank_diamond" //存钱罐消耗获得
|
||||
ETCDKEY_PigBankProp = "/game/pigbank_prop" //存钱罐属性
|
||||
ETCDKEY_NianConfig = "/game/activity_nian" //年兽活动配置
|
||||
ETCDKEY_NianRankConfig = "/game/activity_nian_rank" //年兽排行榜配置
|
||||
KeyRedPacket = "/game/act_redpacket" //红包配置
|
||||
KeyActConsume = "/game/act_consume" //累计消耗活动配置
|
||||
)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ const (
|
|||
ThirteenWaterSceneWaitTimeout = time.Second * 2 //等待倒计时
|
||||
ThirteenWaterStartTimeout = time.Second * 3 //开始倒计时
|
||||
ThirteenWaterSendCardsTimeout = time.Second * 3 //开始发牌
|
||||
ThirteenWaterOptCardTimeout = time.Second * 30 //30选牌换牌
|
||||
ThirteenWaterOptCardTimeout = time.Second * 47 //47选牌换牌
|
||||
ThirteenWaterShowCardsTimeout = time.Second * 1 //轮流看牌时间
|
||||
ThirteenWaterHitTimeout = time.Second * 2 //打枪
|
||||
ThirteenWaterBilledTimeout = time.Second * 5 //结算
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ func init() {
|
|||
etcd.Register(etcd.ETCDKEY_SKin, webapi.SkinConfig{}, platformConfigEtcd)
|
||||
// 娃娃机配置
|
||||
etcd.Register(etcd.ETCDKEY_MACHINE, webapi.MachineConfig{}, platformConfigEtcd)
|
||||
// 存钱罐消耗获得
|
||||
etcd.Register(etcd.ETCDKEY_PigBankDiamond, webapi.GamePigBankDiamondConfig{}, platformConfigEtcd)
|
||||
// 存钱罐属性值
|
||||
etcd.Register(etcd.ETCDKEY_PigBankProp, webapi.GamePigBankPropConfig{}, platformConfigEtcd)
|
||||
}
|
||||
|
||||
func platformConfigEtcd(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
||||
|
|
@ -51,6 +55,10 @@ func platformConfigEtcd(ctx context.Context, completeKey string, isInit bool, ev
|
|||
case *webapi.ItemConfig:
|
||||
ConfigMgrInst.GetConfig(d.Platform).ItemConfig = d
|
||||
srvdata.GameItemMgr.SetConfig(d)
|
||||
case *webapi.GamePigBankDiamondConfig:
|
||||
ConfigMgrInst.GetConfig(d.Platform).GamePigBankDiamondConfig = d
|
||||
case *webapi.GamePigBankPropConfig:
|
||||
ConfigMgrInst.GetConfig(d.Platform).GamePigBankPropConfig = d
|
||||
default:
|
||||
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,133 +0,0 @@
|
|||
package base
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/goserver/core"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/core/profile"
|
||||
"mongo.games.com/goserver/core/schedule"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
"mongo.games.com/goserver/core/transact"
|
||||
"mongo.games.com/goserver/core/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
var MonitorMgrSington = &MonitorMgr{}
|
||||
|
||||
type MonitorMgr struct {
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) ModuleName() string {
|
||||
return "MonitorMgr"
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Init() {
|
||||
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Update() {
|
||||
//logic stats
|
||||
logicStats := profile.GetStats()
|
||||
if len(logicStats) > 0 {
|
||||
logLogic := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", logicStats)
|
||||
if logLogic != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("logic", logLogic)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//net session stats
|
||||
netStats := netlib.Stats()
|
||||
if len(netStats) > 0 {
|
||||
logNet := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", netStats)
|
||||
if logNet != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("net", logNet)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//schedule stats
|
||||
jobStats := schedule.Stats()
|
||||
if len(jobStats) > 0 {
|
||||
logJob := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", jobStats)
|
||||
if logJob != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("job", logJob)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//trans stats
|
||||
transStats := transact.Stats()
|
||||
if len(transStats) > 0 {
|
||||
logTrans := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", transStats)
|
||||
if logTrans != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("transact", logTrans)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//panic stats
|
||||
panicStats := utils.GetPanicStats()
|
||||
if len(panicStats) > 0 {
|
||||
for key, stats := range panicStats {
|
||||
logPanic := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), key, stats)
|
||||
if logPanic != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("panic", logPanic)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//object command quene stats
|
||||
objStats := core.AppCtx.GetStats()
|
||||
if len(objStats) > 0 {
|
||||
logCmd := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "obj", objStats)
|
||||
if logCmd != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("cmdque", logCmd)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//gorouting count, eg. system info
|
||||
runtimeStats := utils.StatsRuntime()
|
||||
logRuntime := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", runtimeStats)
|
||||
if logRuntime != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.InsertMonitorData("runtime", logRuntime)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Shutdown() {
|
||||
module.UnregisteModule(this)
|
||||
}
|
||||
|
||||
func init() {
|
||||
//gob registe
|
||||
gob.Register(profile.TimeElement{})
|
||||
gob.Register(map[string]profile.TimeElement{})
|
||||
gob.Register(netlib.ServiceStats{})
|
||||
gob.Register(map[int]netlib.ServiceStats{})
|
||||
gob.Register(schedule.TaskStats{})
|
||||
gob.Register(map[string]schedule.TaskStats{})
|
||||
gob.Register(transact.TransStats{})
|
||||
gob.Register(map[int]transact.TransStats{})
|
||||
gob.Register(utils.PanicStackInfo{})
|
||||
gob.Register(map[string]utils.PanicStackInfo{})
|
||||
gob.Register(basic.CmdStats{})
|
||||
gob.Register(map[string]basic.CmdStats{})
|
||||
gob.Register(utils.RuntimeStats{})
|
||||
//gob registe
|
||||
|
||||
module.RegisteModule(MonitorMgrSington, time.Minute*5, 0)
|
||||
}
|
||||
|
|
@ -1243,12 +1243,18 @@ func (this *Player) UpdatePigBankCoin(gainTexCoin int64) {
|
|||
return
|
||||
}
|
||||
|
||||
// 渠道开关
|
||||
if !ConfigMgrInst.IsOn(this.Platform, common.ChannelSwitchPigBankCoin, this.LastChannel) {
|
||||
return
|
||||
}
|
||||
|
||||
if this.PlayerData.WelfData == nil || this.PlayerData.WelfData.PigBank == nil {
|
||||
return
|
||||
}
|
||||
|
||||
fGetPropValue := func(propName string) int64 {
|
||||
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||
//pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||
pool := ConfigMgrInst.GetConfig(this.Platform).GamePigBankPropConfig.PropInfo
|
||||
for _, PropItem := range pool {
|
||||
if PropItem.PorpName == propName {
|
||||
return int64(PropItem.PropValue)
|
||||
|
|
@ -1257,7 +1263,9 @@ func (this *Player) UpdatePigBankCoin(gainTexCoin int64) {
|
|||
return 0
|
||||
}
|
||||
BankCoinMax := int64(0)
|
||||
for _, data := range srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr() {
|
||||
// pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
|
||||
pool := ConfigMgrInst.GetConfig(this.Platform).GamePigBankDiamondConfig.DiamondInfo
|
||||
for _, data := range pool {
|
||||
if this.WelfData.PigBank.DayBuyTimes+1 >= data.BuyCountMin && this.WelfData.PigBank.DayBuyTimes+1 <= data.BuyCountMax {
|
||||
BankCoinMax = int64(data.MaxGold)
|
||||
break
|
||||
|
|
|
|||
|
|
@ -2094,11 +2094,6 @@ func (this *Scene) Statistics(param *StaticParam) {
|
|||
|
||||
logger.Logger.Tracef("Statistics gameId:%v wbLevel:%v gain:%v addGain:%v", this.GameId, wbLevel, param.Gain, addGain)
|
||||
|
||||
// 比赛场,私人房不统计
|
||||
if this.IsMatchScene() || this.IsPrivateScene() {
|
||||
return
|
||||
}
|
||||
|
||||
var totalIn int64
|
||||
var totalOut int64
|
||||
now := time.Now()
|
||||
|
|
@ -2181,6 +2176,40 @@ func (this *Scene) Statistics(param *StaticParam) {
|
|||
statics = append(statics, &data.Statics)
|
||||
}
|
||||
|
||||
f := func(list []*model.PlayerGameStatics) {
|
||||
for _, data := range list {
|
||||
if data != nil {
|
||||
if !this.IsMatchScene() && !this.IsPrivateScene() { // 比赛场,私人房不统计
|
||||
data.TotalIn += totalIn
|
||||
data.TotalOut += totalOut
|
||||
data.Tax += param.GainTax
|
||||
}
|
||||
if param.IsAddTimes {
|
||||
data.GameTimes++
|
||||
if param.Gain > 0 {
|
||||
data.WinGameTimes++
|
||||
data.WinGameTimesNum++
|
||||
data.LoseGameTimesNum = 0
|
||||
} else if param.Gain < 0 {
|
||||
data.LoseGameTimes++
|
||||
data.LoseGameTimesNum++
|
||||
data.WinGameTimesNum = 0
|
||||
} else {
|
||||
data.DrawGameTimes++
|
||||
data.WinGameTimesNum = 0
|
||||
data.LoseGameTimesNum = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
f(statics)
|
||||
statics = statics[:0]
|
||||
|
||||
if this.IsMatchScene() || this.IsPrivateScene() {
|
||||
return
|
||||
}
|
||||
|
||||
// 新手输赢统计
|
||||
if !model.GameParamData.CloseNovice && !common.InSliceInt(model.GameParamData.CloseNoviceGame, int(this.GameId)) && isControl && wbLevel == 0 && isNovice {
|
||||
keyNoviceGameId := common.GetKeyNoviceGameId(int(this.GameId))
|
||||
|
|
@ -2249,29 +2278,8 @@ func (this *Scene) Statistics(param *StaticParam) {
|
|||
logger.Logger.Tracef("Statistics PlayerPool gameId:%v wbLevel:%v gain:%v addGain:%v", this.GameId, wbLevel, param.Gain, addGain)
|
||||
}
|
||||
|
||||
for _, data := range statics {
|
||||
if data != nil {
|
||||
data.TotalIn += totalIn
|
||||
data.TotalOut += totalOut
|
||||
data.Tax += param.GainTax
|
||||
if param.IsAddTimes {
|
||||
data.GameTimes++
|
||||
if param.Gain > 0 {
|
||||
data.WinGameTimes++
|
||||
data.WinGameTimesNum++
|
||||
data.LoseGameTimesNum = 0
|
||||
} else if param.Gain < 0 {
|
||||
data.LoseGameTimes++
|
||||
data.LoseGameTimesNum++
|
||||
data.WinGameTimesNum = 0
|
||||
} else {
|
||||
data.DrawGameTimes++
|
||||
data.WinGameTimesNum = 0
|
||||
data.LoseGameTimesNum = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
f(statics)
|
||||
statics = statics[:0]
|
||||
|
||||
// 玩家身上元数据
|
||||
if param.IsAddTimes {
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ func (this *SceneBaseStateFishing) OnPlayerOp(s *base.Scene, p *base.Player, opc
|
|||
// start 检测当前房间是否处于基本的关闭状态
|
||||
if s.CheckNeedDestroy() {
|
||||
if sceneEx.hDestroy == timer.InvalidTimerHandle {
|
||||
if hNext, ok := common.DelayInvake(func() {
|
||||
if hNext, ok := common.DelayInvoke(func() {
|
||||
sceneEx.hDestroy = timer.InvalidTimerHandle
|
||||
sceneEx.SceneDestroy(true)
|
||||
}, nil, time.Second*10, 1); ok {
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ type TienLenSceneData struct {
|
|||
RoundLogId []string // 每局牌局记录id
|
||||
CustomLogSave bool // 是否已经保存日志
|
||||
PlayerAward map[int32]*[]*model.Item // 房卡场最终奖励
|
||||
bill *tienlen.SCTienLenGameBilled
|
||||
}
|
||||
|
||||
func NewTienLenSceneData(s *base.Scene) *TienLenSceneData {
|
||||
|
|
|
|||
|
|
@ -427,6 +427,7 @@ func TienLenCreateRoomInfoPacket(s *base.Scene, p *base.Player, sceneEx *TienLen
|
|||
NumOfGames: proto.Int(sceneEx.NumOfGames),
|
||||
TotalOfGames: sceneEx.TotalOfGames,
|
||||
CurOpIdx: proto.Int(-1),
|
||||
IsSmallCard: sceneEx.FindWinPos() == -1,
|
||||
MasterSnid: proto.Int32(sceneEx.masterSnid),
|
||||
AudienceNum: proto.Int(s.GetAudiencesNum()),
|
||||
BaseScore: proto.Int32(s.GetBaseScore()),
|
||||
|
|
@ -1057,12 +1058,14 @@ func (this *SceneHandCardStateTienLen) OnEnter(s *base.Scene) {
|
|||
}
|
||||
if len(sceneEx.tianHuSnids) == 0 { //没有天胡玩家
|
||||
//有赢家,赢家先出;无赢家手持最小牌先
|
||||
pos := int32(sceneEx.FindWinPos())
|
||||
if pos == -1 {
|
||||
winPos := int32(sceneEx.FindWinPos())
|
||||
pos := winPos
|
||||
if winPos == -1 {
|
||||
pos = sceneEx.startOpPos
|
||||
}
|
||||
pack := &tienlen.SCTienLenFirstOpPos{
|
||||
Pos: proto.Int32(pos),
|
||||
Pos: pos,
|
||||
IsSmallCard: winPos == -1,
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
sceneEx.Broadcast(int(tienlen.TienLenPacketID_PACKET_SCTienLenFirstOpPos), pack, 0)
|
||||
|
|
@ -1383,7 +1386,7 @@ func (this *ScenePlayerOpStateTienLen) OnPlayerOp(s *base.Scene, p *base.Player,
|
|||
|
||||
case rule.TienLenPlayerOpPass: //过牌
|
||||
//当前操作者和上一个操作者是同一个人,必出牌,不能过牌
|
||||
if int32(playerEx.GetPos()) == sceneEx.lastOpPos || sceneEx.lastOpPos != rule.InvalidePos {
|
||||
if int32(playerEx.GetPos()) == sceneEx.lastOpPos || sceneEx.lastOpPos == rule.InvalidePos {
|
||||
finishFunc()
|
||||
return true
|
||||
}
|
||||
|
|
@ -2623,6 +2626,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
proto.SetDefaults(pack)
|
||||
s.Broadcast(int(tienlen.TienLenPacketID_PACKET_SCTienLenGameBilled), pack, 0)
|
||||
logger.Logger.Trace("TienLenPacketID_PACKET_SCTienLenGameBilled gameFreeId:", sceneEx.GetGameFreeId(), ";pack:", pack)
|
||||
sceneEx.bill = pack
|
||||
|
||||
if sceneEx.IsCustom() && sceneEx.TotalOfGames > 0 {
|
||||
for _, v := range tienlenType.PlayerData {
|
||||
|
|
@ -2932,6 +2936,16 @@ func (this *SceneBilledStateTienLen) OnPlayerOp(s *base.Scene, p *base.Player, o
|
|||
// 玩家事件
|
||||
func (this *SceneBilledStateTienLen) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||
this.SceneBaseStateTienLen.OnPlayerEvent(s, p, evtcode, params)
|
||||
sceneEx, ok := s.GetExtraData().(*TienLenSceneData)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
switch evtcode {
|
||||
case base.PlayerEventRehold:
|
||||
if sceneEx.bill != nil && sceneEx.IsRankMatch() {
|
||||
p.SendToClient(int(tienlen.TienLenPacketID_PACKET_SCTienLenGameBilled), sceneEx.bill)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (this *SceneBilledStateTienLen) OnTick(s *base.Scene) {
|
||||
|
|
|
|||
13
go.mod
13
go.mod
|
|
@ -19,6 +19,7 @@ require (
|
|||
github.com/jinzhu/now v1.1.5
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
|
||||
github.com/mojocn/base64Captcha v1.3.6
|
||||
github.com/mozillazg/go-pinyin v0.20.0
|
||||
github.com/spf13/cast v1.7.0
|
||||
github.com/spf13/viper v1.19.0
|
||||
github.com/tealeg/xlsx v1.0.5
|
||||
|
|
@ -91,7 +92,7 @@ require (
|
|||
github.com/xdg-go/scram v1.1.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/xtaci/kcp-go v5.4.20+incompatible // indirect
|
||||
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect
|
||||
github.com/xuri/efp v0.0.0-20241211021726-c4e992084aa6 // indirect
|
||||
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.16 // indirect
|
||||
|
|
@ -102,12 +103,12 @@ require (
|
|||
go.uber.org/automaxprocs v1.6.0 // indirect
|
||||
go.uber.org/multierr v1.9.0 // indirect
|
||||
go.uber.org/zap v1.24.0 // indirect
|
||||
golang.org/x/crypto v0.28.0 // indirect
|
||||
golang.org/x/crypto v0.31.0 // indirect
|
||||
golang.org/x/image v0.18.0 // indirect
|
||||
golang.org/x/net v0.30.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.26.0 // indirect
|
||||
golang.org/x/text v0.19.0 // indirect
|
||||
golang.org/x/net v0.33.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/sys v0.28.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/time v0.7.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
|
||||
|
|
|
|||
26
go.sum
26
go.sum
|
|
@ -226,6 +226,8 @@ github.com/mojocn/base64Captcha v1.3.6 h1:gZEKu1nsKpttuIAQgWHO+4Mhhls8cAKyiV2Ew0
|
|||
github.com/mojocn/base64Captcha v1.3.6/go.mod h1:i5CtHvm+oMbj1UzEPXaA8IH/xHFZ3DGY3Wh3dBpZ28E=
|
||||
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
|
||||
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/mozillazg/go-pinyin v0.20.0 h1:BtR3DsxpApHfKReaPO1fCqF4pThRwH9uwvXzm+GnMFQ=
|
||||
github.com/mozillazg/go-pinyin v0.20.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
|
|
@ -384,8 +386,8 @@ github.com/xtaci/kcp-go v5.4.20+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45
|
|||
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 h1:EWU6Pktpas0n8lLQwDsRyZfmkPeRbdgPtW609es+/9E=
|
||||
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37/go.mod h1:HpMP7DB2CyokmAh4lp0EQnnWhmycP/TvwBGzvuie+H0=
|
||||
github.com/xuri/efp v0.0.0-20200605144744-ba689101faaf/go.mod h1:uBiSUepVYMhGTfDeBKKasV4GpgBlzJ46gXUBAqV8qLk=
|
||||
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d h1:llb0neMWDQe87IzJLS4Ci7psK/lVsjIS2otl+1WyRyY=
|
||||
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
|
||||
github.com/xuri/efp v0.0.0-20241211021726-c4e992084aa6 h1:8m6DWBG+dlFNbx5ynvrE7NgI+Y7OlZVMVTpayoW+rCc=
|
||||
github.com/xuri/efp v0.0.0-20241211021726-c4e992084aa6/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
|
||||
github.com/xuri/excelize/v2 v2.9.0 h1:1tgOaEq92IOEumR1/JfYS/eR0KHOCsRv/rYXXh6YJQE=
|
||||
github.com/xuri/excelize/v2 v2.9.0/go.mod h1:uqey4QBZ9gdMeWApPLdhm9x+9o2lq4iVmjiLfBS5hdE=
|
||||
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 h1:hPVCafDV85blFTabnqKgNhDCkJX25eik94Si9cTER4A=
|
||||
|
|
@ -437,8 +439,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
|
|||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
|
||||
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
|
||||
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
|
||||
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
|
||||
|
|
@ -473,8 +475,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
|
|||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
|
||||
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
|
||||
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
|
@ -485,8 +487,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
|
|||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
|
|
@ -514,8 +516,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
|
||||
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
|
||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
|
|
@ -526,8 +528,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
|||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
|
||||
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
|
||||
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
|
|
|
|||
|
|
@ -139,6 +139,92 @@ func WorldSrvApi(rw http.ResponseWriter, req *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
func DebugSrvApi(rw http.ResponseWriter, req *http.Request) {
|
||||
|
||||
if !common.Config.IsDevMode {
|
||||
return
|
||||
}
|
||||
|
||||
defer utils.DumpStackIfPanic("api.DebugSrvApi")
|
||||
logger.Logger.Info("DebugSrvApi receive:", req.URL.Path, req.URL.RawQuery)
|
||||
|
||||
if common.RequestCheck(req, model.GameParamData.WhiteHttpAddr) == false {
|
||||
logger.Logger.Info("RemoteAddr [%v] require api.", req.RemoteAddr)
|
||||
return
|
||||
}
|
||||
data, err := io.ReadAll(req.Body)
|
||||
if err != nil {
|
||||
logger.Logger.Info("Body err.", err)
|
||||
webApiResponse(rw, nil /*map[string]interface{}{webapi.RESPONSE_STATE: webapi.STATE_ERR, webapi.RESPONSE_ERRMSG: "Post data is null!"}*/)
|
||||
return
|
||||
}
|
||||
|
||||
params := make(map[string]string)
|
||||
json.Unmarshal(data, ¶ms)
|
||||
|
||||
startTime := time.Now().UnixNano()
|
||||
|
||||
var stats *ApiStats
|
||||
if v, exist := WebApiStats.Load(req.URL.Path); exist {
|
||||
stats = v.(*ApiStats)
|
||||
} else {
|
||||
stats = &ApiStats{}
|
||||
WebApiStats.Store(req.URL.Path, stats)
|
||||
}
|
||||
var rep []byte
|
||||
start := time.Now()
|
||||
res := make(chan []byte, 1)
|
||||
suc := core.CoreObject().SendCommand(&WebApiEvent{req: req, path: req.URL.Path, h: HandlerWrapper(func(event *WebApiEvent, data []byte) bool {
|
||||
logger.Logger.Trace("WorldSrvApi start transcate")
|
||||
tnp := &transact.TransNodeParam{
|
||||
Tt: common.TransTypeWebApi,
|
||||
Ot: transact.TransOwnerType(common.GetSelfSrvType()),
|
||||
Oid: common.GetSelfSrvId(),
|
||||
AreaID: common.GetSelfAreaId(),
|
||||
}
|
||||
tNode := transact.DTCModule.StartTrans(tnp, event, transact.DefaultTransactTimeout) //超时时间30秒
|
||||
if tNode != nil {
|
||||
tNode.TransEnv.SetField(WEBAPI_TRANSACTE_EVENT, event)
|
||||
tNode.Go(core.CoreObject())
|
||||
}
|
||||
return true
|
||||
}), body: data, rawQuery: req.URL.RawQuery, res: res}, false)
|
||||
if suc {
|
||||
select {
|
||||
case rep = <-res:
|
||||
if rep != nil {
|
||||
webApiResponse(rw, rep)
|
||||
}
|
||||
case <-time.After(ApiDefaultTimeout):
|
||||
//rep = make(map[string]interface{})
|
||||
//rep[webapi.RESPONSE_STATE] = webapi.STATE_ERR
|
||||
//rep[webapi.RESPONSE_ERRMSG] = "proccess timeout!"
|
||||
webApiResponse(rw, rep)
|
||||
if stats != nil {
|
||||
atomic.AddInt64(&stats.TimeoutTimes, 1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
webApiResponse(rw, nil)
|
||||
if stats != nil {
|
||||
atomic.AddInt64(&stats.UnreachTimes, 1)
|
||||
}
|
||||
}
|
||||
ps := int64(time.Now().Sub(start) / time.Millisecond)
|
||||
if stats != nil {
|
||||
atomic.AddInt64(&stats.RunTimes, 1)
|
||||
atomic.AddInt64(&stats.TotalRuningTime, ps)
|
||||
if atomic.LoadInt64(&stats.MaxRuningTime) < ps {
|
||||
atomic.StoreInt64(&stats.MaxRuningTime, ps)
|
||||
}
|
||||
}
|
||||
|
||||
log := model.NewAPILog(req.URL.Path, req.URL.RawQuery, string(data[:]), req.RemoteAddr, string(rep[:]), startTime, ps)
|
||||
mq.Write(log)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
func init() {
|
||||
transact.RegisteHandler(common.TransTypeWebApi, &transact.TransHanderWrapper{
|
||||
|
|
@ -262,6 +348,9 @@ func init() {
|
|||
admin.MyAdminApp.Route("/api/game/exchange_create", WorldSrvApi)
|
||||
// 兑换订单列表
|
||||
admin.MyAdminApp.Route("/api/game/exchange_order", WorldSrvApi)
|
||||
|
||||
admin.MyAdminApp.Route("/api/platform/debug", DebugSrvApi)
|
||||
|
||||
}
|
||||
|
||||
func Stats() map[string]ApiStats {
|
||||
|
|
|
|||
|
|
@ -1,147 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/mgrsrv/api"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/goserver/core"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/core/profile"
|
||||
"mongo.games.com/goserver/core/schedule"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
"mongo.games.com/goserver/core/transact"
|
||||
"mongo.games.com/goserver/core/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
var MonitorMgrSington = &MonitorMgr{}
|
||||
|
||||
type MonitorMgr struct {
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) ModuleName() string {
|
||||
return "MonitorMgr"
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Init() {
|
||||
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Update() {
|
||||
//webapi stats
|
||||
apiStats := api.Stats()
|
||||
if len(apiStats) > 0 {
|
||||
log := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", apiStats)
|
||||
if log != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("webapi", log)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//logic stats
|
||||
logicStats := profile.GetStats()
|
||||
if len(logicStats) > 0 {
|
||||
logLogic := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", logicStats)
|
||||
if logLogic != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("logic", logLogic)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//net session stats
|
||||
netStats := netlib.Stats()
|
||||
if len(netStats) > 0 {
|
||||
logNet := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", netStats)
|
||||
if logNet != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("net", logNet)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//schedule stats
|
||||
jobStats := schedule.Stats()
|
||||
if len(jobStats) > 0 {
|
||||
logJob := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", jobStats)
|
||||
if logJob != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("job", logJob)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//trans stats
|
||||
transStats := transact.Stats()
|
||||
if len(transStats) > 0 {
|
||||
logTrans := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", transStats)
|
||||
if logTrans != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("transact", logTrans)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//panic stats
|
||||
panicStats := utils.GetPanicStats()
|
||||
if len(panicStats) > 0 {
|
||||
for key, stats := range panicStats {
|
||||
logPanic := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), key, stats)
|
||||
if logPanic != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("panic", logPanic)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//object command quene stats
|
||||
objStats := core.AppCtx.GetStats()
|
||||
if len(objStats) > 0 {
|
||||
logCmd := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "obj", objStats)
|
||||
if logCmd != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("cmdque", logCmd)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//gorouting count, eg. system info
|
||||
runtimeStats := utils.StatsRuntime()
|
||||
logRuntime := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", runtimeStats)
|
||||
if logRuntime != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.InsertMonitorData("runtime", logRuntime)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Shutdown() {
|
||||
module.UnregisteModule(this)
|
||||
}
|
||||
|
||||
func init() {
|
||||
//gob registe
|
||||
gob.Register(api.ApiStats{})
|
||||
gob.Register(map[string]api.ApiStats{})
|
||||
gob.Register(profile.TimeElement{})
|
||||
gob.Register(map[string]profile.TimeElement{})
|
||||
gob.Register(netlib.ServiceStats{})
|
||||
gob.Register(map[int]netlib.ServiceStats{})
|
||||
gob.Register(schedule.TaskStats{})
|
||||
gob.Register(map[string]schedule.TaskStats{})
|
||||
gob.Register(transact.TransStats{})
|
||||
gob.Register(map[int]transact.TransStats{})
|
||||
gob.Register(utils.PanicStackInfo{})
|
||||
gob.Register(map[string]utils.PanicStackInfo{})
|
||||
gob.Register(basic.CmdStats{})
|
||||
gob.Register(map[string]basic.CmdStats{})
|
||||
gob.Register(utils.RuntimeStats{})
|
||||
//gob registe
|
||||
|
||||
module.RegisteModule(MonitorMgrSington, time.Minute*5, 0)
|
||||
}
|
||||
|
|
@ -17,14 +17,15 @@ import (
|
|||
*/
|
||||
|
||||
const (
|
||||
OpAll = 0
|
||||
OpTurnplate = 1
|
||||
OpBlindBox = 2
|
||||
OpFirstPay = 3
|
||||
OpContinuousPay = 4
|
||||
OpPhoneLottery = 5
|
||||
OpCollect = 6
|
||||
OpDiamondLottery = 7
|
||||
OpAll = 0
|
||||
OpTurnplate = 1
|
||||
OpBlindBox = 2
|
||||
OpFirstPay = 3
|
||||
OpContinuousPay = 4
|
||||
OpPhoneLottery = 5
|
||||
OpCollect = 6
|
||||
OpNian = 7
|
||||
OpConsume = 8 // 累计消耗活动
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -163,6 +164,17 @@ type AllConfig struct {
|
|||
LotteryShows map[int64]*webapi.ShowLottery
|
||||
// 竞技馆抽奖必中配置
|
||||
LotteryUser map[int64]*webapi.UserLottery
|
||||
// 存钱罐消耗获得
|
||||
*webapi.GamePigBankDiamondConfig
|
||||
// 存钱罐属性
|
||||
*webapi.GamePigBankPropConfig
|
||||
//年兽配置
|
||||
*webapi.ActivityNianConfig
|
||||
*webapi.NianRankReward
|
||||
// 红包配置
|
||||
*webapi.RedPacketConfig
|
||||
// 累计消耗活动配置
|
||||
*webapi.ConsumeConfig
|
||||
}
|
||||
|
||||
type GlobalConfig struct {
|
||||
|
|
@ -536,3 +548,21 @@ func (cm *ConfigMgr) CustomIsOn(plt string, configId int32) bool {
|
|||
|
||||
return true
|
||||
}
|
||||
|
||||
func (cm *ConfigMgr) GetPigBankDiamondArr(plt string) []*webapi.PigBankDiamondInfo {
|
||||
cfg := cm.GetConfig(plt).GamePigBankDiamondConfig
|
||||
if cfg == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return cfg.DiamondInfo
|
||||
}
|
||||
|
||||
func (cm *ConfigMgr) GetPigBankPropArr(plt string) []*webapi.PigBankPropInfo {
|
||||
cfg := cm.GetConfig(plt).GamePigBankPropConfig
|
||||
if cfg == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return cfg.PropInfo
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,11 @@ import (
|
|||
|
||||
"github.com/globalsign/mgo"
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -85,6 +89,60 @@ func RemoveMonitorData(t time.Time) (chged []*mgo.ChangeInfo, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
type MonitorTool[T any] struct {
|
||||
CollectionName string
|
||||
}
|
||||
|
||||
func NewMonitorTool[T any](collectionName string) *MonitorTool[T] {
|
||||
return &MonitorTool[T]{
|
||||
CollectionName: collectionName,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *MonitorTool[T]) Insert(key string, state *T) {
|
||||
d := NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), key, state)
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return InsertMonitorData(m.CollectionName, d)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
|
||||
}
|
||||
|
||||
func (m *MonitorTool[T]) InsertKV(kv map[string]*T) {
|
||||
// todo 批量插入
|
||||
for k, v := range kv {
|
||||
m.Insert(k, v)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *MonitorTool[T]) Upsert(key string, state *T) {
|
||||
d := NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), key, state)
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return UpsertMonitorData(m.CollectionName, d)
|
||||
}), nil, "UpsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
|
||||
func (m *MonitorTool[T]) UpsertKV(kv map[string]*T) {
|
||||
//todo 批量更新
|
||||
for k, v := range kv {
|
||||
m.Upsert(k, v)
|
||||
}
|
||||
}
|
||||
|
||||
// Remove 清理监控日志
|
||||
func Remove(t time.Time) {
|
||||
if t.IsZero() {
|
||||
return
|
||||
}
|
||||
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
_, err := RemoveMonitorData(t)
|
||||
if err != nil {
|
||||
logger.Logger.Error("RemoveMonitorData error:", err)
|
||||
}
|
||||
return nil
|
||||
}), nil, "RemoveMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
|
||||
type PlayerOLStats struct {
|
||||
PlatformStats map[string]*PlayerStats
|
||||
RobotStats PlayerStats
|
||||
|
|
|
|||
|
|
@ -44,13 +44,14 @@ type BackendPermitJoin struct {
|
|||
|
||||
// BackendPermitTask 通行证任务完成记录
|
||||
type BackendPermitTask struct {
|
||||
Platform string // 平台
|
||||
StartTs int64 // 活动开始时间
|
||||
SnId int32 // 玩家id
|
||||
TaskId int32 // 任务id
|
||||
TaskName string // 任务名称
|
||||
ActivityType int32 // 活动类型
|
||||
TaskType int32 // 任务类型
|
||||
Gain []AwardItem // 任务获得奖励
|
||||
Ts int64 // 时间戳
|
||||
Platform string // 平台
|
||||
StartTs int64 // 活动开始时间
|
||||
SnId int32 // 玩家id
|
||||
TaskId int32 // 任务id
|
||||
TaskName string // 任务名称
|
||||
ActivityType int32 // 活动类型
|
||||
TaskType int32 // 任务类型
|
||||
Gain []AwardItem // 任务获得奖励
|
||||
Ts int64 // 时间戳
|
||||
RemainDiamond int64 // 剩余钻石
|
||||
}
|
||||
|
|
|
|||
|
|
@ -534,16 +534,24 @@ type TaskData struct {
|
|||
}
|
||||
|
||||
type PigBankData struct {
|
||||
TakeTimes int32 //一共领取次数
|
||||
BankCoin int64 //当前金币数量
|
||||
DayBuyTimes int32 //当天领取次数
|
||||
TakeTimes int32 //一共领取次数
|
||||
BankCoin int64 //当前金币数量
|
||||
DayBuyTimes int32 //当天领取次数
|
||||
TakeRecord map[int32]int64 // 每次领取记录
|
||||
}
|
||||
|
||||
// 钻石储存罐数据
|
||||
type DiamondBankData struct {
|
||||
TakeTimes int32 //一共领取次数
|
||||
BankDiamond float64 //当前钻石数量
|
||||
DayBuyTimes int32 //当天领取次数
|
||||
TakeTimes int32 //一共领取次数
|
||||
BankDiamond float64 //当前钻石数量
|
||||
DayBuyTimes int32 //当天领取次数
|
||||
TakeRecord map[int32]int64 // 每次领取记录
|
||||
}
|
||||
|
||||
type RedPacketData struct {
|
||||
N int64 // 领取次数
|
||||
RN int64 // 非空奖次数
|
||||
JN int32 // 参与次数
|
||||
}
|
||||
|
||||
type WelfareData struct {
|
||||
|
|
@ -562,6 +570,8 @@ type WelfareData struct {
|
|||
DiamondBank *DiamondBankData // 钻石储存罐
|
||||
PermitAward map[int32]int64 // 赛季通行证奖励领取时间
|
||||
PermitExchange map[int32][]int64 // 赛季通行证兑换次数, 多次的兑换时间
|
||||
NianData *NianData //年兽活动数据
|
||||
RedPacket map[int64]*RedPacketData // 红包活动 活动id:领取次数
|
||||
}
|
||||
|
||||
func NewWelfareData() *WelfareData {
|
||||
|
|
@ -570,10 +580,19 @@ func NewWelfareData() *WelfareData {
|
|||
VIPBag: make(map[int32]map[int32]int32),
|
||||
Task: make(map[int32]*TaskData),
|
||||
PhoneLotteryTask: make(map[int32]*TaskData),
|
||||
PigBank: &PigBankData{},
|
||||
DiamondBank: &DiamondBankData{},
|
||||
PermitAward: make(map[int32]int64),
|
||||
PermitExchange: make(map[int32][]int64),
|
||||
PigBank: &PigBankData{
|
||||
TakeRecord: make(map[int32]int64, 8),
|
||||
},
|
||||
DiamondBank: &DiamondBankData{
|
||||
TakeRecord: make(map[int32]int64, 8),
|
||||
},
|
||||
PermitAward: make(map[int32]int64),
|
||||
PermitExchange: make(map[int32][]int64),
|
||||
RedPacket: make(map[int64]*RedPacketData),
|
||||
NianData: &NianData{
|
||||
OtherAwardNum: make(map[int32]int32),
|
||||
GiftShop: make(map[int32]int32),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -666,6 +685,22 @@ type WebPlayerDataParam struct {
|
|||
Long, PermitScore int64
|
||||
}
|
||||
|
||||
type NianData struct {
|
||||
ActivityStartTime int64 //活动开始时间
|
||||
ActivityEndTime int64 //活动结束时间
|
||||
BossHp int64 //Boss当前血量
|
||||
BuffStatus bool //Buff领取状态
|
||||
BuffCount int64 //Buff剩余生效次数
|
||||
SignAwardTime int64 //签到奖励领取时间
|
||||
BossDieCount int32 //BOSS死亡次数
|
||||
LittleHurt int32 //小爆竹次数
|
||||
BigHurt int32 //大爆竹次数
|
||||
OtherAwardNum map[int32]int32 //奖励掉落数量
|
||||
AttackMaxHp int64 //单次攻击最大血量
|
||||
AttackSumHp int64 //攻击总伤害
|
||||
GiftShop map[int32]int32 //购买每日礼包记录
|
||||
}
|
||||
|
||||
func ConvertPlayerDataToWebData(param *WebPlayerDataParam) *webapi.PlayerData {
|
||||
if param == nil || param.PlayerData == nil {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ const (
|
|||
MQRankPlayerInvite = "log_rankplayerinvite"
|
||||
MQRankPlayerLevel = "log_rankplayerlevel"
|
||||
MQRankPlayerPermit = "log_rankplayerpermit" // 赛季通行证排行榜
|
||||
MQRankNian = "log_ranknian" //年兽排行榜
|
||||
)
|
||||
|
||||
// 排行榜类型
|
||||
|
|
@ -330,3 +331,78 @@ func SaveRankInvite(args *RankInvite) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 年兽排行榜
|
||||
type NianInfo struct {
|
||||
Platform string
|
||||
SnId int32
|
||||
Name string
|
||||
Luck int64
|
||||
Damage int64
|
||||
ModId int32 //头像
|
||||
LuckTime int64 //幸运值更新时间
|
||||
Ts int64 //更新时间
|
||||
}
|
||||
|
||||
type FindNianListArgs struct {
|
||||
Platform string
|
||||
}
|
||||
type FindNianListReply struct {
|
||||
List []*NianInfo
|
||||
}
|
||||
|
||||
func FindLuckNianRankList(args *FindNianListArgs) (*FindNianListReply, error) {
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.FindLuckNianList rpcCli == nil")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
ret := new(FindNianListReply)
|
||||
err := rpcCli.CallWithTimeout("RankNianSvc.LuckFind", args, ret, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Error("GetNianLuckRankList error:", err)
|
||||
return ret, err
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func FindDamageNianRankList(args *FindNianListArgs) (*FindNianListReply, error) {
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.FindNianList rpcCli == nil")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
ret := new(FindNianListReply)
|
||||
err := rpcCli.CallWithTimeout("RankNianSvc.DamageFind", args, ret, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Error("GetNianDamageRankList error:", err)
|
||||
return ret, err
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
func ClearNianRank(args *FindNianListArgs) error {
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.FindNianList rpcCli == nil")
|
||||
return nil
|
||||
}
|
||||
ret := new(FindNianListReply)
|
||||
err := rpcCli.CallWithTimeout("RankNianSvc.UpdateAll", args, ret, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Error("GetNianDamageRankList error:", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func DelNianRank(args *FindNianListArgs) error {
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.FindNianList rpcCli == nil")
|
||||
return nil
|
||||
}
|
||||
ret := new(FindNianListReply)
|
||||
err := rpcCli.CallWithTimeout("RankNianSvc.DelAll", args, ret, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Error("GetNianDamageRankList error:", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
)
|
||||
|
||||
//go:generate mongoctl -model-dir=. -model-names=RedPacket -dao-dir=../dao/
|
||||
type RedPacket struct {
|
||||
ID primitive.ObjectID `bson:"_id" gen:"autoFill"`
|
||||
Cid int64 // 红包活动id
|
||||
Use map[int64]int64 // 已发红包 红包奖励数量:已发个数
|
||||
Ts int64 // 更新时间戳
|
||||
}
|
||||
|
||||
func (r *RedPacket) DatabaseName() string {
|
||||
return "log"
|
||||
}
|
||||
|
||||
func (r *RedPacket) CollectionName() string {
|
||||
return "log_redpacket"
|
||||
}
|
||||
|
||||
func GetRedPacketAll(plt string) (res []*RedPacket, err error) {
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.GetRedPacketAll rpcCli == nil")
|
||||
return nil, errors.New("rpc client is nil")
|
||||
}
|
||||
|
||||
res = make([]*RedPacket, 0)
|
||||
|
||||
err = rpcCli.CallWithTimeout("RedPacketService.GetAll", &plt, &res, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("GetRedPacketAll error: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
type UpdateRedPacketAllReq struct {
|
||||
Plt string
|
||||
List []*RedPacket
|
||||
}
|
||||
|
||||
func UpdateRedPacketAll(plt string, list []*RedPacket) error {
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.UpdateRedPacketAll rpcCli == nil")
|
||||
return errors.New("rpc client is nil")
|
||||
}
|
||||
req := &UpdateRedPacketAllReq{
|
||||
Plt: plt,
|
||||
List: list,
|
||||
}
|
||||
res := false
|
||||
|
||||
err := rpcCli.CallWithTimeout("RedPacketService.UpdateAll", req, &res, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("UpdateRedPacketAll error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// BackRedPacket 红包统计数据
|
||||
type BackRedPacket struct {
|
||||
Platform string // 平台
|
||||
Id int32 // 红包活动id
|
||||
SnId int32 // 玩家id
|
||||
ItemId int32 // 道具id
|
||||
ItemNum int64 // 道具数量
|
||||
Ts int64 // 时间戳
|
||||
}
|
||||
|
|
@ -76,6 +76,7 @@ type RegisterHandlerParam struct {
|
|||
}
|
||||
|
||||
// RegisterHandler 注册消息处理函数
|
||||
// 必须在init()函数中调用
|
||||
func (c *MessageMgr) RegisterHandler(param *RegisterHandlerParam) {
|
||||
if param == nil {
|
||||
return
|
||||
|
|
@ -143,6 +144,7 @@ func WriteWithOptions(data interface{}, name string, opts ...broker.PublishOptio
|
|||
}
|
||||
|
||||
// RegisterHandler 注册消息处理函数
|
||||
// 必须在init()函数中调用
|
||||
func RegisterHandler(param *RegisterHandlerParam) {
|
||||
MessageMgrSingle.RegisterHandler(param)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ const (
|
|||
BackSystemJyb = "back_jyblog"
|
||||
BackActivityLog = "back_activitylog"
|
||||
BackOnlineGame = "back_onlinegame"
|
||||
BackRedPacket = "back_redpacket"
|
||||
)
|
||||
|
||||
// go后端
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,117 @@
|
|||
syntax = "proto3";
|
||||
package activity;
|
||||
option go_package = "mongo.games.com/game/protocol/activity";
|
||||
|
||||
enum NianPacketID {
|
||||
PACKET_Nian_ZERO = 0; // 弃用消息号
|
||||
PACKET_CSNianData = 2660; // 获取年兽信息
|
||||
PACKET_SCNianData = 2661; // 返回年兽信息
|
||||
PACKET_CSNianBuff = 2662; // 请求领取BUFF
|
||||
PACKET_SCNianBuff = 2663; // 返回Buff信息
|
||||
PACKET_CSNianRankData = 2664; // 请求排行榜信息
|
||||
PACKET_SCNianRankData = 2665; // 返回排行榜信息
|
||||
PACKET_CSNianAttack = 2666; //请求攻击年兽
|
||||
PACKET_SCNianAttackData = 2667; //返回攻击年兽信息
|
||||
PACKET_CSNianSignAward = 2668; //请求签到
|
||||
PACKET_SCNianSignAward = 2669; //签到返回
|
||||
PACKET_CSNianChange = 2670;//请求兑换小爆竹
|
||||
PACKET_SCNianChange = 2671;//返回兑换道具
|
||||
}
|
||||
//操作结果
|
||||
enum OpResultCode_Nian {
|
||||
OPRC_Sucess_Nian = 0; //成功
|
||||
OPRC_Error_Nian = 1; //失败
|
||||
}
|
||||
|
||||
//获取年兽活动信息
|
||||
//PACKET_CSNianData
|
||||
message CSNianData{
|
||||
}
|
||||
//PACKET_SCNianData
|
||||
message SCNianData{
|
||||
int64 ActivityStartTime = 1; //活动开始时间
|
||||
int64 ActivityEndTime = 2; //活动结束时间
|
||||
int64 BossMaxHp = 3; //Boss最大血量
|
||||
int64 BossHp = 4; //Boss当前血量
|
||||
repeated NianRankData RankData = 5;//排行榜奖励配置
|
||||
int64 AwardTime = 6;//每日签到领取时间
|
||||
int64 BuffCount = 7;//Buff剩余次数
|
||||
bool BuffStatus = 8;//Buff领取状态
|
||||
int64 SignAwardTime = 9;//签到领取时间 0-未领取
|
||||
int64 BuffStartTime = 10; //Buff开始领取时间
|
||||
int64 BuffEndTime = 11; //Buff结束领取时间
|
||||
repeated ShopData shopData = 12;//购买礼包数量
|
||||
string ChangeData = 13; //兑换数据
|
||||
string LuckyRankNeed = 14; //幸运榜上榜条件
|
||||
string RankNeed = 15; //总伤害榜上榜条件
|
||||
int32 Switch = 16; //活动开关 1.开启 2.关闭
|
||||
}
|
||||
|
||||
message ShopData{
|
||||
int32 ShopId =1; //shopId
|
||||
int32 ShopNum = 2; //已购买次数
|
||||
int32 MaxShopNum = 3; //最大购买次数
|
||||
}
|
||||
|
||||
//贺春
|
||||
//请求领取BUFF
|
||||
//PACKET_CSNianBuff
|
||||
message CSNianBuff{
|
||||
}
|
||||
//PACKET_SCNianBuff
|
||||
message SCNianBuff{
|
||||
int64 BuffCount = 1; //BUFF剩余次数
|
||||
OpResultCode_Nian OpRetCode = 2; // 返回错误码
|
||||
}
|
||||
|
||||
message NianRankData{
|
||||
int32 TypeId = 1; //1-幸运榜 2-总榜
|
||||
repeated NianRankInfo Data = 2;
|
||||
}
|
||||
message NianRankInfo{
|
||||
int32 RankId =1;
|
||||
repeated RankAwardData Award = 2;
|
||||
}
|
||||
|
||||
message RankAwardData{
|
||||
int32 ItemId =1;
|
||||
int64 ItemNum = 2;
|
||||
}
|
||||
//攻击年兽
|
||||
//PACKET_CSNianAttack
|
||||
message CSNianAttack{
|
||||
int32 TypeId = 1; //1-小爆竹 2-小爆竹*10 3-大爆竹
|
||||
}
|
||||
//PACKET_SCNianAttackData
|
||||
message SCNianAttackData{
|
||||
int32 TypeId = 1; //1-小爆竹 2-小爆竹*10 3-大爆竹
|
||||
int64 BossHp = 2; //BOSS当前血量
|
||||
repeated RankAwardData Award = 3; //获得道具
|
||||
int64 AttackHp = 4; // 攻击伤害
|
||||
bool IsDie = 5; //BOSS是否死亡
|
||||
repeated RankAwardData DieAward = 6;//BOSS死亡奖励
|
||||
int64 BuffCount = 7; //BUFF剩余次数
|
||||
repeated RankAwardData ExtraDrop = 8;//大爆竹额外掉落
|
||||
repeated RankAwardData FloorReward = 9;//保底奖励
|
||||
}
|
||||
//领取签到奖励
|
||||
//PACKET_CSNianSignAward
|
||||
message CSNianSignAward{
|
||||
}
|
||||
//PACKET_SCNianSignAward
|
||||
message SCNianSignAward{
|
||||
int64 SignAwardTime = 1;
|
||||
repeated RankAwardData SignAward = 2;//签到奖励
|
||||
OpResultCode_Nian OpRetCode = 3; // 返回错误码
|
||||
}
|
||||
//兑换
|
||||
//PACKET_CSNianChange
|
||||
message CSNianChange{
|
||||
int32 Num = 1;
|
||||
}
|
||||
//PACKET_SCNianChange
|
||||
message SCNianChange{
|
||||
int32 Num = 1;
|
||||
repeated RankAwardData Award =2;
|
||||
OpResultCode_Nian OpRetCode = 3; // 返回错误码
|
||||
}
|
||||
|
|
@ -52,6 +52,9 @@ const (
|
|||
// 竞技馆抽奖历史
|
||||
Rank_PACKET_CSLotteryHistory Rank = 10017
|
||||
Rank_PACKET_SCLotteryHistory Rank = 10018
|
||||
//年兽排行榜
|
||||
Rank_PACKET_RANK_CSNian Rank = 10019
|
||||
Rank_PACKET_RANK_SCNian Rank = 10020
|
||||
)
|
||||
|
||||
// Enum value maps for Rank.
|
||||
|
|
@ -77,6 +80,8 @@ var (
|
|||
10016: "PACKET_SCRoomAwardOne",
|
||||
10017: "PACKET_CSLotteryHistory",
|
||||
10018: "PACKET_SCLotteryHistory",
|
||||
10019: "PACKET_RANK_CSNian",
|
||||
10020: "PACKET_RANK_SCNian",
|
||||
}
|
||||
Rank_value = map[string]int32{
|
||||
"PACKET_RANK_ZERO": 0,
|
||||
|
|
@ -99,6 +104,8 @@ var (
|
|||
"PACKET_SCRoomAwardOne": 10016,
|
||||
"PACKET_CSLotteryHistory": 10017,
|
||||
"PACKET_SCLotteryHistory": 10018,
|
||||
"PACKET_RANK_CSNian": 10019,
|
||||
"PACKET_RANK_SCNian": 10020,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -2331,6 +2338,237 @@ func (x *SCLotteryHistory) GetList() []*LotteryHistory {
|
|||
return nil
|
||||
}
|
||||
|
||||
// PACKET_RANK_CSNian
|
||||
type CSNian struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Page int32 `protobuf:"varint,1,opt,name=Page,proto3" json:"Page,omitempty"` // 页数
|
||||
PageSize int32 `protobuf:"varint,2,opt,name=PageSize,proto3" json:"PageSize,omitempty"` // 每页数量
|
||||
TypeId int32 `protobuf:"varint,3,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //1-幸运榜 2-伤害榜
|
||||
}
|
||||
|
||||
func (x *CSNian) Reset() {
|
||||
*x = CSNian{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_rank_rank_proto_msgTypes[30]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CSNian) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CSNian) ProtoMessage() {}
|
||||
|
||||
func (x *CSNian) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_rank_rank_proto_msgTypes[30]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CSNian.ProtoReflect.Descriptor instead.
|
||||
func (*CSNian) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_rank_rank_proto_rawDescGZIP(), []int{30}
|
||||
}
|
||||
|
||||
func (x *CSNian) GetPage() int32 {
|
||||
if x != nil {
|
||||
return x.Page
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CSNian) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CSNian) GetTypeId() int32 {
|
||||
if x != nil {
|
||||
return x.TypeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type NianRankData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"` // 玩家id
|
||||
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` // 昵称
|
||||
Score int64 `protobuf:"varint,3,opt,name=Score,proto3" json:"Score,omitempty"`
|
||||
Rank int32 `protobuf:"varint,4,opt,name=Rank,proto3" json:"Rank,omitempty"` // 排名
|
||||
ModId int32 `protobuf:"varint,5,opt,name=ModId,proto3" json:"ModId,omitempty"` // 角色id
|
||||
}
|
||||
|
||||
func (x *NianRankData) Reset() {
|
||||
*x = NianRankData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_rank_rank_proto_msgTypes[31]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NianRankData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NianRankData) ProtoMessage() {}
|
||||
|
||||
func (x *NianRankData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_rank_rank_proto_msgTypes[31]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NianRankData.ProtoReflect.Descriptor instead.
|
||||
func (*NianRankData) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_rank_rank_proto_rawDescGZIP(), []int{31}
|
||||
}
|
||||
|
||||
func (x *NianRankData) GetSnid() int32 {
|
||||
if x != nil {
|
||||
return x.Snid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NianRankData) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NianRankData) GetScore() int64 {
|
||||
if x != nil {
|
||||
return x.Score
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NianRankData) GetRank() int32 {
|
||||
if x != nil {
|
||||
return x.Rank
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NianRankData) GetModId() int32 {
|
||||
if x != nil {
|
||||
return x.ModId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// PACKET_RANK_SCCoin
|
||||
type SCNian struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Ranks []*NianRankData `protobuf:"bytes,1,rep,name=Ranks,proto3" json:"Ranks,omitempty"` // 排行榜
|
||||
Me *NianRankData `protobuf:"bytes,2,opt,name=Me,proto3" json:"Me,omitempty"` // 玩家自己的排行信息
|
||||
Page int32 `protobuf:"varint,3,opt,name=Page,proto3" json:"Page,omitempty"` // 页数
|
||||
PageSize int32 `protobuf:"varint,4,opt,name=PageSize,proto3" json:"PageSize,omitempty"` // 每页数量
|
||||
Total int32 `protobuf:"varint,5,opt,name=Total,proto3" json:"Total,omitempty"` // 总数量
|
||||
TypeId int32 `protobuf:"varint,6,opt,name=TypeId,proto3" json:"TypeId,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SCNian) Reset() {
|
||||
*x = SCNian{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_rank_rank_proto_msgTypes[32]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCNian) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCNian) ProtoMessage() {}
|
||||
|
||||
func (x *SCNian) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_rank_rank_proto_msgTypes[32]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCNian.ProtoReflect.Descriptor instead.
|
||||
func (*SCNian) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_rank_rank_proto_rawDescGZIP(), []int{32}
|
||||
}
|
||||
|
||||
func (x *SCNian) GetRanks() []*NianRankData {
|
||||
if x != nil {
|
||||
return x.Ranks
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCNian) GetMe() *NianRankData {
|
||||
if x != nil {
|
||||
return x.Me
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCNian) GetPage() int32 {
|
||||
if x != nil {
|
||||
return x.Page
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCNian) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCNian) GetTotal() int32 {
|
||||
if x != nil {
|
||||
return x.Total
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCNian) GetTypeId() int32 {
|
||||
if x != nil {
|
||||
return x.TypeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_protocol_rank_rank_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_protocol_rank_rank_proto_rawDesc = []byte{
|
||||
|
|
@ -2543,53 +2781,80 @@ var file_protocol_rank_rank_proto_rawDesc = []byte{
|
|||
0x43, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12,
|
||||
0x28, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e,
|
||||
0x72, 0x61, 0x6e, 0x6b, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74,
|
||||
0x6f, 0x72, 0x79, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x2a, 0x9e, 0x04, 0x0a, 0x04, 0x52, 0x61,
|
||||
0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e,
|
||||
0x4b, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61,
|
||||
0x74, 0x63, 0x68, 0x10, 0x90, 0x4e, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63,
|
||||
0x68, 0x10, 0x91, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52,
|
||||
0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x92, 0x4e, 0x12, 0x17, 0x0a,
|
||||
0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x43,
|
||||
0x6f, 0x69, 0x6e, 0x10, 0x93, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10, 0x94,
|
||||
0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b,
|
||||
0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10, 0x95, 0x4e, 0x12, 0x17, 0x0a, 0x12,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c,
|
||||
0x6f, 0x67, 0x10, 0x96, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x97, 0x4e, 0x12, 0x1a,
|
||||
0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53,
|
||||
0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x98, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x57, 0x69, 0x6e, 0x43,
|
||||
0x6f, 0x69, 0x6e, 0x10, 0x99, 0x4e, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9a, 0x4e,
|
||||
0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f,
|
||||
0x53, 0x43, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9b, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x50, 0x65, 0x72, 0x6d,
|
||||
0x69, 0x74, 0x10, 0x9c, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x10, 0x9d, 0x4e,
|
||||
0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x52, 0x6f, 0x6f,
|
||||
0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0x9e, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10,
|
||||
0x9f, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x52,
|
||||
0x6f, 0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4f, 0x6e, 0x65, 0x10, 0xa0, 0x4e, 0x12, 0x1c,
|
||||
0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x4c, 0x6f, 0x74, 0x74, 0x65,
|
||||
0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa1, 0x4e, 0x12, 0x1c, 0x0a, 0x17,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79,
|
||||
0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa2, 0x4e, 0x2a, 0x8d, 0x01, 0x0a, 0x0a, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76,
|
||||
0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x14,
|
||||
0x0a, 0x10, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x54, 0x6f, 0x74,
|
||||
0x61, 0x6c, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79,
|
||||
0x70, 0x65, 0x5f, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x6e, 0x76,
|
||||
0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x10, 0x03, 0x12,
|
||||
0x15, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x55, 0x70,
|
||||
0x57, 0x65, 0x65, 0x6b, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65,
|
||||
0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x61, 0x78, 0x10, 0x05, 0x42, 0x24, 0x5a, 0x22, 0x6d, 0x6f,
|
||||
0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61,
|
||||
0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x72, 0x61, 0x6e, 0x6b,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6f, 0x72, 0x79, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x06, 0x43, 0x53, 0x4e,
|
||||
0x69, 0x61, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x04, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53,
|
||||
0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53,
|
||||
0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x22, 0x76, 0x0a, 0x0c, 0x4e,
|
||||
0x69, 0x61, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x53,
|
||||
0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e,
|
||||
0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x61, 0x6e,
|
||||
0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x4d, 0x6f, 0x64, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x4d, 0x6f,
|
||||
0x64, 0x49, 0x64, 0x22, 0xb4, 0x01, 0x0a, 0x06, 0x53, 0x43, 0x4e, 0x69, 0x61, 0x6e, 0x12, 0x28,
|
||||
0x0a, 0x05, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e,
|
||||
0x72, 0x61, 0x6e, 0x6b, 0x2e, 0x4e, 0x69, 0x61, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x44, 0x61, 0x74,
|
||||
0x61, 0x52, 0x05, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x12, 0x22, 0x0a, 0x02, 0x4d, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x2e, 0x4e, 0x69, 0x61, 0x6e,
|
||||
0x52, 0x61, 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x02, 0x4d, 0x65, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x50, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x50, 0x61, 0x67, 0x65,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x54, 0x6f, 0x74,
|
||||
0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x2a, 0xd0, 0x04, 0x0a, 0x04, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41,
|
||||
0x4e, 0x4b, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x52, 0x61, 0x6e, 0x6b, 0x4d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x10, 0x90, 0x4e, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74,
|
||||
0x63, 0x68, 0x10, 0x91, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x92, 0x4e, 0x12, 0x17,
|
||||
0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x10, 0x93, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10,
|
||||
0x94, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e,
|
||||
0x4b, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10, 0x95, 0x4e, 0x12, 0x17, 0x0a,
|
||||
0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65,
|
||||
0x4c, 0x6f, 0x67, 0x10, 0x96, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x97, 0x4e, 0x12,
|
||||
0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43,
|
||||
0x53, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x98, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x57, 0x69, 0x6e,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x10, 0x99, 0x4e, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9a,
|
||||
0x4e, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b,
|
||||
0x5f, 0x53, 0x43, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9b, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x50, 0x65, 0x72,
|
||||
0x6d, 0x69, 0x74, 0x10, 0x9c, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x10, 0x9d,
|
||||
0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x52, 0x6f,
|
||||
0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0x9e, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64,
|
||||
0x10, 0x9f, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||
0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4f, 0x6e, 0x65, 0x10, 0xa0, 0x4e, 0x12,
|
||||
0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x4c, 0x6f, 0x74, 0x74,
|
||||
0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa1, 0x4e, 0x12, 0x1c, 0x0a,
|
||||
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72,
|
||||
0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa2, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x4e, 0x69, 0x61,
|
||||
0x6e, 0x10, 0xa3, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52,
|
||||
0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x4e, 0x69, 0x61, 0x6e, 0x10, 0xa4, 0x4e, 0x2a, 0x8d, 0x01,
|
||||
0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x13, 0x0a, 0x0f,
|
||||
0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4e, 0x6f, 0x6e, 0x65, 0x10,
|
||||
0x00, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f,
|
||||
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x69, 0x74,
|
||||
0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10,
|
||||
0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x6f, 0x6e, 0x74, 0x68,
|
||||
0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65,
|
||||
0x5f, 0x55, 0x70, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x6e, 0x76,
|
||||
0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x61, 0x78, 0x10, 0x05, 0x42, 0x24, 0x5a,
|
||||
0x22, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x72,
|
||||
0x61, 0x6e, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
@ -2605,7 +2870,7 @@ func file_protocol_rank_rank_proto_rawDescGZIP() []byte {
|
|||
}
|
||||
|
||||
var file_protocol_rank_rank_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_protocol_rank_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 30)
|
||||
var file_protocol_rank_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 33)
|
||||
var file_protocol_rank_rank_proto_goTypes = []interface{}{
|
||||
(Rank)(0), // 0: rank.Rank
|
||||
(RankInvite)(0), // 1: rank.RankInvite
|
||||
|
|
@ -2639,6 +2904,9 @@ var file_protocol_rank_rank_proto_goTypes = []interface{}{
|
|||
(*LotteryShow)(nil), // 29: rank.LotteryShow
|
||||
(*LotteryHistory)(nil), // 30: rank.LotteryHistory
|
||||
(*SCLotteryHistory)(nil), // 31: rank.SCLotteryHistory
|
||||
(*CSNian)(nil), // 32: rank.CSNian
|
||||
(*NianRankData)(nil), // 33: rank.NianRankData
|
||||
(*SCNian)(nil), // 34: rank.SCNian
|
||||
}
|
||||
var file_protocol_rank_rank_proto_depIdxs = []int32{
|
||||
3, // 0: rank.SCRankMatch.Ranks:type_name -> rank.SeasonRank
|
||||
|
|
@ -2659,11 +2927,13 @@ var file_protocol_rank_rank_proto_depIdxs = []int32{
|
|||
25, // 15: rank.LotteryHistory.Award:type_name -> rank.Item
|
||||
29, // 16: rank.LotteryHistory.Show:type_name -> rank.LotteryShow
|
||||
30, // 17: rank.SCLotteryHistory.List:type_name -> rank.LotteryHistory
|
||||
18, // [18:18] is the sub-list for method output_type
|
||||
18, // [18:18] is the sub-list for method input_type
|
||||
18, // [18:18] is the sub-list for extension type_name
|
||||
18, // [18:18] is the sub-list for extension extendee
|
||||
0, // [0:18] is the sub-list for field type_name
|
||||
33, // 18: rank.SCNian.Ranks:type_name -> rank.NianRankData
|
||||
33, // 19: rank.SCNian.Me:type_name -> rank.NianRankData
|
||||
20, // [20:20] is the sub-list for method output_type
|
||||
20, // [20:20] is the sub-list for method input_type
|
||||
20, // [20:20] is the sub-list for extension type_name
|
||||
20, // [20:20] is the sub-list for extension extendee
|
||||
0, // [0:20] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_protocol_rank_rank_proto_init() }
|
||||
|
|
@ -3032,6 +3302,42 @@ func file_protocol_rank_rank_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_rank_rank_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CSNian); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_rank_rank_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NianRankData); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_rank_rank_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCNian); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
|
@ -3039,7 +3345,7 @@ func file_protocol_rank_rank_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_protocol_rank_rank_proto_rawDesc,
|
||||
NumEnums: 2,
|
||||
NumMessages: 30,
|
||||
NumMessages: 33,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ enum Rank{
|
|||
// 竞技馆抽奖历史
|
||||
PACKET_CSLotteryHistory = 10017;
|
||||
PACKET_SCLotteryHistory = 10018;
|
||||
//年兽排行榜
|
||||
PACKET_RANK_CSNian = 10019;
|
||||
PACKET_RANK_SCNian = 10020;
|
||||
}
|
||||
|
||||
// 排位榜
|
||||
|
|
@ -270,4 +273,29 @@ message LotteryHistory{
|
|||
// PACKET_SCLotteryHistory
|
||||
message SCLotteryHistory{
|
||||
repeated LotteryHistory List = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// PACKET_RANK_CSNian
|
||||
message CSNian{
|
||||
int32 Page = 1; // 页数
|
||||
int32 PageSize = 2; // 每页数量
|
||||
int32 TypeId = 3; //1-幸运榜 2-伤害榜
|
||||
}
|
||||
|
||||
message NianRankData {
|
||||
int32 Snid = 1; // 玩家id
|
||||
string Name = 2; // 昵称
|
||||
int64 Score = 3;
|
||||
int32 Rank = 4; // 排名
|
||||
int32 ModId = 5; // 角色id
|
||||
}
|
||||
|
||||
// PACKET_RANK_SCCoin
|
||||
message SCNian{
|
||||
repeated NianRankData Ranks = 1; // 排行榜
|
||||
NianRankData Me = 2; // 玩家自己的排行信息
|
||||
int32 Page = 3; // 页数
|
||||
int32 PageSize = 4; // 每页数量
|
||||
int32 Total = 5; // 总数量
|
||||
int32 TypeId = 6;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -659,6 +659,22 @@ message DB_GamMatchLVArray {
|
|||
repeated DB_GamMatchLV Arr = 1;
|
||||
}
|
||||
|
||||
message DB_GameBankruptcy {
|
||||
|
||||
int32 Id = 1;
|
||||
|
||||
string GameName = 2;
|
||||
|
||||
string GameDif = 3;
|
||||
|
||||
int32 LimitNum = 4;
|
||||
|
||||
}
|
||||
|
||||
message DB_GameBankruptcyArray {
|
||||
repeated DB_GameBankruptcy Arr = 1;
|
||||
}
|
||||
|
||||
message DB_GameCoinPool {
|
||||
|
||||
int32 Id = 1;
|
||||
|
|
@ -1247,6 +1263,22 @@ message DB_NewPlayerArray {
|
|||
repeated DB_NewPlayer Arr = 1;
|
||||
}
|
||||
|
||||
message DB_NewYearActivity {
|
||||
|
||||
int32 Id = 1;
|
||||
|
||||
string PorpName = 2;
|
||||
|
||||
string PropValue = 3;
|
||||
|
||||
string PropDec = 4;
|
||||
|
||||
}
|
||||
|
||||
message DB_NewYearActivityArray {
|
||||
repeated DB_NewYearActivity Arr = 1;
|
||||
}
|
||||
|
||||
message DB_PassShow {
|
||||
|
||||
int32 Id = 1;
|
||||
|
|
@ -1333,15 +1365,19 @@ message DB_PigBank_Diamond {
|
|||
|
||||
int32 MaxGold = 5;
|
||||
|
||||
int32 MaxDiamond = 6;
|
||||
map<int64, int64> GoldExc = 6;
|
||||
|
||||
int32 DiamondId = 7;
|
||||
int32 MaxDiamond = 7;
|
||||
|
||||
int32 CoinPrice = 8;
|
||||
int32 DiamondId = 8;
|
||||
|
||||
int32 DiamondPrice = 9;
|
||||
map<int64, int64> DiamondExc = 9;
|
||||
|
||||
int32 DiamondNowPrice = 10;
|
||||
int32 CoinPrice = 10;
|
||||
|
||||
int32 DiamondPrice = 11;
|
||||
|
||||
int32 DiamondNowPrice = 12;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ type CSTaskList struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统 6:赛季通行证任务 8:年兽每日任务 9:年兽活动任务 10:累计消耗任务
|
||||
}
|
||||
|
||||
func (x *CSTaskList) Reset() {
|
||||
|
|
@ -275,8 +275,11 @@ type SCTaskList struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
List []*TaskData `protobuf:"bytes,2,rep,name=List,proto3" json:"List,omitempty"` // 任务列表
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型
|
||||
List []*TaskData `protobuf:"bytes,2,rep,name=List,proto3" json:"List,omitempty"` // 任务列表
|
||||
StartTs int64 `protobuf:"varint,3,opt,name=StartTs,proto3" json:"StartTs,omitempty"` // 开始时间
|
||||
EndTs int64 `protobuf:"varint,4,opt,name=EndTs,proto3" json:"EndTs,omitempty"` // 结束时间
|
||||
On bool `protobuf:"varint,5,opt,name=On,proto3" json:"On,omitempty"` // 活动开关
|
||||
}
|
||||
|
||||
func (x *SCTaskList) Reset() {
|
||||
|
|
@ -325,6 +328,27 @@ func (x *SCTaskList) GetList() []*TaskData {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (x *SCTaskList) GetStartTs() int64 {
|
||||
if x != nil {
|
||||
return x.StartTs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCTaskList) GetEndTs() int64 {
|
||||
if x != nil {
|
||||
return x.EndTs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCTaskList) GetOn() bool {
|
||||
if x != nil {
|
||||
return x.On
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 领取任务奖励
|
||||
// PACKET_CSTaskReward
|
||||
type CSTaskReward struct {
|
||||
|
|
@ -332,7 +356,7 @@ type CSTaskReward struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统 6:赛季通行证任务
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型
|
||||
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` // 任务id; 0 表示一键领取
|
||||
}
|
||||
|
||||
|
|
@ -461,7 +485,7 @@ type SCTaskChange struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型
|
||||
List []*TaskData `protobuf:"bytes,2,rep,name=List,proto3" json:"List,omitempty"` // 任务列表
|
||||
}
|
||||
|
||||
|
|
@ -516,7 +540,7 @@ type CSTaskDebugInc struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型
|
||||
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` // 任务id
|
||||
AddNum int32 `protobuf:"varint,3,opt,name=AddNum,proto3" json:"AddNum,omitempty"` // 直接增加次数
|
||||
}
|
||||
|
|
@ -642,59 +666,63 @@ var file_protocol_task_task_proto_rawDesc = []byte{
|
|||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1c, 0x0a, 0x0a, 0x43, 0x53, 0x54, 0x61,
|
||||
0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x22, 0x40, 0x0a, 0x0a, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x02, 0x54, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61,
|
||||
0x74, 0x61, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x0c, 0x43, 0x53, 0x54, 0x61,
|
||||
0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0xcd, 0x01, 0x0a, 0x0c, 0x53, 0x43, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x4f, 0x70, 0x43,
|
||||
0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x22, 0x80, 0x01, 0x0a, 0x0a, 0x53, 0x43, 0x54, 0x61, 0x73,
|
||||
0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x44,
|
||||
0x61, 0x74, 0x61, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x74, 0x61,
|
||||
0x72, 0x74, 0x54, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x53, 0x74, 0x61, 0x72,
|
||||
0x74, 0x54, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x6e, 0x64, 0x54, 0x73, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x05, 0x45, 0x6e, 0x64, 0x54, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x6e, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x4f, 0x6e, 0x22, 0x2e, 0x0a, 0x0c, 0x43, 0x53, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0xcd, 0x01, 0x0a, 0x0c, 0x53, 0x43,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x4f, 0x70,
|
||||
0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x74, 0x61, 0x73,
|
||||
0x6b, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06,
|
||||
0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64,
|
||||
0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x53, 0x43,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72,
|
||||
0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x39,
|
||||
0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x42, 0x0a, 0x0c, 0x53, 0x43, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x48, 0x0a,
|
||||
0x0e, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x12,
|
||||
0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12,
|
||||
0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x41, 0x64, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x06, 0x41, 0x64, 0x64, 0x4e, 0x75, 0x6d, 0x22, 0x3c, 0x0a, 0x0e, 0x53, 0x43, 0x54, 0x61, 0x73,
|
||||
0x6b, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x12, 0x2a, 0x0a, 0x06, 0x4f, 0x70, 0x43,
|
||||
0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x74, 0x61, 0x73, 0x6b,
|
||||
0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x4f,
|
||||
0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18,
|
||||
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x53, 0x43, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64,
|
||||
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x39, 0x0a,
|
||||
0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x42, 0x0a, 0x0c, 0x53, 0x43, 0x54, 0x61,
|
||||
0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x54, 0x61,
|
||||
0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x0e,
|
||||
0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x12, 0x0e,
|
||||
0x0a, 0x02, 0x54, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e,
|
||||
0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16,
|
||||
0x0a, 0x06, 0x41, 0x64, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
|
||||
0x41, 0x64, 0x64, 0x4e, 0x75, 0x6d, 0x22, 0x3c, 0x0a, 0x0e, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x12, 0x2a, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f,
|
||||
0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e,
|
||||
0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x4f, 0x70,
|
||||
0x43, 0x6f, 0x64, 0x65, 0x2a, 0x30, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
|
||||
0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63,
|
||||
0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45,
|
||||
0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x2a, 0xd2, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x50,
|
||||
0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x16, 0x0a,
|
||||
0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x10, 0xe0, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x53, 0x43, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xe1, 0x12, 0x12, 0x18, 0x0a,
|
||||
0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65,
|
||||
0x77, 0x61, 0x72, 0x64, 0x10, 0xe2, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe3,
|
||||
0x12, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x61,
|
||||
0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10, 0xe4, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63,
|
||||
0x10, 0xe5, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||
0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x10, 0xe6, 0x12, 0x42, 0x24, 0x5a, 0x22, 0x6d,
|
||||
0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67,
|
||||
0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x74, 0x61, 0x73,
|
||||
0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x70, 0x43, 0x6f, 0x64, 0x65, 0x2a, 0x30, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c,
|
||||
0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75,
|
||||
0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f,
|
||||
0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x2a, 0xd2, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x16,
|
||||
0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x10, 0xe0, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xe1, 0x12, 0x12, 0x18,
|
||||
0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x52,
|
||||
0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe2, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10,
|
||||
0xe3, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10, 0xe4, 0x12, 0x12, 0x16, 0x0a, 0x11,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e,
|
||||
0x63, 0x10, 0xe5, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
||||
0x43, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x10, 0xe6, 0x12, 0x42, 0x24, 0x5a, 0x22,
|
||||
0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x74, 0x61,
|
||||
0x73, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -33,18 +33,21 @@ message TaskData{
|
|||
// 任务列表
|
||||
// PACKET_CSTaskList
|
||||
message CSTaskList{
|
||||
int32 Tp = 1; // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
int32 Tp = 1; // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统 6:赛季通行证任务 8:年兽每日任务 9:年兽活动任务 10:累计消耗任务
|
||||
}
|
||||
// PACKET_SCTaskList
|
||||
message SCTaskList{
|
||||
int32 Tp = 1; // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
int32 Tp = 1; // 任务类型
|
||||
repeated TaskData List = 2; // 任务列表
|
||||
int64 StartTs = 3; // 开始时间
|
||||
int64 EndTs = 4; // 结束时间
|
||||
bool On = 5; // 活动开关
|
||||
}
|
||||
|
||||
// 领取任务奖励
|
||||
// PACKET_CSTaskReward
|
||||
message CSTaskReward{
|
||||
int32 Tp = 1; // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统 6:赛季通行证任务
|
||||
int32 Tp = 1; // 任务类型
|
||||
int32 Id = 2; // 任务id; 0 表示一键领取
|
||||
}
|
||||
// PACKET_SCTaskReward
|
||||
|
|
@ -58,12 +61,12 @@ message SCTaskReward{
|
|||
// 任务变更通知
|
||||
// PACKET_SCTaskChange
|
||||
message SCTaskChange{
|
||||
int32 Tp = 1; // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
int32 Tp = 1; // 任务类型
|
||||
repeated TaskData List = 2; // 任务列表
|
||||
}
|
||||
|
||||
message CSTaskDebugInc{
|
||||
int32 Tp = 1; // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
int32 Tp = 1; // 任务类型
|
||||
int32 Id = 2; // 任务id
|
||||
int32 AddNum = 3; // 直接增加次数
|
||||
}
|
||||
|
|
|
|||
|
|
@ -662,6 +662,8 @@ type SCTienLenRoomInfo struct {
|
|||
CostType int32 `protobuf:"varint,37,opt,name=CostType,proto3" json:"CostType,omitempty"` //房卡支付方式 1AA 2房主
|
||||
Voice int32 `protobuf:"varint,38,opt,name=Voice,proto3" json:"Voice,omitempty"` //是否开启语音 1开启
|
||||
Password string `protobuf:"bytes,39,opt,name=Password,proto3" json:"Password,omitempty"` //房间密码
|
||||
// 房卡场配置
|
||||
IsSmallCard bool `protobuf:"varint,40,opt,name=IsSmallCard,proto3" json:"IsSmallCard,omitempty"` //必出最小牌
|
||||
}
|
||||
|
||||
func (x *SCTienLenRoomInfo) Reset() {
|
||||
|
|
@ -948,6 +950,13 @@ func (x *SCTienLenRoomInfo) GetPassword() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (x *SCTienLenRoomInfo) GetIsSmallCard() bool {
|
||||
if x != nil {
|
||||
return x.IsSmallCard
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//房间状态更新
|
||||
type SCTienLenRoomState struct {
|
||||
state protoimpl.MessageState
|
||||
|
|
@ -2140,7 +2149,8 @@ type SCTienLenFirstOpPos struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Pos int32 `protobuf:"varint,1,opt,name=Pos,proto3" json:"Pos,omitempty"` //座位位置
|
||||
Pos int32 `protobuf:"varint,1,opt,name=Pos,proto3" json:"Pos,omitempty"` //座位位置
|
||||
IsSmallCard bool `protobuf:"varint,2,opt,name=IsSmallCard,proto3" json:"IsSmallCard,omitempty"` //必出最小牌
|
||||
}
|
||||
|
||||
func (x *SCTienLenFirstOpPos) Reset() {
|
||||
|
|
@ -2182,6 +2192,13 @@ func (x *SCTienLenFirstOpPos) GetPos() int32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *SCTienLenFirstOpPos) GetIsSmallCard() bool {
|
||||
if x != nil {
|
||||
return x.IsSmallCard
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//PACKET_SCTienLenThinkLongCnt
|
||||
type SCTienLenPlayerThinkLongCnt struct {
|
||||
state protoimpl.MessageState
|
||||
|
|
@ -2608,7 +2625,7 @@ var file_protocol_tienlen_tienlen_proto_rawDesc = []byte{
|
|||
0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c,
|
||||
0x65, 0x76, 0x65, 0x6c, 0x22, 0x23, 0x0a, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x44, 0x65, 0x6c, 0x43,
|
||||
0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||
0x28, 0x05, 0x52, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73, 0x22, 0xfd, 0x08, 0x0a, 0x11, 0x53, 0x43,
|
||||
0x28, 0x05, 0x52, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73, 0x22, 0x9f, 0x09, 0x0a, 0x11, 0x53, 0x43,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74,
|
||||
|
|
@ -2680,262 +2697,267 @@ var file_protocol_tienlen_tienlen_proto_rawDesc = []byte{
|
|||
0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x6f, 0x69, 0x63, 0x65,
|
||||
0x18, 0x26, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x56, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x27, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x42, 0x0a, 0x12, 0x53, 0x43, 0x54,
|
||||
0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
||||
0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18,
|
||||
0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x45, 0x0a,
|
||||
0x11, 0x43, 0x53, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72,
|
||||
0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x70,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x4f, 0x70, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x22, 0x8e, 0x01, 0x0a, 0x11, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c,
|
||||
0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70,
|
||||
0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f,
|
||||
0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x03, 0x52, 0x07, 0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x53, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64,
|
||||
0x12, 0x33, 0x0a, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x4f, 0x70,
|
||||
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x4f, 0x70, 0x52, 0x65,
|
||||
0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x46, 0x0a, 0x14, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c,
|
||||
0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x2e, 0x0a,
|
||||
0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x69,
|
||||
0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61,
|
||||
0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x28, 0x0a,
|
||||
0x14, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72,
|
||||
0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x22, 0x6f, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x49, 0x74,
|
||||
0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16,
|
||||
0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0xb3, 0x02, 0x0a, 0x17, 0x54, 0x69, 0x65,
|
||||
0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x42, 0x69,
|
||||
0x6c, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x61, 0x72, 0x64,
|
||||
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12, 0x18,
|
||||
0x0a, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x47, 0x61, 0x6d, 0x65,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x47, 0x61, 0x6d, 0x65,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x73, 0x57, 0x69, 0x6e, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x49, 0x73, 0x57, 0x69, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x57, 0x69,
|
||||
0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x0c, 0x57, 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1c,
|
||||
0x0a, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08,
|
||||
0x41, 0x64, 0x64, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
|
||||
0x41, 0x64, 0x64, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x49,
|
||||
0x74, 0x65, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x69, 0x65,
|
||||
0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x41, 0x64,
|
||||
0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x69, 0x61, 0x6e, 0x48, 0x75,
|
||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x69, 0x61, 0x6e, 0x48, 0x75, 0x22, 0x4d,
|
||||
0x0a, 0x13, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x47, 0x61, 0x6d, 0x65, 0x42,
|
||||
0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x44, 0x61, 0x74, 0x61, 0x73, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x54,
|
||||
0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x49, 0x73, 0x53,
|
||||
0x6d, 0x61, 0x6c, 0x6c, 0x43, 0x61, 0x72, 0x64, 0x18, 0x28, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b,
|
||||
0x49, 0x73, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x43, 0x61, 0x72, 0x64, 0x22, 0x42, 0x0a, 0x12, 0x53,
|
||||
0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74,
|
||||
0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22,
|
||||
0x45, 0x0a, 0x11, 0x43, 0x53, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79,
|
||||
0x65, 0x72, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x4f,
|
||||
0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x8e, 0x01, 0x0a, 0x11, 0x53, 0x43, 0x54, 0x69, 0x65,
|
||||
0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70,
|
||||
0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18,
|
||||
0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e,
|
||||
0x49, 0x64, 0x12, 0x33, 0x0a, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e,
|
||||
0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x4f, 0x70,
|
||||
0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x46, 0x0a, 0x14, 0x53, 0x43, 0x54, 0x69, 0x65,
|
||||
0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x12,
|
||||
0x2e, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||
0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50,
|
||||
0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22,
|
||||
0x28, 0x0a, 0x14, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79,
|
||||
0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x22, 0x6f, 0x0a, 0x07, 0x41, 0x64, 0x64,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x69,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x41, 0x64, 0x64, 0x69,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0xb3, 0x02, 0x0a, 0x17, 0x54,
|
||||
0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65,
|
||||
0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x05, 0x44, 0x61, 0x74, 0x61, 0x73, 0x22, 0xc4, 0x01,
|
||||
0x0a, 0x18, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x53, 0x6d, 0x61, 0x6c, 0x6c,
|
||||
0x47, 0x61, 0x6d, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x57, 0x69,
|
||||
0x6e, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x57, 0x69, 0x6e, 0x50,
|
||||
0x6f, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x57, 0x69, 0x6e, 0x50, 0x6f, 0x73, 0x43, 0x6f, 0x69, 0x6e,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x57, 0x69, 0x6e, 0x50, 0x6f, 0x73, 0x43, 0x6f,
|
||||
0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x4c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x07, 0x4c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x12, 0x20, 0x0a, 0x0b,
|
||||
0x4c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x0b, 0x4c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x18,
|
||||
0x0a, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x4c, 0x6f, 0x73, 0x65,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x4c, 0x6f, 0x73, 0x65,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x22, 0x5b, 0x0a, 0x0d, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65,
|
||||
0x6e, 0x43, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x49,
|
||||
0x73, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x0b, 0x49, 0x73, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49,
|
||||
0x64, 0x22, 0x88, 0x02, 0x0a, 0x11, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43,
|
||||
0x61, 0x72, 0x64, 0x54, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x06, 0x47, 0x72, 0x61, 0x64, 0x65,
|
||||
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65,
|
||||
0x6e, 0x2e, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x54,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x47, 0x72, 0x61, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
|
||||
0x06, 0x47, 0x72, 0x61, 0x64, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x54,
|
||||
0x6f, 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x54, 0x6f,
|
||||
0x74, 0x61, 0x6c, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x6f, 0x75,
|
||||
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x6f, 0x75,
|
||||
0x74, 0x12, 0x1a, 0x0a, 0x08, 0x4c, 0x6f, 0x73, 0x65, 0x52, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x01, 0x52, 0x08, 0x4c, 0x6f, 0x73, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74,
|
||||
0x61, 0x1a, 0x39, 0x0a, 0x0b, 0x47, 0x72, 0x61, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7f, 0x0a, 0x11,
|
||||
0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x75, 0x72, 0x4f, 0x70, 0x50, 0x6f,
|
||||
0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x61,
|
||||
0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x47, 0x61,
|
||||
0x6d, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x47, 0x61,
|
||||
0x6d, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x73, 0x57, 0x69, 0x6e, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x49, 0x73, 0x57, 0x69, 0x6e, 0x12, 0x22, 0x0a, 0x0c,
|
||||
0x57, 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x0c, 0x57, 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65,
|
||||
0x12, 0x1c, 0x0a, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x07, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1a,
|
||||
0x0a, 0x08, 0x41, 0x64, 0x64, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x08, 0x41, 0x64, 0x64, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x41, 0x64,
|
||||
0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74,
|
||||
0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08,
|
||||
0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x69, 0x61, 0x6e,
|
||||
0x48, 0x75, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x69, 0x61, 0x6e, 0x48, 0x75,
|
||||
0x22, 0x4d, 0x0a, 0x13, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x47, 0x61, 0x6d,
|
||||
0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x44, 0x61, 0x74, 0x61, 0x73,
|
||||
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e,
|
||||
0x2e, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61,
|
||||
0x6d, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x05, 0x44, 0x61, 0x74, 0x61, 0x73, 0x22,
|
||||
0xc4, 0x01, 0x0a, 0x18, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x53, 0x6d, 0x61,
|
||||
0x6c, 0x6c, 0x47, 0x61, 0x6d, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x57, 0x69, 0x6e, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x57, 0x69,
|
||||
0x6e, 0x50, 0x6f, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x57, 0x69, 0x6e, 0x50, 0x6f, 0x73, 0x43, 0x6f,
|
||||
0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x57, 0x69, 0x6e, 0x50, 0x6f, 0x73,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x4c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x12, 0x20,
|
||||
0x0a, 0x0b, 0x4c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x0b, 0x4c, 0x6f, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x43, 0x6f, 0x69, 0x6e,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x4c, 0x6f,
|
||||
0x73, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x4c, 0x6f,
|
||||
0x73, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x22, 0x5b, 0x0a, 0x0d, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e,
|
||||
0x4c, 0x65, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73,
|
||||
0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12, 0x20, 0x0a,
|
||||
0x0b, 0x49, 0x73, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x0b, 0x49, 0x73, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53,
|
||||
0x6e, 0x49, 0x64, 0x22, 0x88, 0x02, 0x0a, 0x11, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65,
|
||||
0x6e, 0x43, 0x61, 0x72, 0x64, 0x54, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x06, 0x47, 0x72, 0x61,
|
||||
0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x74, 0x69, 0x65, 0x6e,
|
||||
0x6c, 0x65, 0x6e, 0x2e, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x61, 0x72,
|
||||
0x64, 0x54, 0x65, 0x73, 0x74, 0x2e, 0x47, 0x72, 0x61, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x52, 0x06, 0x47, 0x72, 0x61, 0x64, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
|
||||
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x6f, 0x74, 0x61, 0x6c,
|
||||
0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x54, 0x6f, 0x74, 0x61, 0x6c,
|
||||
0x6f, 0x75, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x4c, 0x6f, 0x73, 0x65, 0x52, 0x61, 0x74, 0x65, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x4c, 0x6f, 0x73, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44,
|
||||
0x61, 0x74, 0x61, 0x1a, 0x39, 0x0a, 0x0b, 0x47, 0x72, 0x61, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74,
|
||||
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7f,
|
||||
0x0a, 0x11, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x75, 0x72, 0x4f, 0x70,
|
||||
0x50, 0x6f, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x03, 0x50, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x73, 0x4e, 0x65, 0x77, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x49, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x43,
|
||||
0x61, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x43, 0x61, 0x72, 0x64,
|
||||
0x73, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x78, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x07, 0x45, 0x78, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x66,
|
||||
0x6c, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x22,
|
||||
0x3b, 0x0a, 0x19, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x55, 0x70, 0x64, 0x61,
|
||||
0x74, 0x65, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a,
|
||||
0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x0a, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6e, 0x69, 0x64, 0x22, 0x3e, 0x0a, 0x1a,
|
||||
0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41,
|
||||
0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x75,
|
||||
0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0b, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0xcb, 0x07, 0x0a,
|
||||
0x0f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x41, 0x49, 0x44, 0x61, 0x74, 0x61,
|
||||
0x12, 0x19, 0x0a, 0x08, 0x42, 0x6f, 0x6d, 0x62, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x07, 0x42, 0x6f, 0x6d, 0x62, 0x4e, 0x75, 0x6d, 0x12, 0x2f, 0x0a, 0x14, 0x43,
|
||||
0x61, 0x72, 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
|
||||
0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x43, 0x61, 0x72, 0x64, 0x50,
|
||||
0x6c, 0x61, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0b,
|
||||
0x4c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x30, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x09, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x30, 0x12, 0x1e, 0x0a, 0x0b,
|
||||
0x4c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x09, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x31, 0x12, 0x1e, 0x0a, 0x0b,
|
||||
0x4c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x09, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x32, 0x12, 0x1e, 0x0a, 0x0b,
|
||||
0x4c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x33, 0x18, 0x06, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x09, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x33, 0x12, 0x27, 0x0a, 0x10,
|
||||
0x4e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x30,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x4e, 0x75, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x73,
|
||||
0x4c, 0x65, 0x66, 0x74, 0x30, 0x12, 0x27, 0x0a, 0x10, 0x4e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x72,
|
||||
0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x31, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0d, 0x4e, 0x75, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x31, 0x12, 0x27,
|
||||
0x0a, 0x10, 0x4e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74,
|
||||
0x5f, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x4e, 0x75, 0x6d, 0x43, 0x61, 0x72,
|
||||
0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x32, 0x12, 0x27, 0x0a, 0x10, 0x4e, 0x75, 0x6d, 0x5f, 0x63,
|
||||
0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x33, 0x18, 0x0a, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x0d, 0x4e, 0x75, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x33,
|
||||
0x12, 0x28, 0x0a, 0x10, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x5f, 0x63,
|
||||
0x61, 0x72, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x4f, 0x74, 0x68, 0x65,
|
||||
0x72, 0x48, 0x61, 0x6e, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x50, 0x6c,
|
||||
0x61, 0x79, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x30, 0x18, 0x0c, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x0c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x30,
|
||||
0x12, 0x24, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73,
|
||||
0x5f, 0x31, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64,
|
||||
0x43, 0x61, 0x72, 0x64, 0x73, 0x31, 0x12, 0x24, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64,
|
||||
0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x32, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
|
||||
0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x32, 0x12, 0x24, 0x0a, 0x0e,
|
||||
0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x33, 0x18, 0x0f,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x43, 0x61, 0x72, 0x64,
|
||||
0x73, 0x33, 0x12, 0x2a, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x6e,
|
||||
0x64, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x50,
|
||||
0x6c, 0x61, 0x79, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12, 0x27,
|
||||
0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x50,
|
||||
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x49, 0x73, 0x54, 0x69, 0x65,
|
||||
0x6e, 0x4c, 0x65, 0x6e, 0x59, 0x75, 0x6c, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d,
|
||||
0x49, 0x73, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x59, 0x75, 0x6c, 0x65, 0x12, 0x20, 0x0a,
|
||||
0x0b, 0x49, 0x73, 0x46, 0x69, 0x72, 0x73, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x18, 0x13, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x0b, 0x49, 0x73, 0x46, 0x69, 0x72, 0x73, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x12,
|
||||
0x20, 0x0a, 0x0c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x30, 0x18,
|
||||
0x14, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74,
|
||||
0x30, 0x12, 0x20, 0x0a, 0x0c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f,
|
||||
0x31, 0x18, 0x15, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65,
|
||||
0x66, 0x74, 0x31, 0x12, 0x20, 0x0a, 0x0c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66,
|
||||
0x74, 0x5f, 0x32, 0x18, 0x16, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x61, 0x72, 0x64, 0x73,
|
||||
0x4c, 0x65, 0x66, 0x74, 0x32, 0x12, 0x20, 0x0a, 0x0c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c,
|
||||
0x65, 0x66, 0x74, 0x5f, 0x33, 0x18, 0x17, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x61, 0x72,
|
||||
0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x33, 0x12, 0x19, 0x0a, 0x08, 0x4c, 0x61, 0x73, 0x74, 0x5f,
|
||||
0x70, 0x6f, 0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4c, 0x61, 0x73, 0x74, 0x50,
|
||||
0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x73, 0x45, 0x6e, 0x64, 0x18, 0x19, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x05, 0x49, 0x73, 0x45, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x57, 0x69, 0x6e, 0x53,
|
||||
0x6e, 0x69, 0x64, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x57, 0x69, 0x6e, 0x53,
|
||||
0x6e, 0x69, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x73, 0x57, 0x69, 0x6e, 0x18, 0x1b, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x05, 0x49, 0x73, 0x57, 0x69, 0x6e, 0x22, 0x49, 0x0a, 0x13, 0x53, 0x43,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4f, 0x70, 0x50, 0x6f,
|
||||
0x73, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||
0x50, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x73, 0x4e, 0x65, 0x77, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x05, 0x49, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x61, 0x72,
|
||||
0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12,
|
||||
0x18, 0x0a, 0x07, 0x45, 0x78, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x07, 0x45, 0x78, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61,
|
||||
0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x22, 0x3b, 0x0a,
|
||||
0x19, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x61,
|
||||
0x73, 0x74, 0x65, 0x72, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
|
||||
0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6e, 0x69, 0x64, 0x22, 0x3e, 0x0a, 0x1a, 0x53, 0x43,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x64,
|
||||
0x69, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x75, 0x64, 0x69,
|
||||
0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x41,
|
||||
0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0xcb, 0x07, 0x0a, 0x0f, 0x53,
|
||||
0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x41, 0x49, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19,
|
||||
0x0a, 0x08, 0x42, 0x6f, 0x6d, 0x62, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x07, 0x42, 0x6f, 0x6d, 0x62, 0x4e, 0x75, 0x6d, 0x12, 0x2f, 0x0a, 0x14, 0x43, 0x61, 0x72,
|
||||
0x64, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65,
|
||||
0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x43, 0x61, 0x72, 0x64, 0x50, 0x6c, 0x61,
|
||||
0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0b, 0x4c, 0x61,
|
||||
0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x30, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x09, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x30, 0x12, 0x1e, 0x0a, 0x0b, 0x4c, 0x61,
|
||||
0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x09, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x31, 0x12, 0x1e, 0x0a, 0x0b, 0x4c, 0x61,
|
||||
0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x09, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x32, 0x12, 0x1e, 0x0a, 0x0b, 0x4c, 0x61,
|
||||
0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x33, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x09, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x33, 0x12, 0x27, 0x0a, 0x10, 0x4e, 0x75,
|
||||
0x6d, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x30, 0x18, 0x07,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x4e, 0x75, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65,
|
||||
0x66, 0x74, 0x30, 0x12, 0x27, 0x0a, 0x10, 0x4e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73,
|
||||
0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x31, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x4e,
|
||||
0x75, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x31, 0x12, 0x27, 0x0a, 0x10,
|
||||
0x4e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x32,
|
||||
0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x4e, 0x75, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x73,
|
||||
0x4c, 0x65, 0x66, 0x74, 0x32, 0x12, 0x27, 0x0a, 0x10, 0x4e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x72,
|
||||
0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x33, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0d, 0x4e, 0x75, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x33, 0x12, 0x28,
|
||||
0x0a, 0x10, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x5f, 0x63, 0x61, 0x72,
|
||||
0x64, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x48,
|
||||
0x61, 0x6e, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79,
|
||||
0x65, 0x64, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x30, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x0c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x30, 0x12, 0x24,
|
||||
0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x31,
|
||||
0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x43, 0x61,
|
||||
0x72, 0x64, 0x73, 0x31, 0x12, 0x24, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x5f, 0x63,
|
||||
0x61, 0x72, 0x64, 0x73, 0x5f, 0x32, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x50, 0x6c,
|
||||
0x61, 0x79, 0x65, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x32, 0x12, 0x24, 0x0a, 0x0e, 0x50, 0x6c,
|
||||
0x61, 0x79, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x33, 0x18, 0x0f, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x0c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x33,
|
||||
0x12, 0x2a, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x5f,
|
||||
0x63, 0x61, 0x72, 0x64, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x50, 0x6c, 0x61,
|
||||
0x79, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12, 0x27, 0x0a, 0x0f,
|
||||
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18,
|
||||
0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x6f, 0x73,
|
||||
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x49, 0x73, 0x54, 0x69, 0x65, 0x6e, 0x4c,
|
||||
0x65, 0x6e, 0x59, 0x75, 0x6c, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x49, 0x73,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x59, 0x75, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x49,
|
||||
0x73, 0x46, 0x69, 0x72, 0x73, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x0b, 0x49, 0x73, 0x46, 0x69, 0x72, 0x73, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x12, 0x20, 0x0a,
|
||||
0x0c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x30, 0x18, 0x14, 0x20,
|
||||
0x03, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x30, 0x12,
|
||||
0x20, 0x0a, 0x0c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x31, 0x18,
|
||||
0x15, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74,
|
||||
0x31, 0x12, 0x20, 0x0a, 0x0c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x5f,
|
||||
0x32, 0x18, 0x16, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x61, 0x72, 0x64, 0x73, 0x4c, 0x65,
|
||||
0x66, 0x74, 0x32, 0x12, 0x20, 0x0a, 0x0c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66,
|
||||
0x74, 0x5f, 0x33, 0x18, 0x17, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x61, 0x72, 0x64, 0x73,
|
||||
0x4c, 0x65, 0x66, 0x74, 0x33, 0x12, 0x19, 0x0a, 0x08, 0x4c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x6f,
|
||||
0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4c, 0x61, 0x73, 0x74, 0x50, 0x6f, 0x73,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x49, 0x73, 0x45, 0x6e, 0x64, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x05, 0x49, 0x73, 0x45, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x57, 0x69, 0x6e, 0x53, 0x6e, 0x69,
|
||||
0x64, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x57, 0x69, 0x6e, 0x53, 0x6e, 0x69,
|
||||
0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x73, 0x57, 0x69, 0x6e, 0x18, 0x1b, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x05, 0x49, 0x73, 0x57, 0x69, 0x6e, 0x22, 0x27, 0x0a, 0x13, 0x53, 0x43, 0x54, 0x69,
|
||||
0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4f, 0x70, 0x50, 0x6f, 0x73, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f,
|
||||
0x73, 0x22, 0x41, 0x0a, 0x1b, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c,
|
||||
0x61, 0x79, 0x65, 0x72, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x4c, 0x6f, 0x6e, 0x67, 0x43, 0x6e, 0x74,
|
||||
0x12, 0x22, 0x0a, 0x0c, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x4c, 0x6f, 0x6e, 0x67, 0x43, 0x6e, 0x74,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x4c, 0x6f, 0x6e,
|
||||
0x67, 0x43, 0x6e, 0x74, 0x22, 0x68, 0x0a, 0x20, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65,
|
||||
0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x69, 0x72, 0x73, 0x74, 0x47, 0x69, 0x76, 0x65,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64,
|
||||
0x12, 0x2c, 0x0a, 0x11, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x63, 0x45, 0x78, 0x70, 0x69, 0x72,
|
||||
0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x52, 0x65, 0x63, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x5e,
|
||||
0x0a, 0x14, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x65, 0x74, 0x53, 0x6b,
|
||||
0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f,
|
||||
0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x12, 0x20, 0x0a, 0x0b,
|
||||
0x50, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x0b, 0x50, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x2c,
|
||||
0x0a, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75,
|
||||
0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, 0xab, 0x01, 0x0a,
|
||||
0x16, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x42, 0x69, 0x6c,
|
||||
0x6c, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x52,
|
||||
0x6f, 0x75, 0x6e, 0x64, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52,
|
||||
0x0a, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53,
|
||||
0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x12, 0x27, 0x0a, 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x11, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49,
|
||||
0x6e, 0x66, 0x6f, 0x52, 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x54, 0x6f,
|
||||
0x74, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a,
|
||||
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x4b, 0x0a, 0x14, 0x53, 0x43,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x42, 0x69, 0x6c, 0x6c,
|
||||
0x65, 0x64, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x1f, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x54, 0x69, 0x65, 0x6e, 0x4c,
|
||||
0x65, 0x6e, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x2a, 0x3e, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73,
|
||||
0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f,
|
||||
0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43,
|
||||
0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4f, 0x50, 0x52, 0x43,
|
||||
0x5f, 0x48, 0x69, 0x6e, 0x74, 0x10, 0x02, 0x2a, 0xa2, 0x05, 0x0a, 0x0f, 0x54, 0x69, 0x65, 0x6e,
|
||||
0x4c, 0x65, 0x6e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x12, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x5a, 0x45, 0x52,
|
||||
0x4f, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x10,
|
||||
0xfa, 0x29, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54,
|
||||
0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x10,
|
||||
0xfb, 0x29, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54,
|
||||
0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xfc,
|
||||
0x29, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69,
|
||||
0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xfd, 0x29,
|
||||
0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65,
|
||||
0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10,
|
||||
0xfe, 0x29, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54,
|
||||
0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76,
|
||||
0x65, 0x10, 0xff, 0x29, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
||||
0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x10, 0x80, 0x2a, 0x12,
|
||||
0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e,
|
||||
0x4c, 0x65, 0x6e, 0x47, 0x61, 0x6d, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x10, 0x81, 0x2a,
|
||||
0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65,
|
||||
0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x75, 0x72, 0x4f, 0x70, 0x50, 0x6f, 0x73, 0x10, 0x82, 0x2a, 0x12,
|
||||
0x24, 0x0a, 0x1f, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e,
|
||||
0x4c, 0x65, 0x6e, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x47, 0x61, 0x6d, 0x65, 0x42, 0x69, 0x6c, 0x6c,
|
||||
0x65, 0x64, 0x10, 0x83, 0x2a, 0x12, 0x25, 0x0a, 0x20, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d,
|
||||
0x61, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6e, 0x69, 0x64, 0x10, 0x84, 0x2a, 0x12, 0x26, 0x0a, 0x21,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e,
|
||||
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75,
|
||||
0x6d, 0x10, 0x85, 0x2a, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
||||
0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x41, 0x49, 0x10, 0x86, 0x2a, 0x12, 0x1f, 0x0a,
|
||||
0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65,
|
||||
0x6e, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4f, 0x70, 0x50, 0x6f, 0x73, 0x10, 0x87, 0x2a, 0x12, 0x1d,
|
||||
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c,
|
||||
0x65, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x54, 0x65, 0x73, 0x74, 0x10, 0x88, 0x2a, 0x12, 0x21, 0x0a,
|
||||
0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65,
|
||||
0x6e, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x4c, 0x6f, 0x6e, 0x67, 0x43, 0x6e, 0x74, 0x10, 0x89, 0x2a,
|
||||
0x50, 0x6f, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x49, 0x73, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x43, 0x61,
|
||||
0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x49, 0x73, 0x53, 0x6d, 0x61, 0x6c,
|
||||
0x6c, 0x43, 0x61, 0x72, 0x64, 0x22, 0x41, 0x0a, 0x1b, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c,
|
||||
0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x4c, 0x6f, 0x6e,
|
||||
0x67, 0x43, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x4c, 0x6f, 0x6e,
|
||||
0x67, 0x43, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x54, 0x68, 0x69, 0x6e,
|
||||
0x6b, 0x4c, 0x6f, 0x6e, 0x67, 0x43, 0x6e, 0x74, 0x22, 0x68, 0x0a, 0x20, 0x53, 0x43, 0x54, 0x69,
|
||||
0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x69, 0x72, 0x73, 0x74,
|
||||
0x47, 0x69, 0x76, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74,
|
||||
0x65, 0x6d, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x63, 0x45,
|
||||
0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x11, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x63, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69,
|
||||
0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x14, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50,
|
||||
0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e,
|
||||
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73,
|
||||
0x12, 0x20, 0x0a, 0x0b, 0x50, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x50, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52,
|
||||
0x65, 0x73, 0x22, 0x2c, 0x0a, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e,
|
||||
0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x4e, 0x75, 0x6d,
|
||||
0x22, 0xab, 0x01, 0x0a, 0x16, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x79, 0x63, 0x6c,
|
||||
0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x53,
|
||||
0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12,
|
||||
0x1e, 0x0a, 0x0a, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x03, 0x52, 0x0a, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
|
||||
0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x49,
|
||||
0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e,
|
||||
0x0a, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x4b,
|
||||
0x0a, 0x14, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x79, 0x63, 0x6c, 0x65,
|
||||
0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x2e, 0x54,
|
||||
0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65,
|
||||
0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x2a, 0x3e, 0x0a, 0x0c, 0x4f,
|
||||
0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f,
|
||||
0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a,
|
||||
0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09,
|
||||
0x4f, 0x50, 0x52, 0x43, 0x5f, 0x48, 0x69, 0x6e, 0x74, 0x10, 0x02, 0x2a, 0xa2, 0x05, 0x0a, 0x0f,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12,
|
||||
0x16, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65,
|
||||
0x6e, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49,
|
||||
0x6e, 0x66, 0x6f, 0x10, 0xfa, 0x29, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74,
|
||||
0x61, 0x74, 0x65, 0x10, 0xfb, 0x29, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x43, 0x53, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72,
|
||||
0x4f, 0x70, 0x10, 0xfc, 0x29, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f,
|
||||
0x70, 0x10, 0xfd, 0x29, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
||||
0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e,
|
||||
0x74, 0x65, 0x72, 0x10, 0xfe, 0x29, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72,
|
||||
0x4c, 0x65, 0x61, 0x76, 0x65, 0x10, 0xff, 0x29, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x61, 0x72, 0x64,
|
||||
0x10, 0x80, 0x2a, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x47, 0x61, 0x6d, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65,
|
||||
0x64, 0x10, 0x81, 0x2a, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
||||
0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x75, 0x72, 0x4f, 0x70, 0x50, 0x6f, 0x73,
|
||||
0x10, 0x82, 0x2a, 0x12, 0x24, 0x0a, 0x1f, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||
0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x47, 0x61, 0x6d, 0x65,
|
||||
0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x10, 0x83, 0x2a, 0x12, 0x25, 0x0a, 0x20, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x55, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6e, 0x69, 0x64, 0x10, 0x84, 0x2a,
|
||||
0x12, 0x26, 0x0a, 0x21, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65,
|
||||
0x6e, 0x4c, 0x65, 0x6e, 0x46, 0x69, 0x72, 0x73, 0x74, 0x47, 0x69, 0x76, 0x65, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x49, 0x74, 0x65, 0x6d, 0x10, 0x8a, 0x2a, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x50, 0x65, 0x74, 0x53,
|
||||
0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x10, 0x8b, 0x2a, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x79,
|
||||
0x63, 0x6c, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x10, 0x8c, 0x2a, 0x42, 0x27, 0x5a, 0x25,
|
||||
0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x74, 0x69,
|
||||
0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6e, 0x4c, 0x65, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e,
|
||||
0x63, 0x65, 0x4e, 0x75, 0x6d, 0x10, 0x85, 0x2a, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x41, 0x49, 0x10, 0x86,
|
||||
0x2a, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69,
|
||||
0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4f, 0x70, 0x50, 0x6f, 0x73, 0x10,
|
||||
0x87, 0x2a, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54,
|
||||
0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x54, 0x65, 0x73, 0x74, 0x10, 0x88,
|
||||
0x2a, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69,
|
||||
0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x4c, 0x6f, 0x6e, 0x67, 0x43, 0x6e,
|
||||
0x74, 0x10, 0x89, 0x2a, 0x12, 0x26, 0x0a, 0x21, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
||||
0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e, 0x46, 0x69, 0x72, 0x73, 0x74, 0x47, 0x69, 0x76,
|
||||
0x65, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x74, 0x65, 0x6d, 0x10, 0x8a, 0x2a, 0x12, 0x20, 0x0a, 0x1b,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c, 0x65, 0x6e,
|
||||
0x50, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x10, 0x8b, 0x2a, 0x12, 0x20,
|
||||
0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x69, 0x65, 0x6e, 0x4c,
|
||||
0x65, 0x6e, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x10, 0x8c, 0x2a,
|
||||
0x42, 0x27, 0x5a, 0x25, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
|
||||
0x6c, 0x2f, 0x74, 0x69, 0x65, 0x6e, 0x6c, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ message SCTienLenRoomInfo {
|
|||
int32 Voice = 38; //是否开启语音 1开启
|
||||
string Password = 39; //房间密码
|
||||
// 房卡场配置
|
||||
bool IsSmallCard = 40; //必出最小牌
|
||||
}
|
||||
|
||||
//房间状态更新
|
||||
|
|
@ -257,6 +258,7 @@ message SCTienLenAIData {
|
|||
//PACKET_SCTienLenFirstOpPos
|
||||
message SCTienLenFirstOpPos {
|
||||
int32 Pos = 1;//座位位置
|
||||
bool IsSmallCard = 2; //必出最小牌
|
||||
}
|
||||
|
||||
//PACKET_SCTienLenThinkLongCnt
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1046,4 +1046,124 @@ message UserLottery{
|
|||
string Time = 4; // 抽奖时间 2006-01-02 15:04:05
|
||||
int64 Num = 5; // 第几期
|
||||
int32 On = 6; // 开关 1开启 2关闭
|
||||
}
|
||||
|
||||
message PigBankDiamondInfo {
|
||||
|
||||
int32 Id = 1;
|
||||
|
||||
int32 BuyCountMin = 2;
|
||||
|
||||
int32 BuyCountMax = 3;
|
||||
|
||||
int32 CostDiamond = 4;
|
||||
|
||||
int32 MaxGold = 5;
|
||||
|
||||
int32 MaxDiamond = 6;
|
||||
|
||||
int32 DiamondId = 7;
|
||||
|
||||
int32 CoinPrice = 8;
|
||||
|
||||
int32 DiamondPrice = 9;
|
||||
|
||||
int32 DiamondNowPrice = 10;
|
||||
|
||||
repeated ItemInfo GoldExc = 11;
|
||||
|
||||
repeated ItemInfo DiamondExc = 12;
|
||||
}
|
||||
|
||||
// etcd /game/pigbank_diamond
|
||||
message GamePigBankDiamondConfig{
|
||||
string Platform = 1; // 平台
|
||||
repeated PigBankDiamondInfo DiamondInfo = 2; // 存钱罐消耗信息
|
||||
}
|
||||
|
||||
|
||||
message PigBankPropInfo {
|
||||
|
||||
int32 Id = 1;
|
||||
|
||||
string PorpName = 2;
|
||||
|
||||
int32 PropValue = 3;
|
||||
|
||||
}
|
||||
|
||||
// etcd /game/pigbank_prop
|
||||
message GamePigBankPropConfig{
|
||||
string Platform = 1; // 平台
|
||||
repeated PigBankPropInfo PropInfo = 2; // 存钱罐属性
|
||||
}
|
||||
//etcd /game/activity_nian
|
||||
message ActivityNianConfig {
|
||||
string Platform = 1; // 平台
|
||||
repeated NianInfo List = 2;
|
||||
int32 Switch = 3; // 活动开关 1.开启 2.关闭
|
||||
}
|
||||
|
||||
message NianInfo{
|
||||
string ActivityStart = 1; // 活动开始时间
|
||||
string ActivityEnd = 2; // 活动结束时间
|
||||
int64 BuffStartTime = 3; //Buff领取开始时间 18
|
||||
int64 BuffEndTime = 4; //Buff领取结束时间 21
|
||||
repeated ItemInfo SignReward = 5; // 签到奖励
|
||||
repeated ItemInfo BossDieReward = 6; // 击杀BOSS奖励
|
||||
repeated NianDropInfo BossDieOtherReward = 7; // 击杀Boss额外奖励
|
||||
}
|
||||
message NianDropInfo{
|
||||
int32 Id = 1;
|
||||
int32 ItemId = 2; // 物品ID
|
||||
int64 ItemNum = 3; // 物品数量
|
||||
int32 DropRate = 4;//掉落概率
|
||||
int32 DropUp = 5;//掉落上限
|
||||
}
|
||||
//年兽排行榜奖励
|
||||
//etcd /game/activity_nian_rank
|
||||
message NianRankReward{
|
||||
string Platform = 1; // 平台
|
||||
repeated NianRankData RankData = 2;
|
||||
}
|
||||
message NianRankData{
|
||||
int32 TypeId = 1; //1-幸运榜 2-伤害榜
|
||||
repeated NianRankAwardInfo RankInfo = 2;
|
||||
}
|
||||
message NianRankAwardInfo{
|
||||
int32 RankId =1;//排名
|
||||
repeated ItemInfo Award = 2; //奖励
|
||||
}
|
||||
|
||||
// etcd /game/act_redpacket
|
||||
message RedPacketConfig{
|
||||
string Platform = 1; // 平台
|
||||
repeated RedPacketInfo List = 2; // 活动列表
|
||||
int32 PlayerLimit = 3; // 玩家最大领取红包次数 0无限制
|
||||
}
|
||||
|
||||
message RedPacketInfo{
|
||||
int64 Id = 1; // 配置id
|
||||
int32 On = 2; // 开关 1开启 2关闭
|
||||
int64 StartHMS = 3; // 开始时间,时*10000 + 分*100 + 秒
|
||||
int64 EndHMS = 4; // 结束时间,时*10000 + 分*100 + 秒
|
||||
int64 StayTs = 5; // 持续时长,单位秒
|
||||
int64 MaxCount = 6; // 每人最大领取次数 0无限制
|
||||
int64 LessCount = 7; // 保底红包个数
|
||||
int32 ItemId = 8; // 奖励类型(道具id,100001金币 100002钻石)
|
||||
int64 TotalNum = 9; // 总奖励数量
|
||||
repeated RedInfo RedList = 10; // 红包奖励列表
|
||||
}
|
||||
|
||||
message RedInfo{
|
||||
int64 Num = 1; // 数量
|
||||
int64 Rate = 2; // 概率,百分比
|
||||
}
|
||||
|
||||
// etcd /game/act_consume
|
||||
message ConsumeConfig{
|
||||
string Platform = 1; // 平台
|
||||
int32 On = 2; // 活动开关 1.开启 2.关闭
|
||||
string StartTime = 3; // 活动开始时间
|
||||
string EndTime = 4; // 活动结束时间
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -84,6 +84,12 @@ enum SPacketID {
|
|||
PACKET_SCLotteryInfo = 2927; // 抽奖信息
|
||||
PACKET_NotifyLotteryAward = 2928; // 通知抽奖中奖
|
||||
PACKET_NotifyLotteryCode = 2929; // 通知获得抽奖号码
|
||||
|
||||
PACKET_CSRedPacketInfo = 2930; // 红包信息
|
||||
PACKET_SCRedPacketInfo = 2931; // 红包信息
|
||||
|
||||
PACKET_CSRedPacketDraw = 2932; // 抽红包
|
||||
PACKET_SCRedPacketDraw = 2933; // 抽红包
|
||||
}
|
||||
|
||||
//救济金领取
|
||||
|
|
@ -336,6 +342,17 @@ message SCBindInvite{
|
|||
OpResultCode OpRetCode = 1; //结果
|
||||
}
|
||||
|
||||
|
||||
message PigBankCoinInfo{
|
||||
int32 IndexId = 1;
|
||||
int64 TakeCoin = 2; //
|
||||
int64 BankMaxCoin = 3; // 存钱罐最大储存值
|
||||
int32 DayBuyMaxCnt = 4; // 今日最大可购买次数
|
||||
int64 Price = 5; //原价
|
||||
int64 CostDiamond = 6; //现价
|
||||
map<int64, int64> GoldExc = 7; // 奖励道具
|
||||
}
|
||||
|
||||
// 存钱罐信息
|
||||
//PACKET_CSPigbankGetInfo
|
||||
message CSPigbankGetInfo{
|
||||
|
|
@ -347,13 +364,9 @@ message SCPigbankGetInfo{
|
|||
OpResultCode OpRetCode = 1; //结果
|
||||
int64 BankCoin = 2; // 当前已存金额
|
||||
int32 TakeTimes = 3; // 领取次数
|
||||
int64 CostDiamond = 4; // 耗费钻石
|
||||
int64 BankMaxCoin = 5; // 存钱罐最储存值
|
||||
int32 DayBuyMaxCnt = 6; // 今日最大可购买次数
|
||||
int64 Price = 7; //消耗钻石原价
|
||||
repeated PigBankCoinInfo infoArr = 4;
|
||||
}
|
||||
|
||||
|
||||
// 存钱罐领取金币
|
||||
//PACKET_CSPigbankTakeCoin
|
||||
message CSPigbankTakeCoin{
|
||||
|
|
@ -365,10 +378,7 @@ message SCPigbankTakeCoin{
|
|||
OpResultCode OpRetCode = 1; // 结果
|
||||
int64 TakeCoinNum = 2; // 领取金币数量
|
||||
int32 TakeTimes = 3; // 领取次数
|
||||
int64 CostDiamond = 4; // 耗费钻石
|
||||
int64 BankMaxCoin = 5; // 存钱罐最储存值
|
||||
int32 DayBuyMaxCnt = 6; // 今日最大可购买次数
|
||||
int64 Price = 7; //消耗钻石原价
|
||||
repeated PropInfo RewardItems = 4;
|
||||
}
|
||||
|
||||
// 钻石存钱罐信息
|
||||
|
|
@ -376,17 +386,24 @@ message SCPigbankTakeCoin{
|
|||
message CSDiamondBankGetInfo{
|
||||
}
|
||||
|
||||
message PigBankDiamondInfo{
|
||||
int32 IndexId = 1;
|
||||
double TakeDiamond = 2; //
|
||||
int64 BankMaxDiamond = 3; // 存钱罐最大储存值
|
||||
int32 DayBuyMaxCnt = 4; // 今日最大可购买次数
|
||||
int64 Price = 5; //原价
|
||||
int64 NowPrice = 6; //现价
|
||||
int32 ShopId = 7; //商城ID
|
||||
map<int64, int64> DiamondExc = 8;
|
||||
}
|
||||
|
||||
// 钻石存钱罐信息
|
||||
//PACKET_SCDiamondBankGetInfo
|
||||
message SCDiamondBankGetInfo{
|
||||
OpResultCode OpRetCode = 1; //结果
|
||||
double BankDiamond = 2; // 当前已存钻石
|
||||
int32 TakeTimes = 3; // 领取次数
|
||||
int64 BankMaxCoin = 4; // 存钱罐最大储存值
|
||||
int32 DayBuyMaxCnt = 5; // 今日最大可购买次数
|
||||
int64 Price = 6; //原价
|
||||
int64 NowPrice = 7; //现价
|
||||
int32 ShopId = 8; //商城ID
|
||||
repeated PigBankDiamondInfo infoArr = 4; // 奖励道具
|
||||
}
|
||||
// 钻石存钱罐领取金币
|
||||
//PACKET_SCDiamondBankTakeDiamond
|
||||
|
|
@ -394,11 +411,7 @@ message SCDiamondBankTakeDiamond{
|
|||
OpResultCode OpRetCode = 1; // 结果
|
||||
double TakeDiamondNum = 2; // 领取钻石数量
|
||||
int32 TakeTimes = 3; // 领取次数
|
||||
int64 BankMaxDiamond = 4; // 存钱罐最大储存值
|
||||
int32 DayBuyMaxCnt = 5; // 今日最大可购买次数
|
||||
int64 Price = 6; //原价
|
||||
int64 NowPrice = 7; //现价
|
||||
int32 ShopId = 8; //商城ID
|
||||
//repeated PropInfo RewardItems = 4;
|
||||
}
|
||||
|
||||
// 赛季通行证信息
|
||||
|
|
@ -549,4 +562,34 @@ message NotifyLotteryAward{
|
|||
//PACKET_NotifyLotteryCode
|
||||
message NotifyLotteryCode{
|
||||
repeated LotteryInfo Info = 1;
|
||||
}
|
||||
|
||||
// 红包信息
|
||||
//PACKET_CSRedPacketInfo
|
||||
message CSRedPacketInfo{
|
||||
}
|
||||
//PACKET_SCRedPacketInfo
|
||||
message SCRedPacketInfo{
|
||||
repeated RedPacketInfo Info = 1; // 红包信息
|
||||
}
|
||||
message RedPacketInfo{
|
||||
int64 Id = 1; // id
|
||||
int64 StartTs = 2; // 开始时间
|
||||
int64 EndTs = 3; // 结束时间
|
||||
int64 StayTs = 4; // 持续时长,单位秒;0代表不限制
|
||||
int64 RemainCount = 5; // 剩余次数;-1代表不限制
|
||||
bool IsJoin = 6; // 是否参与过
|
||||
}
|
||||
|
||||
// 抽红包
|
||||
//PACKET_CSRedPacketDraw
|
||||
message CSRedPacketDraw{
|
||||
int64 Id = 1; // 活动id RedPacketInfo.Id 0表示参与过当前的抽奖活动了
|
||||
}
|
||||
//PACKET_SCRedPacketDraw
|
||||
message SCRedPacketDraw{
|
||||
OpResultCode OpRetCode = 1; // 错误码
|
||||
int64 Id = 2; // id
|
||||
repeated PropInfo Award = 3; // 奖励
|
||||
int64 RemainCount = 4; // 剩余次数;-1代表不限制
|
||||
}
|
||||
|
|
@ -32,6 +32,8 @@ func init() {
|
|||
com.Register(int(rankproto.Rank_PACKET_CSRoomAward), rankproto.CSRoomAward{}, CSRoomAward)
|
||||
// 竞技馆获奖记录
|
||||
com.Register(int(rankproto.Rank_PACKET_CSLotteryHistory), rankproto.CSLotteryHistory{}, CSLotteryHistory)
|
||||
//年兽排行榜
|
||||
com.Register(int(rankproto.Rank_PACKET_RANK_CSNian), rankproto.CSNian{}, CSNian)
|
||||
}
|
||||
|
||||
func CSRankMatch(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data interface{}, sid int64) error {
|
||||
|
|
@ -646,3 +648,138 @@ func CSLotteryHistory(s *netlib.Session, d *rankproto.GateTransmit, packetId int
|
|||
})
|
||||
return nil
|
||||
}
|
||||
func CSNian(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data interface{}, sid int64) error {
|
||||
logger.Logger.Trace("CSNian data:", data)
|
||||
msg, ok := data.(*rankproto.CSNian)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
if msg.TypeId == 1 {
|
||||
rank.NianLuckMgrInstance.Take(d.Platform, 0, func(list []*model.NianInfo, err error) {
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("CSNian error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
page := msg.GetPage()
|
||||
if page < 0 {
|
||||
page = 0
|
||||
}
|
||||
pageSize := msg.GetPageSize()
|
||||
if pageSize < 1 {
|
||||
pageSize = 10
|
||||
}
|
||||
|
||||
start := page * pageSize
|
||||
end := start + pageSize
|
||||
if end >= int32(len(list)) {
|
||||
end = int32(len(list))
|
||||
}
|
||||
|
||||
var i int32
|
||||
var ranks []*rankproto.NianRankData
|
||||
if end > start && int(start) < len(list) {
|
||||
for _, v := range list[start:end] {
|
||||
r := &rankproto.NianRankData{
|
||||
Snid: v.SnId,
|
||||
Name: v.Name,
|
||||
Score: v.Luck,
|
||||
Rank: start + i,
|
||||
ModId: v.ModId,
|
||||
}
|
||||
ranks = append(ranks, r)
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
var me *rankproto.NianRankData
|
||||
for k, v := range list {
|
||||
if v.SnId == d.Snid {
|
||||
me = &rankproto.NianRankData{
|
||||
Snid: v.SnId,
|
||||
Name: v.Name,
|
||||
Score: v.Luck,
|
||||
Rank: int32(k),
|
||||
ModId: v.ModId,
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
pack := &rankproto.SCNian{
|
||||
Ranks: ranks,
|
||||
Me: me,
|
||||
Page: page,
|
||||
PageSize: pageSize,
|
||||
Total: int32(len(list)),
|
||||
}
|
||||
pack.TypeId = msg.TypeId
|
||||
common.SendToGate(sid, int(rankproto.Rank_PACKET_RANK_SCNian), pack, s)
|
||||
logger.Logger.Tracef("SCNian: %v", pack)
|
||||
})
|
||||
} else if msg.TypeId == 2 {
|
||||
rank.NianDamageMgrInstance.Take(d.Platform, 0, func(list []*model.NianInfo, err error) {
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("CSNian error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
page := msg.GetPage()
|
||||
if page < 0 {
|
||||
page = 0
|
||||
}
|
||||
pageSize := msg.GetPageSize()
|
||||
if pageSize < 1 {
|
||||
pageSize = 10
|
||||
}
|
||||
|
||||
start := page * pageSize
|
||||
end := start + pageSize
|
||||
if end >= int32(len(list)) {
|
||||
end = int32(len(list))
|
||||
}
|
||||
|
||||
var i int32
|
||||
var ranks []*rankproto.NianRankData
|
||||
if end > start && int(start) < len(list) {
|
||||
for _, v := range list[start:end] {
|
||||
r := &rankproto.NianRankData{
|
||||
Snid: v.SnId,
|
||||
Name: v.Name,
|
||||
Score: v.Damage,
|
||||
Rank: start + i,
|
||||
ModId: v.ModId,
|
||||
}
|
||||
ranks = append(ranks, r)
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
var me *rankproto.NianRankData
|
||||
for k, v := range list {
|
||||
if v.SnId == d.Snid {
|
||||
me = &rankproto.NianRankData{
|
||||
Snid: v.SnId,
|
||||
Name: v.Name,
|
||||
Score: v.Damage,
|
||||
Rank: int32(k),
|
||||
ModId: v.ModId,
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
pack := &rankproto.SCNian{
|
||||
Ranks: ranks,
|
||||
Me: me,
|
||||
Page: page,
|
||||
PageSize: pageSize,
|
||||
Total: int32(len(list)),
|
||||
}
|
||||
pack.TypeId = msg.TypeId
|
||||
common.SendToGate(sid, int(rankproto.Rank_PACKET_RANK_SCNian), pack, s)
|
||||
logger.Logger.Tracef("SCCoin: %v", pack)
|
||||
})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package rank
|
||||
|
||||
import (
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/ranksrv/com"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
)
|
||||
|
||||
var NianDamageMgrInstance = com.NewListMgr[*model.NianInfo](
|
||||
func() int64 {
|
||||
return int64(model.GameParamData.RankTimeout)
|
||||
},
|
||||
func(platform string, index int32) ([]*model.NianInfo, error) {
|
||||
logger.Logger.Tracef("load rank nian luck platform:%s", platform)
|
||||
list, err := model.FindDamageNianRankList(&model.FindNianListArgs{
|
||||
Platform: platform,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return list.List, nil
|
||||
})
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package rank
|
||||
|
||||
import (
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/ranksrv/com"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
)
|
||||
|
||||
var NianLuckMgrInstance = com.NewListMgr[*model.NianInfo](
|
||||
func() int64 {
|
||||
return int64(model.GameParamData.RankTimeout)
|
||||
},
|
||||
func(platform string, index int32) ([]*model.NianInfo, error) {
|
||||
logger.Logger.Tracef("load rank nian luck platform:%s", platform)
|
||||
list, err := model.FindLuckNianRankList(&model.FindNianListArgs{
|
||||
Platform: platform,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return list.List, nil
|
||||
})
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
package base
|
||||
|
||||
import (
|
||||
"mongo.games.com/goserver/core/module"
|
||||
)
|
||||
|
||||
var MonitorMgrSington = &MonitorMgr{}
|
||||
|
||||
type MonitorMgr struct {
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) ModuleName() string {
|
||||
return "MonitorMgr"
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Init() {
|
||||
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Update() {
|
||||
//mongodb stats
|
||||
//mgo.SetStats(true)
|
||||
//mgoStats := mgo.GetStats()
|
||||
//logMgo := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", mgoStats)
|
||||
//if logMgo != nil {
|
||||
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
// return model.InsertMonitorData("mgo", logMgo)
|
||||
// }), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
//}
|
||||
//
|
||||
////logic stats
|
||||
//logicStats := profile.GetStats()
|
||||
//if len(logicStats) > 0 {
|
||||
// logLogic := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", logicStats)
|
||||
// if logLogic != nil {
|
||||
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
// return model.UpsertMonitorData("logic", logLogic)
|
||||
// }), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
// }
|
||||
//}
|
||||
//
|
||||
////net session stats
|
||||
//netStats := netlib.Stats()
|
||||
//if len(netStats) > 0 {
|
||||
// logNet := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", netStats)
|
||||
// if logNet != nil {
|
||||
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
// return model.UpsertMonitorData("net", logNet)
|
||||
// }), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
// }
|
||||
//}
|
||||
//
|
||||
////schedule stats
|
||||
//jobStats := schedule.Stats()
|
||||
//if len(jobStats) > 0 {
|
||||
// logJob := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", jobStats)
|
||||
// if logJob != nil {
|
||||
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
// return model.UpsertMonitorData("job", logJob)
|
||||
// }), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
// }
|
||||
//}
|
||||
//
|
||||
////trans stats
|
||||
//transStats := transact.Stats()
|
||||
//if len(transStats) > 0 {
|
||||
// logTrans := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", transStats)
|
||||
// if logTrans != nil {
|
||||
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
// return model.UpsertMonitorData("transact", logTrans)
|
||||
// }), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
// }
|
||||
//}
|
||||
//
|
||||
////panic stats
|
||||
//panicStats := utils.GetPanicStats()
|
||||
//if len(panicStats) > 0 {
|
||||
// for key, stats := range panicStats {
|
||||
// logPanic := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), key, stats)
|
||||
// if logPanic != nil {
|
||||
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
// return model.UpsertMonitorData("panic", logPanic)
|
||||
// }), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
////object command quene stats
|
||||
//objStats := core.AppCtx.GetStats()
|
||||
//if len(objStats) > 0 {
|
||||
// logCmd := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "obj", objStats)
|
||||
// if logCmd != nil {
|
||||
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
// return model.UpsertMonitorData("cmdque", logCmd)
|
||||
// }), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
// }
|
||||
//}
|
||||
//
|
||||
////gorouting count, eg. system info
|
||||
//runtimeStats := utils.StatsRuntime()
|
||||
//logRuntime := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", runtimeStats)
|
||||
//if logRuntime != nil {
|
||||
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
// return model.InsertMonitorData("runtime", logRuntime)
|
||||
// }), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
//}
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Shutdown() {
|
||||
module.UnregisteModule(this)
|
||||
}
|
||||
|
||||
func init() {
|
||||
//module.RegisteModule(MonitorMgrSington, time.Minute*5, 0)
|
||||
}
|
||||
|
|
@ -79,6 +79,41 @@ func (this *RPClient) Call(serviceMethod string, args interface{}, reply interfa
|
|||
}
|
||||
|
||||
func (this *RPClient) CallWithTimeout(serviceMethod string, args interface{}, reply interface{}, d time.Duration) error {
|
||||
var err error
|
||||
start := time.Now()
|
||||
|
||||
defer func() {
|
||||
// 记录请求完成时间和响应状态码
|
||||
duration := time.Since(start).Milliseconds()
|
||||
StateMgrLock.Lock()
|
||||
state, ok := StateMgr[serviceMethod]
|
||||
if !ok {
|
||||
state = new(State)
|
||||
StateMgr[serviceMethod] = state
|
||||
}
|
||||
// 执行次数
|
||||
state.RunTimes++
|
||||
// 执行总时长
|
||||
state.TotalRuningTime += duration
|
||||
// 最长执行时长
|
||||
if duration > state.MaxRuningTime {
|
||||
state.MaxRuningTime = duration
|
||||
}
|
||||
switch {
|
||||
case errors.Is(err, ErrRPClientNoConn):
|
||||
state.NoConnTimes++
|
||||
case errors.Is(err, ErrRPClientCallTimeout):
|
||||
state.TimeoutTimes++
|
||||
default:
|
||||
if err != nil {
|
||||
state.FailTimes++
|
||||
} else {
|
||||
state.SuccessTimes++
|
||||
}
|
||||
}
|
||||
StateMgrLock.Unlock()
|
||||
}()
|
||||
|
||||
if this.client == nil {
|
||||
return ErrRPClientNoConn
|
||||
}
|
||||
|
|
@ -87,8 +122,6 @@ func (this *RPClient) CallWithTimeout(serviceMethod string, args interface{}, re
|
|||
d = time.Second
|
||||
}
|
||||
|
||||
start := time.Now()
|
||||
var err error
|
||||
call := this.client.Go(serviceMethod, args, reply, make(chan *rpc.Call, 1))
|
||||
select {
|
||||
case <-time.After(d):
|
||||
|
|
@ -96,7 +129,7 @@ func (this *RPClient) CallWithTimeout(serviceMethod string, args interface{}, re
|
|||
case call = <-call.Done:
|
||||
err = call.Error
|
||||
}
|
||||
if err != nil && (err == rpc.ErrShutdown || err == io.ErrUnexpectedEOF) {
|
||||
if err != nil && (errors.Is(err, rpc.ErrShutdown) || errors.Is(err, io.ErrUnexpectedEOF)) {
|
||||
var dailed chan struct{}
|
||||
if atomic.CompareAndSwapInt32(&this.connecting, 0, 1) {
|
||||
dailed = make(chan struct{})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
type State struct {
|
||||
RunTimes int64 //执行次数
|
||||
TotalRuningTime int64 //总执行时间
|
||||
MaxRuningTime int64 //最长执行时间
|
||||
TimeoutTimes int64 //执行超时次数 大于30秒的次数
|
||||
FailTimes int64 //执行失败次数
|
||||
SuccessTimes int64 //执行成功次数
|
||||
NoConnTimes int64 //无连接次数
|
||||
}
|
||||
|
||||
var StateMgr = make(map[string]*State)
|
||||
var StateMgrLock = sync.RWMutex{}
|
||||
|
||||
func GetState() map[string]*State {
|
||||
ret := make(map[string]*State)
|
||||
StateMgrLock.RLock()
|
||||
defer StateMgrLock.RUnlock()
|
||||
for k, v := range StateMgr {
|
||||
e := *v // 复制一份
|
||||
ret[k] = &e
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
// Code generated by xlsx2proto.
|
||||
// DO NOT EDIT!
|
||||
|
||||
package srvdata
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"mongo.games.com/game/protocol/server"
|
||||
)
|
||||
|
||||
var PBDB_GameBankruptcyMgr = &DB_GameBankruptcyMgr{
|
||||
Datas: &server.DB_GameBankruptcyArray{},
|
||||
pool: make(map[int32]*server.DB_GameBankruptcy),
|
||||
|
||||
}
|
||||
|
||||
type DB_GameBankruptcyMgr struct {
|
||||
Datas *server.DB_GameBankruptcyArray
|
||||
pool map[int32]*server.DB_GameBankruptcy
|
||||
|
||||
}
|
||||
|
||||
func (this *DB_GameBankruptcyMgr) unmarshal(data []byte) error {
|
||||
err := proto.Unmarshal(data, this.Datas)
|
||||
if err == nil {
|
||||
this.arrangeData()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (this *DB_GameBankruptcyMgr) reunmarshal(data []byte) error {
|
||||
newDatas := &server.DB_GameBankruptcyArray{}
|
||||
err := proto.Unmarshal(data, newDatas)
|
||||
if err == nil {
|
||||
for _, item := range newDatas.Arr {
|
||||
existItem := this.GetData(item.GetId())
|
||||
if existItem == nil {
|
||||
this.pool[item.GetId()] = item
|
||||
this.Datas.Arr = append(this.Datas.Arr, item)
|
||||
|
||||
} else {
|
||||
*existItem = *item
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (this *DB_GameBankruptcyMgr) arrangeData() {
|
||||
if this.Datas == nil {
|
||||
return
|
||||
}
|
||||
|
||||
dataArr := this.Datas.GetArr()
|
||||
if dataArr == nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, data := range dataArr {
|
||||
this.pool[data.GetId()] = data
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func (this *DB_GameBankruptcyMgr) GetData(id int32) *server.DB_GameBankruptcy {
|
||||
if data, ok := this.pool[id]; ok {
|
||||
return data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
func init() {
|
||||
DataMgr.register("DB_GameBankruptcy.dat", &ProtobufDataLoader{dh: PBDB_GameBankruptcyMgr})
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
// Code generated by xlsx2proto.
|
||||
// DO NOT EDIT!
|
||||
|
||||
package srvdata
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"mongo.games.com/game/protocol/server"
|
||||
)
|
||||
|
||||
var PBDB_NewYearActivityMgr = &DB_NewYearActivityMgr{
|
||||
Datas: &server.DB_NewYearActivityArray{},
|
||||
pool: make(map[int32]*server.DB_NewYearActivity),
|
||||
|
||||
}
|
||||
|
||||
type DB_NewYearActivityMgr struct {
|
||||
Datas *server.DB_NewYearActivityArray
|
||||
pool map[int32]*server.DB_NewYearActivity
|
||||
|
||||
}
|
||||
|
||||
func (this *DB_NewYearActivityMgr) unmarshal(data []byte) error {
|
||||
err := proto.Unmarshal(data, this.Datas)
|
||||
if err == nil {
|
||||
this.arrangeData()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (this *DB_NewYearActivityMgr) reunmarshal(data []byte) error {
|
||||
newDatas := &server.DB_NewYearActivityArray{}
|
||||
err := proto.Unmarshal(data, newDatas)
|
||||
if err == nil {
|
||||
for _, item := range newDatas.Arr {
|
||||
existItem := this.GetData(item.GetId())
|
||||
if existItem == nil {
|
||||
this.pool[item.GetId()] = item
|
||||
this.Datas.Arr = append(this.Datas.Arr, item)
|
||||
|
||||
} else {
|
||||
*existItem = *item
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (this *DB_NewYearActivityMgr) arrangeData() {
|
||||
if this.Datas == nil {
|
||||
return
|
||||
}
|
||||
|
||||
dataArr := this.Datas.GetArr()
|
||||
if dataArr == nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, data := range dataArr {
|
||||
this.pool[data.GetId()] = data
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func (this *DB_NewYearActivityMgr) GetData(id int32) *server.DB_NewYearActivity {
|
||||
if data, ok := this.pool[id]; ok {
|
||||
return data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
func init() {
|
||||
DataMgr.register("DB_NewYearActivity.dat", &ProtobufDataLoader{dh: PBDB_NewYearActivityMgr})
|
||||
}
|
||||
|
|
@ -1,13 +1,16 @@
|
|||
StartTime: "2024-12-19T00:00:00+08:00"
|
||||
EndTime: "2024-12-20T00:00:00+08:00"
|
||||
StartTime: "2024-12-25T00:00:00+08:00"
|
||||
EndTime: "2024-12-26T00:00:00+08:00"
|
||||
|
||||
IsDatabaseMode: true
|
||||
ListenPort: 8888
|
||||
|
||||
Switch: # 1: open, 0: close
|
||||
- 0 # 新用户游戏破产率
|
||||
- 0 # 新用户平均游戏时长
|
||||
- 1 # 新用户游戏破产率
|
||||
- 1 # 新用户平均游戏时长
|
||||
- 1 # 用户平均游戏时长
|
||||
- 0 # 新用户平均局数
|
||||
- 0 # 平均倍数
|
||||
- 0 # 活跃破产率
|
||||
- 1 # 新用户平均局数
|
||||
- 1 # 平均倍数
|
||||
- 1 # 活跃破产率
|
||||
- 0 # 控输赢胜率
|
||||
- 0 # 机器人胜率
|
||||
- 0 # 人均获得金币
|
||||
|
|
|
|||
|
|
@ -2,7 +2,13 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/mozillazg/go-pinyin"
|
||||
"github.com/xuri/excelize/v2"
|
||||
"gorm.io/gorm"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/mysqlx"
|
||||
)
|
||||
|
||||
type ExcelData struct {
|
||||
|
|
@ -10,6 +16,10 @@ type ExcelData struct {
|
|||
Head []string
|
||||
Index int
|
||||
IndexCell int
|
||||
|
||||
TableName string
|
||||
TableHead []string
|
||||
DataName string
|
||||
}
|
||||
|
||||
func (e *ExcelData) SetHead(head []string) *ExcelData {
|
||||
|
|
@ -59,13 +69,26 @@ func NewExcelMgr() *ExcelMgr {
|
|||
}
|
||||
}
|
||||
|
||||
func (e *ExcelMgr) Register(id int, head []string) *ExcelData {
|
||||
func (e *ExcelMgr) Register(id int, head []string, filename string) *ExcelData {
|
||||
e.List[id] = &ExcelData{
|
||||
File: excelize.NewFile(),
|
||||
Head: head,
|
||||
Index: 0,
|
||||
}
|
||||
|
||||
name := ChineseToPinYin([]string{filename})
|
||||
if len(name) == 0 {
|
||||
return nil
|
||||
}
|
||||
tableName := fmt.Sprintf("task_%s", name[0])
|
||||
e.List[id].TableName = tableName
|
||||
|
||||
for _, v := range head {
|
||||
cl := ChineseToPinYin([]string{v})[0]
|
||||
e.List[id].TableHead = append(e.List[id].TableHead, cl)
|
||||
}
|
||||
e.List[id].DataName = filename
|
||||
|
||||
e.List[id].NewSheet("Sheet1")
|
||||
|
||||
if len(head) > 0 {
|
||||
|
|
@ -79,10 +102,180 @@ func (e *ExcelMgr) Get(id int) *ExcelData {
|
|||
return e.List[id]
|
||||
}
|
||||
|
||||
func (e *ExcelMgr) Save(id int, fileName string) error {
|
||||
func (e *ExcelMgr) Save(id int, startTime, endTime string) error {
|
||||
d := e.List[id]
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return d.SaveAs(fileName)
|
||||
|
||||
filename := fmt.Sprintf("%s_%s_%s.xlsx", d.DataName, startTime, endTime)
|
||||
|
||||
if true {
|
||||
rows, err := d.GetRows("Sheet1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
db, err := mysqlx.GetDatabase("1")
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("GetDatabase error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
files := make(map[string]string)
|
||||
index := make(map[string]string)
|
||||
for _, v := range d.Head {
|
||||
cl := ChineseToPinYin([]string{v})[0]
|
||||
files[cl] = v
|
||||
if strings.Contains(v, "*") {
|
||||
index[cl] = "INDEX"
|
||||
}
|
||||
}
|
||||
|
||||
createSQL := buildCreateTableSQLWithIndices(d.TableName, d.DataName, d.TableHead, files, index)
|
||||
|
||||
if err = db.Exec(createSQL).Error; err != nil {
|
||||
logger.Logger.Errorf("createTable error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
if err = insertData(db.DB, d.TableName, d.TableHead, rows); err != nil {
|
||||
logger.Logger.Errorf("insertData error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
return d.SaveAs(filename)
|
||||
}
|
||||
|
||||
func (e *ExcelMgr) Pull(id int, startTime, endTime string) (*excelize.File, string, error) {
|
||||
d := e.List[id]
|
||||
if d == nil {
|
||||
return nil, "", nil
|
||||
}
|
||||
|
||||
db, err := mysqlx.GetDatabase("1")
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("GetDatabase error: %v", err)
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
rows, err := db.Table(d.TableName).Where("ri_qi between ? and ?", startTime, endTime).Select(d.TableHead).Rows()
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("Pull error: %v", err)
|
||||
return nil, "", err
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
f := excelize.NewFile()
|
||||
f.NewSheet("Sheet1")
|
||||
f.SetSheetRow("Sheet1", "A1", &d.Head)
|
||||
|
||||
index := 2
|
||||
for rows.Next() {
|
||||
data := make([]interface{}, len(d.TableHead))
|
||||
scanArgs := make([]interface{}, len(d.TableHead))
|
||||
for i := range data {
|
||||
scanArgs[i] = &data[i]
|
||||
}
|
||||
err = rows.Scan(scanArgs...)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("Pull error: %v", err)
|
||||
return nil, "", err
|
||||
}
|
||||
f.SetSheetRow("Sheet1", "A"+fmt.Sprintf("%d", index), &data)
|
||||
index++
|
||||
}
|
||||
|
||||
return f, fmt.Sprintf("%s_%s_%s", d.DataName, startTime, endTime), nil
|
||||
}
|
||||
|
||||
// 构建创建表的 SQL 语句,支持中文描述和索引
|
||||
func buildCreateTableSQLWithIndices(tableName string, comment string, head []string, fields map[string]string, indices map[string]string) string {
|
||||
var columns []string
|
||||
var indexDefs []string
|
||||
|
||||
// 遍历字段定义
|
||||
for _, field := range head {
|
||||
comment := fields[field]
|
||||
column := fmt.Sprintf("`%s` VARCHAR(255) COMMENT '%s'", field, comment)
|
||||
columns = append(columns, column)
|
||||
|
||||
// 根据索引类型添加索引定义
|
||||
if indexType, ok := indices[field]; ok {
|
||||
switch strings.ToUpper(indexType) {
|
||||
case "PRIMARY":
|
||||
indexDefs = append(indexDefs, fmt.Sprintf("PRIMARY KEY (`%s`)", field))
|
||||
case "UNIQUE":
|
||||
indexDefs = append(indexDefs, fmt.Sprintf("UNIQUE KEY `idx_%s` (`%s`)", field, field))
|
||||
case "INDEX":
|
||||
indexDefs = append(indexDefs, fmt.Sprintf("KEY `idx_%s` (`%s`)", field, field))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 拼接字段和索引部分
|
||||
allDefs := append(columns, indexDefs...)
|
||||
|
||||
ret := fmt.Sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n%s\n) COMMENT='%s';",
|
||||
tableName,
|
||||
strings.Join(allDefs, ",\n"), comment)
|
||||
logger.Logger.Tracef("createTableSQL: %s", ret)
|
||||
// 拼接最终的 SQL
|
||||
return ret
|
||||
}
|
||||
|
||||
func insertData(db *gorm.DB, tableName string, header []string, rows [][]string) error {
|
||||
placeholders := strings.Repeat("?,", len(header))
|
||||
placeholders = placeholders[:len(placeholders)-1] // 移除多余的逗号
|
||||
|
||||
insertSQL := fmt.Sprintf("INSERT INTO `%s` (%s) VALUES (%s)", tableName, "`"+strings.Join(header, "`,`")+"`", placeholders)
|
||||
|
||||
for _, row := range rows[1:] {
|
||||
// 确保每行数据长度和表头一致
|
||||
if len(row) < len(header) {
|
||||
for len(row) < len(header) {
|
||||
row = append(row, "") // 填充缺失列
|
||||
}
|
||||
}
|
||||
err := db.Exec(insertSQL, interfaceSlice(row)...).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func interfaceSlice(slice []string) []interface{} {
|
||||
result := make([]interface{}, len(slice))
|
||||
for i, v := range slice {
|
||||
result[i] = v
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
var args = pinyin.NewArgs()
|
||||
|
||||
func init() {
|
||||
args.Style = pinyin.Normal
|
||||
}
|
||||
|
||||
func joinPinyin(py [][]string) string {
|
||||
var result []string
|
||||
for _, word := range py {
|
||||
if len(word) > 0 {
|
||||
result = append(result, word[0]) // 每个字的拼音取第一个候选
|
||||
}
|
||||
}
|
||||
return strings.Join(result, "_")
|
||||
}
|
||||
|
||||
func ChineseToPinYin(param []string) []string {
|
||||
var ret []string
|
||||
for _, v := range param {
|
||||
ret = append(ret, joinPinyin(pinyin.Pinyin(v, args)))
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
/*
|
||||
下载
|
||||
GET http://127.0.0.1:8888/statistics/task?data_type=0&start_time=2024-12-26&end_time=2024-12-26
|
||||
请求参数
|
||||
data_type 数据类型
|
||||
0新用户游戏破产率
|
||||
1新用户平均游戏时长
|
||||
2用户平均游戏时长
|
||||
3新用户平均局数
|
||||
4平均倍数
|
||||
5活跃破产率
|
||||
start_time 开始时间 格式:2024-12-26
|
||||
end_time 结束时间 格式:2024-12-26
|
||||
*/
|
||||
|
||||
// Download 下载
|
||||
func Download(w http.ResponseWriter, r *http.Request) {
|
||||
// 请求参数
|
||||
// data_type 数据类型
|
||||
// start_time 开始时间
|
||||
// end_time 结束时间
|
||||
// Request parameters
|
||||
|
||||
dataType, err := strconv.Atoi(r.URL.Query().Get("data_type"))
|
||||
if err != nil {
|
||||
http.Error(w, "Invalid data_type", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
startTime := r.URL.Query().Get("start_time")
|
||||
endTime := r.URL.Query().Get("end_time")
|
||||
|
||||
f, name, err := ExcelMgrSingle.Pull(dataType, startTime, endTime)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
w.Header().Set("Content-Type", "application/octet-stream;charset=UTF-8")
|
||||
w.Header().Set("Content-Disposition", "attachment; filename=\""+name+".xlsx\"")
|
||||
|
||||
f.Write(w)
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
|
|
@ -9,8 +12,10 @@ import (
|
|||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/mongox"
|
||||
"mongo.games.com/goserver/core/mysqlx"
|
||||
"mongo.games.com/goserver/core/utils"
|
||||
"mongo.games.com/goserver/core/viperx"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/statistics/task/gamefree"
|
||||
"mongo.games.com/game/statistics/task/task"
|
||||
)
|
||||
|
|
@ -30,12 +35,93 @@ const (
|
|||
)
|
||||
|
||||
var VP *viper.Viper
|
||||
var ExcelMgrSingle *ExcelMgr
|
||||
|
||||
func run() {
|
||||
if VP.GetBool("IsDatabaseMode") {
|
||||
VP.Set("StartTime", common.HMSToTime(0, 0, 0).AddDate(0, 0, -1).Format(time.RFC3339))
|
||||
VP.Set("EndTime", common.HMSToTime(0, 0, 0).Format(time.RFC3339))
|
||||
}
|
||||
|
||||
startTime, err := time.Parse(time.RFC3339, VP.GetString("StartTime"))
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("time.Parse err: %v", err))
|
||||
return
|
||||
}
|
||||
endTime, err := time.Parse(time.RFC3339, VP.GetString("EndTime"))
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("time.Parse err: %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
switchArr := VP.GetIntSlice("Switch")
|
||||
|
||||
for {
|
||||
if startTime.Unix() >= endTime.Unix() {
|
||||
break
|
||||
}
|
||||
startTimeStr := startTime.Format(time.RFC3339)
|
||||
et := startTime.AddDate(0, 0, 1)
|
||||
endTimeStr := et.Format(time.RFC3339)
|
||||
logger.Logger.Infof("startTime: %v endTime: %v", startTimeStr, endTimeStr)
|
||||
|
||||
if switchArr[ExcelTypeNewPlayerBankrupt] == 1 {
|
||||
// 新用户游戏破产率
|
||||
ExcelMgrSingle.GenNewPlayerBankruptRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeGameTimeAvg] == 1 {
|
||||
// 新用户平均游戏时长
|
||||
ExcelMgrSingle.GenNewPlayerGameTimeAvgExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeGameTimeAllAvg] == 1 {
|
||||
// 用户平均游戏时长
|
||||
ExcelMgrSingle.GenPlayerGameTimeAvgExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeGameCountAvg] == 1 {
|
||||
// 新用户平均局数
|
||||
ExcelMgrSingle.GenGameCountExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeGameRate] == 1 {
|
||||
// 平均倍数
|
||||
ExcelMgrSingle.GenGameRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeActiveRate] == 1 {
|
||||
// 活跃破产率
|
||||
ExcelMgrSingle.GenActiveBankruptRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeCtrlWinRate] == 1 {
|
||||
// 控赢胜率
|
||||
ExcelMgrSingle.GenCtrlWinRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeRobotWinRate] == 1 {
|
||||
// 机器人胜率
|
||||
ExcelMgrSingle.GenRobotWinRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeCoinAvg] == 1 {
|
||||
// 人均获得金币
|
||||
ExcelMgrSingle.GenCoinAvgExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeBankruptOffline] == 1 {
|
||||
// 破产后离线
|
||||
ExcelMgrSingle.GenBankruptOfflineExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeOfflineCoin] == 1 {
|
||||
// 离线金币
|
||||
ExcelMgrSingle.GenOfflineCoinExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
|
||||
startTime = et
|
||||
}
|
||||
|
||||
ExcelMgrSingle.SaveAll(VP.GetString("StartTime")[:10], endTime.AddDate(0, 0, -1).Format(time.DateOnly))
|
||||
}
|
||||
|
||||
func main() {
|
||||
defer func() {
|
||||
logger.Logger.Flush()
|
||||
logger.Logger.Close()
|
||||
}()
|
||||
|
||||
VP = viperx.GetViper("config.yaml")
|
||||
// mongo
|
||||
vp := viperx.GetViper("mongo.yaml")
|
||||
|
|
@ -58,127 +144,84 @@ func main() {
|
|||
mysqlx.Init(myConf)
|
||||
defer mysqlx.Close()
|
||||
|
||||
startTime, err := time.Parse(time.RFC3339, VP.GetString("StartTime"))
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("time.Parse err: %v", err))
|
||||
return
|
||||
}
|
||||
endTime, err := time.Parse(time.RFC3339, VP.GetString("EndTime"))
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("time.Parse err: %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
mgr := NewExcelMgr()
|
||||
mgr.Register(ExcelTypeNewPlayerBankrupt, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"})
|
||||
mgr.Register(ExcelTypeGameTimeAvg, []string{"日期", "场次id", "参与人数", "平均游戏时长"})
|
||||
mgr.Register(ExcelTypeGameTimeAllAvg, []string{"日期", "场次id", "参与人数", "平均游戏时长"})
|
||||
mgr.Register(ExcelTypeGameCountAvg, []string{"日期", "场次id", "参与人数", "平均局数"})
|
||||
mgr.Register(ExcelTypeGameRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"})
|
||||
mgr.Register(ExcelTypeActiveRate, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"})
|
||||
mgr.Register(ExcelTypeCtrlWinRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"})
|
||||
mgr.Register(ExcelTypeCtrlWinRate*10, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"})
|
||||
mgr.Register(ExcelTypeRobotWinRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"})
|
||||
mgr.Register(ExcelTypeCoinAvg, []string{"日期", "场次id", "参与人数", "人均获得金币"})
|
||||
mgr.Register(ExcelTypeBankruptOffline, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"})
|
||||
mgr.Register(ExcelTypeOfflineCoin, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"})
|
||||
switchArr := VP.GetIntSlice("Switch")
|
||||
ExcelMgrSingle = mgr
|
||||
mgr.Register(ExcelTypeNewPlayerBankrupt, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"}, "新用户破产率")
|
||||
mgr.Register(ExcelTypeGameTimeAvg, []string{"日期", "场次id", "参与人数", "平均游戏时长"}, "新用户平均游戏时长")
|
||||
mgr.Register(ExcelTypeGameTimeAllAvg, []string{"日期", "场次id", "参与人数", "平均游戏时长"}, "用户平均游戏时长")
|
||||
mgr.Register(ExcelTypeGameCountAvg, []string{"日期", "场次id", "参与人数", "平均局数"}, "新用户平均局数")
|
||||
mgr.Register(ExcelTypeGameRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"}, "平均倍数")
|
||||
mgr.Register(ExcelTypeActiveRate, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"}, "活跃破产率")
|
||||
mgr.Register(ExcelTypeCtrlWinRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"}, "控赢胜率")
|
||||
mgr.Register(ExcelTypeCtrlWinRate*10, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"}, "控数胜率")
|
||||
mgr.Register(ExcelTypeRobotWinRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"}, "机器人输率")
|
||||
mgr.Register(ExcelTypeCoinAvg, []string{"日期", "场次id", "参与人数", "人均获得金币"}, "人均获得金币")
|
||||
mgr.Register(ExcelTypeBankruptOffline, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"}, "破产后离线")
|
||||
mgr.Register(ExcelTypeOfflineCoin, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"}, "离线金币")
|
||||
|
||||
for {
|
||||
if startTime.Unix() >= endTime.Unix() {
|
||||
break
|
||||
if VP.GetBool("IsDatabaseMode") {
|
||||
// 每天凌晨执行一次 run方法
|
||||
var f func()
|
||||
f = func() {
|
||||
nextTime := common.HMSToTime(0, 0, 0).AddDate(0, 0, 1)
|
||||
time.AfterFunc(nextTime.Sub(time.Now())+time.Second*10, func() {
|
||||
go utils.RepeatUntilPanicless(run)
|
||||
f()
|
||||
})
|
||||
}
|
||||
startTimeStr := startTime.Format(time.RFC3339)
|
||||
et := startTime.AddDate(0, 0, 1)
|
||||
endTimeStr := et.Format(time.RFC3339)
|
||||
logger.Logger.Infof("startTime: %v endTime: %v", startTimeStr, endTimeStr)
|
||||
f()
|
||||
//run()
|
||||
|
||||
if switchArr[ExcelTypeNewPlayerBankrupt] == 1 {
|
||||
// 新用户游戏破产率
|
||||
mgr.GenNewPlayerBankruptRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeGameTimeAvg] == 1 {
|
||||
// 新用户平均游戏时长
|
||||
mgr.GenNewPlayerGameTimeAvgExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeGameTimeAllAvg] == 1 {
|
||||
// 用户平均游戏时长
|
||||
mgr.GenPlayerGameTimeAvgExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeGameCountAvg] == 1 {
|
||||
// 新用户平均局数
|
||||
mgr.GenGameCountExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeGameRate] == 1 {
|
||||
// 平均倍数
|
||||
mgr.GenGameRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeActiveRate] == 1 {
|
||||
// 活跃破产率
|
||||
mgr.GenActiveBankruptRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeCtrlWinRate] == 1 {
|
||||
// 控赢胜率
|
||||
mgr.GenCtrlWinRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeRobotWinRate] == 1 {
|
||||
// 机器人胜率
|
||||
mgr.GenRobotWinRateExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeCoinAvg] == 1 {
|
||||
// 人均获得金币
|
||||
mgr.GenCoinAvgExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeBankruptOffline] == 1 {
|
||||
// 破产后离线
|
||||
mgr.GenBankruptOfflineExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
if switchArr[ExcelTypeOfflineCoin] == 1 {
|
||||
// 离线金币
|
||||
mgr.GenOfflineCoinExcel("1", startTimeStr, endTimeStr)
|
||||
}
|
||||
listenPort := VP.GetString("ListenPort")
|
||||
http.HandleFunc("/statistics/task", Download)
|
||||
go http.ListenAndServe(fmt.Sprintf(":%v", listenPort), nil)
|
||||
|
||||
startTime = et
|
||||
logger.Logger.Infof("start server 0.0.0.0:%v", listenPort)
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, os.Kill)
|
||||
sig := <-c
|
||||
logger.Logger.Infof("closing down (signal: %v)", sig)
|
||||
|
||||
} else {
|
||||
run()
|
||||
}
|
||||
|
||||
mgr.SaveAll(VP.GetString("StartTime")[:10], endTime.AddDate(0, 0, -1).Format(time.DateOnly))
|
||||
}
|
||||
|
||||
func (e *ExcelMgr) SaveAll(startTime, endTime string) {
|
||||
switchArr := VP.GetIntSlice("Switch")
|
||||
if switchArr[ExcelTypeNewPlayerBankrupt] == 1 {
|
||||
e.Save(ExcelTypeNewPlayerBankrupt, fmt.Sprintf("新用户破产率_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeNewPlayerBankrupt, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeGameTimeAvg] == 1 {
|
||||
e.Save(ExcelTypeGameTimeAvg, fmt.Sprintf("新用户平均游戏时长_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeGameTimeAvg, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeGameTimeAllAvg] == 1 {
|
||||
e.Save(ExcelTypeGameTimeAllAvg, fmt.Sprintf("用户平均游戏时长_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeGameTimeAllAvg, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeGameCountAvg] == 1 {
|
||||
e.Save(ExcelTypeGameCountAvg, fmt.Sprintf("新用户平均局数_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeGameCountAvg, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeGameRate] == 1 {
|
||||
e.Save(ExcelTypeGameRate, fmt.Sprintf("平均倍数_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeGameRate, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeActiveRate] == 1 {
|
||||
e.Save(ExcelTypeActiveRate, fmt.Sprintf("活跃破产率_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeActiveRate, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeCtrlWinRate] == 1 {
|
||||
e.Save(ExcelTypeCtrlWinRate, fmt.Sprintf("控赢胜率_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeCtrlWinRate*10, fmt.Sprintf("控输胜率_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeCtrlWinRate, startTime, endTime)
|
||||
e.Save(ExcelTypeCtrlWinRate*10, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeRobotWinRate] == 1 {
|
||||
e.Save(ExcelTypeRobotWinRate, fmt.Sprintf("机器人输率_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeRobotWinRate, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeCoinAvg] == 1 {
|
||||
e.Save(ExcelTypeCoinAvg, fmt.Sprintf("人均获得金币_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeCoinAvg, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeBankruptOffline] == 1 {
|
||||
e.Save(ExcelTypeBankruptOffline, fmt.Sprintf("破产后离线_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeBankruptOffline, startTime, endTime)
|
||||
}
|
||||
if switchArr[ExcelTypeOfflineCoin] == 1 {
|
||||
e.Save(ExcelTypeOfflineCoin, fmt.Sprintf("离线金币_%s_%s.xlsx", startTime, endTime))
|
||||
e.Save(ExcelTypeOfflineCoin, startTime, endTime)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
5
todo
5
todo
|
|
@ -7,4 +7,7 @@ dbproxy优化:
|
|||
参考 https://go-zero.dev/ 中的goctl工具
|
||||
|
||||
消息队列数据恢复发送:
|
||||
发送失败的消息会写入本地文件,等mq正常后尝试重新发送
|
||||
发送失败的消息会写入本地文件,等mq正常后尝试重新发送
|
||||
|
||||
代理业务需要重构,支持worldsrv的滚动更新
|
||||
dbproxy/mq/c_invite.go
|
||||
|
|
@ -237,3 +237,23 @@ func API_GetActConfig(appId string) ([]byte, error) {
|
|||
func ApiGetInviteLink(appId string, body proto.Message) ([]byte, error) {
|
||||
return postRequest(appId, "/get_invite_link", nil, body, "http", DEFAULT_TIMEOUT)
|
||||
}
|
||||
|
||||
// Debug请求
|
||||
type DebugTestReq struct {
|
||||
Snid int32 `json:"snid"`
|
||||
Username string `json:"username"`
|
||||
Count string `json:"count"`
|
||||
Rpc int32 `json:"rpc"`
|
||||
Bankcoin int64 `json:"bankcoin"`
|
||||
Daybuytimes int32 `json:"daybuytimes"`
|
||||
}
|
||||
|
||||
// Debug返回
|
||||
type DebugTestRsp struct {
|
||||
Code int `json:"code"`
|
||||
Data struct {
|
||||
Count int64 `json:"count"`
|
||||
} `json:"data"`
|
||||
Message string `json:"message"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,21 +207,21 @@ func (this *CSLoginHandler) Process(s *netlib.Session, packetid int, data interf
|
|||
}
|
||||
|
||||
// 玩家已经登录完成并且在游戏中,断开当前连接
|
||||
ls := LoginStateMgrSington.GetLoginStateByName(UserKey(csl.GetUsername(), csl.GetPlatform(), tagkey))
|
||||
if ls != nil && ls.acc != nil {
|
||||
// lss 其它连接
|
||||
lss := LoginStateMgrSington.LoginFinish(csl.GetUsername(), csl.GetPlatform(), sid, ls.acc, tagkey)
|
||||
player := PlayerMgrSington.GetPlayerBySnId(ls.acc.SnId)
|
||||
waitMatch := false
|
||||
if player != nil {
|
||||
waitMatch, _ = TournamentMgr.IsMatchWaiting(player.Platform, player.SnId)
|
||||
}
|
||||
if len(lss) > 0 && (player != nil && (player.scene != nil || player.thrscene != 0 || waitMatch || TournamentMgr.IsGaming(player.SnId))) {
|
||||
sendSCLogin(login_proto.OpResultCode_OPRC_LoginOtherPlace)
|
||||
sendSCDisconnect(common.KickReason_Logining)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
//ls := LoginStateMgrSington.GetLoginStateByName(UserKey(csl.GetUsername(), csl.GetPlatform(), tagkey))
|
||||
//if ls != nil && ls.acc != nil {
|
||||
// // lss 其它连接
|
||||
// lss := LoginStateMgrSington.LoginFinish(csl.GetUsername(), csl.GetPlatform(), sid, ls.acc, tagkey)
|
||||
// player := PlayerMgrSington.GetPlayerBySnId(ls.acc.SnId)
|
||||
// waitMatch := false
|
||||
// if player != nil {
|
||||
// waitMatch, _ = TournamentMgr.IsMatchWaiting(player.Platform, player.SnId)
|
||||
// }
|
||||
// if len(lss) > 0 && (player != nil && (player.scene != nil || player.thrscene != 0 || waitMatch || TournamentMgr.IsGaming(player.SnId))) {
|
||||
// sendSCLogin(login_proto.OpResultCode_OPRC_LoginOtherPlace)
|
||||
// sendSCDisconnect(common.KickReason_Logining)
|
||||
// return nil
|
||||
// }
|
||||
//}
|
||||
|
||||
clog := &model.ClientLoginInfo{
|
||||
LoginType: csl.GetLoginType(),
|
||||
|
|
@ -250,7 +250,7 @@ func (this *CSLoginHandler) Process(s *netlib.Session, packetid int, data interf
|
|||
|
||||
// 用缓存信息做登录,有account
|
||||
// 根据StartLogin代码,这里ls.acc一定不为nil
|
||||
ls = LoginStateMgrSington.GetLoginStateByName(UserKey(csl.GetUsername(), csl.GetPlatform(), tagkey))
|
||||
ls := LoginStateMgrSington.GetLoginStateByName(UserKey(csl.GetUsername(), csl.GetPlatform(), tagkey))
|
||||
if ls != nil {
|
||||
acc := ls.acc
|
||||
// 账号冻结
|
||||
|
|
|
|||
|
|
@ -0,0 +1,776 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/mq"
|
||||
"mongo.games.com/game/protocol/activity"
|
||||
"mongo.games.com/game/srvdata"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 请求年兽信息
|
||||
func CSNianData(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
if _, ok := data.(*activity.CSNianData); ok {
|
||||
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
||||
sData := srvdata.PBDB_NewYearActivityMgr.Datas.GetArr()
|
||||
BossMaxHp := int64(0)
|
||||
for _, value := range sData {
|
||||
if value.Id == 5 {
|
||||
BossMaxHp, _ = strconv.ParseInt(value.PropValue, 10, 64)
|
||||
break
|
||||
}
|
||||
}
|
||||
logger.Logger.Trace("请求年兽信息!snid = ", p.SnId)
|
||||
if p == nil {
|
||||
logger.Logger.Warn("CSNianData p == nil")
|
||||
return nil
|
||||
}
|
||||
pool := WelfareMgrSington.GetConfig(p.Platform).ActivityNianConfig
|
||||
if pool == nil || pool.List == nil || pool.Switch == model.WelfareClose {
|
||||
return nil
|
||||
}
|
||||
startTime := pool.List[0].ActivityStart
|
||||
endTime := pool.List[0].ActivityEnd
|
||||
start, _ := time.Parse(time.DateTime, startTime)
|
||||
// 转换为时间戳(以秒为单位)
|
||||
timestamp := start.Unix()
|
||||
end, _ := time.Parse(time.DateTime, endTime)
|
||||
endTimestamp := end.Unix()
|
||||
|
||||
if p.WelfData.NianData != nil && (p.WelfData.NianData.ActivityStartTime != timestamp || p.WelfData.NianData.ActivityEndTime != endTimestamp) {
|
||||
logger.Logger.Infof("CSNianData 年兽活动时间变更 清除之前数据 snid= %d", p.SnId)
|
||||
WelfareMgrSington.ClearActivityNianData(p)
|
||||
}
|
||||
|
||||
if p.WelfData.NianData == nil {
|
||||
p.WelfData.NianData = &model.NianData{
|
||||
ActivityStartTime: timestamp,
|
||||
ActivityEndTime: endTimestamp,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if p.WelfData.NianData.BossHp == 0 {
|
||||
p.WelfData.NianData.BossHp = BossMaxHp
|
||||
}
|
||||
//排行榜配置
|
||||
rankData := PlatformMgrSingleton.GetConfig(p.Platform).NianRankReward
|
||||
if rankData == nil {
|
||||
return nil
|
||||
}
|
||||
pack := &activity.SCNianData{}
|
||||
for _, info := range rankData.RankData {
|
||||
rankInfo := &activity.NianRankData{}
|
||||
rankInfo.TypeId = info.TypeId
|
||||
for _, awardInfo := range info.RankInfo {
|
||||
rank := &activity.NianRankInfo{}
|
||||
rank.RankId = awardInfo.RankId
|
||||
for _, itemInfo := range awardInfo.Award {
|
||||
rankAwardData := &activity.RankAwardData{
|
||||
ItemId: itemInfo.ItemId,
|
||||
ItemNum: itemInfo.ItemNum,
|
||||
}
|
||||
rank.Award = append(rank.Award, rankAwardData)
|
||||
}
|
||||
rankInfo.Data = append(rankInfo.Data, rank)
|
||||
}
|
||||
pack.RankData = append(pack.RankData, rankInfo)
|
||||
}
|
||||
|
||||
var intSlice []int
|
||||
var shopNum []int
|
||||
for _, value := range sData {
|
||||
if value.Id == 17 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, _ := strconv.Atoi(s)
|
||||
intSlice = append(intSlice, num)
|
||||
}
|
||||
}
|
||||
if value.Id == 18 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, _ := strconv.Atoi(s)
|
||||
shopNum = append(shopNum, num)
|
||||
}
|
||||
}
|
||||
}
|
||||
for pos, shopId := range intSlice {
|
||||
num := shopNum[pos]
|
||||
if num == 0 {
|
||||
continue
|
||||
}
|
||||
shopInfo := &activity.ShopData{}
|
||||
shopInfo.ShopId = int32(shopId)
|
||||
shopInfo.ShopNum = p.WelfData.NianData.GiftShop[int32(shopId)]
|
||||
shopInfo.MaxShopNum = int32(num)
|
||||
pack.ShopData = append(pack.ShopData, shopInfo)
|
||||
}
|
||||
changeData := ""
|
||||
for _, value := range sData {
|
||||
if value.Id == 21 {
|
||||
changeData = value.PropValue
|
||||
break
|
||||
}
|
||||
}
|
||||
signTime := int64(0)
|
||||
if p.WelfData.NianData.SignAwardTime > 0 {
|
||||
nextDay := time.Now().Add(24 * time.Hour).Truncate(24 * time.Hour)
|
||||
signTime = nextDay.Unix()
|
||||
}
|
||||
for _, value := range sData {
|
||||
if value.Id == 7 {
|
||||
pack.LuckyRankNeed = value.PropValue
|
||||
break
|
||||
}
|
||||
}
|
||||
for _, value := range sData {
|
||||
if value.Id == 8 {
|
||||
pack.RankNeed = value.PropValue
|
||||
break
|
||||
}
|
||||
}
|
||||
StartTs := common.IntToTime(int(pool.List[0].BuffStartTime)).Unix()
|
||||
EndTs := common.IntToTime(int(pool.List[0].BuffEndTime)).Unix()
|
||||
pack.BuffStartTime = StartTs
|
||||
pack.BuffEndTime = EndTs
|
||||
pack.BossHp = p.WelfData.NianData.BossHp
|
||||
pack.BossMaxHp = BossMaxHp
|
||||
pack.ActivityStartTime = timestamp
|
||||
pack.ActivityEndTime = endTimestamp
|
||||
pack.AwardTime = p.WelfData.NianData.SignAwardTime
|
||||
pack.BuffCount = p.WelfData.NianData.BuffCount
|
||||
pack.BuffStatus = p.WelfData.NianData.BuffStatus
|
||||
pack.SignAwardTime = signTime
|
||||
pack.ChangeData = changeData
|
||||
pack.Switch = pool.Switch
|
||||
logger.Logger.Trace("请求年兽活动信息 ", pack)
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianData), pack)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 攻击年兽
|
||||
func CSNianAttack(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
if msg, ok := data.(*activity.CSNianAttack); ok {
|
||||
typeId := msg.TypeId
|
||||
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
||||
sData := srvdata.PBDB_NewYearActivityMgr.Datas.GetArr()
|
||||
BossMaxHp := int64(0)
|
||||
for _, value := range sData {
|
||||
if value.Id == 5 {
|
||||
BossMaxHp, _ = strconv.ParseInt(value.PropValue, 10, 64)
|
||||
break
|
||||
}
|
||||
}
|
||||
if p.WelfData.NianData == nil {
|
||||
p.WelfData.NianData = &model.NianData{}
|
||||
}
|
||||
if p.WelfData.NianData.BossHp <= 0 {
|
||||
p.WelfData.NianData.BossHp = BossMaxHp
|
||||
}
|
||||
logger.Logger.Trace("客户端请求攻击年兽!snid = ", p.SnId)
|
||||
if p == nil {
|
||||
logger.Logger.Warn("CSNianAttack p == nil")
|
||||
return nil
|
||||
}
|
||||
pool := WelfareMgrSington.GetConfig(p.Platform).ActivityNianConfig
|
||||
if pool == nil || pool.List == nil {
|
||||
return nil
|
||||
}
|
||||
if pool.Switch == model.WelfareClose {
|
||||
logger.Logger.Trace("CSNianAttack 活动关闭!")
|
||||
return nil
|
||||
}
|
||||
//判断活动时间
|
||||
startTime := pool.List[0].ActivityStart
|
||||
endTime := pool.List[0].ActivityEnd
|
||||
t, _ := time.Parse(time.DateTime, startTime)
|
||||
// 转换为时间戳(以秒为单位)
|
||||
timestamp := t.Unix()
|
||||
end, _ := time.Parse(time.DateTime, endTime)
|
||||
endTimestamp := end.Unix()
|
||||
nowTime := time.Now().Unix()
|
||||
if nowTime < timestamp || nowTime > endTimestamp {
|
||||
return nil
|
||||
}
|
||||
|
||||
pack := &activity.SCNianAttackData{}
|
||||
itemId := 0
|
||||
itemNum := 1
|
||||
count := 1
|
||||
if typeId == 1 {
|
||||
itemId = common.ItemIDLittleGuaranteed
|
||||
} else if typeId == 2 {
|
||||
itemId = common.ItemIDLittleGuaranteed
|
||||
itemNum = 10
|
||||
count = 10
|
||||
} else if typeId == 3 {
|
||||
itemId = common.ItemIDBigGuaranteed
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
var costItems []*model.Item
|
||||
costItems = append(costItems, &model.Item{
|
||||
ItemId: int32(itemId),
|
||||
ItemNum: int64(-itemNum),
|
||||
})
|
||||
_, _, result := BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: costItems,
|
||||
GainWay: common.GainWayNianCost,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动消耗",
|
||||
})
|
||||
if !result {
|
||||
return nil
|
||||
}
|
||||
//本次攻击总血量
|
||||
AttackHp := int64(0)
|
||||
LuckyRankNeed := int64(0)
|
||||
RankNeed := int64(0)
|
||||
for _, value := range sData {
|
||||
if value.Id == 7 {
|
||||
LuckyRankNeed, _ = strconv.ParseInt(value.PropValue, 10, 64)
|
||||
break
|
||||
}
|
||||
}
|
||||
for _, value := range sData {
|
||||
if value.Id == 8 {
|
||||
RankNeed, _ = strconv.ParseInt(value.PropValue, 10, 64)
|
||||
break
|
||||
}
|
||||
}
|
||||
//伤害范围
|
||||
var intSlice []int
|
||||
if typeId == 1 || typeId == 2 {
|
||||
for _, value := range sData {
|
||||
if value.Id == 9 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
intSlice = append(intSlice, num)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
//保底奖励次数
|
||||
floorCount := 0
|
||||
for _, value := range sData {
|
||||
if typeId == 1 || typeId == 2 {
|
||||
if value.Id == 13 {
|
||||
floorCount, _ = strconv.Atoi(value.PropValue)
|
||||
break
|
||||
}
|
||||
} else {
|
||||
if value.Id == 15 {
|
||||
floorCount, _ = strconv.Atoi(value.PropValue)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if typeId == 3 {
|
||||
for _, value := range sData {
|
||||
if value.Id == 10 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
intSlice = append(intSlice, num)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
awardInfo := &activity.RankAwardData{}
|
||||
|
||||
for i := 0; i < count; i++ {
|
||||
//随机伤害值
|
||||
randomValue := int64(rand.Intn(intSlice[1]-intSlice[0]+1) + intSlice[0])
|
||||
logger.Logger.Tracef("随机到的伤害值是:%d", randomValue)
|
||||
//计算BUFF
|
||||
if p.WelfData.NianData.BuffCount > 0 {
|
||||
randomValue = randomValue + randomValue/2
|
||||
p.WelfData.NianData.BuffCount -= 1
|
||||
}
|
||||
if p.WelfData.NianData.AttackMaxHp < randomValue {
|
||||
p.WelfData.NianData.AttackMaxHp = randomValue
|
||||
}
|
||||
AttackHp += randomValue
|
||||
if typeId == 3 {
|
||||
p.WelfData.NianData.BigHurt += 1
|
||||
//判断是否掉落保底奖励
|
||||
var guaranteeItems []*model.Item
|
||||
if p.WelfData.NianData.BigHurt%int32(floorCount) == 0 {
|
||||
floorReward := &activity.RankAwardData{}
|
||||
for _, value := range sData {
|
||||
if value.Id == 16 {
|
||||
strSlice := strings.Split(value.PropValue, ",")
|
||||
FloorItemId, _ := strconv.Atoi(strSlice[0])
|
||||
FloorItemNum, _ := strconv.Atoi(strSlice[1])
|
||||
guaranteeItems = append(guaranteeItems, &model.Item{
|
||||
ItemId: int32(FloorItemId),
|
||||
ItemNum: int64(FloorItemNum),
|
||||
})
|
||||
floorReward.ItemId = int32(FloorItemId)
|
||||
floorReward.ItemNum = int64(FloorItemNum)
|
||||
pack.FloorReward = append(pack.FloorReward, floorReward)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: guaranteeItems,
|
||||
GainWay: common.GainWayNianGain_Attack_BigGuarantee,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动-大爆竹保底奖励",
|
||||
})
|
||||
//额外掉落
|
||||
extraItemId := 0
|
||||
extraItemNum := 0
|
||||
var intSlice1 []int
|
||||
for _, value := range sData {
|
||||
if value.Id == 11 {
|
||||
extraItemId, _ = strconv.Atoi(value.PropValue)
|
||||
break
|
||||
}
|
||||
}
|
||||
for _, value := range sData {
|
||||
if value.Id == 12 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
intSlice1 = append(intSlice1, num)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
//随机个数
|
||||
extraItemNum = rand.Intn(intSlice1[1]-intSlice1[0]+1) + intSlice1[0]
|
||||
var extraItems []*model.Item
|
||||
extraItems = append(extraItems, &model.Item{
|
||||
ItemId: int32(extraItemId),
|
||||
ItemNum: int64(extraItemNum),
|
||||
})
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: extraItems,
|
||||
GainWay: common.GainWayNianGain_Attack_BigOther,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动-打爆竹额外活动奖励",
|
||||
})
|
||||
extraDrop := &activity.RankAwardData{}
|
||||
extraDrop.ItemId = int32(extraItemId)
|
||||
extraDrop.ItemNum = int64(extraItemNum)
|
||||
pack.ExtraDrop = append(pack.ExtraDrop, extraDrop)
|
||||
} else {
|
||||
p.WelfData.NianData.LittleHurt += 1
|
||||
//判断是否掉落保底奖励
|
||||
var guaranteeItems []*model.Item
|
||||
if p.WelfData.NianData.LittleHurt%int32(floorCount) == 0 {
|
||||
floorReward := &activity.RankAwardData{}
|
||||
for _, value := range sData {
|
||||
if value.Id == 14 {
|
||||
strSlice := strings.Split(value.PropValue, ",")
|
||||
FloorItemId, _ := strconv.Atoi(strSlice[0])
|
||||
FloorItemNum, _ := strconv.Atoi(strSlice[1])
|
||||
guaranteeItems = append(guaranteeItems, &model.Item{
|
||||
ItemId: int32(FloorItemId),
|
||||
ItemNum: int64(FloorItemNum),
|
||||
})
|
||||
floorReward.ItemId = int32(FloorItemId)
|
||||
floorReward.ItemNum = int64(FloorItemNum)
|
||||
pack.FloorReward = append(pack.FloorReward, floorReward)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: guaranteeItems,
|
||||
GainWay: common.GainWayNianGain_Attack_LittleGuarantee,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动-小爆竹额外掉落奖励",
|
||||
})
|
||||
}
|
||||
}
|
||||
p.WelfData.NianData.BossHp -= AttackHp
|
||||
p.WelfData.NianData.AttackSumHp += AttackHp
|
||||
isDie := false //是否死亡
|
||||
//判断Boss是否死亡
|
||||
var bossDieAward []*model.Item
|
||||
if p.WelfData.NianData.BossHp <= 0 {
|
||||
isDie = true
|
||||
p.WelfData.NianData.BossHp = BossMaxHp
|
||||
p.WelfData.NianData.BossDieCount += 1
|
||||
//获取死亡奖励
|
||||
var bossDieItems []*model.Item
|
||||
for _, value := range pool.List[0].BossDieReward {
|
||||
bossDieItemId := value.ItemId
|
||||
bossDieItemNum := value.ItemNum
|
||||
bossDieAward = append(bossDieAward, &model.Item{
|
||||
ItemId: bossDieItemId,
|
||||
ItemNum: bossDieItemNum,
|
||||
})
|
||||
bossDieItems = append(bossDieItems, &model.Item{
|
||||
ItemId: bossDieItemId,
|
||||
ItemNum: bossDieItemNum,
|
||||
})
|
||||
}
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: bossDieItems,
|
||||
GainWay: common.GainWayNianGain_BossDie,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动-Boss死亡获得",
|
||||
})
|
||||
//年兽死亡额外掉落
|
||||
BigHurtCount := 0
|
||||
for _, value := range sData {
|
||||
if value.Id == 19 {
|
||||
BigHurtCount, _ = strconv.Atoi(value.PropValue)
|
||||
break
|
||||
}
|
||||
}
|
||||
logger.Logger.Trace("年兽死亡额外掉落 当前已使用BigHurt :", p.WelfData.NianData.BigHurt, "BigHurtCount = ", BigHurtCount)
|
||||
if p.WelfData.NianData.BigHurt >= int32(BigHurtCount) {
|
||||
//后台配置额外掉落
|
||||
var bossDieOther []*model.Item
|
||||
for _, info := range pool.List[0].BossDieOtherReward {
|
||||
if p.WelfData.NianData.OtherAwardNum[info.Id] >= info.DropUp {
|
||||
logger.Logger.Trace("BOSS死亡 额外掉落达到上限 id = ", info.Id, "数量:", p.WelfData.NianData.OtherAwardNum[info.Id])
|
||||
continue
|
||||
}
|
||||
//随机
|
||||
if rand.Intn(100)+1 <= int(info.DropRate) {
|
||||
otherItemId := info.ItemId
|
||||
otherItemNum := info.ItemNum
|
||||
if int32(otherItemNum)+p.WelfData.NianData.OtherAwardNum[info.Id] > info.DropUp {
|
||||
otherItemNum = int64(info.DropUp - p.WelfData.NianData.OtherAwardNum[info.Id])
|
||||
}
|
||||
p.WelfData.NianData.OtherAwardNum[info.Id] += int32(otherItemNum)
|
||||
bossDieOther = append(bossDieOther, &model.Item{
|
||||
ItemId: otherItemId,
|
||||
ItemNum: otherItemNum,
|
||||
})
|
||||
bossDieAward = append(bossDieAward, &model.Item{
|
||||
ItemId: otherItemId,
|
||||
ItemNum: otherItemNum,
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: bossDieOther,
|
||||
GainWay: common.GainWayNianGain_BossDieOther,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动-攻击年兽额外获得",
|
||||
})
|
||||
}
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeNianBossKill, &TaskData{SnId: p.SnId, Num: 1}) // BOSS死亡
|
||||
}
|
||||
coinItems := []*model.Item{}
|
||||
coinItems = append(coinItems, &model.Item{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: AttackHp,
|
||||
})
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: coinItems,
|
||||
GainWay: common.GainWayNianGain_Attack_Coin,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动-攻击年兽获得",
|
||||
})
|
||||
awardInfo.ItemId = common.ItemIDCoin
|
||||
awardInfo.ItemNum = AttackHp
|
||||
pack.Award = append(pack.Award, awardInfo)
|
||||
pack.AttackHp = AttackHp
|
||||
pack.TypeId = typeId
|
||||
pack.BossHp = p.WelfData.NianData.BossHp
|
||||
pack.IsDie = isDie
|
||||
for _, item := range bossDieAward {
|
||||
dieInfo := &activity.RankAwardData{}
|
||||
dieInfo.ItemId = item.ItemId
|
||||
dieInfo.ItemNum = item.ItemNum
|
||||
pack.DieAward = append(pack.DieAward, dieInfo)
|
||||
}
|
||||
pack.BuffCount = p.WelfData.NianData.BuffCount
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianAttackData), pack)
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeNianBossDamage, &TaskData{SnId: p.SnId, Num: AttackHp}) // 对年兽造成伤害
|
||||
//更新年兽排行榜榜
|
||||
luckValue := p.WelfData.NianData.AttackMaxHp
|
||||
luckTime := time.Now().Unix()
|
||||
if luckValue < LuckyRankNeed {
|
||||
luckValue = 0
|
||||
luckTime = 0
|
||||
}
|
||||
damage := p.WelfData.NianData.AttackSumHp
|
||||
if luckValue < RankNeed {
|
||||
damage = 0
|
||||
}
|
||||
if luckValue > 0 || damage > 0 {
|
||||
log := &model.NianInfo{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Name: p.Name,
|
||||
Luck: luckValue,
|
||||
Damage: damage,
|
||||
ModId: p.Roles.ModId,
|
||||
Ts: time.Now().Unix(),
|
||||
}
|
||||
if luckTime > 0 {
|
||||
log.LuckTime = luckTime
|
||||
}
|
||||
mq.Write(log)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 请求领取BUFF
|
||||
func CSNianBuff(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
if _, ok := data.(*activity.CSNianBuff); ok {
|
||||
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
||||
logger.Logger.Trace("客户端请求请求领取BUFF snid = ", p.SnId)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
if p.WelfData.NianData == nil {
|
||||
p.WelfData.NianData = &model.NianData{}
|
||||
}
|
||||
if p.WelfData.NianData.BuffStatus {
|
||||
pack := &activity.SCNianBuff{
|
||||
OpRetCode: activity.OpResultCode_Nian_OPRC_Error_Nian,
|
||||
}
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianBuff), pack)
|
||||
return nil
|
||||
}
|
||||
pool := WelfareMgrSington.GetConfig(p.Platform).ActivityNianConfig
|
||||
if pool == nil || pool.List == nil {
|
||||
return nil
|
||||
}
|
||||
if pool.Switch == model.WelfareClose {
|
||||
logger.Logger.Trace("CSNianSignAward 活动关闭!")
|
||||
return nil
|
||||
}
|
||||
StartTs := common.IntToTime(int(pool.List[0].BuffStartTime)).Unix()
|
||||
EndTs := common.IntToTime(int(pool.List[0].BuffEndTime)).Unix()
|
||||
//判断领取时间
|
||||
if time.Now().Unix() >= StartTs && time.Now().Unix() <= EndTs {
|
||||
sData := srvdata.PBDB_NewYearActivityMgr.Datas.GetArr()
|
||||
count := int64(0)
|
||||
for _, value := range sData {
|
||||
if value.Id == 20 {
|
||||
count, _ = strconv.ParseInt(value.PropValue, 10, 64)
|
||||
break
|
||||
}
|
||||
}
|
||||
p.WelfData.NianData.BuffCount = count
|
||||
p.WelfData.NianData.BuffStatus = true
|
||||
pack := &activity.SCNianBuff{
|
||||
BuffCount: p.WelfData.NianData.BuffCount,
|
||||
}
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianBuff), pack)
|
||||
//统计领取BUff
|
||||
//mq.Write()
|
||||
} else {
|
||||
logger.Logger.Trace("CSNianSignAward 活动时间未到!")
|
||||
pack := &activity.SCNianBuff{
|
||||
OpRetCode: activity.OpResultCode_Nian_OPRC_Error_Nian,
|
||||
}
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianBuff), pack)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 领取签到奖励
|
||||
func CSNianSignAward(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
if _, ok := data.(*activity.CSNianSignAward); ok {
|
||||
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
||||
logger.Logger.Trace("领取签到奖励 snid = ", p.SnId)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
pool := WelfareMgrSington.GetConfig(p.Platform).ActivityNianConfig
|
||||
if pool == nil || pool.List == nil {
|
||||
return nil
|
||||
}
|
||||
if pool.Switch == model.WelfareClose {
|
||||
logger.Logger.Trace("CSNianSignAward 活动关闭!")
|
||||
return nil
|
||||
}
|
||||
//判断活动时间
|
||||
startTime := pool.List[0].ActivityStart
|
||||
endTime := pool.List[0].ActivityEnd
|
||||
t, _ := time.Parse(time.DateTime, startTime)
|
||||
// 转换为时间戳(以秒为单位)
|
||||
timestamp := t.Unix()
|
||||
end, _ := time.Parse(time.DateTime, endTime)
|
||||
endTimestamp := end.Unix()
|
||||
nowTime := time.Now().Unix()
|
||||
if nowTime < timestamp || nowTime > endTimestamp {
|
||||
return nil
|
||||
}
|
||||
|
||||
pack := &activity.SCNianSignAward{}
|
||||
if p.WelfData.NianData == nil {
|
||||
p.WelfData.NianData = &model.NianData{}
|
||||
}
|
||||
if p.WelfData.NianData.SignAwardTime > 0 {
|
||||
pack.OpRetCode = activity.OpResultCode_Nian_OPRC_Error_Nian
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianSignAward), pack)
|
||||
return nil
|
||||
}
|
||||
p.WelfData.NianData.SignAwardTime = time.Now().Unix()
|
||||
//奖励
|
||||
pack.SignAwardTime = p.WelfData.NianData.SignAwardTime
|
||||
var items []*model.Item
|
||||
for _, info := range pool.List[0].SignReward {
|
||||
items = append(items, &model.Item{
|
||||
ItemId: info.ItemId,
|
||||
ItemNum: info.ItemNum,
|
||||
})
|
||||
award := &activity.RankAwardData{}
|
||||
award.ItemId = info.ItemId
|
||||
award.ItemNum = info.ItemNum
|
||||
pack.SignAward = append(pack.SignAward, award)
|
||||
}
|
||||
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: items,
|
||||
GainWay: common.GainWayNianGain_Sign,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动-领取签到奖励获得",
|
||||
})
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianSignAward), pack)
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeNianSign, &TaskData{SnId: p.SnId, Num: 1})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func CSNianChange(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
if msg, ok := data.(*activity.CSNianChange); ok {
|
||||
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
||||
logger.Logger.Trace("客户端请求请求年兽兑换 snid = ", p.SnId)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
pool := WelfareMgrSington.GetConfig(p.Platform).ActivityNianConfig
|
||||
if pool == nil || pool.List == nil {
|
||||
return nil
|
||||
}
|
||||
if pool.Switch == model.WelfareClose {
|
||||
logger.Logger.Trace("CSNianSignAward 活动关闭!")
|
||||
return nil
|
||||
}
|
||||
//判断活动时间
|
||||
startTime := pool.List[0].ActivityStart
|
||||
endTime := pool.List[0].ActivityEnd
|
||||
t, _ := time.Parse(time.DateTime, startTime)
|
||||
// 转换为时间戳(以秒为单位)
|
||||
timestamp := t.Unix()
|
||||
end, _ := time.Parse(time.DateTime, endTime)
|
||||
endTimestamp := end.Unix()
|
||||
nowTime := time.Now().Unix()
|
||||
if nowTime < timestamp || nowTime > endTimestamp {
|
||||
return nil
|
||||
}
|
||||
num := msg.Num
|
||||
if num <= 0 || num > 99 {
|
||||
return nil
|
||||
}
|
||||
|
||||
sData := srvdata.PBDB_NewYearActivityMgr.Datas.GetArr()
|
||||
itemNum := 0
|
||||
coin := 0
|
||||
diamond := 0
|
||||
for _, value := range sData {
|
||||
if value.Id == 21 {
|
||||
strSlice := strings.Split(value.PropValue, ",")
|
||||
diamond, _ = strconv.Atoi(strSlice[0])
|
||||
itemNum, _ = strconv.Atoi(strSlice[1])
|
||||
coin, _ = strconv.Atoi(strSlice[2])
|
||||
break
|
||||
}
|
||||
}
|
||||
pack := &activity.SCNianChange{}
|
||||
if p.Diamond < int64(diamond*int(num)) {
|
||||
pack.OpRetCode = activity.OpResultCode_Nian_OPRC_Error_Nian
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianChange), pack)
|
||||
return nil
|
||||
}
|
||||
p.AddDiamond(int64(-diamond*int(num)), 0, common.GainWayNianCost, "sys", "年兽活动兑换道具")
|
||||
var items []*model.Item
|
||||
items = append(items, &model.Item{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: int64(coin * int(num)),
|
||||
})
|
||||
items = append(items, &model.Item{
|
||||
ItemId: common.ItemIDLittleGuaranteed,
|
||||
ItemNum: int64(itemNum * int(num)),
|
||||
})
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: items,
|
||||
GainWay: common.GainWayNianGain_Change,
|
||||
Operator: "system",
|
||||
Remark: "年兽活动-兑换",
|
||||
})
|
||||
|
||||
pack.Num = num
|
||||
for _, item := range items {
|
||||
info := &activity.RankAwardData{
|
||||
ItemId: item.ItemId,
|
||||
ItemNum: item.ItemNum,
|
||||
}
|
||||
pack.Award = append(pack.Award, info)
|
||||
}
|
||||
p.SendToClient(int(activity.NianPacketID_PACKET_SCNianChange), pack)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func init() {
|
||||
common.Register(int(activity.NianPacketID_PACKET_CSNianData), activity.CSNianData{}, CSNianData)
|
||||
common.Register(int(activity.NianPacketID_PACKET_CSNianAttack), activity.CSNianAttack{}, CSNianAttack)
|
||||
common.Register(int(activity.NianPacketID_PACKET_CSNianBuff), activity.CSNianBuff{}, CSNianBuff)
|
||||
common.Register(int(activity.NianPacketID_PACKET_CSNianSignAward), activity.CSNianSignAward{}, CSNianSignAward)
|
||||
common.Register(int(activity.NianPacketID_PACKET_CSNianChange), activity.CSNianChange{}, CSNianChange)
|
||||
}
|
||||
|
|
@ -128,17 +128,24 @@ func init() {
|
|||
//比赛场不处理下面的内容
|
||||
if !scene.IsMatchScene() && !scene.IsCustom() {
|
||||
// 破产检测
|
||||
sdata := srvdata.PBDB_GameSubsidyMgr.GetData(GameSubsidyid)
|
||||
if sdata != nil {
|
||||
if !p.IsRob && p.takeCoin > msg.GetReturnCoin() && p.takeCoin >= int64(sdata.LimitNum) && msg.GetReturnCoin() < int64(sdata.LimitNum) {
|
||||
CostCoin := p.takeCoin - msg.GetReturnCoin()
|
||||
|
||||
logger.Logger.Infof("NewBankruptLogEx: snid:%v GetReturnCoin:%v coin:%v CostCoin:%v", p.SnId, msg.GetReturnCoin(), p.takeCoin, CostCoin)
|
||||
log := model.NewBankruptLogEx(p.SnId, scene.dbGameFree.GetId(), p.CreateTime.Unix(), CostCoin,
|
||||
p.Platform, p.Channel, p.ChannelId, scene.dbGameFree.GetGameDif(), scene.gameId)
|
||||
if log != nil {
|
||||
mq.Write(log)
|
||||
if !p.IsRob {
|
||||
for _, v := range srvdata.PBDB_GameBankruptcyMgr.Datas.GetArr() {
|
||||
if v.GetGameDif() == "" || v.GetLimitNum() <= 0 {
|
||||
continue
|
||||
}
|
||||
if v.GetGameDif() != scene.dbGameFree.GetGameDif() {
|
||||
continue
|
||||
}
|
||||
if p.takeCoin > msg.GetReturnCoin() && p.takeCoin >= int64(v.GetLimitNum()) && msg.GetReturnCoin() < int64(v.GetLimitNum()) {
|
||||
CostCoin := p.takeCoin - msg.GetReturnCoin()
|
||||
logger.Logger.Infof("NewBankruptLogEx: snid:%v GetReturnCoin:%v coin:%v CostCoin:%v", p.SnId, msg.GetReturnCoin(), p.takeCoin, CostCoin)
|
||||
log := model.NewBankruptLogEx(p.SnId, scene.dbGameFree.GetId(), p.CreateTime.Unix(), CostCoin,
|
||||
p.Platform, p.Channel, p.ChannelId, scene.dbGameFree.GetGameDif(), scene.gameId)
|
||||
if log != nil {
|
||||
mq.Write(log)
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
// 破产检测
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"mongo.games.com/game/srvdata"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
|
|
@ -12,7 +15,6 @@ import (
|
|||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/proto"
|
||||
"mongo.games.com/game/protocol/shop"
|
||||
"mongo.games.com/game/srvdata"
|
||||
)
|
||||
|
||||
type CSShopInfoPacketFactory struct {
|
||||
|
|
@ -189,6 +191,49 @@ func (this *CSVCPayShopHandler) Process(s *netlib.Session, packetid int, data in
|
|||
SendClient(shop.OpResultCode_OPRC_Error)
|
||||
return nil
|
||||
}
|
||||
case ShopPageNian:
|
||||
sData := srvdata.PBDB_NewYearActivityMgr.Datas.GetArr()
|
||||
var intSlice []int
|
||||
var shopNum []int
|
||||
for _, value := range sData {
|
||||
if value.Id == 17 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
intSlice = append(intSlice, num)
|
||||
}
|
||||
}
|
||||
if value.Id == 18 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
shopNum = append(shopNum, num)
|
||||
}
|
||||
}
|
||||
}
|
||||
shopPos := 0
|
||||
for i, id := range intSlice {
|
||||
if id == int(shopInfo.Id) {
|
||||
shopPos = i
|
||||
break
|
||||
}
|
||||
}
|
||||
num := shopNum[shopPos]
|
||||
if num > 0 {
|
||||
if p.WelfData.NianData.GiftShop[shopInfo.Id] >= int32(num) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
default:
|
||||
}
|
||||
|
||||
|
|
@ -426,7 +471,8 @@ func (this *CSPayInfoHandler) Process(s *netlib.Session, packetid int, data inte
|
|||
if shopInfo.Page == ShopPageDiamondBank {
|
||||
// 检查每日领取次数
|
||||
fGetPropValue := func(propName string) int32 {
|
||||
pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||
//pool := srvdata.PBDB_Pigbank_PropMgr.Datas.GetArr()
|
||||
pool := PlatformMgrSingleton.GetPigBankPropArr(p.Platform)
|
||||
for _, PropItem := range pool {
|
||||
if PropItem.PorpName == propName {
|
||||
return PropItem.PropValue
|
||||
|
|
@ -474,6 +520,45 @@ func (this *CSPayInfoHandler) Process(s *netlib.Session, packetid int, data inte
|
|||
return nil
|
||||
}
|
||||
}
|
||||
if shopInfo.Page == ShopPageNian {
|
||||
sData := srvdata.PBDB_NewYearActivityMgr.Datas.GetArr()
|
||||
var intSlice []int
|
||||
var shopNum []int
|
||||
for _, value := range sData {
|
||||
if value.Id == 17 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, _ := strconv.Atoi(s)
|
||||
intSlice = append(intSlice, num)
|
||||
}
|
||||
}
|
||||
if value.Id == 18 {
|
||||
str := value.PropValue
|
||||
strSlice := strings.Split(str, ",")
|
||||
// 转换每个字符串为 int
|
||||
for _, s := range strSlice {
|
||||
num, _ := strconv.Atoi(s)
|
||||
shopNum = append(shopNum, num)
|
||||
}
|
||||
}
|
||||
}
|
||||
shopPos := 0
|
||||
for i, id := range intSlice {
|
||||
if id == int(shopInfo.Id) {
|
||||
shopPos = i
|
||||
break
|
||||
}
|
||||
}
|
||||
num := shopNum[shopPos]
|
||||
if num > 0 {
|
||||
if p.WelfData.NianData.GiftShop[shopInfo.Id] >= int32(num) {
|
||||
SendClient(shop.OpResultCode_OPRC_Error)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
ShopMgrSington.SendAPICreateOrder(p, msg.ConfigPayId, shopInfo, "shop_goods_xj")
|
||||
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -27,125 +27,6 @@ func init() {
|
|||
common.Register(int(taskproto.TaskPacketID_PACKET_CSDebugInc), taskproto.CSTaskDebugInc{}, CSTaskDebugInc)
|
||||
}
|
||||
|
||||
// GetTaskTimes 获取任务完成进度
|
||||
func GetTaskTimes(p *Player, id int32) int64 {
|
||||
if p.WelfData != nil && p.WelfData.Task[id] != nil {
|
||||
return p.WelfData.Task[id].N
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// IsTaskFinish 是否任务完成
|
||||
func IsTaskFinish(p *Player, id int32) bool {
|
||||
data := srvdata.PBDB_TaskMgr.GetData(id)
|
||||
if data == nil {
|
||||
return false
|
||||
}
|
||||
if p.WelfData != nil && p.WelfData.Task[id] != nil {
|
||||
return p.WelfData.Task[id].N >= data.GetTargetTimes()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsTaskReward 是否任务奖励已领取
|
||||
func IsTaskReward(p *Player, id int32) bool {
|
||||
if p.WelfData != nil && p.WelfData.Task != nil {
|
||||
if data := p.WelfData.Task[id]; data != nil && data.Ts > 0 {
|
||||
t := srvdata.PBDB_TaskMgr.GetData(id)
|
||||
switch t.ActivityType {
|
||||
case common.TaskActivityTypeEveryDay, common.TaskActivityTypePermitEveryDay:
|
||||
if common.TsInSameDay(time.Now().Unix(), data.Ts) {
|
||||
return true
|
||||
}
|
||||
|
||||
case common.TaskActivityTypeWeek:
|
||||
if common.TsInSameWeek(time.Now().Unix(), data.Ts) {
|
||||
return true
|
||||
}
|
||||
|
||||
case common.TaskActivityTypeNovice, common.TaskActivityTypeInvite, common.TaskActivityTypeAchieve:
|
||||
if data.Ts > 0 {
|
||||
return true
|
||||
}
|
||||
case common.TaskActivityTypePermit:
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs > 0 {
|
||||
return data.Ts >= startTs && data.Ts < endTs
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func SendReward(p *Player, m map[int64]int64, tp int32) {
|
||||
isPermit := p.GetIsPermit()
|
||||
add := p.GetSkillAdd(common.SkillIdTask)
|
||||
var items []*model.Item
|
||||
for k, v := range m {
|
||||
if k == common.ItemIDPermit && isPermit {
|
||||
v += int64(float64(v) * common.PermitAdd)
|
||||
}
|
||||
// 皮肤技能每日任务金币加成
|
||||
if tp == common.TaskActivityTypeEveryDay && add > 0 && k == common.ItemIDCoin {
|
||||
v += int64((float64(v) * float64(add)) / 100.0)
|
||||
}
|
||||
items = append(items, &model.Item{
|
||||
ItemId: int32(k),
|
||||
ItemNum: v,
|
||||
})
|
||||
}
|
||||
gain := int32(0)
|
||||
giveType := int32(-1)
|
||||
switch tp {
|
||||
case 1:
|
||||
gain = common.GainWayItemTaskEveryDay
|
||||
giveType = model.SystemFreeGive_GiveType_TaskEveryDay
|
||||
case 2:
|
||||
gain = common.GainWayItemWeekActive
|
||||
giveType = model.SystemFreeGive_GiveType_TaskWeekActive
|
||||
case 3:
|
||||
gain = common.GainWayItemTaskNewPlayer
|
||||
giveType = model.SystemFreeGive_GiveType_TaskNewPlayer
|
||||
case 4:
|
||||
gain = common.GainWayItemTaskInvite
|
||||
giveType = model.SystemFreeGive_GiveType_TaskInvite
|
||||
case 5:
|
||||
gain = common.GainWayItemTaskAchievement
|
||||
giveType = model.SystemFreeGive_GiveType_TaskAchievement
|
||||
case 6:
|
||||
gain = common.GainWayItemTaskPermit
|
||||
giveType = model.SystemFreeGive_GiveType_TaskPermit
|
||||
}
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: items,
|
||||
Add: 0,
|
||||
GainWay: gain,
|
||||
Operator: "system",
|
||||
Remark: "任务奖励",
|
||||
GameId: 0,
|
||||
GameFreeId: 0,
|
||||
})
|
||||
for _, v := range items {
|
||||
tp := int32(-1)
|
||||
if v.ItemId == common.ItemIDCoin {
|
||||
tp = model.SystemFreeGive_CoinType_Coin
|
||||
} else if v.ItemId == common.ItemIDDiamond {
|
||||
tp = model.SystemFreeGive_CoinType_Diamond
|
||||
}
|
||||
if !p.IsRob && tp >= 0 && giveType >= 0 {
|
||||
mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, giveType, tp, v.ItemNum))
|
||||
}
|
||||
}
|
||||
if giveType == model.SystemFreeGive_GiveType_TaskPermit {
|
||||
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_Permit, 1))
|
||||
}
|
||||
}
|
||||
|
||||
func CSTaskList(s *netlib.Session, packetId int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSTaskList %v", data)
|
||||
msg, ok := data.(*taskproto.CSTaskList)
|
||||
|
|
@ -161,6 +42,14 @@ func CSTaskList(s *netlib.Session, packetId int, data interface{}, sid int64) er
|
|||
ret := &taskproto.SCTaskList{
|
||||
Tp: msg.GetTp(),
|
||||
}
|
||||
if msg.GetTp() == common.TaskActivityTypeConsume {
|
||||
conf := WelfareMgrSington.GetConfig(p.Platform).ConsumeConfig
|
||||
if conf != nil {
|
||||
ret.StartTs = common.StrTimeToTs(conf.StartTime)
|
||||
ret.EndTs = common.StrTimeToTs(conf.EndTime)
|
||||
ret.On = conf.GetOn() == common.On
|
||||
}
|
||||
}
|
||||
|
||||
for _, v := range srvdata.TaskMgr.GetActivityType(msg.GetTp()) {
|
||||
item := &taskproto.TaskData{
|
||||
|
|
@ -227,7 +116,7 @@ func CSTaskReward(s *netlib.Session, packetId int, data interface{}, sid int64)
|
|||
}
|
||||
data := srvdata.PBDB_TaskMgr.GetData(id)
|
||||
if data != nil {
|
||||
SendReward(p, data.Award, msg.Tp)
|
||||
SendTaskReward(p, data.Award, msg.Tp)
|
||||
for k, vv := range data.GetAward() {
|
||||
if k == common.ItemIDPermit && isPermit {
|
||||
vv += int64(float64(vv) * common.PermitAdd)
|
||||
|
|
@ -247,12 +136,22 @@ func CSTaskReward(s *netlib.Session, packetId int, data interface{}, sid int64)
|
|||
taskLog.TaskName = data.GetDes()
|
||||
taskLog.ActivityType = data.GetActivityType()
|
||||
taskLog.TaskType = data.GetTaskType()
|
||||
taskLog.RemainDiamond = p.Diamond
|
||||
}
|
||||
mq.Write(taskLog)
|
||||
ret.OpCode = taskproto.OpResultCode_OPRC_Success
|
||||
}
|
||||
}
|
||||
|
||||
if msg.GetTp() == common.TaskActivityTypeConsume {
|
||||
conf := WelfareMgrSington.GetConfig(p.Platform).ConsumeConfig
|
||||
if conf == nil || conf.GetOn() != common.On || now.Unix() < common.StrTimeToTs(conf.StartTime) || now.Unix() >= common.StrTimeToTs(conf.EndTime) {
|
||||
p.SendToClient(int(taskproto.TaskPacketID_PACKET_SCTaskReward), ret)
|
||||
logger.Logger.Tracef("SCTaskReward %v", ret)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if msg.Tp > 0 && msg.Id == 0 {
|
||||
// 一键领取
|
||||
for _, v := range srvdata.TaskMgr.GetActivityType(msg.GetTp()) {
|
||||
|
|
|
|||
|
|
@ -1344,6 +1344,40 @@ func CSClientUpgrades(s *netlib.Session, packetid int, data interface{}, sid int
|
|||
return nil
|
||||
}
|
||||
|
||||
func CSRedPacketInfo(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSRedPacketInfo Process recv %v", data)
|
||||
_, ok := data.(*welfare.CSRedPacketInfo)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
pack := WelfareMgrSington.SendRedPacketInfo(p)
|
||||
logger.Logger.Tracef("SCRedPacketInfo: %v", pack)
|
||||
return nil
|
||||
}
|
||||
|
||||
func CSRedPacketDraw(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSRedPacketDraw Process recv %v", data)
|
||||
msg, ok := data.(*welfare.CSRedPacketDraw)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
pack := WelfareMgrSington.GetRedPacket(p, msg.GetId())
|
||||
logger.Logger.Tracef("SCRedPacketDraw: %v", pack)
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
// 领取救济金
|
||||
common.RegisterHandler(int(welfare.SPacketID_PACKET_CS_WELF_GETRELIEFFUND), &CSGetReliefFundHandler{})
|
||||
|
|
@ -1411,4 +1445,8 @@ func init() {
|
|||
common.Register(int(welfare.SPacketID_PACKET_CSPermitShop), welfare.CSPermitShop{}, CSPermitShop)
|
||||
// 客户端升级奖励信息
|
||||
common.Register(int(upgrade.PacketID_PACKET_CSClientUpgrades), upgrade.CSClientUpgrades{}, CSClientUpgrades)
|
||||
// 红包活动信息
|
||||
common.Register(int(welfare.SPacketID_PACKET_CSRedPacketInfo), welfare.CSRedPacketInfo{}, CSRedPacketInfo)
|
||||
// 红包活动领取
|
||||
common.Register(int(welfare.SPacketID_PACKET_CSRedPacketDraw), welfare.CSRedPacketDraw{}, CSRedPacketDraw)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,171 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"golang.org/x/exp/maps"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
webapiproto "mongo.games.com/game/protocol/webapi"
|
||||
)
|
||||
|
||||
var RedPacketMgrInst = &RedPacketMgr{
|
||||
RedPacketData: make(map[string]map[int64]*model.RedPacket),
|
||||
}
|
||||
|
||||
func init() {
|
||||
module.RegisteModule(RedPacketMgrInst, time.Hour, 0)
|
||||
|
||||
common.RegisterClockFunc(&common.ClockFunc{
|
||||
OnDayTimerFunc: func() {
|
||||
RedPacketMgrInst.RedPacketData = make(map[string]map[int64]*model.RedPacket)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type RedPacketMgr struct {
|
||||
RedPacketData map[string]map[int64]*model.RedPacket // 红包活动状态 平台:活动id:活动状态
|
||||
}
|
||||
|
||||
func (m *RedPacketMgr) ModuleName() string {
|
||||
return "RedPacketMgr"
|
||||
}
|
||||
|
||||
func (m *RedPacketMgr) Init() {
|
||||
// 加载红包配置
|
||||
for _, v := range PlatformMgrSingleton.GetPlatforms() {
|
||||
if v == nil || v.IdStr == common.Platform_Sys {
|
||||
continue
|
||||
}
|
||||
list, err := model.GetRedPacketAll(v.IdStr)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("GetRedPacketAll error: %v", err))
|
||||
}
|
||||
for _, v1 := range list {
|
||||
if m.RedPacketData[v.IdStr] == nil {
|
||||
m.RedPacketData[v.IdStr] = make(map[int64]*model.RedPacket)
|
||||
}
|
||||
m.RedPacketData[v.IdStr][v1.Cid] = &model.RedPacket{
|
||||
Cid: v1.Cid,
|
||||
Use: v1.Use,
|
||||
Ts: v1.Ts,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (m *RedPacketMgr) Update() {
|
||||
}
|
||||
|
||||
func (m *RedPacketMgr) Shutdown() {
|
||||
// 保存红包配置
|
||||
for k, v := range m.RedPacketData {
|
||||
if err := model.UpdateRedPacketAll(k, maps.Values(v)); err != nil {
|
||||
logger.Logger.Errorf("UpdateRedPacketAll error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
module.UnregisteModule(m)
|
||||
}
|
||||
|
||||
// GetRemainReward 获取剩余奖励数量
|
||||
func (m *RedPacketMgr) GetRemainReward(plt string, id int64) int64 {
|
||||
v, ok := m.RedPacketData[plt]
|
||||
if !ok {
|
||||
v = make(map[int64]*model.RedPacket)
|
||||
m.RedPacketData[plt] = v
|
||||
}
|
||||
d, ok := v[id]
|
||||
if !ok {
|
||||
d = &model.RedPacket{
|
||||
Cid: id,
|
||||
Use: make(map[int64]int64),
|
||||
Ts: time.Now().Unix(),
|
||||
}
|
||||
v[id] = d
|
||||
}
|
||||
|
||||
cfg := WelfareMgrSington.GetConfig(plt).RedPacketConfig
|
||||
if cfg == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
for _, v := range cfg.GetList() {
|
||||
if v.Id == id {
|
||||
total := 0
|
||||
for k1, v1 := range d.Use {
|
||||
total += int(k1 * v1)
|
||||
}
|
||||
|
||||
ret := v.GetTotalNum() - int64(total)
|
||||
if ret < 0 {
|
||||
ret = 0
|
||||
}
|
||||
return ret
|
||||
}
|
||||
}
|
||||
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
// GetRemainTimes 获取剩余次数
|
||||
// 返回最大次数和剩余次数
|
||||
func (m *RedPacketMgr) GetRemainTimes(p *Player, id int64) (int64, int64) {
|
||||
var cfg *webapiproto.RedPacketInfo
|
||||
for _, v := range WelfareMgrSington.GetConfig(p.Platform).RedPacketConfig.GetList() {
|
||||
if v.GetId() == id {
|
||||
cfg = v
|
||||
break
|
||||
}
|
||||
}
|
||||
return m.GetRemainTimesByConfig(p, cfg)
|
||||
}
|
||||
|
||||
// GetRemainTimesByConfig 获取剩余次数
|
||||
// 返回最大次数和剩余次数
|
||||
func (m *RedPacketMgr) GetRemainTimesByConfig(p *Player, cfg *webapiproto.RedPacketInfo) (int64, int64) {
|
||||
if cfg == nil {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
if cfg.GetMaxCount() <= 0 {
|
||||
return -1, -1
|
||||
}
|
||||
|
||||
n := 0
|
||||
if p.WelfData != nil && p.WelfData.RedPacket != nil {
|
||||
if _, exist := p.WelfData.RedPacket[cfg.GetId()]; exist {
|
||||
n = int(p.WelfData.RedPacket[cfg.GetId()].N)
|
||||
}
|
||||
}
|
||||
remainCount := cfg.GetMaxCount() - int64(n)
|
||||
if remainCount < 0 {
|
||||
remainCount = 0
|
||||
}
|
||||
return cfg.GetMaxCount(), remainCount
|
||||
}
|
||||
|
||||
// AddUse 添加使用红包
|
||||
func (m *RedPacketMgr) AddUse(plt string, id int64, n int64) {
|
||||
v, ok := m.RedPacketData[plt]
|
||||
if !ok {
|
||||
v = make(map[int64]*model.RedPacket)
|
||||
m.RedPacketData[plt] = v
|
||||
}
|
||||
d, ok := v[id]
|
||||
if !ok {
|
||||
d = &model.RedPacket{
|
||||
Cid: id,
|
||||
Use: make(map[int64]int64),
|
||||
Ts: time.Now().Unix(),
|
||||
}
|
||||
v[id] = d
|
||||
}
|
||||
d.Use[n]++
|
||||
d.Ts = time.Now().Unix()
|
||||
}
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"math"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"sort"
|
||||
)
|
||||
|
||||
const (
|
||||
ActState_Login int32 = 1 << iota //登录.1
|
||||
ActState_Exchange //兑换.2
|
||||
ActState_Game //游戏.3
|
||||
ActState_Max
|
||||
)
|
||||
|
||||
var ActMonitorMgrSington = &ActMonitorMgr{
|
||||
ActMonitorList: make(map[int64]*ActMonitorInfo),
|
||||
}
|
||||
|
||||
type ActMonitorInfo struct {
|
||||
SeqNo int64
|
||||
SnId int32
|
||||
Platform string //平台
|
||||
MonitorType int32 //二进制 1.登录 2.兑换 3.游戏
|
||||
CreateTime int64 //创建时间
|
||||
Creator string //创建者
|
||||
ReMark string //备注
|
||||
GameName string //当前所在游戏名字
|
||||
State int //玩家状态 0.全部 1.不在线 2.在线 3.游戏中
|
||||
}
|
||||
type ActMonitorMgr struct {
|
||||
ActMonitorList map[int64]*ActMonitorInfo
|
||||
NowActSeqNo int64
|
||||
}
|
||||
|
||||
// monitorType 自己的类型 flag 当前触发的类型
|
||||
func (u *ActMonitorMgr) IsMarkFlag(monitorType, flag int32) bool {
|
||||
if (monitorType & flag) != 0 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
func (u *ActMonitorMgr) Init() {
|
||||
actMonitorData := model.GetAllActMonitorData()
|
||||
for _, info := range actMonitorData {
|
||||
ami := &ActMonitorInfo{
|
||||
SeqNo: info.SeqNo,
|
||||
SnId: info.SnId,
|
||||
Platform: info.Platform,
|
||||
MonitorType: info.MonitorType,
|
||||
CreateTime: info.CreateTime,
|
||||
Creator: info.Creator,
|
||||
ReMark: info.ReMark,
|
||||
}
|
||||
if u.NowActSeqNo < info.SeqNo {
|
||||
u.NowActSeqNo = info.SeqNo
|
||||
}
|
||||
u.ActMonitorList[info.SeqNo] = ami
|
||||
}
|
||||
}
|
||||
|
||||
type ActMonitorList struct {
|
||||
PageNo int
|
||||
PageSize int
|
||||
PageSum int
|
||||
TotalSum int
|
||||
Data []*ActMonitorInfo
|
||||
}
|
||||
|
||||
func (u *ActMonitorMgr) QueryAMIList(pageNo, pageSize int, platform string, snid, startTs, endTs, state int) *ActMonitorList {
|
||||
if len(u.ActMonitorList) == 0 {
|
||||
return nil
|
||||
}
|
||||
var amiList = make([]*ActMonitorInfo, 0)
|
||||
for _, v := range u.ActMonitorList {
|
||||
if len(platform) != 0 && v.Platform != platform {
|
||||
continue
|
||||
}
|
||||
if snid != 0 && v.SnId != int32(snid) {
|
||||
continue
|
||||
}
|
||||
if startTs != 0 && endTs != 0 && (v.CreateTime < int64(startTs) || v.CreateTime > int64(endTs)) {
|
||||
continue
|
||||
}
|
||||
if state != 0 && v.State != state {
|
||||
continue
|
||||
}
|
||||
amiList = append(amiList, v)
|
||||
}
|
||||
sort.Slice(amiList, func(i, j int) bool {
|
||||
if amiList[i].SeqNo > amiList[j].SeqNo {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
totalNum := len(amiList) //总条目
|
||||
pageSum := int(math.Ceil(float64(totalNum) / float64(pageSize))) //总页数
|
||||
if pageNo <= 0 || pageNo > pageSum {
|
||||
pageNo = 1 //当前页
|
||||
}
|
||||
start := (pageNo - 1) * pageSize
|
||||
end := start + pageSize
|
||||
if totalNum > start {
|
||||
if totalNum < end {
|
||||
end = totalNum
|
||||
}
|
||||
amiList = amiList[start:end]
|
||||
}
|
||||
for k, v := range amiList {
|
||||
actPlayer := amiList[k]
|
||||
actPlayer.GameName = ""
|
||||
p := PlayerMgrSington.GetPlayerBySnId(v.SnId)
|
||||
if p != nil {
|
||||
if p.IsOnLine() {
|
||||
actPlayer.State = 2
|
||||
} else {
|
||||
actPlayer.State = 1
|
||||
}
|
||||
if p.scene != nil {
|
||||
actPlayer.State = 3
|
||||
actPlayer.GameName = p.scene.dbGameFree.GetName() + p.scene.dbGameFree.GetTitle()
|
||||
}
|
||||
} else {
|
||||
actPlayer.State = 1
|
||||
}
|
||||
}
|
||||
return &ActMonitorList{pageNo, pageSize, pageSum, totalNum, amiList}
|
||||
}
|
||||
func (u *ActMonitorMgr) Edit(amt *ActMonitorInfo) {
|
||||
u.ActMonitorList[amt.SeqNo] = amt
|
||||
}
|
||||
func (u *ActMonitorMgr) Del(seqNo int64) {
|
||||
delete(u.ActMonitorList, seqNo)
|
||||
}
|
||||
func (u *ActMonitorMgr) AddSeqNo() int64 {
|
||||
u.NowActSeqNo++
|
||||
return u.NowActSeqNo
|
||||
}
|
||||
func (u *ActMonitorMgr) GetSeqNo(snid int32, platform string) int64 {
|
||||
for _, v := range u.ActMonitorList {
|
||||
if v.SnId == snid && v.Platform == platform {
|
||||
return v.SeqNo
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
func (u *ActMonitorMgr) SendActMonitorEvent(eventType, snid int32, name, platform string, billNo, exchangeCoin int64,
|
||||
gameSceneName string, state int32) {
|
||||
logger.Logger.Tracef("SendActMonitorEvent eventType:%v snid:%v name:%v platform:%v billNo:%v exchangeCoin:%v "+
|
||||
"gameSceneName:%v state:%v", eventType, snid, name, platform, billNo, exchangeCoin, gameSceneName, state)
|
||||
//seqNo := u.GetSeqNo(snid, platform)
|
||||
//if data, ok := u.ActMonitorList[seqNo]; ok {
|
||||
// if u.IsMarkFlag(eventType, data.MonitorType) {
|
||||
// var flag int32
|
||||
// if eventType == ActState_Login {
|
||||
// flag = 1
|
||||
// } else if eventType == ActState_Exchange {
|
||||
// flag = 2
|
||||
// } else if eventType == ActState_Game {
|
||||
// flag = 3
|
||||
// }
|
||||
// logger.Logger.Tracef("GenerateActMonitorEvent "+
|
||||
// "flag:%v eventType:%v snid:%v name:%v platform:%v billNo:%v exchangeCoin:%v "+
|
||||
// "gameSceneName:%v state:%v reMark:%v",
|
||||
// flag, eventType, snid, name, platform, billNo, exchangeCoin, gameSceneName, state, data.ReMark)
|
||||
// LogChannelSingleton.WriteMQData(model.GenerateActMonitorEvent(flag, snid, name, platform,
|
||||
// time.Now().Unix(), billNo, exchangeCoin, gameSceneName, state, data.ReMark))
|
||||
// }
|
||||
//}
|
||||
}
|
||||
func init() {
|
||||
//RegisterParallelLoadFunc("用户行为监控列表", func() error {
|
||||
// ActMonitorMgrSington.Init()
|
||||
// return nil
|
||||
//})
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ func (this *AwardLogManager) UpdateAnnouncerLog(data model.AnnouncerLog) {
|
|||
func (this *AwardLogManager) Init() {
|
||||
this.AwardMap = make(map[string]map[int32]map[int32]int64)
|
||||
for _, v := range PlatformMgrSingleton.platforms {
|
||||
if v != nil {
|
||||
if v != nil && v.IdStr != common.Platform_Sys {
|
||||
// 获取道具获得总数
|
||||
res, err := model.FetchAwardLog(v.IdStr)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -106,6 +106,17 @@ func init() {
|
|||
etcd.Register(etcd.ETCDKEY_LotteryConfig, webapi.LotteryConfig{}, platformConfigEvent)
|
||||
// 用户抽奖
|
||||
etcd.Register(etcd.ETCDKEY_LotteryUser, webapi.UserLottery{}, handlerEvent)
|
||||
// 存钱罐消耗获得
|
||||
etcd.Register(etcd.ETCDKEY_PigBankDiamond, webapi.GamePigBankDiamondConfig{}, platformConfigEvent)
|
||||
// 存钱罐属性值
|
||||
etcd.Register(etcd.ETCDKEY_PigBankProp, webapi.GamePigBankPropConfig{}, platformConfigEvent)
|
||||
//年兽配置
|
||||
etcd.Register(etcd.ETCDKEY_NianConfig, webapi.ActivityNianConfig{}, platformConfigEvent)
|
||||
etcd.Register(etcd.ETCDKEY_NianRankConfig, webapi.NianRankReward{}, platformConfigEvent)
|
||||
// 红包配置
|
||||
etcd.Register(etcd.KeyRedPacket, webapi.RedPacketConfig{}, platformConfigEvent)
|
||||
// 累计消耗活动配置
|
||||
etcd.Register(etcd.KeyActConsume, webapi.ConsumeConfig{}, platformConfigEvent)
|
||||
}
|
||||
|
||||
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
||||
|
|
@ -347,6 +358,19 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
|||
case *webapi.LotteryConfig:
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).LotteryConfig = config
|
||||
LotteryMgrInst.UpdateConfig(config)
|
||||
case *webapi.GamePigBankDiamondConfig:
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).GamePigBankDiamondConfig = config
|
||||
case *webapi.GamePigBankPropConfig:
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).GamePigBankPropConfig = config
|
||||
case *webapi.ActivityNianConfig:
|
||||
WelfareMgrSington.UpdateActivityNianStatus(config)
|
||||
case *webapi.NianRankReward:
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).NianRankReward = config
|
||||
case *webapi.RedPacketConfig:
|
||||
WelfareMgrSington.UpdateRedPacket(config, isInit)
|
||||
case *webapi.ConsumeConfig:
|
||||
WelfareMgrSington.UpdateConsumeConfig(config)
|
||||
|
||||
default:
|
||||
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -564,13 +564,69 @@ func (this *FriendMgr) FriendAgree(p *Player, destP *model.BindFriend) {
|
|||
}
|
||||
logger.Logger.Tracef(">>FriendAgree %d -> %d, %v", p.SnId, destP.SnId, pack)
|
||||
}
|
||||
|
||||
// 删除申请者的申请列表
|
||||
delApplyListFunc := func(plt string, snid int32, applySnid int32) friend.OpResultCode {
|
||||
// 删除被申请者的申请列表
|
||||
list1, err := model.QueryFriendApplyBySnid(plt, snid)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("QueryFriendApplyBySnid %v error: %v", snid, err)
|
||||
return friend.OpResultCode_OPRC_Error
|
||||
}
|
||||
if list1 != nil {
|
||||
k := 0
|
||||
for k < len(list1.ApplySnids) {
|
||||
if list1.ApplySnids[k].SnId == applySnid {
|
||||
list1.ApplySnids = append(list1.ApplySnids[:k], list1.ApplySnids[k+1:]...)
|
||||
model.UpsertFriendApply(plt, snid, list1)
|
||||
} else {
|
||||
k++
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除发起方的申请列表
|
||||
list2, err := model.QueryFriendApplyListBySnid(plt, applySnid)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("QueryFriendApplyListBySnid %v error: %v", applySnid, err)
|
||||
return friend.OpResultCode_OPRC_Error
|
||||
}
|
||||
if list2 != nil {
|
||||
k := 0
|
||||
for k < len(list2.List) {
|
||||
if list2.List[k] == snid {
|
||||
list2.List = append(list2.List[:k], list2.List[k+1:]...)
|
||||
model.UpsertApplyList(plt, list2)
|
||||
} else {
|
||||
k++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if applySnid == destP.SnId && list2 != nil {
|
||||
applyList = list2.List
|
||||
}
|
||||
|
||||
if applySnid == p.SnId && list2 != nil {
|
||||
meApplyList = list2.List
|
||||
}
|
||||
|
||||
return friend.OpResultCode_OPRC_Sucess
|
||||
}
|
||||
|
||||
me := FriendMgrSingleton.GetPlayer(p.Platform, p.SnId)
|
||||
if me == nil {
|
||||
SendToClick(friend.OpResultCode_OPRC_Error)
|
||||
return
|
||||
}
|
||||
if FriendMgrSingleton.IsFriend(p.Platform, p.SnId, destP.SnId) { //已经是好友了
|
||||
SendToClick(friend.OpResultCode_OPRC_Friend_AlreadyAdd)
|
||||
// 删除申请者的申请列表
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
delApplyListFunc(p.Platform, p.SnId, destP.SnId)
|
||||
delApplyListFunc(p.Platform, destP.SnId, p.SnId)
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||
SendToClick(friend.OpResultCode_OPRC_Friend_AlreadyAdd)
|
||||
})).StartByFixExecutor(FriendWrite)
|
||||
return
|
||||
}
|
||||
//验证自己
|
||||
|
|
@ -612,54 +668,6 @@ func (this *FriendMgr) FriendAgree(p *Player, destP *model.BindFriend) {
|
|||
}
|
||||
}
|
||||
|
||||
// 删除申请者的申请列表
|
||||
delApplyListFunc := func(plt string, snid int32, applySnid int32) friend.OpResultCode {
|
||||
// 删除被申请者的申请列表
|
||||
list1, err := model.QueryFriendApplyBySnid(plt, snid)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("QueryFriendApplyBySnid %v error: %v", snid, err)
|
||||
return friend.OpResultCode_OPRC_Error
|
||||
}
|
||||
if list1 != nil {
|
||||
k := 0
|
||||
for k < len(list1.ApplySnids) {
|
||||
if list1.ApplySnids[k].SnId == applySnid {
|
||||
list1.ApplySnids = append(list1.ApplySnids[:k], list1.ApplySnids[k+1:]...)
|
||||
model.UpsertFriendApply(plt, snid, list1)
|
||||
} else {
|
||||
k++
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除发起方的申请列表
|
||||
list2, err := model.QueryFriendApplyListBySnid(plt, applySnid)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("QueryFriendApplyListBySnid %v error: %v", applySnid, err)
|
||||
return friend.OpResultCode_OPRC_Error
|
||||
}
|
||||
if list2 != nil {
|
||||
k := 0
|
||||
for k < len(list2.List) {
|
||||
if list2.List[k] == snid {
|
||||
list2.List = append(list2.List[:k], list2.List[k+1:]...)
|
||||
model.UpsertApplyList(plt, list2)
|
||||
} else {
|
||||
k++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if applySnid == destP.SnId && list2 != nil {
|
||||
applyList = list2.List
|
||||
}
|
||||
|
||||
if applySnid == p.SnId && list2 != nil {
|
||||
meApplyList = list2.List
|
||||
}
|
||||
|
||||
return friend.OpResultCode_OPRC_Sucess
|
||||
}
|
||||
|
||||
//查看是否在申请列表
|
||||
code := delApplyListFunc(p.Platform, p.SnId, destP.SnId)
|
||||
if code != friend.OpResultCode_OPRC_Sucess {
|
||||
|
|
|
|||
|
|
@ -16,10 +16,12 @@ func RegisterPlayerListener[Player, Scene any](l PlayerListener[Player, Scene])
|
|||
type PlayerListener[Player, Scene any] interface {
|
||||
common.ClockSinker
|
||||
// 登出相关
|
||||
OnPlayerLogined(p Player) // 玩家登录时触发
|
||||
OnPlayerLogouted(p Player) // 玩家登出时触发
|
||||
OnPlayerDropLine(p Player) // 玩家掉线时触发
|
||||
OnPlayerRehold(p Player) // 玩家重新连接时触发
|
||||
OnPlayerLogined(p Player) // 玩家登录时触发
|
||||
OnPlayerLogouted(p Player) // 玩家登出时触发
|
||||
OnPlayerDropLine(p Player) // 玩家掉线时触发
|
||||
OnPlayerRehold(p Player) // 玩家重新连接时触发
|
||||
OnPlayerDayChanged(p Player, isLogin, isContinue bool) // 玩家跨天时触发
|
||||
OnPlayerWeekChanged(p Player, isLogin, isContinue bool) // 玩家跨周时触发
|
||||
// 业务相关
|
||||
OnPlayerEnterSceneBefore(p Player, s Scene) // 玩家进入场景前触发
|
||||
OnPlayerEnterSceneAfter(p Player, s Scene) // 玩家进入场景后触发
|
||||
|
|
@ -61,6 +63,22 @@ func FirePlayerRehold[Player, Scene any](p Player) {
|
|||
}
|
||||
}
|
||||
|
||||
func FirePlayerDayChanged[Player, Scene any](p Player, isLogin, isContinue bool) {
|
||||
for _, l := range _playerListeners {
|
||||
if l != nil {
|
||||
l.(PlayerListener[Player, Scene]).OnPlayerDayChanged(p, isLogin, isContinue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func FirePlayerWeekChanged[Player, Scene any](p Player, isLogin, isContinue bool) {
|
||||
for _, l := range _playerListeners {
|
||||
if l != nil {
|
||||
l.(PlayerListener[Player, Scene]).OnPlayerWeekChanged(p, isLogin, isContinue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func FirePlayerEnterSceneBefore[Player, Scene any](p Player, s Scene) {
|
||||
for _, l := range _playerListeners {
|
||||
if l != nil {
|
||||
|
|
@ -113,16 +131,18 @@ type BasePlayerListener[Player, Scene any] struct {
|
|||
common.ClockFunc
|
||||
}
|
||||
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerLogined(p Player) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerLogouted(p Player) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerDropLine(p Player) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerRehold(p Player) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerEnterSceneBefore(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerEnterSceneAfter(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerLeaveSceneBefore(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerLeaveSceneAfter(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerReturnSceneBefore(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerReturnSceneAfter(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerLogined(p Player) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerLogouted(p Player) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerDropLine(p Player) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerRehold(p Player) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerDayChanged(p Player, isLogin, isContinue bool) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerWeekChanged(p Player, isLogin, isContinue bool) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerEnterSceneBefore(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerEnterSceneAfter(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerLeaveSceneBefore(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerLeaveSceneAfter(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerReturnSceneBefore(p Player, s Scene) {}
|
||||
func (l *BasePlayerListener[Player, Scene]) OnPlayerReturnSceneAfter(p Player, s Scene) {}
|
||||
|
||||
type PlayerListenerFunc[Player, Scene any] struct {
|
||||
common.ClockFunc
|
||||
|
|
@ -130,6 +150,8 @@ type PlayerListenerFunc[Player, Scene any] struct {
|
|||
OnPlayerLogoutedFunc func(p Player)
|
||||
OnPlayerDropLineFunc func(p Player)
|
||||
OnPlayerReholdFunc func(p Player)
|
||||
OnPlayerDayChangedFunc func(p Player, isLogin, isContinue bool)
|
||||
OnPlayerWeekChangedFunc func(p Player, isLogin, isContinue bool)
|
||||
OnPlayerEnterSceneBeforeFunc func(p Player, s Scene)
|
||||
OnPlayerEnterSceneAfterFunc func(p Player, s Scene)
|
||||
OnPlayerLeaveSceneBeforeFunc func(p Player, s Scene)
|
||||
|
|
@ -162,6 +184,18 @@ func (l *PlayerListenerFunc[Player, Scene]) OnPlayerRehold(p Player) {
|
|||
}
|
||||
}
|
||||
|
||||
func (l *PlayerListenerFunc[Player, Scene]) OnPlayerDayChanged(p Player, isLogin, isContinue bool) {
|
||||
if l.OnPlayerDayChangedFunc != nil {
|
||||
l.OnPlayerDayChangedFunc(p, isLogin, isContinue)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *PlayerListenerFunc[Player, Scene]) OnPlayerWeekChanged(p Player, isLogin, isContinue bool) {
|
||||
if l.OnPlayerWeekChangedFunc != nil {
|
||||
l.OnPlayerWeekChangedFunc(p, isLogin, isContinue)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *PlayerListenerFunc[Player, Scene]) OnPlayerEnterSceneBefore(p Player, s Scene) {
|
||||
if l.OnPlayerEnterSceneBeforeFunc != nil {
|
||||
l.OnPlayerEnterSceneBeforeFunc(p, s)
|
||||
|
|
@ -198,7 +232,7 @@ func (l *PlayerListenerFunc[Player, Scene]) OnPlayerReturnSceneAfter(p Player, s
|
|||
}
|
||||
}
|
||||
|
||||
func RegisterPlayerListenerFunc[P, S any](l *PlayerListenerFunc[P, S]) {
|
||||
func RegisterPlayerListenerFunc[Player, Scene any](l *PlayerListenerFunc[Player, Scene]) {
|
||||
common.RegisterClockFunc(&l.ClockFunc)
|
||||
RegisterPlayerListener(l)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ type PlayerLoadReplay struct {
|
|||
// 重连不会执行
|
||||
type IPlayerLoad interface {
|
||||
// Load 查询数据库,在task中执行
|
||||
Load(platform string, snid int32, data any) *PlayerLoadReplay
|
||||
Load(platform string, snid int32, playerBaseData any) *PlayerLoadReplay
|
||||
// Callback 数据查询成功的回掉方法
|
||||
Callback(data any, ret *PlayerLoadReplay)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,5 +54,6 @@ func main() {
|
|||
schedule.StartTask()
|
||||
//启动业务模块
|
||||
waiter := module.Start()
|
||||
StartMonitor()
|
||||
waiter.Wait("main()")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/timer"
|
||||
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/rpc"
|
||||
)
|
||||
|
||||
var (
|
||||
monitorRpc = model.NewMonitorTool[rpc.State]("rpc")
|
||||
)
|
||||
|
||||
func StartMonitor() {
|
||||
timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
|
||||
//monitorRpc.InsertKV(rpc.GetState())
|
||||
|
||||
//保存到本地文件
|
||||
go func() {
|
||||
err := saveToFile("rpc.json", rpc.GetState())
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("rpc.json failed to save to file: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
return true
|
||||
}), nil, time.Minute*5, -1)
|
||||
}
|
||||
|
||||
// 保存变量到文件(覆盖方式)
|
||||
func saveToFile(filename string, data interface{}) error {
|
||||
// 将数据转换为JSON字节
|
||||
content, err := json.MarshalIndent(data, "", " ")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to serialize data: %w", err)
|
||||
}
|
||||
|
||||
// 写入文件,覆盖模式
|
||||
err = os.WriteFile(filename, content, 0644)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to write to file: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/core/profile"
|
||||
"mongo.games.com/goserver/core/schedule"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
"mongo.games.com/goserver/core/transact"
|
||||
"mongo.games.com/goserver/core/utils"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/webapi"
|
||||
)
|
||||
|
||||
var MonitorMgrSington = &MonitorMgr{}
|
||||
|
||||
type MonitorMgr struct {
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) ModuleName() string {
|
||||
return "MonitorMgr"
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Init() {
|
||||
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Update() {
|
||||
//player online stats
|
||||
olStats := PlayerMgrSington.StatsOnline()
|
||||
log := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", olStats)
|
||||
if log != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.InsertMonitorData("online", log)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
|
||||
//api stats
|
||||
if len(WebAPIStats) > 0 {
|
||||
log := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", WebAPIStats)
|
||||
if log != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("webapi", log)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
apiStats := webapi.Stats()
|
||||
if len(apiStats) > 0 {
|
||||
log := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "api", apiStats)
|
||||
if log != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("webapi", log)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//logic stats
|
||||
logicStats := profile.GetStats()
|
||||
if len(logicStats) > 0 {
|
||||
logLogic := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", logicStats)
|
||||
if logLogic != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("logic", logLogic)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//net session stats
|
||||
netStats := netlib.Stats()
|
||||
if len(netStats) > 0 {
|
||||
logNet := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", netStats)
|
||||
if logNet != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("net", logNet)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//schedule stats
|
||||
jobStats := schedule.Stats()
|
||||
if len(jobStats) > 0 {
|
||||
logJob := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", jobStats)
|
||||
if logJob != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("job", logJob)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//trans stats
|
||||
transStats := transact.Stats()
|
||||
if len(transStats) > 0 {
|
||||
logTrans := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", transStats)
|
||||
if logTrans != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("transact", logTrans)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//panic stats
|
||||
panicStats := utils.GetPanicStats()
|
||||
if len(panicStats) > 0 {
|
||||
for key, stats := range panicStats {
|
||||
logPanic := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), key, stats)
|
||||
if logPanic != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("panic", logPanic)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//object command quene stats
|
||||
objStats := core.AppCtx.GetStats()
|
||||
if len(objStats) > 0 {
|
||||
logCmd := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "obj", objStats)
|
||||
if logCmd != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.UpsertMonitorData("cmdque", logCmd)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
//gorouting count, eg. system info
|
||||
runtimeStats := utils.StatsRuntime()
|
||||
logRuntime := model.NewMonitorData(int32(common.GetSelfSrvId()), int32(common.GetSelfSrvType()), "", runtimeStats)
|
||||
if logRuntime != nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
return model.InsertMonitorData("runtime", logRuntime)
|
||||
}), nil, "InsertMonitorData").StartByFixExecutor("monitor")
|
||||
}
|
||||
}
|
||||
|
||||
func (this *MonitorMgr) Shutdown() {
|
||||
module.UnregisteModule(this)
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
//gob registe
|
||||
gob.Register(model.PlayerOLStats{})
|
||||
gob.Register(map[string]*model.APITransactStats{})
|
||||
gob.Register(webapi.ApiStats{})
|
||||
gob.Register(map[string]webapi.ApiStats{})
|
||||
gob.Register(profile.TimeElement{})
|
||||
gob.Register(map[string]profile.TimeElement{})
|
||||
gob.Register(netlib.ServiceStats{})
|
||||
gob.Register(map[int]netlib.ServiceStats{})
|
||||
gob.Register(schedule.TaskStats{})
|
||||
gob.Register(map[string]schedule.TaskStats{})
|
||||
gob.Register(transact.TransStats{})
|
||||
gob.Register(map[int]transact.TransStats{})
|
||||
gob.Register(utils.PanicStackInfo{})
|
||||
gob.Register(map[string]utils.PanicStackInfo{})
|
||||
gob.Register(basic.CmdStats{})
|
||||
gob.Register(map[string]basic.CmdStats{})
|
||||
gob.Register(utils.RuntimeStats{})
|
||||
//gob registe
|
||||
|
||||
module.RegisteModule(MonitorMgrSington, time.Minute*5, 0)
|
||||
}
|
||||
|
|
@ -34,6 +34,7 @@ func init() {
|
|||
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.BackSystemFreeGive, Data: &model.SystemFreeGive{}})
|
||||
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.DBLotteryCode, Data: &model.LotteryCode{}})
|
||||
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.DBLotteryLog, Data: &model.LotteryLog{}})
|
||||
mq.RegisterMessage(&mq.RegisterMessageParam{Name: model.MQRankNian, Data: &model.NianInfo{}})
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
|||
|
|
@ -176,6 +176,14 @@ func (this *Player) init() bool {
|
|||
this.GuideData = make(map[int32]int32)
|
||||
}
|
||||
this.InitRolesAndPets()
|
||||
// 数据修复
|
||||
if this.PlayerData != nil && this.PlayerData.WelfData != nil {
|
||||
for k, v := range this.PlayerData.WelfData.Task {
|
||||
if v == nil {
|
||||
delete(this.PlayerData.WelfData.Task, k)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -1646,20 +1654,16 @@ func (this *Player) OnDayTimer(login, continuous bool, t int) {
|
|||
return
|
||||
}
|
||||
this.lastOnDayChange = time.Now().Local()
|
||||
this.dirty = true
|
||||
|
||||
logger.Logger.Infof("(this *Player) (%v) OnDayTimer(%v,%v) ", this.SnId, login, continuous)
|
||||
|
||||
this.dirty = true
|
||||
internal.FirePlayerDayChanged[*Player, *Scene](this, login, continuous)
|
||||
|
||||
if login || this.scene == nil {
|
||||
//跨天登录 数据给昨天,今天置为空
|
||||
this.YesterdayGameData = this.TodayGameData
|
||||
this.TodayGameData = model.NewPlayerGameCtrlData()
|
||||
/*
|
||||
for k, v := range this.YesterdayGameData.CtrlData {
|
||||
t := &model.PlayerGameStatics{}
|
||||
t.AvgBetCoin = v.AvgBetCoin
|
||||
this.TodayGameData.CtrlData[k] = t
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//this.OnTimeDayTotal(continuous, t)
|
||||
|
|
@ -1667,22 +1671,9 @@ func (this *Player) OnDayTimer(login, continuous bool, t int) {
|
|||
//商城数据更新
|
||||
this.ShopTotal = make(map[int32]*model.ShopTotal)
|
||||
this.ShopLastLookTime = make(map[int32]int64)
|
||||
// 福利活动更新
|
||||
WelfareMgrSington.OnDayChanged(this)
|
||||
this.VipMatchTimes = 0
|
||||
//VIP商城数据更新
|
||||
this.UpdateVipShopData()
|
||||
// 重置每日任务
|
||||
if this.WelfData != nil {
|
||||
if this.WelfData.Task != nil {
|
||||
for _, v := range srvdata.TaskMgr.GetActivityType(common.TaskActivityTypeEveryDay) {
|
||||
this.WelfData.Task[v.GetId()] = &model.TaskData{}
|
||||
}
|
||||
for _, v := range srvdata.TaskMgr.GetActivityType(common.TaskActivityTypePermitEveryDay) {
|
||||
this.WelfData.Task[v.GetId()] = &model.TaskData{}
|
||||
}
|
||||
}
|
||||
}
|
||||
//周卡数据更新
|
||||
this.WeekCardAward = make(map[int32]bool)
|
||||
//周卡领取奖励
|
||||
|
|
@ -1796,13 +1787,15 @@ func (this *Player) OnMonthTimer() {
|
|||
}
|
||||
|
||||
func (this *Player) OnWeekTimer() {
|
||||
logger.Logger.Tracef("OnWeekTimer %v", time.Now())
|
||||
//判断是否一天即可过滤0点多次切换
|
||||
if common.InSameDayNoZero(time.Now().Local(), this.lastOnWeekChange) {
|
||||
return
|
||||
}
|
||||
this.lastOnWeekChange = time.Now().Local()
|
||||
|
||||
logger.Logger.Tracef("OnWeekTimer %v", time.Now())
|
||||
internal.FirePlayerWeekChanged[*Player, *Scene](this, false, false)
|
||||
|
||||
//清理比赛券
|
||||
ticket := this.Ticket
|
||||
if ticket > 0 {
|
||||
|
|
@ -1827,14 +1820,6 @@ func (this *Player) OnWeekTimer() {
|
|||
}
|
||||
}
|
||||
|
||||
// 重置周任务
|
||||
if this.WelfData != nil {
|
||||
if this.WelfData.Task != nil {
|
||||
for _, v := range srvdata.TaskMgr.GetActivityType(common.TaskActivityTypeWeek) {
|
||||
this.WelfData.Task[v.GetId()] = &model.TaskData{}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 重置周任务
|
||||
// 重置邀请积分
|
||||
CheckNewWeek(this.Platform, this.SnId)
|
||||
|
|
@ -2892,7 +2877,14 @@ func (this *Player) DoShopInfo(info *model.DbShop, isLogin bool) {
|
|||
|
||||
//钻石存储罐
|
||||
if info.PageId == ShopPageDiamondBank {
|
||||
WelfareMgrSington.DiamondBankTakeCoin(this)
|
||||
|
||||
arrItems := WelfareMgrSington.DiamondBankTakeCoin(this)
|
||||
for _, v := range arrItems {
|
||||
itemInfo = append(itemInfo, &playerproto.PayItem{
|
||||
ItemId: v.ItemId,
|
||||
ItemNum: v.ItemNum,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 通行证
|
||||
|
|
@ -2909,6 +2901,10 @@ func (this *Player) DoShopInfo(info *model.DbShop, isLogin bool) {
|
|||
Num: 1,
|
||||
})
|
||||
}
|
||||
//年兽礼包
|
||||
if info.PageId == ShopPageNian {
|
||||
this.WelfData.NianData.GiftShop[info.ShopId] += 1
|
||||
}
|
||||
|
||||
switch info.Remark {
|
||||
case "BlindBox":
|
||||
|
|
|
|||
|
|
@ -647,6 +647,8 @@ func (r *RankMatchMgr) OnDayTimer() {
|
|||
logger.Logger.Info("(this *RankMatchMgr) OnDayTimer")
|
||||
//排行榜发奖
|
||||
//r.RankAward()
|
||||
//年兽排行榜发奖
|
||||
r.NianRankAward()
|
||||
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
|
||||
if platform.IdStr == DefaultPlatform {
|
||||
continue
|
||||
|
|
@ -930,6 +932,184 @@ func (r *RankMatchMgr) Save(platform string, snid int32, isSync, force bool) {
|
|||
})).StartByFixExecutor(fmt.Sprintf("platform%s", ret.Platform))
|
||||
}
|
||||
|
||||
// 年兽排行榜发奖
|
||||
func (r *RankMatchMgr) NianRankAward() {
|
||||
logger.Logger.Trace("年兽排行榜开始发奖!!!!")
|
||||
for _, v := range PlatformMgrSingleton.GetPlatforms() {
|
||||
platform := v.IdStr
|
||||
rankConfig := PlatformMgrSingleton.GetConfig(platform).NianRankReward
|
||||
if rankConfig == nil {
|
||||
continue
|
||||
}
|
||||
pool := WelfareMgrSington.GetConfig(platform).ActivityNianConfig
|
||||
if pool == nil || pool.List == nil {
|
||||
return
|
||||
}
|
||||
if pool.Switch == model.WelfareClose {
|
||||
return
|
||||
}
|
||||
startTime := pool.List[0].ActivityStart
|
||||
endTime := pool.List[0].ActivityEnd
|
||||
t, _ := time.Parse(time.DateTime, startTime)
|
||||
// 转换为时间戳(以秒为单位)
|
||||
timestamp := t.Unix()
|
||||
end, _ := time.Parse(time.DateTime, endTime)
|
||||
endTimestamp := end.Unix()
|
||||
nowTime := time.Now().Unix()
|
||||
if nowTime < timestamp || nowTime > endTimestamp {
|
||||
return
|
||||
}
|
||||
for _, info := range rankConfig.RankData {
|
||||
if info.TypeId == 1 {
|
||||
rankAward := info.RankInfo
|
||||
if rankAward == nil {
|
||||
continue
|
||||
}
|
||||
var players []*model.PlayerBaseInfo
|
||||
list, err := model.FindLuckNianRankList(&model.FindNianListArgs{
|
||||
Platform: platform,
|
||||
})
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
for _, vv := range list.List {
|
||||
player := PlayerMgrSington.GetPlayerBySnId(vv.SnId)
|
||||
if player != nil {
|
||||
players = append(players, &model.PlayerBaseInfo{
|
||||
SnId: player.SnId,
|
||||
LastChannel: player.LastChannel,
|
||||
})
|
||||
} else {
|
||||
baseInfo := model.GetPlayerBaseInfo(platform, vv.SnId)
|
||||
players = append(players, baseInfo)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("RankMatchMgr OnDayTimer FindLuckNianRankList err:%v", err)
|
||||
return
|
||||
}
|
||||
rankId := int32(1)
|
||||
for k, player := range players {
|
||||
if player == nil {
|
||||
logger.Logger.Errorf("RankMatchMgr OnDayTimer FindLuckNianRankList player is nil %v", list.List[k].SnId)
|
||||
continue
|
||||
}
|
||||
var items []int64
|
||||
for _, award := range rankAward[rankId].Award {
|
||||
items = append(items, int64(award.ItemId))
|
||||
items = append(items, award.ItemNum)
|
||||
}
|
||||
if len(items) == 0 {
|
||||
break
|
||||
}
|
||||
// 发邮件
|
||||
var newMsg *model.Message
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
title := i18n.Tr("languages", "NianLuckTitle")
|
||||
content := i18n.Tr("languages", "NianLuckAward", []int{int(rankId), int(rankId), int(rankId), int(rankId)})
|
||||
newMsg = model.NewMessage("", 0, "", player.SnId, model.MSGTYPE_RANK_REWARD,
|
||||
title, content, 0, 0, model.MSGSTATE_UNREAD, time.Now().Unix(), 0, "", items, platform, model.HallTienlen, nil)
|
||||
err := model.InsertMessage(platform, newMsg)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("发送邮件失败 snid:%v err:%v", player.SnId, err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||
p := PlayerMgrSington.GetPlayerBySnId(player.SnId)
|
||||
if p != nil {
|
||||
p.AddMessage(newMsg)
|
||||
}
|
||||
})).Start()
|
||||
rankId += 1
|
||||
}
|
||||
//清除幸运榜数值
|
||||
err := model.ClearNianRank(&model.FindNianListArgs{
|
||||
Platform: platform,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("清除幸运榜数值失败 err:%v", err)
|
||||
}
|
||||
|
||||
})).StartByExecutor("NianLuck_Award")
|
||||
} else if info.TypeId == 2 {
|
||||
if time.Now().Day()-1 != end.Day() {
|
||||
return
|
||||
}
|
||||
rankAward := info.RankInfo
|
||||
if rankAward == nil {
|
||||
continue
|
||||
}
|
||||
var players []*model.PlayerBaseInfo
|
||||
list, err := model.FindDamageNianRankList(&model.FindNianListArgs{
|
||||
Platform: platform,
|
||||
})
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
for _, vv := range list.List {
|
||||
player := PlayerMgrSington.GetPlayerBySnId(vv.SnId)
|
||||
if player != nil {
|
||||
players = append(players, &model.PlayerBaseInfo{
|
||||
SnId: player.SnId,
|
||||
LastChannel: player.LastChannel,
|
||||
})
|
||||
} else {
|
||||
baseInfo := model.GetPlayerBaseInfo(platform, vv.SnId)
|
||||
players = append(players, baseInfo)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("RankMatchMgr OnDayTimer FindLuckNianRankList err:%v", err)
|
||||
return
|
||||
}
|
||||
rankId := int32(1)
|
||||
for k, player := range players {
|
||||
if player == nil {
|
||||
logger.Logger.Errorf("RankMatchMgr OnDayTimer FindLuckNianRankList player is nil %v", list.List[k].SnId)
|
||||
continue
|
||||
}
|
||||
var items []int64
|
||||
for _, award := range rankAward[rankId].Award {
|
||||
items = append(items, int64(award.ItemId))
|
||||
items = append(items, award.ItemNum)
|
||||
}
|
||||
if len(items) == 0 {
|
||||
break
|
||||
}
|
||||
// 发邮件
|
||||
var newMsg *model.Message
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
title := i18n.Tr("languages", "NianDamageTitle")
|
||||
content := i18n.Tr("languages", "NianDamageAward", []int{int(rankId), int(rankId), int(rankId), int(rankId)})
|
||||
newMsg = model.NewMessage("", 0, "", player.SnId, model.MSGTYPE_RANK_REWARD,
|
||||
title, content, 0, 0, model.MSGSTATE_UNREAD, time.Now().Unix(), 0, "", items, platform, model.HallTienlen, nil)
|
||||
err := model.InsertMessage(platform, newMsg)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("发送邮件失败 snid:%v err:%v", player.SnId, err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||
p := PlayerMgrSington.GetPlayerBySnId(player.SnId)
|
||||
if p != nil {
|
||||
p.AddMessage(newMsg)
|
||||
}
|
||||
})).Start()
|
||||
rankId += 1
|
||||
}
|
||||
//删除数据库数据
|
||||
err := model.DelNianRank(&model.FindNianListArgs{
|
||||
Platform: platform,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("删除年兽排行榜数据库数据 err:%v", err)
|
||||
}
|
||||
})).StartByExecutor("NianDamage_Award")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
func (r *RankMatchMgr) Release(platform string, snid int32) {
|
||||
delete(r.playerSeasons, snid)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,16 +46,16 @@ const (
|
|||
|
||||
// page类型
|
||||
const (
|
||||
ShopPageCoin = 1 //金币页面
|
||||
ShopPageDiamond = 2 //钻石页面
|
||||
ShopPageItem = 3 //道具页面
|
||||
ShopPageVip = 4 //VIP页面
|
||||
ShopPagePrivilege = 5 //VIP特权礼包
|
||||
ShopPageGift = 7 //礼包页面
|
||||
ShopPageDiamondBank = 8 //钻石存储罐
|
||||
ShopPagePermit = 9 //赛季通行证
|
||||
ShopPageFangKa = 10 //房卡页面
|
||||
|
||||
ShopPageCoin = 1 //金币页面
|
||||
ShopPageDiamond = 2 //钻石页面
|
||||
ShopPageItem = 3 //道具页面
|
||||
ShopPageVip = 4 //VIP页面
|
||||
ShopPagePrivilege = 5 //VIP特权礼包
|
||||
ShopPageGift = 7 //礼包页面
|
||||
ShopPageDiamondBank = 8 //钻石存储罐
|
||||
ShopPagePermit = 9 //赛季通行证
|
||||
ShopPageFangKa = 10 //房卡页面
|
||||
ShopPageNian = 12 //年兽活动页面
|
||||
ShopPagePhoneScore = 61 //手机积分商城
|
||||
ShopPagePhoneScoreGoogle = 62
|
||||
ShopPageBackend = 63 //并不是页面,是后台加币记录类型
|
||||
|
|
|
|||
|
|
@ -3,12 +3,16 @@ package main
|
|||
import (
|
||||
"container/list"
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/mq"
|
||||
taskproto "mongo.games.com/game/protocol/task"
|
||||
"mongo.games.com/game/srvdata"
|
||||
"mongo.games.com/game/worldsrv/internal"
|
||||
)
|
||||
|
||||
/*
|
||||
|
|
@ -159,6 +163,7 @@ func (t *TaskHandle) AllTask(id int, data any) {
|
|||
|
||||
logger.Logger.Tracef("AllTask taskID:%v %v", id, p.WelfData.Task[int32(id)])
|
||||
|
||||
now := time.Now()
|
||||
change := map[int32][]*taskproto.TaskData{}
|
||||
for _, v := range srvdata.TaskMgr.GetTaskType(int32(id)) {
|
||||
if !info.Debug {
|
||||
|
|
@ -192,6 +197,33 @@ func (t *TaskHandle) AllTask(id int, data any) {
|
|||
}
|
||||
}
|
||||
|
||||
switch v.GetActivityType() {
|
||||
case common.TaskActivityTypeNianEveryDay, common.TaskActivityTypeNian:
|
||||
//判断是否在开启时间段内
|
||||
pool := WelfareMgrSington.GetConfig(p.Platform).ActivityNianConfig
|
||||
if pool == nil || pool.List == nil {
|
||||
continue
|
||||
}
|
||||
if pool.Switch == model.WelfareClose {
|
||||
continue
|
||||
}
|
||||
startTime := pool.List[0].ActivityStart
|
||||
endTime := pool.List[0].ActivityEnd
|
||||
start, _ := time.Parse(time.DateTime, startTime)
|
||||
timestamp := start.Unix()
|
||||
end, _ := time.Parse(time.DateTime, endTime)
|
||||
endTimestamp := end.Unix()
|
||||
if now.Unix() < timestamp || now.Unix() > endTimestamp {
|
||||
continue
|
||||
}
|
||||
|
||||
case common.TaskActivityTypeConsume:
|
||||
cfg := WelfareMgrSington.GetConfig(p.Platform).ConsumeConfig
|
||||
if cfg == nil || cfg.GetOn() != common.On || now.Unix() < common.StrTimeToTs(cfg.StartTime) || now.Unix() >= common.StrTimeToTs(cfg.EndTime) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if p.WelfData.Task[v.Id] == nil {
|
||||
p.WelfData.Task[v.Id] = &model.TaskData{N: 0} // 初始化任务数据
|
||||
}
|
||||
|
|
@ -260,6 +292,146 @@ func OnNotifyChange(p *Player, activityType int32) {
|
|||
logger.Logger.Tracef("SCTaskChange %v", pack)
|
||||
}
|
||||
|
||||
// GetTaskTimes 获取任务完成进度
|
||||
func GetTaskTimes(p *Player, id int32) int64 {
|
||||
if p.WelfData != nil && p.WelfData.Task[id] != nil {
|
||||
return p.WelfData.Task[id].N
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// IsTaskFinish 是否任务完成
|
||||
func IsTaskFinish(p *Player, id int32) bool {
|
||||
data := srvdata.PBDB_TaskMgr.GetData(id)
|
||||
if data == nil {
|
||||
return false
|
||||
}
|
||||
if p.WelfData != nil && p.WelfData.Task[id] != nil {
|
||||
return p.WelfData.Task[id].N >= data.GetTargetTimes()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsTaskReward 是否任务奖励已领取
|
||||
func IsTaskReward(p *Player, id int32) bool {
|
||||
if p.WelfData != nil && p.WelfData.Task != nil {
|
||||
if data := p.WelfData.Task[id]; data != nil && data.Ts > 0 {
|
||||
t := srvdata.PBDB_TaskMgr.GetData(id)
|
||||
switch t.ActivityType {
|
||||
case common.TaskActivityTypeEveryDay, common.TaskActivityTypePermitEveryDay, common.TaskActivityTypeNianEveryDay, common.TaskActivityTypeConsume:
|
||||
if common.TsInSameDay(time.Now().Unix(), data.Ts) {
|
||||
return true
|
||||
}
|
||||
|
||||
case common.TaskActivityTypeWeek:
|
||||
if common.TsInSameWeek(time.Now().Unix(), data.Ts) {
|
||||
return true
|
||||
}
|
||||
|
||||
case common.TaskActivityTypeNovice, common.TaskActivityTypeInvite, common.TaskActivityTypeAchieve:
|
||||
if data.Ts > 0 {
|
||||
return true
|
||||
}
|
||||
case common.TaskActivityTypePermit:
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs > 0 {
|
||||
return data.Ts >= startTs && data.Ts < endTs
|
||||
}
|
||||
return true
|
||||
case common.TaskActivityTypeNian:
|
||||
pool := WelfareMgrSington.GetConfig(p.Platform).ActivityNianConfig
|
||||
if pool == nil || pool.List == nil {
|
||||
return false
|
||||
}
|
||||
if pool.Switch == model.WelfareClose {
|
||||
return false
|
||||
}
|
||||
startTime := pool.List[0].ActivityStart
|
||||
endTime := pool.List[0].ActivityEnd
|
||||
start, _ := time.Parse(time.DateTime, startTime)
|
||||
timestamp := start.Unix()
|
||||
end, _ := time.Parse(time.DateTime, endTime)
|
||||
endTimestamp := end.Unix()
|
||||
if timestamp > 0 {
|
||||
return data.Ts >= timestamp && data.Ts < endTimestamp
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// SendTaskReward 发送任务奖励
|
||||
func SendTaskReward(p *Player, m map[int64]int64, tp int32) {
|
||||
isPermit := p.GetIsPermit()
|
||||
add := p.GetSkillAdd(common.SkillIdTask)
|
||||
var items []*model.Item
|
||||
for k, v := range m {
|
||||
if k == common.ItemIDPermit && isPermit {
|
||||
v += int64(float64(v) * common.PermitAdd)
|
||||
}
|
||||
// 皮肤技能每日任务金币加成
|
||||
if tp == common.TaskActivityTypeEveryDay && add > 0 && k == common.ItemIDCoin {
|
||||
v += int64((float64(v) * float64(add)) / 100.0)
|
||||
}
|
||||
items = append(items, &model.Item{
|
||||
ItemId: int32(k),
|
||||
ItemNum: v,
|
||||
})
|
||||
}
|
||||
gain := int32(0)
|
||||
giveType := int32(-1)
|
||||
switch tp {
|
||||
case 1:
|
||||
gain = common.GainWayItemTaskEveryDay
|
||||
giveType = model.SystemFreeGive_GiveType_TaskEveryDay
|
||||
case 2:
|
||||
gain = common.GainWayItemWeekActive
|
||||
giveType = model.SystemFreeGive_GiveType_TaskWeekActive
|
||||
case 3:
|
||||
gain = common.GainWayItemTaskNewPlayer
|
||||
giveType = model.SystemFreeGive_GiveType_TaskNewPlayer
|
||||
case 4:
|
||||
gain = common.GainWayItemTaskInvite
|
||||
giveType = model.SystemFreeGive_GiveType_TaskInvite
|
||||
case 5:
|
||||
gain = common.GainWayItemTaskAchievement
|
||||
giveType = model.SystemFreeGive_GiveType_TaskAchievement
|
||||
case 6:
|
||||
gain = common.GainWayItemTaskPermit
|
||||
giveType = model.SystemFreeGive_GiveType_TaskPermit
|
||||
case 10:
|
||||
gain = common.GainWayConsume
|
||||
}
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: items,
|
||||
Add: 0,
|
||||
GainWay: gain,
|
||||
Operator: "system",
|
||||
Remark: "任务奖励",
|
||||
GameId: 0,
|
||||
GameFreeId: 0,
|
||||
})
|
||||
for _, v := range items {
|
||||
tp := int32(-1)
|
||||
if v.ItemId == common.ItemIDCoin {
|
||||
tp = model.SystemFreeGive_CoinType_Coin
|
||||
} else if v.ItemId == common.ItemIDDiamond {
|
||||
tp = model.SystemFreeGive_CoinType_Diamond
|
||||
}
|
||||
if !p.IsRob && tp >= 0 && giveType >= 0 {
|
||||
mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, giveType, tp, v.ItemNum))
|
||||
}
|
||||
}
|
||||
if giveType == model.SystemFreeGive_GiveType_TaskPermit {
|
||||
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_Permit, 1))
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
taskHandle := new(TaskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeAdv, taskHandle)
|
||||
|
|
@ -292,4 +464,36 @@ func init() {
|
|||
TaskSubjectSingleton.Attach(common.TaskTypeTienlenWinCoin, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeRankMatchWinTimes, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeBuyPermit, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeBuyRedBag, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeNianBossKill, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeNianBossDamage, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeNianSign, taskHandle)
|
||||
|
||||
internal.RegisterPlayerListenerFunc(&internal.PlayerListenerFunc[*Player, *Scene]{
|
||||
OnPlayerDayChangedFunc: func(p *Player, isLogin, isContinue bool) {
|
||||
if p.WelfData != nil && p.WelfData.Task != nil {
|
||||
for _, v := range []int32{
|
||||
// todo 每日重置的任务列表
|
||||
common.TaskActivityTypeEveryDay,
|
||||
common.TaskActivityTypePermitEveryDay,
|
||||
common.TaskActivityTypeNianEveryDay,
|
||||
common.TaskActivityTypeConsume} {
|
||||
for _, vv := range srvdata.TaskMgr.GetActivityType(v) {
|
||||
p.WelfData.Task[vv.GetId()] = &model.TaskData{}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
OnPlayerWeekChangedFunc: func(p *Player, isLogin, isContinue bool) {
|
||||
if p.WelfData != nil && p.WelfData.Task != nil {
|
||||
for _, v := range []int32{
|
||||
// todo 每周重置的任务列表
|
||||
common.TaskActivityTypeWeek} {
|
||||
for _, vv := range srvdata.TaskMgr.GetActivityType(v) {
|
||||
p.WelfData.Task[vv.GetId()] = &model.TaskData{}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue