上传梦工厂前端工具

This commit is contained in:
liwei1dao 2022-07-14 15:07:40 +08:00
parent f10707b45d
commit fd6cb628f0
25 changed files with 943 additions and 353 deletions

BIN
dist.rar

Binary file not shown.

3
pb.bat
View File

@ -14,6 +14,5 @@ set TAR=%PROJECT_ROOT%\src\pb\js
@REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\pack\*.proto @REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\pack\*.proto
@REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\mail\*.proto @REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\mail\*.proto
npx pbjs -t json-module -w commonjs -o src/pb/proto.js %SRC%\*.proto npx pbjs -t json-module -w commonjs -o src/pb/proto.js %SRC%\*.proto
pause pause

View File

@ -71,7 +71,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
id: 2 id: 2
}, },
ErrorData: { ErrorData: {
type: "string", type: "google.protobuf.Any",
id: 3 id: 3
}, },
Reply: { Reply: {
@ -111,17 +111,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
type: "string", type: "string",
id: 1 id: 1
}, },
MainType: { Reply: {
type: "string", rule: "repeated",
type: "UserMessage",
id: 2 id: 2
},
SubType: {
type: "string",
id: 3
},
Data: {
type: "google.protobuf.Any",
id: 4
} }
} }
}, },
@ -191,6 +184,30 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
Crit: 4 Crit: 4
} }
}, },
UserAssets: {
fields: {
A: {
type: "string",
id: 1
},
T: {
type: "string",
id: 2
},
N: {
type: "int32",
id: 3
}
}
},
TaskParam: {
fields: {
first: {
type: "int32",
id: 1
}
}
},
ErrorCode: { ErrorCode: {
values: { values: {
Success: 0, Success: 0,
@ -218,6 +235,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
GoldNoEnough: 1003, GoldNoEnough: 1003,
DiamondNoEnough: 1004, DiamondNoEnough: 1004,
RoleCreated: 1005, RoleCreated: 1005,
NameExist: 1006,
FriendNotSelf: 1100, FriendNotSelf: 1100,
FriendSelfMax: 1101, FriendSelfMax: 1101,
FriendTargetMax: 1102, FriendTargetMax: 1102,
@ -245,8 +263,20 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
HeroNotNeedResonate: 1308, HeroNotNeedResonate: 1308,
HeroNoEnergy: 1309, HeroNoEnergy: 1309,
HeroCreate: 1310, HeroCreate: 1310,
HeroEquipUpdate: 1311,
HeroMaxAwaken: 1312,
HeroIsLock: 1313,
EquipmentOnFoundEquipment: 1400, EquipmentOnFoundEquipment: 1400,
EquipmentLvlimitReached: 1401 EquipmentLvlimitReached: 1401,
StoryNotFindChapter: 1500,
StoryIDFailed: 1501,
TaskInit: 1600,
TaskReset: 1601,
TaskHandle: 1602,
TaskReceived: 1603,
TaskActiveInit: 1606,
TaskActiveNofound: 1604,
TaskActiveNoenough: 1605
} }
}, },
google: { google: {
@ -395,7 +425,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}, },
DBFriend: { DBFriend: {
fields: { fields: {
uId: { uid: {
type: "string", type: "string",
id: 1 id: 1
}, },
@ -451,7 +481,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
FriendListReq: { FriendListReq: {
fields: {} fields: {}
}, },
FriendListRsp: { FriendListResp: {
fields: { fields: {
list: { list: {
rule: "repeated", rule: "repeated",
@ -468,7 +498,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendApplyRsp: { FriendApplyResp: {
fields: { fields: {
userId: { userId: {
type: "string", type: "string",
@ -488,7 +518,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendDelRsp: { FriendDelResp: {
fields: { fields: {
friendId: { friendId: {
type: "string", type: "string",
@ -509,7 +539,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendAgreeRsp: { FriendAgreeResp: {
fields: { fields: {
Num: { Num: {
type: "int32", type: "int32",
@ -526,7 +556,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendRefuseRsp: { FriendRefuseResp: {
fields: { fields: {
Num: { Num: {
type: "int32", type: "int32",
@ -537,7 +567,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
FriendApplyListReq: { FriendApplyListReq: {
fields: {} fields: {}
}, },
FriendApplyListRsp: { FriendApplyListResp: {
fields: { fields: {
list: { list: {
rule: "repeated", rule: "repeated",
@ -554,7 +584,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendSearchRsp: { FriendSearchResp: {
fields: { fields: {
friend: { friend: {
type: "FriendBase", type: "FriendBase",
@ -565,7 +595,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
FriendBlackListReq: { FriendBlackListReq: {
fields: {} fields: {}
}, },
FriendBlackListRsp: { FriendBlackListResp: {
fields: { fields: {
friends: { friends: {
rule: "repeated", rule: "repeated",
@ -582,7 +612,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendBlackAddRsp: { FriendBlackAddResp: {
fields: { fields: {
friendId: { friendId: {
type: "string", type: "string",
@ -602,7 +632,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendDelBlackRsp: { FriendDelBlackResp: {
fields: { fields: {
friendId: { friendId: {
type: "string", type: "string",
@ -622,7 +652,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendReceiveRsp: { FriendReceiveResp: {
fields: { fields: {
friendId: { friendId: {
type: "string", type: "string",
@ -642,7 +672,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendGiveRsp: { FriendGiveResp: {
fields: { fields: {
friendId: { friendId: {
type: "string", type: "string",
@ -662,7 +692,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
FriendTotalRsp: { FriendTotalResp: {
fields: { fields: {
friendId: { friendId: {
type: "string", type: "string",
@ -800,7 +830,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
HeroInfoRsp: { HeroInfoResp: {
fields: { fields: {
base: { base: {
type: "DBHero", type: "DBHero",
@ -811,7 +841,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
HeroListReq: { HeroListReq: {
fields: {} fields: {}
}, },
HeroListRsp: { HeroListResp: {
fields: { fields: {
list: { list: {
rule: "repeated", rule: "repeated",
@ -921,12 +951,9 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
id: 1 id: 1
}, },
costObjID: { costObjID: {
rule: "repeated",
type: "string", type: "string",
id: 2 id: 2
},
amount: {
type: "int32",
id: 3
} }
} }
}, },
@ -1042,6 +1069,22 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
HeroLockReq: {
fields: {
heroid: {
type: "string",
id: 1
}
}
},
HeroLockResp: {
fields: {
hero: {
type: "DBHero",
id: 1
}
}
},
DB_UserItemData: { DB_UserItemData: {
fields: { fields: {
gridId: { gridId: {
@ -1098,7 +1141,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
ItemsUseItemReq: { ItemsUseItemReq: {
fields: { fields: {
GridId: { GridId: {
type: "int32", type: "string",
id: 1 id: 1
}, },
ItemId: { ItemId: {
@ -1117,7 +1160,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
ItemsSellItemReq: { ItemsSellItemReq: {
fields: { fields: {
GridId: { GridId: {
type: "int32", type: "string",
id: 1 id: 1
}, },
ItemId: { ItemId: {
@ -1133,18 +1176,6 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
ItemsSellItemResp: { ItemsSellItemResp: {
fields: {} fields: {}
}, },
MailAttachment: {
fields: {
ItemId: {
type: "uint32",
id: 1
},
ItemCount: {
type: "uint32",
id: 2
}
}
},
DBMailData: { DBMailData: {
fields: { fields: {
ObjId: { ObjId: {
@ -1181,7 +1212,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}, },
Items: { Items: {
rule: "repeated", rule: "repeated",
type: "MailAttachment", type: "UserAssets",
id: 9 id: 9
} }
} }
@ -1247,6 +1278,42 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
MailGetNewMailPush: {
fields: {
Mail: {
type: "DBMailData",
id: 1
}
}
},
DBSystemNotify: {
fields: {
id: {
type: "string",
id: 1
},
title: {
type: "string",
id: 2
},
content: {
type: "string",
id: 3
},
istop: {
type: "bool",
id: 4
},
ctime: {
type: "int64",
id: 5
},
rtime: {
type: "int64",
id: 6
}
}
},
NotifyErrorNotifyPush: { NotifyErrorNotifyPush: {
fields: { fields: {
ReqMainType: { ReqMainType: {
@ -1267,7 +1334,392 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}, },
Data: { Data: {
type: "string", type: "string",
id: 5
}
}
},
NotifyGetListReq: {
fields: {}
},
NotifyGetListResp: {
fields: {
LastReadTime: {
type: "int64",
id: 1
},
SysNotify: {
rule: "repeated",
type: "DBSystemNotify",
id: 2
}
}
},
ShopType: {
values: {
Null: 0,
GoldShop: 1,
DiamondShop: 2,
PVPShop: 3,
PVEShop: 4,
AllianceShop: 5
}
},
UserShopData: {
fields: {
LastRefreshTime: {
type: "int64",
id: 1
},
ManualRefreshNum: {
type: "int32",
id: 2
},
Items: {
rule: "repeated",
type: "int32",
id: 3
}
}
},
DBShop: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
goldShop: {
type: "UserShopData",
id: 3
},
diamondShop: {
type: "UserShopData",
id: 4
},
pvpShop: {
type: "UserShopData",
id: 5
},
pveShop: {
type: "UserShopData",
id: 6 id: 6
},
allianceShop: {
type: "UserShopData",
id: 7
}
}
},
DBShopItem: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
goodsId: {
type: "int32",
id: 3
},
buyNum: {
type: "int32",
id: 4
},
lastBuyTime: {
type: "int64",
id: 5
}
}
},
ShopItem: {
fields: {
GoodsId: {
type: "int32",
id: 1
},
Items: {
rule: "repeated",
type: "UserAssets",
id: 2
},
Consume: {
rule: "repeated",
type: "UserAssets",
id: 3
},
Sale: {
type: "int32",
id: 4
},
LeftBuyNum: {
type: "int32",
id: 5
}
}
},
ShopGetListReq: {
fields: {
sType: {
type: "ShopType",
id: 1
},
IsManualRefresh: {
type: "bool",
id: 2
}
}
},
ShopGetListResp: {
fields: {
Goods: {
rule: "repeated",
type: "ShopItem",
id: 1
}
}
},
ShopBuyReq: {
fields: {
GoodsId: {
type: "int32",
id: 1
}
}
},
ShopBuyResp: {
fields: {
IsSucc: {
type: "bool",
id: 1
}
}
},
DBStory: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
chapterId: {
type: "int32",
id: 3
},
storyId: {
type: "int32",
id: 4
},
intensity: {
type: "int32",
id: 5
},
awaredID: {
type: "int32",
id: 6
},
progress: {
type: "int32",
id: 7
},
totalBox: {
type: "int32",
id: 8
},
branchID: {
rule: "repeated",
type: "int32",
id: 9
}
}
},
StoryGetListReq: {
fields: {}
},
StoryGetListResp: {
fields: {
data: {
rule: "repeated",
type: "DBStory",
id: 1
}
}
},
StoryGetRewrdReq: {
fields: {
chapterId: {
type: "uint32",
id: 1
},
boxId: {
type: "uint32",
id: 2
}
}
},
StoryGetRewrdResp: {
fields: {
data: {
type: "DBStory",
id: 1
}
}
},
StoryChallengeReq: {
fields: {
chapterId: {
type: "uint32",
id: 1
},
storyId: {
type: "uint32",
id: 2
}
}
},
StoryChallengeResp: {
fields: {
data: {
type: "DBStory",
id: 1
}
}
},
DBTask: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
taskId: {
type: "int32",
id: 3
},
progress: {
type: "int32",
id: 4
},
active: {
type: "int32",
id: 5
},
status: {
type: "int32",
id: 6
},
received: {
type: "int32",
id: 7
}
}
},
DBTaskActive: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
rId: {
type: "int32",
id: 3
},
received: {
type: "int32",
id: 4
}
}
},
TaskReceiveReq: {
fields: {
taskTag: {
type: "int32",
id: 1
},
id: {
type: "string",
id: 2
}
}
},
TaskReceiveResp: {
fields: {
taskId: {
type: "int32",
id: 1
}
}
},
TaskListReq: {
fields: {
taskTag: {
type: "int32",
id: 1
}
}
},
TaskListResp: {
fields: {
list: {
rule: "repeated",
type: "DBTask",
id: 1
}
}
},
TaskActiveListReq: {
fields: {
taskTag: {
type: "int32",
id: 1
}
}
},
TaskActiveListResp: {
fields: {
list: {
rule: "repeated",
type: "DBTaskActive",
id: 1
}
}
},
TaskActiveReceiveReq: {
fields: {
taskTag: {
type: "int32",
id: 1
},
id: {
type: "string",
id: 2
}
}
},
TaskActiveReceiveResp: {
fields: {
taskTag: {
type: "int32",
id: 1
},
id: {
type: "string",
id: 2
} }
} }
}, },
@ -1284,6 +1736,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
GatewayServiceId: { GatewayServiceId: {
type: "string", type: "string",
id: 3 id: 3
},
ip: {
type: "string",
id: 4
} }
} }
}, },
@ -1348,6 +1804,18 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
created: { created: {
type: "bool", type: "bool",
id: 15 id: 15
},
lv: {
type: "int32",
id: 16
},
vip: {
type: "int32",
id: 17
},
diamond: {
type: "int32",
id: 18
} }
} }
}, },
@ -1383,7 +1851,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
UserRegisterRsp: { UserRegisterResp: {
fields: { fields: {
Code: { Code: {
type: "ErrorCode", type: "ErrorCode",
@ -1395,7 +1863,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
UserLoadRsp: { UserLoadResp: {
fields: { fields: {
data: { data: {
type: "CacheUser", type: "CacheUser",
@ -1411,30 +1879,22 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
UserCreateRsp: { UserCreateResp: {
fields: {} fields: {}
}, },
UserAddResReq: { UserAddResReq: {
fields: { fields: {
resType: { res: {
type: "string", type: "UserAssets",
id: 1 id: 1
},
count: {
type: "int32",
id: 2
} }
} }
}, },
UserAddResResp: { UserAddResResp: {
fields: { fields: {
resType: { res: {
type: "string", type: "UserAssets",
id: 1 id: 1
},
count: {
type: "int32",
id: 2
} }
} }
} }

View File

@ -27,7 +27,7 @@ message AgentMessage {
message RPCMessageReply { message RPCMessageReply {
ErrorCode Code = 1; ErrorCode Code = 1;
string ErrorMessage = 2; string ErrorMessage = 2;
string ErrorData = 3; google.protobuf.Any ErrorData = 3;
repeated UserMessage Reply = 4; repeated UserMessage Reply = 4;
} }
@ -43,9 +43,7 @@ message AgentUnBuildReq { string UserSessionId = 1; }
// //
message AgentSendMessageReq { message AgentSendMessageReq {
string UserSessionId = 1; string UserSessionId = 1;
string MainType = 2; repeated UserMessage Reply = 2;
string SubType = 3;
google.protobuf.Any Data = 4;
} }
// //
@ -67,13 +65,27 @@ message BroadCastMessageReq {
message AgentCloseeReq { string UserSessionId = 1; } message AgentCloseeReq { string UserSessionId = 1; }
//线 //线
message NoticeUserCloseReq {string UserSessionId = 1; string UserId = 2; } message NoticeUserCloseReq {
string UserSessionId = 1;
string UserId = 2;
}
// //
enum HeroAttributesType{ enum HeroAttributesType {
Hp = 0; // Hp = 0; //
Atk = 1; // Atk = 1; //
Def = 2; // Def = 2; //
Speed = 3; // Speed = 3; //
Crit = 4; // Crit = 4; //
}
// *cfg.Game_atn
message UserAssets {
string A = 1;
string T = 2;
int32 N = 3;
}
message TaskParam {
int32 first = 1; //
} }

View File

@ -3,31 +3,32 @@ option go_package = ".;pb";
import "equipment_db.proto"; import "equipment_db.proto";
// //
message EquipmentGetListReq {} message EquipmentGetListReq {
}
// //
message EquipmentGetListResp { message EquipmentGetListResp {
repeated DB_Equipment Equipments = 1; // repeated DB_Equipment Equipments = 1; //
} }
// //
message EquipmentEquipReq { message EquipmentEquipReq{
string HeroCardId = 1; //Id string HeroCardId = 1; //Id
repeated string EquipmentId = 2; //Id 0-5 repeated string EquipmentId = 2; //Id 0-5
} }
// //
message EquipmentEquipResp { message EquipmentEquipResp{
repeated DB_Equipment Equipments = 1; // repeated DB_Equipment Equipments = 1; //
} }
// //
message EquipmentUpgradeReq { message EquipmentUpgradeReq{
string EquipmentId = 1; //Id string EquipmentId = 1; //Id
} }
// //
message EquipmentUpgradeResp { message EquipmentUpgradeResp{
bool IsSucc = 1; bool IsSucc = 1;
repeated DB_Equipment Equipment = repeated DB_Equipment Equipment = 2; //
2; //
} }

View File

@ -29,6 +29,7 @@ enum ErrorCode {
GoldNoEnough = 1003; // GoldNoEnough = 1003; //
DiamondNoEnough = 1004; // DiamondNoEnough = 1004; //
RoleCreated = 1005; // RoleCreated = 1005; //
NameExist = 1006; //
// friend // friend
FriendNotSelf = 1100; // FriendNotSelf = 1100; //
@ -51,20 +52,34 @@ enum ErrorCode {
ItemsGirdAmountUpper = 1203; // ItemsGirdAmountUpper = 1203; //
// hero // hero
HeroNoExist = 1300; // HeroNoExist = 1300; //
HeroNoEnough = 1301; // HeroNoEnough = 1301; //
HeroMaxLv = 1302; // HeroMaxLv = 1302; //
HeroInitCreat = 1303; // HeroInitCreat = 1303; //
HeroColorErr = 1304; //
HeroColorErr = 1304; // HeroSkillUpErr = 1305; //
HeroSkillUpErr = 1305;// HeroMaxResonate = 1306; //
HeroMaxResonate = 1306; // HeroNoResonate = 1307; //
HeroNoResonate = 1307; //
HeroNotNeedResonate = 1308; // HeroNotNeedResonate = 1308; //
HeroNoEnergy = 1309; // HeroNoEnergy = 1309; //
HeroCreate = 1310; // HeroCreate = 1310; //
HeroEquipUpdate = 1311; //
HeroMaxAwaken = 1312; //
HeroIsLock = 1313; //
// equipment // equipment
EquipmentOnFoundEquipment = 1400; // EquipmentOnFoundEquipment = 1400; //
EquipmentLvlimitReached = 1401; // EquipmentLvlimitReached = 1401; //
// mainStory
StoryNotFindChapter = 1500; // 线
StoryIDFailed = 1501; // ID
// task
TaskInit = 1600; //
TaskReset = 1601; //
TaskHandle = 1602; //
TaskReceived = 1603; //
TaskActiveInit = 1606; //
TaskActiveNofound = 1604; //
TaskActiveNoenough = 1605; //
} }

View File

@ -2,7 +2,7 @@ syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
message DBFriend { message DBFriend {
string uId = 1; //@go_tags(`bson:"uId"`) ID string uid = 1; //@go_tags(`bson:"uid"`) ID
repeated string friendIds = 2; //@go_tags(`bson:"friendIds"`) ID repeated string friendIds = 2; //@go_tags(`bson:"friendIds"`) ID
repeated string applyIds = 3; //@go_tags(`bson:"applyIds"`) ID repeated string applyIds = 3; //@go_tags(`bson:"applyIds"`) ID
repeated string blackIds = 4; //@go_tags(`bson:"blackIds"`) ID repeated string blackIds = 4; //@go_tags(`bson:"blackIds"`) ID

View File

@ -14,13 +14,13 @@ message FriendBase {
// //
message FriendListReq {} message FriendListReq {}
message FriendListRsp { repeated FriendBase list = 1; } message FriendListResp { repeated FriendBase list = 1; }
// //
message FriendApplyReq { message FriendApplyReq {
string friendId = 1; //ID string friendId = 1; //ID
} }
message FriendApplyRsp { message FriendApplyResp {
string userId = 1; //ID string userId = 1; //ID
string friendId = 2; //ID string friendId = 2; //ID
} }
@ -30,7 +30,7 @@ message FriendDelReq {
string friendId = 1; //ID string friendId = 1; //ID
} }
message FriendDelRsp { message FriendDelResp {
string friendId = 1; //ID string friendId = 1; //ID
string userId = 2; //ID string userId = 2; //ID
} }
@ -39,7 +39,7 @@ message FriendDelRsp {
message FriendAgreeReq { message FriendAgreeReq {
repeated string friendIds = 1; // repeated string friendIds = 1; //
} }
message FriendAgreeRsp { message FriendAgreeResp {
int32 Num = 1; // int32 Num = 1; //
} }
@ -47,30 +47,30 @@ message FriendAgreeRsp {
message FriendRefuseReq { message FriendRefuseReq {
repeated string friendIds = 1; // repeated string friendIds = 1; //
} }
message FriendRefuseRsp { message FriendRefuseResp {
int32 Num = 1; // int32 Num = 1; //
} }
// //
message FriendApplyListReq {} message FriendApplyListReq {}
message FriendApplyListRsp { repeated FriendBase list = 1; } message FriendApplyListResp { repeated FriendBase list = 1; }
// //
message FriendSearchReq { message FriendSearchReq {
string nickName = 1; // string nickName = 1; //
} }
message FriendSearchRsp { FriendBase friend = 1; } message FriendSearchResp { FriendBase friend = 1; }
// //
message FriendBlackListReq {} message FriendBlackListReq {}
message FriendBlackListRsp { repeated FriendBase friends = 1; } message FriendBlackListResp { repeated FriendBase friends = 1; }
// //
message FriendBlackAddReq { string friendId = 1; } message FriendBlackAddReq { string friendId = 1; }
message FriendBlackAddRsp { message FriendBlackAddResp {
string friendId = 1; string friendId = 1;
string userId = 2; string userId = 2;
} }
@ -78,7 +78,7 @@ message FriendBlackAddRsp {
// //
message FriendDelBlackReq { string friendId = 1; } message FriendDelBlackReq { string friendId = 1; }
message FriendDelBlackRsp { message FriendDelBlackResp {
string friendId = 1; string friendId = 1;
string userId = 2; string userId = 2;
} }
@ -86,7 +86,7 @@ message FriendDelBlackRsp {
// //
message FriendReceiveReq { string friendId = 1; } message FriendReceiveReq { string friendId = 1; }
message FriendReceiveRsp { message FriendReceiveResp {
string friendId = 1; string friendId = 1;
string userId = 2; string userId = 2;
} }
@ -94,7 +94,7 @@ message FriendReceiveRsp {
// //
message FriendGiveReq { string friendId = 1; } message FriendGiveReq { string friendId = 1; }
message FriendGiveRsp { message FriendGiveResp {
string friendId = 1; string friendId = 1;
string userId = 2; string userId = 2;
} }
@ -102,7 +102,7 @@ message FriendGiveRsp {
// //
message FriendTotalReq { string friendId = 1; } message FriendTotalReq { string friendId = 1; }
message FriendTotalRsp { message FriendTotalResp {
string friendId = 1; string friendId = 1;
int32 total = 2; // int32 total = 2; //
} }

View File

@ -1,158 +0,0 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";
package google.protobuf;
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option go_package = "google.golang.org/protobuf/types/known/anypb";
option java_package = "com.google.protobuf";
option java_outer_classname = "AnyProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
// `Any` contains an arbitrary serialized protocol buffer message along with a
// URL that describes the type of the serialized message.
//
// Protobuf library provides support to pack/unpack Any values in the form
// of utility functions or additional generated methods of the Any type.
//
// Example 1: Pack and unpack a message in C++.
//
// Foo foo = ...;
// Any any;
// any.PackFrom(foo);
// ...
// if (any.UnpackTo(&foo)) {
// ...
// }
//
// Example 2: Pack and unpack a message in Java.
//
// Foo foo = ...;
// Any any = Any.pack(foo);
// ...
// if (any.is(Foo.class)) {
// foo = any.unpack(Foo.class);
// }
//
// Example 3: Pack and unpack a message in Python.
//
// foo = Foo(...)
// any = Any()
// any.Pack(foo)
// ...
// if any.Is(Foo.DESCRIPTOR):
// any.Unpack(foo)
// ...
//
// Example 4: Pack and unpack a message in Go
//
// foo := &pb.Foo{...}
// any, err := anypb.New(foo)
// if err != nil {
// ...
// }
// ...
// foo := &pb.Foo{}
// if err := any.UnmarshalTo(foo); err != nil {
// ...
// }
//
// The pack methods provided by protobuf library will by default use
// 'type.googleapis.com/full.type.name' as the type URL and the unpack
// methods only use the fully qualified type name after the last '/'
// in the type URL, for example "foo.bar.com/x/y.z" will yield type
// name "y.z".
//
//
// JSON
//
// The JSON representation of an `Any` value uses the regular
// representation of the deserialized, embedded message, with an
// additional field `@type` which contains the type URL. Example:
//
// package google.profile;
// message Person {
// string first_name = 1;
// string last_name = 2;
// }
//
// {
// "@type": "type.googleapis.com/google.profile.Person",
// "firstName": <string>,
// "lastName": <string>
// }
//
// If the embedded message type is well-known and has a custom JSON
// representation, that representation will be embedded adding a field
// `value` which holds the custom JSON in addition to the `@type`
// field. Example (for message [google.protobuf.Duration][]):
//
// {
// "@type": "type.googleapis.com/google.protobuf.Duration",
// "value": "1.212s"
// }
//
message Any {
// A URL/resource name that uniquely identifies the type of the serialized
// protocol buffer message. This string must contain at least
// one "/" character. The last segment of the URL's path must represent
// the fully qualified name of the type (as in
// `path/google.protobuf.Duration`). The name should be in a canonical form
// (e.g., leading "." is not accepted).
//
// In practice, teams usually precompile into the binary all types that they
// expect it to use in the context of Any. However, for URLs which use the
// scheme `http`, `https`, or no scheme, one can optionally set up a type
// server that maps type URLs to message definitions as follows:
//
// * If no scheme is provided, `https` is assumed.
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
// value in binary format, or produce an error.
// * Applications are allowed to cache lookup results based on the
// URL, or have them precompiled into a binary to avoid any
// lookup. Therefore, binary compatibility needs to be preserved
// on changes to types. (Use versioned type names to manage
// breaking changes.)
//
// Note: this functionality is not currently available in the official
// protobuf release, and it is not used for type URLs beginning with
// type.googleapis.com.
//
// Schemes other than `http`, `https` (or the empty scheme) might be
// used with implementation specific semantics.
//
string type_url = 1;
// Must be a valid serialized protocol buffer of the above specified type.
bytes value = 2;
}

View File

@ -29,7 +29,7 @@ message DBHero {
int32 resonateNum = 18; //@go_tags(`bson:"resonateNum"`) int32 resonateNum = 18; //@go_tags(`bson:"resonateNum"`)
int32 distributionResonate = int32 distributionResonate =
19; //@go_tags(`bson:"distributionResonate"`) 19; //@go_tags(`bson:"distributionResonate"`)
map<int32, int32> energy = 20; // @go_tags(`bson:"energy"`) map<int32, int32> energy = 20; // @go_tags(`bson:"energy"`)[1,0]
int32 sameCount = 21; // @go_tags(`bson:"sameCount"`) int32 sameCount = 21; // @go_tags(`bson:"sameCount"`)
int32 suiteId = 22; //@go_tags(`bson:"suiteId"`) Id int32 suiteId = 22; //@go_tags(`bson:"suiteId"`) Id
int32 suiteExtId = 23; // go_tags(`bson:"suiteExtId"`) Id int32 suiteExtId = 23; // go_tags(`bson:"suiteExtId"`) Id

View File

@ -6,12 +6,12 @@ import "hero_db.proto";
message HeroInfoReq { message HeroInfoReq {
string heroId = 1; //ID string heroId = 1; //ID
} }
message HeroInfoRsp { DBHero base = 1; } message HeroInfoResp { DBHero base = 1; }
// //
message HeroListReq {} message HeroListReq {}
message HeroListRsp { repeated DBHero list = 1; } message HeroListResp { repeated DBHero list = 1; }
/// : () /// : ()
/// : (使) /// : (使)
@ -64,8 +64,7 @@ message HeroStrengthenUpSkillResp {
// //
message HeroResonanceReq { message HeroResonanceReq {
string heroObjID = 1; // ID string heroObjID = 1; // ID
string costObjID = 2; // repeated string costObjID = 2; //
int32 amount = 3; //
} }
message HeroResonanceResp { message HeroResonanceResp {
@ -116,3 +115,13 @@ message HeroProperty {
map<string, int32> property = 2; // map<string, int32> property = 2; //
map<string, int32> addProperty = 3; // map<string, int32> addProperty = 3; //
} }
//
message HeroLockReq{
string heroid = 1;
}
//
message HeroLockResp{
DBHero hero = 1; //
}

View File

@ -4,30 +4,34 @@ import "items_db.proto";
// //
message ItemsGetlistReq { message ItemsGetlistReq {
int32 IType = 1; // int32 IType = 1; //
} }
// //
message ItemsGetlistResp { message ItemsGetlistResp {
repeated DB_UserItemData Grids = 1; // repeated DB_UserItemData Grids = 1; //
} }
//使 //使
message ItemsUseItemReq { message ItemsUseItemReq {
int32 GridId = 1; //Id string GridId = 1; //Id
int32 ItemId = 2; //Id int32 ItemId = 2; //Id
uint32 Amount = 3; //使 uint32 Amount = 3; //使
} }
//使 //使
message ItemsUseItemResp {} message ItemsUseItemResp {
}
//sailitem //sailitem
message ItemsSellItemReq { message ItemsSellItemReq {
int32 GridId = 1; //Id string GridId = 1; //Id
int32 ItemId = 2; //Id int32 ItemId = 2; //Id
uint32 Amount = 3; //使 uint32 Amount = 3; //使
} }
// //
message ItemsSellItemResp {} message ItemsSellItemResp {
}

View File

@ -1,15 +1,6 @@
syntax = "proto3"; syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
import "comm.proto";
// message Cache_mailData {
// string UserID = 1;
// repeated DB_MailData MailData = 2;
// }
message MailAttachment { //
uint32 ItemId = 1; // iD
uint32 ItemCount = 2; //
}
message DBMailData { message DBMailData {
string ObjId = 1; // @go_tags(`bson:"_id"`) ID string ObjId = 1; // @go_tags(`bson:"_id"`) ID
@ -20,5 +11,5 @@ message DBMailData {
uint64 DueTime = 6; // uint64 DueTime = 6; //
bool Check = 7; // bool Check = 7; //
bool Reward = 8; // bool Reward = 8; //
repeated MailAttachment Items = 9; // repeated UserAssets Items = 9; //
} }

View File

@ -2,22 +2,43 @@ syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
import "mail_db.proto"; import "mail_db.proto";
message MailGetListReq {} message MailGetListReq {
}
// //
message MailGetListResp { repeated DBMailData Mails = 1; } message MailGetListResp {
repeated DBMailData Mails = 1;
}
// //
message MailReadMailReq { string ObjID = 1; } message MailReadMailReq {
string ObjID = 1;
}
message MailReadMailResp { DBMailData Mail = 1; } message MailReadMailResp {
DBMailData Mail = 1;
}
// //
message MailGetUserMailAttachmentReq { string ObjID = 1; } message MailGetUserMailAttachmentReq {
string ObjID = 1;
}
message MailGetUserMailAttachmentResp { DBMailData Mail = 1; } message MailGetUserMailAttachmentResp {
DBMailData Mail = 1;
}
// //
message MailDelMailReq { string ObjID = 1; } message MailDelMailReq {
string ObjID = 1;
}
message MailDelMailResp { repeated DBMailData Mail = 1; } message MailDelMailResp {
repeated DBMailData Mail = 1;
}
//
message MailGetNewMailPush{
DBMailData Mail = 1; //
}

View File

@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = ".;pb";
//
message DBSystemNotify {
string id = 1; //Id
string title = 2; //
string content = 3; //
bool istop = 4; //
int64 ctime = 5; //
int64 rtime = 6; //
}

View File

@ -1,6 +1,7 @@
syntax = "proto3"; syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
import "errorcode.proto"; import "errorcode.proto";
import "notify/notify_db.proto";
// //
message NotifyErrorNotifyPush { message NotifyErrorNotifyPush {
@ -8,5 +9,15 @@ message NotifyErrorNotifyPush {
string ReqSubType = 2; // :login user的模块中 api_login string ReqSubType = 2; // :login user的模块中 api_login
ErrorCode Code = 3; // errorcode.proto ErrorCode Code = 3; // errorcode.proto
string Message = 4; // string Message = 4; //
string Data = 6; // string Data = 5; //
}
//
message NotifyGetListReq {
}
//
message NotifyGetListResp {
int64 LastReadTime = 1; //
repeated DBSystemNotify SysNotify = 2; //
} }

View File

@ -0,0 +1,35 @@
syntax = "proto3";
option go_package = ".;pb";
enum ShopType {
Null = 0;
GoldShop = 1;
DiamondShop = 2;
PVPShop = 3;
PVEShop = 4;
AllianceShop = 5;
}
message UserShopData {
int64 LastRefreshTime = 1; //
int32 ManualRefreshNum = 2; //
repeated int32 Items = 3; //
}
message DBShop {
string id = 1; //@go_tags(`bson:"_id"`) id
string uid = 2; //@go_tags(`bson:"uid"`) id
UserShopData goldShop = 3; //@go_tags(`bson:"goldShop"`)
UserShopData diamondShop = 4; //@go_tags(`bson:"diamondShop"`)
UserShopData pvpShop = 5; //@go_tags(`bson:"pvpShop"`)
UserShopData pveShop = 6; //@go_tags(`bson:"pveShop"`)
UserShopData allianceShop = 7; //@go_tags(`bson:"allianceShop"`)
}
message DBShopItem {
string id = 1; //@go_tags(`bson:"_id"`) id
string uid = 2; //@go_tags(`bson:"uid"`) id
int32 goodsId = 3; //@go_tags(`bson:"goodsId"`)Id
int32 buyNum = 4; //@go_tags(`bson:"buyNum"`)
int64 lastBuyTime = 5; //@go_tags(`bson:"lastBuyTime"`)
}

View File

@ -0,0 +1,35 @@
syntax = "proto3";
option go_package = ".;pb";
import "shop_db.proto";
import "comm.proto";
//
message ShopItem {
int32 GoodsId = 1; //Id
repeated UserAssets Items = 2; //
repeated UserAssets Consume = 3; //
int32 Sale = 4; //
int32 LeftBuyNum = 5; //
}
//
message ShopGetListReq {
ShopType sType = 1; //
bool IsManualRefresh = 2; //
}
//
message ShopGetListResp {
repeated ShopItem Goods = 1; //
}
//
message ShopBuyReq {
int32 GoodsId = 1; //Id
}
//
message ShopBuyResp {
bool IsSucc = 1; //
}

View File

@ -0,0 +1,14 @@
syntax = "proto3";
option go_package = ".;pb";
message DBStory {
string id = 1; //@go_tags(`bson:"_id"`) ID
string uid = 2; //@go_tags(`bson:"uid"`) ID
int32 chapterId = 3; //@go_tags(`bson:"chapterId"`) ID
int32 storyId = 4; //@go_tags(`bson:"storyId"`) 线ID
int32 intensity = 5; //@go_tags(`bson:"intensity"`)
int32 awaredID = 6; //@go_tags(`bson:"awaredID"`) ID
int32 progress = 7; // @go_tags(`bson:"progress"`) ()
int32 totalBox = 8; // @go_tags(`bson:"totalBox"`)
repeated int32 branchID = 9; // @go_tags(`bson:"branchID"`)
}

View File

@ -0,0 +1,32 @@
syntax = "proto3";
option go_package = ".;pb";
import "story_db.proto";
//
message StoryGetListReq {
}
//
message StoryGetListResp {
repeated DBStory data = 1;
}
//
message StoryGetRewrdReq {
uint32 chapterId = 1; // ID
uint32 boxId = 2; // ID
}
message StoryGetRewrdResp {
DBStory data = 1; //
}
//
message StoryChallengeReq {
uint32 chapterId = 1; // ID
uint32 storyId = 2; // ID
}
message StoryChallengeResp {
DBStory data = 1; //
}

View File

@ -0,0 +1,19 @@
syntax = "proto3";
option go_package = ".;pb";
message DBTask {
string id = 1; //@go_tags(`bson:"_id"`) ID
string uid = 2; //@go_tags(`bson:"uid"`) ID
int32 taskId = 3; //@go_tags(`bson:"taskId"`) Id
int32 progress = 4; //@go_tags(`bson:"progress"`) /
int32 active = 5; //@go_tags(`bson:"active"`)
int32 status = 6; //@go_tags(`bson:"status"`) 0 1
int32 received = 7; //@go_tags(`bson:"received"`) 0 1
}
message DBTaskActive {
string id = 1; //@go_tags(`bson:"_id"`) ID
string uid = 2; //@go_tags(`bson:"uid"`) ID
int32 rId = 3; //@go_tags(`bson:"taskId"`) rewardId
int32 received = 4; //@go_tags(`bson:"received"`) 0 1
}

View File

@ -0,0 +1,34 @@
syntax = "proto3";
option go_package = ".;pb";
import "task_db.proto";
//
message TaskReceiveReq {
int32 taskTag = 1; // 1/2/3
string id = 2; //ID
}
message TaskReceiveResp {
int32 taskId = 1; //ID
}
//
message TaskListReq {
int32 taskTag = 1; ////
}
message TaskListResp { repeated DBTask list = 1; }
//
message TaskActiveListReq { int32 taskTag = 1; }
message TaskActiveListResp { repeated DBTaskActive list = 1; }
//
message TaskActiveReceiveReq {
int32 taskTag = 1; // 1/2
string id = 2; //id
}
message TaskActiveReceiveResp {
int32 taskTag = 1;
string id = 2;
}

View File

@ -5,6 +5,7 @@ message CacheUser {
string uid = 1; string uid = 1;
string SessionId = 2; string SessionId = 2;
string GatewayServiceId = 3; string GatewayServiceId = 3;
string ip = 4;
// DB_UserData UserData = 4; //@go_tags(`json:",inline"`) // DB_UserData UserData = 4; //@go_tags(`json:",inline"`)
} }
@ -24,4 +25,7 @@ message DBUser {
int32 gold = 13; //@go_tags(`bson:"gold"`) int32 gold = 13; //@go_tags(`bson:"gold"`)
int32 exp = 14; //@go_tags(`bson:"exp"`) int32 exp = 14; //@go_tags(`bson:"exp"`)
bool created = 15; //@go_tags(`bson:"created"`) bool created = 15; //@go_tags(`bson:"created"`)
int32 lv = 16; //@go_tags(`bson:"lv"`)
int32 vip = 17; //@go_tags(`bson:"vip"`) vip
int32 diamond = 18; //@go_tags(`bson:"diamond"`)
} }

View File

@ -2,7 +2,7 @@ syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
import "errorcode.proto"; import "errorcode.proto";
import "user_db.proto"; import "user_db.proto";
import "comm.proto";
// //
message UserLoginReq { message UserLoginReq {
string account = 1; // string account = 1; //
@ -16,27 +16,25 @@ message UserRegisterReq {
int32 sid = 2; int32 sid = 2;
} }
message UserRegisterRsp { message UserRegisterResp {
ErrorCode Code = 1; ErrorCode Code = 1;
string account = 2; string account = 2;
} }
message UserLoadRsp { CacheUser data = 1; } message UserLoadResp { CacheUser data = 1; }
// //
message UserCreateReq { message UserCreateReq {
string NickName = 1; // string NickName = 1; //
} }
message UserCreateRsp {} message UserCreateResp {}
// //
message UserAddResReq { message UserAddResReq {
string resType = 1; // UserAssets res = 1; //
int32 count = 2; //
} }
message UserAddResResp { message UserAddResResp {
string resType = 1; // UserAssets res = 1; //
int32 count = 2; //
} }

View File

@ -60,26 +60,38 @@
<v-card> <v-card>
<v-card-title>{{item.FieldName}}</v-card-title> <v-card-title>{{item.FieldName}}</v-card-title>
<v-card-text> <v-card-text>
<v-text-field v-if="item.FieldType != 'Object'" <template v-if="item.FieldType == 'number' || item.FieldType == 'text'">
color="tertiary" <v-text-field color="tertiary"
v-model="item.FieldValue"
:label="item.FieldName"
:type="item.FieldType"
:hint="item.FieldType"
:disabled="!isconnect"
outlined
clearable></v-text-field>
<Vue3JsonEditor v-else
v-model="item.FieldValue" v-model="item.FieldValue"
@json-change="(v)=>{item.FieldValue = v}" :label="item.FieldName"
:showBtns="false" :type="item.FieldType"
:mode="'code'" :hint="item.FieldType"
lang="zh" :disabled="!isconnect"
:expandedOnStart="false"></Vue3JsonEditor> outlined
clearable></v-text-field>
</template>
<template v-else-if="item.FieldType == 'bool'">
<v-checkbox v-model="item.FieldValue"
:label="item.FieldName"></v-checkbox>
</template>
<template v-else-if="item.FieldType == 'enum'">
<v-select v-model="item.FieldValue"
:items="item.FieldRange"
item-title="name"
item-value="value"
:label="item.FieldName"></v-select>
</template>
<template v-else>
<Vue3JsonEditor v-model="item.FieldValue"
@json-change="(v)=>{item.FieldValue = v}"
:showBtns="false"
:mode="'code'"
lang="zh"
:expandedOnStart="false"></Vue3JsonEditor>
</template>
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
<v-row class="mt-5"> <v-row class="mt-5">
@ -191,13 +203,16 @@ export default defineComponent({
computed: {}, computed: {},
setup() { setup() {
const proto_models = reactive([ const proto_models = reactive([
{ mainType: 'notify', disabled: true, subs: [] }, { mainType: 'notify', disabled: false, subs: [] },
{ mainType: 'user', subs: [] }, { mainType: 'user', subs: [] },
{ mainType: 'items', subs: [] }, { mainType: 'items', subs: [] },
{ mainType: 'mail', subs: [] }, { mainType: 'mail', subs: [] },
{ mainType: 'friend', subs: [] }, { mainType: 'friend', subs: [] },
{ mainType: 'equipment', subs: [] }, { mainType: 'equipment', subs: [] },
{ mainType: 'hero', subs: [] }, { mainType: 'hero', subs: [] },
{ mainType: 'shop', subs: [] },
{ mainType: 'stak', subs: [] },
{ mainType: 'story', subs: [] },
]) ])
for (const v of Object.keys(proto)) { for (const v of Object.keys(proto)) {
for (const v1 of proto_models) { for (const v1 of proto_models) {
@ -321,36 +336,63 @@ export default defineComponent({
this.reqproto = [] this.reqproto = []
let keys = Object.keys(this.subSelect.reqproto.fields) let keys = Object.keys(this.subSelect.reqproto.fields)
for (const v of keys) { for (const v of keys) {
let rule = this.subSelect.reqproto.fields[v].rule
let ftype = this.subSelect.reqproto.fields[v].type let ftype = this.subSelect.reqproto.fields[v].type
console.log('ftype', ftype) let range = []
let fvalue = null let fvalue = null
switch (this.subSelect.reqproto.fields[v].type) { if (!rule) {
case 'int32': switch (ftype) {
case 'int64': case 'int32':
case 'uint32': case 'int64':
case 'uint64': case 'uint32':
case 'float32': case 'uint64':
case 'float64': case 'float32':
ftype = 'number' case 'float64':
fvalue = 0 ftype = 'number'
break fvalue = 0
case 'string': break
ftype = 'text' case 'string':
fvalue = '' ftype = 'text'
break fvalue = ''
default: break
ftype = 'Object' case 'bool':
fvalue = {} ftype = 'bool'
break fvalue = false
} break
default:
let data = proto.lookup(ftype)
if (data == null) {
ftype = 'object'
fvalue = {}
} else {
if (data.values) {
//
ftype = 'enum'
for (let key of Object.keys(data.values)) {
range.push({ name: key, value: data.values[key] })
}
fvalue = range[0]
} else {
ftype = 'object'
fvalue = {}
}
}
break
}
} else {
ftype = 'object'
fvalue = {}
}
console.log('ftype', ftype)
this.reqproto.push({ this.reqproto.push({
FieldName: v, FieldName: v,
FieldType: ftype, FieldType: ftype,
FieldRange: range,
FieldValue: fvalue, FieldValue: fvalue,
}) })
} }
console.log(this.reqproto) // console.log(this.reqproto)
}, },
closelisten() { closelisten() {
this.isconnect = false this.isconnect = false
@ -368,10 +410,10 @@ export default defineComponent({
.then((bytes) => { .then((bytes) => {
console.log('bytes', bytes) console.log('bytes', bytes)
let message = proto.lookup('UserMessage').decode(bytes) let message = proto.lookup('UserMessage').decode(bytes)
console.log('接收到消息 message', message)
let mainType = message.MainType let mainType = message.MainType
let subType = message.SubType let subType = message.SubType
let iskeep = false let iskeep = false
console.log('接收到消息 message', message)
for (const v of this.proto_models) { for (const v of this.proto_models) {
if (v.mainType == mainType) { if (v.mainType == mainType) {
for (const v1 of v.subs) { for (const v1 of v.subs) {