From 7991a8044d30488a60f69ce94ae0dc7dd2d481a7 Mon Sep 17 00:00:00 2001 From: kxdd Date: Sat, 7 Sep 2024 17:37:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/action_clawdoll.go | 10 +++++++++ gamesrv/clawdoll/scenepolicy_clawdoll.go | 27 ++++++++++++++++++------ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/gamesrv/clawdoll/action_clawdoll.go b/gamesrv/clawdoll/action_clawdoll.go index fab8d37..6b4800f 100644 --- a/gamesrv/clawdoll/action_clawdoll.go +++ b/gamesrv/clawdoll/action_clawdoll.go @@ -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 { // 获得娃娃卡 diff --git a/gamesrv/clawdoll/scenepolicy_clawdoll.go b/gamesrv/clawdoll/scenepolicy_clawdoll.go index b6bb5d0..949d72a 100644 --- a/gamesrv/clawdoll/scenepolicy_clawdoll.go +++ b/gamesrv/clawdoll/scenepolicy_clawdoll.go @@ -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) {