You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

187 lines
4.4 KiB

// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
syntax = "proto3";
package google.protobuf;
//import "LobbyComm.proto";
//import "GameComm.proto";
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option go_package = "github.com/golang/protobuf/ptypes/struct;structpb";
option java_package = "com.google.protobuf";
option java_outer_classname = "StructProto";
option java_multiple_files = true;
option java_generate_equals_and_hash = true;
option objc_class_prefix = "GPB";
enum SMMsgID {
SM_MSGID_NONE = 0;
SM_MSGID_PING = 10;
SM_MSGID_CLIENT_REG_REQ = 11;
SM_MSGID_CLIENT_REG_RES = 12;
SM_MSGID_CONSOLE_COMMAND_REQ = 13;
SM_MSGID_CONSOLE_COMMAND_RES = 14;
SM_MSGID_AGENT_DO_COMMAND_REQ = 15;
SM_MSGID_AGENT_DO_COMMAND_RES = 16;
SM_MSGID_TRANS_FILE_NOTIFY = 17;
SM_MSGID_FILE_CONTENT_REQ = 19;
SM_MSGID_FILE_CONTENT_RES = 20;
// 文件接收结果通知
SM_MSGID_FILE_RECV_STATE_REQ = 21;
SM_MSGID_FILE_RECV_STATE_RES = 22;
// 取消传送通知, 由center通知agent取消传送
SM_MSGID_CANCEL_TRANS_NOTIFY = 23;
}
//CS_MSGID_PING
message SMPing{
int32 seq = 1;
}
//CS_MSGID_CLIENT_REG_REQ
message SMClientRegReq{
int32 clientType = 1;
string machineName = 2;
}
//SM_MSGID_CLIENT_REG_RES 注册成功后应答, 告诉agent有多少sogloader 总数
message SMClientRegRes{
repeated uint32 serverId = 1;
string workpath = 2;
}
message SMConsoleCommandReq{
string command = 1;
uint32 httpid = 2;//网页请求id
}
message SMConsoleCommandRes{
string command = 1;
string message = 2;
int32 nonewline = 3;
}
message SMAgentDoCommandReq{
int32 seqNum = 1;
uint32 serverId = 2;
string command = 3;
string exeFileName = 4;
string cmdArgs = 5;
string workPath = 6;
int32 stopTimeout = 7;
string centerName = 8; // 发起请求的center hostName
repeated FileAttr fileList = 9; // 检查文件MD5之类的需求
int32 testMode = 10; // 测试模式
}
enum ResResultCode{
ResResultCode_NoRes = 0;
ResResultCode_Success = 1;
ResResultCode_Fail = 2;
ResResultCode_Exception = 3;
ResResultCode_TimeOut = 4;
ResResultCode_Running =5;
ResResultCode_NotRunning = 6;
}
message SMAgentDoCommandRes{
int32 seqNum = 1;
uint32 serverId = 2;
string command = 3;
ResResultCode resultCode = 4;
string result = 5;
string hostName = 6;
string addInfo = 7;
string serverIdStr = 8;
string serverType = 9;
}
message FileAttr{
string fileName = 1;
string fileMd5 = 2;
int32 fileSize = 3;
string filePath = 4;
int64 fileTime = 5;
}
// 通知有文件要传送
message SMTransFileNotify{
string hostName = 1; // 文件存放的host
repeated FileAttr fileList = 2; // 文件列表
int64 transSeq = 3; // 序列号, 快速判断是否同一次传送, 比对比fileList快
}
// 请求文件内容
// SM_MSGID_FILE_CONTENT_REQ
message SMFileContentReq{
string fileName = 1;
string fileMd5 = 2;
string hostName = 3; // 请求数据的host
int32 contentOffset = 4; // 偏移值从0开始
int64 transSeq = 5; // 序列号, 快速判断是否同一次传送, 比对比fileList快
}
// SM_MSGID_FILE_CONTENT_RES
message SMFileContentRes{
int32 ret = 1; // 0 内容有效
string fileName = 2;
string fileMd5 = 3;
int32 contentOffset = 4; // 偏移值从0开始
bytes content = 5;
string hostName = 6; // 发送数据的host
int64 transSeq = 7; // 序列号, 快速判断是否同一次传送, 比对比fileList快
}
// agent通知center文件传送成功,出错时不通知,center将按超时处理
message SMTransSuccNotify{
string hostName = 1;
FileAttr fileAttr = 2;
}
message FileRecvState{
string fileName = 1;
string fileMd5 = 2;
int32 recvState = 3;
}
// 文件接收结果req
// SM_MSGID_FILE_RECV_STATE_REQ
message SMFileRecvStateReq{
int64 transSeq = 1; // 序列号, 快速判断是否同一次传送, 比对比fileList快
string hostName = 2; // 接收文件的host
repeated FileRecvState fileList = 3;
}
// 文件传送结果通知res
// SM_MSGID_FILE_RECV_STATE_RES
message SMFileRecvStateRes{
int64 transSeq = 1; // 序列号, 快速判断是否同一次传送, 比对比fileList快
string hostName = 2; // 发送文件的host
}
// 取消传送
// SM_MSGID_CANCEL_TRANS_NOTIFY
message SMCancelTransNotify{
int64 transSeq = 1; // 序列号, 快速判断是否同一次传送, 比对比fileList快
string hostName = 2; // 发起取消的host
}