Merge remote-tracking branch 'origin/develop' into dev_slots
# Conflicts: # public
This commit is contained in:
commit
5418b2bdda
Binary file not shown.
|
@ -6674,7 +6674,7 @@
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"OtherIntParams": [
|
"OtherIntParams": [
|
||||||
1
|
0
|
||||||
],
|
],
|
||||||
"RobotNumRng": [
|
"RobotNumRng": [
|
||||||
0
|
0
|
||||||
|
@ -6707,7 +6707,7 @@
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"OtherIntParams": [
|
"OtherIntParams": [
|
||||||
1
|
0
|
||||||
],
|
],
|
||||||
"RobotNumRng": [
|
"RobotNumRng": [
|
||||||
0
|
0
|
||||||
|
@ -6740,7 +6740,7 @@
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"OtherIntParams": [
|
"OtherIntParams": [
|
||||||
2
|
1
|
||||||
],
|
],
|
||||||
"RobotNumRng": [
|
"RobotNumRng": [
|
||||||
0
|
0
|
||||||
|
@ -6773,7 +6773,7 @@
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"OtherIntParams": [
|
"OtherIntParams": [
|
||||||
2
|
1
|
||||||
],
|
],
|
||||||
"RobotNumRng": [
|
"RobotNumRng": [
|
||||||
0
|
0
|
||||||
|
|
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
@ -101,7 +101,8 @@ func (svc *BagSvc) AddBagItem(args *model.BagInfo, ret *bool) error {
|
||||||
for id, v := range args.BagItem {
|
for id, v := range args.BagItem {
|
||||||
if item, exist := bag.BagItem[id]; !exist {
|
if item, exist := bag.BagItem[id]; !exist {
|
||||||
if v.ItemNum <= 0 {
|
if v.ItemNum <= 0 {
|
||||||
continue
|
err = errors.New("item num not enough")
|
||||||
|
break
|
||||||
}
|
}
|
||||||
bag.BagItem[id] = &model.Item{
|
bag.BagItem[id] = &model.Item{
|
||||||
ItemId: v.ItemId,
|
ItemId: v.ItemId,
|
||||||
|
@ -110,7 +111,8 @@ func (svc *BagSvc) AddBagItem(args *model.BagInfo, ret *bool) error {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if v.ItemNum < 0 && -v.ItemNum > item.ItemNum {
|
if v.ItemNum < 0 && -v.ItemNum > item.ItemNum {
|
||||||
v.ItemNum = -item.ItemNum
|
err = errors.New("item num not enough")
|
||||||
|
break
|
||||||
}
|
}
|
||||||
item.ItemNum += v.ItemNum
|
item.ItemNum += v.ItemNum
|
||||||
}
|
}
|
||||||
|
@ -119,10 +121,18 @@ func (svc *BagSvc) AddBagItem(args *model.BagInfo, ret *bool) error {
|
||||||
vCard = v.ItemNum
|
vCard = v.ItemNum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
*ret = false
|
||||||
|
logger.Logger.Errorf("AddBagItem error: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
_, err = cbag.Upsert(bson.M{"_id": bag.BagId}, bag)
|
_, err = cbag.Upsert(bson.M{"_id": bag.BagId}, bag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
*ret = false
|
*ret = false
|
||||||
logger.Logger.Info("AddBagItem error ", err)
|
logger.Logger.Info("AddBagItem error ", err)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// v卡返还
|
// v卡返还
|
||||||
|
|
|
@ -227,7 +227,7 @@ func (svc *PlayerDataSvc) CreatePlayerDataByThird(args *model.CreatePlayer, ret
|
||||||
var dataParams model.PlayerParams
|
var dataParams model.PlayerParams
|
||||||
json.Unmarshal([]byte(a.Params), &dataParams)
|
json.Unmarshal([]byte(a.Params), &dataParams)
|
||||||
pd = model.NewPlayerDataThird(acc, name, args.HeadUrl, id, a.Channel, a.Platform, a.Params,
|
pd = model.NewPlayerDataThird(acc, name, args.HeadUrl, id, a.Channel, a.Platform, a.Params,
|
||||||
a.Tel, a.PackegeTag, dataParams.Ip, a.TagKey, a.AccountType, a.DeviceOs)
|
a.Tel, a.PackegeTag, dataParams.Ip, a.TagKey, a.AccountType, a.DeviceOs, a.ChannelId)
|
||||||
if pd != nil {
|
if pd != nil {
|
||||||
err = cplayerdata.Insert(pd)
|
err = cplayerdata.Insert(pd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -35,15 +35,11 @@ func MSDollMachineListHandler(session *netlib.Session, packetId int, data interf
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取空闲娃娃机标识
|
// 获取空闲娃娃机标识
|
||||||
func GetFreeDollMachineId() int {
|
func GetFreeDollMachineId(id int32) int {
|
||||||
// 获取互斥锁
|
if MachineMap[int(id)] != nil && MachineMap[int(id)].MachineStatus == 1 {
|
||||||
MachineMapLock.Lock()
|
return int(id)
|
||||||
defer MachineMapLock.Unlock()
|
} else {
|
||||||
for i, v := range MachineMap {
|
return 0
|
||||||
if v.Status == false {
|
|
||||||
v.Status = true
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ func HandleWGBuyRecTimeItem(session *netlib.Session, packetId int, data interfac
|
||||||
// return nil
|
// return nil
|
||||||
//}
|
//}
|
||||||
|
|
||||||
func CreateSceneHandler(session *netlib.Session, packetId int, data interface{}) error {
|
func CreateScene(session *netlib.Session, packetId int, data interface{}) error {
|
||||||
logger.Logger.Tracef("receive CreateScene %v", data)
|
logger.Logger.Tracef("receive CreateScene %v", data)
|
||||||
msg, ok := data.(*server.WGCreateScene)
|
msg, ok := data.(*server.WGCreateScene)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -86,52 +86,53 @@ func CreateSceneHandler(session *netlib.Session, packetId int, data interface{})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func DestroyScene(session *netlib.Session, packetId int, data interface{}) error {
|
||||||
// 创建房间
|
logger.Logger.Trace("receive WGDestroyScene:", data)
|
||||||
netlib.Register(int(server.SSPacketID_PACKET_WG_CREATESCENE), &server.WGCreateScene{}, CreateSceneHandler)
|
msg, ok := data.(*server.WGDestroyScene)
|
||||||
|
|
||||||
//删除场景
|
|
||||||
// 立刻删除,不管游戏是否结束
|
|
||||||
netlib.RegisterFactory(int(server.SSPacketID_PACKET_WG_DESTROYSCENE), netlib.PacketFactoryWrapper(func() interface{} {
|
|
||||||
return &server.WGDestroyScene{}
|
|
||||||
}))
|
|
||||||
netlib.RegisterHandler(int(server.SSPacketID_PACKET_WG_DESTROYSCENE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
|
||||||
logger.Logger.Trace("receive WGDestroyScene:", pack)
|
|
||||||
msg, ok := pack.(*server.WGDestroyScene)
|
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if !msg.IsGrace {
|
if !msg.IsGrace {
|
||||||
// 立刻删除,不管游戏是否结束
|
// 立刻删除,不管游戏是否结束
|
||||||
for _, v := range msg.Ids {
|
for _, v := range msg.Ids {
|
||||||
s := base.SceneMgrSington.GetScene(int(v))
|
s := base.SceneMgrSington.GetScene(int(v))
|
||||||
if s != nil {
|
if s == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if gameScene, ok := s.ExtraData.(base.GameScene); ok {
|
if gameScene, ok := s.ExtraData.(base.GameScene); ok {
|
||||||
gameScene.SceneDestroy(true)
|
gameScene.SceneDestroy(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// 游戏结束后删除房间
|
// 游戏结束后删除房间
|
||||||
for _, v := range msg.Ids {
|
for _, v := range msg.Ids {
|
||||||
s := base.SceneMgrSington.GetScene(int(v))
|
s := base.SceneMgrSington.GetScene(int(v))
|
||||||
if s != nil {
|
if s == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if s.IsHundredScene() || s.Gaming {
|
if s.IsHundredScene() || s.Gaming {
|
||||||
s.SetGraceDestroy(true)
|
s.SetGraceDestroy()
|
||||||
} else {
|
} else {
|
||||||
if s.IsMatchScene() {
|
if s.IsMatchScene() {
|
||||||
s.SetGraceDestroy(true)
|
s.SetGraceDestroy()
|
||||||
}
|
}
|
||||||
if gameScene, ok := s.ExtraData.(base.GameScene); ok {
|
if gameScene, ok := s.ExtraData.(base.GameScene); ok {
|
||||||
gameScene.SceneDestroy(true)
|
gameScene.SceneDestroy(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}))
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// 创建房间
|
||||||
|
netlib.Register(int(server.SSPacketID_PACKET_WG_CREATESCENE), &server.WGCreateScene{}, CreateScene)
|
||||||
|
// 删除房间
|
||||||
|
netlib.Register(int(server.SSPacketID_PACKET_WG_DESTROYSCENE), &server.WGDestroyScene{}, DestroyScene)
|
||||||
|
|
||||||
//玩家进入
|
//玩家进入
|
||||||
netlib.RegisterFactory(int(server.SSPacketID_PACKET_WG_PLAYERENTER), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(server.SSPacketID_PACKET_WG_PLAYERENTER), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"mongo.games.com/game/protocol/webapi"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -297,8 +298,8 @@ func (this *Scene) SetScenePolicy(sp ScenePolicy) {
|
||||||
func (this *Scene) GetGraceDestroy() bool {
|
func (this *Scene) GetGraceDestroy() bool {
|
||||||
return this.graceDestroy
|
return this.graceDestroy
|
||||||
}
|
}
|
||||||
func (this *Scene) SetGraceDestroy(graceDestroy bool) {
|
func (this *Scene) SetGraceDestroy() {
|
||||||
this.graceDestroy = graceDestroy
|
this.graceDestroy = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Scene) GetCpControlled() bool {
|
func (this *Scene) GetCpControlled() bool {
|
||||||
|
@ -2553,15 +2554,16 @@ func (this *Scene) TryRelease() {
|
||||||
this.Destroy(true)
|
this.Destroy(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (this *Scene) GetMachineServerSecret(MachineId int32, platform string) (AppId int64, ServerSecret string) {
|
func (this *Scene) GetMachineServerInfo(MachineId int32, platform string) *webapi.MachineInfo {
|
||||||
config := ConfigMgrInst.GetConfig(platform).MachineConfig
|
config := ConfigMgrInst.GetConfig(platform).MachineConfig
|
||||||
|
logger.Logger.Tracef("========GetMachineServerInfo=========== platform=%s, MachineId=%d ,config = %v", platform, MachineId, config)
|
||||||
if config == nil {
|
if config == nil {
|
||||||
return 0, ""
|
return nil
|
||||||
}
|
}
|
||||||
for _, info := range config.Info {
|
for _, info := range config.Info {
|
||||||
if info.MachineId == MachineId {
|
if info.MachineId == MachineId {
|
||||||
return info.AppId, info.ServerSecret
|
return info
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0, ""
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package base
|
package base
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/protocol/machine"
|
"mongo.games.com/game/protocol/machine"
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
@ -32,7 +31,7 @@ func (this *SrvSessMgr) OnRegiste(s *netlib.Session) {
|
||||||
} else if srvInfo.GetType() == 10 {
|
} else if srvInfo.GetType() == 10 {
|
||||||
logger.Logger.Warn("(this *SrvSessMgr) OnRegiste (Machine):", s)
|
logger.Logger.Warn("(this *SrvSessMgr) OnRegiste (Machine):", s)
|
||||||
s.Send(int(machine.DollMachinePacketID_PACKET_SMGameLinkSucceed), &machine.SMGameLinkSucceed{})
|
s.Send(int(machine.DollMachinePacketID_PACKET_SMGameLinkSucceed), &machine.SMGameLinkSucceed{})
|
||||||
fmt.Printf("与娃娃机服务器连接成功\n")
|
logger.Logger.Info("与娃娃机服务器连接成功\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package clawdoll
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
rule "mongo.games.com/game/gamerule/clawdoll"
|
|
||||||
"mongo.games.com/game/gamesrv/base"
|
"mongo.games.com/game/gamesrv/base"
|
||||||
"mongo.games.com/game/protocol/clawdoll"
|
"mongo.games.com/game/protocol/clawdoll"
|
||||||
"mongo.games.com/game/protocol/machine"
|
"mongo.games.com/game/protocol/machine"
|
||||||
|
@ -60,15 +59,6 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
scene := p.GetScene()
|
|
||||||
if scene == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
sceneEx, ok := scene.ExtraData.(*SceneEx)
|
|
||||||
if !ok {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
switch msg.TypeId {
|
switch msg.TypeId {
|
||||||
case 1:
|
case 1:
|
||||||
if msg.Result == 1 {
|
if msg.Result == 1 {
|
||||||
|
@ -82,13 +72,6 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Tracef("下抓失败!!!!!!!!!!!!snid = ", msg.Snid)
|
logger.Logger.Tracef("下抓失败!!!!!!!!!!!!snid = ", msg.Snid)
|
||||||
}
|
}
|
||||||
|
|
||||||
scene.ChangeSceneState(rule.ClawDollSceneStateBilled)
|
|
||||||
|
|
||||||
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateBilled))
|
|
||||||
|
|
||||||
ClawdollBroadcastRoomState(scene)
|
|
||||||
ClawdollSendPlayerInfo(scene)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -127,14 +110,17 @@ func (h *CSGetTokenHandler) Process(s *netlib.Session, packetid int, data interf
|
||||||
}
|
}
|
||||||
|
|
||||||
machineId := scene.GetDBGameFree().GetId() % 6080000
|
machineId := scene.GetDBGameFree().GetId() % 6080000
|
||||||
appId, serverSecret := sceneEx.GetMachineServerSecret(machineId, p.Platform)
|
machineInfo := sceneEx.GetMachineServerInfo(machineId, p.Platform)
|
||||||
logger.Logger.Tracef("获取娃娃机 appId = %v, serverSecret = %v", appId, serverSecret)
|
if machineInfo == nil {
|
||||||
if serverSecret == "" || appId == 0 {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
pack.ServerSecret = serverSecret
|
logger.Logger.Tracef("获取娃娃机 appId = %v, serverSecret = %v, streamId = %v", machineInfo.AppId, machineInfo.ServerSecret, machineInfo.StreamId)
|
||||||
pack.AppId = appId
|
|
||||||
|
pack.ServerSecret = machineInfo.ServerSecret
|
||||||
|
pack.AppId = machineInfo.AppId
|
||||||
|
pack.StreamId = machineInfo.StreamId
|
||||||
|
|
||||||
sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMGetToken), pack)
|
sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMGetToken), pack)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -161,6 +147,7 @@ func MSSendTokenHandler(session *netlib.Session, packetId int, data interface{})
|
||||||
LogicId: scene.DBGameFree.GetId(),
|
LogicId: scene.DBGameFree.GetId(),
|
||||||
Appid: msg.Appid,
|
Appid: msg.Appid,
|
||||||
Token: token,
|
Token: token,
|
||||||
|
StreamId: msg.StreamId,
|
||||||
}
|
}
|
||||||
p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_SENDTOKEN), pack)
|
p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_SENDTOKEN), pack)
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,12 +102,35 @@ func (this *SceneEx) BroadcastPlayerLeave(p *base.Player, reason int) {
|
||||||
// 玩家进入事件
|
// 玩家进入事件
|
||||||
func (this *SceneEx) OnPlayerEnter(p *base.Player, reason int) {
|
func (this *SceneEx) OnPlayerEnter(p *base.Player, reason int) {
|
||||||
this.BroadcastPlayerEnter(p, reason)
|
this.BroadcastPlayerEnter(p, reason)
|
||||||
|
|
||||||
|
machineId := this.GetDBGameFree().GetId() % 6080000
|
||||||
|
machineInfo := this.GetMachineServerInfo(machineId, p.Platform)
|
||||||
|
if machineInfo == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if this.GetPlayerNum() > 0 {
|
||||||
|
// 发送http Get请求 打开直播间流
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 玩家离开事件
|
// 玩家离开事件
|
||||||
func (this *SceneEx) OnPlayerLeave(p *base.Player, reason int) {
|
func (this *SceneEx) OnPlayerLeave(p *base.Player, reason int) {
|
||||||
this.delPlayer(p)
|
this.delPlayer(p)
|
||||||
this.BroadcastPlayerLeave(p, reason)
|
this.BroadcastPlayerLeave(p, reason)
|
||||||
|
|
||||||
|
machineId := this.GetDBGameFree().GetId() % 6080000
|
||||||
|
machineInfo := this.GetMachineServerInfo(machineId, p.Platform)
|
||||||
|
if machineInfo == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if this.GetPlayerNum() <= 0 {
|
||||||
|
// 发送http Get请求 关闭直播间流
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
func (this *SceneEx) SceneDestroy(force bool) {
|
func (this *SceneEx) SceneDestroy(force bool) {
|
||||||
//销毁房间
|
//销毁房间
|
||||||
|
@ -288,7 +311,7 @@ func (this *SceneEx) GetPlayGrabType(player *PlayerEx) int32 {
|
||||||
return rule.ClawWeak
|
return rule.ClawWeak
|
||||||
}
|
}
|
||||||
|
|
||||||
if this.RoundId%100 == 0 && this.RoundId != 0 {
|
if this.RoundId/2 == 0 && this.RoundId != 0 {
|
||||||
return rule.ClawStrong
|
return rule.ClawStrong
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,7 +371,11 @@ func (this *SceneEx) SetPlayingState(state int32) {
|
||||||
// 时间到 系统开始下抓
|
// 时间到 系统开始下抓
|
||||||
func (this *SceneEx) TimeOutPlayGrab() bool {
|
func (this *SceneEx) TimeOutPlayGrab() bool {
|
||||||
|
|
||||||
this.OnPlayerSMGrabOp(this.playingSnid, int32(this.machineId), rule.ClawWeak)
|
playerEx := this.players[this.playingSnid]
|
||||||
|
if playerEx != nil {
|
||||||
|
grapType := this.GetPlayGrabType(playerEx)
|
||||||
|
this.OnPlayerSMGrabOp(this.playingSnid, int32(this.machineId), grapType)
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,8 @@ func (this *PolicyClawdoll) OnTick(s *base.Scene) {
|
||||||
sceneEx, ok := s.ExtraData.(*SceneEx)
|
sceneEx, ok := s.ExtraData.(*SceneEx)
|
||||||
if ok {
|
if ok {
|
||||||
if sceneEx.machineId == 0 {
|
if sceneEx.machineId == 0 {
|
||||||
sceneEx.machineId = action.GetFreeDollMachineId()
|
machineId := s.DBGameFree.GetId() % 6080000
|
||||||
|
sceneEx.machineId = action.GetFreeDollMachineId(machineId)
|
||||||
}
|
}
|
||||||
if sceneEx.machineId != 0 {
|
if sceneEx.machineId != 0 {
|
||||||
machineStatus := action.GetDollMachineStatus(sceneEx.machineId)
|
machineStatus := action.GetDollMachineStatus(sceneEx.machineId)
|
||||||
|
@ -285,14 +286,16 @@ func (this *PolicyClawdoll) SendGetVideoToken(s *base.Scene, p *base.Player, sce
|
||||||
pack.Snid = p.SnId
|
pack.Snid = p.SnId
|
||||||
|
|
||||||
machineId := s.DBGameFree.GetId() % 6080000
|
machineId := s.DBGameFree.GetId() % 6080000
|
||||||
appId, serverSecret := sceneEx.GetMachineServerSecret(machineId, p.Platform)
|
machineinfo := sceneEx.GetMachineServerInfo(machineId, p.Platform)
|
||||||
logger.Logger.Tracef("获取娃娃机 appId = %v, serverSecret = %v", appId, serverSecret)
|
if machineinfo == nil {
|
||||||
if serverSecret == "" || appId == 0 {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
pack.ServerSecret = serverSecret
|
logger.Logger.Tracef("获取娃娃机 appId = %v, serverSecret = %v, streamId = %v", machineinfo.AppId, machineinfo.ServerSecret, machineinfo.StreamId)
|
||||||
pack.AppId = appId
|
|
||||||
|
pack.ServerSecret = machineinfo.ServerSecret
|
||||||
|
pack.AppId = machineinfo.AppId
|
||||||
|
pack.StreamId = machineinfo.StreamId
|
||||||
sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMGetToken), pack)
|
sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMGetToken), pack)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -666,6 +669,12 @@ func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, para
|
||||||
//1-弱力抓 2 -强力抓
|
//1-弱力抓 2 -强力抓
|
||||||
sceneEx.OnPlayerSMGrabOp(p.SnId, int32(sceneEx.machineId), grapType)
|
sceneEx.OnPlayerSMGrabOp(p.SnId, int32(sceneEx.machineId), grapType)
|
||||||
|
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateBilled)
|
||||||
|
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateBilled))
|
||||||
|
|
||||||
|
ClawdollBroadcastRoomState(s)
|
||||||
|
ClawdollSendPlayerInfo(s)
|
||||||
|
|
||||||
case rule.ClawDollPlayerOpMove:
|
case rule.ClawDollPlayerOpMove:
|
||||||
|
|
||||||
if !sceneEx.CheckMoveOp(playerEx) {
|
if !sceneEx.CheckMoveOp(playerEx) {
|
||||||
|
@ -693,9 +702,14 @@ func (this *PlayGame) OnTick(s *base.Scene) {
|
||||||
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollScenePlayTimeout {
|
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollScenePlayTimeout {
|
||||||
|
|
||||||
if sceneEx.TimeOutPlayGrab() {
|
if sceneEx.TimeOutPlayGrab() {
|
||||||
logger.Logger.Trace("PlayGame OnTick TimeOutPlayGrab SnId", sceneEx.playingSnid, " machineId:", sceneEx.machineId)
|
//logger.Logger.Trace("PlayGame OnTick TimeOutPlayGrab SnId", sceneEx.playingSnid, " machineId:", sceneEx.machineId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateBilled)
|
||||||
|
sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateBilled))
|
||||||
|
|
||||||
|
ClawdollBroadcastRoomState(s)
|
||||||
|
ClawdollSendPlayerInfo(s)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
|
||||||
num := int64(1)
|
num := int64(1)
|
||||||
for {
|
for {
|
||||||
// 读取数据
|
// 读取数据
|
||||||
logger.Logger.Trace("监听抓取结果返回!")
|
//logger.Logger.Trace("监听抓取结果返回!")
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
n, err := conn.Read(buf)
|
n, err := conn.Read(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -178,7 +178,7 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
|
||||||
}
|
}
|
||||||
// 将读取到的数据按照 221 进行分割
|
// 将读取到的数据按照 221 进行分割
|
||||||
parts := bytes.Split(buf[:n], []byte{221})
|
parts := bytes.Split(buf[:n], []byte{221})
|
||||||
fmt.Println("获取到的返回值:", parts)
|
//fmt.Println("获取到的返回值:", parts)
|
||||||
instruction := []byte{0xAA, 0x05, 0x02, 0x50, 0x09, 0x00}
|
instruction := []byte{0xAA, 0x05, 0x02, 0x50, 0x09, 0x00}
|
||||||
instruction1 := []byte{0xAA, 0x05, 0x02, 0x50, 0x09, 0x01}
|
instruction1 := []byte{0xAA, 0x05, 0x02, 0x50, 0x09, 0x01}
|
||||||
// 遍历分割结果,打印出每个部分
|
// 遍历分割结果,打印出每个部分
|
||||||
|
@ -187,11 +187,11 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
|
||||||
part = part[:len(part)-1] // 去除最后一个字节,该字节为分隔符
|
part = part[:len(part)-1] // 去除最后一个字节,该字节为分隔符
|
||||||
//fmt.Println("比较返回结果 part = ", part)
|
//fmt.Println("比较返回结果 part = ", part)
|
||||||
if bytes.Contains(part, instruction) && num != 1 {
|
if bytes.Contains(part, instruction) && num != 1 {
|
||||||
fmt.Printf("Part %d: %s\n", i+1, part)
|
//fmt.Printf("Part %d: %s\n", i+1, part)
|
||||||
//回应数据
|
//回应数据
|
||||||
_, err = conn.Write([]byte{0xAA, 0x04, 0x01, 0x50, 0x09, 0x5c, 0xdd})
|
_, err = conn.Write([]byte{0xAA, 0x04, 0x01, 0x50, 0x09, 0x5c, 0xdd})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to read response from server:", err)
|
//fmt.Println("Failed to read response from server:", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.Send(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
session.Send(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
||||||
|
@ -300,6 +300,7 @@ func SMGetTokenHandler(session *netlib.Session, packetId int, data interface{})
|
||||||
info.Snid = msg.Snid
|
info.Snid = msg.Snid
|
||||||
info.Token = token
|
info.Token = token
|
||||||
info.Appid = msg.AppId
|
info.Appid = msg.AppId
|
||||||
|
info.StreamId = msg.StreamId
|
||||||
|
|
||||||
session.Send(int(machine.DollMachinePacketID_PACKET_MSSendToken), info)
|
session.Send(int(machine.DollMachinePacketID_PACKET_MSSendToken), info)
|
||||||
logger.Logger.Tracef("向游戏服务器发送娃娃机token:%v", info)
|
logger.Logger.Tracef("向游戏服务器发送娃娃机token:%v", info)
|
||||||
|
|
|
@ -981,7 +981,7 @@ func NewPlayerData(acc string, name string, id int32, channel, platform string,
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPlayerDataThird(acc string, name, headUrl string, id int32, channel, platform string, params, tel string,
|
func NewPlayerDataThird(acc string, name, headUrl string, id int32, channel, platform string, params, tel string,
|
||||||
packTag, ip string, tagkey, accountType int32, deviceOS string) *PlayerData {
|
packTag, ip string, tagkey, accountType int32, deviceOS, channelId string) *PlayerData {
|
||||||
if len(name) == 0 {
|
if len(name) == 0 {
|
||||||
logger.Logger.Trace("New player name is empty.")
|
logger.Logger.Trace("New player name is empty.")
|
||||||
return nil
|
return nil
|
||||||
|
@ -992,6 +992,7 @@ func NewPlayerDataThird(acc string, name, headUrl string, id int32, channel, pla
|
||||||
AccountId: acc,
|
AccountId: acc,
|
||||||
Name: name,
|
Name: name,
|
||||||
Channel: channel,
|
Channel: channel,
|
||||||
|
ChannelId: channelId,
|
||||||
Platform: platform,
|
Platform: platform,
|
||||||
SnId: id,
|
SnId: id,
|
||||||
Head: rand.Int31n(common.HeadRange),
|
Head: rand.Int31n(common.HeadRange),
|
||||||
|
|
|
@ -884,6 +884,7 @@ type SCCLAWDOLLSendToken struct {
|
||||||
LogicId int32 `protobuf:"varint,1,opt,name=LogicId,proto3" json:"LogicId,omitempty"`
|
LogicId int32 `protobuf:"varint,1,opt,name=LogicId,proto3" json:"LogicId,omitempty"`
|
||||||
Appid int64 `protobuf:"varint,2,opt,name=Appid,proto3" json:"Appid,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"`
|
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 *SCCLAWDOLLSendToken) Reset() {
|
func (x *SCCLAWDOLLSendToken) Reset() {
|
||||||
|
@ -939,6 +940,13 @@ func (x *SCCLAWDOLLSendToken) GetToken() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *SCCLAWDOLLSendToken) GetStreamId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.StreamId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type CLAWDOLLWaitPlayers struct {
|
type CLAWDOLLWaitPlayers struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
|
@ -1145,59 +1153,61 @@ var file_clawdoll_proto_rawDesc = []byte{
|
||||||
0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49,
|
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,
|
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,
|
0x12, 0x43, 0x53, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x47, 0x65, 0x74, 0x54, 0x6f,
|
||||||
0x6b, 0x65, 0x6e, 0x22, 0x5b, 0x0a, 0x13, 0x53, 0x43, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c,
|
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,
|
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,
|
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,
|
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,
|
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,
|
0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||||
0x22, 0x63, 0x0a, 0x13, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x57, 0x61, 0x69, 0x74,
|
0x12, 0x1a, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x0f, 0x57, 0x61, 0x69, 0x74, 0x50,
|
0x28, 0x09, 0x52, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x63, 0x0a, 0x13,
|
||||||
0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
|
0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79,
|
||||||
0x32, 0x22, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x64, 0x6f, 0x6c, 0x6c, 0x2e, 0x43, 0x4c, 0x41, 0x57,
|
0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x0f, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65,
|
||||||
0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74,
|
0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63,
|
||||||
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72,
|
0x6c, 0x61, 0x77, 0x64, 0x6f, 0x6c, 0x6c, 0x2e, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c,
|
||||||
0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x70, 0x0a, 0x18, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c,
|
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f,
|
||||||
0x4c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66,
|
0x52, 0x0f, 0x57, 0x61, 0x69, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66,
|
||||||
0x6f, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x6f, 0x22, 0x70, 0x0a, 0x18, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x6c, 0x61,
|
||||||
0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20,
|
0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a,
|
||||||
0x01, 0x28, 0x05, 0x52, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x48, 0x65, 0x61,
|
0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49,
|
||||||
0x64, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x48, 0x65, 0x61, 0x64,
|
0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
|
0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x55, 0x72, 0x6c,
|
||||||
0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x2a, 0xfd, 0x02, 0x0a, 0x10, 0x43, 0x4c, 0x41, 0x57,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x48, 0x65, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12,
|
||||||
0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x0f, 0x0a, 0x0b,
|
0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e,
|
||||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x17, 0x0a,
|
0x61, 0x6d, 0x65, 0x2a, 0xfd, 0x02, 0x0a, 0x10, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c,
|
||||||
0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x49,
|
0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x41, 0x43, 0x4b,
|
||||||
0x4e, 0x46, 0x4f, 0x10, 0xe1, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
0x45, 0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43,
|
||||||
0x5f, 0x43, 0x53, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe2, 0x2b, 0x12,
|
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10,
|
||||||
0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41,
|
0xe1, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f,
|
||||||
0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe3, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b,
|
0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe2, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50,
|
||||||
0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10,
|
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f,
|
||||||
0xe4, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f,
|
0x50, 0x10, 0xe3, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
||||||
0x47, 0x41, 0x4d, 0x45, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xe5, 0x2b, 0x12, 0x1a, 0x0a,
|
0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xe4, 0x2b, 0x12, 0x19,
|
||||||
0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65,
|
0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x47, 0x41, 0x4d, 0x45,
|
||||||
0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10, 0xe6, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43,
|
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, 0x4c, 0x65, 0x61,
|
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x74,
|
||||||
0x76, 0x65, 0x10, 0xe7, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
0x65, 0x72, 0x10, 0xe6, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||||
0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe8, 0x2b,
|
0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x10, 0xe7,
|
||||||
0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x47, 0x45,
|
0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50,
|
||||||
0x54, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0xe9, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43,
|
0x4c, 0x41, 0x59, 0x45, 0x52, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe8, 0x2b, 0x12, 0x17, 0x0a, 0x12,
|
||||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x45, 0x4e, 0x44, 0x54, 0x4f, 0x4b, 0x45, 0x4e,
|
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x47, 0x45, 0x54, 0x54, 0x4f, 0x4b,
|
||||||
0x10, 0xea, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53,
|
0x45, 0x4e, 0x10, 0xe9, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||||
0x5f, 0x57, 0x41, 0x49, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0xeb, 0x2b, 0x12,
|
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, 0x53, 0x43, 0x5f, 0x57, 0x41, 0x49,
|
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, 0xec, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50,
|
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, 0x50, 0x4c, 0x41, 0x59, 0x49, 0x4e, 0x47,
|
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x50, 0x4c, 0x41,
|
||||||
0x49, 0x4e, 0x46, 0x4f, 0x10, 0xed, 0x2b, 0x2a, 0x64, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73,
|
0x59, 0x45, 0x52, 0x53, 0x10, 0xec, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||||
0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f,
|
0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x49, 0x4e, 0x47, 0x49, 0x4e, 0x46, 0x4f,
|
||||||
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52,
|
0x10, 0xed, 0x2b, 0x2a, 0x64, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43,
|
||||||
0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x52,
|
0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x63,
|
||||||
0x43, 0x5f, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10,
|
0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72,
|
||||||
0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x50, 0x6f, 0x73, 0x41, 0x6c, 0x52,
|
0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x43, 0x6f,
|
||||||
0x65, 0x61, 0x64, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x10, 0x03, 0x42, 0x28, 0x5a,
|
0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x02, 0x12, 0x1a, 0x0a,
|
||||||
0x26, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
|
0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x50, 0x6f, 0x73, 0x41, 0x6c, 0x52, 0x65, 0x61, 0x64, 0x79,
|
||||||
0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63,
|
0x50, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x10, 0x03, 0x42, 0x28, 0x5a, 0x26, 0x6d, 0x6f, 0x6e,
|
||||||
0x6c, 0x61, 0x77, 0x64, 0x6f, 0x6c, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
|
|
|
@ -117,6 +117,7 @@ message SCCLAWDOLLSendToken {
|
||||||
int32 LogicId = 1;
|
int32 LogicId = 1;
|
||||||
int64 Appid = 2;
|
int64 Appid = 2;
|
||||||
string Token = 3;
|
string Token = 3;
|
||||||
|
string StreamId = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CLAWDOLLWaitPlayers {
|
message CLAWDOLLWaitPlayers {
|
||||||
|
|
|
@ -505,6 +505,7 @@ type SMGetToken struct {
|
||||||
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||||
AppId int64 `protobuf:"varint,2,opt,name=AppId,proto3" json:"AppId,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"`
|
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() {
|
func (x *SMGetToken) Reset() {
|
||||||
|
@ -560,6 +561,13 @@ func (x *SMGetToken) GetServerSecret() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *SMGetToken) GetStreamId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.StreamId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
//返回token
|
//返回token
|
||||||
type MSSendToken struct {
|
type MSSendToken struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
|
@ -569,6 +577,7 @@ type MSSendToken struct {
|
||||||
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||||
Appid int64 `protobuf:"varint,2,opt,name=Appid,proto3" json:"Appid,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"`
|
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() {
|
func (x *MSSendToken) Reset() {
|
||||||
|
@ -624,6 +633,13 @@ func (x *MSSendToken) GetToken() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *MSSendToken) GetStreamId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.StreamId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_machine_proto protoreflect.FileDescriptor
|
var File_machine_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_machine_proto_rawDesc = []byte{
|
var file_machine_proto_rawDesc = []byte{
|
||||||
|
@ -661,40 +677,44 @@ 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, 0x22, 0x5a, 0x0a, 0x0a, 0x53, 0x4d, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65,
|
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,
|
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,
|
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,
|
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,
|
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, 0x22,
|
0x09, 0x52, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12,
|
||||||
0x4d, 0x0a, 0x0b, 0x4d, 0x53, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x12,
|
0x1a, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||||
0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e,
|
0x09, 0x52, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x0b, 0x4d,
|
||||||
0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x53, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e,
|
||||||
0x03, 0x52, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65,
|
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x14,
|
||||||
0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2a, 0xb9,
|
0x0a, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x41,
|
||||||
0x02, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x61,
|
0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20,
|
||||||
0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x74,
|
||||||
0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5a, 0x65,
|
0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x74,
|
||||||
0x72, 0x6f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x2a, 0xb9, 0x02, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||||
0x4d, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64,
|
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c,
|
||||||
0x10, 0xa0, 0x9c, 0x01, 0x12, 0x20, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
|
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||||
0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x61,
|
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x18,
|
||||||
0x74, 0x65, 0x10, 0xa1, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e,
|
||||||
0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47, 0x72,
|
0x6b, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x10, 0xa0, 0x9c, 0x01, 0x12, 0x20, 0x0a, 0x1a,
|
||||||
0x61, 0x62, 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63,
|
||||||
0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69,
|
0x68, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x61, 0x74, 0x65, 0x10, 0xa1, 0x9c, 0x01, 0x12, 0x1e,
|
||||||
0x73, 0x74, 0x10, 0xa3, 0x9c, 0x01, 0x12, 0x26, 0x0a, 0x20, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||||
0x5f, 0x4d, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63,
|
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1e,
|
||||||
0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x10, 0xa4, 0x9c, 0x01, 0x12, 0x27,
|
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||||
0x0a, 0x21, 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,
|
||||||
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x6f, 0x50, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73,
|
0x0a, 0x20, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74,
|
||||||
0x75, 0x6c, 0x74, 0x10, 0xa5, 0x9c, 0x01, 0x12, 0x17, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
0x65, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74,
|
||||||
0x54, 0x5f, 0x53, 0x4d, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x10, 0xa6, 0x9c, 0x01,
|
0x75, 0x73, 0x10, 0xa4, 0x9c, 0x01, 0x12, 0x27, 0x0a, 0x21, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||||
0x12, 0x18, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x53, 0x65, 0x6e,
|
0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x6f, 0x50,
|
||||||
0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x10, 0xa7, 0x9c, 0x01, 0x42, 0x27, 0x5a, 0x25, 0x6d, 0x6f,
|
0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0xa5, 0x9c, 0x01, 0x12,
|
||||||
0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61,
|
0x17, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x47, 0x65, 0x74, 0x54,
|
||||||
0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x61, 0x63, 0x68,
|
0x6f, 0x6b, 0x65, 0x6e, 0x10, 0xa6, 0x9c, 0x01, 0x12, 0x18, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b,
|
||||||
0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
|
|
|
@ -64,10 +64,12 @@ message SMGetToken{
|
||||||
int32 Snid = 1;
|
int32 Snid = 1;
|
||||||
int64 AppId = 2;
|
int64 AppId = 2;
|
||||||
string ServerSecret = 3;
|
string ServerSecret = 3;
|
||||||
|
string StreamId = 4;
|
||||||
}
|
}
|
||||||
//返回token
|
//返回token
|
||||||
message MSSendToken{
|
message MSSendToken{
|
||||||
int32 Snid = 1;
|
int32 Snid = 1;
|
||||||
int64 Appid = 2;
|
int64 Appid = 2;
|
||||||
string Token = 3;
|
string Token = 3;
|
||||||
|
string StreamId = 4;
|
||||||
}
|
}
|
|
@ -1938,6 +1938,9 @@ func CSPlayerData(s *netlib.Session, packetid int, data interface{}, sid int64)
|
||||||
if (p.Channel == "" || p.Channel == "0") && p.Channel != msg.AppChannel {
|
if (p.Channel == "" || p.Channel == "0") && p.Channel != msg.AppChannel {
|
||||||
p.Channel = msg.AppChannel
|
p.Channel = msg.AppChannel
|
||||||
}
|
}
|
||||||
|
if ls.als.acc.ChannelId != "" && p.ChannelId == "" {
|
||||||
|
p.ChannelId = ls.als.acc.ChannelId
|
||||||
|
}
|
||||||
|
|
||||||
if ls.clog != nil {
|
if ls.clog != nil {
|
||||||
PlayerSubjectSign.UpdateHeadUrl(p.SnId, ls.clog.HeadUrl)
|
PlayerSubjectSign.UpdateHeadUrl(p.SnId, ls.clog.HeadUrl)
|
||||||
|
|
|
@ -93,80 +93,10 @@ func init() {
|
||||||
etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent)
|
etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent)
|
||||||
// 小精灵配置
|
// 小精灵配置
|
||||||
etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent)
|
etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent)
|
||||||
|
// 竞技馆房间配置
|
||||||
PlatformMgrSingleton.GetConfig("1").RoomType = map[int32]*webapi.RoomType{
|
etcd.Register(etcd.ETCDKEY_RoomConfig, webapi.RoomConfig{}, handlerEvent)
|
||||||
1: {
|
// 竞技馆房间类型配置
|
||||||
Platform: "1",
|
etcd.Register(etcd.ETCDKEY_RoomType, webapi.RoomType{}, handlerEvent)
|
||||||
Id: 1,
|
|
||||||
Name: "{\"zh\":\"话费赛\",\"kh\":\"话费赛\",\"vi\":\"话费赛\",\"en\":\"话费赛\"}",
|
|
||||||
On: 1,
|
|
||||||
SortId: 1,
|
|
||||||
},
|
|
||||||
2: {
|
|
||||||
Platform: "1",
|
|
||||||
Id: 2,
|
|
||||||
Name: "{\"zh\":\"物品赛\",\"kh\":\"物品赛\",\"vi\":\"物品赛\",\"en\":\"物品赛\"}",
|
|
||||||
On: 1,
|
|
||||||
SortId: 2,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
PlatformMgrSingleton.UpdateRoomConfig(&webapi.RoomConfig{
|
|
||||||
Platform: "1",
|
|
||||||
Id: 1,
|
|
||||||
Name: "{\"zh\":\"1元话费赛\",\"kh\":\"1元话费赛\",\"vi\":\"1元话费赛\",\"en\":\"1元话费赛\"}",
|
|
||||||
RoomType: 1,
|
|
||||||
On: 1,
|
|
||||||
SortId: 1,
|
|
||||||
Cost: []*webapi.ItemInfo{
|
|
||||||
{
|
|
||||||
ItemId: 100001,
|
|
||||||
ItemNum: 12,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Reward: []*webapi.ItemInfo{
|
|
||||||
{
|
|
||||||
ItemId: 100001,
|
|
||||||
ItemNum: 12,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OnChannelName: []string{common.ChannelOfficial, common.ChannelWeb, common.ChannelGooglePlay},
|
|
||||||
GameFreeId: []int32{2150001, 2160001, 2170001, 2180001},
|
|
||||||
Round: []int32{1, 2, 3, 4},
|
|
||||||
PlayerNum: []int32{2, 3, 4},
|
|
||||||
NeedPassword: 3,
|
|
||||||
CostType: 3,
|
|
||||||
Voice: 3,
|
|
||||||
ImageURI: "",
|
|
||||||
})
|
|
||||||
PlatformMgrSingleton.UpdateRoomConfig(&webapi.RoomConfig{
|
|
||||||
Platform: "1",
|
|
||||||
Id: 2,
|
|
||||||
Name: "{\"zh\":\"2元话费赛\",\"kh\":\"2元话费赛\",\"vi\":\"2元话费赛\",\"en\":\"2元话费赛\"}",
|
|
||||||
RoomType: 1,
|
|
||||||
On: 1,
|
|
||||||
SortId: 2,
|
|
||||||
Cost: []*webapi.ItemInfo{
|
|
||||||
{
|
|
||||||
ItemId: 100001,
|
|
||||||
ItemNum: 12,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Reward: []*webapi.ItemInfo{
|
|
||||||
{
|
|
||||||
ItemId: 100001,
|
|
||||||
ItemNum: 12,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OnChannelName: []string{common.ChannelOfficial, common.ChannelWeb, common.ChannelGooglePlay},
|
|
||||||
GameFreeId: []int32{2150001, 2160001, 2170001, 2180001},
|
|
||||||
Round: []int32{1, 2, 3, 4},
|
|
||||||
PlayerNum: []int32{2, 3, 4},
|
|
||||||
NeedPassword: 3,
|
|
||||||
CostType: 3,
|
|
||||||
Voice: 3,
|
|
||||||
ImageURI: "",
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
||||||
|
@ -555,7 +485,7 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c
|
||||||
config := data.(*webapi.RoomType)
|
config := data.(*webapi.RoomType)
|
||||||
PlatformMgrSingleton.UpdateRoomType(config)
|
PlatformMgrSingleton.UpdateRoomType(config)
|
||||||
if !isInit {
|
if !isInit {
|
||||||
PlayerMgrSington.BroadcastMessageToPlatform(config.GetPlatform(), int(0), nil)
|
//PlayerMgrSington.BroadcastMessageToPlatform(config.GetPlatform(), int(0), nil)
|
||||||
}
|
}
|
||||||
case clientv3.EventTypeDelete:
|
case clientv3.EventTypeDelete:
|
||||||
if plt == "" || len(param) == 0 {
|
if plt == "" || len(param) == 0 {
|
||||||
|
@ -563,7 +493,7 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c
|
||||||
}
|
}
|
||||||
PlatformMgrSingleton.DelRoomType(plt, int32(param[0]))
|
PlatformMgrSingleton.DelRoomType(plt, int32(param[0]))
|
||||||
if !isInit {
|
if !isInit {
|
||||||
PlayerMgrSington.BroadcastMessageToPlatform(plt, int(0), nil)
|
//PlayerMgrSington.BroadcastMessageToPlatform(plt, int(0), nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -514,8 +514,6 @@ func (this *Scene) lastScene(p *Player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Scene) DelPlayer(p *Player) bool {
|
func (this *Scene) DelPlayer(p *Player) bool {
|
||||||
FirePlayerLeaveScene(p, this)
|
|
||||||
this.sp.OnPlayerLeave(this, p)
|
|
||||||
if p.scene != this {
|
if p.scene != this {
|
||||||
roomId := 0
|
roomId := 0
|
||||||
if p.scene != nil {
|
if p.scene != nil {
|
||||||
|
@ -556,6 +554,8 @@ func (this *Scene) DelPlayer(p *Player) bool {
|
||||||
if !p.IsRob {
|
if !p.IsRob {
|
||||||
this.lastTime = time.Now()
|
this.lastTime = time.Now()
|
||||||
}
|
}
|
||||||
|
FirePlayerLeaveScene(p, this)
|
||||||
|
this.sp.OnPlayerLeave(this, p)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,6 +198,7 @@ func (m *SceneMgr) MarshalAllRoom(platform string, groupId, gameId int, gameMode
|
||||||
GameMode: int32(s.gameMode),
|
GameMode: int32(s.gameMode),
|
||||||
SceneMode: int32(s.sceneMode),
|
SceneMode: int32(s.sceneMode),
|
||||||
GroupId: s.groupId,
|
GroupId: s.groupId,
|
||||||
|
GameFreeId: s.dbGameFree.GetId(),
|
||||||
Creator: s.creator,
|
Creator: s.creator,
|
||||||
ReplayCode: s.replayCode,
|
ReplayCode: s.replayCode,
|
||||||
Params: common.CopySliceInt64ToInt32(s.params),
|
Params: common.CopySliceInt64ToInt32(s.params),
|
||||||
|
@ -205,12 +206,12 @@ func (m *SceneMgr) MarshalAllRoom(platform string, groupId, gameId int, gameMode
|
||||||
RobotCnt: int32(s.robotNum),
|
RobotCnt: int32(s.robotNum),
|
||||||
CreateTime: s.createTime.Unix(),
|
CreateTime: s.createTime.Unix(),
|
||||||
BaseScore: s.dbGameFree.BaseScore,
|
BaseScore: s.dbGameFree.BaseScore,
|
||||||
GameFreeId: s.dbGameFree.GetId(),
|
RoomConfigId: s.GetRoomConfigId(),
|
||||||
|
CurrRound: s.currRound,
|
||||||
MaxRound: s.totalRound,
|
MaxRound: s.totalRound,
|
||||||
Password: s.GetPassword(),
|
Password: s.GetPassword(),
|
||||||
CostType: s.GetCostType(),
|
CostType: s.GetCostType(),
|
||||||
Voice: s.GetVoice(),
|
Voice: s.GetVoice(),
|
||||||
CurrRound: s.currRound,
|
|
||||||
}
|
}
|
||||||
if s.starting {
|
if s.starting {
|
||||||
si.Start = 1
|
si.Start = 1
|
||||||
|
|
|
@ -3761,15 +3761,21 @@ func init() {
|
||||||
p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
|
p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
|
||||||
if p != nil {
|
if p != nil {
|
||||||
//获取道具Id
|
//获取道具Id
|
||||||
BagMgrSingleton.AddItemsV2(&model.AddItemParam{
|
_, _, ok := BagMgrSingleton.AddItemsV2(&model.AddItemParam{
|
||||||
P: p.PlayerData,
|
P: p.PlayerData,
|
||||||
Change: items,
|
Change: items,
|
||||||
GainWay: msg.GetTypeId(),
|
GainWay: msg.GetTypeId(),
|
||||||
Operator: "system",
|
Operator: "system",
|
||||||
Remark: msg.GetRemark(),
|
Remark: msg.GetRemark(),
|
||||||
})
|
})
|
||||||
|
if !ok {
|
||||||
|
logger.Logger.Errorf("player delete %v err: %v", msg, err)
|
||||||
|
pack.Tag = webapiproto.TagCode_FAILED
|
||||||
|
pack.Msg = "修改道具失败"
|
||||||
|
return common.ResponseTag_Ok, pack
|
||||||
|
}
|
||||||
pack.Tag = webapiproto.TagCode_SUCCESS
|
pack.Tag = webapiproto.TagCode_SUCCESS
|
||||||
pack.Msg = "AddItem success"
|
pack.Msg = "修改道具成功"
|
||||||
return common.ResponseTag_Ok, pack
|
return common.ResponseTag_Ok, pack
|
||||||
} else {
|
} else {
|
||||||
BagMgrSingleton.AddItemsOffline(msg.Platform, msg.Snid, items, msg.GetTypeId(),
|
BagMgrSingleton.AddItemsOffline(msg.Platform, msg.Snid, items, msg.GetTypeId(),
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue