yokyo 5 years ago
parent
commit
acbc8b2f51
11 changed files with 190 additions and 55 deletions
  1. 2 2
      build
  2. 26 1
      logics/bitlegend.proto
  3. 1 1
      login.proto
  4. 5 1
      modules/checkin.proto
  5. 44 0
      modules/mail.proto
  6. 4 1
      modules/notice.proto
  7. 40 1
      modules/shop.proto
  8. 33 0
      modules/title.proto
  9. 1 0
      msgq_evid.proto
  10. 12 34
      structs.proto
  11. 22 14
      tajmahal.proto

+ 2 - 2
build

@@ -26,10 +26,10 @@ def main():
             
             if args.golang:
                 print('building ', file, ' golang ...')
-                os.system('protoc --go_out=. {}'.format(os.path.join(cur,file)))
+                os.system('protoc -I. --go_out=. {}'.format(os.path.join(cur,file)))
             if args.python:
                 print('building ', file, ' python ...')
-                os.system('protoc --python_out=. {}'.format(os.path.join(cur, file)))
+                os.system('protoc -I. --python_out=. {}'.format(os.path.join(cur, file)))
         if args.clean and cur not in cleaned:
             print('removing ', cur, '...')
             os.system('rm {0}/*.pb.go {0}/*_pb2.py'.format(cur))

+ 26 - 1
logics/bitlegend.proto

@@ -1,2 +1,27 @@
 syntax="proto3";
-package protos;
+package protos.logics;
+
+
+message C_ChangeWeapon {
+
+}
+
+message S_ChangeWeapon {
+
+}
+
+message C_Attack {
+
+}
+
+message S_Attack {
+
+}
+
+message C_UseItems {
+
+}
+
+message S_UseItems {
+
+}

+ 1 - 1
login.proto

@@ -1,7 +1,7 @@
 syntax="proto3";
 package protos;
 
