Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop
This commit is contained in:
commit
9012b2a4db
|
@ -314,6 +314,7 @@ const (
|
||||||
GainWayRoomCost = 106 //房费消耗
|
GainWayRoomCost = 106 //房费消耗
|
||||||
GainWayRoomGain = 107 //房卡场获得
|
GainWayRoomGain = 107 //房卡场获得
|
||||||
GainWayItemShop = 108 // 交易市场道具交易
|
GainWayItemShop = 108 // 交易市场道具交易
|
||||||
|
GainWayClawdoorCostItem = 109 // 娃娃机上分扣道具
|
||||||
)
|
)
|
||||||
|
|
||||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||||
|
|
|
@ -76,8 +76,11 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
|
||||||
case 1:
|
case 1:
|
||||||
if msg.Result == 1 {
|
if msg.Result == 1 {
|
||||||
logger.Logger.Tracef("上分成功!!!!!!!!!!!!snid = ", msg.Snid)
|
logger.Logger.Tracef("上分成功!!!!!!!!!!!!snid = ", msg.Snid)
|
||||||
|
|
||||||
|
sceneEx.playingSnid = p.SnId
|
||||||
|
|
||||||
//发送向前移动指令
|
//发送向前移动指令
|
||||||
//sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonFront)
|
sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonFront)
|
||||||
|
|
||||||
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
||||||
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart))
|
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart))
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package clawdoll
|
package clawdoll
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"mongo.games.com/game/common"
|
||||||
rule "mongo.games.com/game/gamerule/clawdoll"
|
rule "mongo.games.com/game/gamerule/clawdoll"
|
||||||
"mongo.games.com/game/gamesrv/base"
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"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"
|
||||||
)
|
)
|
||||||
|
@ -62,6 +64,41 @@ func (this *PlayerEx) CanPayCoin() bool {
|
||||||
// 投币消耗
|
// 投币消耗
|
||||||
func (this *PlayerEx) CostPlayCoin(count int32) bool {
|
func (this *PlayerEx) CostPlayCoin(count int32) bool {
|
||||||
|
|
||||||
|
if !this.CanPayCoin() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
var items []*model.Item
|
||||||
|
|
||||||
|
itemData := srvdata.GameItemMgr.Get(this.Platform, rule.ClawDoorItemID)
|
||||||
|
if itemData != nil {
|
||||||
|
items = append(items, &model.Item{
|
||||||
|
ItemId: rule.ClawDoorItemID,
|
||||||
|
ItemNum: -1,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
s := this.GetScene()
|
||||||
|
if s == nil {
|
||||||
|
logger.Logger.Warn("CostPlayCoin p.scene == nil")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
sceneEx, ok := s.ExtraData.(*SceneEx)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.AddItems(&model.AddItemParam{
|
||||||
|
P: this.PlayerData,
|
||||||
|
Change: items,
|
||||||
|
GainWay: common.GainWayClawdoorCostItem,
|
||||||
|
Operator: "system",
|
||||||
|
Remark: "娃娃机上分扣除道具",
|
||||||
|
GameId: int64(sceneEx.GameId),
|
||||||
|
GameFreeId: int64(sceneEx.GetGameFreeId()),
|
||||||
|
})
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -296,8 +296,8 @@ func (this *SceneEx) IsHasPlaying() bool {
|
||||||
|
|
||||||
// 等待下一个玩家
|
// 等待下一个玩家
|
||||||
func (this *SceneEx) ReStartGame() {
|
func (this *SceneEx) ReStartGame() {
|
||||||
|
logger.Logger.Trace("(*SceneEx) ReStartGame, playingSnid = ", this.playingSnid)
|
||||||
this.playingSnid = 0
|
this.playingSnid = 0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *SceneEx) BackupPlayer(p *PlayerEx, isBilled bool) {
|
func (this *SceneEx) BackupPlayer(p *PlayerEx, isBilled bool) {
|
||||||
|
|
|
@ -526,13 +526,11 @@ func (this *StateWait) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, par
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1-前 2-后 3-左 4-右 5-投币
|
|
||||||
sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonPayCoin)
|
|
||||||
|
|
||||||
if sceneEx.CanStart() {
|
if sceneEx.CanStart() {
|
||||||
sceneEx.playingSnid = playerEx.SnId
|
// 1-前 2-后 3-左 4-右 5-投币
|
||||||
|
sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonPayCoin)
|
||||||
|
|
||||||
sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
|
//sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,26 +733,6 @@ func (this *StateBilled) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, p
|
||||||
func (this *StateBilled) OnEnter(s *base.Scene) {
|
func (this *StateBilled) OnEnter(s *base.Scene) {
|
||||||
logger.Logger.Trace("(this *StateBilled) OnEnter, sceneid=", s.GetSceneId())
|
logger.Logger.Trace("(this *StateBilled) 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("SCSmallRocketRoundGameBilled is pack: ", pack)
|
|
||||||
proto.SetDefaults(pack)
|
|
||||||
|
|
||||||
playerEx.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_GAMEBILLED), pack)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *StateBilled) OnLeave(s *base.Scene) {
|
func (this *StateBilled) OnLeave(s *base.Scene) {
|
||||||
|
@ -842,12 +820,6 @@ func (this *StateWaitPayCoin) OnPlayerOp(s *base.Scene, p *base.Player, opcode i
|
||||||
|
|
||||||
playerEx.ReStartGame()
|
playerEx.ReStartGame()
|
||||||
|
|
||||||
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
|
||||||
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart))
|
|
||||||
|
|
||||||
ClawdollBroadcastRoomState(s)
|
|
||||||
ClawdollSendPlayerInfo(s)
|
|
||||||
|
|
||||||
sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
|
sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
|
||||||
|
|
||||||
case rule.ClawDollPlayerCancelPayCoin:
|
case rule.ClawDollPlayerCancelPayCoin:
|
||||||
|
@ -894,7 +866,7 @@ func (this *StateWaitPayCoin) OnEnter(s *base.Scene) {
|
||||||
Balance: proto.Int64(playerEx.Coin),
|
Balance: proto.Int64(playerEx.Coin),
|
||||||
}
|
}
|
||||||
|
|
||||||
// logger.Logger.Trace("SCSmallRocketRoundGameBilled is pack: ", pack)
|
logger.Logger.Trace("Clawdoor -StateWaitPayCoin is pack: ", pack)
|
||||||
proto.SetDefaults(pack)
|
proto.SetDefaults(pack)
|
||||||
|
|
||||||
playerEx.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_GAMEBILLED), pack)
|
playerEx.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_GAMEBILLED), pack)
|
||||||
|
|
Loading…
Reference in New Issue