master
chendian 2 years ago
parent d44078eca5
commit 89ee79f259

@ -4,7 +4,7 @@ import (
"app/service/main/message/pb"
"app/service/main/msg_util"
"app/service/robot/user"
"core/network"
"network"
"sync"
)

@ -1,22 +1,19 @@
module app
go 1.22.1
go 1.20
require (
core v0.0.0-00010101000000-000000000000
github.com/panjf2000/ants/v2 v2.5.0
github.com/redis/go-redis/v9 v9.5.1
github.com/sirupsen/logrus v1.9.3
go.uber.org/atomic v1.9.0
google.golang.org/protobuf v1.33.0
)
require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/panjf2000/ants/v2 v2.5.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/testify v1.8.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect
)
replace core => ../core

@ -4,7 +4,7 @@ import (
"runtime"
"sync"
"core/container/safe/mpsc"
"app/container/safe/mpsc"
"go.uber.org/atomic"
)

@ -1,7 +1,7 @@
package network
import (
"core/tools"
"app/tools"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"

@ -8,7 +8,7 @@ import (
"time"
"unsafe"
"core/goroutine"
"app/goroutine"
)
func NewTcpClient(addr string, newCodec func() ICodec, newHanlder func() INetHandler, op ...func(*TcpClient) error) INetClient {

@ -5,8 +5,8 @@ import (
"sync"
"time"
"core/container/safe/mpsc"
"core/goroutine"
"app/container/safe/mpsc"
"app/goroutine"
"go.uber.org/atomic"
)

@ -4,10 +4,22 @@ option go_package = "pb/";
import "msgtype.proto";
message Ping
{
int64 ClientTime = 1; //
}
message Pong
{
int64 ServerTime = 1; //
int64 ClientTime = 2; //
}
message Login
{
string AppId = 1;
string Token = 2;
string AppId = 1;
string Token = 2;
bool IsDebug = 3;
}
message LoginResult

@ -17,6 +17,8 @@ enum MSG_TYPE
_GetRankResult = 10; //GetRankResult
_NotifyNewAudience = 11; //NotifyNewAudience
_NotifyAudienceAction = 12; //NotifyAudienceAction
_Ping = 21; //Ping
_Pong = 22; //Pong
}
enum ERROR_CODE

@ -1,8 +1,8 @@
@ echo off
cd ./protoc/bin
set protoPath="../../"
set clientPath="../../Proto"
set serverPath="../../../src/app/message"
set clientPath="D:/sumo_art/douyin_prj/Assets/Script/GameLogic/Proto"
set serverPath="D:/dy_server/src/app/service/main/message"
protoc.exe -I=%protoPath% --csharp_out=%clientPath% --go_out=%serverPath% %protoPath%/*.proto
clang-format.exe -i -style="{AlignConsecutiveAssignments: true,AlignConsecutiveDeclarations: true,AllowShortFunctionsOnASingleLine: None,BreakBeforeBraces: GNU,ColumnLimit: 0,IndentWidth: 4,Language: Proto}" %protoPath%/*.proto
pause

@ -1,11 +1,11 @@
package game_mgr
import (
"app/douyin"
"app/network"
"app/service/main/message/pb"
"app/service/main/msg_util"
"app/service/main/user"
"core/douyin"
"core/network"
)
var APP_TOKEN_MAP = map[string]string{
@ -30,7 +30,7 @@ func (s *GameMgr) Run() error {
//}
listener := network.NewTcpListener(
":8888",
":8899",
s.newParser,
s.newHandler)

@ -22,19 +22,155 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Ping struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ClientTime int64 `protobuf:"varint,1,opt,name=ClientTime,json=clientTime,proto3" json:"ClientTime,omitempty"` //客户端时间戳
}
func (x *Ping) Reset() {
*x = Ping{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Ping) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (x *Ping) FromDB(data []byte) error {
return proto.Unmarshal(data, x)
}
func (x *Ping) ToDB() ([]byte, error) {
return proto.Marshal(x)
}
func (*Ping) ProtoMessage() {}
func (x *Ping) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[0]
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 Ping.ProtoReflect.Descriptor instead.
func (*Ping) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{0}
}
func (x *Ping) GetClientTime() int64 {
if x != nil {
return x.ClientTime
}
return 0
}
func (x *Ping) SetClientTime(val int64) {
if x != nil {
x.ClientTime = val
}
}
type Pong struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ServerTime int64 `protobuf:"varint,1,opt,name=ServerTime,json=serverTime,proto3" json:"ServerTime,omitempty"` //服务器本地时间戳
ClientTime int64 `protobuf:"varint,2,opt,name=ClientTime,json=clientTime,proto3" json:"ClientTime,omitempty"` //客户端时间戳
}
func (x *Pong) Reset() {
*x = Pong{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Pong) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (x *Pong) FromDB(data []byte) error {
return proto.Unmarshal(data, x)
}
func (x *Pong) ToDB() ([]byte, error) {
return proto.Marshal(x)
}
func (*Pong) ProtoMessage() {}
func (x *Pong) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[1]
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 Pong.ProtoReflect.Descriptor instead.
func (*Pong) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{1}
}
func (x *Pong) GetServerTime() int64 {
if x != nil {
return x.ServerTime
}
return 0
}
func (x *Pong) GetClientTime() int64 {
if x != nil {
return x.ClientTime
}
return 0
}
func (x *Pong) SetServerTime(val int64) {
if x != nil {
x.ServerTime = val
}
}
func (x *Pong) SetClientTime(val int64) {
if x != nil {
x.ClientTime = val
}
}
type Login struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AppId string `protobuf:"bytes,1,opt,name=AppId,json=appId,proto3" json:"AppId,omitempty"`
Token string `protobuf:"bytes,2,opt,name=Token,json=token,proto3" json:"Token,omitempty"`
AppId string `protobuf:"bytes,1,opt,name=AppId,json=appId,proto3" json:"AppId,omitempty"`
Token string `protobuf:"bytes,2,opt,name=Token,json=token,proto3" json:"Token,omitempty"`
IsDebug bool `protobuf:"varint,3,opt,name=IsDebug,json=isDebug,proto3" json:"IsDebug,omitempty"`
}
func (x *Login) Reset() {
*x = Login{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[0]
mi := &file_common_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -55,7 +191,7 @@ func (x *Login) ToDB() ([]byte, error) {
func (*Login) ProtoMessage() {}
func (x *Login) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[0]
mi := &file_common_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -68,7 +204,7 @@ func (x *Login) ProtoReflect() protoreflect.Message {
// Deprecated: Use Login.ProtoReflect.Descriptor instead.
func (*Login) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{0}
return file_common_proto_rawDescGZIP(), []int{2}
}
func (x *Login) GetAppId() string {
@ -85,6 +221,13 @@ func (x *Login) GetToken() string {
return ""
}
func (x *Login) GetIsDebug() bool {
if x != nil {
return x.IsDebug
}
return false
}
func (x *Login) SetAppId(val string) {
if x != nil {
x.AppId = val
@ -95,6 +238,11 @@ func (x *Login) SetToken(val string) {
x.Token = val
}
}
func (x *Login) SetIsDebug(val bool) {
if x != nil {
x.IsDebug = val
}
}
type LoginResult struct {
state protoimpl.MessageState
@ -110,7 +258,7 @@ type LoginResult struct {
func (x *LoginResult) Reset() {
*x = LoginResult{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[1]
mi := &file_common_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -131,7 +279,7 @@ func (x *LoginResult) ToDB() ([]byte, error) {
func (*LoginResult) ProtoMessage() {}
func (x *LoginResult) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[1]
mi := &file_common_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -144,7 +292,7 @@ func (x *LoginResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use LoginResult.ProtoReflect.Descriptor instead.
func (*LoginResult) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{1}
return file_common_proto_rawDescGZIP(), []int{3}
}
func (x *LoginResult) GetResult() ERROR_CODE {
@ -205,7 +353,7 @@ type PlayStart struct {
func (x *PlayStart) Reset() {
*x = PlayStart{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[2]
mi := &file_common_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -226,7 +374,7 @@ func (x *PlayStart) ToDB() ([]byte, error) {
func (*PlayStart) ProtoMessage() {}
func (x *PlayStart) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[2]
mi := &file_common_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -239,7 +387,7 @@ func (x *PlayStart) ProtoReflect() protoreflect.Message {
// Deprecated: Use PlayStart.ProtoReflect.Descriptor instead.
func (*PlayStart) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{2}
return file_common_proto_rawDescGZIP(), []int{4}
}
type PlayStartResult struct {
@ -253,7 +401,7 @@ type PlayStartResult struct {
func (x *PlayStartResult) Reset() {
*x = PlayStartResult{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[3]
mi := &file_common_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -274,7 +422,7 @@ func (x *PlayStartResult) ToDB() ([]byte, error) {
func (*PlayStartResult) ProtoMessage() {}
func (x *PlayStartResult) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[3]
mi := &file_common_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -287,7 +435,7 @@ func (x *PlayStartResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use PlayStartResult.ProtoReflect.Descriptor instead.
func (*PlayStartResult) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{3}
return file_common_proto_rawDescGZIP(), []int{5}
}
func (x *PlayStartResult) GetResult() ERROR_CODE {
@ -312,7 +460,7 @@ type PlayEnd struct {
func (x *PlayEnd) Reset() {
*x = PlayEnd{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[4]
mi := &file_common_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -333,7 +481,7 @@ func (x *PlayEnd) ToDB() ([]byte, error) {
func (*PlayEnd) ProtoMessage() {}
func (x *PlayEnd) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[4]
mi := &file_common_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -346,7 +494,7 @@ func (x *PlayEnd) ProtoReflect() protoreflect.Message {
// Deprecated: Use PlayEnd.ProtoReflect.Descriptor instead.
func (*PlayEnd) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{4}
return file_common_proto_rawDescGZIP(), []int{6}
}
type PlayEndResult struct {
@ -360,7 +508,7 @@ type PlayEndResult struct {
func (x *PlayEndResult) Reset() {
*x = PlayEndResult{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[5]
mi := &file_common_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -381,7 +529,7 @@ func (x *PlayEndResult) ToDB() ([]byte, error) {
func (*PlayEndResult) ProtoMessage() {}
func (x *PlayEndResult) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[5]
mi := &file_common_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -394,7 +542,7 @@ func (x *PlayEndResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use PlayEndResult.ProtoReflect.Descriptor instead.
func (*PlayEndResult) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{5}
return file_common_proto_rawDescGZIP(), []int{7}
}
func (x *PlayEndResult) GetResult() ERROR_CODE {
@ -421,7 +569,7 @@ type Report struct {
func (x *Report) Reset() {
*x = Report{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[6]
mi := &file_common_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -442,7 +590,7 @@ func (x *Report) ToDB() ([]byte, error) {
func (*Report) ProtoMessage() {}
func (x *Report) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[6]
mi := &file_common_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -455,7 +603,7 @@ func (x *Report) ProtoReflect() protoreflect.Message {
// Deprecated: Use Report.ProtoReflect.Descriptor instead.
func (*Report) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{6}
return file_common_proto_rawDescGZIP(), []int{8}
}
func (x *Report) GetInfo() []*ReportInfo {
@ -482,7 +630,7 @@ type ReportResult struct {
func (x *ReportResult) Reset() {
*x = ReportResult{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[7]
mi := &file_common_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -503,7 +651,7 @@ func (x *ReportResult) ToDB() ([]byte, error) {
func (*ReportResult) ProtoMessage() {}
func (x *ReportResult) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[7]
mi := &file_common_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -516,7 +664,7 @@ func (x *ReportResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use ReportResult.ProtoReflect.Descriptor instead.
func (*ReportResult) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{7}
return file_common_proto_rawDescGZIP(), []int{9}
}
func (x *ReportResult) GetResult() ERROR_CODE {
@ -543,7 +691,7 @@ type GetRank struct {
func (x *GetRank) Reset() {
*x = GetRank{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[8]
mi := &file_common_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -564,7 +712,7 @@ func (x *GetRank) ToDB() ([]byte, error) {
func (*GetRank) ProtoMessage() {}
func (x *GetRank) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[8]
mi := &file_common_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -577,7 +725,7 @@ func (x *GetRank) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetRank.ProtoReflect.Descriptor instead.
func (*GetRank) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{8}
return file_common_proto_rawDescGZIP(), []int{10}
}
func (x *GetRank) GetTopCount() int32 {
@ -605,7 +753,7 @@ type GetRankResult struct {
func (x *GetRankResult) Reset() {
*x = GetRankResult{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[9]
mi := &file_common_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -626,7 +774,7 @@ func (x *GetRankResult) ToDB() ([]byte, error) {
func (*GetRankResult) ProtoMessage() {}
func (x *GetRankResult) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[9]
mi := &file_common_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -639,7 +787,7 @@ func (x *GetRankResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetRankResult.ProtoReflect.Descriptor instead.
func (*GetRankResult) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{9}
return file_common_proto_rawDescGZIP(), []int{11}
}
func (x *GetRankResult) GetResult() ERROR_CODE {
@ -679,7 +827,7 @@ type NotifyNewAudience struct {
func (x *NotifyNewAudience) Reset() {
*x = NotifyNewAudience{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[10]
mi := &file_common_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -700,7 +848,7 @@ func (x *NotifyNewAudience) ToDB() ([]byte, error) {
func (*NotifyNewAudience) ProtoMessage() {}
func (x *NotifyNewAudience) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[10]
mi := &file_common_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -713,7 +861,7 @@ func (x *NotifyNewAudience) ProtoReflect() protoreflect.Message {
// Deprecated: Use NotifyNewAudience.ProtoReflect.Descriptor instead.
func (*NotifyNewAudience) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{10}
return file_common_proto_rawDescGZIP(), []int{12}
}
func (x *NotifyNewAudience) GetAudience() *Audience {
@ -745,7 +893,7 @@ type NotifyAudienceAction struct {
func (x *NotifyAudienceAction) Reset() {
*x = NotifyAudienceAction{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[11]
mi := &file_common_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -766,7 +914,7 @@ func (x *NotifyAudienceAction) ToDB() ([]byte, error) {
func (*NotifyAudienceAction) ProtoMessage() {}
func (x *NotifyAudienceAction) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[11]
mi := &file_common_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -779,7 +927,7 @@ func (x *NotifyAudienceAction) ProtoReflect() protoreflect.Message {
// Deprecated: Use NotifyAudienceAction.ProtoReflect.Descriptor instead.
func (*NotifyAudienceAction) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{11}
return file_common_proto_rawDescGZIP(), []int{13}
}
func (x *NotifyAudienceAction) GetOpenId() string {
@ -856,7 +1004,7 @@ type ReportInfo struct {
func (x *ReportInfo) Reset() {
*x = ReportInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[12]
mi := &file_common_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -877,7 +1025,7 @@ func (x *ReportInfo) ToDB() ([]byte, error) {
func (*ReportInfo) ProtoMessage() {}
func (x *ReportInfo) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[12]
mi := &file_common_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -890,7 +1038,7 @@ func (x *ReportInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use ReportInfo.ProtoReflect.Descriptor instead.
func (*ReportInfo) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{12}
return file_common_proto_rawDescGZIP(), []int{14}
}
func (x *ReportInfo) GetOpenId() string {
@ -932,7 +1080,7 @@ type Audience struct {
func (x *Audience) Reset() {
*x = Audience{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[13]
mi := &file_common_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -953,7 +1101,7 @@ func (x *Audience) ToDB() ([]byte, error) {
func (*Audience) ProtoMessage() {}
func (x *Audience) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[13]
mi := &file_common_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -966,7 +1114,7 @@ func (x *Audience) ProtoReflect() protoreflect.Message {
// Deprecated: Use Audience.ProtoReflect.Descriptor instead.
func (*Audience) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{13}
return file_common_proto_rawDescGZIP(), []int{15}
}
func (x *Audience) GetOpenId() string {
@ -1020,7 +1168,7 @@ type RankInfo struct {
func (x *RankInfo) Reset() {
*x = RankInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[14]
mi := &file_common_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1041,7 +1189,7 @@ func (x *RankInfo) ToDB() ([]byte, error) {
func (*RankInfo) ProtoMessage() {}
func (x *RankInfo) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[14]
mi := &file_common_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1054,7 +1202,7 @@ func (x *RankInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use RankInfo.ProtoReflect.Descriptor instead.
func (*RankInfo) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{14}
return file_common_proto_rawDescGZIP(), []int{16}
}
func (x *RankInfo) GetAudience() *Audience {
@ -1099,74 +1247,83 @@ var File_common_proto protoreflect.FileDescriptor
var file_common_proto_rawDesc = []byte{
0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0d, 0x6d, 0x73, 0x67, 0x74, 0x79, 0x70, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x26, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1e,
0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x46,
0x0a, 0x04, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x4d, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12,
0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x80, 0x01, 0x0a, 0x0b,
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45,
0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d,
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64,
0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75,
0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x0b,
0x0a, 0x09, 0x50, 0x6c, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x22, 0x3e, 0x0a, 0x0f, 0x50,
0x6c, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b,
0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13,
0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43,
0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x09, 0x0a, 0x07, 0x50,
0x6c, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x22, 0x3c, 0x0a, 0x0d, 0x50, 0x6c, 0x61, 0x79, 0x45, 0x6e,
0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x22, 0x31, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x27,
0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66,
0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x3b, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72,
0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x22, 0x25, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x12,
0x1a, 0x0a, 0x08, 0x54, 0x6f, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x08, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x65, 0x0a, 0x0d, 0x47,
0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44,
0x45, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x04, 0x49, 0x6e, 0x66,
0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e,
0x66, 0x6f, 0x22, 0x42, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4e, 0x65, 0x77, 0x41,
0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x65,
0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x61, 0x75,
0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x14, 0x4e, 0x6f, 0x74, 0x69, 0x66,
0x79, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x49,
0x73, 0x44, 0x65, 0x62, 0x75, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73,
0x44, 0x65, 0x62, 0x75, 0x67, 0x22, 0x80, 0x01, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e,
0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49,
0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08,
0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x0b, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x79,
0x53, 0x74, 0x61, 0x72, 0x74, 0x22, 0x3e, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x79, 0x53, 0x74, 0x61,
0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x09, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x45, 0x6e, 0x64,
0x22, 0x3c, 0x0a, 0x0d, 0x50, 0x6c, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f,
0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x31,
0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x27, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66,
0x6f, 0x22, 0x3b, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f,
0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x25,
0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x6f, 0x70,
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x6f, 0x70,
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x65, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6f,
0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x42, 0x0a, 0x11,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4e, 0x65, 0x77, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63,
0x65, 0x12, 0x2d, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x75,
0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65,
0x22, 0x94, 0x01, 0x0a, 0x14, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x41, 0x75, 0x64, 0x69, 0x65,
0x6e, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x65,
0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49,
0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x4c,
0x69, 0x6b, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x69,
0x6b, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a,
0x07, 0x47, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x67, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x22, 0x3a, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72,
0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a,
0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63,
0x6f, 0x72, 0x65, 0x22, 0x5c, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12,
0x16, 0x0a, 0x06, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x12, 0x18, 0x0a, 0x07, 0x4c, 0x69, 0x6b, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x6c, 0x69, 0x6b, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x47,
0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x66,
0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x05,
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x22, 0x3a, 0x0a,
0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x4f,
0x70, 0x65, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65,
0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x5c, 0x0a, 0x08, 0x41, 0x75, 0x64,
0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a,
0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x76, 0x61,
0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76,
0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x22, 0x63, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x2d, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e,
0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e,
0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x42, 0x05, 0x5a, 0x03,
0x70, 0x62, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e,
0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72,
0x6c, 0x22, 0x63, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2d, 0x0a,
0x08, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e,
0x63, 0x65, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x52, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b,
0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x42, 0x05, 0x5a, 0x03, 0x70, 0x62, 0x2f, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1181,35 +1338,37 @@ func file_common_proto_rawDescGZIP() []byte {
return file_common_proto_rawDescData
}
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
var file_common_proto_goTypes = []interface{}{
(*Login)(nil), // 0: message.Login
(*LoginResult)(nil), // 1: message.LoginResult
(*PlayStart)(nil), // 2: message.PlayStart
(*PlayStartResult)(nil), // 3: message.PlayStartResult
(*PlayEnd)(nil), // 4: message.PlayEnd
(*PlayEndResult)(nil), // 5: message.PlayEndResult
(*Report)(nil), // 6: message.Report
(*ReportResult)(nil), // 7: message.ReportResult
(*GetRank)(nil), // 8: message.GetRank
(*GetRankResult)(nil), // 9: message.GetRankResult
(*NotifyNewAudience)(nil), // 10: message.NotifyNewAudience
(*NotifyAudienceAction)(nil), // 11: message.NotifyAudienceAction
(*ReportInfo)(nil), // 12: message.ReportInfo
(*Audience)(nil), // 13: message.Audience
(*RankInfo)(nil), // 14: message.RankInfo
(ERROR_CODE)(0), // 15: message.ERROR_CODE
(*Ping)(nil), // 0: message.Ping
(*Pong)(nil), // 1: message.Pong
(*Login)(nil), // 2: message.Login
(*LoginResult)(nil), // 3: message.LoginResult
(*PlayStart)(nil), // 4: message.PlayStart
(*PlayStartResult)(nil), // 5: message.PlayStartResult
(*PlayEnd)(nil), // 6: message.PlayEnd
(*PlayEndResult)(nil), // 7: message.PlayEndResult
(*Report)(nil), // 8: message.Report
(*ReportResult)(nil), // 9: message.ReportResult
(*GetRank)(nil), // 10: message.GetRank
(*GetRankResult)(nil), // 11: message.GetRankResult
(*NotifyNewAudience)(nil), // 12: message.NotifyNewAudience
(*NotifyAudienceAction)(nil), // 13: message.NotifyAudienceAction
(*ReportInfo)(nil), // 14: message.ReportInfo
(*Audience)(nil), // 15: message.Audience
(*RankInfo)(nil), // 16: message.RankInfo
(ERROR_CODE)(0), // 17: message.ERROR_CODE
}
var file_common_proto_depIdxs = []int32{
15, // 0: message.LoginResult.Result:type_name -> message.ERROR_CODE
15, // 1: message.PlayStartResult.Result:type_name -> message.ERROR_CODE
15, // 2: message.PlayEndResult.Result:type_name -> message.ERROR_CODE
12, // 3: message.Report.Info:type_name -> message.ReportInfo
15, // 4: message.ReportResult.Result:type_name -> message.ERROR_CODE
15, // 5: message.GetRankResult.Result:type_name -> message.ERROR_CODE
12, // 6: message.GetRankResult.Info:type_name -> message.ReportInfo
13, // 7: message.NotifyNewAudience.Audience:type_name -> message.Audience
13, // 8: message.RankInfo.Audience:type_name -> message.Audience
17, // 0: message.LoginResult.Result:type_name -> message.ERROR_CODE
17, // 1: message.PlayStartResult.Result:type_name -> message.ERROR_CODE
17, // 2: message.PlayEndResult.Result:type_name -> message.ERROR_CODE
14, // 3: message.Report.Info:type_name -> message.ReportInfo
17, // 4: message.ReportResult.Result:type_name -> message.ERROR_CODE
17, // 5: message.GetRankResult.Result:type_name -> message.ERROR_CODE
14, // 6: message.GetRankResult.Info:type_name -> message.ReportInfo
15, // 7: message.NotifyNewAudience.Audience:type_name -> message.Audience
15, // 8: message.RankInfo.Audience:type_name -> message.Audience
9, // [9:9] is the sub-list for method output_type
9, // [9:9] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
@ -1225,7 +1384,7 @@ func file_common_proto_init() {
file_msgtype_proto_init()
if !protoimpl.UnsafeEnabled {
file_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Login); i {
switch v := v.(*Ping); i {
case 0:
return &v.state
case 1:
@ -1237,7 +1396,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LoginResult); i {
switch v := v.(*Pong); i {
case 0:
return &v.state
case 1:
@ -1249,7 +1408,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlayStart); i {
switch v := v.(*Login); i {
case 0:
return &v.state
case 1:
@ -1261,7 +1420,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlayStartResult); i {
switch v := v.(*LoginResult); i {
case 0:
return &v.state
case 1:
@ -1273,7 +1432,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlayEnd); i {
switch v := v.(*PlayStart); i {
case 0:
return &v.state
case 1:
@ -1285,7 +1444,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlayEndResult); i {
switch v := v.(*PlayStartResult); i {
case 0:
return &v.state
case 1:
@ -1297,7 +1456,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Report); i {
switch v := v.(*PlayEnd); i {
case 0:
return &v.state
case 1:
@ -1309,7 +1468,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ReportResult); i {
switch v := v.(*PlayEndResult); i {
case 0:
return &v.state
case 1:
@ -1321,7 +1480,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetRank); i {
switch v := v.(*Report); i {
case 0:
return &v.state
case 1:
@ -1333,7 +1492,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetRankResult); i {
switch v := v.(*ReportResult); i {
case 0:
return &v.state
case 1:
@ -1345,7 +1504,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NotifyNewAudience); i {
switch v := v.(*GetRank); i {
case 0:
return &v.state
case 1:
@ -1357,7 +1516,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NotifyAudienceAction); i {
switch v := v.(*GetRankResult); i {
case 0:
return &v.state
case 1:
@ -1369,7 +1528,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ReportInfo); i {
switch v := v.(*NotifyNewAudience); i {
case 0:
return &v.state
case 1:
@ -1381,7 +1540,7 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Audience); i {
switch v := v.(*NotifyAudienceAction); i {
case 0:
return &v.state
case 1:
@ -1393,6 +1552,30 @@ func file_common_proto_init() {
}
}
file_common_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ReportInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Audience); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RankInfo); i {
case 0:
return &v.state
@ -1411,7 +1594,7 @@ func file_common_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_common_proto_rawDesc,
NumEnums: 0,
NumMessages: 15,
NumMessages: 17,
NumExtensions: 0,
NumServices: 0,
},

@ -38,6 +38,8 @@ const (
MSG_TYPE__GetRankResult MSG_TYPE = 10 //GetRankResult
MSG_TYPE__NotifyNewAudience MSG_TYPE = 11 //NotifyNewAudience
MSG_TYPE__NotifyAudienceAction MSG_TYPE = 12 //NotifyAudienceAction
MSG_TYPE__Ping MSG_TYPE = 21 //Ping
MSG_TYPE__Pong MSG_TYPE = 22 //Pong
)
// Enum value maps for MSG_TYPE.
@ -56,6 +58,8 @@ var (
10: "_GetRankResult",
11: "_NotifyNewAudience",
12: "_NotifyAudienceAction",
21: "_Ping",
22: "_Pong",
}
MSG_TYPE_value = map[string]int32{
"_ERROR": 0,
@ -71,6 +75,8 @@ var (
"_GetRankResult": 10,
"_NotifyNewAudience": 11,
"_NotifyAudienceAction": 12,
"_Ping": 21,
"_Pong": 22,
}
)
@ -210,7 +216,7 @@ var File_msgtype_proto protoreflect.FileDescriptor
var file_msgtype_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f,
0x72, 0x2a, 0xf1, 0x01, 0x0a, 0x08, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x12, 0x0a,
0x72, 0x2a, 0x87, 0x02, 0x0a, 0x08, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x12, 0x0a,
0x0a, 0x06, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x5f, 0x4c,
0x6f, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x5f, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x5f, 0x50, 0x6c, 0x61,
@ -225,15 +231,16 @@ var file_msgtype_proto_rawDesc = []byte{
0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x5f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4e, 0x65, 0x77,
0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x10, 0x0b, 0x12, 0x19, 0x0a, 0x15, 0x5f, 0x4e,
0x6f, 0x74, 0x69, 0x66, 0x79, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x41, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x10, 0x0c, 0x2a, 0x73, 0x0a, 0x0a, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43,
0x4f, 0x44, 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00,
0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4e,
0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x50, 0x50, 0x49, 0x44, 0x10, 0x02, 0x12, 0x11, 0x0a,
0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x03,
0x12, 0x13, 0x0a, 0x0f, 0x47, 0x41, 0x4d, 0x45, 0x5f, 0x49, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x4e,
0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x41, 0x4d, 0x45, 0x5f, 0x49, 0x53,
0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x05, 0x42, 0x05, 0x5a, 0x03, 0x70, 0x62,
0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x6f, 0x6e, 0x10, 0x0c, 0x12, 0x09, 0x0a, 0x05, 0x5f, 0x50, 0x69, 0x6e, 0x67, 0x10, 0x15,
0x12, 0x09, 0x0a, 0x05, 0x5f, 0x50, 0x6f, 0x6e, 0x67, 0x10, 0x16, 0x2a, 0x73, 0x0a, 0x0a, 0x45,
0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43,
0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x01,
0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x50, 0x50, 0x49,
0x44, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x54,
0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x41, 0x4d, 0x45, 0x5f, 0x49,
0x53, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x47,
0x41, 0x4d, 0x45, 0x5f, 0x49, 0x53, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x05,
0x42, 0x05, 0x5a, 0x03, 0x70, 0x62, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

@ -2,11 +2,12 @@ package msg_util
import (
"bytes"
"core/network"
"core/tools"
"encoding/binary"
"errors"
"google.golang.org/protobuf/proto"
"app/network"
"app/tools"
)
func NewProtoCodec(parser *ProtoParser, maxDecode int, isRaw bool) *ProtoCodec {

@ -1,13 +1,12 @@
package msg_util
import (
"core/tools"
"app/tools"
"fmt"
"strings"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
"strings"
)
type ProtoParser struct {

@ -1,10 +1,12 @@
package user
import (
"app/network"
"app/service/main/in_obj"
"app/service/main/message/pb"
"app/service/main/redis"
"core/network"
"fmt"
"time"
)
func NewUser(mgr in_obj.IGameMgr) *User {
@ -16,6 +18,7 @@ type User struct {
mgr in_obj.IGameMgr
appId string
roomId string
isDebug bool
isRunning bool
audienceSet map[int32]bool
msgChan chan func()
@ -48,6 +51,14 @@ func (s *User) OnSessionClosed() {
}
func (s *User) OnRecv(msgId int32, data interface{}) {
if msgId == int32(pb.MSG_TYPE__Ping) {
s.SendMsg(&pb.Pong{
ServerTime: time.Now().Unix(),
ClientTime: data.(*pb.Ping).ClientTime,
})
return
}
s.Log("Recv", data)
s.msgChan <- func() {
switch msgId {
case int32(pb.MSG_TYPE__Login):
@ -64,11 +75,29 @@ func (s *User) OnRecv(msgId int32, data interface{}) {
}
}
func (s *User) SendUserMsg(msg interface{}) {
s.Log("Send", msg)
s.SendMsg(msg)
}
func (s *User) Log(logType string, msg interface{}) {
fmt.Printf("[%s](%s)%v\n", logType, network.MsgName(msg), msg)
}
func (s *User) OnLogin(msg *pb.Login) {
roomId, uid, nickName, result := s.mgr.Login(msg.AppId, msg.Token)
var (
roomId string
uid string
nickName string
result pb.ERROR_CODE
)
if !msg.IsDebug {
roomId, uid, nickName, result = s.mgr.Login(msg.AppId, msg.Token)
} else {
roomId, uid, nickName, result = "debug", "debug", "debug", pb.ERROR_CODE_SUCCESS
}
s.appId = msg.AppId
s.roomId = roomId
s.SendMsg(&pb.LoginResult{
s.isDebug = msg.IsDebug
s.SendUserMsg(&pb.LoginResult{
Result: result,
RoomId: roomId,
UID: uid,
@ -77,19 +106,25 @@ func (s *User) OnLogin(msg *pb.Login) {
}
func (s *User) OnPlayStart(msg *pb.PlayStart) {
if s.isRunning {
s.SendMsg(&pb.PlayStartResult{Result: pb.ERROR_CODE_GAME_IS_RUNNING})
s.SendUserMsg(&pb.PlayStartResult{Result: pb.ERROR_CODE_GAME_IS_RUNNING})
return
}
s.setPushActive(true)
s.SendMsg(&pb.PlayStartResult{Result: pb.ERROR_CODE_SUCCESS})
s.isRunning = true
if !s.isDebug {
s.setPushActive(true)
}
s.SendUserMsg(&pb.PlayStartResult{Result: pb.ERROR_CODE_SUCCESS})
}
func (s *User) OnPlayEnd(msg *pb.PlayEnd) {
if !s.isRunning {
s.SendMsg(&pb.PlayEndResult{Result: pb.ERROR_CODE_GAME_IS_STOPPED})
s.SendUserMsg(&pb.PlayEndResult{Result: pb.ERROR_CODE_GAME_IS_STOPPED})
return
}
s.setPushActive(false)
s.SendMsg(&pb.PlayEndResult{Result: pb.ERROR_CODE_SUCCESS})
s.isRunning = false
if !s.isDebug {
s.setPushActive(false)
}
s.SendUserMsg(&pb.PlayEndResult{Result: pb.ERROR_CODE_SUCCESS})
}
func (s *User) OnReport(msg *pb.Report) {
scoreMap := map[string]int32{}
@ -98,15 +133,15 @@ func (s *User) OnReport(msg *pb.Report) {
}
err := redis.AddScore(s.appId, scoreMap)
if err != nil {
s.SendMsg(&pb.ReportResult{Result: pb.ERROR_CODE_FAIL})
s.SendUserMsg(&pb.ReportResult{Result: pb.ERROR_CODE_FAIL})
return
}
s.SendMsg(&pb.ReportResult{Result: pb.ERROR_CODE_SUCCESS})
s.SendUserMsg(&pb.ReportResult{Result: pb.ERROR_CODE_SUCCESS})
}
func (s *User) OnGetRank(msg *pb.GetRank) {
rankList, err := redis.GetRank(s.appId, msg.TopCount)
if err != nil {
s.SendMsg(&pb.GetRankResult{Result: pb.ERROR_CODE_FAIL})
s.SendUserMsg(&pb.GetRankResult{Result: pb.ERROR_CODE_FAIL})
return
}
var ret []*pb.ReportInfo
@ -116,11 +151,10 @@ func (s *User) OnGetRank(msg *pb.GetRank) {
Score: info.Score,
})
}
s.SendMsg(&pb.GetRankResult{Result: pb.ERROR_CODE_SUCCESS, Info: ret})
s.SendUserMsg(&pb.GetRankResult{Result: pb.ERROR_CODE_SUCCESS, Info: ret})
}
func (s *User) setPushActive(isActive bool) {
s.isRunning = isActive
if isActive {
s.mgr.StartTask(s.appId, s.roomId, "1")
s.mgr.StartTask(s.appId, s.roomId, "2")

@ -1,7 +1,7 @@
package user
import (
"core/network"
"network"
)
func NewUser() *User {

@ -1,14 +0,0 @@
module core
go 1.22.1
require (
github.com/bwmarrin/snowflake v0.3.0
github.com/google/uuid v1.3.0
github.com/panjf2000/ants/v2 v2.5.0
github.com/sirupsen/logrus v1.9.3
go.uber.org/atomic v1.9.0
google.golang.org/protobuf v1.33.0
)
require golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect

@ -1,32 +0,0 @@
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/panjf2000/ants/v2 v2.5.0 h1:1rWGWSnxCsQBga+nQbA4/iY6VMeNoOIAM0ZWh9u3q2Q=
github.com/panjf2000/ants/v2 v2.5.0/go.mod h1:cU93usDlihJZ5CfRGNDYsiBYvoilLvBF5Qp/BT2GNRE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading…
Cancel
Save