-/// login 服务器到客户端通信协议
+/// login 服务器到客户端通信协议 json
 
 // 用户注册类型
 enum RegType {

+ 5 - 1
modules/checkin.proto

@@ -1,2 +1,6 @@
 syntax = "proto3";
-package modules;
+package protos.modules;
+
+/// 签到模块
+
+// 签到领取道具应直接置入背包, 否则发送到邮箱

+ 44 - 0
modules/mail.proto

@@ -0,0 +1,44 @@
+syntax = "proto3";
+package protos.modules;
+
+
+/// 一封邮件
+message Mail {
+    int64  id                   = 1;
+    string subject              = 2;
+    string body                 = 3;
+    int64  ts                   = 4;
+    string sender               = 5;
+    repeated string itemIds     = 6;    // 可领取的道具列表,空表示没有
+    string btnText              = 7;    // 按钮上的文字,如果空,表示没有按钮
+    int64 expiresAt             = 9;    // 过期时间,0 永不过期
+    int32 read                  = 10;   // 是否已读
+    int32 valid                 = 12;   // 是否有效
+}
+
+message C_UserMails {
+
+}
+
+message S_UserMails {
+    repeated Mail mails = 1;
+}
+
+// 标记已读
+message C_ReadMails {
+    repeated int64 ids = 1;
+}
+
+message S_ReadMails {
+    repeated int64 ids = 1;
+}
+
+// 点击邮箱中按钮领取物品
+// 此时,背包中需要有空槽,否则领取失败
+message C_RetrieveMails {
+    repeated int64 ids  = 1;
+}
+
+message S_RetrieveMails {
+    repeated int64 ids  = 1;
+}

+ 4 - 1
modules/notice.proto

@@ -1,2 +1,5 @@
 syntax = "proto3";
-package modules;
+package protos.modules;
+
+/// 公告模块
+

+ 40 - 1
modules/shop.proto

@@ -1,2 +1,41 @@
 syntax = "proto3";
-package modules;
+package protos.modules;
+
+/// 商城模块
+
+/// 道具定义 TODO: 图标
+message Item {
+    string name     = 1;
+    string id       = 2;        
+    string intro    = 3;        // 文字说明
+    int32 source    = 4;        // 来源
+    int64 born      = 5;        // 生成时间
+    int64 expires   = 6;        // 过期时间
+    int64 value     = 8;        // 面值
+    int64 max       = 10;       // 最大面值
+    int32 valid     = 12;       // 是否有效
+    int32 category  = 13;       // 所属类别
+}
+
+message Commodity {
+    Item item       = 1;    // 道具
+    int64 origPrice = 2;    // 原价
+    int64 price     = 3;    // 价格
+    float discount  = 4;    // 折扣
+}
+
+message C_Shop {
+    
+}
+
+message S_Shop {
+    repeated Commodity commodities = 1;
+}
+
+message C_BuyInShop {
+
+}
+
+message S_BuyInShop {
+
+}

+ 33 - 0
modules/title.proto

@@ -0,0 +1,33 @@
+syntax = "proto3";
+package protos.modules;
+
+/// 称号模块
+
+message Title {
+    int32  id           = 1;
+    string name         = 2;        // 称号
+    string desc         = 3;        // 描述
+}
+
+message UserTitle {
+    Title title         = 1;
+    int32 reached       = 3;        // 是否达成
+    int64 ts            = 4;        // 达成日期
+}
+
+
+message C_UserTitles {
+}
+
+message S_UserTitles {
+    repeated UserTitle titles = 1;
+}
+
+// 更换 title
+message C_UpdateTitle {
+    int32 id        = 1;
+}
+
+message S_UpdateTitle {
+    int32 id        = 1;
+}

+ 1 - 0
msgq_evid.proto

@@ -1,6 +1,7 @@
 syntax="proto3";
 package protos;
 
+/// 消息队列事件ID
 
 enum EvId {
     //TODO

+ 12 - 34
structs.proto

@@ -6,38 +6,16 @@ message Int32Scope {
     int32 max       = 2;
 }
 
-/// 道具定义
-message Item {
-    string name     = 1;
-    string id       = 2;        
-    string intro    = 3;        // 文字说明
-    int32 source    = 4;        // 来源
-    int64 born      = 5;        // 生成时间
-    int64 expires   = 6;        // 过期时间
-    int64 value     = 8;        // 面值
-    int64 max       = 10;       // 最大面值
-    int32 valid     = 12;       // 是否有效
-    int32 category  = 13;       // 所属类别
-}
-
-
-/// 一封邮件
-message Mail {
-    int64  id                   = 1;
-    string subject              = 2;
-    string body                 = 3;
-    int64  ts                   = 4;
-    string sender               = 5;
-    repeated string itemIds     = 6;    // 可领取的道具列表,空表示没有
-    string btnText              = 7;    // 按钮上的文字,如果空,表示没有按钮
-    int64 expiresAt             = 9;    // 过期时间,0 永不过期
-    int32 read                  = 10;   // 是否已读
-    int32 valid                 = 12;   // 是否有效
-}
-
-// 多语言内容,提前配置
-message LangText {
-    int32 lang              = 1;
-    string emailSubjectTpl    = 2;
-    string emailBodyTpl     = 3;
+// 矿池
+message Mine {
+    int64   id          = 1;
+    string name         = 2;        // 名称
+    string coin         = 3;        // 币
+    string city         = 4;
+    string location     = 5;        // 详细位置
+    string desc         = 8;        // 简介
+    string holder       = 9;        // 所有人
+    float longitude     = 10;       // 经纬度
+    float latitude      = 11;
+    uint64 gameId       = 12;
 }

+ 22 - 14
tajmahal.proto

@@ -1,7 +1,6 @@
 syntax="proto3";
 package protos;
 
-//import "structs.proto";
 import "enums.proto";
 
 /// 逻辑服务器之外(大厅,对应进程 tajmahal )的到客户端的协议
@@ -35,15 +34,15 @@ message S_Login {
     int32  headerIcon           = 2;
     string remoteIP             = 3;
     int32  level                = 4;
-    string  username            = 5;
+    string  username            = 5;        // 手机号或邮箱
     int64 birthday              = 6;
     int32 gender                = 7;
     int64 score                 = 8;
     string curTitle             = 9;        // 当前使用称号
     map<string, int64> balances = 12;       // 币,数量
     map<string, string> wallets = 14;       // 钱包地址
-    string verServer            = 16;
-    string verClient            = 18;
+    string verServer            = 16;       // 服务端当前版本号
+    string verClient            = 18;       // 客户端最新版本号
     int32 lang                  = 20;       // 语言
     int32 volBg                 = 21;       // 背景音量
     int32 volFg                 = 22;       // 前景音量
@@ -88,33 +87,42 @@ message S_Logout {
 
 /// 进入游戏场景
 message C_EnterGame {
-    int64 gameId    = 1;
+    uint64 gameId    = 1;
 }
 
 message S_EnterGame {
-    int64 gameId    = 1;
+    uint64 gameId   = 1;
+    uint64 roomId   = 4;    // 副本类游戏表示副本ID
 }
 
 
 /// 离开游戏
 message C_LeaveGame {
-    int32 gameId    = 1;
+    uint32 gameId   = 1;
+    uint64 roomId   = 4;
 }
 
 message S_LeaveGame {
-    int64 gameId    = 1;
+    uint64 gameId   = 1;
+    uint64 roomId   = 4;
 }
 
 
 /// 用户信息设置
 message C_UserInfo {
-    string nickname     = 1;
-    int64 birthday      = 2;
+    string nickname                     = 1;
+    int64 birthday                      = 2;
+    int32 headerIcon                    = 3;
+    int32 gender                        = 4;
+    map<string, string> walletsAddrs    = 8;        // 钱包地址
 }
 
 message S_UserInfo {
-    string nickname     = 1;
-    int64 birthday      = 2;
+    string nickname                     = 1;
+    int64 birthday                      = 2;
+    int32 headerIcon                    = 3;
+    int32 gender                        = 4;
+    map<string, string> walletsAddrs    = 8;
 }
 
 
@@ -122,13 +130,13 @@ message S_UserInfo {
 message C_Settings {
     int32 bgVolume      = 1;
     int32 fgVolume      = 2;
-    string lang         = 3;
+    int32 lang          = 3;
 }
 
 message S_Settings {
     int32 bgVolume      = 1;
     int32 fgVolume      = 2;
-    string lang         = 3;
+    int32 lang          = 3;
 }