Compare commits
No commits in common. "979645567ef02272136d678fc1e30c0a75c8bae9" and "9963ef130ae66f4707afa64c2156ca8c9497f599" have entirely different histories.
979645567e
...
9963ef130a
|
@ -71,7 +71,3 @@ const (
|
||||||
Zego_ForbidRTCStream = iota + 1
|
Zego_ForbidRTCStream = iota + 1
|
||||||
Zego_ResumeRTCStream = iota + 1
|
Zego_ResumeRTCStream = iota + 1
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
ClawDoorItemID = 40003
|
|
||||||
)
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ package clawdoll
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
rule "mongo.games.com/game/gamerule/clawdoll"
|
|
||||||
"mongo.games.com/game/gamesrv/base"
|
"mongo.games.com/game/gamesrv/base"
|
||||||
"mongo.games.com/game/protocol/clawdoll"
|
"mongo.games.com/game/protocol/clawdoll"
|
||||||
"mongo.games.com/game/protocol/machine"
|
"mongo.games.com/game/protocol/machine"
|
||||||
|
@ -53,20 +52,10 @@ func (h *CSPlayerOpHandler) Process(s *netlib.Session, packetid int, data interf
|
||||||
func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data interface{}) error {
|
func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data interface{}) error {
|
||||||
logger.Logger.Tracef("收到返回上分结果!!!!!!!!!!")
|
logger.Logger.Tracef("收到返回上分结果!!!!!!!!!!")
|
||||||
if msg, ok := data.(*machine.MSDollMachineoPerateResult); ok {
|
if msg, ok := data.(*machine.MSDollMachineoPerateResult); ok {
|
||||||
|
|
||||||
p := base.PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
|
p := base.PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
|
||||||
if p == nil {
|
if p == nil {
|
||||||
logger.Logger.Warn("MSDollMachineoCoinResultHandler p == nil")
|
logger.Logger.Warn("CSGetTokenHandler p == nil")
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
s := p.GetScene()
|
|
||||||
if s == nil {
|
|
||||||
logger.Logger.Warn("MSDollMachineoCoinResultHandler p.scene == nil")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
sceneEx, ok := s.ExtraData.(*SceneEx)
|
|
||||||
if !ok {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,17 +68,10 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
if msg.Result == 1 {
|
if msg.Result == 1 {
|
||||||
// 获得娃娃卡
|
|
||||||
logger.Logger.Tracef("下抓成功!!!!!!!!!!!!snid = ", msg.Snid)
|
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Tracef("下抓失败!!!!!!!!!!!!snid = ", msg.Snid)
|
logger.Logger.Tracef("下抓失败!!!!!!!!!!!!snid = ", msg.Snid)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.ChangeSceneState(rule.ClawDollSceneStateBilled)
|
|
||||||
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateBilled))
|
|
||||||
|
|
||||||
ClawdollBroadcastRoomState(s)
|
|
||||||
ClawdollSendPlayerInfo(s)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package clawdoll
|
package clawdoll
|
||||||
|
|
||||||
import (
|
import (
|
||||||
rule "mongo.games.com/game/gamerule/clawdoll"
|
|
||||||
"mongo.games.com/game/gamesrv/base"
|
"mongo.games.com/game/gamesrv/base"
|
||||||
"mongo.games.com/game/srvdata"
|
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -39,18 +37,11 @@ func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool {
|
||||||
|
|
||||||
// 能否投币
|
// 能否投币
|
||||||
func (this *PlayerEx) CanPayCoin() bool {
|
func (this *PlayerEx) CanPayCoin() bool {
|
||||||
|
|
||||||
itemID := int32(rule.ClawDoorItemID)
|
|
||||||
itemData := srvdata.GameItemMgr.Get(this.Platform, itemID)
|
|
||||||
if itemData == nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 投币消耗
|
// 投币消耗
|
||||||
func (this *PlayerEx) CostPlayCoin(count int32) bool {
|
func (this *PlayerEx) CostPlayCoin() bool {
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -115,16 +106,3 @@ func (this *PlayerEx) GetClawState() int32 {
|
||||||
func (this *PlayerEx) SetClawState(state int32) {
|
func (this *PlayerEx) SetClawState(state int32) {
|
||||||
this.clawDollState = state
|
this.clawDollState = state
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PlayerEx) GetItemCount(itemID int32) int64 {
|
|
||||||
itemData := srvdata.GameItemMgr.Get(this.Platform, itemID)
|
|
||||||
if itemData != nil {
|
|
||||||
v, ok := this.Items[itemID]
|
|
||||||
if ok {
|
|
||||||
return v
|
|
||||||
} else {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
|
@ -700,7 +700,7 @@ func (this *PlayGame) OnTick(s *base.Scene) {
|
||||||
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollScenePlayTimeout {
|
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollScenePlayTimeout {
|
||||||
|
|
||||||
if sceneEx.TimeOutPlayGrab() {
|
if sceneEx.TimeOutPlayGrab() {
|
||||||
logger.Logger.Trace("PlayGame OnTick TimeOutPlayGrab SnId", sceneEx.playingSnid, " machineId:", sceneEx.machineId)
|
//logger.Logger.Trace("PlayGame OnTick TimeOutPlayGrab SnId", sceneEx.playingSnid, " machineId:", sceneEx.machineId)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.ChangeSceneState(rule.ClawDollSceneStateBilled)
|
s.ChangeSceneState(rule.ClawDollSceneStateBilled)
|
||||||
|
|
Loading…
Reference in New Issue