You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
1.6 KiB
Protocol Buffer
112 lines
1.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
package message;
|
|
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;
|
|
bool IsDebug = 3;
|
|
}
|
|
|
|
message LoginResult
|
|
{
|
|
ERROR_CODE Result = 1;
|
|
string RoomId = 2;
|
|
string UID = 3;
|
|
string NickName = 4;
|
|
}
|
|
|
|
message PlayStart
|
|
{
|
|
}
|
|
|
|
message PlayStartResult
|
|
{
|
|
ERROR_CODE Result = 1;
|
|
}
|
|
|
|
message PlayEnd
|
|
{
|
|
}
|
|
|
|
message PlayEndResult
|
|
{
|
|
ERROR_CODE Result = 1;
|
|
}
|
|
|
|
message Report
|
|
{
|
|
repeated ReportInfo Info = 1;
|
|
}
|
|
|
|
message ReportResult
|
|
{
|
|
ERROR_CODE Result = 1;
|
|
}
|
|
|
|
message GetRank
|
|
{
|
|
int32 TopCount = 1;
|
|
}
|
|
|
|
message GetRankResult
|
|
{
|
|
ERROR_CODE Result = 1;
|
|
repeated ReportInfo Info = 2;
|
|
}
|
|
|
|
//新用户推送
|
|
message NotifyNewAudience
|
|
{
|
|
Audience Audience = 1;
|
|
}
|
|
//用户行为推送
|
|
message NotifyAudienceAction
|
|
{
|
|
string OpenId = 1;
|
|
string Content = 2; //评论
|
|
int32 LikeNum = 3; //点赞数量
|
|
string GiftId = 4; //礼物ID
|
|
int32 GiftNum = 5; //礼物数量
|
|
}
|
|
|
|
//============结构============
|
|
|
|
//分数信息
|
|
message ReportInfo
|
|
{
|
|
string OpenId = 1;
|
|
int32 Score = 2;
|
|
}
|
|
|
|
//观众信息
|
|
message Audience
|
|
{
|
|
string OpenId = 1;
|
|
string NickName = 2;
|
|
string AvatarUrl = 3;
|
|
int32 Rank = 4; //排名
|
|
int32 WinningStreak = 5; //连胜
|
|
}
|
|
|
|
//排名信息
|
|
message RankInfo
|
|
{
|
|
Audience Audience = 1; //观众信息
|
|
int32 Rank = 2; //排名
|
|
int32 Score = 3; //用户分数
|
|
} |