Merge branch 'develop' into release

This commit is contained in:
sk 2024-09-13 13:52:38 +08:00
commit 48ccfebe34
25 changed files with 509 additions and 215 deletions

View File

@ -314,6 +314,7 @@ const (
GainWayRoomCost = 106 //房费消耗 GainWayRoomCost = 106 //房费消耗
GainWayRoomGain = 107 //房卡场获得 GainWayRoomGain = 107 //房卡场获得
GainWayItemShop = 108 // 交易市场道具交易 GainWayItemShop = 108 // 交易市场道具交易
GainWayClawdoorCostItem = 109 // 娃娃机上分扣道具
) )
// 后台选择 金币变化类型 的充值 类型id号起始 // 后台选择 金币变化类型 的充值 类型id号起始

View File

@ -30,6 +30,8 @@ const (
ClawDollSceneBilledTimeout = time.Second * 2 //结算 ClawDollSceneBilledTimeout = time.Second * 2 //结算
ClawDollSceneWaitPayCoinimeout = time.Second * 10 //等待下一局投币 ClawDollSceneWaitPayCoinimeout = time.Second * 10 //等待下一局投币
ClawDollSceneGrapTimeOut = time.Second * 5 //下抓防卡死强制变状态倒计时
ClawDollScenePayCoinTimeOut = time.Second * 2 //投币防卡死强制变状态倒计时
) )
// 玩家操作 // 玩家操作

View File

@ -69,8 +69,18 @@ func MSUpdateDollMachineStatusHandler(session *netlib.Session, packetId int, dat
} }
return nil return nil
} }
func MSDollMachineHeartBeatHandler(session *netlib.Session, packetId int, data interface{}) error {
//fmt.Println("收到娃娃机服务心跳!!!")
//返回心跳
pack := &machine.SMDollMachineHeartBeat{}
session.Send(int(machine.DollMachinePacketID_Packet_SMDollMachineHeartBeat), pack)
return nil
}
func init() { func init() {
netlib.Register(int(machine.DollMachinePacketID_PACKET_MSDollMachineList), &machine.MSDollMachineList{}, MSDollMachineListHandler) netlib.Register(int(machine.DollMachinePacketID_PACKET_MSDollMachineList), &machine.MSDollMachineList{}, MSDollMachineListHandler)
//更新娃娃机链接状态 //更新娃娃机链接状态
netlib.Register(int(machine.DollMachinePacketID_PACKET_MSUpdateDollMachineStatus), &machine.MSUpdateDollMachineStatus{}, MSUpdateDollMachineStatusHandler) netlib.Register(int(machine.DollMachinePacketID_PACKET_MSUpdateDollMachineStatus), &machine.MSUpdateDollMachineStatus{}, MSUpdateDollMachineStatusHandler)
//心跳
netlib.Register(int(machine.DollMachinePacketID_Packet_MSDollMachineHeartBeat), &machine.MSDollMachineHeartBeat{}, MSDollMachineHeartBeatHandler)
} }

View File

@ -9,6 +9,7 @@ import (
"mongo.games.com/game/etcd" "mongo.games.com/game/etcd"
"mongo.games.com/game/model" "mongo.games.com/game/model"
"mongo.games.com/game/protocol/webapi" "mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata"
) )
var ConfigMgrInst = model.NewConfigMgr() var ConfigMgrInst = model.NewConfigMgr()
@ -18,6 +19,8 @@ func init() {
etcd.Register(etcd.ETCDKEY_PLAYERPOOL, webapi.PlayerPool{}, platformConfigEtcd) etcd.Register(etcd.ETCDKEY_PLAYERPOOL, webapi.PlayerPool{}, platformConfigEtcd)
// 游戏配置 // 游戏配置
etcd.Register(etcd.ETCDKEY_GAME_CONFIG, webapi.GameConfig{}, platformConfigEtcd) etcd.Register(etcd.ETCDKEY_GAME_CONFIG, webapi.GameConfig{}, platformConfigEtcd)
// 道具列表
etcd.Register(etcd.ETCDKEY_Item, webapi.ItemConfig{}, platformConfigEtcd)
// 集卡活动 // 集卡活动
etcd.Register(etcd.ETCDKEY_ACT_Collect, webapi.WelfareCollectConfig{}, platformConfigEtcd) etcd.Register(etcd.ETCDKEY_ACT_Collect, webapi.WelfareCollectConfig{}, platformConfigEtcd)
// 渠道开关 // 渠道开关
@ -45,6 +48,9 @@ func platformConfigEtcd(ctx context.Context, completeKey string, isInit bool, ev
ConfigMgrInst.GetConfig(d.Platform).SkinConfig = d ConfigMgrInst.GetConfig(d.Platform).SkinConfig = d
case *webapi.MachineConfig: case *webapi.MachineConfig:
ConfigMgrInst.GetConfig(d.Platform).MachineConfig = d ConfigMgrInst.GetConfig(d.Platform).MachineConfig = d
case *webapi.ItemConfig:
ConfigMgrInst.GetConfig(d.Platform).ItemConfig = d
srvdata.GameItemMgr.SetConfig(d)
default: default:
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey) logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
} }

View File

@ -582,6 +582,9 @@ func (this *Scene) AudienceSit(p *Player) {
p.OnEnter(this) p.OnEnter(this)
//避免游戏接口异常 //避免游戏接口异常
utils.RunPanicless(func() { this.sp.OnAudienceSit(this, p) }) utils.RunPanicless(func() { this.sp.OnAudienceSit(this, p) })
if !p.IsRob {
this.realPlayerNum++
}
} }
} }

View File

@ -9,6 +9,7 @@ import (
"mongo.games.com/game/protocol/machine" "mongo.games.com/game/protocol/machine"
"mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib" "mongo.games.com/goserver/core/netlib"
"mongo.games.com/goserver/core/timer"
"strconv" "strconv"
) )
@ -74,10 +75,14 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
switch msg.TypeId { switch msg.TypeId {
case 1: case 1:
logger.Logger.Tracef("ClawDoll OnPlayerOp payCoin response, SnId= %v", p.SnId)
if msg.Result == 1 { if msg.Result == 1 {
logger.Logger.Tracef("上分成功snid = ", msg.Snid) logger.Logger.Tracef("上分成功snid = %v", 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))
@ -88,22 +93,29 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
ClawdollBroadcastPlayingInfo(s) ClawdollBroadcastPlayingInfo(s)
} else { } else {
logger.Logger.Tracef("上分失败snid = ", msg.Snid) logger.Logger.Tracef("上分失败snid = %v", msg.Snid)
} }
case 2: case 2:
if msg.Result == 1 { if msg.Result == 1 {
// 获得娃娃卡 // 获得娃娃卡
logger.Logger.Tracef("下抓成功snid = ", msg.Snid) logger.Logger.Tracef("下抓成功snid = %v", msg.Snid)
} else { } else {
logger.Logger.Tracef("下抓失败snid = ", msg.Snid) logger.Logger.Tracef("下抓失败snid = %v", msg.Snid)
} }
logger.Logger.Tracef("ClawDoll StatePlayGame OnPlayerOp Grab response, SnId= %v", msg.Snid)
s.ChangeSceneState(rule.ClawDollSceneStateBilled) s.ChangeSceneState(rule.ClawDollSceneStateBilled)
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateBilled)) sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateBilled))
ClawdollBroadcastRoomState(s) ClawdollBroadcastRoomState(s)
ClawdollSendPlayerInfo(s) ClawdollSendPlayerInfo(s)
if sceneEx.grabTimerHandle != timer.TimerHandle(0) {
timer.StopTimer(sceneEx.grabTimerHandle)
sceneEx.grabTimerHandle = timer.TimerHandle(0)
}
} }
} }
return nil return nil

