diff --git a/DataTables/Datas/__tables__.xlsx b/DataTables/Datas/__tables__.xlsx index 598afad8..760bad25 100644 Binary files a/DataTables/Datas/__tables__.xlsx and b/DataTables/Datas/__tables__.xlsx differ diff --git a/DataTables/Datas/战斗/模式/OnHook模式的全局表.xlsx b/DataTables/Datas/战斗/模式/OnHook模式的全局表.xlsx new file mode 100644 index 00000000..b7b98360 Binary files /dev/null and b/DataTables/Datas/战斗/模式/OnHook模式的全局表.xlsx differ diff --git a/JisolGameCocos/assets/resources/config/data/schema.ts b/JisolGameCocos/assets/resources/config/data/schema.ts index c0c46026..14bafffc 100644 --- a/JisolGameCocos/assets/resources/config/data/schema.ts +++ b/JisolGameCocos/assets/resources/config/data/schema.ts @@ -276,6 +276,39 @@ export class TbGMap { } +export namespace TB { +export class TbGOnHookGlobal { + + constructor(_json_: any) { + if (_json_.id === undefined) { throw new Error() } + this.id = _json_.id + if (_json_.args === undefined) { throw new Error() } + this.args = _json_.args + if (_json_.tig === undefined) { throw new Error() } + this.tig = _json_.tig + } + + /** + * id + */ + readonly id: number + /** + * 全局表参数 + */ + readonly args: string + /** + * 描述 + */ + readonly tig: string + + resolve(tables:Tables) + { + } +} + +} + + export class TbGGlobal{ @@ -470,6 +503,38 @@ export class TbGMap{ +export class TbGOnHookGlobal{ + private _dataMap: Map + private _dataList: TB.TbGOnHookGlobal[] + constructor(_json_: any) { + this._dataMap = new Map() + this._dataList = [] + for(var _json2_ of _json_) { + let _v: TB.TbGOnHookGlobal + _v = new TB.TbGOnHookGlobal(_json2_) + this._dataList.push(_v) + this._dataMap.set(_v.id, _v) + } + } + + getDataMap(): Map { return this._dataMap; } + getDataList(): TB.TbGOnHookGlobal[] { return this._dataList; } + + get(key: number): TB.TbGOnHookGlobal | undefined { return this._dataMap.get(key); } + + resolve(tables:Tables) + { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + +} + + + + type JsonLoader = (file: string) => any export class Tables { @@ -485,6 +550,8 @@ export class Tables { get TbGRoleSkill(): TbGRoleSkill { return this._TbGRoleSkill;} private _TbGMap: TbGMap get TbGMap(): TbGMap { return this._TbGMap;} + private _TbGOnHookGlobal: TbGOnHookGlobal + get TbGOnHookGlobal(): TbGOnHookGlobal { return this._TbGOnHookGlobal;} constructor(loader: JsonLoader) { this._TbGGlobal = new TbGGlobal(loader('tbgglobal')) @@ -493,6 +560,7 @@ export class Tables { this._TbGRoleBattleRes = new TbGRoleBattleRes(loader('tbgrolebattleres')) this._TbGRoleSkill = new TbGRoleSkill(loader('tbgroleskill')) this._TbGMap = new TbGMap(loader('tbgmap')) + this._TbGOnHookGlobal = new TbGOnHookGlobal(loader('tbgonhookglobal')) this._TbGGlobal.resolve(this) this._TbGRole.resolve(this) @@ -500,5 +568,6 @@ export class Tables { this._TbGRoleBattleRes.resolve(this) this._TbGRoleSkill.resolve(this) this._TbGMap.resolve(this) + this._TbGOnHookGlobal.resolve(this) } } diff --git a/JisolGameCocos/assets/resources/config/json/tbgonhookglobal.json b/JisolGameCocos/assets/resources/config/json/tbgonhookglobal.json new file mode 100644 index 00000000..c85d7765 --- /dev/null +++ b/JisolGameCocos/assets/resources/config/json/tbgonhookglobal.json @@ -0,0 +1,7 @@ +[ + { + "id": 80001, + "args": "100", + "tig": "预先生成的野外宠物数量" + } +] \ No newline at end of file diff --git a/JisolGameCocos/assets/resources/config/json/tbgonhookglobal.json.meta b/JisolGameCocos/assets/resources/config/json/tbgonhookglobal.json.meta new file mode 100644 index 00000000..505b6699 --- /dev/null +++ b/JisolGameCocos/assets/resources/config/json/tbgonhookglobal.json.meta @@ -0,0 +1,11 @@ +{ + "ver": "2.0.1", + "importer": "json", + "imported": true, + "uuid": "0ccb44c9-b7bc-4fc6-b7d2-8a4335f806a5", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab index d847ca24..0370b0f2 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab @@ -28,29 +28,29 @@ "__id__": 38 }, { - "__id__": 98 + "__id__": 106 }, { - "__id__": 117 + "__id__": 125 }, { - "__id__": 132 + "__id__": 140 } ], "_active": true, "_components": [ { - "__id__": 147 + "__id__": 155 }, { - "__id__": 149 + "__id__": 157 }, { - "__id__": 151 + "__id__": 159 } ], "_prefab": { - "__id__": 153 + "__id__": 161 }, "_lpos": { "__type__": "cc.Vec3", @@ -883,23 +883,26 @@ "__id__": 39 }, { - "__id__": 53 + "__id__": 47 + }, + { + "__id__": 61 } ], "_active": true, "_components": [ { - "__id__": 91 + "__id__": 99 }, { - "__id__": 93 + "__id__": 101 }, { - "__id__": 95 + "__id__": 103 } ], "_prefab": { - "__id__": 97 + "__id__": 105 }, "_lpos": { "__type__": "cc.Vec3", @@ -930,6 +933,181 @@ }, "_id": "" }, + { + "__type__": "cc.Node", + "_name": "野怪列表", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 38 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 40 + }, + { + "__id__": 42 + }, + { + "__id__": 44 + } + ], + "_prefab": { + "__id__": 46 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 223.109, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 39 + }, + "_enabled": true, + "__prefab": { + "__id__": 41 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 720, + "height": 120 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "0ccMb6aEJJmKtQPc0NQqC7" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 39 + }, + "_enabled": true, + "__prefab": { + "__id__": 43 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 190, + "g": 190, + "b": 190, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "19pPQvdvdMCJ7w/Z+yYIek" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 39 + }, + "_enabled": true, + "__prefab": { + "__id__": 45 + }, + "_alignFlags": 40, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "41TovpTmVCz4oCICCj50W/" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "cfqtEvOKpHO7NzoHh8DAIM", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.Node", "_name": "阵法", @@ -940,25 +1118,25 @@ }, "_children": [ { - "__id__": 40 + "__id__": 48 } ], "_active": true, "_components": [ { - "__id__": 48 + "__id__": 56 }, { - "__id__": 50 + "__id__": 58 } ], "_prefab": { - "__id__": 52 + "__id__": 60 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": 74.983, + "x": -94.905, + "y": -59.881, "z": 0 }, "_lrot": { @@ -988,17 +1166,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 39 + "__id__": 47 }, "_prefab": { - "__id__": 41 + "__id__": 49 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 40 + "__id__": 48 }, "asset": { "__uuid__": "9d7eeadb-58f6-4c42-aaed-bc402f272c84", @@ -1006,7 +1184,7 @@ }, "fileId": "a8T0NC/KpNY7MMbRkPRuwY", "instance": { - "__id__": 42 + "__id__": 50 }, "targetOverrides": null }, @@ -1020,16 +1198,16 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 43 + "__id__": 51 }, { - "__id__": 45 + "__id__": 53 }, { - "__id__": 46 + "__id__": 54 }, { - "__id__": 47 + "__id__": 55 } ], "removedComponents": [] @@ -1037,7 +1215,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 44 + "__id__": 52 }, "propertyPath": [ "_name" @@ -1053,7 +1231,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 44 + "__id__": 52 }, "propertyPath": [ "_lpos" @@ -1068,7 +1246,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 44 + "__id__": 52 }, "propertyPath": [ "_lrot" @@ -1084,7 +1262,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 44 + "__id__": 52 }, "propertyPath": [ "_euler" @@ -1102,15 +1280,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 39 + "__id__": 47 }, "_enabled": true, "__prefab": { - "__id__": 49 + "__id__": 57 }, "_contentSize": { "__type__": "cc.Size", - "width": 550, + "width": 500, "height": 420 }, "_anchorPoint": { @@ -1130,11 +1308,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 39 + "__id__": 47 }, - "_enabled": true, + "_enabled": false, "__prefab": { - "__id__": 51 + "__id__": 59 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1192,28 +1370,28 @@ }, "_children": [ { - "__id__": 54 + "__id__": 62 }, { - "__id__": 70 + "__id__": 78 } ], "_active": true, "_components": [ { - "__id__": 86 + "__id__": 94 }, { - "__id__": 88 + "__id__": 96 } ], "_prefab": { - "__id__": 90 + "__id__": 98 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": -216.02, + "x": 249.748, + "y": -62.84, "z": 0 }, "_lrot": { @@ -1245,32 +1423,32 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 53 + "__id__": 61 }, "_children": [ { - "__id__": 55 + "__id__": 63 } ], "_active": true, "_components": [ { - "__id__": 63 + "__id__": 71 }, { - "__id__": 65 + "__id__": 73 }, { - "__id__": 67 + "__id__": 75 } ], "_prefab": { - "__id__": 69 + "__id__": 77 }, "_lpos": { "__type__": "cc.Vec3", - "x": -150, - "y": 0, + "x": 0, + "y": 105, "z": 0 }, "_lrot": { @@ -1302,23 +1480,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 54 + "__id__": 62 }, "_children": [], "_active": true, "_components": [ { - "__id__": 56 + "__id__": 64 }, { - "__id__": 58 + "__id__": 66 }, { - "__id__": 60 + "__id__": 68 } ], "_prefab": { - "__id__": 62 + "__id__": 70 }, "_lpos": { "__type__": "cc.Vec3", @@ -1355,11 +1533,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 55 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 57 + "__id__": 65 }, "_contentSize": { "__type__": "cc.Size", @@ -1383,11 +1561,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 55 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 59 + "__id__": 67 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1428,11 +1606,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 55 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 61 + "__id__": 69 }, "_color": { "__type__": "cc.Color", @@ -1467,11 +1645,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 62 }, "_enabled": true, "__prefab": { - "__id__": 64 + "__id__": 72 }, "_contentSize": { "__type__": "cc.Size", @@ -1495,11 +1673,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 62 }, "_enabled": true, "__prefab": { - "__id__": 66 + "__id__": 74 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1540,11 +1718,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 62 }, "_enabled": true, "__prefab": { - "__id__": 68 + "__id__": 76 }, "clickEvents": [], "_interactable": true, @@ -1596,7 +1774,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 54 + "__id__": 62 }, "_id": "" }, @@ -1623,32 +1801,32 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 53 + "__id__": 61 }, "_children": [ { - "__id__": 71 + "__id__": 79 } ], "_active": true, "_components": [ { - "__id__": 79 + "__id__": 87 }, { - "__id__": 81 + "__id__": 89 }, { - "__id__": 83 + "__id__": 91 } ], "_prefab": { - "__id__": 85 + "__id__": 93 }, "_lpos": { "__type__": "cc.Vec3", - "x": 150, - "y": 0, + "x": 0, + "y": -105, "z": 0 }, "_lrot": { @@ -1680,23 +1858,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 70 + "__id__": 78 }, "_children": [], "_active": true, "_components": [ { - "__id__": 72 + "__id__": 80 }, { - "__id__": 74 + "__id__": 82 }, { - "__id__": 76 + "__id__": 84 } ], "_prefab": { - "__id__": 78 + "__id__": 86 }, "_lpos": { "__type__": "cc.Vec3", @@ -1733,11 +1911,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 71 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 73 + "__id__": 81 }, "_contentSize": { "__type__": "cc.Size", @@ -1761,11 +1939,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 71 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 75 + "__id__": 83 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1806,11 +1984,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 71 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 77 + "__id__": 85 }, "_color": { "__type__": "cc.Color", @@ -1845,11 +2023,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 70 + "__id__": 78 }, "_enabled": true, "__prefab": { - "__id__": 80 + "__id__": 88 }, "_contentSize": { "__type__": "cc.Size", @@ -1873,11 +2051,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 70 + "__id__": 78 }, "_enabled": true, "__prefab": { - "__id__": 82 + "__id__": 90 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1918,11 +2096,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 70 + "__id__": 78 }, "_enabled": true, "__prefab": { - "__id__": 84 + "__id__": 92 }, "clickEvents": [], "_interactable": true, @@ -1974,7 +2152,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 70 + "__id__": 78 }, "_id": "" }, @@ -2001,16 +2179,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 53 + "__id__": 61 }, "_enabled": true, "__prefab": { - "__id__": 87 + "__id__": 95 }, "_contentSize": { "__type__": "cc.Size", - "width": 450, - "height": 100 + "width": 150, + "height": 340 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2029,14 +2207,14 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 53 + "__id__": 61 }, "_enabled": true, "__prefab": { - "__id__": 89 + "__id__": 97 }, "_resizeMode": 1, - "_layoutType": 1, + "_layoutType": 2, "_cellSize": { "__type__": "cc.Size", "width": 40, @@ -2048,7 +2226,7 @@ "_paddingTop": 0, "_paddingBottom": 0, "_spacingX": 150, - "_spacingY": 0, + "_spacingY": 80, "_verticalDirection": 1, "_horizontalDirection": 0, "_constraint": 0, @@ -2070,8 +2248,6 @@ "__id__": 0 }, "fileId": "a7k4jJN+9E4o9tingaVO93", - "instance": null, - "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -2084,7 +2260,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 100 }, "_contentSize": { "__type__": "cc.Size", @@ -2112,7 +2288,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 102 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2157,7 +2333,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 96 + "__id__": 104 }, "_alignFlags": 44, "_target": null, @@ -2206,26 +2382,26 @@ }, "_children": [ { - "__id__": 99 + "__id__": 107 } ], "_active": true, "_components": [ { - "__id__": 107 + "__id__": 115 }, { - "__id__": 109 + "__id__": 117 }, { - "__id__": 111 + "__id__": 119 }, { - "__id__": 113 + "__id__": 121 } ], "_prefab": { - "__id__": 116 + "__id__": 124 }, "_lpos": { "__type__": "cc.Vec3", @@ -2262,23 +2438,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 98 + "__id__": 106 }, "_children": [], "_active": true, "_components": [ { - "__id__": 100 + "__id__": 108 }, { - "__id__": 102 + "__id__": 110 }, { - "__id__": 104 + "__id__": 112 } ], "_prefab": { - "__id__": 106 + "__id__": 114 }, "_lpos": { "__type__": "cc.Vec3", @@ -2315,11 +2491,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 107 }, "_enabled": true, "__prefab": { - "__id__": 101 + "__id__": 109 }, "_contentSize": { "__type__": "cc.Size", @@ -2343,11 +2519,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 107 }, "_enabled": true, "__prefab": { - "__id__": 103 + "__id__": 111 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2388,11 +2564,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 107 }, "_enabled": true, "__prefab": { - "__id__": 105 + "__id__": 113 }, "_color": { "__type__": "cc.Color", @@ -2427,11 +2603,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 98 + "__id__": 106 }, "_enabled": true, "__prefab": { - "__id__": 108 + "__id__": 116 }, "_contentSize": { "__type__": "cc.Size", @@ -2455,11 +2631,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 98 + "__id__": 106 }, "_enabled": true, "__prefab": { - "__id__": 110 + "__id__": 118 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2500,11 +2676,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 98 + "__id__": 106 }, "_enabled": true, "__prefab": { - "__id__": 112 + "__id__": 120 }, "_alignFlags": 44, "_target": null, @@ -2536,15 +2712,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 98 + "__id__": 106 }, "_enabled": true, "__prefab": { - "__id__": 114 + "__id__": 122 }, "clickEvents": [ { - "__id__": 115 + "__id__": 123 } ], "_interactable": true, @@ -2623,23 +2799,23 @@ }, "_children": [ { - "__id__": 118 + "__id__": 126 } ], "_active": true, "_components": [ { - "__id__": 124 + "__id__": 132 }, { - "__id__": 126 + "__id__": 134 }, { - "__id__": 128 + "__id__": 136 } ], "_prefab": { - "__id__": 131 + "__id__": 139 }, "_lpos": { "__type__": "cc.Vec3", @@ -2676,20 +2852,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 117 + "__id__": 125 }, "_children": [], "_active": true, "_components": [ { - "__id__": 119 + "__id__": 127 }, { - "__id__": 121 + "__id__": 129 } ], "_prefab": { - "__id__": 123 + "__id__": 131 }, "_lpos": { "__type__": "cc.Vec3", @@ -2726,11 +2902,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 126 }, "_enabled": true, "__prefab": { - "__id__": 120 + "__id__": 128 }, "_contentSize": { "__type__": "cc.Size", @@ -2754,11 +2930,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 126 }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 130 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2812,11 +2988,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 117 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 125 + "__id__": 133 }, "_contentSize": { "__type__": "cc.Size", @@ -2840,11 +3016,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 117 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 127 + "__id__": 135 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2885,15 +3061,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 117 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 129 + "__id__": 137 }, "clickEvents": [ { - "__id__": 130 + "__id__": 138 } ], "_interactable": true, @@ -2945,7 +3121,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 117 + "__id__": 125 }, "_id": "" }, @@ -2986,23 +3162,23 @@ }, "_children": [ { - "__id__": 133 + "__id__": 141 } ], "_active": true, "_components": [ { - "__id__": 139 + "__id__": 147 }, { - "__id__": 141 + "__id__": 149 }, { - "__id__": 143 + "__id__": 151 } ], "_prefab": { - "__id__": 146 + "__id__": 154 }, "_lpos": { "__type__": "cc.Vec3", @@ -3039,20 +3215,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 132 + "__id__": 140 }, "_children": [], "_active": true, "_components": [ { - "__id__": 134 + "__id__": 142 }, { - "__id__": 136 + "__id__": 144 } ], "_prefab": { - "__id__": 138 + "__id__": 146 }, "_lpos": { "__type__": "cc.Vec3", @@ -3089,11 +3265,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 133 + "__id__": 141 }, "_enabled": true, "__prefab": { - "__id__": 135 + "__id__": 143 }, "_contentSize": { "__type__": "cc.Size", @@ -3117,11 +3293,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 133 + "__id__": 141 }, "_enabled": true, "__prefab": { - "__id__": 137 + "__id__": 145 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3175,11 +3351,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 132 + "__id__": 140 }, "_enabled": true, "__prefab": { - "__id__": 140 + "__id__": 148 }, "_contentSize": { "__type__": "cc.Size", @@ -3203,11 +3379,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 132 + "__id__": 140 }, "_enabled": true, "__prefab": { - "__id__": 142 + "__id__": 150 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3248,15 +3424,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 132 + "__id__": 140 }, "_enabled": true, "__prefab": { - "__id__": 144 + "__id__": 152 }, "clickEvents": [ { - "__id__": 145 + "__id__": 153 } ], "_interactable": true, @@ -3308,7 +3484,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 132 + "__id__": 140 }, "_id": "" }, @@ -3349,7 +3525,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 148 + "__id__": 156 }, "_contentSize": { "__type__": "cc.Size", @@ -3377,7 +3553,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 150 + "__id__": 158 }, "_alignFlags": 45, "_target": null, @@ -3413,7 +3589,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 152 + "__id__": 160 }, "mask": false, "maskOpcity": 80, @@ -3440,7 +3616,7 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": [ { - "__id__": 40 + "__id__": 48 } ] } diff --git a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts index 57ebfc61..c82ab8c6 100644 --- a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts @@ -20,6 +20,8 @@ import PlayerTacticalData, { PlayerTacticalEvent } from "../../data/PlayerTactic import GRoleOnHookExpand from "../base/role/expand/OnHook/GRoleOnHookExpand"; import PlayerPetData from "../../data/PlayerPetData"; import { GUI } from "../../ui/UIConfig"; +import { GAction } from "../../consts/GAction"; +import { GActionType } from "../../consts/GActionType"; const { ccclass, property } = _decorator; //挂机模式状态 @@ -43,6 +45,16 @@ export interface GOnHookInfo{ roles: TB.TbGRole[]; } +//野怪 +interface GOnHookPet{ + key:string; //野怪唯一Id + petTbId:number; //野怪配置表Id +} +//野怪列表 +interface GOnHookPets{ + pets:GOnHookPet[]; +} + /** * 挂机模式 无限出现小怪 (不是联机模式 该模式支持使用本地数据) */ @@ -103,6 +115,21 @@ export default class GOnHookMode extends GBaseMode<{}>{ //是否允许攻击 isAllowAttack:boolean = false; + //野怪列表 + _wildlifes:GOnHookPets; + get wildlifes(){ + //如果没有野怪了 则 向服务器生成 + if(!this._wildlifes || !(this._wildlifes.pets.length)){ + //生成 + this.onSpawnWildlife(); + return null; + } + return this._wildlifes; + } + set wildlifes(data:GOnHookPets){ + this._wildlifes = data; + } + //添加监听事件 addEvent(){ app.event.on(PlayerTacticalEvent.UPDATE_TACTICAL,this.onUpdatePlayerPet,this); @@ -135,14 +162,22 @@ export default class GOnHookMode extends GBaseMode<{}>{ this.map3.init(app.battleRes.maps[60001][2],1,app.battleRes.maps[60001][1].width * scale,1048 * scale); this.onUpdateMap(0); - this.playerInfo = { tactical: GTactical.getTactical().setOffset(this.playerPos), roles: GRoleUtil.getGRoles([10004,10004,10004,10004,10003,10003]) }; - this.enemyInfo = { tactical: GTactical.getTactical(true).setOffset(this.enemyPos), roles: GRoleUtil.getGRoles([10002]) }; + this.playerInfo = { tactical: GTactical.getTactical().setOffset(this.playerPos), roles: GRoleUtil.getGRoles([]) }; + this.enemyInfo = { tactical: GTactical.getTactical(true).setOffset(this.enemyPos), roles: GRoleUtil.getGRoles([]) }; this.onUpdatePlayerPet(); //添加监听 this.addEvent(); + // //模拟请求生成宠物 + // app.socket.SendBack(GAction.MODE_ON_HOOK_SPAWN_PET,{ + // type:GActionType.GOnHookPets, + // fun:(info:GOnHookPets) => { + // console.log("接受到野怪列表",info) + // } + // }) + //生成玩家 // this.playerInfo.roles.forEach((info,index) => this.onGenRole(GOnHookModePlayerEnum.PLAYER,index + 1,info)) @@ -151,6 +186,17 @@ export default class GOnHookMode extends GBaseMode<{}>{ } + //生成野怪 + onSpawnWildlife(){ + //获取服务器野怪 + app.socket.SendBack(GAction.MODE_ON_HOOK_SPAWN_PET,{ + type:GActionType.GOnHookPets, + fun:(info:GOnHookPets) => { + this.wildlifes = info; + } + }) + } + //更新玩家宠物 onUpdatePlayerPet(){ //获取玩家阵容 @@ -318,7 +364,12 @@ export default class GOnHookMode extends GBaseMode<{}>{ //生成敌人 onResetGenerateEnemy(){ this.enemyRoles = []; - this.enemyInfo.roles.forEach((info,index) => this.onGenRole(GOnHookModePlayerEnum.ENEMY,index + 1,info)) + if(!this.wildlifes) return; + + //获取敌人 + let wildlife = this.wildlifes.pets.shift(); + this.onGenRole(GOnHookModePlayerEnum.ENEMY,2,GRoleUtil.getGRole(wildlife.petTbId)); + // this.enemyInfo.roles.forEach((info,index) => this.onGenRole(GOnHookModePlayerEnum.ENEMY,index + 1,info)); } //角色死亡回调 diff --git a/JisolGameCocos/assets/script/consts/GAction.ts b/JisolGameCocos/assets/script/consts/GAction.ts index 944f522f..19e45c8d 100644 --- a/JisolGameCocos/assets/script/consts/GAction.ts +++ b/JisolGameCocos/assets/script/consts/GAction.ts @@ -2,8 +2,15 @@ export enum GAction { TOKEN_EXPIRED = 1001, //Token过期 - //聊天 + /*************** 聊天 **************/ CHAT_MESSAGE = 2001, //发送聊天消息 CHAT_RECEIVE_MESSAGE = 2002, //接受聊天消息 + + /*************** 游戏模式 : 无尽模式(OnHook) **************/ + MODE_ON_HOOK_SPAWN_PET = 3001, //生成宠物 + MODE_ON_HOOK_CAPTURE_PET = 3002, //捕捉宠物 + MODE_ON_HOOK_SELL_PET = 3003, //卖出宠物 + + } \ No newline at end of file diff --git a/JisolGameCocos/assets/script/consts/GActionType.ts b/JisolGameCocos/assets/script/consts/GActionType.ts index a181e1fd..25861da6 100644 --- a/JisolGameCocos/assets/script/consts/GActionType.ts +++ b/JisolGameCocos/assets/script/consts/GActionType.ts @@ -6,4 +6,9 @@ export enum GActionType { GUIChatMessage = "GUIChatMessage",//聊天信息 + + /*************** 游戏模式 : 无尽模式(OnHook) **************/ + GOnHookPet = "GOnHookPet", //野怪 + GOnHookPets = "GOnHookPets", //野怪列表 + } \ No newline at end of file diff --git a/JisolGameCocos/assets/script/data/PlayerTacticalData.ts b/JisolGameCocos/assets/script/data/PlayerTacticalData.ts index d1b9a27b..5a015656 100644 --- a/JisolGameCocos/assets/script/data/PlayerTacticalData.ts +++ b/JisolGameCocos/assets/script/data/PlayerTacticalData.ts @@ -44,11 +44,14 @@ export default class PlayerTacticalData extends BaseData{ } //更新上阵 - async UpdateTactical(roles:number[]){ + async UpdateTactical(roles:number[]):Promise{ + //如果阵法一样则不更新 + if(this.info.tacticalData == JSON.stringify(roles)) return false; this.info.roles = roles; this.info.tacticalData = JSON.stringify(this.info.roles); //上传到服务器 并且保存 this.onSaveTacticalInfo(await API.SetPlayerTactical(this.info)); + return true; } //修改指定位置的上阵 上阵下标,上阵的宠物Id diff --git a/JisolGameCocos/assets/script/ui/Consts/Tactical/PlayerTacticalItem.ts b/JisolGameCocos/assets/script/ui/Consts/Tactical/PlayerTacticalItem.ts index db4dc5f1..9ffddc03 100644 --- a/JisolGameCocos/assets/script/ui/Consts/Tactical/PlayerTacticalItem.ts +++ b/JisolGameCocos/assets/script/ui/Consts/Tactical/PlayerTacticalItem.ts @@ -117,6 +117,12 @@ export class PlayerTacticalItem extends Component { fun(this,e); }); } + + addMoveEndEvent(fun:Function){ + this.drag.addMoveEndEvent((e) => { + fun(this,e); + }); + } } diff --git a/JisolGameCocos/assets/script/ui/Consts/Tactical/PlayerTacticalView.ts b/JisolGameCocos/assets/script/ui/Consts/Tactical/PlayerTacticalView.ts index 9a7fa8f1..4f51ff45 100644 --- a/JisolGameCocos/assets/script/ui/Consts/Tactical/PlayerTacticalView.ts +++ b/JisolGameCocos/assets/script/ui/Consts/Tactical/PlayerTacticalView.ts @@ -1,10 +1,11 @@ import { _decorator, Component, Node } from 'cc'; import { PlayerTacticalItem } from './PlayerTacticalItem'; import { app } from '../../../App'; -import { PlayerTacticalEvent } from '../../../data/PlayerTacticalData'; +import PlayerTacticalData, { PlayerTacticalEvent } from '../../../data/PlayerTacticalData'; import JNodeDrag from '../../../../../extensions/ngame/assets/ngame/util/components/JNodeDrag'; import { EventTouch } from 'cc'; import { UITransform } from 'cc'; +import { GUI } from '../../UIConfig'; const { ccclass, property } = _decorator; /** @@ -23,7 +24,10 @@ export class PlayerTacticalView extends Component { this.items = this.node.getComponentsInChildren(PlayerTacticalItem); this.items.forEach((item,index) => { item.onInit(index); //初始化阵法下标 + //添加移动事件 item.addMoveEvent(this.onMoveItem.bind(this)); + //添加移动结束事件 + item.addMoveEndEvent(this.onMoveEndItem.bind(this)); }); this.onUpdateView(); @@ -53,6 +57,20 @@ export class PlayerTacticalView extends Component { } + //子节点移动结束 + async onMoveEndItem(){ + + //移动结束则保存阵法 + let pets:number[] = PlayerTacticalData.getIns().getInitTacticalInfo(); + this.items.forEach(item => { + pets[item.index] = item.petId || 0; + }) + if(await PlayerTacticalData.getIns().UpdateTactical(pets)){ + app.layer.Open(GUI.Tips,{text:"保存阵法成功"}); + } + + } + protected onDestroy(): void { this.offEvent(); } diff --git a/JisolGameCocos/extensions/ngame b/JisolGameCocos/extensions/ngame index 01a31870..ea12e2c1 160000 --- a/JisolGameCocos/extensions/ngame +++ b/JisolGameCocos/extensions/ngame @@ -1 +1 @@ -Subproject commit 01a31870c404967092e5c87fc91650bae868bbad +Subproject commit ea12e2c1097c07ed71baf59504455038e3b0b856 diff --git a/JisolGameCocos/proto/GOnHookMessage.proto b/JisolGameCocos/proto/GOnHookMessage.proto new file mode 100644 index 00000000..5f972cda --- /dev/null +++ b/JisolGameCocos/proto/GOnHookMessage.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +option java_package = "cn.jisol.ngame.proto"; + +//生成宠物类 +message GOnHookPet { + string key = 1; //生成宠物的key + int32 petTbId = 2; //生成宠物的配置表Id +} + +//生成的宠物类列表 +message GOnHookPets { + repeated GOnHookPet pets = 1; //宠物列表 +} diff --git a/JisolGameServer/JNGame b/JisolGameServer/JNGame index fe5330b6..a57971ec 160000 --- a/JisolGameServer/JNGame +++ b/JisolGameServer/JNGame @@ -1 +1 @@ -Subproject commit fe5330b622e0fb50a12808bc832eeb79202c4eb3 +Subproject commit a57971eceadfcc80e06934e75a7dee7469fb10a1 diff --git a/JisolGameServer/Main/src/main/java/cfg/TB/TbGMap.java b/JisolGameServer/Main/src/main/java/cfg/TB/TbGMap.java index 17ae9e25..5658ac2d 100644 --- a/JisolGameServer/Main/src/main/java/cfg/TB/TbGMap.java +++ b/JisolGameServer/Main/src/main/java/cfg/TB/TbGMap.java @@ -24,6 +24,7 @@ public final class TbGMap extends AbstractBean { map1OffsetY = _buf.get("map1OffsetY").getAsInt(); map2OffsetY = _buf.get("map2OffsetY").getAsInt(); map3OffsetY = _buf.get("map3OffsetY").getAsInt(); + scale = _buf.get("scale").getAsFloat(); } public static TbGMap deserialize(JsonObject _buf) { @@ -62,6 +63,10 @@ public final class TbGMap extends AbstractBean { * 地图2(后) 偏移量Y */ public final int map3OffsetY; + /** + * 地图缩放 + */ + public final float scale; public static final int __ID__ = -2067912029; @@ -79,6 +84,7 @@ public final class TbGMap extends AbstractBean { + "(format_field_name __code_style field.name):" + map1OffsetY + "," + "(format_field_name __code_style field.name):" + map2OffsetY + "," + "(format_field_name __code_style field.name):" + map3OffsetY + "," + + "(format_field_name __code_style field.name):" + scale + "," + "}"; } } diff --git a/JisolGameServer/Main/src/main/java/cfg/TB/TbGOnHookGlobal.java b/JisolGameServer/Main/src/main/java/cfg/TB/TbGOnHookGlobal.java new file mode 100644 index 00000000..eb2f830a --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cfg/TB/TbGOnHookGlobal.java @@ -0,0 +1,55 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg.TB; + +import luban.*; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + + +public final class TbGOnHookGlobal extends AbstractBean { + public TbGOnHookGlobal(JsonObject _buf) { + id = _buf.get("id").getAsInt(); + args = _buf.get("args").getAsString(); + tig = _buf.get("tig").getAsString(); + } + + public static TbGOnHookGlobal deserialize(JsonObject _buf) { + return new cfg.TB.TbGOnHookGlobal(_buf); + } + + /** + * id + */ + public final int id; + /** + * 全局表参数 + */ + public final String args; + /** + * 描述 + */ + public final String tig; + + public static final int __ID__ = -340649858; + + @Override + public int getTypeId() { return __ID__; } + + @Override + public String toString() { + return "{ " + + "(format_field_name __code_style field.name):" + id + "," + + "(format_field_name __code_style field.name):" + args + "," + + "(format_field_name __code_style field.name):" + tig + "," + + "}"; + } +} + diff --git a/JisolGameServer/Main/src/main/java/cfg/Tables.java b/JisolGameServer/Main/src/main/java/cfg/Tables.java index 2f82636c..1e480a79 100644 --- a/JisolGameServer/Main/src/main/java/cfg/Tables.java +++ b/JisolGameServer/Main/src/main/java/cfg/Tables.java @@ -31,6 +31,8 @@ public final class Tables public cfg.TbGRoleSkill getTbGRoleSkill() { return _tbgroleskill; } private final cfg.TbGMap _tbgmap; public cfg.TbGMap getTbGMap() { return _tbgmap; } + private final cfg.TbGOnHookGlobal _tbgonhookglobal; + public cfg.TbGOnHookGlobal getTbGOnHookGlobal() { return _tbgonhookglobal; } public Tables(IJsonLoader loader) throws java.io.IOException { _tbgglobal = new cfg.TbGGlobal(loader.load("tbgglobal")); @@ -39,6 +41,7 @@ public final class Tables _tbgrolebattleres = new cfg.TbGRoleBattleRes(loader.load("tbgrolebattleres")); _tbgroleskill = new cfg.TbGRoleSkill(loader.load("tbgroleskill")); _tbgmap = new cfg.TbGMap(loader.load("tbgmap")); + _tbgonhookglobal = new cfg.TbGOnHookGlobal(loader.load("tbgonhookglobal")); } } diff --git a/JisolGameServer/Main/src/main/java/cfg/TbGOnHookGlobal.java b/JisolGameServer/Main/src/main/java/cfg/TbGOnHookGlobal.java new file mode 100644 index 00000000..efad1290 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cfg/TbGOnHookGlobal.java @@ -0,0 +1,37 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg; + +import luban.*; +import com.google.gson.JsonElement; + + +public final class TbGOnHookGlobal { + private final java.util.HashMap _dataMap; + private final java.util.ArrayList _dataList; + + public TbGOnHookGlobal(JsonElement _buf) { + _dataMap = new java.util.HashMap(); + _dataList = new java.util.ArrayList(); + + for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { + cfg.TB.TbGOnHookGlobal _v; + _v = cfg.TB.TbGOnHookGlobal.deserialize(_e_.getAsJsonObject()); + _dataList.add(_v); + _dataMap.put(_v.id, _v); + } + } + + public java.util.HashMap getDataMap() { return _dataMap; } + public java.util.ArrayList getDataList() { return _dataList; } + + public cfg.TB.TbGOnHookGlobal get(int key) { return _dataMap.get(key); } + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GActionEnum.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GActionEnum.java index 24ce5fb4..e2a4fae2 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GActionEnum.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GActionEnum.java @@ -8,4 +8,9 @@ public interface GActionEnum { int CHAT_MESSAGE = 2001; //发送聊天消息 int CHAT_RECEIVE_MESSAGE = 2002; //接受聊天消息 + /*************** 游戏模式 : 无尽模式(OnHook) **************/ + int MODE_ON_HOOK_SPAWN_PET = 3001; //生成宠物 + int MODE_ON_HOOK_CAPTURE_PET = 3002; //捕捉宠物 + int MODE_ON_HOOK_SELL_PET = 3003; //卖出宠物 + } diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/onhook/GOnHookAction.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/onhook/GOnHookAction.java new file mode 100644 index 00000000..00291b60 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/onhook/GOnHookAction.java @@ -0,0 +1,66 @@ +package cn.jisol.game.actions.onhook; + +import cfg.TB.TbGRole; +import cn.hutool.core.lang.UUID; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; +import cn.jisol.game.actions.GActionEnum; +import cn.jisol.game.data.GlobalIds; +import cn.jisol.game.data.TD; +import cn.jisol.game.network.client.GClient; +import cn.jisol.game.proto.GOnHookMessage; +import cn.jisol.ngame.actions.core.NAction; +import cn.jisol.ngame.actions.core.NActionMethod; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +//无尽模式 +@NAction +public class GOnHookAction { + + //生成的宠物列表 + public static Map> PETS = new HashMap<>(); + + //生成宠物 返回生成好的列表 + @NActionMethod(GActionEnum.MODE_ON_HOOK_SPAWN_PET) + public static GOnHookMessage.GOnHookPets onSpawnPet(GClient client){ + + //获取玩家生成的宠物 + Map pets = PETS.get(client.player.getPlayerId()); + + //如果没有则生成类 + if(Objects.isNull(pets)){ + PETS.put(client.player.getPlayerId(),pets = new HashMap<>()); + } + + //获取可生成的最大数量 + int max = Integer.parseInt(TD.DATA.getTbGOnHookGlobal().get(GlobalIds.MODE_ON_HOOK_SPAWN_NUM).args); + + //获取配置表全部宠物 + ArrayList tdPets = TD.DATA.getTbGRole().getDataList(); + + //如果小于最大数量则生成 + while (pets.size() < max){ + + //目前随机生成宠物 + GOnHookMessage.GOnHookPet hookPet = GOnHookMessage.GOnHookPet.newBuilder() + //生成唯一Id + .setKey(RandomUtil.randomString(8)) + //随机取配置表宠物中的宠物 + .setPetTbId(tdPets.get(RandomUtil.randomInt(0, tdPets.size() - 1)).id) + .build(); + + //添加到宠物列表中 + pets.put(hookPet.getKey(),hookPet); + + } + + //返回生成好的宠物 + return GOnHookMessage.GOnHookPets.newBuilder().addAllPets(pets.values()).build(); + } + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java new file mode 100644 index 00000000..a76c6ef9 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java @@ -0,0 +1,13 @@ +package cn.jisol.game.controller.game.mode; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.*; + +@Api(value = "JNGameDemo - API", tags = {"无尽模式 - API"}) +@RestController +@RequestMapping("/game/mode/onhook") +@ResponseBody +public class GOnHookController { + + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalIds.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalIds.java index 045eb53d..1f053615 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalIds.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalIds.java @@ -5,4 +5,8 @@ public interface GlobalIds { //选择宠物配置表Id int SELECT_PET_ID = 70001; + + //OnHook模式 宠物生成数量 + int MODE_ON_HOOK_SPAWN_NUM = 80001; + } diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/network/WebSocket.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/network/WebSocket.java index 834fe100..25514302 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/network/WebSocket.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/network/WebSocket.java @@ -55,7 +55,7 @@ public class WebSocket { @OnMessage public void onMessage(Session session, InputStream inputStream){ GClient client = CLIENTS.get(session.getId()); - JNetwork.onMessage(inputStream,client,CLIENTS,client.user,client.player); + JNetwork.onMessage(inputStream,client,client,CLIENTS,client.user,client.player); } @OnClose diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/network/client/GClient.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/network/client/GClient.java index 67457008..fb26952a 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/network/client/GClient.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/network/client/GClient.java @@ -13,8 +13,10 @@ public class GClient extends QueueNClient { public Session session; + //账号 public User user; + //游戏玩家 public Player player; public GClient(String token,Session session){ diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GOnHookMessage.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GOnHookMessage.java new file mode 100644 index 00000000..fa17f147 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GOnHookMessage.java @@ -0,0 +1,1679 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GOnHookMessage.proto + +package cn.jisol.game.proto; + +public final class GOnHookMessage { + private GOnHookMessage() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface GOnHookPetOrBuilder extends + // @@protoc_insertion_point(interface_extends:GOnHookPet) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     *生成宠物的key
+     * 
+ * + * string key = 1; + * @return The key. + */ + String getKey(); + /** + *
+     *生成宠物的key
+     * 
+ * + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + *
+     *生成宠物的配置表Id
+     * 
+ * + * int32 petTbId = 2; + * @return The petTbId. + */ + int getPetTbId(); + } + /** + *
+   *生成宠物类
+   * 
+ * + * Protobuf type {@code GOnHookPet} + */ + public static final class GOnHookPet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:GOnHookPet) + GOnHookPetOrBuilder { + private static final long serialVersionUID = 0L; + // Use GOnHookPet.newBuilder() to construct. + private GOnHookPet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GOnHookPet() { + key_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new GOnHookPet(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GOnHookPet( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 16: { + + petTbId_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return GOnHookMessage.internal_static_GOnHookPet_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return GOnHookMessage.internal_static_GOnHookPet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + GOnHookMessage.GOnHookPet.class, GOnHookMessage.GOnHookPet.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile Object key_; + /** + *
+     *生成宠物的key
+     * 
+ * + * string key = 1; + * @return The key. + */ + @Override + public String getKey() { + Object ref = key_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + *
+     *生成宠物的key
+     * 
+ * + * string key = 1; + * @return The bytes for key. + */ + @Override + public com.google.protobuf.ByteString + getKeyBytes() { + Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PETTBID_FIELD_NUMBER = 2; + private int petTbId_; + /** + *
+     *生成宠物的配置表Id
+     * 
+ * + * int32 petTbId = 2; + * @return The petTbId. + */ + @Override + public int getPetTbId() { + return petTbId_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (petTbId_ != 0) { + output.writeInt32(2, petTbId_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (petTbId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, petTbId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof GOnHookMessage.GOnHookPet)) { + return super.equals(obj); + } + GOnHookMessage.GOnHookPet other = (GOnHookMessage.GOnHookPet) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (getPetTbId() + != other.getPetTbId()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + PETTBID_FIELD_NUMBER; + hash = (53 * hash) + getPetTbId(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static GOnHookMessage.GOnHookPet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GOnHookMessage.GOnHookPet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GOnHookMessage.GOnHookPet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GOnHookMessage.GOnHookPet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GOnHookMessage.GOnHookPet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GOnHookMessage.GOnHookPet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GOnHookMessage.GOnHookPet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static GOnHookMessage.GOnHookPet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static GOnHookMessage.GOnHookPet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static GOnHookMessage.GOnHookPet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static GOnHookMessage.GOnHookPet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static GOnHookMessage.GOnHookPet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GOnHookMessage.GOnHookPet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     *生成宠物类
+     * 
+ * + * Protobuf type {@code GOnHookPet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:GOnHookPet) + GOnHookMessage.GOnHookPetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return GOnHookMessage.internal_static_GOnHookPet_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return GOnHookMessage.internal_static_GOnHookPet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + GOnHookMessage.GOnHookPet.class, GOnHookMessage.GOnHookPet.Builder.class); + } + + // Construct using cn.jisol.ngame.proto.GOnHookMessage.GOnHookPet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + key_ = ""; + + petTbId_ = 0; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return GOnHookMessage.internal_static_GOnHookPet_descriptor; + } + + @Override + public GOnHookMessage.GOnHookPet getDefaultInstanceForType() { + return GOnHookMessage.GOnHookPet.getDefaultInstance(); + } + + @Override + public GOnHookMessage.GOnHookPet build() { + GOnHookMessage.GOnHookPet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public GOnHookMessage.GOnHookPet buildPartial() { + GOnHookMessage.GOnHookPet result = new GOnHookMessage.GOnHookPet(this); + result.key_ = key_; + result.petTbId_ = petTbId_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof GOnHookMessage.GOnHookPet) { + return mergeFrom((GOnHookMessage.GOnHookPet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(GOnHookMessage.GOnHookPet other) { + if (other == GOnHookMessage.GOnHookPet.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getPetTbId() != 0) { + setPetTbId(other.getPetTbId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + GOnHookMessage.GOnHookPet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (GOnHookMessage.GOnHookPet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private Object key_ = ""; + /** + *
+       *生成宠物的key
+       * 
+ * + * string key = 1; + * @return The key. + */ + public String getKey() { + Object ref = key_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (String) ref; + } + } + /** + *
+       *生成宠物的key
+       * 
+ * + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       *生成宠物的key
+       * 
+ * + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + *
+       *生成宠物的key
+       * 
+ * + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + *
+       *生成宠物的key
+       * 
+ * + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private int petTbId_ ; + /** + *
+       *生成宠物的配置表Id
+       * 
+ * + * int32 petTbId = 2; + * @return The petTbId. + */ + @Override + public int getPetTbId() { + return petTbId_; + } + /** + *
+       *生成宠物的配置表Id
+       * 
+ * + * int32 petTbId = 2; + * @param value The petTbId to set. + * @return This builder for chaining. + */ + public Builder setPetTbId(int value) { + + petTbId_ = value; + onChanged(); + return this; + } + /** + *
+       *生成宠物的配置表Id
+       * 
+ * + * int32 petTbId = 2; + * @return This builder for chaining. + */ + public Builder clearPetTbId() { + + petTbId_ = 0; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:GOnHookPet) + } + + // @@protoc_insertion_point(class_scope:GOnHookPet) + private static final GOnHookMessage.GOnHookPet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GOnHookMessage.GOnHookPet(); + } + + public static GOnHookMessage.GOnHookPet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public GOnHookPet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GOnHookPet(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public GOnHookMessage.GOnHookPet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GOnHookPetsOrBuilder extends + // @@protoc_insertion_point(interface_extends:GOnHookPets) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + java.util.List + getPetsList(); + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + GOnHookMessage.GOnHookPet getPets(int index); + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + int getPetsCount(); + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + java.util.List + getPetsOrBuilderList(); + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + GOnHookMessage.GOnHookPetOrBuilder getPetsOrBuilder( + int index); + } + /** + *
+   *生成的宠物类列表
+   * 
+ * + * Protobuf type {@code GOnHookPets} + */ + public static final class GOnHookPets extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:GOnHookPets) + GOnHookPetsOrBuilder { + private static final long serialVersionUID = 0L; + // Use GOnHookPets.newBuilder() to construct. + private GOnHookPets(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GOnHookPets() { + pets_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new GOnHookPets(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GOnHookPets( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + pets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + pets_.add( + input.readMessage(GOnHookMessage.GOnHookPet.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + pets_ = java.util.Collections.unmodifiableList(pets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return GOnHookMessage.internal_static_GOnHookPets_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return GOnHookMessage.internal_static_GOnHookPets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + GOnHookMessage.GOnHookPets.class, GOnHookMessage.GOnHookPets.Builder.class); + } + + public static final int PETS_FIELD_NUMBER = 1; + private java.util.List pets_; + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + @Override + public java.util.List getPetsList() { + return pets_; + } + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + @Override + public java.util.List + getPetsOrBuilderList() { + return pets_; + } + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + @Override + public int getPetsCount() { + return pets_.size(); + } + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + @Override + public GOnHookMessage.GOnHookPet getPets(int index) { + return pets_.get(index); + } + /** + *
+     *宠物列表
+     * 
+ * + * repeated .GOnHookPet pets = 1; + */ + @Override + public GOnHookMessage.GOnHookPetOrBuilder getPetsOrBuilder( + int index) { + return pets_.get(index); + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < pets_.size(); i++) { + output.writeMessage(1, pets_.get(i)); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < pets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, pets_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof GOnHookMessage.GOnHookPets)) { + return super.equals(obj); + } + GOnHookMessage.GOnHookPets other = (GOnHookMessage.GOnHookPets) obj; + + if (!getPetsList() + .equals(other.getPetsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPetsCount() > 0) { + hash = (37 * hash) + PETS_FIELD_NUMBER; + hash = (53 * hash) + getPetsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static GOnHookMessage.GOnHookPets parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GOnHookMessage.GOnHookPets parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GOnHookMessage.GOnHookPets parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GOnHookMessage.GOnHookPets parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GOnHookMessage.GOnHookPets parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GOnHookMessage.GOnHookPets parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GOnHookMessage.GOnHookPets parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static GOnHookMessage.GOnHookPets parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static GOnHookMessage.GOnHookPets parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static GOnHookMessage.GOnHookPets parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static GOnHookMessage.GOnHookPets parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static GOnHookMessage.GOnHookPets parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GOnHookMessage.GOnHookPets prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     *生成的宠物类列表
+     * 
+ * + * Protobuf type {@code GOnHookPets} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:GOnHookPets) + GOnHookMessage.GOnHookPetsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return GOnHookMessage.internal_static_GOnHookPets_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return GOnHookMessage.internal_static_GOnHookPets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + GOnHookMessage.GOnHookPets.class, GOnHookMessage.GOnHookPets.Builder.class); + } + + // Construct using cn.jisol.ngame.proto.GOnHookMessage.GOnHookPets.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPetsFieldBuilder(); + } + } + @Override + public Builder clear() { + super.clear(); + if (petsBuilder_ == null) { + pets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + petsBuilder_.clear(); + } + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return GOnHookMessage.internal_static_GOnHookPets_descriptor; + } + + @Override + public GOnHookMessage.GOnHookPets getDefaultInstanceForType() { + return GOnHookMessage.GOnHookPets.getDefaultInstance(); + } + + @Override + public GOnHookMessage.GOnHookPets build() { + GOnHookMessage.GOnHookPets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public GOnHookMessage.GOnHookPets buildPartial() { + GOnHookMessage.GOnHookPets result = new GOnHookMessage.GOnHookPets(this); + int from_bitField0_ = bitField0_; + if (petsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + pets_ = java.util.Collections.unmodifiableList(pets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.pets_ = pets_; + } else { + result.pets_ = petsBuilder_.build(); + } + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof GOnHookMessage.GOnHookPets) { + return mergeFrom((GOnHookMessage.GOnHookPets)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(GOnHookMessage.GOnHookPets other) { + if (other == GOnHookMessage.GOnHookPets.getDefaultInstance()) return this; + if (petsBuilder_ == null) { + if (!other.pets_.isEmpty()) { + if (pets_.isEmpty()) { + pets_ = other.pets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePetsIsMutable(); + pets_.addAll(other.pets_); + } + onChanged(); + } + } else { + if (!other.pets_.isEmpty()) { + if (petsBuilder_.isEmpty()) { + petsBuilder_.dispose(); + petsBuilder_ = null; + pets_ = other.pets_; + bitField0_ = (bitField0_ & ~0x00000001); + petsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPetsFieldBuilder() : null; + } else { + petsBuilder_.addAllMessages(other.pets_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + GOnHookMessage.GOnHookPets parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (GOnHookMessage.GOnHookPets) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List pets_ = + java.util.Collections.emptyList(); + private void ensurePetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + pets_ = new java.util.ArrayList(pets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + GOnHookPet, GOnHookPet.Builder, GOnHookPetOrBuilder> petsBuilder_; + + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public java.util.List getPetsList() { + if (petsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pets_); + } else { + return petsBuilder_.getMessageList(); + } + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public int getPetsCount() { + if (petsBuilder_ == null) { + return pets_.size(); + } else { + return petsBuilder_.getCount(); + } + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public GOnHookMessage.GOnHookPet getPets(int index) { + if (petsBuilder_ == null) { + return pets_.get(index); + } else { + return petsBuilder_.getMessage(index); + } + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder setPets( + int index, GOnHookMessage.GOnHookPet value) { + if (petsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePetsIsMutable(); + pets_.set(index, value); + onChanged(); + } else { + petsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder setPets( + int index, GOnHookMessage.GOnHookPet.Builder builderForValue) { + if (petsBuilder_ == null) { + ensurePetsIsMutable(); + pets_.set(index, builderForValue.build()); + onChanged(); + } else { + petsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder addPets(GOnHookMessage.GOnHookPet value) { + if (petsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePetsIsMutable(); + pets_.add(value); + onChanged(); + } else { + petsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder addPets( + int index, GOnHookMessage.GOnHookPet value) { + if (petsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePetsIsMutable(); + pets_.add(index, value); + onChanged(); + } else { + petsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder addPets( + GOnHookMessage.GOnHookPet.Builder builderForValue) { + if (petsBuilder_ == null) { + ensurePetsIsMutable(); + pets_.add(builderForValue.build()); + onChanged(); + } else { + petsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder addPets( + int index, GOnHookMessage.GOnHookPet.Builder builderForValue) { + if (petsBuilder_ == null) { + ensurePetsIsMutable(); + pets_.add(index, builderForValue.build()); + onChanged(); + } else { + petsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder addAllPets( + Iterable values) { + if (petsBuilder_ == null) { + ensurePetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, pets_); + onChanged(); + } else { + petsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder clearPets() { + if (petsBuilder_ == null) { + pets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + petsBuilder_.clear(); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public Builder removePets(int index) { + if (petsBuilder_ == null) { + ensurePetsIsMutable(); + pets_.remove(index); + onChanged(); + } else { + petsBuilder_.remove(index); + } + return this; + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public GOnHookMessage.GOnHookPet.Builder getPetsBuilder( + int index) { + return getPetsFieldBuilder().getBuilder(index); + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public GOnHookMessage.GOnHookPetOrBuilder getPetsOrBuilder( + int index) { + if (petsBuilder_ == null) { + return pets_.get(index); } else { + return petsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public java.util.List + getPetsOrBuilderList() { + if (petsBuilder_ != null) { + return petsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pets_); + } + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public GOnHookMessage.GOnHookPet.Builder addPetsBuilder() { + return getPetsFieldBuilder().addBuilder( + GOnHookMessage.GOnHookPet.getDefaultInstance()); + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public GOnHookMessage.GOnHookPet.Builder addPetsBuilder( + int index) { + return getPetsFieldBuilder().addBuilder( + index, GOnHookMessage.GOnHookPet.getDefaultInstance()); + } + /** + *
+       *宠物列表
+       * 
+ * + * repeated .GOnHookPet pets = 1; + */ + public java.util.List + getPetsBuilderList() { + return getPetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + GOnHookPet, GOnHookPet.Builder, GOnHookPetOrBuilder> + getPetsFieldBuilder() { + if (petsBuilder_ == null) { + petsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + GOnHookPet, GOnHookPet.Builder, GOnHookPetOrBuilder>( + pets_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + pets_ = null; + } + return petsBuilder_; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:GOnHookPets) + } + + // @@protoc_insertion_point(class_scope:GOnHookPets) + private static final GOnHookMessage.GOnHookPets DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GOnHookMessage.GOnHookPets(); + } + + public static GOnHookMessage.GOnHookPets getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public GOnHookPets parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GOnHookPets(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public GOnHookMessage.GOnHookPets getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GOnHookPet_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_GOnHookPet_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GOnHookPets_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_GOnHookPets_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\024GOnHookMessage.proto\"*\n\nGOnHookPet\022\013\n\003" + + "key\030\001 \001(\t\022\017\n\007petTbId\030\002 \001(\005\"(\n\013GOnHookPet" + + "s\022\031\n\004pets\030\001 \003(\0132\013.GOnHookPetB\026\n\024cn.jisol" + + ".ngame.protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_GOnHookPet_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_GOnHookPet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_GOnHookPet_descriptor, + new String[] { "Key", "PetTbId", }); + internal_static_GOnHookPets_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_GOnHookPets_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_GOnHookPets_descriptor, + new String[] { "Pets", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GOnHookMessage.proto b/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GOnHookMessage.proto new file mode 100644 index 00000000..5f972cda --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GOnHookMessage.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +option java_package = "cn.jisol.ngame.proto"; + +//生成宠物类 +message GOnHookPet { + string key = 1; //生成宠物的key + int32 petTbId = 2; //生成宠物的配置表Id +} + +//生成的宠物类列表 +message GOnHookPets { + repeated GOnHookPet pets = 1; //宠物列表 +} diff --git a/JisolGameServer/Main/src/main/resources/json/tbgmap.json b/JisolGameServer/Main/src/main/resources/json/tbgmap.json index bc23d3ff..3caec599 100644 --- a/JisolGameServer/Main/src/main/resources/json/tbgmap.json +++ b/JisolGameServer/Main/src/main/resources/json/tbgmap.json @@ -5,8 +5,9 @@ "map1": "map/MAP6/MAP6_1/spriteFrame", "map2": "map/MAP6/MAP6_2/spriteFrame", "map3": "map/MAP6/MAP6_3/spriteFrame", - "map1OffsetY": 100, - "map2OffsetY": 400, - "map3OffsetY": 400 + "map1OffsetY": 80, + "map2OffsetY": 520, + "map3OffsetY": 520, + "scale": 1.5 } ] \ No newline at end of file diff --git a/JisolGameServer/Main/src/main/resources/json/tbgonhookglobal.json b/JisolGameServer/Main/src/main/resources/json/tbgonhookglobal.json new file mode 100644 index 00000000..c85d7765 --- /dev/null +++ b/JisolGameServer/Main/src/main/resources/json/tbgonhookglobal.json @@ -0,0 +1,7 @@ +[ + { + "id": 80001, + "args": "100", + "tig": "预先生成的野外宠物数量" + } +] \ No newline at end of file