From c0b6f3229e7a59511094f57c03af9b921427abe0 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Thu, 23 Feb 2023 10:55:44 +0800 Subject: [PATCH] proto --- protocol/userProxy.proto | 1 + rpc/user_center_func.go | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/protocol/userProxy.proto b/protocol/userProxy.proto index 27ca2bc..2565ccb 100644 --- a/protocol/userProxy.proto +++ b/protocol/userProxy.proto @@ -362,4 +362,5 @@ message GlobalGameBanner { uint64 userId = 2; string avatar = 3; uint64 diamond = 4; + string bannerUrl = 5; } \ No newline at end of file diff --git a/rpc/user_center_func.go b/rpc/user_center_func.go index ac1090e..a005bc6 100644 --- a/rpc/user_center_func.go +++ b/rpc/user_center_func.go @@ -93,12 +93,23 @@ func SendDiamondChange(userId uint64, diamond uint32) error { // 发送游戏横幅 // param winUserId:胜利的用户id +// param gameType 0:slot 5:luckybox 6:fruit func SendGlobalGameBanner(winUserId uint64, diamond uint64, avatar string, gameType uint32) error { + bannerUrl := "" + switch gameType { + case 0: + bannerUrl = "https://image.whoisamy.shop/hilo/resource/game/game_banner_slot.png" + case 5: + bannerUrl = "https://image.whoisamy.shop/hilo/resource/game/game_banner_luckybox.png" + case 6: + bannerUrl = "https://image.whoisamy.shop/hilo/resource/game/game_banner_fruit.png" + } msg := &userProxy.GlobalGameBanner{ - GameType: gameType, - UserId: winUserId, - Avatar: avatar, - Diamond: diamond, + GameType: gameType, + UserId: winUserId, + Avatar: avatar, + Diamond: diamond, + BannerUrl: bannerUrl, } if buffer, err := proto.Marshal(msg); err == nil { rspUids, err := broadcast(MsgTypeGlobalGameBanner, buffer) -- 2.22.0