From 89adccd175fa6301bace5661375e6115dcbaac7e Mon Sep 17 00:00:00 2001 From: hujiebin Date: Thu, 20 Apr 2023 17:32:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=B0=83=E6=95=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/user_center_func.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpc/user_center_func.go b/rpc/user_center_func.go index c42e084..f82275a 100644 --- a/rpc/user_center_func.go +++ b/rpc/user_center_func.go @@ -262,6 +262,12 @@ func SendSheepGameResult(matchId, winId, userId1, userId2 uint64, nick1, nick2, players = append(players, &userProxy.SheepGamePlayer{IsWin: winId == userId2, User: &userProxy.User{ Id: userId2, Nick: nick2, Avatar: avatar2, }}) + if !players[0].IsWin { + players[0], players[1] = players[1], players[0] + } + for i := range players { + players[i].Rank = int32(i) + 1 + } msg := &userProxy.SheepGameResult{ MatchId: matchId, Players: players, -- 2.22.0