feat 初始化
This commit is contained in:
18
protofile/SocketServer/gen_proto.ps1
Normal file
18
protofile/SocketServer/gen_proto.ps1
Normal file
@@ -0,0 +1,18 @@
|
||||
$gen = "gen"
|
||||
if (!(Test-Path $gen))
|
||||
{
|
||||
mkdir $gen | Out-Null
|
||||
}
|
||||
|
||||
$files = Get-ChildItem sources/*.proto | ForEach-Object { $_.Name }
|
||||
|
||||
protoc `
|
||||
--proto_path=sources `
|
||||
--go_out=$gen `
|
||||
$files
|
||||
|
||||
$sourcePath = "$gen/git.hlsq.asia/alex/proto/proto/ss"
|
||||
$targetPath = "../../proto"
|
||||
|
||||
Copy-Item -Path $sourcePath -Destination $targetPath -Recurse -Force
|
||||
Remove-Item -Path "$gen/git.hlsq.asia" -Recurse -Force
|
||||
27
protofile/SocketServer/sources/channel.proto
Normal file
27
protofile/SocketServer/sources/channel.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "git.hlsq.asia/alex/proto/proto/ss/sspb";
|
||||
import "ss_common.proto";
|
||||
|
||||
enum ChannelType {
|
||||
CHANNEL_TYPE_UNKNOWN = 0;
|
||||
CHANNEL_TYPE_PHYSICAL_ROOM = 1; // 线下比赛房间频道
|
||||
CHANNEL_TYPE_BASE_COURT = 2; // 基础球场频道
|
||||
CHANNEL_TYPE_HORN = 3; // 小喇叭频道
|
||||
CHANNEL_TYPE_WATCH_ONLINE_COMPETITION = 4; // 观看在线比赛频道 ( 小程序端业务 )
|
||||
CHANNEL_TYPE_TOURNAMENT = 5; // 锦标赛
|
||||
}
|
||||
|
||||
// MESSAGE_ID_JOIN_CHANNEL
|
||||
message C2S_JoinChannel {
|
||||
string ChannelName = 1; // 频道名称
|
||||
}
|
||||
message S2C_JoinChannel {
|
||||
}
|
||||
|
||||
// MESSAGE_ID_LEAVE_CHANNEL
|
||||
message C2S_LeaveChannel {
|
||||
string ChannelName = 1; // 频道名称
|
||||
}
|
||||
message S2C_LeaveChannel {
|
||||
}
|
||||
21
protofile/SocketServer/sources/define.proto
Normal file
21
protofile/SocketServer/sources/define.proto
Normal file
@@ -0,0 +1,21 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "git.hlsq.asia/alex/proto/proto/ss/sspb";
|
||||
option csharp_namespace = "common_pb";
|
||||
import "ss_common.proto";
|
||||
|
||||
enum MessageID {
|
||||
MESSAGE_ID_INVALID = 0;
|
||||
MESSAGE_ID_KICK_OUT = 1; // 服务器踢人
|
||||
MESSAGE_ID_QUEUE_UP = 2; // 排队中
|
||||
MESSAGE_ID_LOGIN_SUCCESS = 3; // 登录成功
|
||||
MESSAGE_ID_PING = 4; // Ping
|
||||
MESSAGE_ID_PONG = 5; // Pong
|
||||
MESSAGE_ID_JOIN_CHANNEL = 101; // 加入频道
|
||||
MESSAGE_ID_LEAVE_CHANNEL = 102; // 离开频道
|
||||
}
|
||||
|
||||
message Message {
|
||||
MessageID ID = 1;
|
||||
bytes Payload = 2;
|
||||
}
|
||||
35
protofile/SocketServer/sources/service.proto
Normal file
35
protofile/SocketServer/sources/service.proto
Normal file
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "git.hlsq.asia/alex/proto/proto/ss/sspb";
|
||||
import "ss_common.proto";
|
||||
|
||||
// MESSAGE_ID_KICK_OUT
|
||||
enum KickOutID {
|
||||
KICK_OUT_ID_INVALID = 0;
|
||||
KICK_OUT_ID_DUPLICATE_LOGIN = 1; // 重复登录
|
||||
KICK_OUT_ID_SERVER_BUSY = 2; // 服务器繁忙
|
||||
KICK_OUT_ID_SERVER_CLOSE = 3; // 服务器关闭
|
||||
KICK_OUT_ID_QUEUE_UP_FULL = 4; // 排队上限
|
||||
KICK_OUT_ID_TOKEN_INVALID = 5; // Token无效
|
||||
}
|
||||
message S2C_KickOut {
|
||||
KickOutID ID = 1;
|
||||
}
|
||||
|
||||
// MESSAGE_ID_QUEUE_UP
|
||||
message S2C_QueueUp {
|
||||
int32 QueueUpCount = 1; // 排队人数
|
||||
}
|
||||
|
||||
// MESSAGE_ID_LOGIN_SUCCESS
|
||||
message S2C_LoginSuccess {
|
||||
int64 GatewayID = 1; // 网关ID
|
||||
}
|
||||
|
||||
// MESSAGE_ID_PING
|
||||
message C2S_Ping {
|
||||
}
|
||||
|
||||
// MESSAGE_ID_PONG
|
||||
message S2C_Pong {
|
||||
}
|
||||
3
protofile/SocketServer/sources/ss_common.proto
Normal file
3
protofile/SocketServer/sources/ss_common.proto
Normal file
@@ -0,0 +1,3 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "git.hlsq.asia/alex/proto/proto/ss/sscommon";
|
||||
Reference in New Issue
Block a user