modify 结算

This commit is contained in:
sk 2025-01-06 18:12:05 +08:00
parent 990e211d0d
commit d481ee25b9
2 changed files with 13 additions and 1 deletions

View File

@ -74,6 +74,7 @@ type TienLenSceneData struct {
RoundLogId []string // 每局牌局记录id
CustomLogSave bool // 是否已经保存日志
PlayerAward map[int32]*[]*model.Item // 房卡场最终奖励
Bill *tienlen.SCTienLenGameBilled // 结算信息
}
func NewTienLenSceneData(s *base.Scene) *TienLenSceneData {

View File

@ -1743,7 +1743,6 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
}()
//在这里执行结算
if sceneEx, ok := s.GetExtraData().(*TienLenSceneData); ok {
addItems := func(billData *tienlen.TienLenPlayerGameBilled, sceneTypeScore, vipAdd, vipScore, roleAdd, roleScore, weekCardScore, skinAdd, skinScore int64) {
// 场次加成配置
if sceneTypeScore > 0 {
@ -2706,6 +2705,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
proto.SetDefaults(pack)
s.Broadcast(int(tienlen.TienLenPacketID_PACKET_SCTienLenGameBilled), pack, 0)
logger.Logger.Trace("TienLenPacketID_PACKET_SCTienLenGameBilled gameFreeId:", sceneEx.GetGameFreeId(), ";pack:", pack)
sceneEx.Bill = pack
//if sceneEx.IsCustom() && sceneEx.TotalOfGames > 0 {
// for _, v := range tienlenType.PlayerData {
@ -2943,6 +2943,7 @@ func (this *SceneBilledStateTienLen) OnLeave(s *base.Scene) {
if len(sceneEx.tianHuSnids) != sceneEx.GetGameingPlayerCnt() { //非和局
sceneEx.lastWinSnid = sceneEx.winSnids[0]
}
sceneEx.Bill = nil
hasLeave := false
//剔除下线玩家
for i := 0; i < sceneEx.GetPlayerNum(); i++ {
@ -3038,6 +3039,16 @@ func (this *SceneBilledStateTienLen) OnPlayerOp(s *base.Scene, p *base.Player, o
// 玩家事件
func (this *SceneBilledStateTienLen) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
this.SceneBaseStateTienLen.OnPlayerEvent(s, p, evtcode, params)
sceneEx, ok := s.GetExtraData().(*TienLenSceneData)
if !ok {
return
}
switch evtcode {
case base.PlayerEventRehold, base.PlayerEventReturn:
if sceneEx.Bill != nil && !p.IsMarkFlag(base.PlayerState_Ready) {
p.SendToClient(int(tienlen.TienLenPacketID_PACKET_SCTienLenGameBilled), sceneEx.Bill)
}
}
}
func (this *SceneBilledStateTienLen) OnTick(s *base.Scene) {