Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop

This commit is contained in:
sk 2024-10-09 17:12:29 +08:00
commit 373dd36b31
3 changed files with 26 additions and 20 deletions

View File

@ -119,6 +119,8 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
playerEx.IsWin = false playerEx.IsWin = false
} }
playerEx.SendPlayerGameBilled(int32(sceneEx.RoundId))
logger.Logger.Tracef("ClawDoll StatePlayGame OnPlayerOp Grab response, SnId= %v", msg.Snid) logger.Logger.Tracef("ClawDoll StatePlayGame OnPlayerOp Grab response, SnId= %v", msg.Snid)
s.ChangeSceneState(rule.ClawDollSceneStateBilled) s.ChangeSceneState(rule.ClawDollSceneStateBilled)

View File

@ -6,6 +6,9 @@ import (
"mongo.games.com/game/model" "mongo.games.com/game/model"
"mongo.games.com/game/srvdata" "mongo.games.com/game/srvdata"
"mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/logger"
"mongo.games.com/game/proto"
"mongo.games.com/game/protocol/clawdoll"
) )
type PlayerEx struct { type PlayerEx struct {
@ -225,3 +228,24 @@ func (this *PlayerEx) GetItemCount(itemID int32) int64 {
} }
return 0 return 0
} }
func (this *PlayerEx) SendPlayerGameBilled(RoundId int32) {
if this != nil {
result := 0
if this.IsWin {
result = 1
}
pack := &clawdoll.SCCLAWDOLLRoundGameBilled{
RoundId: proto.Int32(RoundId),
ClowResult: proto.Int32(int32(result)),
Award: proto.Int64(this.gainCoin),
Balance: proto.Int64(this.Coin),
}
logger.Logger.Trace("Clawdoor -StateWaitPayCoin is pack: ", pack)
proto.SetDefaults(pack)
this.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_GAMEBILLED), pack)
}
}

View File

@ -924,26 +924,6 @@ func (this *StateWaitPayCoin) OnPlayerOp(s *base.Scene, p *base.Player, opcode i
func (this *StateWaitPayCoin) OnEnter(s *base.Scene) { func (this *StateWaitPayCoin) OnEnter(s *base.Scene) {
logger.Logger.Trace("(this *StateWaitPayCoin) OnEnter, sceneid=", s.GetSceneId()) logger.Logger.Trace("(this *StateWaitPayCoin) OnEnter, sceneid=", s.GetSceneId())
this.BaseState.OnEnter(s) this.BaseState.OnEnter(s)
sceneEx, ok := s.ExtraData.(*SceneEx)
if !ok {
return
}
playerEx := sceneEx.GetPlayingEx()
if playerEx != nil {
pack := &clawdoll.SCCLAWDOLLRoundGameBilled{
RoundId: proto.Int32(int32(sceneEx.RoundId)),
ClowResult: proto.Int32(0),
Award: proto.Int64(playerEx.gainCoin),
Balance: proto.Int64(playerEx.Coin),
}
logger.Logger.Trace("Clawdoor -StateWaitPayCoin is pack: ", pack)
proto.SetDefaults(pack)
playerEx.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_GAMEBILLED), pack)
}
} }
func (this *StateWaitPayCoin) OnLeave(s *base.Scene) { func (this *StateWaitPayCoin) OnLeave(s *base.Scene) {