View File

@ -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
} }

View File

@ -66,6 +66,9 @@ type SceneEx struct {
machineId int //娃娃机ID machineId int //娃娃机ID
machineConn *netlib.Session //娃娃机链接 machineConn *netlib.Session //娃娃机链接
machineStatus int32 //娃娃机链接状态 0:离线 1:在线 machineStatus int32 //娃娃机链接状态 0:离线 1:在线
payCoinTimeHandle timer.TimerHandle //上分投币托管handle
grabTimerHandle timer.TimerHandle //下抓托管handle
} }
// 游戏是否能开始 // 游戏是否能开始
@ -296,8 +299,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) {
@ -392,6 +395,7 @@ func (this *SceneEx) TimeOutPlayGrab() bool {
if playerEx != nil { if playerEx != nil {
grapType := this.GetPlayGrabType(playerEx) grapType := this.GetPlayGrabType(playerEx)
this.OnPlayerSMGrabOp(this.playingSnid, int32(this.machineId), grapType) this.OnPlayerSMGrabOp(this.playingSnid, int32(this.machineId), grapType)
} }
return true return true
@ -431,6 +435,34 @@ func (this *SceneEx) SendToMachine(pid int, msg interface{}) {
} }
} }
// 下抓托管handle
func (this *SceneEx) GrabTimerHandle() {
if this.grabTimerHandle != timer.TimerHandle(0) {
timer.StopTimer(this.grabTimerHandle)
this.grabTimerHandle = timer.TimerHandle(0)
}
this.grabTimerHandle, _ = timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
logger.Logger.Tracef("ClawDoll SceneEx GrabTimerHandle: TimeOut: %v", rule.ClawDollSceneGrapTimeOut)
this.TimeOutPlayGrab()
return true
}), nil, rule.ClawDollSceneGrapTimeOut, 1)
}
// 上分投币托管handle
func (this *SceneEx) PayCoinTimeHandle() {
if this.payCoinTimeHandle != timer.TimerHandle(0) {
timer.StopTimer(this.payCoinTimeHandle)
this.payCoinTimeHandle = timer.TimerHandle(0)
}
this.payCoinTimeHandle, _ = timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
logger.Logger.Tracef("ClawDoll SceneEx PayCoinTimeHandle: TimeOut: %v", rule.ClawDollScenePayCoinTimeOut)
return true
}), nil, rule.ClawDollScenePayCoinTimeOut, 1)
}
// actionType : 1 禁止推流 ForbidRTCStream // actionType : 1 禁止推流 ForbidRTCStream
// actionType : 2 恢复推流 ResumeRTCStream // actionType : 2 恢复推流 ResumeRTCStream
func operateTask(sceneEx *SceneEx, times int, actionType int, platform string) { func operateTask(sceneEx *SceneEx, times int, actionType int, platform string) {

View File

@ -526,13 +526,13 @@ 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) logger.Logger.Trace("(ClawDoll this *StateWait) OnPlayerOp payCoin, sceneId=", s.GetSceneId(), " player=", p.SnId, " machineId=", sceneEx.machineId)
//sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
} }
} }
@ -577,6 +577,8 @@ func (this *StateStart) OnTick(s *base.Scene) {
this.BaseState.OnTick(s) this.BaseState.OnTick(s)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok { if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollSceneStartTimeout { if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollSceneStartTimeout {
logger.Logger.Trace("ClawDoll StateStart OnTick ChangeSceneState:", rule.ClawDollSceneStatePlayGame)
//切换到等待操作状态 //切换到等待操作状态
s.ChangeSceneState(rule.ClawDollSceneStatePlayGame) s.ChangeSceneState(rule.ClawDollSceneStatePlayGame)
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStatePlayGame)) sceneEx.SetPlayingState(int32(rule.ClawDollSceneStatePlayGame))
@ -638,7 +640,7 @@ func (this *PlayGame) OnEnter(s *base.Scene) {
func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool { func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
logger.Logger.Trace("StatePlayGame OnPlayerOp-----SnId:", p.SnId, " opcode: ", opcode, " params:", params) logger.Logger.Trace("ClawDoll StatePlayGame OnPlayerOp-----SnId:", p.SnId, " opcode: ", opcode, " params:", params)
if this.BaseState.OnPlayerOp(s, p, opcode, params) { if this.BaseState.OnPlayerOp(s, p, opcode, params) {
return true return true
@ -666,7 +668,7 @@ func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, para
grapType := sceneEx.GetPlayGrabType(playerEx) grapType := sceneEx.GetPlayGrabType(playerEx)
logger.Logger.Trace("StatePlayGame OnPlayerOp-----SnId:", p.SnId, " grapType: ", grapType) logger.Logger.Trace("ClawDoll StatePlayGame OnPlayerOp Grab-----SnId:", p.SnId, " grapType: ", grapType)
//1-弱力抓 2 -强力抓 //1-弱力抓 2 -强力抓
sceneEx.OnPlayerSMGrabOp(p.SnId, int32(sceneEx.machineId), grapType) sceneEx.OnPlayerSMGrabOp(p.SnId, int32(sceneEx.machineId), grapType)
@ -683,7 +685,7 @@ func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, para
} }
if params[0] < rule.ButtonFront || params[0] > rule.ButtonRight { if params[0] < rule.ButtonFront || params[0] > rule.ButtonRight {
logger.Logger.Trace("StatePlayGame OnPlayerOp-----SnId:", p.SnId, " opcode: ", opcode, " params:", params) logger.Logger.Trace("ClawDoll StatePlayGame OnPlayerOp-----SnId:", p.SnId, " opcode: ", opcode, " params:", params)
return false return false
} }
// 1-前 2-后 3-左 4-右 5-投币 // 1-前 2-后 3-左 4-右 5-投币
@ -698,9 +700,11 @@ func (this *PlayGame) OnTick(s *base.Scene) {
if sceneEx, ok := s.ExtraData.(*SceneEx); ok { if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollScenePlayTimeout { if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollScenePlayTimeout {
if sceneEx.TimeOutPlayGrab() { if sceneEx.Gaming && sceneEx.TimeOutPlayGrab() {
sceneEx.Gaming = false sceneEx.Gaming = false
logger.Logger.Trace("PlayGame OnTick TimeOutPlayGrab SnId", sceneEx.playingSnid, " machineId:", sceneEx.machineId) logger.Logger.Trace("PlayGame OnTick TimeOutPlayGrab SnId: ", sceneEx.playingSnid, " machineId:", sceneEx.machineId)
sceneEx.GrabTimerHandle()
} }
return return
@ -735,26 +739,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 +826,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 +872,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)

View File

@ -1964,7 +1964,7 @@ func (this *TienLenSceneData) TrySmallGameBilled() {
score = int64(this.roundScore) * int64(baseScore) / 100 //百分比 score = int64(this.roundScore) * int64(baseScore) / 100 //百分比
} }
losePlayerCoin := losePlayer.GetCoin() losePlayerCoin := losePlayer.GetCoin()
if !this.IsMatchScene() && losePlayerCoin < score { //输完 if !this.IsMatchScene() && !this.IsCustom() && losePlayerCoin < score { //输完
score = losePlayerCoin score = losePlayerCoin
} }
//判断宠物技能生不生效 //判断宠物技能生不生效
@ -1983,7 +1983,7 @@ func (this *TienLenSceneData) TrySmallGameBilled() {
gainScore := int64(float64(score) * float64(10000-taxRate) / 10000.0) //税后 gainScore := int64(float64(score) * float64(10000-taxRate) / 10000.0) //税后
bombTaxScore := score - gainScore bombTaxScore := score - gainScore
// win // win
if this.IsMatchScene() { if this.IsMatchScene() || this.IsCustom() {
winPlayer.AddCoinNoLog(gainScore, 0) winPlayer.AddCoinNoLog(gainScore, 0)
} else { } else {
winPlayer.AddCoin(gainScore, common.GainWay_CoinSceneWin, 0, "system", this.GetSceneName()) winPlayer.AddCoin(gainScore, common.GainWay_CoinSceneWin, 0, "system", this.GetSceneName())
@ -1997,7 +1997,7 @@ func (this *TienLenSceneData) TrySmallGameBilled() {
winPlayer.bombRankScore += rankScore * rule.RankBaseScore winPlayer.bombRankScore += rankScore * rule.RankBaseScore
} }
//lose //lose
if this.IsMatchScene() { if this.IsMatchScene() && this.IsCustom() {
losePlayer.AddCoinNoLog(-score, 0) losePlayer.AddCoinNoLog(-score, 0)
} else { } else {
losePlayer.AddCoin(-score, common.GainWay_CoinSceneLost, 0, "system", this.GetSceneName()) losePlayer.AddCoin(-score, common.GainWay_CoinSceneLost, 0, "system", this.GetSceneName())

View File

@ -1790,7 +1790,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
} }
} }
losePlayerCoin := losePlayer.GetCoin() losePlayerCoin := losePlayer.GetCoin()
if !sceneEx.IsMatchScene() && losePlayerCoin < gainScore { if !sceneEx.IsMatchScene() && !sceneEx.IsCustom() && losePlayerCoin < gainScore {
gainScore = losePlayerCoin gainScore = losePlayerCoin
} }
losePlayerScore = gainScore losePlayerScore = gainScore
@ -1932,7 +1932,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
} }
} }
lastWinPlayerCoin := lastWinPlayer.GetCoin() lastWinPlayerCoin := lastWinPlayer.GetCoin()
if !sceneEx.IsMatchScene() && lastWinPlayerCoin < astWinGainScore { if !sceneEx.IsMatchScene() && !sceneEx.IsCustom() && lastWinPlayerCoin < astWinGainScore {
astWinGainScore = lastWinPlayerCoin astWinGainScore = lastWinPlayerCoin
} }
lastWinPlayerScore = astWinGainScore lastWinPlayerScore = astWinGainScore
@ -2292,7 +2292,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
} }
} }
losePlayerCoin := playerEx.GetCoin() losePlayerCoin := playerEx.GetCoin()
if !sceneEx.IsMatchScene() && losePlayerCoin < gainScore { if !sceneEx.IsMatchScene() && !sceneEx.IsCustom() && losePlayerCoin < gainScore {
gainScore = losePlayerCoin gainScore = losePlayerCoin
} }
winScore += gainScore winScore += gainScore
@ -2659,7 +2659,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
// 刷新存钱罐 // 刷新存钱罐
playerEx := s.GetPlayer(o_player.UserId) playerEx := s.GetPlayer(o_player.UserId)
if playerEx != nil && (!(s.IsFreePublic() || s.IsMatchScene())) { if playerEx != nil && (!(s.IsFreePublic() || s.IsMatchScene() || s.IsCustom())) {
playerEx.UpdatePigBankCoin(o_player.GainCoin) playerEx.UpdatePigBankCoin(o_player.GainCoin)
} }

