Merge branch 'develop' of https://git.pogorockgames.com/mango-games/server/game into develop
This commit is contained in:
commit
3cd2dd06e1
|
|
@ -71,3 +71,7 @@ const (
|
|||
Zego_ForbidRTCStream = iota + 1
|
||||
Zego_ResumeRTCStream = iota + 1
|
||||
)
|
||||
|
||||
const (
|
||||
ClawDoorItemID = 40003
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package clawdoll
|
|||
|
||||
import (
|
||||
"mongo.games.com/game/common"
|
||||
rule "mongo.games.com/game/gamerule/clawdoll"
|
||||
"mongo.games.com/game/gamesrv/base"
|
||||
"mongo.games.com/game/protocol/clawdoll"
|
||||
"mongo.games.com/game/protocol/machine"
|
||||
|
|
@ -52,10 +53,20 @@ func (h *CSPlayerOpHandler) Process(s *netlib.Session, packetid int, data interf
|
|||
func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data interface{}) error {
|
||||
logger.Logger.Tracef("收到返回上分结果!!!!!!!!!!")
|
||||
if msg, ok := data.(*machine.MSDollMachineoPerateResult); ok {
|
||||
|
||||
p := base.PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
|
||||
if p == nil {
|
||||
logger.Logger.Warn("CSGetTokenHandler p == nil")
|
||||
logger.Logger.Warn("MSDollMachineoCoinResultHandler 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
|
||||
}
|
||||
|
||||
|
|
@ -68,10 +79,17 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
|
|||
}
|
||||
case 2:
|
||||
if msg.Result == 1 {
|
||||
|
||||
// 获得娃娃卡
|
||||
logger.Logger.Tracef("下抓成功!!!!!!!!!!!!snid = ", msg.Snid)
|
||||
} else {
|
||||
logger.Logger.Tracef("下抓失败!!!!!!!!!!!!snid = ", msg.Snid)
|
||||
}
|
||||
|
||||
s.ChangeSceneState(rule.ClawDollSceneStateBilled)
|
||||
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateBilled))
|
||||
|
||||
ClawdollBroadcastRoomState(s)
|
||||
ClawdollSendPlayerInfo(s)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package clawdoll
|
||||
|
||||
import (
|
||||
rule "mongo.games.com/game/gamerule/clawdoll"
|
||||
"mongo.games.com/game/gamesrv/base"
|
||||
"mongo.games.com/game/srvdata"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
)
|
||||
|
||||
|
|
@ -37,11 +39,18 @@ func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool {
|
|||
|
||||
// 能否投币
|
||||
func (this *PlayerEx) CanPayCoin() bool {
|
||||
|
||||
itemID := int32(rule.ClawDoorItemID)
|
||||
itemData := srvdata.GameItemMgr.Get(this.Platform, itemID)
|
||||
if itemData == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// 投币消耗
|
||||
func (this *PlayerEx) CostPlayCoin() bool {
|
||||
func (this *PlayerEx) CostPlayCoin(count int32) bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
|
@ -106,3 +115,16 @@ func (this *PlayerEx) GetClawState() int32 {
|
|||
func (this *PlayerEx) SetClawState(state int32) {
|
||||
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 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)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ func init() {
|
|||
if err != nil {
|
||||
pack.Tag = webapiproto.TagCode_FAILED
|
||||
pack.Msg = "数据序列化失败"
|
||||
return common.ResponseTag_ParamError, pack
|
||||
return common.ResponseTag_Ok, pack
|
||||
}
|
||||
pack.Tag = webapiproto.TagCode_SUCCESS
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ func init() {
|
|||
if scene == nil || scene.ExtraData == nil {
|
||||
pack.Tag = webapiproto.TagCode_NotFound
|
||||
pack.Msg = "房间没找到"
|
||||
return common.ResponseTag_NoFindRoom, pack
|
||||
return common.ResponseTag_Ok, pack
|
||||
}
|
||||
|
||||
switch d := scene.ExtraData.(type) {
|
||||
|
|
|
|||
2
public
2
public
|
|
@ -1 +1 @@
|
|||
Subproject commit 06da9b31abec96f3936877d7d73069e9852781ff
|
||||
Subproject commit 00b9fce886af5b6a926aa804d3cad33be9ea0793
|
||||
Loading…
Reference in New Issue