diff --git a/protocol/userProxy.proto b/protocol/userProxy.proto index 27ca2bcf5f1ca984b458bcf00bcc054a17f4396c..2565ccb5c3f7605f2a4345838badfe6e2d12ba4a 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 ac1090e5660b51f7dd655fffcdb3a92e6aaef421..a005bc6bd312592b8fb516499288c80e366ad4d4 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)