娃娃机结算结果修改
This commit is contained in:
parent
28982e018c
commit
b0eb952494
|
@ -119,6 +119,8 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
|
|||
playerEx.IsWin = false
|
||||
}
|
||||
|
||||
playerEx.SendPlayerGameBilled(int32(sceneEx.RoundId))
|
||||
|
||||
logger.Logger.Tracef("ClawDoll StatePlayGame OnPlayerOp Grab response, SnId= %v", msg.Snid)
|
||||
|
||||
s.ChangeSceneState(rule.ClawDollSceneStateBilled)
|
||||
|
|
|
@ -6,6 +6,9 @@ import (
|
|||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/srvdata"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
|
||||
"mongo.games.com/game/proto"
|
||||
"mongo.games.com/game/protocol/clawdoll"
|
||||
)
|
||||
|
||||
type PlayerEx struct {
|
||||
|
@ -225,3 +228,24 @@ func (this *PlayerEx) GetItemCount(itemID int32) int64 {
|
|||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -924,26 +924,6 @@ 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("Clawdoor -StateWaitPayCoin is pack: ", pack)
|
||||
proto.SetDefaults(pack)
|
||||
|
||||
playerEx.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_GAMEBILLED), pack)
|
||||
}
|
||||
}
|
||||
|
||||
func (this *StateWaitPayCoin) OnLeave(s *base.Scene) {
|
||||
|
|
Loading…
Reference in New Issue