diff --git a/package-lock.json b/package-lock.json index 5a48a6a..8a9aaec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,8 @@ "@mdi/font": "5.9.55", "core-js": "^3.8.3", "google-protobuf": "^3.20.1", + "js-base64": "^3.7.2", + "js-md5": "^0.7.3", "protobufjs": "^6.11.3", "roboto-fontface": "*", "vue": "^3.2.13", @@ -7527,6 +7529,16 @@ "@sideway/pinpoint": "^2.0.0" } }, + "node_modules/js-base64": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.2.tgz", + "integrity": "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==" + }, + "node_modules/js-md5": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz", + "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==" + }, "node_modules/js-message": { "version": "1.0.7", "resolved": "https://registry.npmmirror.com/js-message/-/js-message-1.0.7.tgz", @@ -17862,6 +17874,16 @@ "@sideway/pinpoint": "^2.0.0" } }, + "js-base64": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.2.tgz", + "integrity": "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==" + }, + "js-md5": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz", + "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==" + }, "js-message": { "version": "1.0.7", "resolved": "https://registry.npmmirror.com/js-message/-/js-message-1.0.7.tgz", diff --git a/package.json b/package.json index bff96b0..92d5d1a 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "@mdi/font": "5.9.55", "core-js": "^3.8.3", "google-protobuf": "^3.20.1", + "js-base64": "^3.7.2", + "js-md5": "^0.7.3", "protobufjs": "^6.11.3", "roboto-fontface": "*", "vue": "^3.2.13", diff --git a/src/pb/proto.js b/src/pb/proto.js index bab2565..85548fc 100644 --- a/src/pb/proto.js +++ b/src/pb/proto.js @@ -46,13 +46,17 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr type: "string", id: 4 }, - Method: { + MainType: { type: "string", id: 5 }, + SubType: { + type: "string", + id: 6 + }, Message: { type: "google.protobuf.Any", - id: 6 + id: 7 } } }, @@ -62,13 +66,18 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr type: "ErrorCode", id: 1 }, - Message: { + ErrorMessage: { type: "string", id: 2 }, - Data: { + ErrorData: { type: "string", id: 3 + }, + Reply: { + rule: "repeated", + type: "UserMessage", + id: 4 } } }, @@ -161,6 +170,27 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, + NoticeUserCloseReq: { + fields: { + UserSessionId: { + type: "string", + id: 1 + }, + UserId: { + type: "string", + id: 2 + } + } + }, + HeroAttributesType: { + values: { + Hp: 0, + Atk: 1, + Def: 2, + Speed: 3, + Crit: 4 + } + }, ErrorCode: { values: { Success: 0, @@ -178,9 +208,16 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr DBError: 21, SystemError: 22, Exception: 100, + Unknown: 101, + ResNoEnough: 102, + ConfigurationException: 103, + ConfigNoFound: 104, SecKeyInvalid: 1000, SecKey: 1001, BindUser: 1002, + GoldNoEnough: 1003, + DiamondNoEnough: 1004, + RoleCreated: 1005, FriendNotSelf: 1100, FriendSelfMax: 1101, FriendTargetMax: 1102, @@ -192,7 +229,24 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr FriendTargetBlackYet: 1108, FriendApplyError: 1109, FriendBlackMax: 1110, - FriendSearchNameEmpty: 1111 + FriendSearchNameEmpty: 1111, + ItemsNoEnough: 1200, + ItemsNoFoundGird: 1201, + ItemsGridNumUpper: 1202, + ItemsGirdAmountUpper: 1203, + HeroNoExist: 1300, + HeroNoEnough: 1301, + HeroMaxLv: 1302, + HeroInitCreat: 1303, + HeroColorErr: 1304, + HeroSkillUpErr: 1305, + HeroMaxResonate: 1306, + HeroNoResonate: 1307, + HeroNotNeedResonate: 1308, + HeroNoEnergy: 1309, + HeroCreate: 1310, + EquipmentOnFoundEquipment: 1400, + EquipmentLvlimitReached: 1401 } }, google: { @@ -215,7 +269,115 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - DB_FriendData: { + EquipmentAttributeEntry: { + fields: { + Id: { + type: "int32", + id: 1 + }, + libraryid: { + type: "int32", + id: 2 + }, + AttrName: { + type: "string", + id: 3 + }, + Lv: { + type: "int32", + id: 4 + }, + Value: { + type: "int32", + id: 5 + } + } + }, + DB_Equipment: { + fields: { + Id: { + type: "string", + id: 1 + }, + cId: { + type: "sint32", + id: 2 + }, + uId: { + type: "string", + id: 3 + }, + heroId: { + type: "string", + id: 5 + }, + lv: { + type: "sint32", + id: 6 + }, + keepFailNum: { + type: "sint32", + id: 7 + }, + mainEntry: { + type: "EquipmentAttributeEntry", + id: 8 + }, + adverbEntry: { + rule: "repeated", + type: "EquipmentAttributeEntry", + id: 9 + }, + overlayNum: { + type: "uint32", + id: 10 + }, + isInitialState: { + type: "bool", + id: 11 + } + } + }, + EquipmentGetListReq: { + fields: {} + }, + EquipmentGetListResp: { + fields: { + Equipments: { + rule: "repeated", + type: "DB_Equipment", + id: 1 + } + } + }, + EquipmentEquipReq: { + fields: { + HeroCardId: { + type: "string", + id: 1 + }, + EquipmentId: { + rule: "repeated", + type: "string", + id: 2 + } + } + }, + EquipmentEquipResp: { + fields: {} + }, + EquipmentUpgradeReq: { + fields: { + EquipmentId: { + type: "string", + id: 1 + } + } + }, + EquipmentUpgradeResp: { + fields: {} + }, + DBFriend: { fields: { uId: { type: "string", @@ -270,10 +432,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_List_Req: { + FriendListReq: { fields: {} }, - Friend_List_Rsp: { + FriendListRsp: { fields: { list: { rule: "repeated", @@ -282,7 +444,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Apply_Req: { + FriendApplyReq: { fields: { friendId: { type: "string", @@ -290,7 +452,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Apply_Rsp: { + FriendApplyRsp: { fields: { userId: { type: "string", @@ -302,7 +464,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Del_Req: { + FriendDelReq: { fields: { friendId: { type: "string", @@ -310,7 +472,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Del_Rsp: { + FriendDelRsp: { fields: { friendId: { type: "string", @@ -322,7 +484,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Agree_Req: { + FriendAgreeReq: { fields: { friendIds: { rule: "repeated", @@ -331,7 +493,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Agree_Rsp: { + FriendAgreeRsp: { fields: { Num: { type: "int32", @@ -339,7 +501,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Refuse_Req: { + FriendRefuseReq: { fields: { friendIds: { rule: "repeated", @@ -348,7 +510,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Refuse_Rsp: { + FriendRefuseRsp: { fields: { Num: { type: "int32", @@ -356,10 +518,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_ApplyList_Req: { + FriendApplyListReq: { fields: {} }, - Friend_ApplyList_Rsp: { + FriendApplyListRsp: { fields: { list: { rule: "repeated", @@ -368,7 +530,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Search_Req: { + FriendSearchReq: { fields: { nickName: { type: "string", @@ -376,7 +538,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Search_Rsp: { + FriendSearchRsp: { fields: { friend: { type: "FriendBase", @@ -384,10 +546,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_BlackList_Req: { + FriendBlackListReq: { fields: {} }, - Friend_BlackList_Rsp: { + FriendBlackListRsp: { fields: { friends: { rule: "repeated", @@ -396,7 +558,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_BlackAdd_Req: { + FriendBlackAddReq: { fields: { friendId: { type: "string", @@ -404,7 +566,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_BlackAdd_Rsp: { + FriendBlackAddRsp: { fields: { friendId: { type: "string", @@ -416,7 +578,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_DelBlack_Req: { + FriendDelBlackReq: { fields: { friendId: { type: "string", @@ -424,7 +586,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_DelBlack_Rsp: { + FriendDelBlackRsp: { fields: { friendId: { type: "string", @@ -436,7 +598,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Receive_Req: { + FriendReceiveReq: { fields: { friendId: { type: "string", @@ -444,7 +606,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Receive_Rsp: { + FriendReceiveRsp: { fields: { friendId: { type: "string", @@ -456,7 +618,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Give_Req: { + FriendGiveReq: { fields: { friendId: { type: "string", @@ -464,7 +626,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Give_Rsp: { + FriendGiveRsp: { fields: { friendId: { type: "string", @@ -476,7 +638,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Total_Req: { + FriendTotalReq: { fields: { friendId: { type: "string", @@ -484,7 +646,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Friend_Total_Rsp: { + FriendTotalRsp: { fields: { friendId: { type: "string", @@ -496,6 +658,467 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, + pb: { + nested: { + SkillData: { + fields: { + skillID: { + type: "int32", + id: 1 + }, + skillLv: { + type: "int32", + id: 2 + } + } + }, + DBHero: { + fields: { + id: { + type: "string", + id: 1 + }, + uid: { + type: "string", + id: 2 + }, + heroID: { + type: "int32", + id: 3 + }, + star: { + type: "int32", + id: 4 + }, + lv: { + type: "int32", + id: 5 + }, + exp: { + type: "int32", + id: 6 + }, + juexingLv: { + type: "int32", + id: 7 + }, + captainSkill: { + type: "int32", + id: 8 + }, + normalSkill: { + rule: "repeated", + type: "SkillData", + id: 9 + }, + property: { + keyType: "int32", + type: "int32", + id: 10 + }, + addProperty: { + keyType: "int32", + type: "int32", + id: 11 + }, + formation: { + type: "int32", + id: 12 + }, + cardType: { + type: "int32", + id: 13 + }, + curSkin: { + type: "int32", + id: 14 + }, + skins: { + rule: "repeated", + type: "int32", + id: 15 + }, + block: { + type: "bool", + id: 16 + }, + equipID: { + rule: "repeated", + type: "string", + id: 17 + }, + resonateNum: { + type: "int32", + id: 18 + }, + distributionResonate: { + type: "int32", + id: 19 + }, + energy: { + keyType: "int32", + type: "int32", + id: 20 + }, + sameCount: { + type: "int32", + id: 21 + }, + suiteId: { + type: "int32", + id: 22 + }, + suiteExtId: { + type: "int32", + id: 23 + }, + isOverlying: { + type: "bool", + id: 24 + } + } + }, + HeroInfoReq: { + fields: { + heroId: { + type: "string", + id: 1 + } + } + }, + HeroInfoRsp: { + fields: { + base: { + type: "DBHero", + id: 1 + } + } + }, + HeroListReq: { + fields: {} + }, + HeroListRsp: { + fields: { + list: { + rule: "repeated", + type: "DBHero", + id: 1 + } + } + }, + ItemData: { + fields: { + itemId: { + type: "int32", + id: 2 + }, + amount: { + type: "int32", + id: 3 + } + } + }, + HeroStrengthenUplvReq: { + fields: { + heroObjID: { + type: "string", + id: 1 + }, + expCardID: { + type: "string", + id: 2 + }, + amount: { + type: "int32", + id: 3 + } + } + }, + HeroStrengthenUplvResp: { + fields: { + hero: { + type: "DBHero", + id: 1 + } + } + }, + CostCardData: { + fields: { + costCardObj: { + type: "string", + id: 1 + }, + amount: { + type: "int32", + id: 2 + } + } + }, + HeroStrengthenUpStarReq: { + fields: { + heroObjID: { + type: "string", + id: 1 + }, + hero: { + rule: "repeated", + type: "CostCardData", + id: 2 + }, + heroRace: { + rule: "repeated", + type: "CostCardData", + id: 3 + } + } + }, + HeroStrengthenUpStarResp: { + fields: { + hero: { + type: "DBHero", + id: 1 + } + } + }, + HeroStrengthenUpSkillReq: { + fields: { + heroObjID: { + type: "string", + id: 1 + }, + costCardObj: { + type: "string", + id: 2 + } + } + }, + HeroStrengthenUpSkillResp: { + fields: { + hero: { + type: "DBHero", + id: 1 + } + } + }, + HeroResonanceReq: { + fields: { + heroObjID: { + type: "string", + id: 1 + }, + costObjID: { + type: "string", + id: 2 + }, + amount: { + type: "int32", + id: 3 + } + } + }, + HeroResonanceResp: { + fields: { + hero: { + type: "DBHero", + id: 1 + }, + energy: { + type: "int32", + id: 2 + }, + upStarCard: { + type: "DBHero", + id: 3 + } + } + }, + HeroResonanceResetReq: { + fields: { + heroObjID: { + type: "string", + id: 1 + } + } + }, + HeroResonanceResetResp: { + fields: { + hero: { + type: "DBHero", + id: 1 + }, + energy: { + type: "int32", + id: 2 + } + } + }, + HeroResonanceUseEnergyReq: { + fields: { + heroObjID: { + type: "string", + id: 1 + }, + useEnergy: { + type: "int32", + id: 2 + }, + useType: { + type: "int32", + id: 3 + } + } + }, + HeroResonanceUseEnergyResp: { + fields: { + hero: { + type: "DBHero", + id: 1 + } + } + }, + HeroJuexingReq: { + fields: { + heroObjID: { + type: "string", + id: 1 + }, + costItmes: { + type: "ItemData", + id: 2 + } + } + }, + HeroJuexingResp: { + fields: { + hero: { + type: "DBHero", + id: 1 + } + } + }, + HeroChoukaReq: { + fields: {} + }, + HeroChoukaResp: { + fields: { + heroes: { + rule: "repeated", + type: "DBHero", + id: 1 + } + } + }, + HeroProperty: { + fields: { + heroId: { + type: "string", + id: 1 + }, + property: { + keyType: "int32", + type: "int32", + id: 2 + }, + addProperty: { + keyType: "int32", + type: "int32", + id: 3 + } + } + } + } + }, + DB_UserItemData: { + fields: { + gridId: { + type: "string", + id: 1 + }, + uId: { + type: "string", + id: 2 + }, + isEmpty: { + type: "bool", + id: 3 + }, + itemId: { + type: "int32", + id: 4 + }, + amount: { + type: "uint32", + id: 5 + }, + cTime: { + type: "int64", + id: 6 + }, + eTime: { + type: "int64", + id: 7 + }, + isNewItem: { + type: "bool", + id: 8 + } + } + }, + ItemsGetlistReq: { + fields: { + IType: { + type: "int32", + id: 1 + } + } + }, + ItemsGetlistResp: { + fields: { + Grids: { + rule: "repeated", + type: "DB_UserItemData", + id: 1 + } + } + }, + ItemsUseItemReq: { + fields: { + GridId: { + type: "int32", + id: 1 + }, + ItemId: { + type: "int32", + id: 2 + }, + Amount: { + type: "uint32", + id: 3 + } + } + }, + ItemsUseItemResp: { + fields: {} + }, + ItemsSellItemReq: { + fields: { + GridId: { + type: "int32", + id: 1 + }, + ItemId: { + type: "int32", + id: 2 + }, + Amount: { + type: "uint32", + id: 3 + } + } + }, + ItemsSellItemResp: { + fields: {} + }, MailAttachment: { fields: { ItemId: { @@ -508,7 +1131,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - DB_MailData: { + DBMailData: { fields: { ObjId: { type: "string", @@ -549,19 +1172,19 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Mail_GetList_Req: { + MailGetListReq: { fields: {} }, - Mail_GetList_Resp: { + MailGetListResp: { fields: { Mails: { rule: "repeated", - type: "DB_MailData", + type: "DBMailData", id: 1 } } }, - Mail_ReadMail_Req: { + MailReadMailReq: { fields: { ObjID: { type: "string", @@ -569,15 +1192,15 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Mail_ReadMail_Resp: { + MailReadMailResp: { fields: { Mail: { - type: "DB_MailData", + type: "DBMailData", id: 1 } } }, - Mail_GetUserMailAttachment_Req: { + MailGetUserMailAttachmentReq: { fields: { ObjID: { type: "string", @@ -585,15 +1208,15 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Mail_GetUserMailAttachment_Resp: { + MailGetUserMailAttachmentResp: { fields: { Mail: { - type: "DB_MailData", + type: "DBMailData", id: 1 } } }, - Mail_DelMail_Req: { + MailDelMailReq: { fields: { ObjID: { type: "string", @@ -601,16 +1224,16 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - Mail_DelMail_Resp: { + MailDelMailResp: { fields: { Mail: { rule: "repeated", - type: "DB_MailData", + type: "DBMailData", id: 1 } } }, - ErrorNotify: { + NotifyErrorNotifyPush: { fields: { ReqMainType: { type: "string", @@ -634,98 +1257,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - DB_UserItemData: { - fields: { - gridId: { - type: "string", - id: 1 - }, - uId: { - type: "string", - id: 2 - }, - isEmpty: { - type: "bool", - id: 3 - }, - itemId: { - type: "int32", - id: 4 - }, - amount: { - type: "uint32", - id: 5 - }, - cTime: { - type: "int64", - id: 6 - }, - eTime: { - type: "int64", - id: 7 - }, - isNewItem: { - type: "bool", - id: 8 - } - } - }, - Pack_Getlist_Req: { - fields: { - IType: { - type: "int32", - id: 1 - } - } - }, - Pack_Getlist_Resp: { - fields: { - Grids: { - rule: "repeated", - type: "DB_UserItemData", - id: 1 - } - } - }, - Pack_UseItem_Req: { - fields: { - GridId: { - type: "int32", - id: 1 - }, - ItemId: { - type: "int32", - id: 2 - }, - Amount: { - type: "uint32", - id: 3 - } - } - }, - Pack_UseItem_Resp: { - fields: {} - }, - Pack_SellItem_Req: { - fields: { - GridId: { - type: "int32", - id: 1 - }, - ItemId: { - type: "int32", - id: 2 - }, - Amount: { - type: "uint32", - id: 3 - } - } - }, - Pack_SellItem_Resp: { - fields: {} - }, - Cache_UserData: { + CacheUser: { fields: { uid: { type: "string", @@ -741,7 +1273,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - DB_UserData: { + DBUser: { fields: { id: { type: "string", @@ -790,6 +1322,14 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr avatar: { type: "int32", id: 12 + }, + gold: { + type: "int32", + id: 13 + }, + exp: { + type: "int32", + id: 14 } } }, @@ -808,7 +1348,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr UserLoginResp: { fields: { data: { - type: "DB_UserData", + type: "DBUser", id: 1 } } @@ -840,7 +1380,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr UserLoadRsp: { fields: { data: { - type: "Cache_UserData", + type: "CacheUser", id: 1 } } diff --git a/src/pb/proto/comm.proto b/src/pb/proto/comm.proto index 4674ef0..41e4797 100644 --- a/src/pb/proto/comm.proto +++ b/src/pb/proto/comm.proto @@ -18,15 +18,17 @@ message AgentMessage { string UserSessionId = 2; string UserId = 3; string GatewayServiceId = 4; - string Method = 5; - google.protobuf.Any Message = 6; + string MainType = 5; + string SubType = 6; + google.protobuf.Any Message = 7; } // RPC 服务固定回复结构 message RPCMessageReply { ErrorCode Code = 1; - string Message = 2; - string Data = 3; + string ErrorMessage = 2; + string ErrorData = 3; + repeated UserMessage Reply = 4; } //用户代理绑定Uid请求 @@ -62,4 +64,16 @@ message BroadCastMessageReq { } //关闭用户代理 -message AgentCloseeReq { string UserSessionId = 1; } \ No newline at end of file +message AgentCloseeReq { string UserSessionId = 1; } + +//通知用户离线 +message NoticeUserCloseReq {string UserSessionId = 1; string UserId = 2; } + +//英雄属性类型 +enum HeroAttributesType{ + Hp = 0; //血量 + Atk = 1; //攻击 + Def = 2; //防御 + Speed = 3; //速度 + Crit = 4; //暴击 +} \ No newline at end of file diff --git a/src/pb/proto/equipment_db.proto b/src/pb/proto/equipment_db.proto new file mode 100644 index 0000000..914db48 --- /dev/null +++ b/src/pb/proto/equipment_db.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +option go_package = ".;pb"; + +//装备属性词条 +message EquipmentAttributeEntry { + int32 Id = 1; //属性词条主键id 唯一 + int32 libraryid = 2; //属性词条id 非唯一 + string AttrName = 3; //属性名 + int32 Lv = 4; //属性等级 + int32 Value = 5; //属性值 +} + +//武器数据 +message DB_Equipment { + string Id = 1; //@go_tags(`bson:"_id"`) 装备id + sint32 cId = 2; //@go_tags(`bson:"cId"`) 配置Id + string uId = 3; //@go_tags(`bson:"uid"`) 所属玩家Id + string heroId = 5; //@go_tags(`bson:"heroId"`) 挂在的英雄卡片id 未装备 填 '' + sint32 lv = 6; //@go_tags(`bson:"lv"`) 装备强化等级 + sint32 keepFailNum = 7; //@go_tags(`bson:"keepFailNum"`) 连续强化失败次数 + EquipmentAttributeEntry mainEntry = 8; //@go_tags(`bson:"mainEntry"`) 装备主词条 + repeated EquipmentAttributeEntry adverbEntry = 9; //@go_tags(`bson:"adverbEntry"`) 装备副词条 + uint32 overlayNum = 10; //@go_tags(`bson:"overlayNum"`) 叠加数量 + bool isInitialState = 11; //@go_tags(`bson:"isInitialState"`) 是否初始状态 +} \ No newline at end of file diff --git a/src/pb/proto/equipment_msg.proto b/src/pb/proto/equipment_msg.proto new file mode 100644 index 0000000..eb74f78 --- /dev/null +++ b/src/pb/proto/equipment_msg.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +option go_package = ".;pb"; +import "equipment_db.proto"; + +//获取装备列表请求 +message EquipmentGetListReq { + +} +//获取装备列表请求 回应 +message EquipmentGetListResp { + repeated DB_Equipment Equipments = 1; //装备列表 +} + +//装备挂在到英雄上 +message EquipmentEquipReq{ + string HeroCardId = 1; //英雄卡Id + repeated string EquipmentId = 2; //装备Id 固定长度的数组 0-5 对应的装备栏 +} + +//装备挂在到英雄上 回应 +message EquipmentEquipResp{ + +} + +//装备升级 +message EquipmentUpgradeReq{ + string EquipmentId = 1; //装备Id +} + +//装备升级 回应 +message EquipmentUpgradeResp{ + +} \ No newline at end of file diff --git a/src/pb/proto/errorcode.proto b/src/pb/proto/errorcode.proto index cfe0625..e519f65 100644 --- a/src/pb/proto/errorcode.proto +++ b/src/pb/proto/errorcode.proto @@ -17,11 +17,18 @@ enum ErrorCode { DBError = 21; //数据库操作失败 SystemError = 22; //通用错误 Exception = 100; //程序执行异常 + Unknown = 101; //未知错误 + ResNoEnough = 102; //资源不足 + ConfigurationException = 103; //配置异常 + ConfigNoFound = 104; //配置未找到 // user - SecKeyInvalid = 1000; //秘钥无效 - SecKey = 1001; //秘钥格式错误 - BindUser = 1002; //用户绑定错误 + SecKeyInvalid = 1000; //秘钥无效 + SecKey = 1001; //秘钥格式错误 + BindUser = 1002; //用户绑定错误 + GoldNoEnough = 1003; // 金币不足 + DiamondNoEnough = 1004; // 钻石不足 + RoleCreated = 1005; //已创角 // friend FriendNotSelf = 1100; //不能是自己 @@ -36,4 +43,28 @@ enum ErrorCode { FriendApplyError = 1109; //申请失败 FriendBlackMax = 1110; //黑名单最大数量 FriendSearchNameEmpty = 1111; //查询昵称为空 + + // item + ItemsNoEnough = 1200; //背包物品不足 + ItemsNoFoundGird = 1201; //背包未找到物品格子 + ItemsGridNumUpper = 1202; //背包格子数量已达上限 + ItemsGirdAmountUpper = 1203; //背包格子容量已达上限 + + // hero + HeroNoExist = 1300; //英雄不存在 + HeroNoEnough = 1301; //英雄数量不足 + HeroMaxLv = 1302; //英雄达到最大等级 + HeroInitCreat = 1303; //初始化英雄 + + HeroColorErr = 1304; // 品质不匹配 + HeroSkillUpErr = 1305;// 技能升级失败 + HeroMaxResonate = 1306; // 达到最大共鸣次数 + HeroNoResonate = 1307; // 没有共鸣 + HeroNotNeedResonate = 1308; // 不需要重置共鸣 + HeroNoEnergy = 1309; // 没有能量点数 + HeroCreate = 1310; // 创建卡失败 + + // equipment + EquipmentOnFoundEquipment = 1400; // 未找到武器 + EquipmentLvlimitReached = 1401; // 武器等级已达上限 } \ No newline at end of file diff --git a/src/pb/proto/forum_db.proto b/src/pb/proto/forum_db.proto new file mode 100644 index 0000000..f3d2253 --- /dev/null +++ b/src/pb/proto/forum_db.proto @@ -0,0 +1,3 @@ +syntax = "proto3"; +option go_package = ".;pb"; + diff --git a/src/pb/proto/forum_msg.proto b/src/pb/proto/forum_msg.proto new file mode 100644 index 0000000..fbeb202 --- /dev/null +++ b/src/pb/proto/forum_msg.proto @@ -0,0 +1,2 @@ +syntax = "proto3"; +option go_package = ".;pb"; \ No newline at end of file diff --git a/src/pb/proto/friend_db.proto b/src/pb/proto/friend_db.proto index f09779d..e4944d2 100644 --- a/src/pb/proto/friend_db.proto +++ b/src/pb/proto/friend_db.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option go_package = ".;pb"; -message DB_FriendData { +message DBFriend { 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 diff --git a/src/pb/proto/friend_msg.proto b/src/pb/proto/friend_msg.proto index 4498a99..5b25eac 100644 --- a/src/pb/proto/friend_msg.proto +++ b/src/pb/proto/friend_msg.proto @@ -12,97 +12,97 @@ message FriendBase { } //好友列表 -message Friend_List_Req {} +message FriendListReq {} -message Friend_List_Rsp { repeated FriendBase list = 1; } +message FriendListRsp { repeated FriendBase list = 1; } //申请好友 -message Friend_Apply_Req { +message FriendApplyReq { string friendId = 1; //好友ID } -message Friend_Apply_Rsp { +message FriendApplyRsp { string userId = 1; //用户ID string friendId = 2; //好友ID } //删除好友 -message Friend_Del_Req { +message FriendDelReq { string friendId = 1; //好友ID } -message Friend_Del_Rsp { +message FriendDelRsp { string friendId = 1; //好友ID string userId = 2; //用户ID } //同意 -message Friend_Agree_Req { +message FriendAgreeReq { repeated string friendIds = 1; //被同意的用户 } -message Friend_Agree_Rsp { +message FriendAgreeRsp { int32 Num = 1; //操作的数量 } //拒绝 -message Friend_Refuse_Req { +message FriendRefuseReq { repeated string friendIds = 1; //被拒绝的用户 } -message Friend_Refuse_Rsp { +message FriendRefuseRsp { int32 Num = 1; //操作的数量 } //好友申请列表 -message Friend_ApplyList_Req {} -message Friend_ApplyList_Rsp { repeated FriendBase list = 1; } +message FriendApplyListReq {} +message FriendApplyListRsp { repeated FriendBase list = 1; } //好友搜索 -message Friend_Search_Req { +message FriendSearchReq { string nickName = 1; //好友昵称 } -message Friend_Search_Rsp { FriendBase friend = 1; } +message FriendSearchRsp { FriendBase friend = 1; } //黑名单 -message Friend_BlackList_Req {} +message FriendBlackListReq {} -message Friend_BlackList_Rsp { repeated FriendBase friends = 1; } +message FriendBlackListRsp { repeated FriendBase friends = 1; } //添加黑名单 -message Friend_BlackAdd_Req { string friendId = 1; } +message FriendBlackAddReq { string friendId = 1; } -message Friend_BlackAdd_Rsp { +message FriendBlackAddRsp { string friendId = 1; string userId = 2; } //删除黑名单 -message Friend_DelBlack_Req { string friendId = 1; } +message FriendDelBlackReq { string friendId = 1; } -message Friend_DelBlack_Rsp { +message FriendDelBlackRsp { string friendId = 1; string userId = 2; } //接收 -message Friend_Receive_Req { string friendId = 1; } +message FriendReceiveReq { string friendId = 1; } -message Friend_Receive_Rsp { +message FriendReceiveRsp { string friendId = 1; string userId = 2; } //赠送 -message Friend_Give_Req { string friendId = 1; } +message FriendGiveReq { string friendId = 1; } -message Friend_Give_Rsp { +message FriendGiveRsp { string friendId = 1; string userId = 2; } //好友数量 -message Friend_Total_Req { string friendId = 1; } +message FriendTotalReq { string friendId = 1; } -message Friend_Total_Rsp { +message FriendTotalRsp { string friendId = 1; int32 total = 2; //好友数量 } \ No newline at end of file diff --git a/src/pb/proto/hero_db.proto b/src/pb/proto/hero_db.proto new file mode 100644 index 0000000..abe4da3 --- /dev/null +++ b/src/pb/proto/hero_db.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +option go_package = ".;pb"; +package pb; + +message SkillData { + int32 skillID = 1; + int32 skillLv = 2; +} + +message DBHero { + string id = 1; //@go_tags(`bson:"_id"`) ID + string uid = 2; + int32 heroID = 3; //@go_tags(`bson:"heroID"`) 英雄的配置表ID + int32 star = 4; // 英雄星级 + int32 lv = 5; // 英雄等级 + int32 exp = 6; // 英雄经验 + int32 juexingLv = 7; //@go_tags(`bson:"juexingLv"`) 觉醒等级 + int32 captainSkill = 8; //@go_tags(`bson:"captainSkill"`) 队长技能 + repeated SkillData normalSkill = 9; //@go_tags(`bson:"normalSkill"`) 普通技能 + map property = 10; // 属性相关 + map addProperty = + 11; //@go_tags(`bson:"addProperty"`) 附加属性相关 + int32 formation = 12; // 阵型类型 + int32 cardType = + 13; //@go_tags(`bson:"cardType"`) 卡片类型(升星卡、经验卡、技能升级卡) + int32 curSkin = 14; //@go_tags(`bson:"curSkin"`) 当前装备的皮肤ID + repeated int32 skins = 15; // 所有皮肤ID + bool block = 16; // 锁定 + repeated string equipID = 17; //@go_tags(`bson:"equipID"`) 装备 objID + int32 resonateNum = 18; //@go_tags(`bson:"resonateNum"`) 共鸣次数 + int32 distributionResonate = + 19; //@go_tags(`bson:"distributionResonate"`) 分配的共鸣能量 + map energy = 20; // @go_tags(`bson:"energy"`)能量分配到哪里 + int32 sameCount = 21; // @go_tags(`bson:"sameCount"`) 卡片叠加数量 + int32 suiteId = 22; //@go_tags(`bson:"suiteId"`) 套装Id + int32 suiteExtId = 23; // go_tags(`bson:"suiteExtId"`) 扩展套装Id + bool isOverlying = 24; // go_tags(`bson:"isOverlying"`) 是否允许叠加 默认true +} \ No newline at end of file diff --git a/src/pb/proto/hero_msg.proto b/src/pb/proto/hero_msg.proto new file mode 100644 index 0000000..d8d1a1a --- /dev/null +++ b/src/pb/proto/hero_msg.proto @@ -0,0 +1,120 @@ +syntax = "proto3"; +option go_package = ".;pb"; +package pb; +import "hero_db.proto"; + +//英雄基础信息 +message HeroInfoReq { + string heroId = 1; //英雄唯一ID +} +message HeroInfoRsp { DBHero base = 1; } + +//英雄列表 +message HeroListReq {} + +message HeroListRsp { repeated DBHero list = 1; } + +/// 卡牌养成: 强化(卡牌升级、卡牌升星、技能升级) +/// 卡牌养成: 共鸣(共鸣消耗、材料返回、能量点使用) +/// 卡牌养成: 觉醒(英雄觉醒、材料消耗) + +message ItemData { + int32 itemId = 2; //物品Id + int32 amount = 3; //数量 +} + +// 卡牌升级 +message HeroStrengthenUplvReq { + string heroObjID = 1; // 英雄对象ID + string expCardID = 2; // 经验卡对象ID + int32 amount = 3; // 消耗经验卡数量} +} + +// 卡牌升级返回 +message HeroStrengthenUplvResp { + DBHero hero = 1; // 英雄对象 +} + +message CostCardData { + string costCardObj = 1; // 对象ID + int32 amount = 2; // 数量 +} +// 卡牌升星 +message HeroStrengthenUpStarReq { + string heroObjID = 1; // 英雄对象ID + repeated CostCardData hero = 2; // 消耗卡牌对象ID + repeated CostCardData heroRace = 3; // 消耗种族卡牌对象ID +} + +// 卡牌升星返回 +message HeroStrengthenUpStarResp { + DBHero hero = 1; // 英雄对象 +} + +// 卡牌技能升级 +message HeroStrengthenUpSkillReq { + string heroObjID = 1; // 英雄对象ID + string costCardObj = 2; // 消耗技能升级卡 +} + +// 卡牌技能升级返回 +message HeroStrengthenUpSkillResp { + DBHero hero = 1; // 英雄对象 +} + +// 共鸣英雄 +message HeroResonanceReq { + string heroObjID = 1; // 英雄对象ID + string costObjID = 2; // 消耗对象 + int32 amount = 3;// 消耗的数量 +} + +message HeroResonanceResp { + DBHero hero = 1; // 英雄对象 + int32 energy = 2; // 共鸣成功 获得的能量点数 + DBHero upStarCard = 3; //共鸣成功 获得的升星卡 +} + +// 重置共鸣属性 +message HeroResonanceResetReq { + string heroObjID = 1; // 英雄对象ID +} + +message HeroResonanceResetResp { + DBHero hero = 1; // 英雄对象 + int32 energy = 2; // 能量点数 +} + +// 使用能量点数 +message HeroResonanceUseEnergyReq { + string heroObjID = 1; // 英雄对象ID + int32 useEnergy = 2; // 使用的能量点数 + int32 useType = 3; // 使用的类型 (攻击、血量、防御) +} + +message HeroResonanceUseEnergyResp { + DBHero hero = 1; // 英雄对象 +} + +// 觉醒 +message HeroJuexingReq { + string heroObjID = 1; // 英雄对象ID + ItemData costItmes = 2; // 觉醒消耗待定 +} + +// 觉醒返回 +message HeroJuexingResp { + DBHero hero = 1; // 英雄对象 +} + +//抽卡 +message HeroChoukaReq {} + +message HeroChoukaResp { repeated DBHero heroes = 1; } + +//英雄属性推送 +message HeroProperty { + string heroId = 1; //英雄唯一ID + map property = 2; //基础属性 + map addProperty = 3; //附加属性 +} \ No newline at end of file diff --git a/src/pb/proto/pack_db.proto b/src/pb/proto/items_db.proto similarity index 100% rename from src/pb/proto/pack_db.proto rename to src/pb/proto/items_db.proto diff --git a/src/pb/proto/pack_msg.proto b/src/pb/proto/items_msg.proto similarity index 75% rename from src/pb/proto/pack_msg.proto rename to src/pb/proto/items_msg.proto index 6ea8c5b..064888e 100644 --- a/src/pb/proto/pack_msg.proto +++ b/src/pb/proto/items_msg.proto @@ -1,37 +1,37 @@ syntax = "proto3"; option go_package = ".;pb"; -import "pack_db.proto"; +import "items_db.proto"; //查询用户背包请求 -message Pack_Getlist_Req { +message ItemsGetlistReq { int32 IType = 1; //道具类型 } //查询用户背包请求 回应 -message Pack_Getlist_Resp { +message ItemsGetlistResp { repeated DB_UserItemData Grids = 1; //用户背包列表 } //使用物品请求 -message Pack_UseItem_Req { +message ItemsUseItemReq { int32 GridId = 1; //格子Id int32 ItemId = 2; //物品Id uint32 Amount = 3; //使用数量 } //使用物品请求 回应 -message Pack_UseItem_Resp { +message ItemsUseItemResp { } //出售道具请求sailitem -message Pack_SellItem_Req { +message ItemsSellItemReq { int32 GridId = 1; //格子Id int32 ItemId = 2; //物品Id uint32 Amount = 3; //使用数量 } //出售道具请求 回应 -message Pack_SellItem_Resp { +message ItemsSellItemResp { } \ No newline at end of file diff --git a/src/pb/proto/mail_db.proto b/src/pb/proto/mail_db.proto index 3db1aa4..cc90632 100644 --- a/src/pb/proto/mail_db.proto +++ b/src/pb/proto/mail_db.proto @@ -11,7 +11,7 @@ message MailAttachment { // 附件 uint32 ItemCount = 2; // 数量 } -message DB_MailData { +message DBMailData { string ObjId = 1; // @go_tags(`bson:"_id"`) ID string Uid = 2; string Title = 3; // 邮件标题 diff --git a/src/pb/proto/mail_msg.proto b/src/pb/proto/mail_msg.proto index 60dce61..41b441f 100644 --- a/src/pb/proto/mail_msg.proto +++ b/src/pb/proto/mail_msg.proto @@ -2,38 +2,38 @@ syntax = "proto3"; option go_package = ".;pb"; import "mail_db.proto"; -message Mail_GetList_Req { +message MailGetListReq { } // 查询邮件信息 -message Mail_GetList_Resp { - repeated DB_MailData Mails = 1; +message MailGetListResp { + repeated DBMailData Mails = 1; } // 查看邮件 -message Mail_ReadMail_Req { +message MailReadMailReq { string ObjID = 1; } -message Mail_ReadMail_Resp { - DB_MailData Mail = 1; +message MailReadMailResp { + DBMailData Mail = 1; } // 领取附件 -message Mail_GetUserMailAttachment_Req { +message MailGetUserMailAttachmentReq { string ObjID = 1; } -message Mail_GetUserMailAttachment_Resp { - DB_MailData Mail = 1; +message MailGetUserMailAttachmentResp { + DBMailData Mail = 1; } // 删除某个邮件 -message Mail_DelMail_Req { +message MailDelMailReq { string ObjID = 1; } -message Mail_DelMail_Resp { - repeated DB_MailData Mail = 1; +message MailDelMailResp { + repeated DBMailData Mail = 1; } diff --git a/src/pb/proto/notify_msg.proto b/src/pb/proto/notify_msg.proto index fdd30f7..8087675 100644 --- a/src/pb/proto/notify_msg.proto +++ b/src/pb/proto/notify_msg.proto @@ -3,10 +3,11 @@ option go_package = ".;pb"; import "errorcode.proto"; //统一错误码返回 -message ErrorNotify { - string ReqMainType =1; // 请求协议模块 模块名 例如:user 对应项目中 user的模块 - string ReqSubType = 2; // 请求协议函数 例如:login 对应项目中 user的模块中 api_login 的处理函数 - ErrorCode Code = 3; // 执行返回错误码 对应 errorcode.proto 枚举 - string Message = 4; // 错误消息 - string Data = 6; // 错误数据 +message NotifyErrorNotifyPush { + string ReqMainType = 1; // 请求协议模块 模块名 例如:user 对应项目中 user的模块 + string ReqSubType = 2; // 请求协议函数 例如:login 对应项目中 user的模块中 + // api_login 的处理函数 + ErrorCode Code = 3; // 执行返回错误码 对应 errorcode.proto 枚举 + string Message = 4; // 错误消息 + string Data = 6; // 错误数据 } diff --git a/src/pb/proto/user_db.proto b/src/pb/proto/user_db.proto index 6edeb7c..9833e2c 100644 --- a/src/pb/proto/user_db.proto +++ b/src/pb/proto/user_db.proto @@ -1,14 +1,14 @@ syntax = "proto3"; option go_package = ".;pb"; -message Cache_UserData { +message CacheUser { string uid = 1; string SessionId = 2; string GatewayServiceId = 3; // DB_UserData UserData = 4; //@go_tags(`json:",inline"`) } -message DB_UserData { +message DBUser { string id = 1; //@go_tags(`bson:"_id"`) ID string uid = 2; //@go_tags(`bson:"uid"`) 用户ID string uuid = 3; //@go_tags(`bson:"uuid"`) 玩家唯一uuid @@ -21,4 +21,6 @@ message DB_UserData { int64 logintime = 10; //@go_tags(`bson:"logintime"`) 最后一次登录时间 int32 friendPoint = 11; //@go_tags(`bson:"friendPoint"`) 友情点 int32 avatar = 12; //@go_tags(`bson:"avatar"`) 头像 + int32 gold = 13; //@go_tags(`bson:"gold"`) 金币 + int32 exp = 14; //@go_tags(`bson:"exp"`) 经验 } \ No newline at end of file diff --git a/src/pb/proto/user_msg.proto b/src/pb/proto/user_msg.proto index 0e8327a..aae23a7 100644 --- a/src/pb/proto/user_msg.proto +++ b/src/pb/proto/user_msg.proto @@ -9,7 +9,7 @@ message UserLoginReq { int32 sid = 2; //区服编号 } -message UserLoginResp { DB_UserData data = 1; } +message UserLoginResp { DBUser data = 1; } message UserRegisterReq { string account = 1; @@ -21,7 +21,7 @@ message UserRegisterRsp { string account = 2; } -message UserLoadRsp { Cache_UserData data = 1; } +message UserLoadRsp { CacheUser data = 1; } //创角 message UserCreateReq { diff --git a/src/utils/socket.js b/src/utils/socket.js index 8eb2cc9..1f4bcc9 100644 --- a/src/utils/socket.js +++ b/src/utils/socket.js @@ -18,7 +18,7 @@ var socket = { hearbeat_interval: 5000, // 是否自动重连 - is_reonnect: true, + is_reonnect: false, // 重连次数 reconnect_count: 3, // 已发起重连次数 @@ -27,7 +27,10 @@ var socket = { reconnect_timer: null, // 重连频率 reconnect_interval: 3000, - + // 消息监听 + receivelisten: null, + // 关闭监听 + closelisten: null, /** * 初始化连接 */ @@ -45,26 +48,9 @@ var socket = { * @param {*} callback 发送后的自定义回调函数 */ send: (data, callback = null) => { - // 开启状态直接发送 - if (socket.websock.readyState === socket.websock.OPEN) { - socket.websock.send(JSON.stringify(data)) - - if (callback) { - callback() - } - - // 正在开启状态,则等待1s后重新调用 - } else if (socket.websock.readyState === socket.websock.CONNECTING) { - setTimeout(function () { - socket.send(data, callback) - }, 1000) - - // 未开启,则等待1s后重新调用 - } else { - socket.init() - setTimeout(function () { - socket.send(data, callback) - }, 1000) + socket.websock.send(data) + if (callback) { + callback() } }, @@ -180,7 +166,11 @@ var socket = { } socket.websock = new WebSocket(socket.ws_url) socket.websock.onmessage = function (e) { - socket.receive(e) + if (socket.receivelisten != null) { + socket.receivelisten(e) + } else { + socket.receive(e) + } } // 关闭连接 socket.websock.onclose = function (e) { @@ -202,6 +192,10 @@ var socket = { socket.reconnect_current++ return socket.connect(resolve, reject) }, socket.reconnect_interval) + } else { + if (socket.closelisten != null) + socket.closelisten() + return reject("连接失败") } } @@ -210,9 +204,9 @@ var socket = { console.log('连接成功') socket.reconnect_current = 0 socket.socket_open = true - socket.is_reonnect = true + // socket.is_reonnect = true // 开启心跳 - socket.heartbeat() + // socket.heartbeat() resolve(socket.websock) } // 连接发生错误 @@ -221,7 +215,5 @@ var socket = { console.log('WebSocket连接发生错误') // reject("WebSocket连接发生错误") } - - }, } \ No newline at end of file diff --git a/src/views/protocol/Index.vue b/src/views/protocol/Index.vue index aed9a72..0406ad6 100644 --- a/src/views/protocol/Index.vue +++ b/src/views/protocol/Index.vue @@ -27,17 +27,105 @@ - - + + - - + + + + + + + + + + + + + + request + + + + + 输出 + + + Clear + + + + + + + + + + + + +
+ +
{{log.data}}
+
+
+
+
+
+
+
{{ error_message }}