Merge remote-tracking branch 'origin/develop' into dev_slots
This commit is contained in:
commit
4ba65f9e87
|
@ -176,27 +176,24 @@ func IsDaZhong(gameId int) bool {
|
|||
|
||||
// 房间编号区间
|
||||
const (
|
||||
PrivateSceneStartId = 100000
|
||||
PrivateSceneMaxId = 999999
|
||||
MatchSceneStartId = 100000000
|
||||
MatchSceneMaxId = 199999999
|
||||
HundredSceneStartId = 200000000
|
||||
HundredSceneMaxId = 299999999
|
||||
HallSceneStartId = 300000000
|
||||
HallSceneMaxId = 399999999
|
||||
MiniGameSceneStartId = 400000000
|
||||
MiniGameSceneMaxId = 409999999
|
||||
CoinSceneStartId = 1000000000 //区间预留大点,因为队列匹配比较耗id,假定一天100w牌局,那么这个id区间够用1000天
|
||||
CoinSceneMaxId = 1999999999
|
||||
DgSceneId = 99
|
||||
PrivateSceneStartId = 100000
|
||||
PrivateSceneMaxId = 999999
|
||||
MatchSceneStartId = 100000000
|
||||
MatchSceneMaxId = 199999999
|
||||
HundredSceneStartId = 200000000
|
||||
HundredSceneMaxId = 299999999
|
||||
CoinSceneStartId = 1000000000
|
||||
CoinSceneMaxId = 1999999999
|
||||
DgSceneId = 99
|
||||
)
|
||||
|
||||
// 房间模式
|
||||
const (
|
||||
SceneMode_Public = 0 //公共房间
|
||||
SceneMode_Private = 2 //私人房间
|
||||
SceneMode_Match = 3 //赛事房间
|
||||
SceneMode_Thr = 4 //三方房间
|
||||
SceneModePublic = 0 // 公共房间
|
||||
SceneModePrivate = 2 // 私人房间
|
||||
SceneModeMatch = 3 // 赛事房间
|
||||
SceneModeThr = 4 // 三方房间
|
||||
SceneModePrivateMatch = 5 // 竞技馆房间
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -359,30 +356,6 @@ const (
|
|||
PlayerLeaveReason_AutoState //托管状态踢出房间
|
||||
)
|
||||
|
||||
// 万分比
|
||||
const RATE_BASE_VALUE int32 = 10000
|
||||
|
||||
const (
|
||||
SceneState_Normal int = iota
|
||||
SceneState_Fishing //鱼潮
|
||||
)
|
||||
|
||||
const (
|
||||
PlayerType_Rob int32 = 0
|
||||
PlayerType_Undefine = 1
|
||||
PlayerType_Black = -1
|
||||
PlayerType_White = -2
|
||||
)
|
||||
|
||||
const (
|
||||
CoinPoolAIModel_Default int32 = iota //默认
|
||||
CoinPoolAIModel_Normal //正常模式
|
||||
CoinPoolAIModel_ShouFen //收分模式
|
||||
CoinPoolAIModel_ZheZhong //折中模式
|
||||
CoinPoolAIModel_TuFen //吐分
|
||||
CoinPoolAIModel_Max //
|
||||
)
|
||||
|
||||
const (
|
||||
RobotServerType int = 9
|
||||
RobotServerId = 901
|
||||
|
@ -465,12 +438,6 @@ const (
|
|||
MatchTrueMan_Priority = 1 //优先匹配真人
|
||||
)
|
||||
|
||||
const (
|
||||
SingleAdjustModeNormal = 0
|
||||
SingleAdjustModeWin = 1
|
||||
SingleAdjustModeLose = 2
|
||||
)
|
||||
|
||||
// 自动化标签(程序里产生的全部<0)
|
||||
const (
|
||||
AutomaticTag_QZNN_Smart int32 = -1
|
||||
|
@ -515,35 +482,6 @@ const (
|
|||
CodeTypeNo = 3 // 不使用验证码
|
||||
)
|
||||
|
||||
const (
|
||||
ActId_Share int = iota //0.微信分享
|
||||
ActId_OnlineReward //1.在线奖励
|
||||
ActId_UpgradeAccount //2.升级账号
|
||||
ActId_GoldTask //3.财神任务
|
||||
ActId_GoldCome //4.财神降临
|
||||
ActId_LuckyTurntable //5.转盘活动
|
||||
ActId_Yeb //6.余额宝
|
||||
ActId_Card //7.周卡月卡
|
||||
ActId_RebateTask //8.返利获取
|
||||
ActId_IOSINSTALLSTABLE //9.ios安装奖励
|
||||
ActId_VipLevelBonus //10.vip日周月等级奖励
|
||||
ActId_LoginRandCoin //11.登录红包
|
||||
ActId_OnlineRandCoin //12.红包雨
|
||||
ActId_MatchSwitch //13.比赛开关
|
||||
ActId_PromoterBind //14.手动绑定推广员
|
||||
ActId_Lottery //15.彩金池
|
||||
ActId_Task //16.活跃任务
|
||||
ActId_PROMOTER //17.全民推广
|
||||
ActId_Activity //18.活动界面
|
||||
ActId_NewYear //19.新年暗号红包活动
|
||||
ActId_Guess //20.猜灯谜活动
|
||||
ActId_Sign //21.七日签到
|
||||
ExchangeId_Alipay //22.兑换到支付宝
|
||||
ExchangeId_Bank //23.兑换到银行卡
|
||||
ExchangeId_Wechat //24.兑换到微信
|
||||
ActId_Max
|
||||
)
|
||||
|
||||
// 匹配模式
|
||||
const (
|
||||
MatchMode_Normal int32 = iota //普通匹配
|
||||
|
|
|
@ -291,6 +291,13 @@ func CSDestroyRoom(s *netlib.Session, packetid int, data interface{}, sid int64)
|
|||
send()
|
||||
return nil
|
||||
}
|
||||
if scene.ExtraData != nil {
|
||||
gs, ok := scene.ExtraData.(base.GameScene)
|
||||
if ok {
|
||||
gs.SceneDestroy(true)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
scene.Destroy(true)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -894,8 +894,13 @@ func (this *Scene) Destroy(force bool) {
|
|||
logger.Logger.Trace("(this *Scene) Destroy(force bool) isCompleted", isCompleted)
|
||||
}
|
||||
|
||||
// IsSceneMode 房间模式
|
||||
func (this *Scene) IsSceneMode(mode int) bool {
|
||||
return this.SceneMode == int32(mode)
|
||||
}
|
||||
|
||||
func (this *Scene) IsPrivateScene() bool {
|
||||
return this.SceneId >= common.PrivateSceneStartId && this.SceneId <= common.PrivateSceneMaxId || this.SceneMode == common.SceneMode_Private
|
||||
return this.IsSceneMode(common.SceneModePrivate) || this.IsSceneMode(common.SceneModePrivateMatch)
|
||||
}
|
||||
|
||||
// IsFreePublic 自由桌
|
||||
|
@ -910,10 +915,13 @@ func (this *Scene) IsRankMatch() bool {
|
|||
|
||||
// IsMatchScene 比赛场
|
||||
func (this *Scene) IsMatchScene() bool {
|
||||
return this.SceneId >= common.MatchSceneStartId && this.SceneId <= common.MatchSceneMaxId
|
||||
return this.IsSceneMode(common.SceneModeMatch)
|
||||
}
|
||||
|
||||
func (this *Scene) IsCustom() bool {
|
||||
if this.IsSceneMode(common.SceneModePrivateMatch) {
|
||||
return true
|
||||
}
|
||||
return this.GetDBGameFree().GetIsCustom() > 0
|
||||
}
|
||||
|
||||
|
@ -921,12 +929,7 @@ func (this *Scene) IsFull() bool {
|
|||
return len(this.Players) >= this.GetPlayerNum()
|
||||
}
|
||||
|
||||
// 大厅场
|
||||
func (this *Scene) IsHallScene() bool {
|
||||
return this.SceneId >= common.HallSceneStartId && this.SceneId <= common.HallSceneMaxId
|
||||
}
|
||||
|
||||
// 金豆自由场
|
||||
// 对战场
|
||||
func (this *Scene) IsCoinScene() bool {
|
||||
return this.SceneId >= common.CoinSceneStartId && this.SceneId <= common.CoinSceneMaxId
|
||||
}
|
||||
|
@ -1547,7 +1550,7 @@ func GetSaveGamePlayerListLogParam(platform, channel, promoter, packageTag, logi
|
|||
}
|
||||
|
||||
func (this *Scene) SaveFriendRecord(snid int32, isWin int32, billCoin int64, baseScore int32) {
|
||||
if this.SceneMode == common.SceneMode_Private {
|
||||
if this.SceneMode == common.SceneModePrivate {
|
||||
return
|
||||
}
|
||||
log := model.NewFriendRecordLogEx(this.Platform, snid, isWin, this.GameId, baseScore, billCoin, int64(this.GetMatch().GetMatchType()))
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"mongo.games.com/game/protocol/machine"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type CSPlayerOpPacketFactory struct {
|
||||
|
@ -75,9 +76,21 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
|
|||
case 1:
|
||||
if msg.Result == 1 {
|
||||
logger.Logger.Tracef("上分成功!!!!!!!!!!!!snid = ", msg.Snid)
|
||||
//发送向前移动指令
|
||||
sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonFront)
|
||||
|
||||
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
||||
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart))
|
||||
|
||||
ClawdollBroadcastRoomState(s)
|
||||
ClawdollSendPlayerInfo(s)
|
||||
|
||||
ClawdollBroadcastPlayingInfo(s)
|
||||
|
||||
} else {
|
||||
logger.Logger.Tracef("上分失败!!!!!!!!!!!!snid = ", msg.Snid)
|
||||
}
|
||||
|
||||
case 2:
|
||||
if msg.Result == 1 {
|
||||
// 获得娃娃卡
|
||||
|
@ -133,15 +146,15 @@ func (h *CSGetTokenHandler) Process(s *netlib.Session, packetid int, data interf
|
|||
return nil
|
||||
}
|
||||
|
||||
logger.Logger.Tracef("获取娃娃机 appId = %v, serverSecret = %v, streamId = %v", machineInfo.AppId, machineInfo.ServerSecret, machineInfo.StreamId)
|
||||
logger.Logger.Tracef("获取娃娃机 appId = %v, serverSecret = %v, streamId = %v,snid = %d", machineInfo.AppId, machineInfo.ServerSecret, machineInfo.StreamId, p.SnId)
|
||||
|
||||
//生成token
|
||||
token, err := token04.GenerateToken04(uint32(machineInfo.AppId), string(p.SnId), machineInfo.ServerSecret, 7200, "")
|
||||
token, err := token04.GenerateToken04(uint32(machineInfo.AppId), strconv.Itoa(int(p.SnId)), machineInfo.ServerSecret, 3600, "")
|
||||
if err != nil {
|
||||
logger.Logger.Error(err)
|
||||
return err
|
||||
}
|
||||
logger.Logger.Trace(token)
|
||||
logger.Logger.Trace("======================token========================", token)
|
||||
|
||||
pack := &clawdoll.SCCLAWDOLLSendToken{
|
||||
LogicId: scene.DBGameFree.GetId(),
|
||||
|
@ -154,33 +167,6 @@ func (h *CSGetTokenHandler) Process(s *netlib.Session, packetid int, data interf
|
|||
return nil
|
||||
}
|
||||
|
||||
// 娃娃机返回token 通知客户端
|
||||
func MSSendTokenHandler(session *netlib.Session, packetId int, data interface{}) error {
|
||||
logger.Logger.Tracef("MSSendTokenHandler")
|
||||
if msg, ok := data.(*machine.MSSendToken); ok {
|
||||
//给客户端返回token
|
||||
token := msg.Token
|
||||
p := base.PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
|
||||
if p == nil {
|
||||
logger.Logger.Warn("MSSendTokenHandler p == nil")
|
||||
return nil
|
||||
}
|
||||
|
||||
scene := p.GetScene()
|
||||
if scene == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
pack := &clawdoll.SCCLAWDOLLSendToken{
|
||||
LogicId: scene.DBGameFree.GetId(),
|
||||
Appid: msg.Appid,
|
||||
Token: token,
|
||||
StreamId: msg.StreamId,
|
||||
}
|
||||
p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_SENDTOKEN), pack)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func init() {
|
||||
common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_PLAYEROP), &CSPlayerOpHandler{})
|
||||
netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_PLAYEROP), &CSPlayerOpPacketFactory{})
|
||||
|
@ -188,6 +174,4 @@ func init() {
|
|||
//客户端请求token
|
||||
common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_GETTOKEN), &CSGetTokenHandler{})
|
||||
netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_GETTOKEN), &CSGetTokenPacketFactory{})
|
||||
//获取token返回
|
||||
netlib.Register(int(machine.DollMachinePacketID_PACKET_MSSendToken), &machine.MSSendToken{}, MSSendTokenHandler)
|
||||
}
|
||||
|
|
|
@ -41,11 +41,21 @@ func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool {
|
|||
func (this *PlayerEx) CanPayCoin() bool {
|
||||
|
||||
itemID := int32(rule.ClawDoorItemID)
|
||||
itemCount := this.GetItemCount(itemID)
|
||||
if itemCount < 1 {
|
||||
return true
|
||||
}
|
||||
|
||||
itemData := srvdata.GameItemMgr.Get(this.Platform, itemID)
|
||||
if itemData == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
num, ok := this.Items[itemID]
|
||||
if !ok || num < 1 {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -58,12 +68,26 @@ func (this *PlayerEx) CostPlayCoin(count int32) bool {
|
|||
// 能否移动
|
||||
func (this *PlayerEx) CanMove() bool {
|
||||
|
||||
s := this.GetScene()
|
||||
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||
if !sceneEx.Gaming {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// 能否下抓
|
||||
func (this *PlayerEx) CanGrab() bool {
|
||||
|
||||
s := this.GetScene()
|
||||
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||
if !sceneEx.Gaming {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"github.com/zegoim/zego_server_assistant/token/go/src/token04"
|
||||
"mongo.games.com/game/gamesrv/action"
|
||||
"mongo.games.com/game/protocol/clawdoll"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core"
|
||||
|
@ -287,15 +288,14 @@ func (this *PolicyClawdoll) SendGetVideoToken(s *base.Scene, p *base.Player, sce
|
|||
return
|
||||
}
|
||||
|
||||
logger.Logger.Tracef("获取娃娃机 appId = %v, serverSecret = %v, streamId = %v", machineinfo.AppId, machineinfo.ServerSecret, machineinfo.StreamId)
|
||||
|
||||
//生成token
|
||||
token, err := token04.GenerateToken04(uint32(machineinfo.AppId), string(p.SnId), machineinfo.ServerSecret, 3600, "")
|
||||
token, err := token04.GenerateToken04(uint32(machineinfo.AppId), strconv.Itoa(int(p.SnId)), machineinfo.ServerSecret, 3600, "")
|
||||
if err != nil {
|
||||
logger.Logger.Error(err)
|
||||
return
|
||||
}
|
||||
logger.Logger.Trace(token)
|
||||
|
||||
logger.Logger.Tracef("获取娃娃机 appId = %v, serverSecret = %v, streamId = %v, token = %v", machineinfo.AppId, machineinfo.ServerSecret, machineinfo.StreamId, token)
|
||||
|
||||
pack := &clawdoll.SCCLAWDOLLSendToken{
|
||||
LogicId: s.DBGameFree.GetId(),
|
||||
|
@ -531,13 +531,6 @@ func (this *StateWait) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, par
|
|||
|
||||
if sceneEx.CanStart() {
|
||||
sceneEx.playingSnid = playerEx.SnId
|
||||
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
||||
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart))
|
||||
|
||||
ClawdollBroadcastRoomState(s)
|
||||
ClawdollSendPlayerInfo(s)
|
||||
|
||||
ClawdollBroadcastPlayingInfo(s)
|
||||
|
||||
sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
|
||||
}
|
||||
|
@ -677,6 +670,8 @@ func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, para
|
|||
//1-弱力抓 2 -强力抓
|
||||
sceneEx.OnPlayerSMGrabOp(p.SnId, int32(sceneEx.machineId), grapType)
|
||||
|
||||
sceneEx.Gaming = false
|
||||
|
||||
case rule.ClawDollPlayerOpMove:
|
||||
|
||||
if !sceneEx.CheckMoveOp(playerEx) {
|
||||
|
@ -704,6 +699,7 @@ func (this *PlayGame) OnTick(s *base.Scene) {
|
|||
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollScenePlayTimeout {
|
||||
|
||||
if sceneEx.TimeOutPlayGrab() {
|
||||
sceneEx.Gaming = false
|
||||
logger.Logger.Trace("PlayGame OnTick TimeOutPlayGrab SnId", sceneEx.playingSnid, " machineId:", sceneEx.machineId)
|
||||
}
|
||||
|
||||
|
@ -883,6 +879,26 @@ 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("SCSmallRocketRoundGameBilled is pack: ", pack)
|
||||
proto.SetDefaults(pack)
|
||||
|
||||
playerEx.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_GAMEBILLED), pack)
|
||||
}
|
||||
}
|
||||
|
||||
func (this *StateWaitPayCoin) OnLeave(s *base.Scene) {
|
||||
|
|
|
@ -287,6 +287,9 @@ func (this *TienLenSceneData) OnPlayerLeave(p *base.Player, reason int) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if !this.GetDestroyed() && this.IsCustom() && len(this.players) == 0 {
|
||||
this.SceneDestroy(true)
|
||||
}
|
||||
}
|
||||
|
||||
func (this *TienLenSceneData) SceneDestroy(force bool) {
|
||||
|
@ -2105,7 +2108,7 @@ func (this *TienLenSceneData) SendFirstGiveTimeItem(p *base.Player) {
|
|||
|
||||
// SaveCustomLog 保存竞技馆对局记录
|
||||
func (this *TienLenSceneData) SaveCustomLog() {
|
||||
if this.CustomLogSave || !this.IsCustom() {
|
||||
if this.CustomLogSave || !this.IsCustom() || this.NumOfGames == 0 {
|
||||
return
|
||||
}
|
||||
this.CustomLogSave = true
|
||||
|
@ -2117,15 +2120,16 @@ func (this *TienLenSceneData) SaveCustomLog() {
|
|||
Platform: this.Platform,
|
||||
CycleId: this.CycleID,
|
||||
RoomConfigId: this.GetCustom().GetRoomConfigId(),
|
||||
GameFreeId: this.GetGameFreeId(),
|
||||
TotalRound: this.TotalOfGames,
|
||||
PlayerNum: this.PlayerNum,
|
||||
Password: this.GetCustom().GetPassword(),
|
||||
CostType: this.GetCustom().GetCostType(),
|
||||
Voice: this.GetCustom().GetVoice(),
|
||||
RoomId: this.SceneId,
|
||||
StartTs: this.GameStartTime.Unix(),
|
||||
EndTs: time.Now().Unix(),
|
||||
State: state,
|
||||
GameFreeId: this.GetGameFreeId(),
|
||||
TotalRound: this.TotalOfGames,
|
||||
Password: this.GetCustom().GetPassword(),
|
||||
CostType: this.GetCustom().GetCostType(),
|
||||
Voice: this.GetCustom().GetVoice(),
|
||||
}
|
||||
for snid := range this.BilledList {
|
||||
var items []*model.Item
|
||||
|
|
|
@ -148,9 +148,6 @@ func (this *ScenePolicyTienLen) OnPlayerLeave(s *base.Scene, p *base.Player, rea
|
|||
}
|
||||
sceneEx.OnPlayerLeave(p, reason)
|
||||
s.FirePlayerEvent(p, base.PlayerEventLeave, []int64{int64(reason)})
|
||||
if s.IsCustom() && len(s.Players) == 0 {
|
||||
s.Destroy(true)
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家掉线
|
||||
|
@ -899,7 +896,7 @@ func (this *SceneWaitStartStateTienLen) OnTick(s *base.Scene) {
|
|||
return
|
||||
}
|
||||
}
|
||||
if sceneEx.SceneMode == common.SceneMode_Public {
|
||||
if sceneEx.SceneMode == common.SceneModePublic {
|
||||
if time.Now().Sub(sceneEx.StateStartTime) > rule.TienLenWaitStartTimeout {
|
||||
if sceneEx.Creator != 0 && sceneEx.GetRealPlayerNum() == 0 {
|
||||
sceneEx.Destroy(true)
|
||||
|
|
|
@ -3,14 +3,12 @@ package action
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/zegoim/zego_server_assistant/token/go/src/token04"
|
||||
"math"
|
||||
"mongo.games.com/game/machine/machinedoll"
|
||||
"mongo.games.com/game/protocol/machine"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/core/timer"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
@ -71,7 +69,7 @@ func processConnMessageQueue(queue *ConnMessageQueue) {
|
|||
|
||||
// 移动
|
||||
func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data interface{}) error {
|
||||
logger.Logger.Tracef("SMDollMachinePerateHandler %v", data)
|
||||
fmt.Println("SMDollMachinePerateHandler %v", data)
|
||||
msg, ok := data.(*machine.SMDollMachineoPerate)
|
||||
if !ok {
|
||||
return nil
|
||||
|
@ -121,13 +119,7 @@ func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data inte
|
|||
Process(conn, f1, f2)
|
||||
case 5:
|
||||
//投币
|
||||
f1 := []func(){
|
||||
func() { machinedoll.Coin(conn) },
|
||||
}
|
||||
f2 := []func(){
|
||||
func() {},
|
||||
}
|
||||
Process(conn, f1, f2)
|
||||
machinedoll.Coin(conn)
|
||||
go DollMachineGrabResult(session, conn, msg.Snid, msg.GetId())
|
||||
}
|
||||
return nil
|
||||
|
@ -269,7 +261,7 @@ func SMGameLinkSucceedHandler(session *netlib.Session, packetId int, data interf
|
|||
return nil
|
||||
}
|
||||
|
||||
// 获取进入视频房间token
|
||||
/*// 获取进入视频房间token
|
||||
func SMGetTokenHandler(session *netlib.Session, packetId int, data interface{}) error {
|
||||
logger.Logger.Tracef("SMGetTokenHandler %v", data)
|
||||
msg, ok := data.(*machine.SMGetToken)
|
||||
|
@ -308,12 +300,12 @@ func SMGetTokenHandler(session *netlib.Session, packetId int, data interface{})
|
|||
session.Send(int(machine.DollMachinePacketID_PACKET_MSSendToken), info)
|
||||
fmt.Println("向游戏服务器发送娃娃机token:%v", info)
|
||||
return nil
|
||||
}
|
||||
}*/
|
||||
|
||||
func init() {
|
||||
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_SMGameLinkSucceed), &machine.SMGameLinkSucceed{}, SMGameLinkSucceedHandler)
|
||||
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMGetToken), &machine.SMGetToken{}, SMGetTokenHandler)
|
||||
//netlib.Register(int(machine.DollMachinePacketID_PACKET_SMGetToken), &machine.SMGetToken{}, SMGetTokenHandler)
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ var data = []byte{
|
|||
0x65, //0 几币几玩
|
||||
0x00, //1 几币几玩占用位
|
||||
0x2D, //2 游戏时间
|
||||
0x00, //3 出奖模式0 无概率 1 随机模式 2 固定模式 3 冠兴模式
|
||||
0x01, //3 出奖模式0 无概率 1 随机模式 2 固定模式 3 冠兴模式
|
||||
0x0F, //4 出奖概率
|
||||
0x00, //5 出奖概率占用位
|
||||
0x00, //6 空中抓物 0关闭 1开启
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
"mongo.games.com/game/protocol/server"
|
||||
"time"
|
||||
|
||||
"github.com/globalsign/mgo"
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
)
|
||||
|
@ -125,17 +124,3 @@ func ManageCoinPoolSetting(dbSetting *CoinPoolSetting) {
|
|||
}
|
||||
CoinPoolSettingDatas[key] = dbSetting
|
||||
}
|
||||
|
||||
// 删除水池历史调控记录
|
||||
func RemoveCoinPoolSettingHis(ts time.Time) (*mgo.ChangeInfo, error) {
|
||||
if rpcCli == nil {
|
||||
return nil, ErrRPClientNoConn
|
||||
}
|
||||
var ret mgo.ChangeInfo
|
||||
err := rpcCli.CallWithTimeout("CoinPoolSettingSvc.RemoveCoinPoolSettingHis", ts, &ret, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Warn("RemoveCoinPoolSettingHis error:", err)
|
||||
return &ret, err
|
||||
}
|
||||
return &ret, err
|
||||
}
|
||||
|
|
|
@ -885,7 +885,6 @@ type SCCLAWDOLLSendToken struct {
|
|||
Appid int64 `protobuf:"varint,2,opt,name=Appid,proto3" json:"Appid,omitempty"`
|
||||
Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"`
|
||||
StreamId string `protobuf:"bytes,4,opt,name=StreamId,proto3" json:"StreamId,omitempty"`
|
||||
AppSign string `protobuf:"bytes,5,opt,name=AppSign,proto3" json:"AppSign,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SCCLAWDOLLSendToken) Reset() {
|
||||
|
@ -948,13 +947,6 @@ func (x *SCCLAWDOLLSendToken) GetStreamId() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (x *SCCLAWDOLLSendToken) GetAppSign() string {
|
||||
if x != nil {
|
||||
return x.AppSign
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CLAWDOLLWaitPlayers struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
@ -1169,64 +1161,62 @@ var file_clawdoll_proto_rawDesc = []byte{
|
|||
0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x22, 0x14, 0x0a,
|
||||
0x12, 0x43, 0x53, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x47, 0x65, 0x74, 0x54, 0x6f,
|
||||
0x6b, 0x65, 0x6e, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x53, 0x43, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f,
|
||||
0x4c, 0x4c, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x4c,
|
||||
0x6f, 0x67, 0x69, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x63, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x54,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x6b, 0x65,
|
||||
0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x41, 0x70, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x41, 0x70, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x22, 0x63, 0x0a, 0x13, 0x43, 0x4c, 0x41, 0x57, 0x44,
|
||||
0x4f, 0x4c, 0x4c, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x4c,
|
||||
0x0a, 0x0f, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x64, 0x6f,
|
||||
0x6c, 0x6c, 0x2e, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x6c, 0x61, 0x79, 0x65,
|
||||
0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x57, 0x61, 0x69,
|
||||
0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x84, 0x01, 0x0a,
|
||||
0x18, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44,
|
||||
0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x48, 0x65, 0x61,
|
||||
0x64, 0x12, 0x18, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x07, 0x48, 0x65, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x4e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x53, 0x74, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53,
|
||||
0x74, 0x61, 0x74, 0x2a, 0xfd, 0x02, 0x0a, 0x10, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c,
|
||||
0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10,
|
||||
0xe1, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f,
|
||||
0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe2, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f,
|
||||
0x50, 0x10, 0xe3, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
||||
0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xe4, 0x2b, 0x12, 0x19,
|
||||
0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x47, 0x41, 0x4d, 0x45,
|
||||
0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xe5, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x74,
|
||||
0x65, 0x72, 0x10, 0xe6, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x10, 0xe7,
|
||||
0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50,
|
||||
0x4c, 0x41, 0x59, 0x45, 0x52, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe8, 0x2b, 0x12, 0x17, 0x0a, 0x12,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x47, 0x45, 0x54, 0x54, 0x4f, 0x4b,
|
||||
0x45, 0x4e, 0x10, 0xe9, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x53, 0x43, 0x5f, 0x53, 0x45, 0x4e, 0x44, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0xea, 0x2b, 0x12,
|
||||
0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x57, 0x41, 0x49,
|
||||
0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0xeb, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x50, 0x4c, 0x41,
|
||||
0x59, 0x45, 0x52, 0x53, 0x10, 0xec, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x49, 0x4e, 0x47, 0x49, 0x4e, 0x46, 0x4f,
|
||||
0x10, 0xed, 0x2b, 0x2a, 0x64, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43,
|
||||
0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x63,
|
||||
0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72,
|
||||
0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x43, 0x6f,
|
||||
0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x02, 0x12, 0x1a, 0x0a,
|
||||
0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x50, 0x6f, 0x73, 0x41, 0x6c, 0x52, 0x65, 0x61, 0x64, 0x79,
|
||||
0x50, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x10, 0x03, 0x42, 0x28, 0x5a, 0x26, 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, 0x63, 0x6c, 0x61, 0x77, 0x64,
|
||||
0x6f, 0x6c, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6b, 0x65, 0x6e, 0x22, 0x77, 0x0a, 0x13, 0x53, 0x43, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c,
|
||||
0x4c, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4c, 0x6f, 0x67,
|
||||
0x69, 0x63, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f,
|
||||
0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x63, 0x0a, 0x13,
|
||||
0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79,
|
||||
0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x0f, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65,
|
||||
0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63,
|
||||
0x6c, 0x61, 0x77, 0x64, 0x6f, 0x6c, 0x6c, 0x2e, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c,
|
||||
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f,
|
||||
0x52, 0x0f, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x22, 0x84, 0x01, 0x0a, 0x18, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x6c,
|
||||
0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e,
|
||||
0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x55, 0x72,
|
||||
0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x48, 0x65, 0x61, 0x64, 0x55, 0x72, 0x6c,
|
||||
0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
||||
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x74, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x04, 0x53, 0x74, 0x61, 0x74, 0x2a, 0xfd, 0x02, 0x0a, 0x10, 0x43, 0x4c, 0x41,
|
||||
0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x0f, 0x0a,
|
||||
0x0b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x17,
|
||||
0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d,
|
||||
0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe1, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x43, 0x53, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe2, 0x2b,
|
||||
0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c,
|
||||
0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe3, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45,
|
||||
0x10, 0xe4, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||
0x5f, 0x47, 0x41, 0x4d, 0x45, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xe5, 0x2b, 0x12, 0x1a,
|
||||
0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79,
|
||||
0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10, 0xe6, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65,
|
||||
0x61, 0x76, 0x65, 0x10, 0xe7, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe8,
|
||||
0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x47,
|
||||
0x45, 0x54, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0xe9, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x45, 0x4e, 0x44, 0x54, 0x4f, 0x4b, 0x45,
|
||||
0x4e, 0x10, 0xea, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43,
|
||||
0x53, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0xeb, 0x2b,
|
||||
0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x57, 0x41,
|
||||
0x49, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0xec, 0x2b, 0x12, 0x1a, 0x0a, 0x15,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x49, 0x4e,
|
||||
0x47, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xed, 0x2b, 0x2a, 0x64, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65,
|
||||
0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43,
|
||||
0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50,
|
||||
0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50,
|
||||
0x52, 0x43, 0x5f, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68,
|
||||
0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x50, 0x6f, 0x73, 0x41, 0x6c,
|
||||
0x52, 0x65, 0x61, 0x64, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x10, 0x03, 0x42, 0x28,
|
||||
0x5a, 0x26, 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,
|
||||
0x63, 0x6c, 0x61, 0x77, 0x64, 0x6f, 0x6c, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -118,7 +118,6 @@ message SCCLAWDOLLSendToken {
|
|||
int64 Appid = 2;
|
||||
string Token = 3;
|
||||
string StreamId = 4;
|
||||
string AppSign = 5;
|
||||
}
|
||||
|
||||
message CLAWDOLLWaitPlayers {
|
||||
|
|
|
@ -496,150 +496,6 @@ func (x *MSUpdateDollMachineStatus) GetVideoAddr() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
//获取token
|
||||
type SMGetToken struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||
AppId int64 `protobuf:"varint,2,opt,name=AppId,proto3" json:"AppId,omitempty"`
|
||||
ServerSecret string `protobuf:"bytes,3,opt,name=ServerSecret,proto3" json:"ServerSecret,omitempty"`
|
||||
StreamId string `protobuf:"bytes,4,opt,name=StreamId,proto3" json:"StreamId,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SMGetToken) Reset() {
|
||||
*x = SMGetToken{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_machine_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SMGetToken) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SMGetToken) ProtoMessage() {}
|
||||
|
||||
func (x *SMGetToken) 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 SMGetToken.ProtoReflect.Descriptor instead.
|
||||
func (*SMGetToken) Descriptor() ([]byte, []int) {
|
||||
return file_machine_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *SMGetToken) GetSnid() int32 {
|
||||
if x != nil {
|
||||
return x.Snid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SMGetToken) GetAppId() int64 {
|
||||
if x != nil {
|
||||
return x.AppId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SMGetToken) GetServerSecret() string {
|
||||
if x != nil {
|
||||
return x.ServerSecret
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SMGetToken) GetStreamId() string {
|
||||
if x != nil {
|
||||
return x.StreamId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
//返回token
|
||||
type MSSendToken struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||
Appid int64 `protobuf:"varint,2,opt,name=Appid,proto3" json:"Appid,omitempty"`
|
||||
Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"`
|
||||
StreamId string `protobuf:"bytes,4,opt,name=StreamId,proto3" json:"StreamId,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MSSendToken) Reset() {
|
||||
*x = MSSendToken{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_machine_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MSSendToken) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MSSendToken) ProtoMessage() {}
|
||||
|
||||
func (x *MSSendToken) 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 MSSendToken.ProtoReflect.Descriptor instead.
|
||||
func (*MSSendToken) Descriptor() ([]byte, []int) {
|
||||
return file_machine_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *MSSendToken) GetSnid() int32 {
|
||||
if x != nil {
|
||||
return x.Snid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MSSendToken) GetAppid() int64 {
|
||||
if x != nil {
|
||||
return x.Appid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MSSendToken) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MSSendToken) GetStreamId() string {
|
||||
if x != nil {
|
||||
return x.StreamId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_machine_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_machine_proto_rawDesc = []byte{
|
||||
|
@ -677,44 +533,29 @@ var file_machine_proto_rawDesc = []byte{
|
|||
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,
|
||||
0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41,
|
||||
0x64, 0x64, 0x72, 0x22, 0x76, 0x0a, 0x0a, 0x53, 0x4d, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65,
|
||||
0x6e, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x53,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12,
|
||||
0x1a, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x0b, 0x4d,
|
||||
0x53, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e,
|
||||
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x41,
|
||||
0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x74,
|
||||
0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x74,
|
||||
0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x2a, 0xb9, 0x02, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c,
|
||||
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x18,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e,
|
||||
0x6b, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x10, 0xa0, 0x9c, 0x01, 0x12, 0x20, 0x0a, 0x1a,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63,
|
||||
0x68, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x61, 0x74, 0x65, 0x10, 0xa1, 0x9c, 0x01, 0x12, 0x1e,
|
||||
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1e,
|
||||
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xa3, 0x9c, 0x01, 0x12, 0x26,
|
||||
0x0a, 0x20, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74,
|
||||
0x65, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x10, 0xa4, 0x9c, 0x01, 0x12, 0x27, 0x0a, 0x21, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x6f, 0x50,
|
||||
0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0xa5, 0x9c, 0x01, 0x12,
|
||||
0x17, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x65, 0x74, 0x54,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x10, 0xa6, 0x9c, 0x01, 0x12, 0x18, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x4d, 0x53, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x10, 0xa7,
|
||||
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,
|
||||
0x64, 0x64, 0x72, 0x2a, 0xb9, 0x02, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
|
||||
0x69, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
|
||||
0x69, 0x6e, 0x65, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x75,
|
||||
0x63, 0x63, 0x65, 0x65, 0x64, 0x10, 0xa0, 0x9c, 0x01, 0x12, 0x20, 0x0a, 0x1a, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
|
||||
0x65, 0x50, 0x65, 0x72, 0x61, 0x74, 0x65, 0x10, 0xa1, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
|
||||
0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
|
||||
0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xa3, 0x9c, 0x01, 0x12, 0x26, 0x0a, 0x20, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f,
|
||||
0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x10,
|
||||
0xa4, 0x9c, 0x01, 0x12, 0x27, 0x0a, 0x21, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53,
|
||||
0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x6f, 0x50, 0x65, 0x72, 0x61,
|
||||
0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0xa5, 0x9c, 0x01, 0x12, 0x17, 0x0a, 0x11,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65,
|
||||
0x6e, 0x10, 0xa6, 0x9c, 0x01, 0x12, 0x18, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x4d, 0x53, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x10, 0xa7, 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 (
|
||||
|
@ -730,7 +571,7 @@ func file_machine_proto_rawDescGZIP() []byte {
|
|||
}
|
||||
|
||||
var file_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_machine_proto_goTypes = []interface{}{
|
||||
(DollMachinePacketID)(0), // 0: machine.DollMachinePacketID
|
||||
(*SMGameLinkSucceed)(nil), // 1: machine.SMGameLinkSucceed
|
||||
|
@ -740,8 +581,6 @@ var file_machine_proto_goTypes = []interface{}{
|
|||
(*MSDollMachineList)(nil), // 5: machine.MSDollMachineList
|
||||
(*DollMachine)(nil), // 6: machine.DollMachine
|
||||
(*MSUpdateDollMachineStatus)(nil), // 7: machine.MSUpdateDollMachineStatus
|
||||
(*SMGetToken)(nil), // 8: machine.SMGetToken
|
||||
(*MSSendToken)(nil), // 9: machine.MSSendToken
|
||||
}
|
||||
var file_machine_proto_depIdxs = []int32{
|
||||
6, // 0: machine.MSDollMachineList.data:type_name -> machine.DollMachine
|
||||
|
@ -842,30 +681,6 @@ func file_machine_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_machine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SMGetToken); 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.(*MSSendToken); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
@ -873,7 +688,7 @@ func file_machine_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_machine_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 9,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
|
|
@ -58,18 +58,4 @@ message MSUpdateDollMachineStatus{
|
|||
int32 Id = 1;
|
||||
int32 Status = 2; //1-空闲 0-无法使用
|
||||
string VideoAddr = 3;
|
||||
}
|
||||
//获取token
|
||||
message SMGetToken{
|
||||
int32 Snid = 1;
|
||||
int64 AppId = 2;
|
||||
string ServerSecret = 3;
|
||||
string StreamId = 4;
|
||||
}
|
||||
//返回token
|
||||
message MSSendToken{
|
||||
int32 Snid = 1;
|
||||
int64 Appid = 2;
|
||||
string Token = 3;
|
||||
string StreamId = 4;
|
||||
}
|
|
@ -104,14 +104,6 @@ func (this *FishingScene) IsFull() bool {
|
|||
return len(this.players) >= int(fishing.MaxPlayer)
|
||||
}
|
||||
|
||||
func (this *FishingScene) IsMatchScene() bool {
|
||||
return this.GetRoomId() >= common.MatchSceneStartId && this.GetRoomId() <= common.MatchSceneMaxId
|
||||
}
|
||||
|
||||
func (this *FishingScene) IsCoinScene() bool {
|
||||
return this.GetRoomId() >= common.CoinSceneStartId && this.GetRoomId() <= common.CoinSceneMaxId
|
||||
}
|
||||
|
||||
func (this *FishingScene) InitPlayer(s *netlib.Session, p *FishingPlayer) {
|
||||
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ func (s *ThirteenWaterScene) IsFull() bool {
|
|||
}
|
||||
|
||||
func (s *ThirteenWaterScene) IsMatchScene() bool {
|
||||
return s.GetRoomId() >= common.MatchSceneStartId
|
||||
return s.RoomMode == common.SceneModeMatch
|
||||
}
|
||||
|
||||
func (s *ThirteenWaterScene) Update(ts int64) {
|
||||
|
|
|
@ -354,7 +354,7 @@ func (this *CSInviteFriendHandler) Process(s *netlib.Session, packetid int, data
|
|||
return nil
|
||||
}
|
||||
//私有房间
|
||||
if p.scene.sceneMode != common.SceneMode_Private {
|
||||
if p.scene.sceneMode != common.SceneModePrivate {
|
||||
logger.Logger.Warn("CSInviteFriendHandler scene is common.SceneMode_Private")
|
||||
opRetCode = friend.OpResultCode_OPRC_InviteFriend_RoomLimit
|
||||
send(p)
|
||||
|
@ -461,7 +461,7 @@ func (this *CSInviteFriendOpHandler) Process(s *netlib.Session, packetid int, da
|
|||
return nil
|
||||
}
|
||||
//私有房间
|
||||
if scene.sceneMode != common.SceneMode_Private {
|
||||
if scene.sceneMode != common.SceneModePrivate {
|
||||
logger.Logger.Warn("CSInviteFriendHandler scene is common.SceneMode_Private")
|
||||
opRetCode = friend.OpResultCode_OPRC_InviteFriend_RoomLimit //只能进入私有房间
|
||||
send(p)
|
||||
|
|
|
@ -314,7 +314,7 @@ func (this *CSQueryRoomInfoHandler) ProcessLocalGame(s *netlib.Session, packetid
|
|||
if scene.gameId == int(gameid) && scene.dbGameFree.GetSceneType() == msg.GetGameSite() {
|
||||
|
||||
// 私人房需要是好友
|
||||
if scene.sceneMode == common.SceneMode_Private {
|
||||
if scene.sceneMode == common.SceneModePrivate {
|
||||
if !FriendMgrSington.IsFriend(p.Platform, p.SnId, scene.creator) {
|
||||
continue
|
||||
}
|
||||
|
@ -872,7 +872,7 @@ func (this *CSCreateRoomHandler) ProcessLocalGame(s *netlib.Session, packetid in
|
|||
|
||||
//创建房间
|
||||
csp = CoinSceneMgrSingleton.GetCoinScenePool(p.GetPlatform().IdStr, dbGameFree.GetId())
|
||||
roomId = SceneMgrSingleton.GenOnePrivateSceneId()
|
||||
roomId = SceneMgrSingleton.GenOneCoinSceneId()
|
||||
if roomId == common.RANDID_INVALID {
|
||||
code = gamehall.OpResultCode_Game_OPRC_AllocRoomIdFailed_Game
|
||||
logger.Logger.Tracef("CSCreateRoomHandler SnId:%v GameId:%v sceneId == -1 ", p.SnId, gameId)
|
||||
|
@ -1141,8 +1141,6 @@ func CSAudienceEnterRoomHandler(s *netlib.Session, packetId int, data interface{
|
|||
code = gamehall.OpResultCode_Game(CoinSceneMgrSingleton.AudienceEnter(p, cfg.GetDbGameFree().GetId(), msg.GetRoomId(), nil, true))
|
||||
case scene.IsHundredScene():
|
||||
|
||||
case scene.IsMatchScene():
|
||||
code = gamehall.OpResultCode_Game(MatchSceneMgrSingleton.AudienceEnter(p, cfg.GetDbGameFree().GetId(), int(msg.GetRoomId()), nil, true))
|
||||
}
|
||||
|
||||
failed:
|
||||
|
@ -1306,7 +1304,7 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{
|
|||
scene := SceneMgrSingleton.CreateScene(&CreateSceneParam{
|
||||
CreateId: p.SnId,
|
||||
RoomId: roomId,
|
||||
SceneMode: common.SceneMode_Private,
|
||||
SceneMode: common.SceneModePrivateMatch,
|
||||
CycleTimes: 0,
|
||||
TotalRound: int(msg.GetRound()),
|
||||
Params: common.CopySliceInt32ToInt64(csp.dbGameRule.GetParams()),
|
||||
|
@ -1341,8 +1339,8 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{
|
|||
sp.CostPayment(scene, p)
|
||||
}
|
||||
|
||||
code = gamehall.OpResultCode_Game_OPRC_Sucess_Game
|
||||
pack = &gamehall.SCCreatePrivateRoom{
|
||||
OpRetCode: gamehall.OpResultCode_Game_OPRC_Sucess_Game,
|
||||
GameFreeId: msg.GetGameFreeId(),
|
||||
RoomTypeId: msg.GetRoomTypeId(),
|
||||
RoomConfigId: msg.GetRoomConfigId(),
|
||||
|
|
|
@ -49,24 +49,13 @@ func init() {
|
|||
logger.Logger.Trace("GWPlayerLeave p.UnmarshalData(data)")
|
||||
p.UnmarshalData(data, scene)
|
||||
}
|
||||
|
||||
switch {
|
||||
case scene.IsCoinScene():
|
||||
if !CoinSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
|
||||
logger.Logger.Warnf("GWPlayerLeave snid:%v sceneid:%v gameid:%v modeid:%v [coinscene]",
|
||||
p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
|
||||
}
|
||||
case scene.IsMatchScene():
|
||||
if !MatchSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
|
||||
logger.Logger.Warnf("GWPlayerLeave snid:%v sceneid:%v gameid:%v modeid:%v matchid:%v [matchscene]",
|
||||
p.SnId, scene.sceneId, scene.gameId, scene.gameMode, scene.MatchSortId)
|
||||
} else {
|
||||
//结算积分
|
||||
if !p.IsRob {
|
||||
TournamentMgr.UpdateMatchInfo(p, msg.MatchId, int32(msg.GetReturnCoin()), int32(msg.GetCurIsWin()), msg.GetMatchRobotGrades())
|
||||
} else {
|
||||
p.matchCtx = nil
|
||||
}
|
||||
}
|
||||
case scene.IsHundredScene():
|
||||
if !HundredSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
|
||||
logger.Logger.Warnf("GWPlayerLeave snid:%v sceneid:%v gameid:%v modeid:%v [hundredcene]",
|
||||
|
@ -77,7 +66,17 @@ func init() {
|
|||
}
|
||||
|
||||
if p.scene != nil {
|
||||
logger.Logger.Warnf("after GWPlayerLeave found snid:%v sceneid:%v gameid:%v modeid:%v", p.SnId, p.scene.sceneId, p.scene.gameId, p.scene.gameMode)
|
||||
logger.Logger.Errorf("after GWPlayerLeave found snid:%v sceneid:%v gameid:%v modeid:%v",
|
||||
p.SnId, p.scene.sceneId, p.scene.gameId, p.scene.gameMode)
|
||||
}
|
||||
|
||||
if scene.IsMatchScene() {
|
||||
//结算积分
|
||||
if !p.IsRob {
|
||||
TournamentMgr.UpdateMatchInfo(p, msg.MatchId, int32(msg.GetReturnCoin()), int32(msg.GetCurIsWin()), msg.GetMatchRobotGrades())
|
||||
} else {
|
||||
p.matchCtx = nil
|
||||
}
|
||||
}
|
||||
|
||||
// 同步排位积分
|
||||
|
@ -363,11 +362,6 @@ func init() {
|
|||
if !HundredSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
|
||||
logger.Logger.Warnf("GWPlayerForceLeave snid:%v sceneid:%v gameid:%v modeid:%v [hundredcene]", p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
|
||||
}
|
||||
case scene.IsMatchScene():
|
||||
if !MatchSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
|
||||
logger.Logger.Warnf("GWPlayerLeave snid:%v sceneid:%v gameid:%v modeid:%v matchid:%v [matchscene]",
|
||||
p.SnId, scene.sceneId, scene.gameId, scene.gameMode, scene.MatchSortId)
|
||||
}
|
||||
default:
|
||||
scene.PlayerLeave(p, int(msg.GetReason()))
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ func (csp *CoinScenePool) PreCreateRoom() {
|
|||
if preCreateNum <= 0 {
|
||||
return
|
||||
}
|
||||
num := preCreateNum - csp.GetRoomNum(common.SceneMode_Public)
|
||||
num := preCreateNum - csp.GetRoomNum(common.SceneModePublic)
|
||||
if num > 0 {
|
||||
logger.Logger.Tracef("预创建房间 [inc:%v] platform:%v gameFreeId:%v", num, csp.platform, csp.dbGameFree.Id)
|
||||
for i := 0; i < num; i++ {
|
||||
|
|
|
@ -218,7 +218,7 @@ func (this *BaseCoinScenePool) NewScene(pool *CoinScenePool, p *Player) *Scene {
|
|||
sceneId := SceneMgrSingleton.GenOneCoinSceneId()
|
||||
scene := SceneMgrSingleton.CreateScene(&CreateSceneParam{
|
||||
RoomId: sceneId,
|
||||
SceneMode: common.SceneMode_Public,
|
||||
SceneMode: common.SceneModePublic,
|
||||
Params: params,
|
||||
GS: nil,
|
||||
Platform: limitPlatform,
|
||||
|
|
|
@ -225,7 +225,7 @@ func (l *CoinScenePoolLocal) NewScene(pool *CoinScenePool, p *Player) *Scene {
|
|||
scene := SceneMgrSingleton.CreateScene(&CreateSceneParam{
|
||||
CreateId: p.SnId,
|
||||
RoomId: sceneId,
|
||||
SceneMode: common.SceneMode_Public,
|
||||
SceneMode: common.SceneModePublic,
|
||||
Params: common.CopySliceInt32ToInt64(params),
|
||||
GS: nil,
|
||||
Platform: limitPlatform,
|
||||
|
@ -276,7 +276,7 @@ func (l *CoinScenePoolLocal) NewPreCreateScene(pool *CoinScenePool) *Scene {
|
|||
if baseScore != 0 {
|
||||
scene = SceneMgrSingleton.CreateScene(&CreateSceneParam{
|
||||
RoomId: sceneId,
|
||||
SceneMode: common.SceneMode_Public,
|
||||
SceneMode: common.SceneModePublic,
|
||||
Params: common.CopySliceInt32ToInt64(params),
|
||||
Platform: limitPlatform,
|
||||
GF: pool.dbGameFree,
|
||||
|
|
|
@ -174,8 +174,8 @@ func (this *GameSession) AddScene(args *AddSceneParam) {
|
|||
Match: args.S.MatchParam,
|
||||
Params: args.S.params,
|
||||
}
|
||||
if args.S.GetRoomTypeId() != 0 {
|
||||
cfg := PlatformMgrSingleton.GetConfig(args.S.limitPlatform.IdStr).RoomConfig[args.S.GetRoomTypeId()]
|
||||
if args.S.GetRoomConfigId() != 0 {
|
||||
cfg := PlatformMgrSingleton.GetConfig(args.S.limitPlatform.IdStr).RoomConfig[args.S.GetRoomConfigId()]
|
||||
if cfg != nil {
|
||||
for _, v := range cfg.GetReward() {
|
||||
msg.Items = append(msg.Items, &server_proto.Item{
|
||||
|
@ -200,6 +200,11 @@ func (this *GameSession) AddScene(args *AddSceneParam) {
|
|||
}
|
||||
this.Send(int(server_proto.SSPacketID_PACKET_WG_CREATESCENE), msg)
|
||||
logger.Logger.Tracef("WGCreateScene: %v", msg)
|
||||
|
||||
// 初始化水池
|
||||
if args.S.limitPlatform != nil && args.S.dbGameFree != nil {
|
||||
this.DetectCoinPoolSetting(args.S.limitPlatform.IdStr, args.S.dbGameFree.GetId(), args.S.groupId)
|
||||
}
|
||||
}
|
||||
|
||||
func (this *GameSession) DelScene(s *Scene) {
|
||||
|
|
|
@ -205,7 +205,7 @@ func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Pl
|
|||
params := common.CopySliceInt32ToInt64(dbGameRule.GetParams())
|
||||
scene := SceneMgrSingleton.CreateScene(&CreateSceneParam{
|
||||
RoomId: sceneId,
|
||||
SceneMode: common.SceneMode_Public,
|
||||
SceneMode: common.SceneModePublic,
|
||||
Params: params,
|
||||
Platform: limitPlatform,
|
||||
GF: dbGameFree,
|
||||
|
|
|
@ -5,7 +5,6 @@ import "sort"
|
|||
type PlayerMatchContext struct {
|
||||
tm *TmMatch //比赛
|
||||
p *Player //玩家数据
|
||||
scene *Scene //比赛房间
|
||||
round int32 //第几轮
|
||||
seq int //报名序号
|
||||
grade int32 //比赛积分
|
||||
|
|
|
@ -6,18 +6,13 @@ import (
|
|||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/proto"
|
||||
hallproto "mongo.games.com/game/protocol/gamehall"
|
||||
"mongo.games.com/game/protocol/server"
|
||||
)
|
||||
|
||||
var MatchSceneMgrSingleton = &MatchSceneMgr{
|
||||
scenes: make(map[int]*Scene),
|
||||
}
|
||||
var MatchSceneMgrSingleton = &MatchSceneMgr{}
|
||||
|
||||
// MatchSceneMgr 比赛场房间管理器
|
||||
type MatchSceneMgr struct {
|
||||
scenes map[int]*Scene // 比赛场房间,房间id:房间数据
|
||||
}
|
||||
type MatchSceneMgr struct{}
|
||||
|
||||
// NewScene 创建比赛场房间
|
||||
// tm 一场比赛,数据
|
||||
|
@ -50,7 +45,7 @@ func (ms *MatchSceneMgr) NewScene(tm *TmMatch, isFinals bool, round int32) *Scen
|
|||
rule := srvdata.PBDB_GameRuleMgr.GetData(tm.dbGameFree.GetGameRule())
|
||||
scene := SceneMgrSingleton.CreateScene(&CreateSceneParam{
|
||||
RoomId: sceneId,
|
||||
SceneMode: common.SceneMode_Match,
|
||||
SceneMode: common.SceneModeMatch,
|
||||
Params: common.CopySliceInt32ToInt64(rule.GetParams()),
|
||||
Platform: limitPlatform,
|
||||
GF: tm.dbGameFree,
|
||||
|
@ -73,16 +68,22 @@ func (ms *MatchSceneMgr) NewScene(tm *TmMatch, isFinals bool, round int32) *Scen
|
|||
// MatchStart 开始首轮比赛
|
||||
func (ms *MatchSceneMgr) MatchStart(tm *TmMatch) {
|
||||
var scene *Scene
|
||||
csp := CoinSceneMgrSingleton.GetCoinScenePool(tm.Platform, tm.dbGameFree.GetId())
|
||||
if csp == nil {
|
||||
logger.Logger.Errorf("MatchStart: csp is nil, TMID=%v", tm.TMId)
|
||||
return
|
||||
}
|
||||
for _, tmp := range tm.TmPlayer { //先进真人
|
||||
if scene == nil || scene.IsFull() {
|
||||
scene = ms.NewScene(tm, false, 1)
|
||||
if scene != nil {
|
||||
ms.scenes[scene.sceneId] = scene
|
||||
if scene == nil {
|
||||
logger.Logger.Errorf("MatchStart NewScene failed, TMID=%v", tm.TMId)
|
||||
return
|
||||
}
|
||||
csp.AddScene(scene)
|
||||
}
|
||||
|
||||
p := PlayerMgrSington.GetPlayerBySnId(tmp.SnId)
|
||||
|
||||
if p == nil {
|
||||
continue
|
||||
}
|
||||
|
@ -95,7 +96,10 @@ func (ms *MatchSceneMgr) MatchStart(tm *TmMatch) {
|
|||
mc := TournamentMgr.CreatePlayerMatchContext(p, tm, tmp.seq)
|
||||
if mc != nil {
|
||||
mc.gaming = true
|
||||
scene.PlayerEnter(p, -1, true)
|
||||
if !scene.PlayerEnter(p, -1, true) {
|
||||
logger.Logger.Errorf("MatchStart error: snid:%v enter scene %v failed", p.SnId, scene.sceneId)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
// 填充机器人
|
||||
|
@ -116,20 +120,28 @@ func (ms *MatchSceneMgr) MatchStart(tm *TmMatch) {
|
|||
// NewRoundStart 开始非首轮比赛
|
||||
func (ms *MatchSceneMgr) NewRoundStart(tm *TmMatch, mct []*PlayerMatchContext, finals bool, round int32) {
|
||||
var scene *Scene
|
||||
csp := CoinSceneMgrSingleton.GetCoinScenePool(tm.Platform, tm.dbGameFree.GetId())
|
||||
if csp == nil {
|
||||
logger.Logger.Errorf("NewRoundStart: csp is nil, TMID=%v", tm.TMId)
|
||||
return
|
||||
}
|
||||
for _, tmp := range mct {
|
||||
if scene == nil || scene.IsFull() {
|
||||
scene = ms.NewScene(tm, finals, round)
|
||||
if scene != nil {
|
||||
ms.scenes[scene.sceneId] = scene
|
||||
if scene == nil {
|
||||
logger.Logger.Errorf("NewRoundStart NewScene failed, TMID=%v", tm.TMId)
|
||||
return
|
||||
}
|
||||
csp.AddScene(scene)
|
||||
}
|
||||
|
||||
p := tmp.p
|
||||
if p == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if p.scene != nil {
|
||||
logger.Logger.Errorf("NewRoundStart error: snid:%v in scene %v", p.SnId, p.scene.sceneId)
|
||||
logger.Logger.Errorf("NewRoundStart error: snid:%v in scene %v gameId:%v", p.SnId, p.scene.sceneId, p.scene.gameId)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -137,7 +149,10 @@ func (ms *MatchSceneMgr) NewRoundStart(tm *TmMatch, mct []*PlayerMatchContext, f
|
|||
mc.gaming = true
|
||||
mc.grade = mc.grade * 75 / 100 //积分衰减
|
||||
mc.rank = tmp.rank
|
||||
scene.PlayerEnter(p, -1, true)
|
||||
if !scene.PlayerEnter(p, -1, true) {
|
||||
logger.Logger.Errorf("NewRoundStart error: snid:%v enter scene %v failed", p.SnId, scene.sceneId)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
// 填充机器人
|
||||
|
@ -156,36 +171,7 @@ func (ms *MatchSceneMgr) NewRoundStart(tm *TmMatch, mct []*PlayerMatchContext, f
|
|||
}
|
||||
}
|
||||
|
||||
func (ms *MatchSceneMgr) PlayerLeave(p *Player, reason int) bool {
|
||||
if p == nil || p.scene == nil {
|
||||
return true
|
||||
}
|
||||
if p.scene.MatchSortId == 0 {
|
||||
return true
|
||||
}
|
||||
p.scene.PlayerLeave(p, reason)
|
||||
return true
|
||||
}
|
||||
|
||||
func (ms *MatchSceneMgr) OnDestroyScene(sceneId int) {
|
||||
_, has := ms.scenes[sceneId]
|
||||
if !has {
|
||||
return
|
||||
}
|
||||
delete(ms.scenes, sceneId)
|
||||
}
|
||||
|
||||
func (ms *MatchSceneMgr) AudienceEnter(p *Player, id int32, roomId int, exclude []int32, ischangeroom bool) hallproto.OpResultCode {
|
||||
scene, ok := ms.scenes[roomId]
|
||||
if !ok {
|
||||
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||
}
|
||||
if !scene.AudienceEnter(p, ischangeroom) {
|
||||
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||
}
|
||||
return hallproto.OpResultCode_OPRC_Sucess
|
||||
}
|
||||
|
||||
// MatchStop 强制停止比赛
|
||||
func (ms *MatchSceneMgr) MatchStop(tm *TmMatch) {
|
||||
if SceneMgrSingleton.scenes != nil && tm != nil {
|
||||
for _, scene := range SceneMgrSingleton.scenes {
|
||||
|
|
|
@ -1055,23 +1055,6 @@ func (this *Player) EditMessage(msg *model.Message) {
|
|||
}
|
||||
}
|
||||
|
||||
func (this *Player) SendIosInstallStableMail() {
|
||||
if this.layered[common.ActId_IOSINSTALLSTABLE] {
|
||||
logger.Logger.Trace("this.layered[common.ActId_IOSINSTALLSTABLE] is true")
|
||||
return
|
||||
}
|
||||
var newMsg *model.Message
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
newMsg = model.NewMessage("", 0, "", this.SnId, model.MSGTYPE_IOSINSTALLSTABLE, "系统通知", fmt.Sprintf("感谢您下载稳定版本,额外奖励%d元,请查收", int(model.GameParamData.IosStableInstallPrize/100)),
|
||||
int64(model.GameParamData.IosStableInstallPrize), 0, 0, time.Now().Unix(), 0, "", nil, this.Platform, model.HallAll, nil)
|
||||
return model.InsertMessage(this.Platform, newMsg)
|
||||
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
||||
if data == nil {
|
||||
this.AddMessage(newMsg)
|
||||
}
|
||||
}), "SendMessage").Start()
|
||||
}
|
||||
|
||||
func (this *Player) TestMail() {
|
||||
|
||||
var newMsg *model.Message
|
||||
|
@ -1974,7 +1957,7 @@ func (this *Player) AddCoin(num, add int64, gainWay int32, oper, remark string)
|
|||
//this.TotalData(num, gainWay)
|
||||
|
||||
async := false
|
||||
if num > 0 && this.scene != nil && !this.scene.IsTestScene() && !this.scene.IsMatchScene() && this.scene.sceneMode != common.SceneMode_Thr { //游戏场中加币,需要同步到gamesrv上
|
||||
if num > 0 && this.scene != nil && !this.scene.IsTestScene() && !this.scene.IsMatchScene() && this.scene.sceneMode != common.SceneModeThr { //游戏场中加币,需要同步到gamesrv上
|
||||
if StartAsyncAddCoinTransact(this, num, gainWay, oper, remark, true, 0, true) {
|
||||
async = true
|
||||
}
|
||||
|
@ -2029,7 +2012,7 @@ func (this *Player) AddCoinAsync(num, add int64, gainWay int32, oper, remark str
|
|||
|
||||
//玩家可能正在换房间
|
||||
async := false
|
||||
if num > 0 && retryCnt < 3 && this.scene != nil && !this.scene.IsTestScene() && this.scene.sceneMode != common.SceneMode_Thr { //游戏场中加币,需要同步到gamesrv上
|
||||
if num > 0 && retryCnt < 3 && this.scene != nil && !this.scene.IsTestScene() && this.scene.sceneMode != common.SceneModeThr { //游戏场中加币,需要同步到gamesrv上
|
||||
if StartAsyncAddCoinTransact(this, num, gainWay, oper, remark, broadcast, retryCnt, writeLog) {
|
||||
async = true
|
||||
}
|
||||
|
|
|
@ -681,8 +681,6 @@ func (this *Scene) OnClose() {
|
|||
IsForce: proto.Int(1),
|
||||
}
|
||||
this.Broadcast(int(hallproto.GameHallPacketID_PACKET_SC_DESTROYROOM), scDestroyRoom, 0)
|
||||
|
||||
this.sp.OnStop(this)
|
||||
this.deleting = true
|
||||
this.closed = true
|
||||
|
||||
|
@ -728,39 +726,37 @@ func (this *Scene) SendGameDestroy(isGrace bool) {
|
|||
logger.Logger.Tracef("WG_DESTROYSCENE: %v", pack)
|
||||
}
|
||||
|
||||
// IsMatchScene 比赛场
|
||||
func (this *Scene) IsMatchScene() bool {
|
||||
return this.sceneId >= common.MatchSceneStartId && this.sceneId < common.MatchSceneMaxId
|
||||
}
|
||||
|
||||
// IsCoinScene 金币场
|
||||
func (this *Scene) IsCoinScene() bool {
|
||||
return this.sceneId >= common.CoinSceneStartId && this.sceneId < common.CoinSceneMaxId
|
||||
return this != nil && this.csp != nil
|
||||
}
|
||||
|
||||
// IsHundredScene 百人场
|
||||
func (this *Scene) IsHundredScene() bool {
|
||||
return this.sceneId >= common.HundredSceneStartId && this.sceneId < common.HundredSceneMaxId
|
||||
return this != nil && this.hp != nil
|
||||
}
|
||||
|
||||
// IsMatchScene 比赛场
|
||||
func (this *Scene) IsMatchScene() bool {
|
||||
return this.IsSceneMode(common.SceneModeMatch)
|
||||
}
|
||||
|
||||
// IsPrivateScene 私人房间
|
||||
func (this *Scene) IsPrivateScene() bool {
|
||||
return this.sceneId >= common.PrivateSceneStartId && this.sceneId < common.PrivateSceneMaxId
|
||||
return this.IsSceneMode(common.SceneModePrivate)
|
||||
}
|
||||
|
||||
// IsCustom 房卡场房间
|
||||
// IsCustom 竞技馆房间
|
||||
func (this *Scene) IsCustom() bool {
|
||||
if this.IsSceneMode(common.SceneModePrivateMatch) {
|
||||
return true
|
||||
}
|
||||
if this.dbGameFree == nil {
|
||||
return false
|
||||
}
|
||||
return this.dbGameFree.IsCustom > 0
|
||||
}
|
||||
|
||||
// IsSceneMode 房间模式
|
||||
func (this *Scene) IsSceneMode(mode int) bool {
|
||||
return this.sceneMode == mode
|
||||
}
|
||||
|
||||
// IsRankMatch 排位赛
|
||||
func (this *Scene) IsRankMatch() bool {
|
||||
if this.dbGameFree == nil {
|
||||
|
@ -769,6 +765,11 @@ func (this *Scene) IsRankMatch() bool {
|
|||
return this.dbGameFree.RankType > 0
|
||||
}
|
||||
|
||||
// IsSceneMode 房间模式
|
||||
func (this *Scene) IsSceneMode(mode int) bool {
|
||||
return this.sceneMode == mode
|
||||
}
|
||||
|
||||
// IsTestScene 试玩场
|
||||
func (this *Scene) IsTestScene() bool {
|
||||
if this.dbGameFree != nil {
|
||||
|
|
|
@ -13,7 +13,6 @@ import (
|
|||
"mongo.games.com/game/model"
|
||||
serverproto "mongo.games.com/game/protocol/server"
|
||||
webapiproto "mongo.games.com/game/protocol/webapi"
|
||||
"mongo.games.com/game/webapi"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -94,18 +93,6 @@ func (m *SceneMgr) GenPassword() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (m *SceneMgr) GenPasswordInt32() int32 {
|
||||
for i := 0; i < 100; i++ {
|
||||
s := strconv.Itoa(common.RandInt(10000, 100000))
|
||||
if _, ok := m.password[s]; !ok {
|
||||
m.password[s] = struct{}{}
|
||||
n, _ := strconv.Atoi(s)
|
||||
return int32(n)
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SceneMgr) GetPlatformBySceneId(sceneId int) string {
|
||||
s := m.GetScene(sceneId)
|
||||
if s != nil && s.limitPlatform != nil {
|
||||
|
@ -413,18 +400,12 @@ func (m *SceneMgr) CreateScene(args *CreateSceneParam) *Scene {
|
|||
return nil
|
||||
}
|
||||
m.scenes[args.RoomId] = s
|
||||
s.sp.OnStart(s)
|
||||
// 添加到游戏服记录中
|
||||
args.GS.AddScene(&AddSceneParam{
|
||||
S: s,
|
||||
})
|
||||
s.sp.OnStart(s)
|
||||
logger.Logger.Infof("SceneMgr NewScene Platform:%v %+v", args.Platform.IdStr, args)
|
||||
|
||||
// 创建水池
|
||||
if !s.IsMatchScene() && s.dbGameFree != nil && s.limitPlatform != nil {
|
||||
//平台水池设置
|
||||
args.GS.DetectCoinPoolSetting(s.limitPlatform.IdStr, s.dbGameFree.GetId(), s.groupId)
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
|
@ -437,24 +418,23 @@ func (m *SceneMgr) DestroyScene(sceneId int, isCompleted bool) {
|
|||
return
|
||||
}
|
||||
|
||||
s.sp.OnStop(s)
|
||||
s.gameSess.DelScene(s)
|
||||
switch {
|
||||
case s.IsCoinScene():
|
||||
CoinSceneMgrSingleton.OnDestroyScene(s.sceneId)
|
||||
|
||||
case s.IsHundredScene():
|
||||
HundredSceneMgrSingleton.OnDestroyScene(s.sceneId)
|
||||
|
||||
case s.IsMatchScene():
|
||||
MatchSceneMgrSingleton.OnDestroyScene(s.sceneId)
|
||||
}
|
||||
|
||||
s.gameSess.DelScene(s)
|
||||
s.OnClose()
|
||||
|
||||
delete(m.scenes, s.sceneId)
|
||||
delete(m.password, s.GetPassword())
|
||||
logger.Logger.Infof("(this *SceneMgr) DestroyScene, SceneId=%v", sceneId)
|
||||
}
|
||||
|
||||
// SendGameDestroy 发送游戏服销毁房间
|
||||
func (m *SceneMgr) SendGameDestroy(sceneId []int, isGrace bool) {
|
||||
if len(sceneId) == 0 {
|
||||
return
|
||||
|
@ -475,6 +455,30 @@ func (m *SceneMgr) SendGameDestroy(sceneId []int, isGrace bool) {
|
|||
srvlib.ServerSessionMgrSington.Broadcast(int(serverproto.SSPacketID_PACKET_WG_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
}
|
||||
|
||||
// CheckDestroyEmptyRoom 尝试解散空闲房间
|
||||
// 非必须,防止内存泄露
|
||||
func (m *SceneMgr) CheckDestroyEmptyRoom() {
|
||||
for _, s := range m.scenes {
|
||||
switch {
|
||||
case s.IsCoinScene():
|
||||
if !s.IsLongTimeInactive() {
|
||||
continue
|
||||
}
|
||||
if s.dbGameFree == nil {
|
||||
continue
|
||||
}
|
||||
if s.dbGameFree.GetCreateRoomNum() == 0 {
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive CoinScene SendGameDestroy scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.SendGameDestroy(false)
|
||||
}
|
||||
if s.dbGameFree.GetCreateRoomNum() > 0 && s.csp.GetRoomNum(common.SceneModePublic) > int(s.dbGameFree.GetCreateRoomNum()) {
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive CoinScene SendGameDestroy scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.SendGameDestroy(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=========================ClockSinker===============================
|
||||
|
||||
// InterestClockEvent 接收所有时间事件
|
||||
|
@ -483,28 +487,5 @@ func (m *SceneMgr) InterestClockEvent() int {
|
|||
}
|
||||
|
||||
func (m *SceneMgr) OnMiniTimer() {
|
||||
// 解散空闲房间
|
||||
for _, s := range m.scenes {
|
||||
if webapi.ThridPlatformMgrSington.FindPlatformByPlatformBaseGameId(s.gameId) != nil {
|
||||
continue
|
||||
}
|
||||
switch {
|
||||
case s.IsCoinScene():
|
||||
if s.IsLongTimeInactive() {
|
||||
if s.dbGameFree.GetCreateRoomNum() == 0 {
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive CoinScene SendGameDestroy scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.SendGameDestroy(false)
|
||||
}
|
||||
if s.dbGameFree.GetCreateRoomNum() > 0 && s.csp != nil && s.csp.GetRoomNum(common.SceneMode_Public) > int(s.dbGameFree.GetCreateRoomNum()) {
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive CoinScene SendGameDestroy scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.SendGameDestroy(false)
|
||||
}
|
||||
}
|
||||
case s.IsPrivateScene():
|
||||
if s.IsLongTimeInactive() {
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive PrivateScene SendGameDestroy scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.SendGameDestroy(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
m.CheckDestroyEmptyRoom()
|
||||
}
|
||||
|
|
|
@ -1226,6 +1226,13 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
|
|||
|
||||
}
|
||||
|
||||
switch shopInfo.Page {
|
||||
case ShopPageFangKa:
|
||||
remark = fmt.Sprintf("房卡|%v", shopInfo.Id)
|
||||
default:
|
||||
|
||||
}
|
||||
|
||||
dbShop = this.NewDbShop(p, shopInfo.Page, amount[:], ShopConsumeMoney, costNum,
|
||||
common.GainWay_ShopBuy, itemInfo, shopInfo.Id, shopInfo.Name, 0, remark, []int32{})
|
||||
err := model.InsertDbShopLog(dbShop)
|
||||
|
|
Loading…
Reference in New Issue