diff --git a/gamesrv/clawdoll/action_clawdoll.go b/gamesrv/clawdoll/action_clawdoll.go index 2340d03..6cd153c 100644 --- a/gamesrv/clawdoll/action_clawdoll.go +++ b/gamesrv/clawdoll/action_clawdoll.go @@ -69,8 +69,69 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data } return nil } + +type CSGetTokenPacketFactory struct { +} + +type CSGetTokenHandler struct { +} + +func (f *CSGetTokenPacketFactory) CreatePacket() interface{} { + pack := &clawdoll.CSCLAWDOLLGetToken{} + return pack +} + +func (h *CSGetTokenHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error { + //转发到娃娃机主机 + logger.Logger.Tracef("CSGetTokenHandler") + if msg, ok := data.(*clawdoll.CSCLAWDOLLGetToken); ok { + p := base.PlayerMgrSington.GetPlayer(sid) + if p == nil { + logger.Logger.Warn("CSGetTokenHandler p == nil") + return nil + } + pack := &machine.SMGetToken{} + pack.Snid = p.SnId + pack.AppId = msg.Appid + pack.ServerSecret = msg.ServerSecret + scene := p.GetScene() + if scene == nil { + return nil + } + sceneEx, ok := scene.ExtraData.(*SceneEx) + if !ok { + return nil + } + sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMGetToken), pack) + } + 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.GetPlayer(int64(msg.Snid)) + if p == nil { + logger.Logger.Warn("MSSendTokenHandler p == nil") + return nil + } + pack := &clawdoll.SCCLAWDOLLSendToken{ + Token: token, + } + p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_SENDTOKEN), pack) + } + return nil +} func init() { common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_PLAYEROP), &CSPlayerOpHandler{}) netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_PLAYEROP), &CSPlayerOpPacketFactory{}) netlib.Register(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{}, MSDollMachineoCoinResultHandler) + //客户端请求token + common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_PLAYEROP), &CSGetTokenHandler{}) + netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_PLAYEROP), &CSGetTokenPacketFactory{}) + //获取token返回 + netlib.Register(int(machine.DollMachinePacketID_PACKET_MSSendToken), &machine.MSSendToken{}, MSSendTokenHandler) } diff --git a/machine/action/action_server.go b/machine/action/action_server.go index f044962..f102677 100644 --- a/machine/action/action_server.go +++ b/machine/action/action_server.go @@ -3,6 +3,7 @@ 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" @@ -199,7 +200,7 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid Result: 0, TypeId: 2, }) - fmt.Println("没有抓到礼品!!!!!!!!snid = ", snid) + fmt.Println("没有抓到礼品!!!!!!!!snid = ", snid, "num = ", num) return } if bytes.Contains(part, instruction1) && num != 1 { @@ -216,7 +217,7 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid Result: 1, TypeId: 2, }) - fmt.Println("抓到礼品了!!!!!!!!snid = ", snid) + fmt.Println("抓到礼品了!!!!!!!!snid = ", snid, "num = ", num) return } //上分成功 @@ -267,9 +268,49 @@ func SMGameLinkSucceedHandler(session *netlib.Session, packetId int, data interf logger.Logger.Tracef("向游戏服务器发送娃娃机连接信息:%v", msg) return nil } + +// 获取进入视频房间token +func SMGetTokenHandler(session *netlib.Session, packetId int, data interface{}) error { + logger.Logger.Tracef("SMGetTokenHandler %v", data) + msg, ok := data.(*machine.SMGetToken) + if !ok { + return nil + } + // 请将 appId 修改为你的 appId,appid 为数字,从即构控制台获取 + // 举例:1234567890 + var appId uint32 = uint32(msg.GetAppId()) + + // 请修改为你的 serverSecret,serverSecret 为字符串,从即构控制台获取 + // 举例: "fa94dd0f974cf2e293728a526b028271" + serverSecret := msg.ServerSecret + + // 请将 userId 修改为用户的 user_id + userId := msg.GetSnid() + + // token 的有效时长,单位:秒 + var effectiveTimeInSeconds int64 = 3600 + // token业务认证扩展,基础鉴权token此处填空字符串 + var payload string = "" + + //生成token + token, err := token04.GenerateToken04(appId, string(userId), serverSecret, effectiveTimeInSeconds, payload) + if err != nil { + fmt.Println(err) + return err + } + fmt.Println(token) + info := &machine.MSSendToken{} + info.Snid = msg.Snid + info.Token = token + session.Send(int(machine.DollMachinePacketID_PACKET_MSSendToken), info) + logger.Logger.Tracef("向游戏服务器发送娃娃机连接信息:%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) } diff --git a/protocol/clawdoll/clawdoll.pb.go b/protocol/clawdoll/clawdoll.pb.go index 437be49..30f9f00 100644 --- a/protocol/clawdoll/clawdoll.pb.go +++ b/protocol/clawdoll/clawdoll.pb.go @@ -33,6 +33,8 @@ const ( CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_PlayerEnter CLAWDOLLPacketID = 5606 // 玩家进入 CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_PlayerLeave CLAWDOLLPacketID = 5607 // 玩家离开 CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_PLAYERINFO CLAWDOLLPacketID = 5608 // 玩家状态信息变化 + CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_GETTOKEN CLAWDOLLPacketID = 5609 // 获取token + CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_SENDTOKEN CLAWDOLLPacketID = 5610 // 获取token ) // Enum value maps for CLAWDOLLPacketID. @@ -47,6 +49,8 @@ var ( 5606: "PACKET_SC_CLAWDOLL_PlayerEnter", 5607: "PACKET_SC_CLAWDOLL_PlayerLeave", 5608: "PACKET_SC_CLAWDOLL_PLAYERINFO", + 5609: "PACKET_CS_CLAWDOLL_GETTOKEN", + 5610: "PACKET_SC_CLAWDOLL_SENDTOKEN", } CLAWDOLLPacketID_value = map[string]int32{ "PACKET_CLAWDOLL_ZERO": 0, @@ -58,6 +62,8 @@ var ( "PACKET_SC_CLAWDOLL_PlayerEnter": 5606, "PACKET_SC_CLAWDOLL_PlayerLeave": 5607, "PACKET_SC_CLAWDOLL_PLAYERINFO": 5608, + "PACKET_CS_CLAWDOLL_GETTOKEN": 5609, + "PACKET_SC_CLAWDOLL_SENDTOKEN": 5610, } ) @@ -806,6 +812,109 @@ func (x *SCCLAWDOLLPlayerLeave) GetPos() int32 { return 0 } +//玩家请求进入视频地址token +type CSCLAWDOLLGetToken struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Appid int64 `protobuf:"varint,1,opt,name=Appid,proto3" json:"Appid,omitempty"` + ServerSecret string `protobuf:"bytes,2,opt,name=serverSecret,proto3" json:"serverSecret,omitempty"` +} + +func (x *CSCLAWDOLLGetToken) Reset() { + *x = CSCLAWDOLLGetToken{} + if protoimpl.UnsafeEnabled { + mi := &file_clawdoll_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CSCLAWDOLLGetToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CSCLAWDOLLGetToken) ProtoMessage() {} + +func (x *CSCLAWDOLLGetToken) ProtoReflect() protoreflect.Message { + mi := &file_clawdoll_proto_msgTypes[9] + 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 CSCLAWDOLLGetToken.ProtoReflect.Descriptor instead. +func (*CSCLAWDOLLGetToken) Descriptor() ([]byte, []int) { + return file_clawdoll_proto_rawDescGZIP(), []int{9} +} + +func (x *CSCLAWDOLLGetToken) GetAppid() int64 { + if x != nil { + return x.Appid + } + return 0 +} + +func (x *CSCLAWDOLLGetToken) GetServerSecret() string { + if x != nil { + return x.ServerSecret + } + return "" +} + +type SCCLAWDOLLSendToken struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` +} + +func (x *SCCLAWDOLLSendToken) Reset() { + *x = SCCLAWDOLLSendToken{} + if protoimpl.UnsafeEnabled { + mi := &file_clawdoll_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCCLAWDOLLSendToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCCLAWDOLLSendToken) ProtoMessage() {} + +func (x *SCCLAWDOLLSendToken) ProtoReflect() protoreflect.Message { + mi := &file_clawdoll_proto_msgTypes[10] + 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 SCCLAWDOLLSendToken.ProtoReflect.Descriptor instead. +func (*SCCLAWDOLLSendToken) Descriptor() ([]byte, []int) { + return file_clawdoll_proto_rawDescGZIP(), []int{10} +} + +func (x *SCCLAWDOLLSendToken) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + var File_clawdoll_proto protoreflect.FileDescriptor var file_clawdoll_proto_rawDesc = []byte{ @@ -886,37 +995,49 @@ var file_clawdoll_proto_rawDesc = []byte{ 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x29, 0x0a, 0x15, 0x53, 0x43, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x2a, 0xc7, 0x02, 0x0a, 0x10, 0x43, 0x4c, 0x41, - 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x18, 0x0a, - 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, - 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, - 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x52, 0x4f, - 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe1, 0x2b, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, - 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, - 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe2, 0x2b, 0x12, 0x20, 0x0a, 0x1b, 0x50, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x22, 0x4e, 0x0a, 0x12, 0x43, 0x53, 0x43, 0x4c, + 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, + 0x0a, 0x05, 0x41, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x41, + 0x70, 0x70, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x2b, 0x0a, 0x13, 0x53, 0x43, 0x43, 0x4c, + 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2a, 0x8c, 0x03, 0x0a, 0x10, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, + 0x4c, 0x4c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x41, + 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x5a, 0x45, + 0x52, 0x4f, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, + 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x49, + 0x4e, 0x46, 0x4f, 0x10, 0xe1, 0x2b, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, + 0x5f, 0x43, 0x53, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x50, 0x4c, 0x41, + 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe2, 0x2b, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, + 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x50, + 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe3, 0x2b, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, + 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, + 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xe4, 0x2b, 0x12, 0x22, 0x0a, + 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, + 0x4f, 0x4c, 0x4c, 0x5f, 0x47, 0x41, 0x4d, 0x45, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xe5, + 0x2b, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, + 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, + 0x74, 0x65, 0x72, 0x10, 0xe6, 0x2b, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, + 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x10, 0xe7, 0x2b, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, - 0x4c, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe3, 0x2b, 0x12, 0x21, 0x0a, - 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, - 0x4f, 0x4c, 0x4c, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xe4, 0x2b, - 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, - 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x47, 0x41, 0x4d, 0x45, 0x42, 0x49, 0x4c, 0x4c, 0x45, - 0x44, 0x10, 0xe5, 0x2b, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, - 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10, 0xe6, 0x2b, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, - 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, - 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x10, 0xe7, 0x2b, 0x12, 0x22, - 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, 0x4c, 0x41, 0x57, - 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x49, 0x4e, 0x46, 0x4f, 0x10, - 0xe8, 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, + 0x4c, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe8, 0x2b, 0x12, + 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x43, 0x4c, 0x41, + 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x47, 0x45, 0x54, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0xe9, + 0x2b, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x43, + 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x5f, 0x53, 0x45, 0x4e, 0x44, 0x54, 0x4f, 0x4b, 0x45, + 0x4e, 0x10, 0xea, 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 ( @@ -932,7 +1053,7 @@ func file_clawdoll_proto_rawDescGZIP() []byte { } var file_clawdoll_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_clawdoll_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_clawdoll_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_clawdoll_proto_goTypes = []interface{}{ (CLAWDOLLPacketID)(0), // 0: clawdoll.CLAWDOLLPacketID (OpResultCode)(0), // 1: clawdoll.OpResultCode @@ -945,6 +1066,8 @@ var file_clawdoll_proto_goTypes = []interface{}{ (*SCCLAWDOLLPlayerInfo)(nil), // 8: clawdoll.SCCLAWDOLLPlayerInfo (*SCCLAWDOLLPlayerEnter)(nil), // 9: clawdoll.SCCLAWDOLLPlayerEnter (*SCCLAWDOLLPlayerLeave)(nil), // 10: clawdoll.SCCLAWDOLLPlayerLeave + (*CSCLAWDOLLGetToken)(nil), // 11: clawdoll.CSCLAWDOLLGetToken + (*SCCLAWDOLLSendToken)(nil), // 12: clawdoll.SCCLAWDOLLSendToken } var file_clawdoll_proto_depIdxs = []int32{ 2, // 0: clawdoll.SCCLAWDOLLRoomInfo.Players:type_name -> clawdoll.CLAWDOLLPlayerData @@ -1071,6 +1194,30 @@ func file_clawdoll_proto_init() { return nil } } + file_clawdoll_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CSCLAWDOLLGetToken); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_clawdoll_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCCLAWDOLLSendToken); 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{ @@ -1078,7 +1225,7 @@ func file_clawdoll_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_clawdoll_proto_rawDesc, NumEnums: 2, - NumMessages: 9, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/protocol/clawdoll/clawdoll.proto b/protocol/clawdoll/clawdoll.proto index 579ae56..a2d08c4 100644 --- a/protocol/clawdoll/clawdoll.proto +++ b/protocol/clawdoll/clawdoll.proto @@ -13,6 +13,8 @@ enum CLAWDOLLPacketID { PACKET_SC_CLAWDOLL_PlayerEnter = 5606; // 玩家进入 PACKET_SC_CLAWDOLL_PlayerLeave = 5607; // 玩家离开 PACKET_SC_CLAWDOLL_PLAYERINFO = 5608; // 玩家状态信息变化 + PACKET_CS_CLAWDOLL_GETTOKEN = 5609; // 获取token + PACKET_SC_CLAWDOLL_SENDTOKEN = 5610; // 获取token } //操作结果 @@ -102,4 +104,13 @@ message SCCLAWDOLLPlayerEnter { //PACKET_SCCLAWDOLLPlayerLeave message SCCLAWDOLLPlayerLeave { int32 Pos = 1; //玩家位置 +} +//玩家请求进入视频地址token +message CSCLAWDOLLGetToken { + int64 Appid = 1; + string serverSecret = 2; +} + +message SCCLAWDOLLSendToken { + string Token = 1; } \ No newline at end of file diff --git a/protocol/machine/machine.pb.go b/protocol/machine/machine.pb.go index 65ef2f3..1f7d7f4 100644 --- a/protocol/machine/machine.pb.go +++ b/protocol/machine/machine.pb.go @@ -31,6 +31,8 @@ const ( DollMachinePacketID_PACKET_MSDollMachineList DollMachinePacketID = 20003 DollMachinePacketID_PACKET_MSUpdateDollMachineStatus DollMachinePacketID = 20004 DollMachinePacketID_PACKET_MSDollMachineoPerateResult DollMachinePacketID = 20005 + DollMachinePacketID_PACKET_SMGetToken DollMachinePacketID = 20006 + DollMachinePacketID_PACKET_MSSendToken DollMachinePacketID = 20007 ) // Enum value maps for DollMachinePacketID. @@ -43,6 +45,8 @@ var ( 20003: "PACKET_MSDollMachineList", 20004: "PACKET_MSUpdateDollMachineStatus", 20005: "PACKET_MSDollMachineoPerateResult", + 20006: "PACKET_SMGetToken", + 20007: "PACKET_MSSendToken", } DollMachinePacketID_value = map[string]int32{ "PACKET_SMDollMachineZero": 0, @@ -52,6 +56,8 @@ var ( "PACKET_MSDollMachineList": 20003, "PACKET_MSUpdateDollMachineStatus": 20004, "PACKET_MSDollMachineoPerateResult": 20005, + "PACKET_SMGetToken": 20006, + "PACKET_MSSendToken": 20007, } ) @@ -490,6 +496,126 @@ 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"` +} + +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 "" +} + +//返回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"` + Token string `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,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) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + var File_machine_proto protoreflect.FileDescriptor var file_machine_proto_rawDesc = []byte{ @@ -527,26 +653,39 @@ 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, 0x2a, 0x86, 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, 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, 0x22, 0x5a, 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, 0x22, + 0x37, 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, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 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 ( @@ -562,7 +701,7 @@ func file_machine_proto_rawDescGZIP() []byte { } var file_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_machine_proto_goTypes = []interface{}{ (DollMachinePacketID)(0), // 0: machine.DollMachinePacketID (*SMGameLinkSucceed)(nil), // 1: machine.SMGameLinkSucceed @@ -572,6 +711,8 @@ 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 @@ -672,6 +813,30 @@ 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{ @@ -679,7 +844,7 @@ func file_machine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_machine_proto_rawDesc, NumEnums: 1, - NumMessages: 7, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/protocol/machine/machine.proto b/protocol/machine/machine.proto index 1e4933d..a5b5e5c 100644 --- a/protocol/machine/machine.proto +++ b/protocol/machine/machine.proto @@ -13,6 +13,8 @@ enum DollMachinePacketID { PACKET_MSDollMachineList = 20003; PACKET_MSUpdateDollMachineStatus = 20004; PACKET_MSDollMachineoPerateResult = 20005; + PACKET_SMGetToken = 20006; + PACKET_MSSendToken = 20007; } //通知链接成功 //PACKET_SMDollMachinePerate @@ -56,4 +58,15 @@ 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; +} +//返回token +message MSSendToken{ + int32 Snid = 1; + string Token = 2; } \ No newline at end of file