Compare commits

...

2 Commits

Author SHA1 Message Date
kxdd 13042959c9 Merge branch 'ma' into develop 2024-09-07 17:37:50 +08:00
kxdd 7991a8044d 娃娃机状态调整 2024-09-07 17:37:22 +08:00
2 changed files with 30 additions and 7 deletions

View File

@ -78,9 +78,19 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
logger.Logger.Tracef("上分成功snid = ", msg.Snid)
//发送向前移动指令
sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonFront)
s.ChangeSceneState(rule.ClawDollSceneStateStart)
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart))
ClawdollBroadcastRoomState(s)
ClawdollSendPlayerInfo(s)
ClawdollBroadcastPlayingInfo(s)
} else {
logger.Logger.Tracef("上分失败snid = ", msg.Snid)
}
case 2:
if msg.Result == 1 {
// 获得娃娃卡

View File

@ -531,13 +531,6 @@ func (this *StateWait) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, par
if sceneEx.CanStart() {
sceneEx.playingSnid = playerEx.SnId
s.ChangeSceneState(rule.ClawDollSceneStateStart)
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart))
ClawdollBroadcastRoomState(s)
ClawdollSendPlayerInfo(s)
ClawdollBroadcastPlayingInfo(s)
sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
}
@ -886,6 +879,26 @@ func (this *StateWaitPayCoin) OnPlayerOp(s *base.Scene, p *base.Player, opcode i
func (this *StateWaitPayCoin) OnEnter(s *base.Scene) {
logger.Logger.Trace("(this *StateWaitPayCoin) OnEnter, sceneid=", s.GetSceneId())
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("SCSmallRocketRoundGameBilled is pack: ", pack)
proto.SetDefaults(pack)
playerEx.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_GAMEBILLED), pack)
}
}
func (this *StateWaitPayCoin) OnLeave(s *base.Scene) {