View File

@ -77,7 +77,11 @@ func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data inte
conn, ok := machinedoll.MachineMgr.ConnMap[int(msg.GetId())] conn, ok := machinedoll.MachineMgr.ConnMap[int(msg.GetId())]
if !ok || conn == nil { if !ok || conn == nil {
return nil fmt.Println("移动,创建链接!!!!!!!!!!!!!")
conn = machinedoll.MachineMgr.CreateConn(int(msg.GetId()))
if conn == nil {
return nil
}
} }
switch msg.Perate { switch msg.Perate {
@ -119,8 +123,9 @@ func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data inte
Process(conn, f1, f2) Process(conn, f1, f2)
case 5: case 5:
//投币 //投币
fmt.Println("===========玩家投币===========") conn := machinedoll.MachineMgr.CreateConn(int(msg.GetId()))
go DollMachineGrabResult(session, conn, msg.Snid, msg.GetId()) fmt.Println("===========玩家投币===========", conn)
go DollMachineGrabResult(conn, msg.Snid, msg.GetId())
machinedoll.Coin(conn) machinedoll.Coin(conn)
} }
@ -137,7 +142,11 @@ func SMDollMachineGrabHandler(session *netlib.Session, packetId int, data interf
conn, ok := machinedoll.MachineMgr.ConnMap[int(msg.GetId())] conn, ok := machinedoll.MachineMgr.ConnMap[int(msg.GetId())]
if !ok || conn == nil { if !ok || conn == nil {
return nil fmt.Println("下抓,创建链接!!!!!!!!!!!!!")
conn = machinedoll.MachineMgr.CreateConn(int(msg.GetId()))
if conn == nil {
return nil
}
} }
switch msg.GetTypeId() { switch msg.GetTypeId() {
@ -162,7 +171,7 @@ func SMDollMachineGrabHandler(session *netlib.Session, packetId int, data interf
} }
// 监听抓取结果返回 // 监听抓取结果返回
func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid, id int32) { func DollMachineGrabResult(conn *machinedoll.Conn, snid, id int32) {
num := int64(1) num := int64(1)
for { for {
// 读取数据 // 读取数据
@ -198,6 +207,13 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
Result: 0, Result: 0,
TypeId: 2, TypeId: 2,
}) })
//删除娃娃机链接
//delete(machinedoll.MachineMgr.ConnMap, conn.Id)
err := conn.Conn.Close()
if err != nil {
return
}
fmt.Println("关闭与娃娃机链接")
return return
} }
if bytes.Contains(part, instruction1) && num != 1 { if bytes.Contains(part, instruction1) && num != 1 {
@ -215,6 +231,13 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
Result: 1, Result: 1,
TypeId: 2, TypeId: 2,
}) })
//删除娃娃机链接
//delete(machinedoll.MachineMgr.ConnMap, conn.Id)
err := conn.Conn.Close()
if err != nil {
return
}
fmt.Println("关闭与娃娃机链接")
return return
} }
//上分成功 //上分成功
@ -265,51 +288,57 @@ func SMGameLinkSucceedHandler(session *netlib.Session, packetId int, data interf
return nil return nil
} }
/*// 获取进入视频房间token /*
func SMGetTokenHandler(session *netlib.Session, packetId int, data interface{}) error { // 获取进入视频房间token
logger.Logger.Tracef("SMGetTokenHandler %v", data)
msg, ok := data.(*machine.SMGetToken) func SMGetTokenHandler(session *netlib.Session, packetId int, data interface{}) error {
if !ok { logger.Logger.Tracef("SMGetTokenHandler %v", data)
msg, ok := data.(*machine.SMGetToken)
if !ok {
return nil
}
// 请将 appId 修改为你的 appIdappid 为数字,从即构控制台获取
// 举例1234567890
var appId uint32 = uint32(msg.GetAppId())
// 请修改为你的 serverSecretserverSecret 为字符串,从即构控制台获取
// 举例: "fa94dd0f974cf2e293728a526b028271"
serverSecret := msg.ServerSecret
// 请将 userId 修改为用户的 user_id
userId := msg.GetSnid()
// token 的有效时长,单位:秒
var effectiveTimeInSeconds int64 = 3600
// token业务认证扩展基础鉴权token此处填空字符串
var payload string = ""
//生成token
token, err := token04.GenerateToken04(appId, strconv.Itoa(int(userId)), serverSecret, effectiveTimeInSeconds, payload)
if err != nil {
logger.Logger.Error(err)
return err
}
logger.Logger.Trace(token)
info := &machine.MSSendToken{}
info.Snid = msg.Snid
info.Token = token
info.Appid = msg.AppId
info.StreamId = msg.StreamId
session.Send(int(machine.DollMachinePacketID_PACKET_MSSendToken), info)
fmt.Println("向游戏服务器发送娃娃机token%v", info)
return nil return nil
} }
// 请将 appId 修改为你的 appIdappid 为数字,从即构控制台获取 */
// 举例1234567890 func SMDollMachineHeartBeatHandler(session *netlib.Session, packetId int, data interface{}) error {
var appId uint32 = uint32(msg.GetAppId()) //fmt.Println("收到返回的心跳包")
// 请修改为你的 serverSecretserverSecret 为字符串,从即构控制台获取
// 举例: "fa94dd0f974cf2e293728a526b028271"
serverSecret := msg.ServerSecret
// 请将 userId 修改为用户的 user_id
userId := msg.GetSnid()
// token 的有效时长,单位:秒
var effectiveTimeInSeconds int64 = 3600
// token业务认证扩展基础鉴权token此处填空字符串
var payload string = ""
//生成token
token, err := token04.GenerateToken04(appId, strconv.Itoa(int(userId)), serverSecret, effectiveTimeInSeconds, payload)
if err != nil {
logger.Logger.Error(err)
return err
}
logger.Logger.Trace(token)
info := &machine.MSSendToken{}
info.Snid = msg.Snid
info.Token = token
info.Appid = msg.AppId
info.StreamId = msg.StreamId
session.Send(int(machine.DollMachinePacketID_PACKET_MSSendToken), info)
fmt.Println("向游戏服务器发送娃娃机token%v", info)
return nil return nil
}*/ }
func init() { func init() {
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMDollMachinePerate), &machine.SMDollMachineoPerate{}, SMDollMachinePerateHandler) netlib.Register(int(machine.DollMachinePacketID_PACKET_SMDollMachinePerate), &machine.SMDollMachineoPerate{}, SMDollMachinePerateHandler)
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMDollMachineGrab), &machine.SMDollMachineGrab{}, SMDollMachineGrabHandler) netlib.Register(int(machine.DollMachinePacketID_PACKET_SMDollMachineGrab), &machine.SMDollMachineGrab{}, SMDollMachineGrabHandler)
//链接成功 返回消息 //链接成功 返回消息
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMGameLinkSucceed), &machine.SMGameLinkSucceed{}, SMGameLinkSucceedHandler) netlib.Register(int(machine.DollMachinePacketID_PACKET_SMGameLinkSucceed), &machine.SMGameLinkSucceed{}, SMGameLinkSucceedHandler)
//netlib.Register(int(machine.DollMachinePacketID_PACKET_SMGetToken), &machine.SMGetToken{}, SMGetTokenHandler) netlib.Register(int(machine.DollMachinePacketID_Packet_SMDollMachineHeartBeat), &machine.SMDollMachineHeartBeat{}, SMDollMachineHeartBeatHandler)
} }

View File

@ -10,11 +10,9 @@ import (
"syscall" "syscall"
"time" "time"
"mongo.games.com/goserver/core/basic"
"mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/module" "mongo.games.com/goserver/core/module"
"mongo.games.com/goserver/core/netlib" "mongo.games.com/goserver/core/netlib"
"mongo.games.com/goserver/core/task"
"mongo.games.com/goserver/srvlib" "mongo.games.com/goserver/srvlib"
"mongo.games.com/game/protocol/machine" "mongo.games.com/game/protocol/machine"
@ -89,49 +87,93 @@ func (this *MachineManager) Init() {
} }
func (this *MachineManager) Update() { // 创建娃娃机链接
var delConn []*Conn func (this *MachineManager) CreateConn(key int) *Conn {
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { fmt.Println("新建与娃娃机链接")
for _, v := range this.ConnMap { var serverAddrs []string
_, err := v.Write([]byte("heartbeat")) programDir, err := os.Getwd()
if err != nil { if err != nil {
delConn = append(delConn, v) logger.Logger.Error("Error getting working directory:", err)
v.Close()
logger.Logger.Tracef("断开连接:%v", v.Addr)
this.UpdateToGameServer(v, 0)
}
}
return nil return nil
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { }
for _, v := range delConn { configFile := filepath.Join(programDir, "machineIPConfig.json")
delete(this.ConnMap, v.Id) logger.Logger.Trace("构建配置文件的路径", configFile)
this.DelConnMap[v.Id] = v.Addr fileData, err := os.ReadFile(configFile)
if err != nil {
logger.Logger.Error("Read robot account file error:", err)
return nil
} else {
if err = json.Unmarshal(fileData, &serverAddrs); err != nil {
logger.Logger.Error("Unmarshal robot account data error:", err)
return nil
} }
}
// 重连 //与娃娃机创建连接
var delIds []*Conn // 遍历每个服务器地址,建立连接
for i, addr := range serverAddrs {
if i+1 == key {
conn, err := net.DialTimeout("tcp", addr, 5*time.Second)
if err != nil {
logger.Logger.Error("Failed to connect to server:", err)
continue
}
this.ConnMap[i+1] = &Conn{
Id: i + 1,
Conn: conn,
Addr: addr,
}
return this.ConnMap[i+1]
}
}
return nil
}
func (this *MachineManager) Update() {
//向游戏服发送心跳包
pack := &machine.MSDollMachineHeartBeat{}
SendToGameServer(int(machine.DollMachinePacketID_Packet_MSDollMachineHeartBeat), pack)
/* var delConn []*Conn
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
for id, addr := range this.DelConnMap { for _, v := range this.ConnMap {
conn, err := net.DialTimeout("tcp", addr, 5*time.Second) _, err := v.Write([]byte("heartbeat"))
if err != nil { if err != nil {
continue delConn = append(delConn, v)
v.Close()
fmt.Println("断开连接:%v", v.Addr)
this.UpdateToGameServer(v, 0)
} }
logger.Logger.Tracef("娃娃机重连成功addr = %v", addr)
delIds = append(delIds, &Conn{
Id: id,
Conn: conn,
Addr: addr,
})
} }
return nil return nil
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { }), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
for _, v := range delIds { for _, v := range delConn {
this.ConnMap[v.Id] = v delete(this.ConnMap, v.Id)
delete(this.DelConnMap, v.Id) this.DelConnMap[v.Id] = v.Addr
this.UpdateToGameServer(v, 1)
} }
})).StartByFixExecutor(this.ModuleName())
})).StartByFixExecutor(this.ModuleName()) // 重连
var delIds []*Conn
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
for id, addr := range this.DelConnMap {
conn, err := net.DialTimeout("tcp", addr, 5*time.Second)
if err != nil {
continue
}
fmt.Println("娃娃机重连成功addr = %v", addr)
delIds = append(delIds, &Conn{
Id: id,
Conn: conn,
Addr: addr,
})
}
return nil
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
for _, v := range delIds {
this.ConnMap[v.Id] = v
delete(this.DelConnMap, v.Id)
this.UpdateToGameServer(v, 1)
}
})).StartByFixExecutor(this.ModuleName())
})).StartByFixExecutor(this.ModuleName())*/
} }
func (this *MachineManager) Shutdown() { func (this *MachineManager) Shutdown() {
@ -204,8 +246,6 @@ func listenKeyboardEvents(conn net.Conn) {
case "j": case "j":
Grab(conn) Grab(conn)
case "J": case "J":
SetPower(conn)
time.Sleep(200 * time.Millisecond)
Grab(conn) Grab(conn)
case "k": case "k":

View File

@ -25,7 +25,7 @@ type CustomLog struct {
TotalRound int32 // 总局数 TotalRound int32 // 总局数
PlayerNum int32 // 最大人数 PlayerNum int32 // 最大人数
Password string // 密码 Password string // 密码
CostType int32 // 付费方式 1房主 2AA CostType int32 // 付费方式 1AA 2房主
Voice int32 // 是否开启语音 1开启 Voice int32 // 是否开启语音 1开启
RoomId int32 // 房间id RoomId int32 // 房间id
SnId []PlayerInfo // 所有玩家 SnId []PlayerInfo // 所有玩家

View File

@ -47,6 +47,7 @@ const (
OpResultCode_OPRC_InviteFriend_PosIsError OpResultCode = 1019 //座位不存在 OpResultCode_OPRC_InviteFriend_PosIsError OpResultCode = 1019 //座位不存在
OpResultCode_OPRC_InviteFriend_HadInRoom OpResultCode = 1020 //已在房间中 OpResultCode_OPRC_InviteFriend_HadInRoom OpResultCode = 1020 //已在房间中
OpResultCode_OPRC_Friend_NotOpMyself OpResultCode = 1021 //不能操作自己 OpResultCode_OPRC_Friend_NotOpMyself OpResultCode = 1021 //不能操作自己
OpResultCode_OPRC_InviteFriend_CostNotEnough OpResultCode = 1022 // 房卡不足
) )
// Enum value maps for OpResultCode. // Enum value maps for OpResultCode.
@ -75,6 +76,7 @@ var (
1019: "OPRC_InviteFriend_PosIsError", 1019: "OPRC_InviteFriend_PosIsError",
1020: "OPRC_InviteFriend_HadInRoom", 1020: "OPRC_InviteFriend_HadInRoom",
1021: "OPRC_Friend_NotOpMyself", 1021: "OPRC_Friend_NotOpMyself",
1022: "OPRC_InviteFriend_CostNotEnough",
} }
OpResultCode_value = map[string]int32{ OpResultCode_value = map[string]int32{
"OPRC_Sucess": 0, "OPRC_Sucess": 0,
@ -100,6 +102,7 @@ var (
"OPRC_InviteFriend_PosIsError": 1019, "OPRC_InviteFriend_PosIsError": 1019,
"OPRC_InviteFriend_HadInRoom": 1020, "OPRC_InviteFriend_HadInRoom": 1020,
"OPRC_Friend_NotOpMyself": 1021, "OPRC_Friend_NotOpMyself": 1021,
"OPRC_InviteFriend_CostNotEnough": 1022,
} }
) )
@ -1726,7 +1729,7 @@ var file_friend_proto_rawDesc = []byte{
0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52,
0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e,
0x64, 0x2a, 0xf3, 0x05, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x2a, 0x99, 0x06, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f,
0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73,
0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f,
0x72, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x14, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x72, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x14, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x46, 0x72, 0x69, 0x65,
@ -1773,41 +1776,43 @@ var file_friend_proto_rawDesc = []byte{
0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x48, 0x61, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x48, 0x61, 0x64,
0x49, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x10, 0xfc, 0x07, 0x12, 0x1c, 0x0a, 0x17, 0x4f, 0x50, 0x52, 0x49, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x10, 0xfc, 0x07, 0x12, 0x1c, 0x0a, 0x17, 0x4f, 0x50, 0x52,
0x43, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x4e, 0x6f, 0x74, 0x4f, 0x70, 0x4d, 0x79, 0x43, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x4e, 0x6f, 0x74, 0x4f, 0x70, 0x4d, 0x79,
0x73, 0x65, 0x6c, 0x66, 0x10, 0xfd, 0x07, 0x2a, 0xe9, 0x03, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x73, 0x65, 0x6c, 0x66, 0x10, 0xfd, 0x07, 0x12, 0x24, 0x0a, 0x1f, 0x4f, 0x50, 0x52, 0x43, 0x5f,
0x6e, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x41, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x43, 0x6f, 0x73,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x74, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xfe, 0x07, 0x2a, 0xe9, 0x03,
0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x10, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e,
0x8c, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x64, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x18,
0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x10, 0x8d, 0x15, 0x12, 0x16, 0x0a, 0x11, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x46, 0x72, 0x69, 0x65, 0x6e,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x10, 0x8c, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b,
0x70, 0x10, 0x8e, 0x15, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x10,
0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10, 0x8f, 0x15, 0x12, 0x20, 0x0a, 0x1b, 0x8d, 0x15, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x46,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10, 0x8e, 0x15, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41,
0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x90, 0x15, 0x12, 0x20, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10,
0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x51, 0x75, 0x65, 0x72, 0x79, 0x8f, 0x15, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x51,
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x91, 0x15, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x6f,
0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x67, 0x10, 0x90, 0x15, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x92, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65,
0x4c, 0x6f, 0x67, 0x10, 0x91, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10,
0x92, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x49,
0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x93, 0x15, 0x12, 0x1c,
0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74,
0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10, 0x94, 0x15, 0x12, 0x1c, 0x0a, 0x17,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46,
0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x93, 0x15, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10, 0x95, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70,
0x64, 0x4f, 0x70, 0x10, 0x94, 0x15, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x6c, 0x79, 0x44, 0x61, 0x74, 0x61, 0x10, 0x96, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x72, 0x65,
0x70, 0x10, 0x95, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x10, 0x97, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x46, 0x75, 0x7a, 0x7a, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79,
0x10, 0x96, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x98, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x75, 0x7a, 0x7a, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79,
0x10, 0x97, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x99, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x46, 0x75, 0x7a, 0x7a, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64,
0x10, 0x98, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x9a, 0x15, 0x42, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e,
0x46, 0x75, 0x7a, 0x7a, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d,
0x10, 0x99, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x10, 0x9a, 0x15, 0x42, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d,
0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -27,6 +27,7 @@ enum OpResultCode {
OPRC_InviteFriend_PosIsError = 1019; // OPRC_InviteFriend_PosIsError = 1019; //
OPRC_InviteFriend_HadInRoom = 1020; // OPRC_InviteFriend_HadInRoom = 1020; //
OPRC_Friend_NotOpMyself = 1021; // OPRC_Friend_NotOpMyself = 1021; //
OPRC_InviteFriend_CostNotEnough = 1022; //
} }
//id //id

View File

@ -33,6 +33,8 @@ const (
DollMachinePacketID_PACKET_MSDollMachineoPerateResult DollMachinePacketID = 20005 DollMachinePacketID_PACKET_MSDollMachineoPerateResult DollMachinePacketID = 20005
DollMachinePacketID_PACKET_SMGetToken DollMachinePacketID = 20006 DollMachinePacketID_PACKET_SMGetToken DollMachinePacketID = 20006
DollMachinePacketID_PACKET_MSSendToken DollMachinePacketID = 20007 DollMachinePacketID_PACKET_MSSendToken DollMachinePacketID = 20007
DollMachinePacketID_Packet_MSDollMachineHeartBeat DollMachinePacketID = 20008
DollMachinePacketID_Packet_SMDollMachineHeartBeat DollMachinePacketID = 20009
) )
// Enum value maps for DollMachinePacketID. // Enum value maps for DollMachinePacketID.
@ -47,6 +49,8 @@ var (
20005: "PACKET_MSDollMachineoPerateResult", 20005: "PACKET_MSDollMachineoPerateResult",
20006: "PACKET_SMGetToken", 20006: "PACKET_SMGetToken",
20007: "PACKET_MSSendToken", 20007: "PACKET_MSSendToken",
20008: "Packet_MSDollMachineHeartBeat",
20009: "Packet_SMDollMachineHeartBeat",
} }
DollMachinePacketID_value = map[string]int32{ DollMachinePacketID_value = map[string]int32{
"PACKET_SMDollMachineZero": 0, "PACKET_SMDollMachineZero": 0,
@ -58,6 +62,8 @@ var (
"PACKET_MSDollMachineoPerateResult": 20005, "PACKET_MSDollMachineoPerateResult": 20005,
"PACKET_SMGetToken": 20006, "PACKET_SMGetToken": 20006,
"PACKET_MSSendToken": 20007, "PACKET_MSSendToken": 20007,
"Packet_MSDollMachineHeartBeat": 20008,
"Packet_SMDollMachineHeartBeat": 20009,
} }
) )
@ -496,6 +502,83 @@ func (x *MSUpdateDollMachineStatus) GetVideoAddr() string {
return "" return ""
} }
//心跳
type MSDollMachineHeartBeat struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *MSDollMachineHeartBeat) Reset() {
*x = MSDollMachineHeartBeat{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MSDollMachineHeartBeat) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MSDollMachineHeartBeat) ProtoMessage() {}
func (x *MSDollMachineHeartBeat) ProtoReflect() protoreflect.Message {
mi := &file_machine_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MSDollMachineHeartBeat.ProtoReflect.Descriptor instead.
func (*MSDollMachineHeartBeat) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{7}
}
type SMDollMachineHeartBeat struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *SMDollMachineHeartBeat) Reset() {
*x = SMDollMachineHeartBeat{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SMDollMachineHeartBeat) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SMDollMachineHeartBeat) ProtoMessage() {}
func (x *SMDollMachineHeartBeat) ProtoReflect() protoreflect.Message {
mi := &file_machine_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SMDollMachineHeartBeat.ProtoReflect.Descriptor instead.
func (*SMDollMachineHeartBeat) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{8}
}
var File_machine_proto protoreflect.FileDescriptor var File_machine_proto protoreflect.FileDescriptor
var file_machine_proto_rawDesc = []byte{ var file_machine_proto_rawDesc = []byte{
@ -533,29 +616,37 @@ var file_machine_proto_rawDesc = []byte{
0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41, 0x64, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41, 0x64,
0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41,
0x64, 0x64, 0x72, 0x2a, 0xb9, 0x02, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x64, 0x64, 0x72, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63,
0x69, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x68, 0x69, 0x6e, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x22, 0x18, 0x0a,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x16, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x48, 0x65,
0x69, 0x6e, 0x65, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x2a, 0x83, 0x03, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c,
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x75, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12,
0x63, 0x63, 0x65, 0x65, 0x64, 0x10, 0xa0, 0x9c, 0x01, 0x12, 0x20, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x1c, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c,
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1e, 0x0a,
0x65, 0x50, 0x65, 0x72, 0x61, 0x74, 0x65, 0x10, 0xa1, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x6e, 0x6b, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x10, 0xa0, 0x9c, 0x01, 0x12, 0x20, 0x0a,
0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x61, 0x74, 0x65, 0x10, 0xa1, 0x9c, 0x01, 0x12,
0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xa3, 0x9c, 0x01, 0x12, 0x26, 0x0a, 0x20, 0x50, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x10, 0xa2, 0x9c, 0x01, 0x12,
0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x10, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c,
0xa4, 0x9c, 0x01, 0x12, 0x27, 0x0a, 0x21, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xa3, 0x9c, 0x01, 0x12,
0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x6f, 0x50, 0x65, 0x72, 0x61, 0x26, 0x0a, 0x20, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0xa5, 0x9c, 0x01, 0x12, 0x17, 0x0a, 0x11, 0x74, 0x65, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x74, 0x75, 0x73, 0x10, 0xa4, 0x9c, 0x01, 0x12, 0x27, 0x0a, 0x21, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x6e, 0x10, 0xa6, 0x9c, 0x01, 0x12, 0x18, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x6f,
0x4d, 0x53, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x10, 0xa7, 0x9c, 0x01, 0x42, 0x50, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0xa5, 0x9c, 0x01,
0x27, 0x5a, 0x25, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x12, 0x17, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x65, 0x74,
0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x10, 0xa6, 0x9c, 0x01, 0x12, 0x18, 0x0a, 0x12, 0x50, 0x41, 0x43,
0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x10,
0xa7, 0x9c, 0x01, 0x12, 0x23, 0x0a, 0x1d, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x4d, 0x53,
0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74,
0x42, 0x65, 0x61, 0x74, 0x10, 0xa8, 0x9c, 0x01, 0x12, 0x23, 0x0a, 0x1d, 0x50, 0x61, 0x63, 0x6b,
0x65, 0x74, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x10, 0xa9, 0x9c, 0x01, 0x42, 0x27, 0x5a,
0x25, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d,
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -571,7 +662,7 @@ func file_machine_proto_rawDescGZIP() []byte {
} }
var file_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_machine_proto_goTypes = []interface{}{ var file_machine_proto_goTypes = []interface{}{
(DollMachinePacketID)(0), // 0: machine.DollMachinePacketID (DollMachinePacketID)(0), // 0: machine.DollMachinePacketID
(*SMGameLinkSucceed)(nil), // 1: machine.SMGameLinkSucceed (*SMGameLinkSucceed)(nil), // 1: machine.SMGameLinkSucceed
@ -581,6 +672,8 @@ var file_machine_proto_goTypes = []interface{}{
(*MSDollMachineList)(nil), // 5: machine.MSDollMachineList (*MSDollMachineList)(nil), // 5: machine.MSDollMachineList
(*DollMachine)(nil), // 6: machine.DollMachine (*DollMachine)(nil), // 6: machine.DollMachine
(*MSUpdateDollMachineStatus)(nil), // 7: machine.MSUpdateDollMachineStatus (*MSUpdateDollMachineStatus)(nil), // 7: machine.MSUpdateDollMachineStatus
(*MSDollMachineHeartBeat)(nil), // 8: machine.MSDollMachineHeartBeat
(*SMDollMachineHeartBeat)(nil), // 9: machine.SMDollMachineHeartBeat
} }
var file_machine_proto_depIdxs = []int32{ var file_machine_proto_depIdxs = []int32{
6, // 0: machine.MSDollMachineList.data:type_name -> machine.DollMachine 6, // 0: machine.MSDollMachineList.data:type_name -> machine.DollMachine
@ -681,6 +774,30 @@ func file_machine_proto_init() {
return nil return nil
} }
} }
file_machine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MSDollMachineHeartBeat); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_machine_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SMDollMachineHeartBeat); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -688,7 +805,7 @@ func file_machine_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_machine_proto_rawDesc, RawDescriptor: file_machine_proto_rawDesc,
NumEnums: 1, NumEnums: 1,
NumMessages: 7, NumMessages: 9,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -15,6 +15,8 @@ enum DollMachinePacketID {
PACKET_MSDollMachineoPerateResult = 20005; PACKET_MSDollMachineoPerateResult = 20005;
PACKET_SMGetToken = 20006; PACKET_SMGetToken = 20006;
PACKET_MSSendToken = 20007; PACKET_MSSendToken = 20007;
Packet_MSDollMachineHeartBeat = 20008;
Packet_SMDollMachineHeartBeat = 20009;
} }
// //
//PACKET_SMDollMachinePerate //PACKET_SMDollMachinePerate
@ -58,4 +60,11 @@ message MSUpdateDollMachineStatus{
int32 Id = 1; int32 Id = 1;
int32 Status = 2; //1- 0-使 int32 Status = 2; //1- 0-使
string VideoAddr = 3; string VideoAddr = 3;
} }
//
message MSDollMachineHeartBeat{
}
message SMDollMachineHeartBeat{
}

