fix:房间列表变更房费信息

This commit is contained in:
sk 2024-12-19 16:28:44 +08:00
parent 06c6284116
commit e39a231a51
1 changed files with 12 additions and 0 deletions

View File

@ -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