From e39a231a51a8b215b845522cb4727aa892e0dc3c Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 19 Dec 2024 16:28:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=88=BF=E9=97=B4=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E6=88=BF=E8=B4=B9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/scene.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/worldsrv/scene.go b/worldsrv/scene.go index 821c86f..21e30af 100644 --- a/worldsrv/scene.go +++ b/worldsrv/scene.go @@ -952,6 +952,16 @@ func (this *Scene) ProtoPrivateRoom() *gamehall.PrivateRoomInfo { if this.GetPassword() != "" { needPassword = int32(1) } + + cost := this.sp.NeedRoomCardCost(int(this.CustomParam.GetCostType()), this.playerNum, PlatformMgrSingleton.GetConfig(this.platform.IdStr).RoomConfig[this.CustomParam.GetRoomConfigId()]) + var costItems []*gamehall.ItemInfo + for _, vv := range cost { + costItems = append(costItems, &gamehall.ItemInfo{ + Id: vv.ItemID, + Num: int32(vv.Count), + }) + } + ret := &gamehall.PrivateRoomInfo{ GameFreeId: this.dbGameFree.GetId(), GameId: int32(this.gameId), @@ -966,6 +976,7 @@ func (this *Scene) ProtoPrivateRoom() *gamehall.PrivateRoomInfo { CreateTs: this.createTime.Unix(), State: this.SceneState, CostType: this.CustomParam.GetCostType(), + Cost: costItems, } for _, v := range this.players { ret.Players = append(ret.Players, &gamehall.PrivatePlayerInfo{ @@ -980,6 +991,7 @@ func (this *Scene) ProtoPrivateRoom() *gamehall.PrivateRoomInfo { ret.WinSnId = p.SnId ret.WinName = p.GetName() ret.WinRoleId = p.Roles.ModId + ret.WinHeadUrl = p.HeadUrl } } return ret