| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- // message结构的属性名请使用 驼峰小写字母开始
- syntax = "proto3";
- option go_package = "/pb";
- package pb;
- import "base_type.proto";
- // // 兵种
- // enum TroopType {
- // // 步兵
- // Infantry = 1;
- // // 骑兵
- // Cavalry = 2;
- // // 弓箭手
- // Archer = 3;
- // }
- // // 阵营类型
- // enum BattleCampType {
- // Camp1 = 0;
- // Camp2 = 1;
- // }
- // enum BattleType {
- // // 测试
- // Test = 1;
- // // 探险
- // Exploration = 2;
- // //
- // PVP = 3;
- // //
- // SLG = 4,
- // }
- message BattleReplay {
- int32 errorCode = 1;
- string errorText = 2;
- BattleResult result = 3;
- }
- // 战斗参数
- message BattleParam {
- // 随机种子数
- uint64 randomSeed = 1;
- // 地图ID
- uint32 mapID = 2;
- // 阵营数据
- repeated BattleCampParam camps = 3;
- // 是否需要生成详细校验数据
- bool isGenerateVerificationInfo = 4;
- // 战斗类型 BattleType 1:测试 2:探险 3:PVP 4:SLG
- int32 battleType = 5;
- // 配置数据
- bytes configData = 6;
- // 是否生成配置数据
- bool generateConfigData = 7;
- }
- // // 领主信息
- // message BattleLordInfo {
- // // 领主ID
- // int64 lordId = 1;
- // // 名称
- // string name = 2;
- // // 等级
- // int32 level = 3;
- // // 头像
- // int32 iconID = 4;
- // // 头像框
- // int32 frameID = 5;
- // // 联盟名
- // string guildName = 6;
- // }
- // 阵营参数
- message BattleCampParam {
- // 阵营 BattleCampType
- int32 camp = 1;
- // 战斗力
- int64 power = 2;
- // 战斗小队
- repeated BattleSquadParam squads = 3;
- // 玩家唯一ID,0表示是怪物
- int64 playerID = 4;
- }
- // 战斗小队参数
- message BattleSquadParam {
- // 阵位索引
- int32 tileIndex = 1;
- // 战斗对象
- Fighter fighter = 2;
- // 小兵
- repeated BattleSoldierParam soldiers = 3;
- // 军团属性列表
- Attrs attrs = 4;
- // 兵种类型
- int32 troopsID = 5;
- // 兵种数量
- int32 troopsNum = 6;
- // 统兵上限数量
- int32 heroTroopNum = 7;
- // 首战兵种数量(连战)
- int32 firstTroopsNum = 8;
- }
- // 战斗对象
- message Fighter {
- // 唯一ID
- int64 id = 1;
- // 战斗对象类型 1:英雄 2:怪物
- int32 battleObjType = 2;
- // 配置ID
- int32 configID = 3;
- // 编队位置索引 默认0,前端用
- int32 tileIndex = 4;
- // 属性列表
- Attrs attrs = 5;
- // 技能列表
- repeated uint32 skills = 6;
- // 等级
- int32 level = 7;
- // 外显等级
- int32 displayLevel = 8;
- // 英雄星级
- int32 star = 9;
- // 是否死亡
- bool isDead = 10;
- }
- // 战斗小兵参数
- message BattleSoldierParam {
- // 配置ID
- int32 configID = 1;
- // 编队位置索引
- int32 tileIndex = 2;
- // 属性列表
- Attrs attrs = 3;
- // 技能列表
- repeated uint32 skills = 4;
- // 数量
- int32 num = 5;
- }
- // 阵营结果
- message BattleCampResult {
- // 阵营 BattleCampType
- int32 camp = 1;
- // 各个小队的结果
- repeated BattleSquadResult squadResults = 2;
- // 玩家唯一ID,0表示是怪物
- int64 playerID = 3;
- }
- // 小队结果
- message BattleSquadResult {
- // 战斗对象结果
- FighterResult fighterResult = 1;
- // 士兵剩余数量
- int32 soldierNum = 2;
- }
- // 战斗对象结果
- message FighterResult {
- // 唯一ID
- int64 id = 1;
- // 战斗对象类型 1:英雄 2:怪物
- int32 battleObjType = 2;
- // 配置ID
- int32 configID = 3;
- // 是否死亡
- bool isDead = 4;
- // 剩余血量万分比 (需要除以10000)
- int32 hp = 5;
- }
- // 战斗结果
- message BattleResult {
- // 胜利的阵营 -1表示平局
- int32 victoriousCamp = 1;
- // 结果校验码 相等时表示执行结果一致
- int64 checksum = 2;
- // 阵营结果
- repeated BattleCampResult campResult = 3;
- // 详细校验结果
- repeated BattleVerifyInfo verifyInfos = 4;
- // 配置数据
- bytes configData = 6;
- }
- // 校验详细信息
- message BattleVerifyInfo {
- // 类名
- string name = 1;
- // 校验码
- int64 checksum = 2;
- // 成员信息
- map<string, string> members = 3;
- // 子节点信息
- map<string, BattleVerifyInfo> children = 4;
- }
|