View File

@ -910,7 +910,7 @@ type CustomParam struct {
RoomTypeId int32 `protobuf:"varint,1,opt,name=RoomTypeId,proto3" json:"RoomTypeId,omitempty"` // 房间类型id RoomTypeId int32 `protobuf:"varint,1,opt,name=RoomTypeId,proto3" json:"RoomTypeId,omitempty"` // 房间类型id
RoomConfigId int32 `protobuf:"varint,2,opt,name=RoomConfigId,proto3" json:"RoomConfigId,omitempty"` // 房间配置id RoomConfigId int32 `protobuf:"varint,2,opt,name=RoomConfigId,proto3" json:"RoomConfigId,omitempty"` // 房间配置id
CostType int32 `protobuf:"varint,3,opt,name=CostType,proto3" json:"CostType,omitempty"` // 房卡场付费方式 1房主 2AA CostType int32 `protobuf:"varint,3,opt,name=CostType,proto3" json:"CostType,omitempty"` // 房卡场付费方式 1AA 2房主
Password string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"` // 房间密码 Password string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"` // 房间密码
Voice int32 `protobuf:"varint,5,opt,name=Voice,proto3" json:"Voice,omitempty"` // 是否开启语音 1开启 2关闭 Voice int32 `protobuf:"varint,5,opt,name=Voice,proto3" json:"Voice,omitempty"` // 是否开启语音 1开启 2关闭
} }

View File

@ -170,7 +170,7 @@ message Item {
message CustomParam { message CustomParam {
int32 RoomTypeId = 1; // id int32 RoomTypeId = 1; // id
int32 RoomConfigId = 2; // id int32 RoomConfigId = 2; // id
int32 CostType = 3; // 1 2AA int32 CostType = 3; // 1AA 2
string Password = 4; // string Password = 4; //
int32 Voice = 5; // 1 2 int32 Voice = 5; // 1 2
} }

View File

@ -501,6 +501,17 @@ func (this *CSInviteFriendOpHandler) Process(s *netlib.Session, packetid int, da
} }
} }
// 房费是否充足
if scene.IsCustom() {
cfg := PlatformMgrSingleton.GetConfig(p.Platform).RoomConfig[scene.RoomConfigId]
if scene.CostType == 1 && !scene.sp.CostEnough(int(scene.CostType), scene.playerNum, cfg, p) {
logger.Logger.Trace("CSInviteFriendHandler cost error")
opRetCode = friend.OpResultCode_OPRC_InviteFriend_CostNotEnough
send(p)
return nil
}
}
sp := GetScenePolicy(scene.gameId, scene.gameMode) sp := GetScenePolicy(scene.gameId, scene.gameMode)
if sp == nil { if sp == nil {
logger.Logger.Warn("CSInviteFriendHandler game not exist") logger.Logger.Warn("CSInviteFriendHandler game not exist")

View File

@ -103,6 +103,15 @@ func (this *CSEnterRoomHandler) Process(s *netlib.Session, packetid int, data in
logger.Logger.Trace("CSEnterRoomHandler password error") logger.Logger.Trace("CSEnterRoomHandler password error")
goto failed goto failed
} }
// 房费是否充足
if scene.IsCustom() {
cfg := PlatformMgrSingleton.GetConfig(p.Platform).RoomConfig[scene.RoomConfigId]
if scene.CostType == 1 && !scene.sp.CostEnough(int(scene.CostType), scene.playerNum, cfg, p) {
code = gamehall.OpResultCode_Game_OPRC_CostNotEnough
logger.Logger.Trace("CSEnterRoomHandler cost error")
goto failed
}
}
dbGameFree = scene.dbGameFree dbGameFree = scene.dbGameFree
if dbGameFree != nil { if dbGameFree != nil {
@ -1335,7 +1344,7 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{
return nil return nil
} }
if cfg.GetCostType() == 2 { if costType == 2 {
sp.CostPayment(scene, p) sp.CostPayment(scene, p)
} }

View File

@ -1799,7 +1799,12 @@ func (this *Player) CanDelete() bool {
} }
func (this *Player) Time2Save() { func (this *Player) Time2Save() {
this.Save(false) logger.Logger.Tracef("player save %v", this.SnId)
if common.Config.IsDevMode {
this.Save(true)
} else {
this.Save(false)
}
if this != nil && this.CanDelete() { if this != nil && this.CanDelete() {
PlayerMgrSington.DelPlayer(this.SnId) PlayerMgrSington.DelPlayer(this.SnId)
} }

View File

@ -32,7 +32,7 @@ func (spd *ScenePolicyData) OnStart(s *Scene) {
func (spd *ScenePolicyData) OnStop(s *Scene) { func (spd *ScenePolicyData) OnStop(s *Scene) {
s.NotifyPrivateRoom(common.ListDel) s.NotifyPrivateRoom(common.ListDel)
// 房主付费,房间没有玩就解散了,返还房主建房费用 // 房主付费,房间没有玩就解散了,返还房主建房费用
if s.IsCustom() && s.GetCostType() == 1 && s.currRound == 0 { if s.IsCustom() && s.GetCostType() == 2 && s.currRound == 0 {
spd.GiveCostPayment(s, s.creator) spd.GiveCostPayment(s, s.creator)
} }
} }
@ -142,7 +142,7 @@ func (spd *ScenePolicyData) CostPayment(s *Scene, p *Player) bool {
if roomConfig == nil { if roomConfig == nil {
return false return false
} }
return spd.costEnough(int(roomConfig.GetCostType()), s.playerNum, roomConfig, p.SnId, func(items []*model.Item) { return spd.costEnough(int(s.GetCostType()), s.playerNum, roomConfig, p.SnId, func(items []*model.Item) {
for _, v := range items { for _, v := range items {
v.ItemNum = -v.ItemNum v.ItemNum = -v.ItemNum
} }
@ -166,7 +166,7 @@ func (spd *ScenePolicyData) GiveCostPayment(s *Scene, snid int32) bool {
return false return false
} }
if roomConfig.GetCostType() != 1 { // 只有房主付费才有返还 if s.GetCostType() != 2 { // 只有房主付费才有返还
return false return false
} }

View File

@ -1276,27 +1276,14 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
amount[ShopParamDiamond] = bbd.Grade amount[ShopParamDiamond] = bbd.Grade
} }
var itemInfo []model.ItemInfo dbShop = this.NewDbShop(p, 0, amount[:], ShopConsumeMoney, int32(bbd.Price2), common.GainWay_ActBlindBox, nil, 0, "", 0, remark, []int32{bbd.Id})
var webItemInfo []*webapi_proto.ItemInfo
for _, info := range shopInfo.GetItems() {
itemInfo = append(itemInfo, model.ItemInfo{
ItemId: info.ItemId,
ItemNum: info.ItemNum,
})
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
ItemId: info.ItemId,
ItemNum: info.ItemNum,
})
}
dbShop = this.NewDbShop(p, 0, amount[:], ShopConsumeMoney, int32(bbd.Price2), common.GainWay_ActBlindBox, itemInfo, 0, "", 0, remark, []int32{bbd.Id})
err := model.InsertDbShopLog(dbShop) err := model.InsertDbShopLog(dbShop)
if err != nil { if err != nil {
logger.Logger.Errorf("model.InsertDbShopLog err:", err) logger.Logger.Errorf("model.InsertDbShopLog err:", err)
return nil return nil
} }
return webapi.API_CreateOrder(common.GetAppId(), dbShop.LogId.Hex(), ConfigPayId, p.SnId, 0, p.Platform, p.PackageID, p.DeviceOS, return webapi.API_CreateOrder(common.GetAppId(), dbShop.LogId.Hex(), ConfigPayId, p.SnId, 0, p.Platform, p.PackageID, p.DeviceOS,
p.DeviceId, bbd.Name, amount, int32(bbd.Price2), webItemInfo, "", p.Channel, p.ChannelId) p.DeviceId, bbd.Name, amount, int32(bbd.Price2), nil, "", p.Channel, p.ChannelId)
} else if wfs, ok := data.(*webapi_proto.WelfareSpree); ok { } else if wfs, ok := data.(*webapi_proto.WelfareSpree); ok {
var items []model.ItemInfo var items []model.ItemInfo
var webItemInfo []*webapi_proto.ItemInfo var webItemInfo []*webapi_proto.ItemInfo