上传梦工厂前端工具

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%\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

View File

@ -71,7 +71,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
id: 2
},
ErrorData: {
type: "string",
type: "google.protobuf.Any",
id: 3
},
Reply: {
@ -111,17 +111,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
type: "string",
id: 1
},
MainType: {
type: "string",
Reply: {
rule: "repeated",
type: "UserMessage",
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
}
},
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: {
values: {
Success: 0,
@ -218,6 +235,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
GoldNoEnough: 1003,
DiamondNoEnough: 1004,
RoleCreated: 1005,
NameExist: 1006,
FriendNotSelf: 1100,
FriendSelfMax: 1101,
FriendTargetMax: 1102,
@ -245,8 +263,20 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
HeroNotNeedResonate: 1308,
HeroNoEnergy: 1309,
HeroCreate: 1310,
HeroEquipUpdate: 1311,
HeroMaxAwaken: 1312,
HeroIsLock: 1313,
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: {
@ -395,7 +425,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
},
DBFriend: {
fields: {
uId: {
uid: {
type: "string",
id: 1
},
@ -451,7 +481,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
FriendListReq: {
fields: {}
},
FriendListRsp: {
FriendListResp: {
fields: {
list: {
rule: "repeated",
@ -468,7 +498,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendApplyRsp: {
FriendApplyResp: {
fields: {
userId: {
type: "string",
@ -488,7 +518,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendDelRsp: {
FriendDelResp: {
fields: {
friendId: {
type: "string",
@ -509,7 +539,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendAgreeRsp: {
FriendAgreeResp: {
fields: {
Num: {
type: "int32",
@ -526,7 +556,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendRefuseRsp: {
FriendRefuseResp: {
fields: {
Num: {
type: "int32",
@ -537,7 +567,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
FriendApplyListReq: {
fields: {}
},
FriendApplyListRsp: {
FriendApplyListResp: {
fields: {
list: {
rule: "repeated",
@ -554,7 +584,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendSearchRsp: {
FriendSearchResp: {
fields: {
friend: {
type: "FriendBase",
@ -565,7 +595,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
FriendBlackListReq: {
fields: {}
},
FriendBlackListRsp: {
FriendBlackListResp: {
fields: {
friends: {
rule: "repeated",
@ -582,7 +612,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendBlackAddRsp: {
FriendBlackAddResp: {
fields: {
friendId: {
type: "string",
@ -602,7 +632,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendDelBlackRsp: {
FriendDelBlackResp: {
fields: {
friendId: {
type: "string",
@ -622,7 +652,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendReceiveRsp: {
FriendReceiveResp: {
fields: {
friendId: {
type: "string",
@ -642,7 +672,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendGiveRsp: {
FriendGiveResp: {
fields: {
friendId: {
type: "string",
@ -662,7 +692,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
FriendTotalRsp: {
FriendTotalResp: {
fields: {
friendId: {
type: "string",
@ -800,7 +830,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
HeroInfoRsp: {
HeroInfoResp: {
fields: {
base: {
type: "DBHero",
@ -811,7 +841,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
HeroListReq: {
fields: {}
},
HeroListRsp: {
HeroListResp: {
fields: {
list: {
rule: "repeated",
@ -921,12 +951,9 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
id: 1
},
costObjID: {
rule: "repeated",
type: "string",
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: {
fields: {
gridId: {
@ -1098,7 +1141,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
ItemsUseItemReq: {
fields: {
GridId: {
type: "int32",
type: "string",
id: 1
},
ItemId: {
@ -1117,7 +1160,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
ItemsSellItemReq: {
fields: {
GridId: {
type: "int32",
type: "string",
id: 1
},
ItemId: {
@ -1133,18 +1176,6 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
ItemsSellItemResp: {
fields: {}
},
MailAttachment: {
fields: {
ItemId: {
type: "uint32",
id: 1
},
ItemCount: {
type: "uint32",
id: 2
}
}
},
DBMailData: {
fields: {
ObjId: {
@ -1181,7 +1212,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
},
Items: {
rule: "repeated",
type: "MailAttachment",
type: "UserAssets",
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: {
fields: {
ReqMainType: {
@ -1267,7 +1334,392 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
},
Data: {
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
},
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: {
type: "string",
id: 3
},
ip: {
type: "string",
id: 4
}
}
},
@ -1348,6 +1804,18 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
created: {
type: "bool",
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: {
Code: {
type: "ErrorCode",
@ -1395,7 +1863,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
UserLoadRsp: {
UserLoadResp: {
fields: {
data: {
type: "CacheUser",
@ -1411,30 +1879,22 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
UserCreateRsp: {
UserCreateResp: {
fields: {}
},
UserAddResReq: {
fields: {
resType: {
type: "string",
res: {
type: "UserAssets",
id: 1
},
count: {
type: "int32",
id: 2
}
}
},
UserAddResResp: {
fields: {
resType: {
type: "string",
res: {
type: "UserAssets",
id: 1
},
count: {
type: "int32",
id: 2
}
}
}

View File

@ -27,7 +27,7 @@ message AgentMessage {
message RPCMessageReply {
ErrorCode Code = 1;
string ErrorMessage = 2;
string ErrorData = 3;
google.protobuf.Any ErrorData = 3;
repeated UserMessage Reply = 4;
}
@ -43,9 +43,7 @@ message AgentUnBuildReq { string UserSessionId = 1; }
//
message AgentSendMessageReq {
string UserSessionId = 1;
string MainType = 2;
string SubType = 3;
google.protobuf.Any Data = 4;
repeated UserMessage Reply = 2;
}
//
@ -67,13 +65,27 @@ message BroadCastMessageReq {
message AgentCloseeReq { string UserSessionId = 1; }
//线
message NoticeUserCloseReq {string UserSessionId = 1; string UserId = 2; }
message NoticeUserCloseReq {
string UserSessionId = 1;
string UserId = 2;
}
//
enum HeroAttributesType{
Hp = 0; //
Atk = 1; //
Def = 2; //
enum HeroAttributesType {
Hp = 0; //
Atk = 1; //
Def = 2; //
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";
//
message EquipmentGetListReq {}
message EquipmentGetListReq {
}
//
message EquipmentGetListResp {
repeated DB_Equipment Equipments = 1; //
repeated DB_Equipment Equipments = 1; //
}
//
message EquipmentEquipReq {
string HeroCardId = 1; //Id
repeated string EquipmentId = 2; //Id 0-5
message EquipmentEquipReq{
string HeroCardId = 1; //Id
repeated string EquipmentId = 2; //Id 0-5
}
//
message EquipmentEquipResp {
repeated DB_Equipment Equipments = 1; //
message EquipmentEquipResp{
repeated DB_Equipment Equipments = 1; //
}
//
message EquipmentUpgradeReq {
string EquipmentId = 1; //Id
message EquipmentUpgradeReq{
string EquipmentId = 1; //Id
}
//
message EquipmentUpgradeResp {
bool IsSucc = 1;
repeated DB_Equipment Equipment =
2; //
message EquipmentUpgradeResp{
bool IsSucc = 1;
repeated DB_Equipment Equipment = 2; //
}

View File

@ -29,6 +29,7 @@ enum ErrorCode {
GoldNoEnough = 1003; //
DiamondNoEnough = 1004; //
RoleCreated = 1005; //
NameExist = 1006; //
// friend
FriendNotSelf = 1100; //
@ -51,20 +52,34 @@ enum ErrorCode {
ItemsGirdAmountUpper = 1203; //
// hero
HeroNoExist = 1300; //
HeroNoEnough = 1301; //
HeroMaxLv = 1302; //
HeroInitCreat = 1303; //
HeroColorErr = 1304; //
HeroSkillUpErr = 1305;//
HeroMaxResonate = 1306; //
HeroNoResonate = 1307; //
HeroNoExist = 1300; //
HeroNoEnough = 1301; //
HeroMaxLv = 1302; //
HeroInitCreat = 1303; //
HeroColorErr = 1304; //
HeroSkillUpErr = 1305; //
HeroMaxResonate = 1306; //
HeroNoResonate = 1307; //
HeroNotNeedResonate = 1308; //
HeroNoEnergy = 1309; //
HeroCreate = 1310; //
HeroNoEnergy = 1309; //
HeroCreate = 1310; //
HeroEquipUpdate = 1311; //
HeroMaxAwaken = 1312; //
HeroIsLock = 1313; //
// equipment
EquipmentOnFoundEquipment = 1400; //
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";
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 applyIds = 3; //@go_tags(`bson:"applyIds"`) ID
repeated string blackIds = 4; //@go_tags(`bson:"blackIds"`) ID

View File

@ -14,13 +14,13 @@ message FriendBase {
//
message FriendListReq {}
message FriendListRsp { repeated FriendBase list = 1; }
message FriendListResp { repeated FriendBase list = 1; }
//
message FriendApplyReq {
string friendId = 1; //ID
}
message FriendApplyRsp {
message FriendApplyResp {
string userId = 1; //ID
string friendId = 2; //ID
}
@ -30,7 +30,7 @@ message FriendDelReq {
string friendId = 1; //ID
}
message FriendDelRsp {
message FriendDelResp {
string friendId = 1; //ID
string userId = 2; //ID
}
@ -39,7 +39,7 @@ message FriendDelRsp {
message FriendAgreeReq {
repeated string friendIds = 1; //
}
message FriendAgreeRsp {
message FriendAgreeResp {
int32 Num = 1; //
}
@ -47,30 +47,30 @@ message FriendAgreeRsp {
message FriendRefuseReq {
repeated string friendIds = 1; //
}
message FriendRefuseRsp {
message FriendRefuseResp {
int32 Num = 1; //
}
//
message FriendApplyListReq {}
message FriendApplyListRsp { repeated FriendBase list = 1; }
message FriendApplyListResp { repeated FriendBase list = 1; }
//
message FriendSearchReq {
string nickName = 1; //
}
message FriendSearchRsp { FriendBase friend = 1; }
message FriendSearchResp { FriendBase friend = 1; }
//
message FriendBlackListReq {}
message FriendBlackListRsp { repeated FriendBase friends = 1; }
message FriendBlackListResp { repeated FriendBase friends = 1; }
//
message FriendBlackAddReq { string friendId = 1; }
message FriendBlackAddRsp {
message FriendBlackAddResp {
string friendId = 1;
string userId = 2;
}
@ -78,7 +78,7 @@ message FriendBlackAddRsp {
//
message FriendDelBlackReq { string friendId = 1; }
message FriendDelBlackRsp {
message FriendDelBlackResp {
string friendId = 1;
string userId = 2;
}
@ -86,7 +86,7 @@ message FriendDelBlackRsp {
//
message FriendReceiveReq { string friendId = 1; }
message FriendReceiveRsp {
message FriendReceiveResp {
string friendId = 1;
string userId = 2;
}
@ -94,7 +94,7 @@ message FriendReceiveRsp {
//
message FriendGiveReq { string friendId = 1; }
message FriendGiveRsp {
message FriendGiveResp {
string friendId = 1;
string userId = 2;
}
@ -102,7 +102,7 @@ message FriendGiveRsp {
//
message FriendTotalReq { string friendId = 1; }
message FriendTotalRsp {
message FriendTotalResp {
string friendId = 1;
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 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 suiteId = 22; //@go_tags(`bson:"suiteId"`) Id
int32 suiteExtId = 23; // go_tags(`bson:"suiteExtId"`) Id

View File

@ -6,12 +6,12 @@ import "hero_db.proto";
message HeroInfoReq {
string heroId = 1; //ID
}
message HeroInfoRsp { DBHero base = 1; }
message HeroInfoResp { DBHero base = 1; }
//
message HeroListReq {}
message HeroListRsp { repeated DBHero list = 1; }
message HeroListResp { repeated DBHero list = 1; }
/// : ()
/// : (使)
@ -64,8 +64,7 @@ message HeroStrengthenUpSkillResp {
//
message HeroResonanceReq {
string heroObjID = 1; // ID
string costObjID = 2; //
int32 amount = 3; //
repeated string costObjID = 2; //
}
message HeroResonanceResp {
@ -115,4 +114,14 @@ message HeroProperty {
string heroId = 1; //ID
map<string, int32> property = 2; //
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 {
int32 IType = 1; //
int32 IType = 1; //
}
//
message ItemsGetlistResp {
repeated DB_UserItemData Grids = 1; //
repeated DB_UserItemData Grids = 1; //
}
//使
message ItemsUseItemReq {
int32 GridId = 1; //Id
int32 ItemId = 2; //Id
uint32 Amount = 3; //使
string GridId = 1; //Id
int32 ItemId = 2; //Id
uint32 Amount = 3; //使
}
//使
message ItemsUseItemResp {}
message ItemsUseItemResp {
}
//sailitem
message ItemsSellItemReq {
int32 GridId = 1; //Id
int32 ItemId = 2; //Id
uint32 Amount = 3; //使
string GridId = 1; //Id
int32 ItemId = 2; //Id
uint32 Amount = 3; //使
}
//
message ItemsSellItemResp {}
message ItemsSellItemResp {
}

View File

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

View File

@ -2,22 +2,43 @@ syntax = "proto3";
option go_package = ".;pb";
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";
option go_package = ".;pb";
import "errorcode.proto";
import "notify/notify_db.proto";
//
message NotifyErrorNotifyPush {
@ -8,5 +9,15 @@ message NotifyErrorNotifyPush {
string ReqSubType = 2; // :login user的模块中 api_login
ErrorCode Code = 3; // errorcode.proto
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 SessionId = 2;
string GatewayServiceId = 3;
string ip = 4;
// DB_UserData UserData = 4; //@go_tags(`json:",inline"`)
}
@ -24,4 +25,7 @@ message DBUser {
int32 gold = 13; //@go_tags(`bson:"gold"`)
int32 exp = 14; //@go_tags(`bson:"exp"`)
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";
import "errorcode.proto";
import "user_db.proto";
import "comm.proto";
//
message UserLoginReq {
string account = 1; //
@ -16,27 +16,25 @@ message UserRegisterReq {
int32 sid = 2;
}
message UserRegisterRsp {
message UserRegisterResp {
ErrorCode Code = 1;
string account = 2;
}
message UserLoadRsp { CacheUser data = 1; }
message UserLoadResp { CacheUser data = 1; }
//
message UserCreateReq {
string NickName = 1; //
}
message UserCreateRsp {}
message UserCreateResp {}
//
message UserAddResReq {
string resType = 1; //
int32 count = 2; //
UserAssets res = 1; //
}
message UserAddResResp {
string resType = 1; //
int32 count = 2; //
UserAssets res = 1; //
}

View File

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