From ac0daa39a4cb13d66979bf62a47c55b5a7616c3e Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Wed, 8 Jan 2025 11:24:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=BA=A2=E5=8C=85=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/welfmgr.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index c9eea81..ce183c9 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -5,6 +5,7 @@ import ( "math" "math/rand" "slices" + "sort" "time" "mongo.games.com/goserver/core/logger" @@ -2313,6 +2314,10 @@ func (this *WelfareMgr) SendRedPacketInfo(p *Player) *welfare.SCRedPacketInfo { } } + sort.Slice(pack.Info, func(i, j int) bool { + return pack.Info[i].StartTs < pack.Info[j].StartTs + }) + p.SendToClient(int(welfare.SPacketID_PACKET_SCRedPacketInfo), pack) return pack }